forked from pret/pokered
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sram.asm
51 lines (37 loc) · 1.05 KB
/
sram.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
SECTION "Sprite Buffers", SRAM
sSpriteBuffer0:: ds SPRITEBUFFERSIZE
sSpriteBuffer1:: ds SPRITEBUFFERSIZE
sSpriteBuffer2:: ds SPRITEBUFFERSIZE
ds $100
sHallOfFame:: ds HOF_TEAM * HOF_TEAM_CAPACITY
SECTION "Save Data", SRAM
ds $598
sPlayerName:: ds NAME_LENGTH
sMainData:: ds wMainDataEnd - wMainDataStart
sSpriteData:: ds wSpriteDataEnd - wSpriteDataStart
sPartyData:: ds wPartyDataEnd - wPartyDataStart
sCurBoxData:: ds wBoxDataEnd - wBoxDataStart
sTileAnimations:: db
sMainDataCheckSum:: db
; 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
; sBox1 - sBox6
boxes 6
sBank2AllBoxesChecksum:: db
sBank2IndividualBoxChecksums:: ds 6
SECTION "Saved Boxes 2", SRAM
; sBox7 - sBox12
boxes 6
sBank3AllBoxesChecksum:: db
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}"