PT_ isn't using convhex correctly, just wanted to throw that out there. *runs away*
Have spasm output a .bin, and *then* compress.
Have spasm output a .bin, and *then* compress.
DrawField:
scf
sbc hl, hl
ld (hl), 2
; Speed: 722161/721349/711751 cycles
ld hl, -3
jp mpShaData
DrawFieldStart:
add hl, sp
ld (TempSP2 - AoCEDisplayIsoTile + cursorImage), hl
ld hl, (currDrawingBuffer)
ld de, 15
add hl, de
ld (startingPosition - DrawFieldStart + mpShaData), hl
ld de, 8*320
ld b, 29
DisplayEachRowLoop:
bit 0, b
exx
startingPosition = $+2
ld iy, 0
ld a, 10
jr nz, DisplayRowOfTilesLoop
dec a
lea iy, iy+16
DisplayRowOfTilesLoop:
ld hl, _tile_test \.r2
call cursorImage
lea iy, iy+32
dec a
jr nz, DisplayRowOfTilesLoop
exx
add hl, de
ld (startingPosition - DrawFieldStart + mpShaData), hl
djnz DisplayEachRowLoop
ret
DrawFieldEnd:
.echo DrawFieldEnd-DrawFieldStart
AoCEDisplayIsoTile:
; Thanks a lot to TheMachine02 and grosged for help and optimizations!
; Input:
; IY = pointer to output
; HL = pointer to iso sprite
;
; Bytes: 168 bytes
; Time: 2558 cycles
lea de, iy
ld ix, 0
lea bc, ix+2
add ix, de
ld sp, 320
ldir
add ix, sp
lea de, ix-2
ld c, 6
ldir
add ix, sp
lea de, ix-4
ld c, 10
ldir
add ix, sp
lea de, ix-6
ld c, 14
ldir
add ix, sp
lea de, ix-8
ld c, 18
ldir
add ix, sp
lea de, ix-10
ld c, 22
ldir
add ix, sp
lea de, ix-12
ld c, 26
ldir
add ix, sp
lea de, ix-14
ld c, 30
ldir
add ix, sp
lea de, ix-15
ld c, 32
ldir
add ix, sp
lea de, ix-14
ld c, 30
ldir
add ix, sp
lea de, ix-12
ld c, 26
ldir
add ix, sp
lea de, ix-10
ld c, 22
ldir
add ix, sp
lea de, ix-8
ld c, 18
ldir
add ix, sp
lea de, ix-6
ld c, 14
ldir
add ix, sp
lea de, ix-4
ld c, 10
ldir
add ix, sp
lea de, ix-2
ld c, 6
ldir
add ix, sp
lea de, ix
ldi
ldi
TempSP2 = $+1
ld sp, 0
ret
AoCEDisplayIsoTileEnd:
DrawField:
scf
sbc hl, hl
ld (hl), 2
; Speed: 722161/721349/711751 cycles
ld hl, -3
jp mpShaData
DrawFieldStart:
add hl, sp
ld (TempSP2 - AoCEDisplayIsoTile + cursorImage), hl
ld hl, (currDrawingBuffer)
ld de, 15
add hl, de
ld (startingPosition - DrawFieldStart + mpShaData), hl
ld de, 8*320
ld b, 29
DisplayEachRowLoop:
bit 0, b
exx
startingPosition = $+2
ld iy, 0
ld a, 10
jr nz, DisplayRowOfTilesLoop
dec a
lea iy, iy+16
DisplayRowOfTilesLoop:
ld hl, _tile_test \.r2
call cursorImage
lea iy, iy+32
dec a
jr nz, DisplayRowOfTilesLoop
exx
add hl, de
ld (startingPosition - DrawFieldStart + mpShaData), hl
djnz DisplayEachRowLoop
ret
DrawFieldEnd:
.echo DrawFieldEnd-DrawFieldStart
AoCEDisplayIsoTile:
; Thanks a lot to TheMachine02 and grosged for help and optimizations!
; Input:
; IY = pointer to output
; HL = pointer to iso sprite
;
; Bytes: 168 bytes
; Time: 2558 cycles
lea de, iy
ld ix, 0
lea bc, ix+2
add ix, de
ld sp, 320
ldir
add ix, sp
lea de, ix-2
ld c, 6
ldir
add ix, sp
lea de, ix-4
ld c, 10
ldir
add ix, sp
lea de, ix-6
ld c, 14
ldir
add ix, sp
lea de, ix-8
ld c, 18
ldir
add ix, sp
lea de, ix-10
ld c, 22
ldir
add ix, sp
lea de, ix-12
ld c, 26
ldir
add ix, sp
lea de, ix-14
ld c, 30
ldir
add ix, sp
lea de, ix-15
ld c, 32
ldir
add ix, sp
lea de, ix-14
ld c, 30
ldir
add ix, sp
lea de, ix-12
ld c, 26
ldir
add ix, sp
lea de, ix-10
ld c, 22
ldir
add ix, sp
lea de, ix-8
ld c, 18
ldir
add ix, sp
lea de, ix-6
ld c, 14
ldir
add ix, sp
lea de, ix-4
ld c, 10
ldir
add ix, sp
lea de, ix-2
ld c, 6
ldir
add ix, sp
lea de, ix
ldi
ldi
TempSP2 = $+1
ld sp, 0
ret
AoCEDisplayIsoTileEnd:
ld hl, (currDrawingBuffer)
ld de, 15
add hl, de
Can be replaced with:
ld iy, (currDrawingBuffer)
lea hl, iy+15
Saves 1 byte, and 4 cycles.
Advertisement