Skip to content

Instantly share code, notes, and snippets.

@jacobly0
Last active February 15, 2017 17:30
Show Gist options
  • Select an option

  • Save jacobly0/f246e7b088868975f0b57be63873ee00 to your computer and use it in GitHub Desktop.

Select an option

Save jacobly0/f246e7b088868975f0b57be63873ee00 to your computer and use it in GitHub Desktop.
AoCE Display Optimizations
;out off, size
;320* 0-0*2, 2
;320* 1-1*2, 6
;320* 2-2*2, 10
;320* 3-3*2, 14
;320* 4-4*2, 18
;320* 5-5*2, 22
;320* 6-6*2, 26
;320* 7-7*2, 30
;320* 8- 15, 32
;320* 9-7*2, 30
;320*10-6*2, 26
;320*11-5*2, 22
;320*12-4*2, 18
;320*13-3*2, 14
;320*14-2*2, 10
;320*15-1*2, 6
;320*16-0*2, 2
; Input:
; de = output position
; hl = tile
; Output:
; de = next output position
; sp = lcdWidth+2
DisplayRow:
ld a,9
DisplayTile:
ld sp, lcdWidth-2
ld bc,2
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 6
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 10
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 14
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 18
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 22
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 26
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 30
ldir
inc sp; lcdWidth-1
ex de, hl
add hl, sp
ex de, hl
ld c, 32
ldir
inc sp; lcdWidth
inc sp; lcdWidth+1
ex de, hl
add hl, sp
ex de, hl
ld c, 30
ldir
inc sp; lcdWidth+2
ex de, hl
add hl, sp
ex de, hl
ld c, 26
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 22
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 18
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 14
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 10
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 6
ldir
ex de, hl
add hl, sp
ex de, hl
ld c, 2
ldir
ld hl,32-lcdWidth*15-2
add hl,de
ex de,hl
dec a
jr nz,DisplayTile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment