Skip to content

Commit

Permalink
Rename some labels
Browse files Browse the repository at this point in the history
- Remove "Buffer" suffix from some byte and word quantities
- Change "Ptr" to "Pointer"

Fixes #789
  • Loading branch information
Rangi42 committed Dec 23, 2020
1 parent 1a05466 commit 99e66c2
Show file tree
Hide file tree
Showing 106 changed files with 584 additions and 578 deletions.
4 changes: 2 additions & 2 deletions audio/engine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ _UpdateSound::
ret

UpdateChannels:
ld hl, .ChannelFnPtrs
ld hl, .ChannelFunctions
ld a, [wCurChannel]
maskbits NUM_CHANNELS
add a
Expand All @@ -222,7 +222,7 @@ UpdateChannels:
ld l, a
jp hl

.ChannelFnPtrs:
.ChannelFunctions:
dw .Channel1
dw .Channel2
dw .Channel3
Expand Down
6 changes: 3 additions & 3 deletions data/text/battle.asm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ SandstormHitsText:
PerishCountText:
text "<USER>'s"
line "PERISH count is @"
text_decimal wDeciramBuffer, 1, 1
text_decimal wTextDecimalByte, 1, 1
text "!"
prompt

Expand Down Expand Up @@ -670,7 +670,7 @@ SpiteEffectText:
text_ram wStringBuffer1
text " was"
cont "reduced by @"
text_decimal wDeciramBuffer, 1, 1
text_decimal wTextDecimalByte, 1, 1
text "!"
prompt

Expand Down Expand Up @@ -1030,7 +1030,7 @@ SafeguardProtectText:

MagnitudeText:
text "Magnitude @"
text_decimal wDeciramBuffer, 1, 1
text_decimal wTextDecimalByte, 1, 1
text "!"
prompt

Expand Down
10 changes: 5 additions & 5 deletions data/text/common_2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ _NameCardListedCardText::
text_ram wMysteryGiftCardHolderName
text "'s CARD was"
line "listed as no.@"
text_decimal wDeciramBuffer, 1, 2
text_decimal wTextDecimalByte, 1, 2
text "."
prompt

Expand Down Expand Up @@ -609,7 +609,7 @@ _AskThrowAwayText::

_AskQuantityThrowAwayText::
text "Throw away @"
text_decimal wItemQuantityChangeBuffer, 1, 2
text_decimal wItemQuantityChange, 1, 2
text_start
line "@"
text_ram wStringBuffer2
Expand Down Expand Up @@ -1110,7 +1110,7 @@ _PlayersPCHowManyWithdrawText::

_PlayersPCWithdrewItemsText::
text "Withdrew @"
text_decimal wItemQuantityChangeBuffer, 1, 2
text_decimal wItemQuantityChange, 1, 2
text_start
line "@"
text_ram wStringBuffer2
Expand All @@ -1133,7 +1133,7 @@ _PlayersPCHowManyDepositText::

_PlayersPCDepositItemsText::
text "Deposited @"
text_decimal wItemQuantityChangeBuffer, 1, 2
text_decimal wItemQuantityChange, 1, 2
text_start
line "@"
text_ram wStringBuffer2
Expand Down Expand Up @@ -1390,7 +1390,7 @@ _ItemsTossOutHowManyText::

_ItemsThrowAwayText::
text "Throw away @"
text_decimal wItemQuantityChangeBuffer, 1, 2
text_decimal wItemQuantityChange, 1, 2
text_start
line "@"
text_ram wStringBuffer2
Expand Down
6 changes: 3 additions & 3 deletions data/text/common_3.asm
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ _MartHowManyText::
done

_MartFinalPriceText::
text_decimal wItemQuantityChangeBuffer, 1, 2
text_decimal wItemQuantityChange, 1, 2
text " @"
text_ram wStringBuffer2
text "(S)"
Expand Down Expand Up @@ -509,7 +509,7 @@ _HerbalLadyHowManyText::
done

_HerbalLadyFinalPriceText::
text_decimal wItemQuantityChangeBuffer, 1, 2
text_decimal wItemQuantityChange, 1, 2
text " @"
text_ram wStringBuffer2
text "(S)"
Expand Down Expand Up @@ -592,7 +592,7 @@ _PharmacyHowManyText::
done

_PharmacyFinalPriceText::
text_decimal wItemQuantityChangeBuffer, 1, 2
text_decimal wItemQuantityChange, 1, 2
text " @"
text_ram wStringBuffer2
text "(S)"
Expand Down
4 changes: 2 additions & 2 deletions docs/event_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ If <code><i>item_id</i></code> = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` i
## `$49`: `closetext`


## `$4A`: <code>writeunusedbytebuffer <i>byte</i></code>
## `$4A`: <code>writeunusedbyte <i>byte</i></code>

<code>[<i>wUnusedScriptByteBuffer</i>] = <i>byte</i></code>
<code>[<i>wUnusedScriptByte</i>] = <i>byte</i></code>


## `$4B`: <code>farwritetext <i>text_pointer</i></code>
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/ai/items.asm
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ PrintText_UsedItemOn_AND_AIUpdateHUD:

PrintText_UsedItemOn:
ld a, [wCurEnemyItem]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
call GetItemName
ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
Expand Down
48 changes: 24 additions & 24 deletions engine/battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ HandleBerserkGene:
push bc
callfar GetUserItem
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
sub BERSERK_GENE
pop bc
pop de
Expand Down Expand Up @@ -1161,7 +1161,7 @@ HandlePerishSong:
ret z
dec [hl]
ld a, [hl]
ld [wDeciramBuffer], a
ld [wTextDecimalByte], a
push af
ld hl, PerishCountText
call StdBattleTextbox
Expand Down Expand Up @@ -1235,7 +1235,7 @@ HandleWrap:
ret nz

ld a, [de]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
ld [wFXAnimID], a
call GetMoveName
dec [hl]
Expand Down Expand Up @@ -1288,7 +1288,7 @@ HandleLeftovers:

callfar GetUserItem
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
call GetItemName
ld a, b
cp HELD_LEFTOVERS
Expand Down Expand Up @@ -1434,7 +1434,7 @@ HandleMysteryberry:
.skip_checks
callfar GetUserItem
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
xor a
ld [hl], a
call GetPartymonItem
Expand Down Expand Up @@ -3703,7 +3703,7 @@ TryToRunAwayFromBattle:
push hl
push de
ld a, [wBattleMonItem]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
ld b, a
callfar GetItemHeldEffect
ld a, b
Expand Down Expand Up @@ -4025,7 +4025,7 @@ SendOutPlayerMon:
call GetBattleMonBackpic
xor a
ldh [hGraphicStartTile], a
ld [wBattleMenuCursorBuffer], a
ld [wBattleMenuCursorPosition], a
ld [wCurMoveNum], a
ld [wTypeModifier], a
ld [wPlayerMoveStruct + MOVE_ANIM], a
Expand Down Expand Up @@ -4343,7 +4343,7 @@ UseOpponentItem:
call RefreshBattleHuds
callfar GetOpponentItem
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
call GetItemName
callfar ConsumeHeldItem
ld hl, RecoveredUsingText
Expand Down Expand Up @@ -4437,7 +4437,7 @@ UseConfusionHealingItem:

.heal_status
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVarAddr
res SUBSTATUS_CONFUSED, [hl]
Expand Down Expand Up @@ -4504,7 +4504,7 @@ HandleStatBoostingHeldItems:
jr nz, .loop
pop bc
ld a, [bc]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a
push bc
dec hl
dec hl
Expand Down Expand Up @@ -4899,7 +4899,7 @@ BattleMenu:
.next
ld a, $1
ldh [hBGMapMode], a
ld a, [wBattleMenuCursorBuffer]
ld a, [wBattleMenuCursorPosition]
cp $1
jp z, BattleMenu_Fight
cp $3
Expand Down Expand Up @@ -5003,7 +5003,7 @@ BattleMenu_Pack:
and a
jr nz, .run
callfar CheckItemPocket
ld a, [wItemAttributeParamBuffer]
ld a, [wItemAttributeValue]
cp BALL
jr z, .ball
call ClearBGPalettes
Expand Down Expand Up @@ -5427,7 +5427,7 @@ MoveSelectionScreen:

.battle_player_moves
call MoveInfoBox
ld a, [wMoveSwapBuffer]
ld a, [wSwappingMove]
and a
jr z, .interpret_joypad
hlcoord 5, 13
Expand All @@ -5451,7 +5451,7 @@ MoveSelectionScreen:
push af

xor a
ld [wMoveSwapBuffer], a
ld [wSwappingMove], a
ld a, [wMenuCursorY]
dec a
ld [wMenuCursorY], a
Expand Down Expand Up @@ -5542,7 +5542,7 @@ MoveSelectionScreen:
jp .menu_loop

.pressed_select
ld a, [wMoveSwapBuffer]
ld a, [wSwappingMove]
and a
jr z, .start_swap
ld hl, wBattleMonMoves
Expand All @@ -5560,14 +5560,14 @@ MoveSelectionScreen:
ld a, [hl]
and $f
ld b, a
ld a, [wMoveSwapBuffer]
ld a, [wSwappingMove]
swap a
add b
ld [hl], a
jr .swap_moves_in_party_struct

.not_swapping_disabled_move
ld a, [wMoveSwapBuffer]
ld a, [wSwappingMove]
cp b
jr nz, .swap_moves_in_party_struct
ld a, [hl]
Expand Down Expand Up @@ -5595,12 +5595,12 @@ MoveSelectionScreen:

.transformed
xor a
ld [wMoveSwapBuffer], a
ld [wSwappingMove], a
jp MoveSelectionScreen

.swap_bytes
push hl
ld a, [wMoveSwapBuffer]
ld a, [wSwappingMove]
dec a
ld c, a
ld b, 0
Expand All @@ -5622,7 +5622,7 @@ MoveSelectionScreen:

.start_swap
ld a, [wMenuCursorY]
ld [wMoveSwapBuffer], a
ld [wSwappingMove], a
jp MoveSelectionScreen

MoveInfoBox:
Expand Down Expand Up @@ -5717,7 +5717,7 @@ MoveInfoBox:
inc hl
ld [hl], "/"
inc hl
ld de, wNamedObjectIndexBuffer
ld de, wNamedObjectIndex
lb bc, 1, 2
call PrintNum
ret
Expand Down Expand Up @@ -6383,7 +6383,7 @@ LoadEnemyMon:
ld [de], a

ld a, [wTempEnemyMonSpecies]
ld [wNamedObjectIndexBuffer], a
ld [wNamedObjectIndex], a

call GetPokemonName

Expand Down Expand Up @@ -8044,7 +8044,7 @@ BattleIntro:
call LoadTrainerOrWildMonPic
xor a
ld [wTempBattleMonSpecies], a
ld [wBattleMenuCursorBuffer], a
ld [wBattleMenuCursorPosition], a
xor a
ldh [hMapAnims], a
farcall PlayBattleMusic
Expand Down Expand Up @@ -8300,7 +8300,7 @@ CleanUpBattleRAM:
ld [wPartyMenuCursor], a
ld [wKeyItemsPocketCursor], a
ld [wItemsPocketCursor], a
ld [wBattleMenuCursorBuffer], a
ld [wBattleMenuCursorPosition], a
ld [wCurMoveNum], a
ld [wBallsPocketCursor], a
ld [wLastPocket], a
Expand Down
Loading

0 comments on commit 99e66c2

Please sign in to comment.