summaryrefslogtreecommitdiff
path: root/home/text.asm
diff options
context:
space:
mode:
authordannye <corrnondacqb@yahoo.com>2016-07-18 01:32:24 -0500
committerdannye <corrnondacqb@yahoo.com>2016-07-18 01:32:24 -0500
commit7c01509b6b69b4dc33f5d739589d50f26ffd65b0 (patch)
tree89b4000a56c9e3d942666639c83416100f360f88 /home/text.asm
parent80bae03975a84dadf080c79f52216866dd410cf8 (diff)
parentfc474c8ee740acbe662b06db0d9cab8edc6680e9 (diff)
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'home/text.asm')
-rw-r--r--home/text.asm161
1 files changed, 75 insertions, 86 deletions
diff --git a/home/text.asm b/home/text.asm
index 88db9377..65d7a614 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -52,28 +52,28 @@ PlaceNextChar::
ld a,[de]
cp "@"
- jr nz,.PlaceText
+ jr nz, Char4ETest
ld b,h
ld c,l
pop hl
ret
-.PlaceText
- cp $4E
- jr nz,.next
- ld bc,SCREEN_WIDTH * 2
+Char4ETest::
+ cp $4E ; next
+ jr nz, .char4FTest
+ ld bc, 2 * SCREEN_WIDTH
ld a,[hFlags_0xFFF6]
bit 2,a
- jr z,.next2
+ jr z,.ok
ld bc,SCREEN_WIDTH
-.next2
+.ok
pop hl
add hl,bc
push hl
jp PlaceNextChar_inc
-.next
- cp $4F
+.char4FTest
+ cp $4F ; line
jr nz,.next3
pop hl
coord hl, 1, 16
@@ -81,46 +81,36 @@ PlaceNextChar::
jp PlaceNextChar_inc
.next3 ; Check against a dictionary
+dict: macro
+if \1 == 0
and a
- jp z,Char00
- cp $4C
- jp z,Char4C
- cp $4B
- jp z,Char4B
- cp $51
- jp z,Char51
- cp $49
- jp z,Char49
- cp $52
- jp z,Char52
- cp $53
- jp z,Char53
- cp $54
- jp z,Char54
- cp $5B
- jp z,Char5B
- cp $5E
- jp z,Char5E
- cp $5C
- jp z,Char5C
- cp $5D
- jp z,Char5D
- cp $55
- jp z,Char55
- cp $56
- jp z,Char56
- cp $57
- jp z,Char57
- cp $58
- jp z,Char58
- cp $4A
- jp z,Char4A
- cp $5F
- jp z,Char5F
- cp $59
- jp z,Char59
- cp $5A
- jp z,Char5A
+else
+ cp \1
+endc
+ jp z, \2
+endm
+
+ dict $00, Char00 ; error
+ dict $4C, Char4C ; autocont
+ dict $4B, Char4B ; cont_
+ dict $51, Char51 ; para
+ dict $49, Char49 ; page
+ dict $52, Char52 ; player
+ dict $53, Char53 ; rival
+ dict $54, Char54 ; POKé
+ dict $5B, Char5B ; PC
+ dict $5E, Char5E ; ROCKET
+ dict $5C, Char5C ; TM
+ dict $5D, Char5D ; TRAINER
+ dict $55, Char55 ; cont
+ dict $56, Char56 ; 6 dots
+ dict $57, Char57 ; done
+ dict $58, Char58 ; prompt
+ dict $4A, Char4A ; PKMN
+ dict $5F, Char5F ; dex
+ dict $59, Char59 ; TARGET
+ dict $5A, Char5A ; USER
+
ld [hli],a
call PrintLetterDelay
PlaceNextChar_inc::
@@ -211,7 +201,6 @@ MonsterNameCharsCommon::
; print “Enemy ”
ld de,Char5AText
call PlaceString
-
ld h,b
ld l,c
ld de,wEnemyMonNick ; enemy active monster name
@@ -264,36 +253,36 @@ Char5F::
pop hl
ret
-Char58::
+Char58:: ; prompt
ld a,[wLinkState]
cp LINK_STATE_BATTLING
- jp z,Next1AA2
- ld a,"▼"
+ jp z, .ok
+ ld a, "▼"
Coorda 18, 16
-Next1AA2::
+.ok
call ProtectedDelay3
call ManualTextScroll
ld a, " "
Coorda 18, 16
-Char57::
+Char57:: ; done
pop hl
- ld de,Char58Text
+ ld de, Char58Text
dec de
ret
Char58Text::
db "@"
-Char51::
+Char51:: ; para
push de
- ld a,"▼"
+ ld a, "▼"
Coorda 18, 16
call ProtectedDelay3
call ManualTextScroll
coord hl, 1, 13
lb bc, 4, 18
call ClearScreenArea
- ld c,20
+ ld c, 20
call DelayFrames
pop de
coord hl, 1, 14
@@ -328,8 +317,8 @@ Char4B::
;fall through
Char4C::
push de
- call ScrollTextUp
- call ScrollTextUp
+ call ScrollTextUpOneLine
+ call ScrollTextUpOneLine
coord hl, 1, 16
pop de
jp PlaceNextChar_inc
@@ -338,7 +327,7 @@ Char4C::
; always called twice in a row
; first time, copy the two rows of text to the "in between" rows that are usually emtpy
; second time, copy the bottom row of text into the top row of text
-ScrollTextUp::
+ScrollTextUpOneLine::
coord hl, 0, 14 ; top row of text
coord de, 0, 13 ; empty line above text
ld b, SCREEN_WIDTH * 3
@@ -376,7 +365,7 @@ TextCommandProcessor::
push af
set 1,a
ld e,a
- ld a,[$fff4]
+ ld a, [$fff4]
xor e
ld [wLetterPrintingDelayFlags],a
ld a,c
@@ -393,22 +382,22 @@ NextTextCommand::
ret
.doTextCommand
push hl
- cp a,$17
- jp z,TextCommand17
- cp a,$0e
+ cp a, $17
+ jp z, TextCommand17
+ cp a, $0e
jp nc,TextCommand0B ; if a != 0x17 and a >= 0xE, go to command 0xB
; if a < 0xE, use a jump table
ld hl,TextCommandJumpTable
push bc
add a
- ld b,$00
- ld c,a
- add hl,bc
+ ld b, 0
+ ld c, a
+ add hl, bc
pop bc
- ld a,[hli]
- ld h,[hl]
- ld l,a
- jp [hl]
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
; draw box
; 04AAAABBCC
@@ -527,10 +516,10 @@ TextCommand06::
; 07
; (no arguments)
TextCommand07::
- ld a," "
+ ld a, " "
Coorda 18, 16 ; place blank space in lower right corner of dialogue text box
- call ScrollTextUp
- call ScrollTextUp
+ call ScrollTextUpOneLine
+ call ScrollTextUpOneLine
pop hl
coord bc, 1, 16 ; address of second line of dialogue text box
jp NextTextCommand
@@ -541,7 +530,7 @@ TextCommand08::
pop hl
ld de,NextTextCommand
push de ; return address
- jp [hl]
+ jp hl
; print decimal number (converted from binary number)
; 09AAAABB
@@ -630,16 +619,16 @@ TextCommand0B::
; format: text command ID, sound ID or cry ID
TextCommandSounds::
- db $0B,SFX_GET_ITEM_1 ; actually plays SFX_LEVEL_UP when the battle music engine is loaded
- db $12,SFX_CAUGHT_MON
- db $0E,SFX_POKEDEX_RATING ; unused?
- db $0F,SFX_GET_ITEM_1 ; unused?
- db $10,SFX_GET_ITEM_2
- db $11,SFX_GET_KEY_ITEM
- db $13,SFX_DEX_PAGE_ADDED
- db $14,NIDORINA ; used in OakSpeech
- db $15,PIDGEOT ; used in SaffronCityText12
- db $16,DEWGONG ; unused?
+ db $0B, SFX_GET_ITEM_1 ; actually plays SFX_LEVEL_UP when the battle music engine is loaded
+ db $12, SFX_CAUGHT_MON
+ db $0E, SFX_POKEDEX_RATING ; unused?
+ db $0F, SFX_GET_ITEM_1 ; unused?
+ db $10, SFX_GET_ITEM_2
+ db $11, SFX_GET_KEY_ITEM
+ db $13, SFX_DEX_PAGE_ADDED
+ db $14, NIDORINA ; used in OakSpeech
+ db $15, PIDGEOT ; used in SaffronCityText12
+ db $16, DEWGONG ; unused?
; draw ellipses
; 0CAA