From 4fa6c6daa46935c7580a60a22bd9216414246dc0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 16 Oct 2015 13:35:43 -0400 Subject: Split up bank 2; other relabelings --- home/menu.asm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'home/menu.asm') diff --git a/home/menu.asm b/home/menu.asm index 82bac3b99..bc7751a0b 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -81,16 +81,16 @@ InterpretMenu2:: ; 0x1d81 call Function1c66 ld a, [wcf91] bit 7, a - jr z, .asm_1da7 ; 0x1d98 $d + jr z, .cancel ; 0x1d98 $d call Function1c10 call Function1bc9 call Function1ff8 bit 1, a - jr z, .asm_1da9 ; 0x1da5 $2 -.asm_1da7 + jr z, .okay ; 0x1da5 $2 +.cancel scf ret -.asm_1da9 +.okay and a ret ; 0x1dab @@ -165,15 +165,15 @@ Function1dfe:: ; 1dfe call DelayFrames call WriteBackup pop af - jr c, .asm_1e16 + jr c, .no ld a, [wcfa9] cp 2 ; no - jr z, .asm_1e16 + jr z, .no and a ret -.asm_1e16 - ld a, $2 +.no + ld a, 2 ld [wcfa9], a scf ret @@ -308,7 +308,7 @@ Function1ebd:: ; 1ebd ; 1eda Function1eda:: ; 1eda - call Function1cfd + call GetMemTileCoord ld bc, $002a add hl, bc .asm_1ee1 @@ -521,13 +521,13 @@ Function1ff0:: ; 1ff0 Function1ff8:: ; 1ff8 push af and $3 - jr z, .asm_2007 + jr z, .nosound ld hl, wcf81 bit 3, [hl] - jr nz, .asm_2007 + jr nz, .nosound call PlayClickSFX -.asm_2007 +.nosound pop af ret ; 2009 -- cgit v1.2.3 From f53d65c536096213b6826765f81a0f436c88fe72 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 17 Oct 2015 17:18:52 -0400 Subject: Battle intro animation function --- home/menu.asm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'home/menu.asm') diff --git a/home/menu.asm b/home/menu.asm index bc7751a0b..e82511895 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -131,9 +131,9 @@ YesNoBox:: ; 1dcf PlaceYesNoBox:: ; 1dd2 jr _YesNoBox -Function1dd4:: ; 1dd4 +PlaceGenericTwoOptionBox:: ; 1dd4 call LoadMenuDataHeader - jr Function1dfe + jr InterpretTwoOptionMenu _YesNoBox:: ; 1dd9 ; Return nc (yes) or c (no). @@ -141,13 +141,15 @@ _YesNoBox:: ; 1dd9 ld hl, YesNoMenuDataHeader call CopyMenuDataHeader pop bc +; This seems to be an overflow prevention, but +; it was coded wrong. ld a, b - cp $e - jr nz, .asm_1de9 - ld a, $e + cp SCREEN_WIDTH - 6 + jr nz, .okay ; should this be "jr nc"? + ld a, SCREEN_WIDTH - 6 ld b, a -.asm_1de9 +.okay ld a, b ld [wcf83], a add $5 @@ -158,7 +160,7 @@ _YesNoBox:: ; 1dd9 ld [wcf84], a call Function1c00 -Function1dfe:: ; 1dfe +InterpretTwoOptionMenu:: ; 1dfe call InterpretMenu2 push af ld c, $f -- cgit v1.2.3 From 52605b764a6ecfb781ca9e70d51dad909dabe7c3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 17 Oct 2015 20:49:34 -0400 Subject: Add commented numbers to map/group constants --- home/menu.asm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'home/menu.asm') diff --git a/home/menu.asm b/home/menu.asm index e82511895..7c46b97e0 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -486,21 +486,23 @@ endr ret ; 1fbf -Function1fbf:: ; 1fbf +ResetTextRelatedRAM:: ; 1fbf ld hl, wcf71 - call Function1ff0 + call .bytefill ld hl, wcf81 - call Function1ff0 + call .bytefill ld hl, wcf91 - call Function1ff0 + call .bytefill ld hl, wcfa1 - call Function1ff0 + call .bytefill + ld a, [rSVBK] push af ld a, $7 ld [rSVBK], a + xor a - ld hl, $dfff + ld hl, w7_dfff rept 2 ld [hld], a endr @@ -508,12 +510,13 @@ endr ld [wcf71], a ld a, h ld [wcf72], a + pop af ld [rSVBK], a ret ; 1ff0 -Function1ff0:: ; 1ff0 +.bytefill: ; 1ff0 ld bc, $0010 xor a call ByteFill -- cgit v1.2.3 From 119d6b411922eb7b375691b81fc97c9b334f4167 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 24 Oct 2015 10:34:19 -0400 Subject: About time I got to these functions --- home/menu.asm | 66 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'home/menu.asm') diff --git a/home/menu.asm b/home/menu.asm index 7c46b97e0..1de260b2d 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -1,14 +1,14 @@ ; Functions used in displaying and handling menus. -LoadMenuDataHeader:: ; 0x1d35 +LoadMenuDataHeader:: call CopyMenuDataHeader - call Function1c00 + call BackUpTiles ret -CopyMenuDataHeader:: ; 0x1d3c +CopyMenuDataHeader:: ld de, wcf81 - ld bc, $0010 + ld bc, 16 call CopyBytes ld a, [hROMBank] ld [wcf8a], a @@ -16,7 +16,7 @@ CopyMenuDataHeader:: ; 0x1d3c ; 0x1d4b Function1d4b:: ; 1d4b - ld [wcf88], a + ld [wPocketPointerLocationBuffer], a ret ; 1d4f @@ -71,7 +71,7 @@ Function1d7d:: ; 1d7d ret ; 1d81 -InterpretMenu2:: ; 0x1d81 +InterpretMenu2:: xor a ld [hBGMapMode], a call Function1cbb @@ -81,12 +81,12 @@ InterpretMenu2:: ; 0x1d81 call Function1c66 ld a, [wcf91] bit 7, a - jr z, .cancel ; 0x1d98 $d + jr z, .cancel call Function1c10 call Function1bc9 call Function1ff8 bit 1, a - jr z, .okay ; 0x1da5 $2 + jr z, .okay .cancel scf ret @@ -103,7 +103,7 @@ GetMenu2:: ; 1dab ret ; 1db8 -Function1db8:: ; 0x1db8 +Function1db8:: push hl push bc push af @@ -151,14 +151,14 @@ _YesNoBox:: ; 1dd9 .okay ld a, b - ld [wcf83], a + ld [wMenuBorderLeftCoord], a add $5 - ld [wcf85], a + ld [wMenuBorderRightCoord], a ld a, c - ld [wcf82], a + ld [wMenuBorderTopCoord], a add $4 - ld [wcf84], a - call Function1c00 + ld [wMenuBorderBottomCoord], a + call BackUpTiles InterpretTwoOptionMenu:: ; 1dfe call InterpretMenu2 @@ -198,7 +198,7 @@ YesNoMenuData2:: ; 1e25 Function1e2e:: ; 1e2e call Function1e35 - call Function1c00 + call BackUpTiles ret ; 1e35 @@ -206,24 +206,24 @@ Function1e35:: ; 1e35 push de call CopyMenuDataHeader pop de - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ld h, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] sub h ld h, a ld a, d - ld [wcf83], a + ld [wMenuBorderLeftCoord], a add h - ld [wcf85], a - ld a, [wcf82] + ld [wMenuBorderRightCoord], a + ld a, [wMenuBorderTopCoord] ld l, a - ld a, [wcf84] + ld a, [wMenuBorderBottomCoord] sub l ld l, a ld a, e - ld [wcf82], a + ld [wMenuBorderTopCoord], a add l - ld [wcf84], a + ld [wMenuBorderBottomCoord], a ret ; 1e5d @@ -245,14 +245,14 @@ SetUpMenu:: ; 1e70 set 7, [hl] ret -MenuFunc_1e7f:: ; 0x1e7f +MenuFunc_1e7f:: call Function1c66 call Function1ebd call Function1ea6 call Function1cbb ret -MenuWriteText:: ; 0x1e8c +MenuWriteText:: xor a ld [hBGMapMode], a call Function1ebd ; sort out the text @@ -269,18 +269,18 @@ MenuWriteText:: ; 0x1e8c ; 0x1ea6 Function1ea6:: ; 1ea6 - ld a, [wcf83] + ld a, [wMenuBorderLeftCoord] ld c, a - ld a, [wcf85] + ld a, [wMenuBorderRightCoord] sub c ld c, a ld a, [wcf92] add a inc a ld b, a - ld a, [wcf82] + ld a, [wMenuBorderTopCoord] add b - ld [wcf84], a + ld [wMenuBorderBottomCoord], a ret ; 1ebd @@ -410,7 +410,7 @@ Function1f2a:: ; 1f2a ld a, [hl] ld [MenuSelection], a ld a, [wcfa9] - ld [wcf88], a + ld [wPocketPointerLocationBuffer], a and a ret @@ -571,7 +571,7 @@ InterpretMenu:: ; 202a ld a, [hROMBank] ld [wcf94], a callba Function2400e - ld a, [wcf88] + ld a, [wPocketPointerLocationBuffer] ret ; 2039 @@ -579,7 +579,7 @@ Function2039:: ; 2039 ld a, [hROMBank] ld [wcf94], a callba Function24022 - ld a, [wcf88] + ld a, [wPocketPointerLocationBuffer] ret ; 2048 @@ -587,7 +587,7 @@ Function2048:: ; 2048 ld a, [hROMBank] ld [wcf94], a callba Function2403c - ld a, [wcf88] + ld a, [wPocketPointerLocationBuffer] ret ; 2057 -- cgit v1.2.3 From 4d17f6e1f6d41b91f5a5de71984a7c6f2bd0041c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 24 Oct 2015 19:49:19 -0400 Subject: Address comments on PR 322 --- home/menu.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'home/menu.asm') diff --git a/home/menu.asm b/home/menu.asm index 1de260b2d..c4f0ed0d9 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -16,7 +16,7 @@ CopyMenuDataHeader:: ; 0x1d4b Function1d4b:: ; 1d4b - ld [wPocketPointerLocationBuffer], a + ld [wPocketCursorBuffer], a ret ; 1d4f @@ -410,7 +410,7 @@ Function1f2a:: ; 1f2a ld a, [hl] ld [MenuSelection], a ld a, [wcfa9] - ld [wPocketPointerLocationBuffer], a + ld [wPocketCursorBuffer], a and a ret @@ -571,7 +571,7 @@ InterpretMenu:: ; 202a ld a, [hROMBank] ld [wcf94], a callba Function2400e - ld a, [wPocketPointerLocationBuffer] + ld a, [wPocketCursorBuffer] ret ; 2039 @@ -579,7 +579,7 @@ Function2039:: ; 2039 ld a, [hROMBank] ld [wcf94], a callba Function24022 - ld a, [wPocketPointerLocationBuffer] + ld a, [wPocketCursorBuffer] ret ; 2048 @@ -587,7 +587,7 @@ Function2048:: ; 2048 ld a, [hROMBank] ld [wcf94], a callba Function2403c - ld a, [wPocketPointerLocationBuffer] + ld a, [wPocketCursorBuffer] ret ; 2057 -- cgit v1.2.3