Skip to content

Commit

Permalink
Use compound assignment operators
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Nov 24, 2021
1 parent fb18368 commit 39f4072
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion constants/deco_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ __deco_value__ = 0
deco: MACRO
const DECO_\1
DECOFLAG_\1 EQU __deco_value__
__deco_value__ = __deco_value__ + 1
__deco_value__ += 1
ENDM

; decorations:
Expand Down
4 changes: 2 additions & 2 deletions constants/map_constants.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
newgroup: MACRO
const_value = const_value + 1
const_value += 1
__map_value__ = 1
ENDM

Expand All @@ -9,7 +9,7 @@ map_const: MACRO
;\3: height: in blocks
GROUP_\1 EQU const_value
MAP_\1 EQU __map_value__
__map_value__ = __map_value__ + 1
__map_value__ += 1
\1_WIDTH EQU \2
\1_HEIGHT EQU \3
ENDM
Expand Down
4 changes: 2 additions & 2 deletions constants/pokemon_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,14 @@ ext_const_def: MACRO
endc
if _NARG >= 2
DEF \2 EQU ext_const_value
redef ext_const_value = ext_const_value + const_inc
redef ext_const_value += const_inc
endc
ENDM

ext_const: MACRO
const_skip
DEF \1 EQU ext_const_value
redef ext_const_value = ext_const_value + const_inc
redef ext_const_value += const_inc
ENDM

NO_FORM EQU 0
Expand Down
2 changes: 1 addition & 1 deletion constants/tmhm_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ __tmhm_value__ = 1

add_tmnum: MACRO
\1_TMNUM EQU __tmhm_value__
__tmhm_value__ = __tmhm_value__ + 1
__tmhm_value__ += 1
ENDM

add_tm: MACRO
Expand Down
2 changes: 1 addition & 1 deletion constants/trainer_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ __trainer_class__ = 0

trainerclass: MACRO
\1 EQU __trainer_class__
__trainer_class__ = __trainer_class__ + 1
__trainer_class__ += 1
const_def 1
ENDM

Expand Down
2 changes: 1 addition & 1 deletion data/events/odd_eggs.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NUM_ODD_EGGS EQU 5
ODD_EGG_LENGTH EQU 10

prob: MACRO
prob_total = prob_total + (\1)
prob_total += \1
dw prob_total * $ffff / 100
ENDM

Expand Down
2 changes: 1 addition & 1 deletion data/pokemon/base_stats.asm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tmhm: MACRO
if DEF(\<i>_TMNUM)
def n = (\<i>_TMNUM - 1) / 8
def t = (\<i>_TMNUM - 1) % 8
def _tm{d:n} = _tm{d:n} | (1 << t)
def _tm{d:n} |= 1 << t
else
fail "\<i> is not a TM, HM, or tutor move"
endc
Expand Down
2 changes: 1 addition & 1 deletion data/wild/roammon_maps.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ for i, 2, _NARG + 1
map_id \<i>
endr
db 0
list_index = list_index + 1
list_index += 1
ENDM

RoamMaps:
Expand Down
2 changes: 1 addition & 1 deletion engine/math/sine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ _Sine::
x = 0
rept $20
dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
x = x + DIV(32768, $20) ; a circle has 65536 "degrees"
x += DIV(32768, $20) ; a circle has 65536 "degrees"
endr
2 changes: 1 addition & 1 deletion macros/asserts.asm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ENDM
li: MACRO
assert !STRIN(\1, "@"), STRCAT("String terminator \"@\" in list entry: ", \1)
db \1, "@"
redef list_index = list_index + 1
redef list_index += 1
ENDM

assert_list_length: MACRO
Expand Down
2 changes: 1 addition & 1 deletion macros/code.asm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ maskbits: MACRO
def x = 1
rept 8
if x + 1 < (\1)
redef x = x << 1 | 1
redef x = (x << 1) | 1
endc
endr
if _NARG == 2
Expand Down
6 changes: 3 additions & 3 deletions macros/const.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENDM

const: MACRO
DEF \1 EQU const_value
redef const_value = const_value + const_inc
redef const_value += const_inc
ENDM

shift_const: MACRO
Expand All @@ -25,9 +25,9 @@ ENDM

const_skip: MACRO
if _NARG >= 1
redef const_value = const_value + const_inc * (\1)
redef const_value += const_inc * (\1)
else
redef const_value = const_value + const_inc
redef const_value += const_inc
endc
ENDM

Expand Down
4 changes: 2 additions & 2 deletions macros/data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ genders: MACRO
def y = 1
for i, 1, _NARG + 1
if !STRCMP("\<i>", "FEMALE")
def x = x | y
def x |= y
endc
def y = y * 2
def y <<= 1
endr
db x
ENDM
2 changes: 1 addition & 1 deletion macros/scripts/gfx_anims.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ frame: MACRO
db \1
def x = \2
for i, 3, _NARG + 1
redef x = x | (1 << (\<i> + 1))
redef x |= 1 << (\<i> + 1)
endr
db x
ENDM
Expand Down
12 changes: 6 additions & 6 deletions macros/scripts/maps.asm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENDM

scene_script: MACRO
dw \1 ; script
redef {_NUM_SCENE_SCRIPTS} = {_NUM_SCENE_SCRIPTS} + 1
redef {_NUM_SCENE_SCRIPTS} += 1
ENDM

def_callbacks: MACRO
Expand All @@ -24,7 +24,7 @@ ENDM
callback: MACRO
db \1 ; type
dw \2 ; script
def {_NUM_CALLBACKS} = {_NUM_CALLBACKS} + 1
redef {_NUM_CALLBACKS} += 1
ENDM

def_warp_events: MACRO
Expand All @@ -38,7 +38,7 @@ warp_event: MACRO
db \1 ; x
db \4 ; warp_to
map_id \3 ; map
redef {_NUM_WARP_EVENTS} = {_NUM_WARP_EVENTS} + 1
redef {_NUM_WARP_EVENTS} += 1
ENDM

def_coord_events: MACRO
Expand All @@ -52,7 +52,7 @@ coord_event: MACRO
db \2 ; y
db \1 ; x
dw \4 ; script
redef {_NUM_COORD_EVENTS} = {_NUM_COORD_EVENTS} + 1
redef {_NUM_COORD_EVENTS} += 1
ENDM

def_bg_events: MACRO
Expand All @@ -74,7 +74,7 @@ bg_event: MACRO
else
dw \4 ; pointer
endc
redef {_NUM_BG_EVENTS} = {_NUM_BG_EVENTS} + 1
redef {_NUM_BG_EVENTS} += 1
ENDM

def_object_events: MACRO
Expand Down Expand Up @@ -107,7 +107,7 @@ object_event: MACRO
dw \<12> ; pointer || byte, 0
dw \<13> ; event flag
endc
redef {_NUM_OBJECT_EVENTS} = {_NUM_OBJECT_EVENTS} + 1
redef {_NUM_OBJECT_EVENTS} += 1
ENDM

itemball_event: MACRO
Expand Down

0 comments on commit 39f4072

Please sign in to comment.