diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-04-27 15:49:59 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-04-27 15:49:59 -0400 |
commit | 6a31663c960a5c1da9dbbf12d49e0252860b96d0 (patch) | |
tree | 74c333d90fda4297a40748ddf0dd11771feb0832 /sram.asm | |
parent | bcc4380d40767983a0b253d486bb3c82f0f1fd07 (diff) |
Use {interpolation} to generate sequences of RAM labels
Fixes #319
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}" |