From cd649184f556db777d592671a7274bfa4a8423d7 Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 3 Jul 2015 14:37:53 -0500 Subject: Rename/organize part 1 of 4 rename functions, clean up address/wram comments, other misc only broken up so that all changes are viewable on github --- engine/menu/vending_machine.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/menu/vending_machine.asm') diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm index 88cfcf65..d5209440 100755 --- a/engine/menu/vending_machine.asm +++ b/engine/menu/vending_machine.asm @@ -52,9 +52,9 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld c, 1 call GiveItem jr nc, .BagFull - ld b, $3c ; number of times to play the "brrrrr" sound -.playDeliverySound ; 0x74f63 - ld c, $2 + ld b, 60 ; number of times to play the "brrrrr" sound +.playDeliverySound + ld c, 2 call DelayFrames push bc ld a, (SFX_02_53 - SFX_Headers_02) / 3 -- cgit v1.2.3 From aa3da5f3b07b8965bf7d4f1b5449ce67bed4fb87 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 17 Jul 2015 00:16:27 -0700 Subject: title / diploma / vending machine --- engine/menu/vending_machine.asm | 43 +++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'engine/menu/vending_machine.asm') diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm index d5209440..0c585687 100755 --- a/engine/menu/vending_machine.asm +++ b/engine/menu/vending_machine.asm @@ -7,19 +7,19 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) xor a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld a, $3 + ld a, A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a - ld a, $3 + ld a, 3 ld [wMaxMenuItem], a - ld a, $5 + ld a, 5 ld [wTopMenuItemY], a - ld a, $1 + ld a, 1 ld [wTopMenuItemX], a ld hl, wd730 set 6, [hl] hlCoord 0, 3 - ld b, $8 - ld c, $c + ld b, 8 + ld c, 12 call TextBoxBorder call UpdateSprites hlCoord 2, 5 @@ -31,11 +31,11 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld hl, wd730 res 6, [hl] call HandleMenuInput - bit 1, a - jr nz, .asm_74f93 + bit 1, a ; pressed B? + jr nz, .notThirsty ld a, [wCurrentMenuItem] - cp $3 - jr z, .asm_74f93 + cp 3 ; chose Cancel? + jr z, .notThirsty xor a ld [$ff9f], a ld [$ffa1], a @@ -46,12 +46,13 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld hl, VendingMachineText4 jp PrintText .enoughMoney - call Func_74fe7 - ld a, [$ffdb] + call LoadVendingMachineItem + ld a, [hVendingMachineItem] ld b, a ld c, 1 call GiveItem jr nc, .BagFull + ld b, 60 ; number of times to play the "brrrrr" sound .playDeliverySound ld c, 2 @@ -62,10 +63,10 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) pop bc dec b jr nz, .playDeliverySound -.asm_74f72 + ld hl, VendingMachineText5 call PrintText - ld hl, $ffde + ld hl, hVendingMachinePrice + 2 ld de, wPlayerMoney + 2 ld c, $3 predef SubBCDPredef @@ -75,7 +76,7 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) .BagFull ld hl, VendingMachineText6 jp PrintText -.asm_74f93 +.notThirsty ld hl, VendingMachineText7 jp PrintText @@ -110,22 +111,22 @@ VendingMachineText7: ; 74fe2 (1d:4fe2) TX_FAR _VendingMachineText7 db "@" -Func_74fe7: ; 74fe7 (1d:4fe7) +LoadVendingMachineItem: ; 74fe7 (1d:4fe7) ld hl, VendingPrices ld a, [wCurrentMenuItem] add a add a - ld d, $0 + ld d, 0 ld e, a add hl, de ld a, [hli] - ld [$ffdb], a + ld [hVendingMachineItem], a ld a, [hli] - ld [$ffdc], a + ld [hVendingMachinePrice], a ld a, [hli] - ld [$ffdd], a + ld [hVendingMachinePrice + 1], a ld a, [hl] - ld [$ffde], a + ld [hVendingMachinePrice + 2], a ret VendingPrices: ; 75000 (1d:5000) -- cgit v1.2.3 From 6931ce96259d366263c63e704dfaac6f241d8e4a Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 17 Jul 2015 01:21:40 -0700 Subject: money / coins hram constants --- engine/menu/vending_machine.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/menu/vending_machine.asm') diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm index 0c585687..07cf8854 100755 --- a/engine/menu/vending_machine.asm +++ b/engine/menu/vending_machine.asm @@ -37,10 +37,10 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) cp 3 ; chose Cancel? jr z, .notThirsty xor a - ld [$ff9f], a - ld [$ffa1], a + ld [hMoney], a + ld [hMoney + 2], a ld a, $2 - ld [$ffa0], a + ld [hMoney + 1], a call HasEnoughMoney jr nc, .enoughMoney ld hl, VendingMachineText4 -- cgit v1.2.3 From 148d3f3cf28f9c270e3d5043af0692d95bc731c5 Mon Sep 17 00:00:00 2001 From: dannye Date: Sat, 18 Jul 2015 15:52:03 -0500 Subject: Consolidate coord macros --- engine/menu/vending_machine.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/menu/vending_machine.asm') diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm index 07cf8854..0f6c6a13 100755 --- a/engine/menu/vending_machine.asm +++ b/engine/menu/vending_machine.asm @@ -17,15 +17,15 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld [wTopMenuItemX], a ld hl, wd730 set 6, [hl] - hlCoord 0, 3 + coord hl, 0, 3 ld b, 8 ld c, 12 call TextBoxBorder call UpdateSprites - hlCoord 2, 5 + coord hl, 2, 5 ld de, DrinkText call PlaceString - hlCoord 9, 6 + coord hl, 9, 6 ld de, DrinkPriceText call PlaceString ld hl, wd730 -- cgit v1.2.3 From ea9cc86949cecc3508aeac06b807372b6b0134d8 Mon Sep 17 00:00:00 2001 From: dannye Date: Sun, 19 Jul 2015 03:46:12 -0500 Subject: Name sound effects --- engine/menu/vending_machine.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/menu/vending_machine.asm') diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm index 0f6c6a13..8460889f 100755 --- a/engine/menu/vending_machine.asm +++ b/engine/menu/vending_machine.asm @@ -58,7 +58,7 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld c, 2 call DelayFrames push bc - ld a, (SFX_02_53 - SFX_Headers_02) / 3 + ld a, SFX_PUSH_BOULDER call PlaySound pop bc dec b -- cgit v1.2.3