diff options
Diffstat (limited to 'sram.asm')
-rw-r--r-- | sram.asm | 31 |
1 files changed, 18 insertions, 13 deletions
@@ -21,25 +21,30 @@ sTileAnimations:: ds 1 sMainDataCheckSum:: ds 1 +; The PC boxes will not fit into one SRAM bank, +; so they use multiple SECTIONs +box_n = 0 +boxes: MACRO +rept \1 +box_n = box_n + 1 +sBox{d:box_n}:: ds wBoxDataEnd - wBoxDataStart +endr +ENDM + SECTION "Saved Boxes 1", SRAM ; BANK 2 -sBox1:: ds wBoxDataEnd - wBoxDataStart -sBox2:: ds wBoxDataEnd - wBoxDataStart -sBox3:: ds wBoxDataEnd - wBoxDataStart -sBox4:: ds wBoxDataEnd - wBoxDataStart -sBox5:: ds wBoxDataEnd - wBoxDataStart -sBox6:: ds wBoxDataEnd - wBoxDataStart +; sBox1 - sBox6 + boxes 6 sBank2AllBoxesChecksum:: ds 1 sBank2IndividualBoxChecksums:: ds 6 - SECTION "Saved Boxes 2", SRAM ; BANK 3 -sBox7:: ds wBoxDataEnd - wBoxDataStart -sBox8:: ds wBoxDataEnd - wBoxDataStart -sBox9:: ds wBoxDataEnd - wBoxDataStart -sBox10:: ds wBoxDataEnd - wBoxDataStart -sBox11:: ds wBoxDataEnd - wBoxDataStart -sBox12:: ds wBoxDataEnd - wBoxDataStart +; sBox7 - sBox12 + boxes 6 sBank3AllBoxesChecksum:: ds 1 sBank3IndividualBoxChecksums:: ds 6 + +; All 12 boxes fit within 2 SRAM banks + assert box_n == NUM_BOXES, \ + "boxes: Expected {d:NUM_BOXES} total boxes, got {d:box_n}" |