Skip to content

Commit b460637

Browse files
authored
Avoid using EQUS when EQU or MACRO will do (#496)
1 parent f0bf1df commit b460637

File tree

4 files changed

+83
-28
lines changed

4 files changed

+83
-28
lines changed

engine/gfx/mon_icons.asm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,13 @@ INCLUDE "data/pokemon/menu_icons.asm"
283283
DEF INC_FRAME_1 EQUS "0, $20"
284284
DEF INC_FRAME_2 EQUS "$20, $20"
285285

286-
BugIconFrame1: INCBIN "gfx/icons/bug.2bpp", INC_FRAME_1
287-
PlantIconFrame1: INCBIN "gfx/icons/plant.2bpp", INC_FRAME_1
288-
BugIconFrame2: INCBIN "gfx/icons/bug.2bpp", INC_FRAME_2
289-
PlantIconFrame2: INCBIN "gfx/icons/plant.2bpp", INC_FRAME_2
290-
SnakeIconFrame1: INCBIN "gfx/icons/snake.2bpp", INC_FRAME_1
286+
BugIconFrame1: INCBIN "gfx/icons/bug.2bpp", INC_FRAME_1
287+
PlantIconFrame1: INCBIN "gfx/icons/plant.2bpp", INC_FRAME_1
288+
BugIconFrame2: INCBIN "gfx/icons/bug.2bpp", INC_FRAME_2
289+
PlantIconFrame2: INCBIN "gfx/icons/plant.2bpp", INC_FRAME_2
290+
SnakeIconFrame1: INCBIN "gfx/icons/snake.2bpp", INC_FRAME_1
291291
QuadrupedIconFrame1: INCBIN "gfx/icons/quadruped.2bpp", INC_FRAME_1
292-
SnakeIconFrame2: INCBIN "gfx/icons/snake.2bpp", INC_FRAME_2
292+
SnakeIconFrame2: INCBIN "gfx/icons/snake.2bpp", INC_FRAME_2
293293
QuadrupedIconFrame2: INCBIN "gfx/icons/quadruped.2bpp", INC_FRAME_2
294294

295295
TradeBubbleIconGFX: INCBIN "gfx/trade/bubble.2bpp"

macros/coords.asm

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,17 @@ MACRO validate_coords
1111
ENDC
1212
ENDM
1313

14-
DEF hlcoord EQUS "coord hl,"
15-
DEF bccoord EQUS "coord bc,"
16-
DEF decoord EQUS "coord de,"
14+
MACRO hlcoord
15+
coord hl, \#
16+
ENDM
17+
18+
MACRO bccoord
19+
coord bc, \#
20+
ENDM
21+
22+
MACRO decoord
23+
coord de, \#
24+
ENDM
1725

1826
MACRO coord
1927
; register, x, y[, origin]
@@ -25,9 +33,17 @@ MACRO coord
2533
ENDC
2634
ENDM
2735

28-
DEF hlbgcoord EQUS "bgcoord hl,"
29-
DEF bcbgcoord EQUS "bgcoord bc,"
30-
DEF debgcoord EQUS "bgcoord de,"
36+
MACRO hlbgcoord
37+
bgcoord hl, \#
38+
ENDM
39+
40+
MACRO bcbgcoord
41+
bgcoord bc, \#
42+
ENDM
43+
44+
MACRO debgcoord
45+
bgcoord de, \#
46+
ENDM
3147

3248
MACRO bgcoord
3349
; register, x, y[, origin]
@@ -39,9 +55,17 @@ MACRO bgcoord
3955
ENDC
4056
ENDM
4157

42-
DEF hlowcoord EQUS "owcoord hl,"
43-
DEF bcowcoord EQUS "owcoord bc,"
44-
DEF deowcoord EQUS "owcoord de,"
58+
MACRO hlowcoord
59+
owcoord hl, \#
60+
ENDM
61+
62+
MACRO bcowcoord
63+
owcoord bc, \#
64+
ENDM
65+
66+
MACRO deowcoord
67+
owcoord de, \#
68+
ENDM
4569

4670
MACRO owcoord
4771
; register, x, y, map width

macros/scripts/maps.asm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,14 @@ MACRO connection
225225
dw wOverworldMap + _win
226226
ENDM
227227

228-
DEF def_script_pointers EQUS "const_def"
228+
MACRO def_script_pointers
229+
const_def
230+
ENDM
229231

230-
DEF def_text_pointers EQUS "const_def 1"
232+
MACRO def_text_pointers
233+
const_def 1
234+
ENDM
231235

232-
DEF object_const_def EQUS "const_def 1"
236+
MACRO object_const_def
237+
const_def 1
238+
ENDM

macros/scripts/text.asm

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
1-
DEF text EQUS "db TX_START," ; Start writing text.
2-
DEF next EQUS "db \"<NEXT>\"," ; Move a line down.
3-
DEF line EQUS "db \"<LINE>\"," ; Start writing at the bottom line.
4-
DEF para EQUS "db \"<PARA>\"," ; Start a new paragraph.
5-
DEF cont EQUS "db \"<CONT>\"," ; Scroll to the next line.
6-
DEF done EQUS "db \"<DONE>\"" ; End a text box.
7-
DEF prompt EQUS "db \"<PROMPT>\"" ; Prompt the player to end a text box (initiating some other event).
8-
9-
DEF page EQUS "db \"<PAGE>\"," ; Start a new Pokédex page.
10-
DEF dex EQUS "db \"<DEXEND>\", \"@\"" ; End a Pokédex entry.
1+
MACRO text
2+
db TX_START, \# ; Start writing text
3+
ENDM
4+
5+
MACRO next
6+
db "<NEXT>", \# ; Move a line down
7+
ENDM
8+
9+
MACRO line
10+
db "<LINE>", \# ; Start writing at the bottom line
11+
ENDM
12+
13+
MACRO para
14+
db "<PARA>", \# ; Start a new paragraph
15+
ENDM
16+
17+
MACRO cont
18+
db "<CONT>", \# ; Scroll to the next line
19+
ENDM
20+
21+
MACRO done
22+
db "<DONE>" ; End a text box
23+
ENDM
24+
25+
MACRO prompt
26+
db "<PROMPT>" ; Prompt the player to end a text box (initiating some other event)
27+
ENDM
28+
29+
MACRO page
30+
db "<PAGE>", \# ; Start a new Pokédex page
31+
ENDM
32+
33+
MACRO dex
34+
db "<DEXEND>@" ; End a Pokédex entry
35+
ENDM
1136

1237

1338
; TextCommandJumpTable indexes (see home/text.asm)

0 commit comments

Comments
 (0)