summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-12-10 01:47:10 -0500
committerGitHub <noreply@github.com>2017-12-10 01:47:10 -0500
commit94c7def4883fbdbcd3987a067443a2069b8bb610 (patch)
tree171c67509afba62571266bd6bebbfdb829d2a876 /macros
parent89b9292db0898f8ad2b6ea8513a3190762eb58c8 (diff)
parentd554b997c590825f030bd1be71989653b16a2ae0 (diff)
Merge pull request #409 from roukaour/master
Document constants with comments, actual names, and more thorough usage
Diffstat (limited to 'macros')
-rw-r--r--macros/basestats.asm49
-rw-r--r--macros/charmap.asm95
-rw-r--r--macros/text.asm6
3 files changed, 90 insertions, 60 deletions
diff --git a/macros/basestats.asm b/macros/basestats.asm
index 25ffcc02b..f3e98b64a 100644
--- a/macros/basestats.asm
+++ b/macros/basestats.asm
@@ -29,38 +29,37 @@ add_mt: MACRO
enum \1_TMNUM
ENDM
+; N TMs/HMs need (N+7)/8 bytes for their bit flags.
+; The rgbasm integers tms1, tms2, tms3 each hold 3 bytes, or 24 bits.
tmhm: MACRO
-x = 0
-y = 0
-w = 0
- rept _NARG
+tms1 = 0
+tms2 = 0
+tms3 = 0
+rept _NARG
if def(\1_TMNUM)
- if \1_TMNUM < 25
-x = x | (1 << ((\1_TMNUM) - 1))
+ if \1_TMNUM < 24 + 1
+tms1 = tms1 | (1 << ((\1_TMNUM) - 1))
+ elif \1_TMNUM < 48 + 1
+tms2 = tms2 | (1 << ((\1_TMNUM) - 1 - 24))
else
- if \1_TMNUM < 49
-y = y | (1 << ((\1_TMNUM) - 1 - 24))
- else
-w = w | (1 << ((\1_TMNUM) - 1 - 48))
- endc
+tms3 = tms3 | (1 << ((\1_TMNUM) - 1 - 48))
endc
else
fail "\1 is not a TM, HM, or move tutor move"
endc
-
shift
- endr
+endr
- rept 3
- db x & $ff
-x = x >> 8
- endr
- rept 3
- db y & $ff
-y = y >> 8
- endr
- rept 2
- db w & $ff
-w = w >> 8
- endr
+rept 3
+ db tms1 & $ff
+tms1 = tms1 >> 8
+endr
+rept 3
+ db tms2 & $ff
+tms2 = tms2 >> 8
+endr
+rept 2
+ db tms3 & $ff
+tms3 = tms3 >> 8
+endr
ENDM
diff --git a/macros/charmap.asm b/macros/charmap.asm
index 445922932..b936b0953 100644
--- a/macros/charmap.asm
+++ b/macros/charmap.asm
@@ -1,53 +1,63 @@
; Control characters
charmap "<START>", $00
- charmap "<PLAY_G>", $14 ; <PLAYER> + gender
+ charmap "<PLAY_G>", $14 ; gendered PlayerName; same as "<PLAYER>" in English
charmap "<DAY>", $15
- charmap "¯", $1f
+ charmap "¯", $1f ; soft linebreak
charmap "<LNBRK>", $22
- charmap "<POKE>", $24
+ charmap "<POKE>", $24 ; "<PO><KE>"
charmap "%", $25
- charmap "<RED>", $38
- charmap "<GREEN>", $39
+ charmap "<RED>", $38 ; RedsName
+ charmap "<GREEN>", $39 ; GreensName
charmap "<ENEMY>", $3f
- charmap "<SHINY>", $3f
- charmap "<MOM>", $49
- charmap "<PKMN>", $4a
+ charmap "<MOM>", $49 ; MomsName
+ charmap "<PKMN>", $4a ; "<PK><MN>"
charmap "<NEXT>", $4e
charmap "<LINE>", $4f
charmap "@", $50
charmap "<PARA>", $51
- charmap "<PLAYER>", $52
+ charmap "<PLAYER>", $52 ; PlayerName
charmap "<RIVAL>", $53
charmap "#", $54
charmap "<CONT>", $55
- charmap "<......>", $56
+ charmap "<......>", $56 ; "……"
charmap "<DONE>", $57
charmap "<PROMPT>", $58
charmap "<TARGET>", $59
charmap "<USER>", $5a
- charmap "<PC>", $5b
- charmap "<TM>", $5c
- charmap "<TRNER>", $5d
- charmap "<ROCKET>", $5e
+ charmap "<PC>", $5b ; "PC"
+ charmap "<TM>", $5c ; "TM"
+ charmap "<TRNER>", $5d ; "TRAINER"
+ charmap "<ROCKET>", $5e ; "ROCKET"
charmap "<DEXEND>", $5f
-; Actual characters
- charmap "▲", $61
- charmap "_", $62
- charmap "<COLON>", $6d ; necessary because ":" is already used
- charmap "′", $6e
- charmap "<LV>", $6e
- charmap "″", $6f
+; Actual characters (from gfx/misc/font_extra.png)
+ charmap "<BOLD_A>", $60 ; unused
+ charmap "<BOLD_B>", $61 ; unused
+ charmap "<BOLD_C>", $62 ; unused
+ charmap "<BOLD_D>", $63 ; unused
+ charmap "<BOLD_E>", $64 ; unused
+ charmap "<BOLD_F>", $65 ; unused
+ charmap "<BOLD_G>", $66 ; unused
+ charmap "<BOLD_H>", $67 ; unused
+ charmap "<BOLD_I>", $68 ; unused
+ charmap "<BOLD_V>", $69
+ charmap "<BOLD_S>", $6a
+ charmap "<BOLD_L>", $6b ; unused
+ charmap "<BOLD_M>", $6c ; unused
+ charmap "<COLON>", $6d ; colon with tinier dots than ":"
+ charmap "ぃ", $6e ; hiragana small i, unused
+ charmap "ぅ", $6f ; hiragana small u, unused
charmap "<PO>", $70
charmap "<KE>", $71
- charmap "◀", $71
- charmap "<``>", $72
- charmap "<''>", $73
- charmap "<ID>", $73
- charmap "№", $74
- charmap "…", $75
+ charmap "<``>", $72 ; opening quote
+ charmap "<''>", $73 ; closing quote
+ charmap "·", $74 ; middle dot, unused
+ charmap "…", $75 ; ellipsis
+ charmap "ぁ", $76 ; hiragana small a, unused
+ charmap "ぇ", $77 ; hiragana small e, unused
+ charmap "ぉ", $78 ; hiragana small o, unused
charmap "┌", $79
charmap "─", $7a
@@ -57,6 +67,32 @@
charmap "┘", $7e
charmap " ", $7f
+; Actual characters (from gfx/misc/font_battle_extra.png)
+
+ charmap "<LV>", $6e
+
+ charmap "<ど>", $70 ; hiragana small do, unused
+ charmap "◀", $71
+ charmap "『", $72 ; Japanese opening quote, unused
+ charmap "<ID>", $73
+ charmap "№", $74
+
+; Actual characters (from other graphics files)
+
+ charmap "|", $31 ; from gfx/stats/stats_tiles
+
+ charmap "<SHINY>", $3f ; gfx/stats/shiny
+
+ charmap "<BLACK>", $60 ; from gfx/mobile/phone_tiles.2bpp
+ charmap "▲", $61 ; gfx/font/up_arrow.png
+ charmap "<PHONE>", $62 ; gfx/mobile/overworld_phone_icon.2bpp
+ charmap "_", $62 ; from gfx/battle/hp_exp_bar_border.1bpp
+
+ charmap "′", $6e ; gfx/font/feet_inches.png
+ charmap "″", $6f ; gfx/font/feet_inches.png
+
+; Actual characters (from gfx/misc/font.png)
+
charmap "A", $80
charmap "B", $81
charmap "C", $82
@@ -152,7 +188,7 @@
charmap "♂", $ef
charmap "¥", $f0
charmap "×", $f1
- charmap "·", $f2
+ charmap "<DOT>", $f2 ; same as "." in English
charmap "/", $f3
charmap ",", $f4
charmap "♀", $f5
@@ -168,8 +204,7 @@
charmap "8", $fe
charmap "9", $ff
-; Japanese, for those bits of text that
-; were not translated to English.
+; Japanese kana, for those bits of text that were not translated to English
charmap "ガ", $5
charmap "ギ", $6
diff --git a/macros/text.asm b/macros/text.asm
index cc7f609b6..08004f32a 100644
--- a/macros/text.asm
+++ b/macros/text.asm
@@ -1,16 +1,12 @@
text EQUS "db $00," ; Start writing text.
next EQUS "db $4e," ; Move a line down.
line EQUS "db $4f," ; Start writing at the bottom line.
+page EQUS "db $50," ; Start a new Pokedex page.
para EQUS "db $51," ; Start a new paragraph.
cont EQUS "db $55," ; Scroll to the next line.
done EQUS "db $57" ; End a text box.
prompt EQUS "db $58" ; Prompt the player to end a text box (initiating some other event).
-; Pokedex text commands are only used with pokered.
-; They are included for compatibility.
-page EQUS "db $50," ; Start a new Pokedex page.
-dex EQUS "db $e8, $50" ; End a Pokedex entry.
-
; TX_RAM EQU $01
; TX_FAR EQU $16
enum_start 1