mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-12-06 11:21:02 +13:00
Improve some RAM formatting
This commit is contained in:
parent
ce62dca69b
commit
8701ef4d61
|
|
@ -207,7 +207,7 @@ TM01 EQU const_value
|
||||||
add_tm ROCK_SLIDE ; $F8
|
add_tm ROCK_SLIDE ; $F8
|
||||||
add_tm TRI_ATTACK ; $F9
|
add_tm TRI_ATTACK ; $F9
|
||||||
add_tm SUBSTITUTE ; $FA
|
add_tm SUBSTITUTE ; $FA
|
||||||
assert NUM_TMS == const_value - TM01, "NUM_TMS ({d:NUM_TMS}) does not match the number of add_tm definitions"
|
ASSERT NUM_TMS == const_value - TM01, "NUM_TMS ({d:NUM_TMS}) does not match the number of add_tm definitions"
|
||||||
|
|
||||||
NUM_TM_HM EQU NUM_TMS + NUM_HMS
|
NUM_TM_HM EQU NUM_TMS + NUM_HMS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ SubanimationPointers:
|
||||||
; subanim type, count
|
; subanim type, count
|
||||||
; REPT count
|
; REPT count
|
||||||
; db frame block id, base coordinate id, frame block mode
|
; db frame block id, base coordinate id, frame block mode
|
||||||
; endr
|
; ENDR
|
||||||
|
|
||||||
subanim: MACRO
|
subanim: MACRO
|
||||||
db (\1 << 5) | \2
|
db (\1 << 5) | \2
|
||||||
|
|
|
||||||
|
|
@ -6308,7 +6308,7 @@ LoadPlayerBackPic:
|
||||||
ld de, OldManPicBack
|
ld de, OldManPicBack
|
||||||
.next
|
.next
|
||||||
ld a, BANK(RedPicBack)
|
ld a, BANK(RedPicBack)
|
||||||
assert BANK(RedPicBack) == BANK(OldManPicBack)
|
ASSERT BANK(RedPicBack) == BANK(OldManPicBack)
|
||||||
call UncompressSpriteFromDE
|
call UncompressSpriteFromDE
|
||||||
predef ScaleSpriteByTwo
|
predef ScaleSpriteByTwo
|
||||||
ld hl, wOAMBuffer
|
ld hl, wOAMBuffer
|
||||||
|
|
|
||||||
|
|
@ -2617,7 +2617,7 @@ IsKeyItem_::
|
||||||
ld hl, KeyItemFlags
|
ld hl, KeyItemFlags
|
||||||
ld de, wBuffer
|
ld de, wBuffer
|
||||||
ld bc, 15 ; only 11 bytes are actually used
|
ld bc, 15 ; only 11 bytes are actually used
|
||||||
assert 15 >= (NUM_ITEMS + 7) / 8
|
ASSERT 15 >= (NUM_ITEMS + 7) / 8
|
||||||
call CopyData
|
call CopyData
|
||||||
pop af
|
pop af
|
||||||
dec a
|
dec a
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@ GetName::
|
||||||
|
|
||||||
; TM names are separate from item names.
|
; TM names are separate from item names.
|
||||||
; BUG: This applies to all names instead of just items.
|
; BUG: This applies to all names instead of just items.
|
||||||
assert NUM_POKEMON_INDEXES < HM01, \
|
ASSERT NUM_POKEMON_INDEXES < HM01, \
|
||||||
"A bug in GetName will get TM/HM names for Pokémon above ${x:HM01}."
|
"A bug in GetName will get TM/HM names for Pokémon above ${x:HM01}."
|
||||||
assert NUM_ATTACKS < HM01, \
|
ASSERT NUM_ATTACKS < HM01, \
|
||||||
"A bug in GetName will get TM/HM names for moves above ${x:HM01}."
|
"A bug in GetName will get TM/HM names for moves above ${x:HM01}."
|
||||||
assert NUM_TRAINERS < HM01, \
|
ASSERT NUM_TRAINERS < HM01, \
|
||||||
"A bug in GetName will get TM/HM names for trainers above ${x:HM01}."
|
"A bug in GetName will get TM/HM names for trainers above ${x:HM01}."
|
||||||
cp HM01
|
cp HM01
|
||||||
jp nc, GetMachineName
|
jp nc, GetMachineName
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ WRAM0
|
||||||
org $c100
|
org $c100
|
||||||
"Sprite State Data"
|
"Sprite State Data"
|
||||||
"OAM Buffer"
|
"OAM Buffer"
|
||||||
org $dfff
|
org $df00
|
||||||
"Stack"
|
"Stack"
|
||||||
VRAM
|
VRAM
|
||||||
"VRAM"
|
"VRAM"
|
||||||
|
|
|
||||||
|
|
@ -118,10 +118,10 @@ ENDM
|
||||||
|
|
||||||
end_grass_wildmons: MACRO
|
end_grass_wildmons: MACRO
|
||||||
IF CURRENT_GRASS_WILDMONS_RATE == 0
|
IF CURRENT_GRASS_WILDMONS_RATE == 0
|
||||||
assert 1 == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \
|
ASSERT 1 == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \
|
||||||
"def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected 1 byte"
|
"def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected 1 byte"
|
||||||
ELSE
|
ELSE
|
||||||
assert WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \
|
ASSERT WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \
|
||||||
"def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes"
|
"def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes"
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
@ -136,10 +136,10 @@ ENDM
|
||||||
|
|
||||||
end_water_wildmons: MACRO
|
end_water_wildmons: MACRO
|
||||||
IF CURRENT_WATER_WILDMONS_RATE == 0
|
IF CURRENT_WATER_WILDMONS_RATE == 0
|
||||||
assert 1 == @ - {CURRENT_WATER_WILDMONS_LABEL}, \
|
ASSERT 1 == @ - {CURRENT_WATER_WILDMONS_LABEL}, \
|
||||||
"def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected 1 byte"
|
"def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected 1 byte"
|
||||||
ELSE
|
ELSE
|
||||||
assert WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \
|
ASSERT WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \
|
||||||
"def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes"
|
"def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes"
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
|
||||||
|
|
@ -95,3 +95,10 @@ spritestatedata2: MACRO
|
||||||
ds 1
|
ds 1
|
||||||
\1End::
|
\1End::
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
sprite_oam_struct: MACRO
|
||||||
|
\1YCoord:: db
|
||||||
|
\1XCoord:: db
|
||||||
|
\1TileID:: db
|
||||||
|
\1Attributes:: db
|
||||||
|
ENDM
|
||||||
|
|
|
||||||
23
sram.asm
23
sram.asm
|
|
@ -1,4 +1,4 @@
|
||||||
SECTION "Sprite Buffers", SRAM ; BANK 0
|
SECTION "Sprite Buffers", SRAM
|
||||||
|
|
||||||
sSpriteBuffer0:: ds SPRITEBUFFERSIZE
|
sSpriteBuffer0:: ds SPRITEBUFFERSIZE
|
||||||
sSpriteBuffer1:: ds SPRITEBUFFERSIZE
|
sSpriteBuffer1:: ds SPRITEBUFFERSIZE
|
||||||
|
|
@ -9,7 +9,8 @@ sSpriteBuffer2:: ds SPRITEBUFFERSIZE
|
||||||
sHallOfFame:: ds HOF_TEAM * HOF_TEAM_CAPACITY
|
sHallOfFame:: ds HOF_TEAM * HOF_TEAM_CAPACITY
|
||||||
|
|
||||||
|
|
||||||
SECTION "Save Data", SRAM ; BANK 1
|
SECTION "Save Data", SRAM
|
||||||
|
|
||||||
ds $598
|
ds $598
|
||||||
|
|
||||||
sPlayerName:: ds NAME_LENGTH
|
sPlayerName:: ds NAME_LENGTH
|
||||||
|
|
@ -17,34 +18,34 @@ sMainData:: ds wMainDataEnd - wMainDataStart
|
||||||
sSpriteData:: ds wSpriteDataEnd - wSpriteDataStart
|
sSpriteData:: ds wSpriteDataEnd - wSpriteDataStart
|
||||||
sPartyData:: ds wPartyDataEnd - wPartyDataStart
|
sPartyData:: ds wPartyDataEnd - wPartyDataStart
|
||||||
sCurBoxData:: ds wBoxDataEnd - wBoxDataStart
|
sCurBoxData:: ds wBoxDataEnd - wBoxDataStart
|
||||||
sTileAnimations:: ds 1
|
sTileAnimations:: db
|
||||||
sMainDataCheckSum:: ds 1
|
sMainDataCheckSum:: db
|
||||||
|
|
||||||
|
|
||||||
; The PC boxes will not fit into one SRAM bank,
|
; The PC boxes will not fit into one SRAM bank,
|
||||||
; so they use multiple SECTIONs
|
; so they use multiple SECTIONs
|
||||||
box_n = 0
|
box_n = 0
|
||||||
boxes: MACRO
|
boxes: MACRO
|
||||||
rept \1
|
REPT \1
|
||||||
box_n = box_n + 1
|
box_n = box_n + 1
|
||||||
sBox{d:box_n}:: ds wBoxDataEnd - wBoxDataStart
|
sBox{d:box_n}:: ds wBoxDataEnd - wBoxDataStart
|
||||||
endr
|
ENDR
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
SECTION "Saved Boxes 1", SRAM ; BANK 2
|
SECTION "Saved Boxes 1", SRAM
|
||||||
|
|
||||||
; sBox1 - sBox6
|
; sBox1 - sBox6
|
||||||
boxes 6
|
boxes 6
|
||||||
sBank2AllBoxesChecksum:: ds 1
|
sBank2AllBoxesChecksum:: db
|
||||||
sBank2IndividualBoxChecksums:: ds 6
|
sBank2IndividualBoxChecksums:: ds 6
|
||||||
|
|
||||||
SECTION "Saved Boxes 2", SRAM ; BANK 3
|
SECTION "Saved Boxes 2", SRAM
|
||||||
|
|
||||||
; sBox7 - sBox12
|
; sBox7 - sBox12
|
||||||
boxes 6
|
boxes 6
|
||||||
sBank3AllBoxesChecksum:: ds 1
|
sBank3AllBoxesChecksum:: db
|
||||||
sBank3IndividualBoxChecksums:: ds 6
|
sBank3IndividualBoxChecksums:: ds 6
|
||||||
|
|
||||||
; All 12 boxes fit within 2 SRAM banks
|
; All 12 boxes fit within 2 SRAM banks
|
||||||
assert box_n == NUM_BOXES, \
|
ASSERT box_n == NUM_BOXES, \
|
||||||
"boxes: Expected {d:NUM_BOXES} total boxes, got {d:box_n}"
|
"boxes: Expected {d:NUM_BOXES} total boxes, got {d:box_n}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue