Use for loops to generate box pointer tables

Fixes #996
This commit is contained in:
Rangi 2022-08-31 18:03:49 -04:00
parent c7dee19a48
commit 4883950318
7 changed files with 25 additions and 118 deletions

View File

@ -1356,20 +1356,9 @@ DebugRoom_BoxStructStrings:
DebugRoom_BoxAddresses:
table_width 3, DebugRoom_BoxAddresses
dba sBox1
dba sBox2
dba sBox3
dba sBox4
dba sBox5
dba sBox6
dba sBox7
dba sBox8
dba sBox9
dba sBox10
dba sBox11
dba sBox12
dba sBox13
dba sBox14
for n, 1, NUM_BOXES + 1
dba sBox{d:n}
endr
assert_table_length NUM_BOXES
DebugRoomMenu_RTCEdit:

View File

@ -193,20 +193,9 @@ CheckForLuckyNumberWinners:
.BoxBankAddresses:
table_width 3, CheckForLuckyNumberWinners.BoxBankAddresses
dba sBox1
dba sBox2
dba sBox3
dba sBox4
dba sBox5
dba sBox6
dba sBox7
dba sBox8
dba sBox9
dba sBox10
dba sBox11
dba sBox12
dba sBox13
dba sBox14
for n, 1, NUM_BOXES + 1
dba sBox{d:n}
endr
assert_table_length NUM_BOXES
.LuckyNumberMatchPartyText:

View File

@ -1068,28 +1068,12 @@ EraseBoxes:
jr nz, .next
ret
MACRO box_address
assert BANK(\1) == BANK(\2)
db BANK(\1)
dw \1, \2
ENDM
BoxAddresses:
table_width 5, BoxAddresses
box_address sBox1, sBox1End
box_address sBox2, sBox2End
box_address sBox3, sBox3End
box_address sBox4, sBox4End
box_address sBox5, sBox5End
box_address sBox6, sBox6End
box_address sBox7, sBox7End
box_address sBox8, sBox8End
box_address sBox9, sBox9End
box_address sBox10, sBox10End
box_address sBox11, sBox11End
box_address sBox12, sBox12End
box_address sBox13, sBox13End
box_address sBox14, sBox14End
for n, 1, NUM_BOXES + 1
db BANK(sBox{d:n}) ; aka BANK(sBox{d:n}End)
dw sBox{d:n}, sBox{d:n}End
endr
assert_table_length NUM_BOXES
Checksum:

View File

@ -2153,20 +2153,9 @@ GetBoxPointer:
.BoxBankAddresses:
table_width 3, GetBoxPointer.BoxBankAddresses
dba sBox1
dba sBox2
dba sBox3
dba sBox4
dba sBox5
dba sBox6
dba sBox7
dba sBox8
dba sBox9
dba sBox10
dba sBox11
dba sBox12
dba sBox13
dba sBox14
for n, 1, NUM_BOXES + 1
dba sBox{d:n}
endr
assert_table_length NUM_BOXES
BillsPC_ApplyPalettes:
@ -2371,20 +2360,9 @@ GetBoxCount:
.BoxBankAddresses:
table_width 3, GetBoxCount.BoxBankAddresses
dba sBox1
dba sBox2
dba sBox3
dba sBox4
dba sBox5
dba sBox6
dba sBox7
dba sBox8
dba sBox9
dba sBox10
dba sBox11
dba sBox12
dba sBox13
dba sBox14
for n, 1, NUM_BOXES + 1
dba sBox{d:n}
endr
assert_table_length NUM_BOXES
BillsPC_PrintBoxName:

View File

@ -366,18 +366,7 @@ LoadBoxMonListing: ; unreferenced
.BoxAddresses:
table_width 3, LoadBoxMonListing.BoxAddresses
dba sBox1
dba sBox2
dba sBox3
dba sBox4
dba sBox5
dba sBox6
dba sBox7
dba sBox8
dba sBox9
dba sBox10
dba sBox11
dba sBox12
dba sBox13
dba sBox14
for n, 1, NUM_BOXES + 1
dba sBox{d:n}
endr
assert_table_length NUM_BOXES

View File

@ -253,20 +253,9 @@ endr
SearchBoxAddressTable:
table_width 3, SearchBoxAddressTable
dba sBox1
dba sBox2
dba sBox3
dba sBox4
dba sBox5
dba sBox6
dba sBox7
dba sBox8
dba sBox9
dba sBox10
dba sBox11
dba sBox12
dba sBox13
dba sBox14
for n, 1, NUM_BOXES + 1
dba sBox{d:n}
endr
assert_table_length NUM_BOXES
UpdateOTPointer:

View File

@ -174,20 +174,9 @@ MobileCheckOwnMonAnywhere:
.BoxAddresses:
table_width 3, MobileCheckOwnMonAnywhere.BoxAddresses
dba sBox1
dba sBox2
dba sBox3
dba sBox4
dba sBox5
dba sBox6
dba sBox7
dba sBox8
dba sBox9
dba sBox10
dba sBox11
dba sBox12
dba sBox13
dba sBox14
for n, 1, NUM_BOXES + 1
dba sBox{d:n}
endr
assert_table_length NUM_BOXES
.AdvanceOTName: