summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-11-23 20:18:08 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2021-11-23 20:18:08 -0500
commitab0f9c287a45d1986985545d7ec6a2cd862e26fc (patch)
tree8063a15ad7082b953e47d2d00afd2679f9a8b470 /macros
parent6834c7a9a149aaadccc7d41bc93e5440d84d8b66 (diff)
Use compound assignment operators
Diffstat (limited to 'macros')
-rw-r--r--macros/asserts.asm2
-rw-r--r--macros/code.asm2
-rw-r--r--macros/const.asm10
-rw-r--r--macros/data.asm2
-rw-r--r--macros/scripts/gfx_anims.asm2
-rw-r--r--macros/scripts/maps.asm12
6 files changed, 15 insertions, 15 deletions
diff --git a/macros/asserts.asm b/macros/asserts.asm
index f1c5cfdc1..e04ed0dc6 100644
--- a/macros/asserts.asm
+++ b/macros/asserts.asm
@@ -29,7 +29,7 @@ ENDM
li: MACRO
assert !STRIN(\1, "@"), STRCAT("String terminator \"@\" in list entry: ", \1)
db \1, "@"
-list_index = list_index + 1
+list_index += 1
ENDM
assert_list_length: MACRO
diff --git a/macros/code.asm b/macros/code.asm
index 89e7c6e90..6e76febb8 100644
--- a/macros/code.asm
+++ b/macros/code.asm
@@ -38,7 +38,7 @@ maskbits: MACRO
x = 1
rept 8
if x + 1 < (\1)
-x = x << 1 | 1
+x = (x << 1) | 1
endc
endr
if _NARG == 2
diff --git a/macros/const.asm b/macros/const.asm
index 11d96d179..aed8bde4a 100644
--- a/macros/const.asm
+++ b/macros/const.asm
@@ -15,19 +15,19 @@ ENDM
const: MACRO
\1 EQU const_value
-const_value = const_value + const_inc
+const_value += const_inc
ENDM
shift_const: MACRO
-\1 EQU (1 << const_value)
-const_value = const_value + const_inc
+\1 EQU 1 << const_value
+const_value += const_inc
ENDM
const_skip: MACRO
if _NARG >= 1
-const_value = const_value + const_inc * (\1)
+const_value += const_inc * (\1)
else
-const_value = const_value + const_inc
+const_value += const_inc
endc
ENDM
diff --git a/macros/data.asm b/macros/data.asm
index d57bfdd8f..e5ebf1e64 100644
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -98,6 +98,6 @@ sine_table: MACRO
x = 0
rept \1
dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
-x = x + DIV(32768, \1) ; a circle has 65536 "degrees"
+x += DIV(32768, \1) ; a circle has 65536 "degrees"
endr
ENDM
diff --git a/macros/scripts/gfx_anims.asm b/macros/scripts/gfx_anims.asm
index 61c18fa8b..2c4c267b3 100644
--- a/macros/scripts/gfx_anims.asm
+++ b/macros/scripts/gfx_anims.asm
@@ -5,7 +5,7 @@ frame: MACRO
x = \2
if _NARG > 2
rept _NARG - 2
-x = x | (1 << (\3 + 1))
+x |= 1 << (\3 + 1)
shift
endr
endc
diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm
index a394405d4..0621277ba 100644
--- a/macros/scripts/maps.asm
+++ b/macros/scripts/maps.asm
@@ -17,7 +17,7 @@ scene_script: MACRO
;\1: script pointer
dw \1
dw 0 ; filler
-{_NUM_SCENE_SCRIPTS} = {_NUM_SCENE_SCRIPTS} + 1
+{_NUM_SCENE_SCRIPTS} += 1
ENDM
def_callbacks: MACRO
@@ -30,7 +30,7 @@ callback: MACRO
;\1: type: a MAPCALLBACK_* constant
;\2: script pointer
dbw \1, \2
-{_NUM_CALLBACKS} = {_NUM_CALLBACKS} + 1
+{_NUM_CALLBACKS} += 1
ENDM
def_warp_events: MACRO
@@ -46,7 +46,7 @@ warp_event: MACRO
;\4: warp destination: starts at 1
db \2, \1, \4
map_id \3
-{_NUM_WARP_EVENTS} = {_NUM_WARP_EVENTS} + 1
+{_NUM_WARP_EVENTS} += 1
ENDM
def_coord_events: MACRO
@@ -64,7 +64,7 @@ coord_event: MACRO
db 0 ; filler
dw \4
dw 0 ; filler
-{_NUM_COORD_EVENTS} = {_NUM_COORD_EVENTS} + 1
+{_NUM_COORD_EVENTS} += 1
ENDM
def_bg_events: MACRO
@@ -80,7 +80,7 @@ bg_event: MACRO
;\4: script pointer
db \2, \1, \3
dw \4
-{_NUM_BG_EVENTS} = {_NUM_BG_EVENTS} + 1
+{_NUM_BG_EVENTS} += 1
ENDM
def_object_events: MACRO
@@ -114,7 +114,7 @@ object_event: MACRO
dw \<12>, \<13>
; the dummy PlayerObjectTemplate object_event has no def_object_events
if DEF(_NUM_OBJECT_EVENTS)
-{_NUM_OBJECT_EVENTS} = {_NUM_OBJECT_EVENTS} + 1
+{_NUM_OBJECT_EVENTS} += 1
endc
ENDM