diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/charmap.inc | 4 | ||||
-rw-r--r-- | include/code_macros.inc | 14 | ||||
-rw-r--r-- | include/const_macros.inc | 60 | ||||
-rw-r--r-- | include/gfx_macros.inc | 16 | ||||
-rw-r--r-- | include/hardware.inc | 8 | ||||
-rw-r--r-- | include/puzzle_constants.inc | 4 | ||||
-rw-r--r-- | include/text.inc | 20 |
7 files changed, 58 insertions, 68 deletions
diff --git a/include/charmap.inc b/include/charmap.inc index 72b2490..e2ff5a3 100644 --- a/include/charmap.inc +++ b/include/charmap.inc @@ -320,8 +320,8 @@ charmap "(", 238 charmap ")", 239 charmap "~", 240 -TX_LF EQU -2 ; Line feed -TX_END EQU -1 ; End of message +DEF TX_LF EQU -2 ; Line feed +DEF TX_END EQU -1 ; End of message pushc newcharmap ascii diff --git a/include/code_macros.inc b/include/code_macros.inc index 26834cb..ea200d9 100644 --- a/include/code_macros.inc +++ b/include/code_macros.inc @@ -1,12 +1,12 @@ -lb: macro +macro lb ld \1, ((\2) & $ff) << 8 | ((\3) & $ff) endm -ln: macro +macro ln ld \1, ((\2) & $f) << 4 | ((\3) & $f) endm -ld16: macro +macro ld16 ld a, LOW(\2) ld [\1 + 0], a ld a, HIGH(\2) @@ -14,7 +14,7 @@ ld16: macro endm -farcall: macro +macro farcall push af ld16 w_farcall_target, \1 ld a, BANK(\1) @@ -23,7 +23,7 @@ farcall: macro call _farcall endm -farjp: macro +macro farjp push af ld16 w_farcall_target, \1 ld a, BANK(\1) @@ -33,7 +33,7 @@ farjp: macro endm -push_bank_rom: macro +macro push_bank_rom ld a, [w_bank_rom] push af ld a, \1 @@ -41,7 +41,7 @@ push_bank_rom: macro ld [rROMB0], a endm -pop_bank_rom: macro +macro pop_bank_rom pop af ld [w_bank_rom], a ld [rROMB0], a diff --git a/include/const_macros.inc b/include/const_macros.inc index 5cbdd2a..9ccdd81 100644 --- a/include/const_macros.inc +++ b/include/const_macros.inc @@ -1,43 +1,43 @@ -const_def: macro -if _NARG >= 1 -const_value = \1 -else -const_value = 0 -endc -if _NARG >= 2 -const_inc = \2 -else -const_inc = 1 -endc +macro const_def + if _NARG >= 1 + def const_value = \1 + else + def const_value = 0 + endc + if _NARG >= 2 + def const_inc = \2 + else + def const_inc = 1 + endc endm -const: macro -\1 EQU const_value -const_value = const_value + const_inc +macro const + DEF \1 EQU const_value + def const_value = const_value + const_inc endm -shift_const: macro -\1 EQU (1 << const_value) -const_value = const_value + const_inc +macro shift_const + DEF \1 EQU (1 << const_value) + def const_value = const_value + const_inc endm -const_skip: macro -if _NARG >= 1 -const_value = const_value + const_inc * (\1) -else -const_value = const_value + const_inc -endc +macro const_skip + if _NARG >= 1 + def const_value = const_value + const_inc * (\1) + else + def const_value = const_value + const_inc + endc endm -const_next: macro -if (const_value > 0 && \1 < const_value) || (const_value < 0 && \1 > const_value) -fail "const_next cannot go backwards from {const_value} to \1" -else -const_value = \1 -endc +macro const_next + if (const_value > 0 && \1 < const_value) || (const_value < 0 && \1 > const_value) + fail "const_next cannot go backwards from {const_value} to \1" + else + def const_value = \1 + endc endm -const_dw: macro +macro const_dw const \1 dw \2 endm diff --git a/include/gfx_macros.inc b/include/gfx_macros.inc index ad52e32..ee67fad 100644 --- a/include/gfx_macros.inc +++ b/include/gfx_macros.inc @@ -1,16 +1,16 @@ -RGB: macro +macro RGB rept _NARG / 3 dw palred (\1) + palgreen (\2) + palblue (\3) shift 3 endr endm -palred EQUS "(1 << 0) *" -palgreen EQUS "(1 << 5) *" -palblue EQUS "(1 << 10) *" +DEF palred EQUS "(1 << 0) *" +DEF palgreen EQUS "(1 << 5) *" +DEF palblue EQUS "(1 << 10) *" -palettes EQUS "* PALETTE_SIZE" -palette EQUS "+ PALETTE_SIZE *" -color EQUS "+ PAL_COLOR_SIZE *" +DEF palettes EQUS "* PALETTE_SIZE" +DEF palette EQUS "+ PALETTE_SIZE *" +DEF color EQUS "+ PAL_COLOR_SIZE *" -tiles EQUS "* $10" +DEF tiles EQUS "* $10" diff --git a/include/hardware.inc b/include/hardware.inc index a55a4b0..612f6b9 100644 --- a/include/hardware.inc +++ b/include/hardware.inc @@ -456,7 +456,7 @@ rSCY EQU $FF42 ; -- -; -- SCY ($FF43) +; -- SCX ($FF43) ; -- Scroll X (R/W) ; -- rSCX EQU $FF43 @@ -607,9 +607,15 @@ HDMA5F_BUSY EQU %10000000 ; 0=Busy (DMA still in progress), 1=Transfer complete ; -- ; -- RP ($FF56) ; -- Infrared Communications Port (R/W) +; -- CGB Mode Only ; -- rRP EQU $FF56 +RPF_ENREAD EQU %11000000 +RPF_DATAIN EQU %00000010 ; 0=Receiving IR Signal, 1=Normal +RPF_WRITE_HI EQU %00000001 +RPF_WRITE_LO EQU %00000000 + ; -- ; -- BCPS ($FF68) diff --git a/include/puzzle_constants.inc b/include/puzzle_constants.inc index 15941aa..fc95de3 100644 --- a/include/puzzle_constants.inc +++ b/include/puzzle_constants.inc @@ -14,7 +14,7 @@ const PUZZLE_BALLOONS const PUZZLE_BICYCLE const PUZZLE_HAT -TOWN_MAP_PUZZLES EQU const_value +DEF TOWN_MAP_PUZZLES EQU const_value const PUZZLE_DIGLETT const PUZZLE_GASTLY const PUZZLE_OMANYTE @@ -167,7 +167,7 @@ TOWN_MAP_PUZZLES EQU const_value const PUZZLE_ZAPDOS const PUZZLE_MEW const PUZZLE_TOGEPI -SAFARI_ZONE_PUZZLES EQU const_value +DEF SAFARI_ZONE_PUZZLES EQU const_value const PUZZLE_SAFARI_HAUNTER const PUZZLE_MEW_AND_MEWTWO const PUZZLE_STARING_CONTEST diff --git a/include/text.inc b/include/text.inc index 9de853a..77044e7 100644 --- a/include/text.inc +++ b/include/text.inc @@ -1,21 +1,5 @@ INCLUDE "charmap.inc" -; Outputs each character of each argument as a 16-bit word -; (dw "string" does not do this: https://github.com/gbdev/rgbds/issues/568) -text: macro -_arg = 1 - rept _NARG -_WS EQUS \1 -_len = STRLEN("{_WS}") -_i = 1 - rept _len - dw STRSUB("{_WS}", _i, 1) -_i = _i + 1 - endr - PURGE _WS - shift -_arg = _arg + 1 - endr -endm -line EQUS "dw TX_LF\n text" +text EQUS "dw" +line EQUS "dw TX_LF," done EQUS "dw TX_END" |