summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorpikalaxalt <PikalaxALT@gmail.com>2016-06-11 20:37:15 -0400
committerpikalaxalt <PikalaxALT@gmail.com>2016-06-11 20:37:15 -0400
commitf5983c0f813d3d908b6016db3ed866e4ca9437dc (patch)
treed6888723f443557ce45c9a00d873caa5e7a8930e /home
parent041c4f28a3c35e31329222769534942439b70f29 (diff)
parent401d6e7f36e86aa246a2c0591195e1f0f01e879f (diff)
Merge branch 'master' of github.com:pret/pokeyellow
Diffstat (limited to 'home')
-rw-r--r--home/overworld.asm54
-rw-r--r--home/pic.asm228
-rw-r--r--home/play_time.asm18
3 files changed, 150 insertions, 150 deletions
diff --git a/home/overworld.asm b/home/overworld.asm
index d8f91e79..484e19c3 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -34,7 +34,7 @@ EnterMap:: ; 01d7 (0:01d7)
ld hl, wd72d
res 5, [hl]
call UpdateSprites
- ld hl, wd126
+ ld hl, wCurrentMapScriptFlags
set 5, [hl]
set 6, [hl]
xor a
@@ -279,7 +279,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245)
res 6, [hl]
ld hl, wFlags_D733
res 3, [hl]
- ld hl, wd126
+ ld hl, wCurrentMapScriptFlags
set 5, [hl]
set 6, [hl]
xor a
@@ -531,7 +531,7 @@ CheckMapConnections:: ; 05db (0:05db)
ld a, [wXCoord]
cp $ff
jr nz, .checkEastMap
- ld a, [W_MAPCONN3PTR]
+ ld a, [wMapConn3Ptr]
ld [wCurMap], a
ld a, [wWestConnectedMapXAlignment] ; new X coordinate upon entering west map
ld [wXCoord], a
@@ -568,7 +568,7 @@ CheckMapConnections:: ; 05db (0:05db)
ld a, [wCurrentMapWidth2] ; map width
cp b
jr nz, .checkNorthMap
- ld a, [W_MAPCONN4PTR]
+ ld a, [wMapConn4Ptr]
ld [wCurMap], a
ld a, [wEastConnectedMapXAlignment] ; new X coordinate upon entering east map
ld [wXCoord], a
@@ -604,7 +604,7 @@ CheckMapConnections:: ; 05db (0:05db)
ld a, [wYCoord]
cp $ff
jr nz, .checkSouthMap
- ld a, [W_MAPCONN1PTR]
+ ld a, [wMapConn1Ptr]
ld [wCurMap], a
ld a, [wNorthConnectedMapYAlignment] ; new Y coordinate upon entering north map
ld [wYCoord], a
@@ -632,7 +632,7 @@ CheckMapConnections:: ; 05db (0:05db)
ld a, [wCurrentMapHeight2]
cp b
jr nz, .didNotEnterConnectedMap
- ld a, [W_MAPCONN2PTR]
+ ld a, [wMapConn2Ptr]
ld [wCurMap], a
ld a, [wSouthConnectedMapYAlignment] ; new Y coordinate upon entering south map
ld [wYCoord], a
@@ -901,9 +901,9 @@ LoadTileBlockMap:: ; 083c (0:083c)
add hl, bc
ld c, MAP_BORDER
add hl, bc ; this puts us past the (west) border
- ld a, [W_MAPDATAPTR] ; tile map pointer
+ ld a, [wMapDataPtr] ; tile map pointer
ld e, a
- ld a, [W_MAPDATAPTR + 1]
+ ld a, [wMapDataPtr + 1]
ld d, a ; de = tile map pointer
ld a, [wCurMapHeight]
ld b, a
@@ -928,7 +928,7 @@ LoadTileBlockMap:: ; 083c (0:083c)
dec b
jr nz, .rowLoop
.northConnection
- ld a, [W_MAPCONN1PTR]
+ ld a, [wMapConn1Ptr]
cp $ff
jr z, .southConnection
call SwitchToMapRomBank
@@ -946,7 +946,7 @@ LoadTileBlockMap:: ; 083c (0:083c)
ld [hNorthSouthConnectedMapWidth], a
call LoadNorthSouthConnectionsTileMap
.southConnection
- ld a, [W_MAPCONN2PTR]
+ ld a, [wMapConn2Ptr]
cp $ff
jr z, .westConnection
call SwitchToMapRomBank
@@ -964,7 +964,7 @@ LoadTileBlockMap:: ; 083c (0:083c)
ld [hNorthSouthConnectedMapWidth], a
call LoadNorthSouthConnectionsTileMap
.westConnection
- ld a, [W_MAPCONN3PTR]
+ ld a, [wMapConn3Ptr]
cp $ff
jr z, .eastConnection
call SwitchToMapRomBank
@@ -982,7 +982,7 @@ LoadTileBlockMap:: ; 083c (0:083c)
ld [hEastWestConnectedMapWidth], a
call LoadEastWestConnectionsTileMap
.eastConnection
- ld a, [W_MAPCONN4PTR]
+ ld a, [wMapConn4Ptr]
cp $ff
jr z, .done
call SwitchToMapRomBank
@@ -1078,7 +1078,7 @@ IsSpriteOrSignInFrontOfPlayer:: ; 095e (0:095e)
.extendRangeOverCounter
; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC
predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player in c
- ld hl, W_TILESETTALKINGOVERTILES ; list of tiles that extend talking range (counter tiles)
+ ld hl, wTileSetTalkingOverTiles ; list of tiles that extend talking range (counter tiles)
ld b, 3
ld d, $20 ; talking range in pixels (long range)
.counterTilesLoop
@@ -1169,8 +1169,8 @@ IsSpriteInFrontOfPlayer2:: ; 0985 (0:0985)
ld a, l
and $f0
inc a
- ld l, a
- set 7, [hl]
+ ld l, a ; hl = $c1x1
+ set 7, [hl] ; set flag to make the sprite face the player
ld a, e
ld [hSpriteIndexOrTextID], a
ld a, [hSpriteIndexOrTextID] ; possible useless read because a already has the value of the read address
@@ -1584,9 +1584,9 @@ ScheduleWestColumnRedraw:: ; 0c0c (0:0c0c)
; Input: c = tile block ID, hl = destination address
DrawTileBlock:: ; 0c21 (0:0c21)
push hl
- ld a, [W_TILESETBLOCKSPTR] ; pointer to tiles
+ ld a, [wTileSetBlocksPtr] ; pointer to tiles
ld l, a
- ld a, [W_TILESETBLOCKSPTR + 1]
+ ld a, [wTileSetBlocksPtr + 1]
ld h, a
ld a, c
swap a
@@ -1779,7 +1779,7 @@ RunMapScript:: ; 0d2c (0:0d2c)
call RunNPCMovementScript
ld a, [wCurMap] ; current map number
call SwitchToMapRomBank ; change to the ROM bank the map's data is in
- ld hl, W_MAPSCRIPTPTR
+ ld hl, wMapScriptPtr
ld a, [hli]
ld h, [hl]
ld l, a
@@ -1873,32 +1873,32 @@ asm_0dbd
jr nz, .copyFixedHeaderLoop
; initialize all the connected maps to disabled at first, before loading the actual values
ld a, $ff
- ld [W_MAPCONN1PTR], a
- ld [W_MAPCONN2PTR], a
- ld [W_MAPCONN3PTR], a
- ld [W_MAPCONN4PTR], a
+ ld [wMapConn1Ptr], a
+ ld [wMapConn2Ptr], a
+ ld [wMapConn3Ptr], a
+ ld [wMapConn4Ptr], a
; copy connection data (if any) to WRAM
- ld a, [W_MAPCONNECTIONS]
+ ld a, [wMapConnections]
ld b, a
.checkNorth
bit 3, b
jr z, .checkSouth
- ld de, W_MAPCONN1PTR
+ ld de, wMapConn1Ptr
call CopyMapConnectionHeader
.checkSouth
bit 2, b
jr z, .checkWest
- ld de, W_MAPCONN2PTR
+ ld de, wMapConn2Ptr
call CopyMapConnectionHeader
.checkWest
bit 1, b
jr z, .checkEast
- ld de, W_MAPCONN3PTR
+ ld de, wMapConn3Ptr
call CopyMapConnectionHeader
.checkEast
bit 0, b
jr z, .getObjectDataPointer
- ld de, W_MAPCONN4PTR
+ ld de, wMapConn4Ptr
call CopyMapConnectionHeader
.getObjectDataPointer
ld a, [hli]
diff --git a/home/pic.asm b/home/pic.asm
index 25a2ceb5..37abaecd 100644
--- a/home/pic.asm
+++ b/home/pic.asm
@@ -1,5 +1,5 @@
; bankswitches and runs _UncompressSpriteData
-; bank is given in a, sprite input stream is pointed to in W_SPRITEINPUTPTR
+; bank is given in a, sprite input stream is pointed to in wSpriteInputPtr
UncompressSpriteData:: ; 23f8 (0:23f8)
ld b, a
ld a, [H_LOADEDROMBANK]
@@ -16,51 +16,51 @@ UncompressSpriteData:: ; 23f8 (0:23f8)
; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop
_UncompressSpriteData:: ; 2410 (0:2410)
- ld hl, S_SPRITEBUFFER1
+ ld hl, sSpriteBuffer1
ld c, (2*SPRITEBUFFERSIZE) % $100
ld b, (2*SPRITEBUFFERSIZE) / $100
xor a
call FillMemory ; clear sprite buffer 1 and 2
ld a, $1
- ld [W_SPRITEINPUTBITCOUNTER], a
+ ld [wSpriteInputBitCounter], a
ld a, $3
- ld [W_SPRITEOUTPUTBITOFFSET], a
+ ld [wSpriteOutputBitOffset], a
xor a
- ld [W_SPRITECURPOSX], a
- ld [W_SPRITECURPOSY], a
- ld [W_SPRITELOADFLAGS], a
+ ld [wSpriteCurPosX], a
+ ld [wSpriteCurPosY], a
+ ld [wSpriteLoadFlags], a
call ReadNextInputByte ; first byte of input determines sprite width (high nybble) and height (low nybble) in tiles (8x8 pixels)
ld b, a
and $f
add a
add a
add a
- ld [W_SPRITEHEIGHT], a
+ ld [wSpriteHeight], a
ld a, b
swap a
and $f
add a
add a
add a
- ld [W_SPRITEWITDH], a
+ ld [wSpriteWidth], a
call ReadNextInputBit
- ld [W_SPRITELOADFLAGS], 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
+ ld [wSpriteLoadFlags], a ; initialite bit1 to 0 and bit0 to the first input bit
+ ; 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:: ; 244c (0:244c)
- ld hl, S_SPRITEBUFFER1
- ld a, [W_SPRITELOADFLAGS]
+ 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, [W_SPRITELOADFLAGS]
+ ld a, [wSpriteLoadFlags]
bit 1, a
jr z, .startDecompression ; check if last iteration
call ReadNextInputBit ; if last chunk, read 1-2 bit unpacking mode
@@ -69,7 +69,7 @@ UncompressSpriteDataLoop:: ; 244c (0:244c)
call ReadNextInputBit ; 1 0 -> mode 1
inc a ; 1 1 -> mode 2
.unpackingMode0
- ld [W_SPRITEUNPACKMODE], a
+ ld [wSpriteUnpackMode], a
.startDecompression
call ReadNextInputBit
and a
@@ -143,69 +143,69 @@ UncompressSpriteDataLoop:: ; 244c (0:244c)
; also cancels the calling function if the all output is done (by removing the return pointer from stack)
; and calls postprocessing functions according to the unpack mode
MoveToNextBufferPosition:: ; 24ce (0:24ce)
- ld a, [W_SPRITEHEIGHT]
+ ld a, [wSpriteHeight]
ld b, a
- ld a, [W_SPRITECURPOSY]
+ ld a, [wSpriteCurPosY]
inc a
cp b
jr z, .curColumnDone
- ld [W_SPRITECURPOSY], a
- ld a, [W_SPRITEOUTPUTPTR]
+ ld [wSpriteCurPosY], a
+ ld a, [wSpriteOutputPtr]
inc a
- ld [W_SPRITEOUTPUTPTR], a
+ ld [wSpriteOutputPtr], a
ret nz
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
inc a
- ld [W_SPRITEOUTPUTPTR+1], a
+ ld [wSpriteOutputPtr+1], a
ret
.curColumnDone
xor a
- ld [W_SPRITECURPOSY], a
- ld a, [W_SPRITEOUTPUTBITOFFSET]
+ ld [wSpriteCurPosY], a
+ ld a, [wSpriteOutputBitOffset]
and a
jr z, .bitOffsetsDone
dec a
- ld [W_SPRITEOUTPUTBITOFFSET], a
- ld hl, W_SPRITEOUTPUTPTRCACHED
+ ld [wSpriteOutputBitOffset], a
+ ld hl, wSpriteOutputPtrCached
ld a, [hli]
- ld [W_SPRITEOUTPUTPTR], a
+ ld [wSpriteOutputPtr], a
ld a, [hl]
- ld [W_SPRITEOUTPUTPTR+1], a
+ ld [wSpriteOutputPtr+1], a
ret
.bitOffsetsDone
ld a, $3
- ld [W_SPRITEOUTPUTBITOFFSET], a
- ld a, [W_SPRITECURPOSX]
+ ld [wSpriteOutputBitOffset], a
+ ld a, [wSpriteCurPosX]
add $8
- ld [W_SPRITECURPOSX], a
+ ld [wSpriteCurPosX], a
ld b, a
- ld a, [W_SPRITEWITDH]
+ ld a, [wSpriteWidth]
cp b
jr z, .allColumnsDone
- ld a, [W_SPRITEOUTPUTPTR]
+ ld a, [wSpriteOutputPtr]
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
inc hl
jp StoreSpriteOutputPointer
.allColumnsDone
pop hl
xor a
- ld [W_SPRITECURPOSX], a
- ld a, [W_SPRITELOADFLAGS]
+ ld [wSpriteCurPosX], a
+ ld a, [wSpriteLoadFlags]
bit 1, a
jr nz, .done ; test if there is one more sprite to go
xor $1
set 1, a
- ld [W_SPRITELOADFLAGS], a
+ ld [wSpriteLoadFlags], a
jp UncompressSpriteDataLoop
.done
jp UnpackSprite
-; writes 2 bits (from a) to the output buffer (pointed to from W_SPRITEOUTPUTPTR)
+; writes 2 bits (from a) to the output buffer (pointed to from wSpriteOutputPtr)
WriteSpriteBitsToBuffer:: ; 253f (0:253f)
ld e, a
- ld a, [W_SPRITEOUTPUTBITOFFSET]
+ ld a, [wSpriteOutputBitOffset]
and a
jr z, .offset0
cp $2
@@ -221,9 +221,9 @@ WriteSpriteBitsToBuffer:: ; 253f (0:253f)
.offset2
swap e
.offset0
- ld a, [W_SPRITEOUTPUTPTR]
+ ld a, [wSpriteOutputPtr]
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
ld a, [hl]
or e
@@ -232,32 +232,32 @@ WriteSpriteBitsToBuffer:: ; 253f (0:253f)
; reads next bit from input stream and returns it in a
ReadNextInputBit:: ; 2566 (0:2566)
- ld a, [W_SPRITEINPUTBITCOUNTER]
+ ld a, [wSpriteInputBitCounter]
dec a
jr nz, .curByteHasMoreBitsToRead
call ReadNextInputByte
- ld [W_SPRITEINPUTCURBYTE], a
+ ld [wSpriteInputCurByte], a
ld a, $8
.curByteHasMoreBitsToRead
- ld [W_SPRITEINPUTBITCOUNTER], a
- ld a, [W_SPRITEINPUTCURBYTE]
+ ld [wSpriteInputBitCounter], a
+ ld a, [wSpriteInputCurByte]
rlca
- ld [W_SPRITEINPUTCURBYTE], a
+ ld [wSpriteInputCurByte], a
and $1
ret
; reads next byte from input stream and returns it in a
ReadNextInputByte:: ; 2581 (0:2581)
- ld a, [W_SPRITEINPUTPTR]
+ ld a, [wSpriteInputPtr]
ld l, a
- ld a, [W_SPRITEINPUTPTR+1]
+ ld a, [wSpriteInputPtr+1]
ld h, a
ld a, [hli]
ld b, a
ld a, l
- ld [W_SPRITEINPUTPTR], a
+ ld [wSpriteInputPtr], a
ld a, h
- ld [W_SPRITEINPUTPTR+1], a
+ ld [wSpriteInputPtr+1], a
ld a, b
ret
@@ -282,22 +282,22 @@ LengthEncodingOffsetList:: ; 2595 (0:2595)
; unpacks the sprite data depending on the unpack mode
UnpackSprite:: ; 25b5 (0:25b5)
- ld a, [W_SPRITEUNPACKMODE]
+ ld a, [wSpriteUnpackMode]
cp $2
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
; input bit value 0 preserves the current bit value and input bit value 1 toggles it (starting from initial value 0).
SpriteDifferentialDecode:: ; 25ca (0:25ca)
xor a
- ld [W_SPRITECURPOSX], a
- ld [W_SPRITECURPOSY], a
+ ld [wSpriteCurPosX], a
+ ld [wSpriteCurPosY], a
call StoreSpriteOutputPointer
ld a, [wSpriteFlipped]
and a
@@ -310,18 +310,18 @@ SpriteDifferentialDecode:: ; 25ca (0:25ca)
ld de, DecodeNybble1Table
.storeDecodeTablesPointers
ld a, l
- ld [W_SPRITEDECODETABLE0PTR], a
+ ld [wSpriteDecodeTable0Ptr], a
ld a, h
- ld [W_SPRITEDECODETABLE0PTR+1], a
+ ld [wSpriteDecodeTable0Ptr+1], a
ld a, e
- ld [W_SPRITEDECODETABLE1PTR], a
+ ld [wSpriteDecodeTable1Ptr], a
ld a, d
- ld [W_SPRITEDECODETABLE1PTR+1], a
+ ld [wSpriteDecodeTable1Ptr+1], a
ld e, $0 ; last decoded nybble, initialized to 0
.decodeNextByteLoop
- ld a, [W_SPRITEOUTPUTPTR]
+ ld a, [wSpriteOutputPtr]
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
ld a, [hl]
ld b, a
@@ -335,47 +335,47 @@ SpriteDifferentialDecode:: ; 25ca (0:25ca)
call DifferentialDecodeNybble ; decode low nybble
or d
ld b, a
- ld a, [W_SPRITEOUTPUTPTR]
+ ld a, [wSpriteOutputPtr]
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
ld a, b
ld [hl], a ; write back decoded data
- ld a, [W_SPRITEHEIGHT]
+ ld a, [wSpriteHeight]
add l ; move on to next column
jr nc, .noCarry
inc h
.noCarry
- ld [W_SPRITEOUTPUTPTR], a
+ ld [wSpriteOutputPtr], a
ld a, h
- ld [W_SPRITEOUTPUTPTR+1], a
- ld a, [W_SPRITECURPOSX]
+ ld [wSpriteOutputPtr+1], a
+ ld a, [wSpriteCurPosX]
add $8
- ld [W_SPRITECURPOSX], a
+ ld [wSpriteCurPosX], a
ld b, a
- ld a, [W_SPRITEWITDH]
+ ld a, [wSpriteWidth]
cp b
jr nz, .decodeNextByteLoop ; test if current row is done
xor a
ld e, a
- ld [W_SPRITECURPOSX], a
- ld a, [W_SPRITECURPOSY] ; move on to next row
+ ld [wSpriteCurPosX], a
+ ld a, [wSpriteCurPosY] ; move on to next row
inc a
- ld [W_SPRITECURPOSY], a
+ ld [wSpriteCurPosY], a
ld b, a
- ld a, [W_SPRITEHEIGHT]
+ ld a, [wSpriteHeight]
cp b
jr z, .done ; test if all rows finished
- ld a, [W_SPRITEOUTPUTPTRCACHED]
+ ld a, [wSpriteOutputPtrCached]
ld l, a
- ld a, [W_SPRITEOUTPUTPTRCACHED+1]
+ ld a, [wSpriteOutputPtrCached+1]
ld h, a
inc hl
call StoreSpriteOutputPointer
jr .decodeNextByteLoop
.done
xor a
- ld [W_SPRITECURPOSY], a
+ ld [wSpriteCurPosY], a
ret
; decodes the nybble stored in a. Last decoded data is assumed to be in e (needed to determine if initial value is 0 or 1)
@@ -396,14 +396,14 @@ DifferentialDecodeNybble:: ; 2663 (0:2663)
.selectLookupTable
ld e, l
jr nz, .initialValue1 ; load the appropriate table
- ld a, [W_SPRITEDECODETABLE0PTR]
+ ld a, [wSpriteDecodeTable0Ptr]
ld l, a
- ld a, [W_SPRITEDECODETABLE0PTR+1]
+ ld a, [wSpriteDecodeTable0Ptr+1]
jr .tableLookup
.initialValue1
- ld a, [W_SPRITEDECODETABLE1PTR]
+ ld a, [wSpriteDecodeTable1Ptr]
ld l, a
- ld a, [W_SPRITEDECODETABLE1PTR+1]
+ ld a, [wSpriteDecodeTable1Ptr+1]
.tableLookup
ld h, a
ld a, e
@@ -461,22 +461,22 @@ DecodeNybble1TableFlipped:: ; 26b5 (0:26b5)
; combines the two loaded chunks with xor (the chunk loaded second is the destination). The source chunk is differeintial decoded beforehand.
XorSpriteChunks:: ; 26bd (0:26bd)
xor a
- ld [W_SPRITECURPOSX], a
- ld [W_SPRITECURPOSY], a
+ ld [wSpriteCurPosX], a
+ ld [wSpriteCurPosY], a
call ResetSpriteBufferPointers
- ld a, [W_SPRITEOUTPUTPTR] ; points to buffer 1 or 2, depending on flags
+ ld a, [wSpriteOutputPtr] ; points to buffer 1 or 2, depending on flags
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
call SpriteDifferentialDecode ; decode buffer 1 or 2, depending on flags
call ResetSpriteBufferPointers
- ld a, [W_SPRITEOUTPUTPTR] ; source buffer, points to buffer 1 or 2, depending on flags
+ ld a, [wSpriteOutputPtr] ; source buffer, points to buffer 1 or 2, depending on flags
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
- ld a, [W_SPRITEOUTPUTPTRCACHED] ; destination buffer, points to buffer 2 or 1, depending on flags
+ ld a, [wSpriteOutputPtrCached] ; destination buffer, points to buffer 2 or 1, depending on flags
ld e, a
- ld a, [W_SPRITEOUTPUTPTRCACHED+1]
+ ld a, [wSpriteOutputPtrCached+1]
ld d, a
.xorChunksLoop
ld a, [wSpriteFlipped]
@@ -503,24 +503,24 @@ XorSpriteChunks:: ; 26bd (0:26bd)
xor b
ld [de], a
inc de
- ld a, [W_SPRITECURPOSY]
+ ld a, [wSpriteCurPosY]
inc a
- ld [W_SPRITECURPOSY], a ; go to next row
+ ld [wSpriteCurPosY], a ; go to next row
ld b, a
- ld a, [W_SPRITEHEIGHT]
+ ld a, [wSpriteHeight]
cp b
jr nz, .xorChunksLoop ; test if column finished
xor a
- ld [W_SPRITECURPOSY], a
- ld a, [W_SPRITECURPOSX]
+ ld [wSpriteCurPosY], a
+ ld a, [wSpriteCurPosX]
add $8
- ld [W_SPRITECURPOSX], a ; go to next column
+ ld [wSpriteCurPosX], a ; go to next column
ld b, a
- ld a, [W_SPRITEWITDH]
+ ld a, [wSpriteWidth]
cp b
jr nz, .xorChunksLoop ; test if all columns finished
xor a
- ld [W_SPRITECURPOSX], a
+ ld [wSpriteCurPosX], a
ret
; reverses the bits in the nybble given in register a
@@ -534,26 +534,26 @@ ReverseNybble:: ; 272d (0:272d)
ld a, [de]
ret
-; resets sprite buffer pointers to buffer 1 and 2, depending on W_SPRITELOADFLAGS
+; resets sprite buffer pointers to buffer 1 and 2, depending on wSpriteLoadFlags
ResetSpriteBufferPointers:: ; 2737 (0:2737)
- ld a, [W_SPRITELOADFLAGS] ; wd0a8
+ ld a, [wSpriteLoadFlags] ; wd0a8
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 [W_SPRITEOUTPUTPTR], a
+ ld [wSpriteOutputPtr], a
ld a, h
- ld [W_SPRITEOUTPUTPTR+1], a
+ ld [wSpriteOutputPtr+1], a
ld a, e
- ld [W_SPRITEOUTPUTPTRCACHED], a
+ ld [wSpriteOutputPtrCached], a
ld a, d
- ld [W_SPRITEOUTPUTPTRCACHED+1], a
+ ld [wSpriteOutputPtrCached+1], a
ret
; maps each nybble to its reverse
@@ -567,9 +567,9 @@ UnpackSpriteMode2:: ; 276d (0:276d)
push af
xor a
ld [wSpriteFlipped], a ; temporarily clear flipped flag for decoding the destination chunk
- ld a, [W_SPRITEOUTPUTPTRCACHED]
+ ld a, [wSpriteOutputPtrCached]
ld l, a
- ld a, [W_SPRITEOUTPUTPTRCACHED+1]
+ ld a, [wSpriteOutputPtrCached+1]
ld h, a
call SpriteDifferentialDecode
call ResetSpriteBufferPointers
@@ -580,9 +580,9 @@ UnpackSpriteMode2:: ; 276d (0:276d)
; stores hl into the output pointers
StoreSpriteOutputPointer:: ; 278d (0:278d)
ld a, l
- ld [W_SPRITEOUTPUTPTR], a
- ld [W_SPRITEOUTPUTPTRCACHED], a
+ ld [wSpriteOutputPtr], a
+ ld [wSpriteOutputPtrCached], a
ld a, h
- ld [W_SPRITEOUTPUTPTR+1], a
- ld [W_SPRITEOUTPUTPTRCACHED+1], a
+ ld [wSpriteOutputPtr+1], a
+ ld [wSpriteOutputPtrCached+1], a
ret
diff --git a/home/play_time.asm b/home/play_time.asm
index 09c894fc..8044d15c 100644
--- a/home/play_time.asm
+++ b/home/play_time.asm
@@ -6,7 +6,7 @@ TrackPlayTime: ; 1ef5 (0:1ef5)
ld a,[wd732]
bit 0,a
ret z
- ld a, [wPlayTimeMinutes]
+ ld a, [wPlayTimeMaxed]
and a
ret nz
ld a, [wPlayTimeFrames]
@@ -23,16 +23,16 @@ TrackPlayTime: ; 1ef5 (0:1ef5)
ret nz
xor a
ld [wPlayTimeSeconds], a
- ld a, [wPlayTimeMinutes + 1]
+ ld a, [wPlayTimeMinutes]
inc a
- ld [wPlayTimeMinutes + 1], a
+ ld [wPlayTimeMinutes], a
cp 60
ret nz
xor a
- ld [wPlayTimeMinutes + 1], a
- ld a, [wPlayTimeHours + 1]
+ ld [wPlayTimeMinutes], a
+ ld a, [wPlayTimeHours]
inc a
- ld [wPlayTimeHours + 1], a
+ ld [wPlayTimeHours], a
cp $ff
ret nz
ld hl, wd47a
@@ -40,10 +40,10 @@ TrackPlayTime: ; 1ef5 (0:1ef5)
.maxIGT
ld a, 59
ld [wPlayTimeSeconds], a
- ld [wPlayTimeMinutes + 1], a
- ld a, $ff
- ld [wPlayTimeHours + 1], a
ld [wPlayTimeMinutes], a
+ ld a, $ff
+ ld [wPlayTimeHours], a
+ ld [wPlayTimeMaxed], a
ret
CountDownIgnoreInputBitReset: ; 1f54 (0:1f54)