mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
No more S_
This commit is contained in:
parent
5facf8377a
commit
8026d47585
7 changed files with 34 additions and 34 deletions
22
home/pic.asm
22
home/pic.asm
|
|
@ -19,7 +19,7 @@ UncompressSpriteData:: ; 24fd (0:24fd)
|
|||
|
||||
; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop
|
||||
_UncompressSpriteData:: ; 251a (0:251a)
|
||||
ld hl, S_SPRITEBUFFER1
|
||||
ld hl, sSpriteBuffer1
|
||||
ld c, (2*SPRITEBUFFERSIZE) % $100
|
||||
ld b, (2*SPRITEBUFFERSIZE) / $100
|
||||
xor a
|
||||
|
|
@ -48,19 +48,19 @@ _UncompressSpriteData:: ; 251a (0:251a)
|
|||
ld [wSpriteWidth], a
|
||||
call ReadNextInputBit
|
||||
ld [wSpriteLoadFlags], a ; initialite bit1 to 0 and bit0 to the first input bit
|
||||
; this will load two chunks of data to S_SPRITEBUFFER1 and S_SPRITEBUFFER2
|
||||
; this will load two chunks of data to sSpriteBuffer1 and sSpriteBuffer2
|
||||
; bit 0 decides in which one the first chunk is placed
|
||||
; fall through
|
||||
|
||||
; uncompresses a chunk from the sprite input data stream (pointed to at wd0da) into S_SPRITEBUFFER1 or S_SPRITEBUFFER2
|
||||
; uncompresses a chunk from the sprite input data stream (pointed to at wd0da) into sSpriteBuffer1 or sSpriteBuffer2
|
||||
; each chunk is a 1bpp sprite. A 2bpp sprite consist of two chunks which are merged afterwards
|
||||
; note that this is an endless loop which is terminated during a call to MoveToNextBufferPosition by manipulating the stack
|
||||
UncompressSpriteDataLoop:: ; 2556 (0:2556)
|
||||
ld hl, S_SPRITEBUFFER1
|
||||
ld hl, sSpriteBuffer1
|
||||
ld a, [wSpriteLoadFlags]
|
||||
bit 0, a
|
||||
jr z, .useSpriteBuffer1 ; check which buffer to use
|
||||
ld hl, S_SPRITEBUFFER2
|
||||
ld hl, sSpriteBuffer2
|
||||
.useSpriteBuffer1
|
||||
call StoreSpriteOutputPointer
|
||||
ld a, [wSpriteLoadFlags]
|
||||
|
|
@ -290,9 +290,9 @@ UnpackSprite:: ; 26bf (0:26bf)
|
|||
jp z, UnpackSpriteMode2
|
||||
and a
|
||||
jp nz, XorSpriteChunks
|
||||
ld hl, S_SPRITEBUFFER1
|
||||
ld hl, sSpriteBuffer1
|
||||
call SpriteDifferentialDecode
|
||||
ld hl, S_SPRITEBUFFER2
|
||||
ld hl, sSpriteBuffer2
|
||||
; fall through
|
||||
|
||||
; decodes differential encoded sprite data
|
||||
|
|
@ -542,12 +542,12 @@ ResetSpriteBufferPointers:: ; 2841 (0:2841)
|
|||
ld a, [wSpriteLoadFlags]
|
||||
bit 0, a
|
||||
jr nz, .buffer2Selected
|
||||
ld de, S_SPRITEBUFFER1
|
||||
ld hl, S_SPRITEBUFFER2
|
||||
ld de, sSpriteBuffer1
|
||||
ld hl, sSpriteBuffer2
|
||||
jr .storeBufferPointers
|
||||
.buffer2Selected
|
||||
ld de, S_SPRITEBUFFER2
|
||||
ld hl, S_SPRITEBUFFER1
|
||||
ld de, sSpriteBuffer2
|
||||
ld hl, sSpriteBuffer1
|
||||
.storeBufferPointers
|
||||
ld a, l
|
||||
ld [wSpriteOutputPtr], a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue