diff options
author | yenatch <yenatch@gmail.com> | 2014-07-12 09:02:49 -0400 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2014-07-12 09:02:49 -0400 |
commit | fb11ff7e55be56cef9234c8443614f04f2157a1e (patch) | |
tree | a6aa8d0745bd07d0b80090491b5e4b6652de4420 /engine/menu/vending_machine.asm | |
parent | 15427f532085846ab6b51719be687951a094cb6c (diff) | |
parent | 9f29f21d9d43baa7124991dcf3b093fc6c615706 (diff) |
Merge pull request #48 from yenatch/master
Clean up post-split main.asm. Get rid of static wram addresses. Lay out a foundation for Yellow.
Diffstat (limited to 'engine/menu/vending_machine.asm')
-rwxr-xr-x | engine/menu/vending_machine.asm | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm index 1f0ed084..c2968e2f 100755 --- a/engine/menu/vending_machine.asm +++ b/engine/menu/vending_machine.asm @@ -2,41 +2,38 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld hl, VendingMachineText1 call PrintText ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wLastMenuItem], a ; $cc2a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wLastMenuItem], a ; wLastMenuItem ld a, $3 - ld [wMenuWatchedKeys], a ; $cc29 + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld a, $3 - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem ld a, $5 - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, $1 - ld [wTopMenuItemX], a ; $cc25 - ld hl, $d730 + ld [wTopMenuItemX], a ; wTopMenuItemX + ld hl, wd730 set 6, [hl] - FuncCoord 0, 3 ; $c3dc - ld hl, Coord + hlCoord 0, 3 ld b, $8 ld c, $c call TextBoxBorder call UpdateSprites - FuncCoord 2, 5 ; $c406 - ld hl, Coord + hlCoord 2, 5 ld de, DrinkText call PlaceString - FuncCoord 9, 6 ; $c421 - ld hl, Coord + hlCoord 9, 6 ld de, DrinkPriceText call PlaceString - ld hl, $d730 + ld hl, wd730 res 6, [hl] call HandleMenuInput bit 1, a jr nz, .asm_74f93 - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $3 jr z, .asm_74f93 xor a @@ -69,12 +66,11 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld hl, VendingMachineText5 call PrintText ld hl, $ffde - ld de, wPlayerMoney + 2 ; $d349 + ld de, wPlayerMoney + 2 ; wd349 ld c, $3 - ld a, $c - call Predef ; indirect jump to Func_f836 (f836 (3:7836)) + predef SubBCDPredef ld a, $13 - ld [$d125], a + ld [wd125], a jp DisplayTextBoxID .BagFull ld hl, VendingMachineText6 @@ -116,7 +112,7 @@ VendingMachineText7: ; 74fe2 (1d:4fe2) Func_74fe7: ; 74fe7 (1d:4fe7) ld hl, VendingPrices - ld a, [$cc26] + ld a, [wCurrentMenuItem] add a add a ld d, $0 |