Use STRING_BUFFER_LENGTH for the wStringBuffers

This commit is contained in:
Rangi 2020-11-24 20:11:17 -05:00
parent 4ca9f45db7
commit 4613bcfadf
6 changed files with 14 additions and 11 deletions

View File

@ -9,6 +9,8 @@ LAST_TALKED EQU -2
const STRING_BUFFER_5 ; use wStringBuffer5 const STRING_BUFFER_5 ; use wStringBuffer5
NUM_STRING_BUFFERS EQU const_value NUM_STRING_BUFFERS EQU const_value
STRING_BUFFER_LENGTH EQU 19
; checkmoney/takemoney accounts ; checkmoney/takemoney accounts
const_def const_def
const YOUR_MONEY ; 0 const YOUR_MONEY ; 0

View File

@ -1750,7 +1750,7 @@ The exact cause of this bug is unknown.
ld de, wStringBuffer1 ld de, wStringBuffer1
ld a, BANK("Evolutions and Attacks") ld a, BANK("Evolutions and Attacks")
- ld bc, 10 - ld bc, 10
+ ld bc, wStringBuffer2 - wStringBuffer1 + ld bc, STRING_BUFFER_LENGTH
call FarCopyBytes call FarCopyBytes
``` ```

View File

@ -4711,7 +4711,7 @@ GetStatName:
.Copy: .Copy:
ld de, wStringBuffer2 ld de, wStringBuffer2
ld bc, wStringBuffer3 - wStringBuffer2 ld bc, STRING_BUFFER_LENGTH
jp CopyBytes jp CopyBytes
INCLUDE "data/battle/stat_names.asm" INCLUDE "data/battle/stat_names.asm"

View File

@ -73,7 +73,7 @@ AskTeachTMHM:
ChooseMonToLearnTMHM: ChooseMonToLearnTMHM:
ld hl, wStringBuffer2 ld hl, wStringBuffer2
ld de, wTMHMMoveNameBackup ld de, wTMHMMoveNameBackup
ld bc, 12 ld bc, MOVE_NAME_LENGTH - 1
call CopyBytes call CopyBytes
call ClearBGPalettes call ClearBGPalettes
ChooseMonToLearnTMHM_NoRefresh: ChooseMonToLearnTMHM_NoRefresh:
@ -97,7 +97,7 @@ ChooseMonToLearnTMHM_NoRefresh:
push bc push bc
ld hl, wTMHMMoveNameBackup ld hl, wTMHMMoveNameBackup
ld de, wStringBuffer2 ld de, wStringBuffer2
ld bc, 12 ld bc, MOVE_NAME_LENGTH - 1
call CopyBytes call CopyBytes
pop af ; now contains the original contents of af pop af ; now contains the original contents of af
ret ret

View File

@ -1590,7 +1590,7 @@ GetStringBuffer:
CopyConvertedText: CopyConvertedText:
ld hl, wStringBuffer3 ld hl, wStringBuffer3
ld bc, wStringBuffer4 - wStringBuffer3 ld bc, STRING_BUFFER_LENGTH
call AddNTimes call AddNTimes
call CopyName2 call CopyName2
ret ret

View File

@ -1675,7 +1675,8 @@ wBufferMonNick:: ds MON_NAME_LENGTH
wBufferMonOT:: ds NAME_LENGTH wBufferMonOT:: ds NAME_LENGTH
wBufferMon:: party_struct wBufferMon wBufferMon:: party_struct wBufferMon
ds 8 ds 8
wMonOrItemNameBuffer:: ds 22 wMonOrItemNameBuffer:: ds NAME_LENGTH
ds NAME_LENGTH
NEXTU NEXTU
; poke seer ; poke seer
@ -2019,11 +2020,11 @@ ENDU
wTMHMMoveNameBackup:: ds MOVE_NAME_LENGTH wTMHMMoveNameBackup:: ds MOVE_NAME_LENGTH
wStringBuffer1:: ds 19 wStringBuffer1:: ds STRING_BUFFER_LENGTH
wStringBuffer2:: ds 19 wStringBuffer2:: ds STRING_BUFFER_LENGTH
wStringBuffer3:: ds 19 wStringBuffer3:: ds STRING_BUFFER_LENGTH
wStringBuffer4:: ds 19 wStringBuffer4:: ds STRING_BUFFER_LENGTH
wStringBuffer5:: ds 19 wStringBuffer5:: ds STRING_BUFFER_LENGTH
wBattleMenuCursorBuffer:: dw wBattleMenuCursorBuffer:: dw