diff --git a/constants/pokemon_data_constants.asm b/constants/pokemon_data_constants.asm index f9c2ef296..c12c61431 100644 --- a/constants/pokemon_data_constants.asm +++ b/constants/pokemon_data_constants.asm @@ -136,10 +136,17 @@ DEF PARTY_LENGTH EQU 6 ; boxes DEF MONS_PER_BOX EQU 20 +DEF MONS_PER_BOX_JP EQU 30 ; box: count, species, mons, OTs, nicknames, padding DEF BOX_LENGTH EQU 1 + MONS_PER_BOX + 1 + (BOXMON_STRUCT_LENGTH + NAME_LENGTH + MON_NAME_LENGTH) * MONS_PER_BOX + 2 ; $450 DEF NUM_BOXES EQU 14 +rsreset +DEF BOXLIST_SPECIES rb +DEF BOXLIST_BOXNUM rb +DEF BOXLIST_INDEX rb +DEF BOXLIST_SIZE EQU _RS + ; hall of fame ; hof_mon: species, id, dvs, level, nicknames DEF HOF_MON_LENGTH EQU 1 + 2 + 2 + 1 + (MON_NAME_LENGTH - 1) ; $10 diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index be7334ff0..3ba1399ad 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -1115,10 +1115,10 @@ BillsPC_LoadMonStats: add [hl] ld e, a ld d, 0 - ld hl, wBillsPCPokemonList + 1 ; box number - add hl, de - add hl, de + ld hl, wBillsPCPokemonList + BOXLIST_BOXNUM +rept BOXLIST_SIZE add hl, de +endr ld a, [hl] and a jr z, .party @@ -1229,10 +1229,10 @@ BillsPC_RefreshTextboxes: ld a, [wBillsPC_ScrollPosition] ld e, a ld d, 0 - ld hl, wBillsPCPokemonList - add hl, de - add hl, de + ld hl, wBillsPCPokemonList + BOXLIST_SPECIES +rept BOXLIST_SIZE add hl, de +endr ld e, l ld d, h hlcoord 9, 4 @@ -1246,9 +1246,9 @@ BillsPC_RefreshTextboxes: ld de, 2 * SCREEN_WIDTH add hl, de pop de +rept BOXLIST_SIZE inc de - inc de - inc de +endr pop af dec a jr nz, .loop @@ -1377,13 +1377,13 @@ MACRO copy_box_data jr z, .done\@ and a jr z, .done\@ - ld [de], a ; species + ld [de], a ; BOXLIST_SPECIES inc de ld a, [wBillsPC_LoadedBox] - ld [de], a ; box number + ld [de], a ; BOXLIST_BOXNUM inc de ld a, [wBillsPCTempListIndex] - ld [de], a ; list index + ld [de], a ; BOXLIST_INDEX inc a ld [wBillsPCTempListIndex], a inc de @@ -1407,7 +1407,7 @@ ENDM CopyBoxmonSpecies: xor a ld hl, wBillsPCPokemonList - ld bc, 3 * 30 + ld bc, BOXLIST_SIZE * MONS_PER_BOX_JP call ByteFill ld de, wBillsPCPokemonList xor a @@ -1444,10 +1444,10 @@ BillsPC_GetSelectedPokemonSpecies: add [hl] ld e, a ld d, 0 - ld hl, wBillsPCPokemonList - add hl, de - add hl, de + ld hl, wBillsPCPokemonList + BOXLIST_SPECIES +rept BOXLIST_SIZE add hl, de +endr ld a, [hl] ret diff --git a/ram/wram.asm b/ram/wram.asm index 7a3c14fb6..bf5fcc4cc 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -921,9 +921,7 @@ SECTION UNION "Overworld Map", WRAM0 ; bill's pc data wBillsPCData:: -wBillsPCPokemonList:: -; (species, box number, list index) x30 - ds 3 * 30 +wBillsPCPokemonList:: ds BOXLIST_SIZE * MONS_PER_BOX_JP ds 720 wBillsPC_ScrollPosition:: db wBillsPC_CursorPosition:: db