No more S_

This commit is contained in:
dannye 2015-08-30 22:15:32 -05:00
parent 5facf8377a
commit 8026d47585
7 changed files with 34 additions and 34 deletions

View file

@ -6457,7 +6457,7 @@ LoadPlayerBackPic: ; 3ec92 (f:6c92)
xor a
ld [$4000], a
ld hl, vSprites
ld de, S_SPRITEBUFFER1
ld de, sSpriteBuffer1
ld a, [H_LOADEDROMBANK]
ld b, a
ld c, 7 * 7

View file

@ -2,12 +2,12 @@
; assumes that input sprite chunks are 4x4 tiles, and the rightmost and bottommost 4 pixels will be ignored
; resulting in a 7*7 tile output sprite chunk
ScaleSpriteByTwo: ; 2fe40 (b:7e40)
ld de, S_SPRITEBUFFER1 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
ld hl, S_SPRITEBUFFER0 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
ld de, sSpriteBuffer1 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
ld hl, sSpriteBuffer0 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
call ScaleLastSpriteColumnByTwo ; last tile column is special case
call ScaleFirstThreeSpriteColumnsByTwo ; scale first 3 tile columns
ld de, S_SPRITEBUFFER2 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
ld hl, S_SPRITEBUFFER1 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
ld de, sSpriteBuffer2 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
ld hl, sSpriteBuffer1 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
call ScaleLastSpriteColumnByTwo ; last tile column is special case
ScaleFirstThreeSpriteColumnsByTwo: ; 2fe55 (b:7e55)

View file

@ -186,8 +186,8 @@ HoFLoadPlayerPics: ; 7033e (1c:433e)
ld de, RedPicFront
ld a, BANK(RedPicFront)
call UncompressSpriteFromDE
ld hl, S_SPRITEBUFFER1
ld de, S_SPRITEBUFFER0
ld hl, sSpriteBuffer1
ld de, sSpriteBuffer0
ld bc, $310
call CopyData
ld de, vFrontPic

View file

@ -215,8 +215,8 @@ IntroDisplayPicCenteredOrUpperRight: ; 62a4 (1:62a4)
push bc
ld a,b
call UncompressSpriteFromDE
ld hl,S_SPRITEBUFFER1
ld de,S_SPRITEBUFFER0
ld hl,sSpriteBuffer1
ld de,sSpriteBuffer0
ld bc,$310
call CopyData
ld de,vFrontPic

View file

@ -810,15 +810,15 @@ LoadUncompressedSpriteData:: ; 1672 (0:1672)
ld [H_SPRITEOFFSET], a
xor a
ld [$4000], a
ld hl, S_SPRITEBUFFER0
ld hl, sSpriteBuffer0
call ZeroSpriteBuffer ; zero buffer 0
ld de, S_SPRITEBUFFER1
ld hl, S_SPRITEBUFFER0
ld de, sSpriteBuffer1
ld hl, sSpriteBuffer0
call AlignSpriteDataCentered ; copy and align buffer 1 to 0 (containing the MSB of the 2bpp sprite)
ld hl, S_SPRITEBUFFER1
ld hl, sSpriteBuffer1
call ZeroSpriteBuffer ; zero buffer 1
ld de, S_SPRITEBUFFER2
ld hl, S_SPRITEBUFFER1
ld de, sSpriteBuffer2
ld hl, sSpriteBuffer1
call AlignSpriteDataCentered ; copy and align buffer 2 to 1 (containing the LSB of the 2bpp sprite)
pop de
jp InterlaceMergeSpriteBuffers
@ -869,9 +869,9 @@ InterlaceMergeSpriteBuffers:: ; 16ea (0:16ea)
xor a
ld [$4000], a
push de
ld hl, S_SPRITEBUFFER2 + (SPRITEBUFFERSIZE - 1) ; destination: end of buffer 2
ld de, S_SPRITEBUFFER1 + (SPRITEBUFFERSIZE - 1) ; source 2: end of buffer 1
ld bc, S_SPRITEBUFFER0 + (SPRITEBUFFERSIZE - 1) ; source 1: end of buffer 0
ld hl, sSpriteBuffer2 + (SPRITEBUFFERSIZE - 1) ; destination: end of buffer 2
ld de, sSpriteBuffer1 + (SPRITEBUFFERSIZE - 1) ; source 2: end of buffer 1
ld bc, sSpriteBuffer0 + (SPRITEBUFFERSIZE - 1) ; source 1: end of buffer 0
ld a, SPRITEBUFFERSIZE/2 ; $c4
ld [H_SPRITEINTERLACECOUNTER], a
.interlaceLoop
@ -895,7 +895,7 @@ InterlaceMergeSpriteBuffers:: ; 16ea (0:16ea)
and a
jr z, .notFlipped
ld bc, 2*SPRITEBUFFERSIZE
ld hl, S_SPRITEBUFFER1
ld hl, sSpriteBuffer1
.swapLoop
swap [hl] ; if flipped swap nybbles in all bytes
inc hl
@ -905,7 +905,7 @@ InterlaceMergeSpriteBuffers:: ; 16ea (0:16ea)
jr nz, .swapLoop
.notFlipped
pop hl
ld de, S_SPRITEBUFFER1
ld de, sSpriteBuffer1
ld c, (2*SPRITEBUFFERSIZE)/16 ; $31, number of 16 byte chunks to be copied
ld a, [H_LOADEDROMBANK]
ld b, a

View file

@ -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

View file

@ -1,8 +1,8 @@
SECTION "Sprite Buffers", SRAM, BANK[0]
S_SPRITEBUFFER0:: ds SPRITEBUFFERSIZE ; a000
S_SPRITEBUFFER1:: ds SPRITEBUFFERSIZE ; a188
S_SPRITEBUFFER2:: ds SPRITEBUFFERSIZE ; a310
sSpriteBuffer0:: ds SPRITEBUFFERSIZE ; a000
sSpriteBuffer1:: ds SPRITEBUFFERSIZE ; a188
sSpriteBuffer2:: ds SPRITEBUFFERSIZE ; a310
ds $100