Revise some RAM buffer constants

This commit is contained in:
Rangi
2025-09-26 16:55:23 -04:00
parent 59da8c8122
commit 628797baff
6 changed files with 20 additions and 20 deletions

View File

@@ -64,7 +64,6 @@ DEF HOF_MON EQU $10
DEF HOF_TEAM EQU PARTY_LENGTH * HOF_MON
DEF HOF_TEAM_CAPACITY EQU 50
; mon data locations
; Note that some values are not supported by all functions that use these values.
const_def
@@ -74,15 +73,14 @@ DEF HOF_TEAM_CAPACITY EQU 50
const DAYCARE_DATA ; 3
const BATTLE_MON_DATA ; 4
; See data/pokemon/evos_moves.asm
; Evolution types
const_def 1
const EVOLVE_LEVEL ; 1
const EVOLVE_ITEM ; 2
const EVOLVE_TRADE ; 3
; evolution data (see data/pokemon/evos_moves.asm)
DEF NUM_EVOS_IN_BUFFER EQU 3
; wMonHGrowthRate values
; GrowthRateTable indexes (see data/growth_rates.asm)

View File

@@ -1,5 +1,5 @@
DEF NAME_LENGTH EQU 11
DEF ITEM_NAME_LENGTH EQU 13
DEF NAME_LENGTH EQU 11
DEF ITEM_NAME_LENGTH EQU 13
DEF NAME_BUFFER_LENGTH EQU 20
; PrintNumber, PrintBCDNumber
@@ -8,9 +8,9 @@ DEF NAME_BUFFER_LENGTH EQU 20
const BIT_LEFT_ALIGN ; 6
const BIT_LEADING_ZEROES ; 7
DEF MONEY_SIGN EQU (1 << BIT_MONEY_SIGN)
DEF LEFT_ALIGN EQU (1 << BIT_LEFT_ALIGN)
DEF LEADING_ZEROES EQU (1 << BIT_LEADING_ZEROES)
DEF MONEY_SIGN EQU 1 << BIT_MONEY_SIGN
DEF LEFT_ALIGN EQU 1 << BIT_LEFT_ALIGN
DEF LEADING_ZEROES EQU 1 << BIT_LEADING_ZEROES
; special text IDs (see home/text_script.asm)
const_def $d0

View File

@@ -2195,7 +2195,7 @@ ItemUseTMHM:
.chooseMon
ld hl, wStringBuffer
ld de, wTempMoveNameBuffer
ld bc, 14
ld bc, ITEM_NAME_LENGTH + 1
call CopyData ; save the move name because DisplayPartyMenu will overwrite it
ld a, $ff
ld [wUpdateSpritesEnabled], a
@@ -2205,7 +2205,7 @@ ItemUseTMHM:
push af
ld hl, wTempMoveNameBuffer
ld de, wStringBuffer
ld bc, 14
ld bc, ITEM_NAME_LENGTH + 1
call CopyData
pop af
jr nc, .checkIfAbleToLearnMove

View File

@@ -131,7 +131,7 @@ RedrawPartyMenu_::
ld l, a
ld de, wEvoDataBuffer
ld a, BANK(EvosMovesPointerTable)
ld bc, 4 * 3 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
ld bc, wEvoDataBufferEnd - wEvoDataBuffer
call FarCopyData
ld hl, wEvoDataBuffer
ld de, .notAbleToEvolveText

View File

@@ -16,10 +16,10 @@ LoadWildData::
jr z, .NoGrassData ; if no grass data, skip to surfing data
push hl
ld de, wGrassMons ; otherwise, load grass data
ld bc, $14
ld bc, WILDDATA_LENGTH - 1
call CopyData
pop hl
ld bc, $14
ld bc, WILDDATA_LENGTH - 1
add hl, bc
.NoGrassData
ld a, [hli]
@@ -27,7 +27,7 @@ LoadWildData::
and a
ret z ; if no water data, we're done
ld de, wWaterMons ; otherwise, load surfing data
ld bc, $14
ld bc, WILDDATA_LENGTH - 1
jp CopyData
INCLUDE "data/wild/grass_water.asm"

View File

@@ -890,6 +890,7 @@ wDownscaledMonSize::
; FormatMovesString stores the number of moves minus one here
wNumMovesMinusOne:: db
; This union spans 20 bytes.
UNION
; storage buffer for various name strings
wNameBuffer:: ds NAME_BUFFER_LENGTH
@@ -905,7 +906,8 @@ wPayDayMoney:: ds 3
NEXTU
; evolution data for one mon
wEvoDataBuffer:: ds 4 * 3 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
wEvoDataBuffer:: ds NUM_EVOS_IN_BUFFER * 4 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
wEvoDataBufferEnd::
NEXTU
wBattleMenuCurrentPP:: db
@@ -1068,7 +1070,7 @@ wPartyMenuBlkPacket:: ds $30
NEXTU
ds 29
; storage buffer for various strings
wStringBuffer:: ds 20
wStringBuffer:: ds NAME_BUFFER_LENGTH
NEXTU
ds 29
@@ -1206,7 +1208,7 @@ wTrainerPicPointer:: dw
ds 1
UNION
wTempMoveNameBuffer:: ds 14
wTempMoveNameBuffer:: ds ITEM_NAME_LENGTH + 1
NEXTU
; The name of the mon that is learning a move.
@@ -2136,12 +2138,12 @@ wEventFlags:: flag_array NUM_EVENTS
UNION
wGrassRate:: db
wGrassMons:: ds 10 * 2
wGrassMons:: ds WILDDATA_LENGTH - 1
ds 8
wWaterRate:: db
wWaterMons:: ds 10 * 2
wWaterMons:: ds WILDDATA_LENGTH - 1
NEXTU
; linked game's trainer name