aboutsummaryrefslogtreecommitdiffstats
path: root/engine/menu/text_ids2.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2020-05-20 19:40:33 -0500
committerdannye <33dannye@gmail.com>2020-05-20 20:02:53 -0500
commit10f9559eab8c93b94abb8ae8d1083704ad4e169a (patch)
tree7dbe7b152dde8a6e9b56664b5b8cdfc0d6be1253 /engine/menu/text_ids2.asm
parentMerge pull request #39 from TiKevin83/master (diff)
downloadpokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.tar.gz
pokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.tar.xz
pokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.zip
Sync with pokered
Diffstat (limited to '')
-rw-r--r--engine/menu/text_box.asm (renamed from engine/menu/text_ids2.asm)122
1 files changed, 64 insertions, 58 deletions
diff --git a/engine/menu/text_ids2.asm b/engine/menu/text_box.asm
index b22c9507..a109bff2 100644
--- a/engine/menu/text_ids2.asm
+++ b/engine/menu/text_box.asm
@@ -1,28 +1,28 @@
; function to draw various text boxes
DisplayTextBoxID_:
- ld a,[wTextBoxID]
- cp a,TWO_OPTION_MENU
- jp z,DisplayTwoOptionMenu
- ld c,a
- ld hl,TextBoxFunctionTable
- ld de,3
+ ld a, [wTextBoxID]
+ cp TWO_OPTION_MENU
+ jp z, DisplayTwoOptionMenu
+ ld c, a
+ ld hl, TextBoxFunctionTable
+ ld de, 3
call SearchTextBoxTable
- jr c,.functionTableMatch
- ld hl,TextBoxCoordTable
- ld de,5
+ jr c, .functionTableMatch
+ ld hl, TextBoxCoordTable
+ ld de, 5
call SearchTextBoxTable
- jr c,.coordTableMatch
- ld hl,TextBoxTextAndCoordTable
- ld de,9
+ jr c, .coordTableMatch
+ ld hl, TextBoxTextAndCoordTable
+ ld de, 9
call SearchTextBoxTable
- jr c,.textAndCoordTableMatch
+ jr c, .textAndCoordTableMatch
.done
ret
.functionTableMatch
- ld a,[hli]
- ld h,[hl]
- ld l,a ; hl = address of function
- ld de,.done
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a ; hl = address of function
+ ld de, .done
push de
jp hl ; jump to the function
.coordTableMatch
@@ -37,14 +37,14 @@ DisplayTextBoxID_:
call TextBoxBorder
pop hl
call GetTextBoxIDText
- ld a,[wd730]
+ ld a, [wd730]
push af
- ld a,[wd730]
- set 6,a ; no pauses between printing each letter
- ld [wd730],a
+ ld a, [wd730]
+ set 6, a ; no pauses between printing each letter
+ ld [wd730], a
call PlaceString
pop af
- ld [wd730],a
+ ld [wd730], a
call UpdateSprites
ret
@@ -53,12 +53,12 @@ DisplayTextBoxID_:
SearchTextBoxTable:
dec de
.loop
- ld a,[hli]
- cp a,$ff
- jr z,.notFound
+ ld a, [hli]
+ cp $ff
+ jr z, .notFound
cp c
- jr z,.found
- add hl,de
+ jr z, .found
+ add hl, de
jr .loop
.found
scf
@@ -74,31 +74,31 @@ SearchTextBoxTable:
; d = row of upper left corner
; e = column of upper left corner
GetTextBoxIDCoords:
- ld a,[hli] ; column of upper left corner
- ld e,a
- ld a,[hli] ; row of upper left corner
- ld d,a
- ld a,[hli] ; column of lower right corner
+ ld a, [hli] ; column of upper left corner
+ ld e, a
+ ld a, [hli] ; row of upper left corner
+ ld d, a
+ ld a, [hli] ; column of lower right corner
sub e
dec a
- ld c,a ; c = width
- ld a,[hli] ; row of lower right corner
+ ld c, a ; c = width
+ ld a, [hli] ; row of lower right corner
sub d
dec a
- ld b,a ; b = height
+ ld b, a ; b = height
ret
; function to load a text address and text coordinates from the TextBoxTextAndCoordTable
GetTextBoxIDText:
- ld a,[hli]
- ld e,a
- ld a,[hli]
- ld d,a ; de = address of text
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a ; de = address of text
push de ; save text address
- ld a,[hli]
- ld e,a ; column of upper left corner of text
- ld a,[hl]
- ld d,a ; row of upper left corner of text
+ ld a, [hli]
+ ld e, a ; column of upper left corner of text
+ ld a, [hl]
+ ld d, a ; row of upper left corner of text
call GetAddressOfScreenCoords
pop de ; restore text address
ret
@@ -112,17 +112,17 @@ GetTextBoxIDText:
GetAddressOfScreenCoords:
push bc
coord hl, 0, 0
- ld bc,20
+ ld bc, 20
.loop ; loop to add d rows to the base address
- ld a,d
+ ld a, d
and a
- jr z,.addedRows
- add hl,bc
+ jr z, .addedRows
+ add hl, bc
dec d
jr .loop
.addedRows
pop bc
- add hl,de
+ add hl, de
ret
; Format:
@@ -418,7 +418,7 @@ DisplayTwoOptionMenu:
xor a
ld [wTwoOptionMenuID], a
ld hl, wd730
- res 6, [hl]
+ res 6, [hl] ; turn on the printing delay
call HandleMenuInput
pop hl
bit 1, a ; A button pressed?
@@ -513,19 +513,26 @@ TwoOptionMenuStrings:
dw .NoYesMenu
.NoYesMenu
- db "NO",$4E,"YES@"
+ db "NO"
+ next "YES@"
.YesNoMenu
- db "YES",$4E,"NO@"
+ db "YES"
+ next "NO@"
.NorthWestMenu
- db "NORTH",$4E,"WEST@"
+ db "NORTH"
+ next "WEST@"
.SouthEastMenu
- db "SOUTH",$4E,"EAST@"
+ db "SOUTH"
+ next "EAST@"
.NorthEastMenu
- db "NORTH",$4E,"EAST@"
+ db "NORTH"
+ next "EAST@"
.TradeCancelMenu
- db "TRADE",$4E,"CANCEL@"
+ db "TRADE"
+ next "CANCEL@"
.HealCancelMenu
- db "HEAL",$4E,"CANCEL@"
+ db "HEAL"
+ next "CANCEL@"
DisplayFieldMoveMonMenu:
xor a
@@ -547,7 +554,7 @@ DisplayFieldMoveMonMenu:
call TextBoxBorder
call UpdateSprites
ld a, 12
- ld [hFieldMoveMonMenuTopMenuItemX], a ; fffb, not fff7
+ ld [hFieldMoveMonMenuTopMenuItemX], a
coord hl, 13, 12
ld de, PokemonMenuEntries
jp PlaceString
@@ -730,4 +737,3 @@ FieldMoveDisplayData:
db TELEPORT, $08, $0A
db SOFTBOILED, $09, $08
db $ff ; list terminator
-