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: DebugRoom_BoxAddresses:
table_width 3, DebugRoom_BoxAddresses table_width 3, DebugRoom_BoxAddresses
dba sBox1 for n, 1, NUM_BOXES + 1
dba sBox2 dba sBox{d:n}
dba sBox3 endr
dba sBox4
dba sBox5
dba sBox6
dba sBox7
dba sBox8
dba sBox9
dba sBox10
dba sBox11
dba sBox12
dba sBox13
dba sBox14
assert_table_length NUM_BOXES assert_table_length NUM_BOXES
DebugRoomMenu_RTCEdit: DebugRoomMenu_RTCEdit:

View File

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

View File

@ -1068,28 +1068,12 @@ EraseBoxes:
jr nz, .next jr nz, .next
ret ret
MACRO box_address
assert BANK(\1) == BANK(\2)
db BANK(\1)
dw \1, \2
ENDM
BoxAddresses: BoxAddresses:
table_width 5, BoxAddresses table_width 5, BoxAddresses
box_address sBox1, sBox1End for n, 1, NUM_BOXES + 1
box_address sBox2, sBox2End db BANK(sBox{d:n}) ; aka BANK(sBox{d:n}End)
box_address sBox3, sBox3End dw sBox{d:n}, sBox{d:n}End
box_address sBox4, sBox4End endr
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
assert_table_length NUM_BOXES assert_table_length NUM_BOXES
Checksum: Checksum:

View File

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

View File

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

View File

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

View File

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