From be0c7962b00e612543a8d3653cc9a876e68adf70 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 4 Dec 2013 02:49:12 -0500 Subject: [PATCH] YesNoBox --- engine/scripting.asm | 4 +- event/name_rater.asm | 4 +- home/menu.asm | 21 ++++----- items/item_effects.asm | 4 +- main.asm | 96 +++++++++++++++++++++--------------------- 5 files changed, 65 insertions(+), 64 deletions(-) diff --git a/engine/scripting.asm b/engine/scripting.asm index df1215f40..f0d064d8e 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -455,7 +455,7 @@ Script_keeptextopen: ; 0x96edc Script_yesorno: ; 0x96eed ; script command 0x4e - call Function1dcf + call YesNoBox ld a, $0 jr c, .asm_96ef6 ; 0x96ef2 $2 ld a, $1 @@ -792,7 +792,7 @@ Script_askforphonenumber: ; 0x970be ; parameters: ; number (SingleByteParam) - call Function1dcf + call YesNoBox jr c, .asm_970d6 ; 0x970c1 $13 call GetScriptByte ld c, a diff --git a/event/name_rater.asm b/event/name_rater.asm index e979bfee1..3f2bf3912 100644 --- a/event/name_rater.asm +++ b/event/name_rater.asm @@ -1,7 +1,7 @@ NameRater: ; fb6ed ld hl, UnknownText_0xfb80f call PrintText - call Function1dcf + call YesNoBox jp c, .asm_fb77e ld hl, UnknownText_0xfb814 call PrintText @@ -15,7 +15,7 @@ NameRater: ; fb6ed jr c, .asm_fb779 ld hl, UnknownText_0xfb819 call PrintText - call Function1dcf + call YesNoBox jr c, .asm_fb77e ld hl, UnknownText_0xfb81e call PrintText diff --git a/home/menu.asm b/home/menu.asm index bb613b8b8..6a8b8628a 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -124,19 +124,20 @@ Function1db8: ; 0x1db8 ; 0x1dcf -Function1dcf: ; 1dcf - ld bc, $0e07 +YesNoBox: ; 1dcf + lb bc, 14, 7 -Function1dd2: ; 1dd2 - jr Function1dd9 +PlaceYesNoBox: ; 1dd2 + jr _YesNoBox Function1dd4: ; 1dd4 call LoadMenuDataHeader jr Function1dfe -Function1dd9: ; 1dd9 +_YesNoBox: ; 1dd9 +; Return nc (yes) or c (no). push bc - ld hl, MenuDataHeader_0x1e1d + ld hl, YesNoMenuDataHeader call Function1d3c pop bc ld a, b @@ -165,7 +166,7 @@ Function1dfe: ; 1dfe pop af jr c, .asm_1e16 ld a, [$cfa9] - cp $2 + cp 2 ; no jr z, .asm_1e16 and a ret @@ -177,15 +178,15 @@ Function1dfe: ; 1dfe ret ; 1e1d -MenuDataHeader_0x1e1d: ; 1e1d +YesNoMenuDataHeader: ; 1e1d db $40 ; tile backup db 5, 10 ; start coords db 9, 15 ; end coords - dw MenuData2_0x1e25 + dw YesNoMenuData2 db 1 ; default option ; 1e25 -MenuData2_0x1e25: ; 1e25 +YesNoMenuData2: ; 1e25 db $c0 ; flags db 2 db "YES@" diff --git a/items/item_effects.asm b/items/item_effects.asm index 0877d3cb6..c0f031bc0 100644 --- a/items/item_effects.asm +++ b/items/item_effects.asm @@ -367,7 +367,7 @@ ParkBall: ; e8a2 ld [$d265], a call $343b - call $1dcf + call YesNoBox jp c, $6be2 @@ -430,7 +430,7 @@ ParkBall: ; e8a2 ld [$d265], a call $343b - call $1dcf + call YesNoBox jr c, .asm_ebaf diff --git a/main.asm b/main.asm index 01f337c62..a6a6abab9 100644 --- a/main.asm +++ b/main.asm @@ -5507,7 +5507,7 @@ Function6520: ; 6520 Function65b5: ; 65b5 ld hl, UnknownText_0x6675 call PrintText - call Function1dcf + call YesNoBox jp c, Function6520 ld hl, UnknownText_0x667a call PrintText @@ -5526,7 +5526,7 @@ Function65d3: ; 65d3 push hl ld hl, UnknownText_0x667f call PrintText - call Function1dcf + call YesNoBox pop hl ret c ld bc, $fffc @@ -14021,8 +14021,8 @@ Functione6ce: ; e6ce ld [$d265], a callba Functioncc0c7 callba Functioncc000 - ld bc, $0e07 - call Function1dd2 + lb bc, 14, 7 + call PlaceYesNoBox ret c .asm_e6ea @@ -18704,7 +18704,7 @@ Function129f4: ; 129f4 jr c, .asm_12a42 ld hl, $6a4a call Function1d4f - call Function1dcf + call YesNoBox push af call Function1c07 pop af @@ -19138,7 +19138,7 @@ Function12cea: ; 12cea (4:6cea) Function12cf5: ; 12cf5 call Function1d4f - call Function1dcf + call YesNoBox jp Function1c07 ; 12cfe @@ -22788,7 +22788,7 @@ Function14a83: ; 14a83 (5:4a83) push de ld hl, $52a1 call Function1d4f - call Function1dcf + call YesNoBox call Function1c07 jr c, .asm_14ab0 call Function14b89 @@ -22895,8 +22895,8 @@ Function14baf: ; 14baf ld b, $5 call Function269a call Function1d58 - ld bc, $0007 - call Function1dd2 + lb bc, 0, 7 + call PlaceYesNoBox ld a, [$cfa9] dec a call Function1c17 @@ -25101,7 +25101,7 @@ Function15d97: ; 15d97 call Predef ld a, $1 call Function15c7d - call Function1dcf + call YesNoBox ret ; 15da5 @@ -25264,7 +25264,7 @@ Function15efd: ; 15efd call ClearBox ld hl, UnknownText_0x15f78 call PrintTextBoxText - call Function1dcf + call YesNoBox jr c, .asm_15f6e ld de, Money ld bc, $ffc3 @@ -25664,14 +25664,14 @@ Function16781: ; 16781 .asm_16788 call Function1689b - call Function1dcf + call YesNoBox ret ; 1678f Function1678f: ; 1678f set 7, [hl] call Function1689b - call Function1dcf + call YesNoBox ret ; 16798 @@ -25746,18 +25746,18 @@ Function16807: ; 16807 jr nz, .asm_16819 ld a, $f call Function1689b - call Function1dcf + call YesNoBox jr c, .asm_16844 jr .asm_1682d .asm_16819 ld a, $b call Function1689b - call Function1dcf + call YesNoBox jr c, .asm_16844 ld a, $c call Function1689b - call Function1dcf + call YesNoBox jr c, .asm_16844 .asm_1682d @@ -25856,7 +25856,7 @@ Function16936: ; 16936 .asm_16949 ld hl, $6993 call PrintText - call Function1dcf + call YesNoBox jr c, .asm_1697c ld a, [PartyCount] cp $6 @@ -26762,7 +26762,7 @@ Function16f7a: ; 16f7a (5:6f7a) push de ld hl, $70ba call PrintText - call Function1dcf + call YesNoBox pop de jr c, .asm_17074 ld a, $1 @@ -27494,7 +27494,7 @@ Function20051: ; 20051 (8:4051) call Function2011f ld hl, $40b0 call PrintText - call Function1dcf + call YesNoBox jr c, .asm_200ad ld a, [$d1ed] ld [StringBuffer2], a ; $d086 @@ -30871,7 +30871,7 @@ INCBIN "baserom.gbc",$254a7,$265d3 - $254a7 ProfOaksPC: ; 0x265d3 ld hl, OakPCText1 call Function1d4f - call Function1dcf + call YesNoBox jr c, .shutdown call ProfOaksPCBoot ; player chose "yes"? .shutdown @@ -36330,7 +36330,7 @@ Function2c545: ; 2c545 (b:4545) Function2c547: ; 2c547 ld hl, $45ef call PrintText - call Function1dcf + call YesNoBox jr c, .asm_2c5c3 ld hl, $45f4 call PrintText @@ -36361,7 +36361,7 @@ Function2c547: ; 2c547 call GetMoveName ld hl, $45d6 call PrintText - call Function1dcf + call YesNoBox pop bc jr c, .asm_2c5c3 call Function2c5f9 @@ -36671,7 +36671,7 @@ Function2c7bf: ; 2c7bf (b:47bf) call PrintText ld hl, $48c9 call PrintText - call Function1dcf + call YesNoBox .asm_2c7f5 pop bc ld a, b @@ -41446,8 +41446,8 @@ Function3d1f8: ; 3d1f8 ld hl, BattleText_0x80a83 call StdBattleTextBox .asm_3d20a - ld bc, $0107 - call Function1dd2 + lb bc, 1, 7 + call PlaceYesNoBox ld a, [$cfa9] jr c, .asm_3d217 and a @@ -42253,8 +42253,8 @@ Function3d74b: ; 3d74b callab Function39939 ld hl, BattleText_0x80aca call StdBattleTextBox - ld bc, $0107 - call Function1dd2 + lb bc, 1, 7 + call PlaceYesNoBox ld a, [$cfa9] dec a jr nz, .asm_3d79a @@ -51746,7 +51746,7 @@ Function4484a: ; 0x4484a .PutInPack ; 0x44877 ld hl, .MessageLostText call Function1d4f - call Function1dcf + call YesNoBox call Function1c07 ret c ld a, [MenuSelection] @@ -55963,7 +55963,7 @@ Function4a9d7: ; 4a9d7 call CopyBytes ld hl, $6a1d call PrintText - call Function1dcf + call YesNoBox ret ; 4aa1d @@ -56576,7 +56576,7 @@ Function4ae12: ; 4ae12 Function4ae1f: ; 4ae1f ld bc, $0e07 push bc - ld hl, MenuDataHeader_0x1e1d + ld hl, YesNoMenuDataHeader call Function1d3c pop bc ld a, b @@ -58012,7 +58012,7 @@ Function4db35: ; 4db35 Function4db3b: ; 4db3b ld hl, $5b44 call PrintText - jp Function1dcf + jp YesNoBox ; 4db44 INCBIN "baserom.gbc",$4db44,$4db49 - $4db44 @@ -71541,7 +71541,7 @@ Function8afd4: ; 8afd4 call GetItemName ld hl, $7077 call Function105a - call Function1dcf + call YesNoBox jr c, .asm_8afeb ld a, [$cf75] call Function8b154 @@ -77268,7 +77268,7 @@ Function90672: ; 90672 (24:4672) call Function90783 ld hl, $4886 call PrintText - call Function1dcf + call YesNoBox jr nc, .asm_9072e call Function90783 jr .asm_906e8 @@ -77295,7 +77295,7 @@ Function90672: ; 90672 (24:4672) call Function90783 ld hl, $48a4 call PrintText - call Function1dcf + call YesNoBox jr nc, .asm_90773 call Function90783 jr .asm_9072e @@ -77543,7 +77543,7 @@ Function90913: ; 90913 call Function1ad2 ld hl, $4a44 call PrintText - call Function1dcf + call YesNoBox jr c, .asm_90936 ld a, [DefaultFlypoint] ld [StringBuffer2], a @@ -81382,8 +81382,8 @@ Function930e9: ; 930e9 (24:70e9) ld hl, UnknownText_9311f call PrintText call Function1d58 - ld bc, $e0c - call Function1dd2 + lb bc, 14, 12 + call PlaceYesNoBox ld a, [$cfa9] dec a call Function1c17 @@ -94973,7 +94973,7 @@ Functione01b0: ; e01b0 Functione01b5: ; e01b5 ld hl, UnknownText_0xe01cd call Functione0489 - call Function1dcf + call YesNoBox jr c, .asm_e01c7 call Functione0366 call Functione01b0 @@ -95177,7 +95177,7 @@ Functione031e: ; e031e call ClearSprites ld hl, UnknownText_0xe0356 call Functione0489 - call Function1dcf + call YesNoBox jr nc, .asm_e0330 call Functione01b0 ret @@ -96629,8 +96629,8 @@ Functione24e0: ; e24e0 (38:64e0) ld de, $74f4 call Functione2a6e call Function1d6e - ld bc, $e0b - call Function1dd2 + lb bc, 14, 11 + call PlaceYesNoBox ld a, [$cfa9] dec a call Function1c07 @@ -96867,8 +96867,8 @@ Functione26d8: ; e26d8 (38:66d8) ld de, $74f4 call Functione2a6e call Function1d6e - ld bc, $e0b - call Function1dd2 + lb bc, 14, 11 + call PlaceYesNoBox ld a, [$cfa9] dec a call Function1c07 @@ -102762,7 +102762,7 @@ Functionfcba8: ; fcba8 jr nz, .asm_fcc03 ld a, $0 call Functionfcf38 - call Function1dcf + call YesNoBox ld a, $1 jr c, .asm_fcc03 ld b, $6 @@ -105583,7 +105583,7 @@ Function102142: ; 102142 call Function10219f ld hl, $61d6 call Function1d4f - call Function1dcf + call YesNoBox call Function1c07 jr c, .asm_10217c call Function1021b8 @@ -105686,7 +105686,7 @@ Function10366e: ; 10366e jr z, .asm_10369b ld hl, $775d call PrintText - call Function1dcf + call YesNoBox jr c, .asm_103696 callba Function8b1e1 jr nc, .asm_103690 @@ -105710,7 +105710,7 @@ Function10366e: ; 10366e jr nz, .asm_1036b5 ld hl, $7762 call PrintText - call Function1dcf + call YesNoBox jr c, .asm_1036b5 call Function1036f9 call Functiona36 @@ -105857,7 +105857,7 @@ Function1037c2: ; 1037c2 jr z, .asm_1037de ld hl, $77e6 call PrintText - call Function1dcf + call YesNoBox jr c, .asm_1037de ld a, $1 ld [ScriptVar], a