mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-14 00:56:40 +13:00
Use rgbds 0.5.0 features:
- FOR loops
- {interpolation}
- REDEF EQUS
- \# for all macro args
This commit is contained in:
parent
4b64b146e4
commit
dd690920c9
|
|
@ -128,17 +128,10 @@ IF !DEF(HM01)
|
||||||
HM01 EQU const_value
|
HM01 EQU const_value
|
||||||
__tmhm_value__ = NUM_TMS + 1
|
__tmhm_value__ = NUM_TMS + 1
|
||||||
ENDC
|
ENDC
|
||||||
HM_VALUE EQU __tmhm_value__ - NUM_TMS
|
|
||||||
IF HM_VALUE < 10
|
|
||||||
MOVE_FOR_HM EQUS "HM0{d:HM_VALUE}_MOVE"
|
|
||||||
ELSE
|
|
||||||
MOVE_FOR_HM EQUS "HM{d:HM_VALUE}_MOVE"
|
|
||||||
ENDC
|
|
||||||
MOVE_FOR_HM = \1
|
|
||||||
PURGE MOVE_FOR_HM
|
|
||||||
PURGE HM_VALUE
|
|
||||||
const HM_\1
|
const HM_\1
|
||||||
\1_TMNUM EQU __tmhm_value__
|
\1_TMNUM EQU __tmhm_value__
|
||||||
|
__HM_VALUE = __tmhm_value__ - NUM_TMS
|
||||||
|
HM{02d:__HM_VALUE}_MOVE EQU \1
|
||||||
__tmhm_value__ = __tmhm_value__ + 1
|
__tmhm_value__ = __tmhm_value__ + 1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
@ -159,15 +152,9 @@ IF !DEF(TM01)
|
||||||
TM01 EQU const_value
|
TM01 EQU const_value
|
||||||
__tmhm_value__ = 1
|
__tmhm_value__ = 1
|
||||||
ENDC
|
ENDC
|
||||||
IF __tmhm_value__ < 10
|
|
||||||
MOVE_FOR_TM EQUS "TM0{d:__tmhm_value__}_MOVE"
|
|
||||||
ELSE
|
|
||||||
MOVE_FOR_TM EQUS "TM{d:__tmhm_value__}_MOVE"
|
|
||||||
ENDC
|
|
||||||
MOVE_FOR_TM = \1
|
|
||||||
PURGE MOVE_FOR_TM
|
|
||||||
const TM_\1
|
const TM_\1
|
||||||
\1_TMNUM EQU __tmhm_value__
|
\1_TMNUM EQU __tmhm_value__
|
||||||
|
TM{02d:__tmhm_value__}_MOVE EQU \1
|
||||||
__tmhm_value__ = __tmhm_value__ + 1
|
__tmhm_value__ = __tmhm_value__ + 1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,28 +4,12 @@
|
||||||
TechnicalMachines:
|
TechnicalMachines:
|
||||||
table_width 1, TechnicalMachines
|
table_width 1, TechnicalMachines
|
||||||
|
|
||||||
n = 1
|
FOR n, 1, NUM_TMS + 1
|
||||||
REPT NUM_TMS
|
db TM{02d:n}_MOVE
|
||||||
IF n < 10
|
|
||||||
MOVE_FOR_TM EQUS "TM0{d:n}_MOVE"
|
|
||||||
ELSE
|
|
||||||
MOVE_FOR_TM EQUS "TM{d:n}_MOVE"
|
|
||||||
ENDC
|
|
||||||
db MOVE_FOR_TM
|
|
||||||
PURGE MOVE_FOR_TM
|
|
||||||
n = n + 1
|
|
||||||
ENDR
|
ENDR
|
||||||
assert_table_length NUM_TMS
|
assert_table_length NUM_TMS
|
||||||
|
|
||||||
n = 1
|
FOR n, 1, NUM_HMS + 1
|
||||||
REPT NUM_HMS
|
db HM{02d:n}_MOVE
|
||||||
IF n < 10
|
|
||||||
MOVE_FOR_HM EQUS "HM0{d:n}_MOVE"
|
|
||||||
ELSE
|
|
||||||
MOVE_FOR_HM EQUS "HM{d:n}_MOVE"
|
|
||||||
ENDC
|
|
||||||
db MOVE_FOR_HM
|
|
||||||
PURGE MOVE_FOR_HM
|
|
||||||
n = n + 1
|
|
||||||
ENDR
|
ENDR
|
||||||
assert_table_length NUM_TM_HM
|
assert_table_length NUM_TM_HM
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
coll_tiles: MACRO
|
coll_tiles: MACRO
|
||||||
REPT _NARG
|
IF _NARG
|
||||||
db \1
|
db \# ; all args
|
||||||
shift
|
ENDC
|
||||||
ENDR
|
|
||||||
db -1 ; end
|
db -1 ; end
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,9 @@ DoorTileIDPointers:
|
||||||
db -1 ; end
|
db -1 ; end
|
||||||
|
|
||||||
door_tiles: MACRO
|
door_tiles: MACRO
|
||||||
REPT _NARG
|
IF _NARG
|
||||||
db \1
|
db \# ; all args
|
||||||
shift
|
ENDC
|
||||||
ENDR
|
|
||||||
db 0 ; end
|
db 0 ; end
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,9 @@ WarpTileListPointers:
|
||||||
dw .FacingRightWarpTiles
|
dw .FacingRightWarpTiles
|
||||||
|
|
||||||
warp_carpet_tiles: MACRO
|
warp_carpet_tiles: MACRO
|
||||||
REPT _NARG
|
IF _NARG
|
||||||
db \1
|
db \# ; all args
|
||||||
shift
|
ENDC
|
||||||
ENDR
|
|
||||||
db -1 ; end
|
db -1 ; end
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,9 @@ WarpTileIDPointers:
|
||||||
assert_table_length NUM_TILESETS
|
assert_table_length NUM_TILESETS
|
||||||
|
|
||||||
warp_tiles: MACRO
|
warp_tiles: MACRO
|
||||||
REPT _NARG
|
IF _NARG
|
||||||
db \1
|
db \# ; all args
|
||||||
shift
|
ENDC
|
||||||
ENDR
|
|
||||||
db -1 ; end
|
db -1 ; end
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
move_choices: MACRO
|
move_choices: MACRO
|
||||||
REPT _NARG
|
IF _NARG
|
||||||
db \1
|
db \# ; all args
|
||||||
shift
|
ENDC
|
||||||
ENDR
|
|
||||||
db 0 ; end
|
db 0 ; end
|
||||||
list_index = list_index + 1
|
list_index = list_index + 1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
|
||||||
|
|
@ -91,9 +91,9 @@ FlashSprite8Times:
|
||||||
|
|
||||||
CopyHealingMachineOAM:
|
CopyHealingMachineOAM:
|
||||||
; copy one OAM entry and advance the pointers
|
; copy one OAM entry and advance the pointers
|
||||||
REPT 4
|
REPT 4
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
inc de
|
inc de
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ENDR
|
ENDR
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ ClearBgMap::
|
||||||
jr .next
|
jr .next
|
||||||
ld a, l
|
ld a, l
|
||||||
.next
|
.next
|
||||||
ld de, $400 ; size of VRAM background map
|
ld de, BG_MAP_WIDTH * BG_MAP_HEIGHT
|
||||||
ld l, e
|
ld l, e
|
||||||
.loop
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -69,7 +69,7 @@ RedrawRowOrColumn::
|
||||||
.noCarry
|
.noCarry
|
||||||
; the following 4 lines wrap us from bottom to top if necessary
|
; the following 4 lines wrap us from bottom to top if necessary
|
||||||
ld a, d
|
ld a, d
|
||||||
and $03
|
and $3
|
||||||
or $98
|
or $98
|
||||||
ld d, a
|
ld d, a
|
||||||
dec c
|
dec c
|
||||||
|
|
@ -169,21 +169,19 @@ AutoBgMapTransfer::
|
||||||
|
|
||||||
TransferBgRows::
|
TransferBgRows::
|
||||||
; unrolled loop and using pop for speed
|
; unrolled loop and using pop for speed
|
||||||
|
REPT SCREEN_WIDTH / 2 - 1
|
||||||
REPT 20 / 2 - 1
|
|
||||||
pop de
|
pop de
|
||||||
ld [hl], e
|
ld [hl], e
|
||||||
inc l
|
inc l
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
inc l
|
inc l
|
||||||
ENDR
|
ENDR
|
||||||
|
|
||||||
pop de
|
pop de
|
||||||
ld [hl], e
|
ld [hl], e
|
||||||
inc l
|
inc l
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
|
|
||||||
ld a, 32 - (20 - 1)
|
ld a, BG_MAP_WIDTH - (SCREEN_WIDTH - 1)
|
||||||
add l
|
add l
|
||||||
ld l, a
|
ld l, a
|
||||||
jr nc, .ok
|
jr nc, .ok
|
||||||
|
|
@ -261,7 +259,7 @@ VBlankCopyDouble::
|
||||||
ldh [hVBlankCopyDoubleSize], a
|
ldh [hVBlankCopyDoubleSize], a
|
||||||
|
|
||||||
.loop
|
.loop
|
||||||
REPT 3
|
REPT LEN_2BPP_TILE / 4 - 1
|
||||||
pop de
|
pop de
|
||||||
ld [hl], e
|
ld [hl], e
|
||||||
inc l
|
inc l
|
||||||
|
|
@ -271,8 +269,7 @@ VBlankCopyDouble::
|
||||||
inc l
|
inc l
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
inc l
|
inc l
|
||||||
ENDR
|
ENDR
|
||||||
|
|
||||||
pop de
|
pop de
|
||||||
ld [hl], e
|
ld [hl], e
|
||||||
inc l
|
inc l
|
||||||
|
|
@ -339,14 +336,13 @@ VBlankCopy::
|
||||||
ldh [hVBlankCopySize], a
|
ldh [hVBlankCopySize], a
|
||||||
|
|
||||||
.loop
|
.loop
|
||||||
REPT 7
|
REPT LEN_2BPP_TILE / 2 - 1
|
||||||
pop de
|
pop de
|
||||||
ld [hl], e
|
ld [hl], e
|
||||||
inc l
|
inc l
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
inc l
|
inc l
|
||||||
ENDR
|
ENDR
|
||||||
|
|
||||||
pop de
|
pop de
|
||||||
ld [hl], e
|
ld [hl], e
|
||||||
inc l
|
inc l
|
||||||
|
|
|
||||||
|
|
@ -2,33 +2,27 @@
|
||||||
|
|
||||||
table_width: MACRO
|
table_width: MACRO
|
||||||
CURRENT_TABLE_WIDTH = \1
|
CURRENT_TABLE_WIDTH = \1
|
||||||
IF DEF(CURRENT_TABLE_START)
|
|
||||||
PURGE CURRENT_TABLE_START
|
|
||||||
ENDC
|
|
||||||
IF _NARG == 2
|
IF _NARG == 2
|
||||||
CURRENT_TABLE_START EQUS "\2"
|
REDEF CURRENT_TABLE_START EQUS "\2"
|
||||||
ELSE
|
ELSE
|
||||||
CURRENT_TABLE_START EQUS "._table_width\@"
|
REDEF CURRENT_TABLE_START EQUS "._table_width\@"
|
||||||
CURRENT_TABLE_START:
|
{CURRENT_TABLE_START}:
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
assert_table_length: MACRO
|
assert_table_length: MACRO
|
||||||
x = \1
|
x = \1
|
||||||
ASSERT x * CURRENT_TABLE_WIDTH == @ - CURRENT_TABLE_START, \
|
ASSERT x * CURRENT_TABLE_WIDTH == @ - {CURRENT_TABLE_START}, \
|
||||||
"{CURRENT_TABLE_START}: expected {d:x} entries, each {d:CURRENT_TABLE_WIDTH} bytes"
|
"{CURRENT_TABLE_START}: expected {d:x} entries, each {d:CURRENT_TABLE_WIDTH} bytes"
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
list_start: MACRO
|
list_start: MACRO
|
||||||
list_index = 0
|
list_index = 0
|
||||||
IF DEF(CURRENT_LIST_START)
|
|
||||||
PURGE CURRENT_LIST_START
|
|
||||||
ENDC
|
|
||||||
IF _NARG == 1
|
IF _NARG == 1
|
||||||
CURRENT_LIST_START EQUS "\1"
|
REDEF CURRENT_LIST_START EQUS "\1"
|
||||||
ELSE
|
ELSE
|
||||||
CURRENT_LIST_START EQUS "._list_start\@"
|
REDEF CURRENT_LIST_START EQUS "._list_start\@"
|
||||||
CURRENT_LIST_START:
|
{CURRENT_LIST_START}:
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
@ -46,42 +40,36 @@ ENDM
|
||||||
|
|
||||||
def_grass_wildmons: MACRO
|
def_grass_wildmons: MACRO
|
||||||
;\1: encounter rate
|
;\1: encounter rate
|
||||||
if DEF(CURRENT_GRASS_WILDMONS_LABEL)
|
|
||||||
PURGE CURRENT_GRASS_WILDMONS_LABEL
|
|
||||||
endc
|
|
||||||
CURRENT_GRASS_WILDMONS_RATE = \1
|
CURRENT_GRASS_WILDMONS_RATE = \1
|
||||||
CURRENT_GRASS_WILDMONS_LABEL EQUS "._def_grass_wildmons_\1"
|
REDEF CURRENT_GRASS_WILDMONS_LABEL EQUS "._def_grass_wildmons_\1"
|
||||||
CURRENT_GRASS_WILDMONS_LABEL:
|
{CURRENT_GRASS_WILDMONS_LABEL}:
|
||||||
db \1
|
db \1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
end_grass_wildmons: MACRO
|
end_grass_wildmons: MACRO
|
||||||
IF CURRENT_GRASS_WILDMONS_RATE == 0
|
IF CURRENT_GRASS_WILDMONS_RATE == 0
|
||||||
assert 1 == @ - CURRENT_GRASS_WILDMONS_LABEL, \
|
assert 1 == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \
|
||||||
"def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected 1 byte"
|
"def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected 1 byte"
|
||||||
ELSE
|
ELSE
|
||||||
assert WILDDATA_LENGTH == @ - CURRENT_GRASS_WILDMONS_LABEL, \
|
assert WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \
|
||||||
"def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes"
|
"def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes"
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
def_water_wildmons: MACRO
|
def_water_wildmons: MACRO
|
||||||
;\1: encounter rate
|
;\1: encounter rate
|
||||||
if DEF(CURRENT_WATER_WILDMONS_LABEL)
|
|
||||||
PURGE CURRENT_WATER_WILDMONS_LABEL
|
|
||||||
endc
|
|
||||||
CURRENT_WATER_WILDMONS_RATE = \1
|
CURRENT_WATER_WILDMONS_RATE = \1
|
||||||
CURRENT_WATER_WILDMONS_LABEL EQUS "._def_water_wildmons_\1"
|
REDEF CURRENT_WATER_WILDMONS_LABEL EQUS "._def_water_wildmons_\1"
|
||||||
CURRENT_WATER_WILDMONS_LABEL:
|
{CURRENT_WATER_WILDMONS_LABEL}:
|
||||||
db \1
|
db \1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
end_water_wildmons: MACRO
|
end_water_wildmons: MACRO
|
||||||
IF CURRENT_WATER_WILDMONS_RATE == 0
|
IF CURRENT_WATER_WILDMONS_RATE == 0
|
||||||
assert 1 == @ - CURRENT_WATER_WILDMONS_LABEL, \
|
assert 1 == @ - {CURRENT_WATER_WILDMONS_LABEL}, \
|
||||||
"def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected 1 byte"
|
"def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected 1 byte"
|
||||||
ELSE
|
ELSE
|
||||||
assert WILDDATA_LENGTH == @ - CURRENT_WATER_WILDMONS_LABEL, \
|
assert WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \
|
||||||
"def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes"
|
"def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes"
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
|
||||||
|
|
@ -19,33 +19,23 @@ money EQUS "bcd3"
|
||||||
; used in data/pokemon/base_stats/*.asm
|
; used in data/pokemon/base_stats/*.asm
|
||||||
tmhm: MACRO
|
tmhm: MACRO
|
||||||
; initialize bytes to 0
|
; initialize bytes to 0
|
||||||
n = 0
|
FOR n, (NUM_TM_HM + 7) / 8
|
||||||
REPT (NUM_TM_HM + 7) / 8
|
_tm{d:n} = 0
|
||||||
_TM_BYTE EQUS "_tm{d:n}"
|
|
||||||
_TM_BYTE = 0
|
|
||||||
PURGE _TM_BYTE
|
|
||||||
n = n + 1
|
|
||||||
ENDR
|
ENDR
|
||||||
; set bits of bytes
|
; set bits of bytes
|
||||||
REPT _NARG
|
REPT _NARG
|
||||||
IF DEF(\1_TMNUM)
|
IF DEF(\1_TMNUM)
|
||||||
n = (\1_TMNUM - 1) / 8
|
n = (\1_TMNUM - 1) / 8
|
||||||
i = (\1_TMNUM - 1) % 8
|
i = (\1_TMNUM - 1) % 8
|
||||||
_TM_BYTE EQUS "_tm{d:n}"
|
_tm{d:n} = _tm{d:n} | (1 << i)
|
||||||
_TM_BYTE = _TM_BYTE | (1 << i)
|
|
||||||
PURGE _TM_BYTE
|
|
||||||
ELSE
|
ELSE
|
||||||
FAIL "\1 is not a TM or HM move"
|
FAIL "\1 is not a TM or HM move"
|
||||||
ENDC
|
ENDC
|
||||||
SHIFT
|
SHIFT
|
||||||
ENDR
|
ENDR
|
||||||
; output bytes
|
; output bytes
|
||||||
n = 0
|
FOR n, (NUM_TM_HM + 7) / 8
|
||||||
REPT (NUM_TM_HM + 7) / 8
|
db _tm{d:n}
|
||||||
_TM_BYTE EQUS "_tm{d:n}"
|
|
||||||
db _TM_BYTE
|
|
||||||
PURGE _TM_BYTE
|
|
||||||
n = n + 1
|
|
||||||
ENDR
|
ENDR
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
def_objects: MACRO
|
def_objects: MACRO
|
||||||
IF DEF(_NUM_OBJECTS)
|
REDEF _NUM_OBJECTS EQUS "_NUM_OBJECTS_\@"
|
||||||
PURGE _NUM_OBJECTS
|
db {_NUM_OBJECTS}
|
||||||
ENDC
|
{_NUM_OBJECTS} = 0
|
||||||
_NUM_OBJECTS EQUS "_NUM_OBJECTS_\@"
|
|
||||||
db _NUM_OBJECTS
|
|
||||||
_NUM_OBJECTS = 0
|
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
;\1 sprite id
|
;\1 sprite id
|
||||||
|
|
@ -32,16 +29,13 @@ object: MACRO
|
||||||
ELSE
|
ELSE
|
||||||
db \6
|
db \6
|
||||||
ENDC
|
ENDC
|
||||||
_NUM_OBJECTS = _NUM_OBJECTS + 1
|
{_NUM_OBJECTS} = {_NUM_OBJECTS} + 1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
def_warps: MACRO
|
def_warps: MACRO
|
||||||
IF DEF(_NUM_WARPS)
|
REDEF _NUM_WARPS EQUS "_NUM_WARPS_\@"
|
||||||
PURGE _NUM_WARPS
|
db {_NUM_WARPS}
|
||||||
ENDC
|
{_NUM_WARPS} = 0
|
||||||
_NUM_WARPS EQUS "_NUM_WARPS_\@"
|
|
||||||
db _NUM_WARPS
|
|
||||||
_NUM_WARPS = 0
|
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
;\1 x position
|
;\1 x position
|
||||||
|
|
@ -50,19 +44,15 @@ ENDM
|
||||||
;\4 destination map (-1 = wLastMap)
|
;\4 destination map (-1 = wLastMap)
|
||||||
warp: MACRO
|
warp: MACRO
|
||||||
db \2, \1, \3, \4
|
db \2, \1, \3, \4
|
||||||
_TMP EQUS "\n_WARP_{d:{_NUM_WARPS}}_X = \1\n_WARP_{d:{_NUM_WARPS}}_Y = \2"
|
_WARP_{d:{_NUM_WARPS}}_X = \1
|
||||||
_TMP
|
_WARP_{d:{_NUM_WARPS}}_Y = \2
|
||||||
PURGE _TMP
|
{_NUM_WARPS} = {_NUM_WARPS} + 1
|
||||||
_NUM_WARPS = _NUM_WARPS + 1
|
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
def_signs: MACRO
|
def_signs: MACRO
|
||||||
IF DEF(_NUM_SIGNS)
|
REDEF _NUM_SIGNS EQUS "_NUM_SIGNS_\@"
|
||||||
PURGE _NUM_SIGNS
|
db {_NUM_SIGNS}
|
||||||
ENDC
|
{_NUM_SIGNS} = 0
|
||||||
_NUM_SIGNS EQUS "_NUM_SIGNS_\@"
|
|
||||||
db _NUM_SIGNS
|
|
||||||
_NUM_SIGNS = 0
|
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
;\1 x position
|
;\1 x position
|
||||||
|
|
@ -70,17 +60,13 @@ ENDM
|
||||||
;\3 sign id
|
;\3 sign id
|
||||||
sign: MACRO
|
sign: MACRO
|
||||||
db \2, \1, \3
|
db \2, \1, \3
|
||||||
_NUM_SIGNS = _NUM_SIGNS + 1
|
{_NUM_SIGNS} = {_NUM_SIGNS} + 1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
;\1 source map
|
;\1 source map
|
||||||
def_warps_to: MACRO
|
def_warps_to: MACRO
|
||||||
N = 0
|
FOR n, _NUM_WARPS
|
||||||
REPT _NUM_WARPS
|
warp_to _WARP_{d:n}_X, _WARP_{d:n}_Y, \1_WIDTH
|
||||||
_TMP EQUS "warp_to _WARP_{d:N}_X, _WARP_{d:N}_Y, \1_WIDTH"
|
|
||||||
_TMP
|
|
||||||
PURGE _TMP
|
|
||||||
N = N + 1
|
|
||||||
ENDR
|
ENDR
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
@ -146,10 +132,8 @@ ENDM
|
||||||
|
|
||||||
; Comes after map_header and connection macros
|
; Comes after map_header and connection macros
|
||||||
end_map_header: MACRO
|
end_map_header: MACRO
|
||||||
dw CURRENT_MAP_OBJECT
|
dw {CURRENT_MAP_OBJECT}
|
||||||
PURGE CURRENT_MAP_WIDTH
|
PURGE CURRENT_MAP_WIDTH, CURRENT_MAP_HEIGHT, CURRENT_MAP_OBJECT
|
||||||
PURGE CURRENT_MAP_HEIGHT
|
|
||||||
PURGE CURRENT_MAP_OBJECT
|
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
; Connections go in order: north, south, west, east
|
; Connections go in order: north, south, west, east
|
||||||
|
|
|
||||||
|
|
@ -169,10 +169,9 @@ ENDM
|
||||||
script_mart: MACRO
|
script_mart: MACRO
|
||||||
db TX_SCRIPT_MART
|
db TX_SCRIPT_MART
|
||||||
db _NARG ; number of items
|
db _NARG ; number of items
|
||||||
REPT _NARG
|
IF _NARG
|
||||||
db \1 ; item id
|
db \# ; all item ids
|
||||||
SHIFT
|
ENDC
|
||||||
ENDR
|
|
||||||
db -1 ; end
|
db -1 ; end
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,18 @@
|
||||||
; pokered requires rgbds 0.4.2 or newer.
|
|
||||||
MAJOR EQU 0
|
MAJOR EQU 0
|
||||||
MINOR EQU 4
|
MINOR EQU 5
|
||||||
PATCH EQU 2
|
PATCH EQU 0
|
||||||
|
|
||||||
|
wrong_rgbds: MACRO
|
||||||
|
fail "pokered requires rgbds v0.5.0 or newer."
|
||||||
|
ENDM
|
||||||
|
|
||||||
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
|
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
|
||||||
fail "pokered requires rgbds 0.4.2 or newer."
|
wrong_rgbds
|
||||||
ELSE
|
ELSE
|
||||||
IF (__RGBDS_MAJOR__ < MAJOR) || \
|
IF (__RGBDS_MAJOR__ < MAJOR) || \
|
||||||
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ < MINOR) || \
|
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ < MINOR) || \
|
||||||
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ < PATCH)
|
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ < PATCH) || \
|
||||||
fail "pokered requires rgbds 0.4.2 or newer."
|
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ == PATCH && DEF(__RGBDS_RC__))
|
||||||
|
wrong_rgbds
|
||||||
ENDC
|
ENDC
|
||||||
ENDC
|
ENDC
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue