RGBDS syntax updates (#905)

New MACRO and DEF syntax
This commit is contained in:
vulcandth
2022-06-06 16:25:42 -05:00
committed by GitHub
parent a4d346cc8c
commit 3648afda16
179 changed files with 2546 additions and 2545 deletions

View File

@@ -4044,7 +4044,7 @@ MobileEZChatCategoryPointers:
db "なんの@@", $2, $4, $0
MobileEZChatData_WordAndPageCounts:
macro_11f220: MACRO
MACRO macro_11f220
; parameter: number of words
db \1
; 12 words per page (0-based indexing)
@@ -4071,11 +4071,11 @@ EZChat_SortedWords:
; allocated size for each.
; These arrays are expanded dynamically to accomodate
; any Pokemon you've seen that starts with each kana.
macro_11f23c: MACRO
MACRO macro_11f23c
dw w3_d012 - w3_d000 + x, \1
x += 2 * \1
DEF x += 2 * \1
ENDM
x = 0
DEF x = 0
macro_11f23c $2f ; a
macro_11f23c $1e ; i
macro_11f23c $11 ; u

View File

@@ -2395,7 +2395,7 @@ Function100f8d:
call CloseSRAM
ret
macro_100fc0: MACRO
MACRO macro_100fc0
; first byte:
; Bit 7 set: Not SRAM
; Lower 7 bits: Bank if SRAM

View File

@@ -1,9 +1,9 @@
add_mobiletradeanim: MACRO
MACRO add_mobiletradeanim
\1_MobileTradeCmd:
dw \1
ENDM
mobiletradeanim: MACRO
MACRO mobiletradeanim
db (\1_MobileTradeCmd - MobileTradeAnim_JumptableLoop.Jumptable) / 2
ENDM

View File

@@ -2946,17 +2946,17 @@ Function17e349:
call CloseSRAM
ret
inc_crash_check_pointer_farcall: MACRO
MACRO inc_crash_check_pointer_farcall
call IncCrashCheckPointer
call HlToCrashCheckPointer ; redundant
ldh a, [rSVBK]
push af
ld a, $1
ldh [rSVBK], a
rept _NARG
farcall \1
shift
endr
rept _NARG
farcall \1
shift
endr
pop af
ldh [rSVBK], a
ret