ref: e607199397cb36565f61703a58d99efdc21891c5
parent: 02bd91b7076165653a900a8e39c12a92a9bd2976
author: YamaArashi <shadow962@live.com>
date: Sun Jul 19 10:01:08 EDT 2015
replace uses of minus one
--- a/engine/HoF_room_pc.asm
+++ b/engine/HoF_room_pc.asm
@@ -29,7 +29,7 @@
ld c, 128
call DelayFrames
xor a
- ld [wNumCreditsMonsDisplayed - 1], a ; not read
+ ld [wUnusedCD3D], a ; not read
ld [wNumCreditsMonsDisplayed], a
jp Credits
--- a/engine/menu/prize_menu.asm
+++ b/engine/menu/prize_menu.asm
@@ -179,7 +179,7 @@
ld hl,wd141 ; first prize's price
add hl,de ; get selected prize's price
xor a
- ld [hCoins - 1],a
+ ld [hUnusedCoinsByte],a
ld a,[hli]
ld [hCoins],a
ld a,[hl]
--- a/engine/overworld/hidden_items.asm
+++ b/engine/overworld/hidden_items.asm
@@ -67,7 +67,7 @@
and a
ret nz
xor a
- ld [hCoins - 1], a
+ ld [hUnusedCoinsByte], a
ld [hCoins], a
ld [hCoins + 1], a
ld a, [wHiddenObjectFunctionArgument]
--- a/hram.asm
+++ b/hram.asm
@@ -137,6 +137,9 @@
; 1 = target is to the west
hNPCPlayerRelativePosFlags EQU $FF9D
+; some code zeroes this for no reason when writing a coin amount
+hUnusedCoinsByte EQU $FF9F
+
hMoney EQU $FF9F ; 3-byte BCD number
hCoins EQU $FFA0 ; 2-byte BCD number
--- a/scripts/celadongamecorner.asm
+++ b/scripts/celadongamecorner.asm
@@ -170,7 +170,7 @@
ld c, $3
predef SubBCDPredef
xor a
- ld [hCoins - 1], a
+ ld [hUnusedCoinsByte], a
ld [hCoins], a
ld a, $50
ld [hCoins + 1], a
@@ -238,7 +238,7 @@
call Has9990Coins
jr nc, .asm_48d8e
xor a
- ld [hCoins - 1], a
+ ld [hUnusedCoinsByte], a
ld [hCoins], a
ld a, $10
ld [hCoins + 1], a
@@ -320,7 +320,7 @@
call Has9990Coins
jr nc, .asm_48e18
xor a
- ld [hCoins - 1], a
+ ld [hUnusedCoinsByte], a
ld [hCoins], a
ld a, $20
ld [hCoins + 1], a
@@ -373,7 +373,7 @@
call Has9990Coins
jr z, .asm_48e7a
xor a
- ld [hCoins - 1], a
+ ld [hUnusedCoinsByte], a
ld [hCoins], a
ld a, $20
ld [hCoins + 1], a
--- a/wram.asm
+++ b/wram.asm
@@ -733,6 +733,8 @@
; which entry from TradeMons to select
wTrainerSpriteOffset:: ; cd3d
+
+wUnusedCD3D:: ; cd3d
ds 1
wSSAnneSmokeX:: ; cd3e