summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-06 12:28:31 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-06 12:28:31 -0400
commit8a79315635ee9ebb6eed5c9648fe89746085d0b1 (patch)
treee4db65c6ced277be38f2cb0bfc85cdc39a90208e /macros
parentd08eb862339c29ffe387f661121ac4dfe79c74ab (diff)
Capitalize rgbds control structures (EQU/EQUS, IF/ELIF/ELSE/ENDC, REPT/ENDR, MACRO/ENDM, etc)
Diffstat (limited to 'macros')
-rwxr-xr-xmacros/code.asm6
-rwxr-xr-xmacros/data.asm26
-rw-r--r--macros/enum.asm18
-rw-r--r--macros/gfx.asm4
-rwxr-xr-xmacros/scripts/events.asm8
-rw-r--r--macros/scripts/maps.asm32
-rwxr-xr-xmacros/scripts/text.asm4
7 files changed, 49 insertions, 49 deletions
diff --git a/macros/code.asm b/macros/code.asm
index 72ce9caf..8507b1ad 100755
--- a/macros/code.asm
+++ b/macros/code.asm
@@ -11,10 +11,10 @@ ENDM
; Design patterns
dict: MACRO
-if \1 == 0
+IF \1 == 0
and a
-else
+ELSE
cp \1
-endc
+ENDC
jp z, \2
ENDM
diff --git a/macros/data.asm b/macros/data.asm
index 333bf937..7a813529 100755
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -13,40 +13,40 @@ bcd3: MACRO
dn ((\1) / 10) % 10, (\1) % 10
ENDM
-coins equs "bcd2"
-money equs "bcd3"
+coins EQUS "bcd2"
+money EQUS "bcd3"
tmhm: MACRO
; used in data/pokemon/base_stats/*.asm
_tms1 = 0 ; TM01-TM24 (24)
_tms2 = 0 ; TM25-TM48 (24)
_tms3 = 0 ; TM49-TM50 + HM01-HM05 (7/24)
-rept _NARG
+REPT _NARG
if DEF(\1_TMNUM)
if \1_TMNUM < 24 + 1
_tms1 = _tms1 | (1 << ((\1_TMNUM) - 1))
- elif \1_TMNUM < 48 + 1
+ ELIF \1_TMNUM < 48 + 1
_tms2 = _tms2 | (1 << ((\1_TMNUM) - 1 - 24))
else
_tms3 = _tms3 | (1 << ((\1_TMNUM) - 1 - 48))
- endc
+ ENDC
else
fail "\1 is not a TM or HM move"
- endc
+ ENDC
shift
-endr
-rept 3 ; TM01-TM24 (24/24)
+ENDR
+REPT 3 ; TM01-TM24 (24/24)
db _tms1 & $ff
_tms1 = _tms1 >> 8
-endr
-rept 3 ; TM25-TM48 (24/24)
+ENDR
+REPT 3 ; TM25-TM48 (24/24)
db _tms2 & $ff
_tms2 = _tms2 >> 8
-endr
-rept 1 ; TM49-TM50 + HM01-HM05 (7/8)
+ENDR
+REPT 1 ; TM49-TM50 + HM01-HM05 (7/8)
db _tms3 & $ff
_tms3 = _tms3 >> 8
-endr
+ENDR
ENDM
diff --git a/macros/enum.asm b/macros/enum.asm
index 8fe5b534..5c69bcb8 100644
--- a/macros/enum.asm
+++ b/macros/enum.asm
@@ -1,16 +1,16 @@
; Enumerate variables
enum_start: MACRO
-if _NARG >= 1
+IF _NARG >= 1
__enum__ = \1
-else
+ELSE
__enum__ = 0
-endc
-if _NARG >= 2
+ENDC
+IF _NARG >= 2
__enumdir__ = \2
-else
+ELSE
__enumdir__ = 1
-endc
+ENDC
ENDM
enum: MACRO
@@ -25,11 +25,11 @@ ENDM
; Enumerate constants
const_def: MACRO
-if _NARG >= 1
+IF _NARG >= 1
const_value = \1
-else
+ELSE
const_value = 0
-endc
+ENDC
ENDM
const: MACRO
diff --git a/macros/gfx.asm b/macros/gfx.asm
index bad051ad..950daee1 100644
--- a/macros/gfx.asm
+++ b/macros/gfx.asm
@@ -1,8 +1,8 @@
RGB: MACRO
-rept _NARG / 3
+REPT _NARG / 3
dw palred (\1) + palgreen (\2) + palblue (\3)
shift 3
-endr
+ENDR
ENDM
palred EQUS "(1 << 0) *"
diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm
index c5f90107..9e84ec62 100755
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -183,10 +183,10 @@ ENDM
;\3, \4, ... = additional (optional) event indices
SetEvents: MACRO
SetEvent \1
- rept _NARG - 1
+ REPT _NARG - 1
SetEventReuseHL \2
shift
- endr
+ ENDR
ENDM
@@ -235,10 +235,10 @@ ENDM
;\3 = event index (optional)
ResetEvents: MACRO
ResetEvent \1
- rept _NARG - 1
+ REPT _NARG - 1
ResetEventReuseHL \2
shift
- endr
+ ENDR
ENDM
diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm
index a30561b9..37da8c58 100644
--- a/macros/scripts/maps.asm
+++ b/macros/scripts/maps.asm
@@ -121,58 +121,58 @@ connection: MACRO
; Calculate tile offsets for source (current) and target maps
_src = 0
_tgt = (\4) + 3
-if _tgt < 2
+IF _tgt < 2
_src = -_tgt
_tgt = 0
-endc
+ENDC
-if "\1" == "north"
+IF "\1" == "north"
_blk = \3_WIDTH * (\3_HEIGHT - 3) + _src
_map = _tgt
_win = (\3_WIDTH + 6) * \3_HEIGHT + 1
_y = \3_HEIGHT * 2 - 1
_x = (\4) * -2
_len = CURRENT_MAP_WIDTH + 3 - (\4)
-if _len > \3_WIDTH
+IF _len > \3_WIDTH
_len = \3_WIDTH
-endc
+ENDC
-elif "\1" == "south"
+ELIF "\1" == "south"
_blk = _src
_map = (CURRENT_MAP_WIDTH + 6) * (CURRENT_MAP_HEIGHT + 3) + _tgt
_win = \3_WIDTH + 7
_y = 0
_x = (\4) * -2
_len = CURRENT_MAP_WIDTH + 3 - (\4)
-if _len > \3_WIDTH
+IF _len > \3_WIDTH
_len = \3_WIDTH
-endc
+ENDC
-elif "\1" == "west"
+ELIF "\1" == "west"
_blk = (\3_WIDTH * _src) + \3_WIDTH - 3
_map = (CURRENT_MAP_WIDTH + 6) * _tgt
_win = (\3_WIDTH + 6) * 2 - 6
_y = (\4) * -2
_x = \3_WIDTH * 2 - 1
_len = CURRENT_MAP_HEIGHT + 3 - (\4)
-if _len > \3_HEIGHT
+IF _len > \3_HEIGHT
_len = \3_HEIGHT
-endc
+ENDC
-elif "\1" == "east"
+ELIF "\1" == "east"
_blk = (\3_WIDTH * _src)
_map = (CURRENT_MAP_WIDTH + 6) * _tgt + CURRENT_MAP_WIDTH + 3
_win = \3_WIDTH + 7
_y = (\4) * -2
_x = 0
_len = CURRENT_MAP_HEIGHT + 3 - (\4)
-if _len > \3_HEIGHT
+IF _len > \3_HEIGHT
_len = \3_HEIGHT
-endc
+ENDC
-else
+ELSE
fail "Invalid direction for 'connection'."
-endc
+ENDC
db \3
dw \2_Blocks + _blk
diff --git a/macros/scripts/text.asm b/macros/scripts/text.asm
index b1e1727b..4bf2c1bc 100755
--- a/macros/scripts/text.asm
+++ b/macros/scripts/text.asm
@@ -198,10 +198,10 @@ ENDM
script_mart: MACRO
db TX_SCRIPT_MART
db _NARG ; number of items
-rept _NARG
+REPT _NARG
db \1 ; item id
shift
-endr
+ENDR
db -1 ; end
ENDM