summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-01-09 19:46:41 -0800
committerYamaArashi <shadow962@live.com>2016-01-09 19:46:41 -0800
commitb609a1690d49bc7fa6016f4db8a3ee5450ad780c (patch)
treeff5ae2d52444e07bcb44e86684093c3a924d1370
parent418c84dc0c0808559e1ad8605f9346369861588b (diff)
pokedex unown mode
-rw-r--r--engine/pokedex.asm55
-rwxr-xr-xengine/unowndex.asm2
-rw-r--r--main.asm2
-rw-r--r--wram.asm4
4 files changed, 32 insertions, 31 deletions
diff --git a/engine/pokedex.asm b/engine/pokedex.asm
index 4b3bb30b4..bcac8491b 100644
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -83,7 +83,7 @@ InitPokedex: ; 40063
call Pokedex_OrderMonsByMode
call Pokedex_InitCursorPosition
call Pokedex_GetLandmark
- callba Function1de247
+ callba DrawDexEntryScreenRightEdge
call Pokedex_ResetBGMapMode
ret
@@ -781,11 +781,11 @@ Pokedex_UpdateSearchResultsScreen: ; 40562 (10:4562)
Pokedex_InitUnownMode: ; 405bd (10:45bd)
call Pokedex_LoadUnownFont
- call Function409f1
+ call Pokedex_DrawUnownModeBG
xor a
- ld [wc7dd], a
- call Function41a58
- call Function40658
+ ld [wDexCurrentUnownIndex], a
+ call Pokedex_LoadUnownFrontpicTiles
+ call Pokedex_UnownModePlaceCursor
callba PrintUnownWord
call WaitBGMap
ld a, $16
@@ -831,9 +831,9 @@ Pokedex_UnownModeHandleDPadInput: ; 40610 (10:4610)
ret
.right
- ld a, [wc7de]
+ ld a, [wDexUnownCount]
ld e, a
- ld hl, wc7dd
+ ld hl, wDexCurrentUnownIndex
ld a, [hl]
inc a
cp e
@@ -843,7 +843,7 @@ Pokedex_UnownModeHandleDPadInput: ; 40610 (10:4610)
jr .update
.left
- ld hl, wc7dd
+ ld hl, wDexCurrentUnownIndex
ld a, [hl]
and a
ret z
@@ -855,9 +855,9 @@ Pokedex_UnownModeHandleDPadInput: ; 40610 (10:4610)
xor a
ld [hBGMapMode], a
pop af
- call Function40654
- call Function41a58
- call Function40658
+ call Pokedex_UnownModeEraseCursor
+ call Pokedex_LoadUnownFrontpicTiles
+ call Pokedex_UnownModePlaceCursor
callba PrintUnownWord
ld a, $1
ld [hBGMapMode], a
@@ -865,17 +865,18 @@ Pokedex_UnownModeHandleDPadInput: ; 40610 (10:4610)
call DelayFrame
ret
-Function40654: ; 40654 (10:4654)
- ld c, $7f
- jr asm_4065d
+Pokedex_UnownModeEraseCursor: ; 40654 (10:4654)
+ ld c, " "
+ jr Pokedex_UnownModeUpdateCursorGfx
-Function40658: ; 40658 (10:4658)
- ld a, [wc7dd]
- ld c, $5a
-asm_4065d: ; 4065d (10:465d)
+Pokedex_UnownModePlaceCursor: ; 40658 (10:4658)
+ ld a, [wDexCurrentUnownIndex]
+ ld c, $5a ; diamond cursor
+
+Pokedex_UnownModeUpdateCursorGfx: ; 4065d (10:465d)
ld e, a
ld d, 0
- ld hl, Unknown_40a3e + 2
+ ld hl, UnownModeLetterAndCursorCoords + 2
rept 4
add hl, de
endr
@@ -1283,7 +1284,7 @@ Pokedex_PlaceSearchResultsTypeStrings: ; 409cf (10:49cf)
.done
ret
-Function409f1: ; 409f1 (10:49f1)
+Pokedex_DrawUnownModeBG: ; 409f1 (10:49f1)
call Pokedex_FillBackgroundColor2
hlcoord 2, 1
lb bc, 10, 13
@@ -1307,7 +1308,7 @@ Function409f1: ; 409f1 (10:49f1)
and a
jr z, .done
push af
- ld hl, Unknown_40a3e
+ ld hl, UnownModeLetterAndCursorCoords
rept 4
add hl, de
endr
@@ -1323,10 +1324,10 @@ endr
jr nz, .loop
.done
ld a, b
- ld [wc7de], a
+ ld [wDexUnownCount], a
ret
-Unknown_40a3e: ; 40a3e
+UnownModeLetterAndCursorCoords: ; 40a3e
; letter, cursor
dwcoord 4,11, 3,11
dwcoord 4,10, 3,10
@@ -2526,12 +2527,12 @@ Pokedex_LoadUnownFont: ; 41a2c
call CloseSRAM
ret
-Function41a58: ; 41a58 (10:5a58)
+Pokedex_LoadUnownFrontpicTiles: ; 41a58 (10:5a58)
ld a, [UnownLetter]
push af
- ld a, [wc7dd]
+ ld a, [wDexCurrentUnownIndex]
ld e, a
- ld d, $0
+ ld d, 0
ld hl, UnownDex
add hl, de
ld a, [hl]
@@ -2548,7 +2549,7 @@ Function41a58: ; 41a58 (10:5a58)
_NewPokedexEntry: ; 41a7f
xor a
ld [hBGMapMode], a
- callba Function1de247
+ callba DrawDexEntryScreenRightEdge
call Pokedex_ResetBGMapMode
call DisableLCD
call LoadStandardFont
diff --git a/engine/unowndex.asm b/engine/unowndex.asm
index 8c4332e96..0b251da0b 100755
--- a/engine/unowndex.asm
+++ b/engine/unowndex.asm
@@ -25,7 +25,7 @@ PrintUnownWord: ; fba2e (3e:7a2e)
ld bc, 12
ld a, " "
call ByteFill
- ld a, [wc7dd]
+ ld a, [wDexCurrentUnownIndex]
ld e, a
ld d, 0
ld hl, UnownDex
diff --git a/main.asm b/main.asm
index 00cf73453..aa000622b 100644
--- a/main.asm
+++ b/main.asm
@@ -12110,7 +12110,7 @@ DrawPokedexSearchResultsWindow: ; 1de1d1 (77:61d1)
; (### FOUN)
next "D!@"
-Function1de247: ; 1de247
+DrawDexEntryScreenRightEdge: ; 1de247
ld a, [hBGMapAddress]
ld l, a
ld a, [hBGMapAddress + 1]
diff --git a/wram.asm b/wram.asm
index 63c468030..1677f982d 100644
--- a/wram.asm
+++ b/wram.asm
@@ -939,8 +939,8 @@ wDexArrowCursorDelayCounter:: ds 1
wDexArrowCursorBlinkCounter:: ds 1
wDexSearchSlowpokeFrame:: ds 1
wUnlockedUnownMode:: ds 1
-wc7dd:: ds 1
-wc7de:: ds 1
+wDexCurrentUnownIndex:: ds 1
+wDexUnownCount:: ds 1
wDexConvertedMonType:: ds 1 ; mon type converted from dex search mon type
wc7e0:: ds 1
wc7e1:: ds 1