mirror of
https://github.com/pret/pokegold.git
synced 2026-04-26 10:00:21 -05:00
parent
5b4a996655
commit
ec8bd3e1ae
|
|
@ -21,6 +21,7 @@ DEF NUM_MAPSETUP_SCRIPTS EQU const_value - $f1
|
||||||
const MAPCALLBACK_CMDQUEUE
|
const MAPCALLBACK_CMDQUEUE
|
||||||
const MAPCALLBACK_SPRITES
|
const MAPCALLBACK_SPRITES
|
||||||
const MAPCALLBACK_NEWMAP
|
const MAPCALLBACK_NEWMAP
|
||||||
|
DEF NUM_MAPCALLBACK_TYPES EQU const_value - 1
|
||||||
|
|
||||||
; see data/maps/setup_script_pointers.asm
|
; see data/maps/setup_script_pointers.asm
|
||||||
DEF MAPSETUPSCRIPT_HAS_PARAM_F EQU 7
|
DEF MAPSETUPSCRIPT_HAS_PARAM_F EQU 7
|
||||||
|
|
|
||||||
|
|
@ -39,11 +39,17 @@ MACRO def_callbacks
|
||||||
REDEF _NUM_CALLBACKS EQUS "_NUM_CALLBACKS_\@"
|
REDEF _NUM_CALLBACKS EQUS "_NUM_CALLBACKS_\@"
|
||||||
db {_NUM_CALLBACKS}
|
db {_NUM_CALLBACKS}
|
||||||
DEF {_NUM_CALLBACKS} = 0
|
DEF {_NUM_CALLBACKS} = 0
|
||||||
|
for x, 1, NUM_MAPCALLBACK_TYPES + 1
|
||||||
|
DEF map_callback_{d:x} = 0
|
||||||
|
endr
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
MACRO callback
|
MACRO callback
|
||||||
;\1: type: a MAPCALLBACK_* constant
|
;\1: type: a MAPCALLBACK_* constant
|
||||||
;\2: script pointer
|
;\2: script pointer
|
||||||
|
DEF x = \1
|
||||||
|
assert !map_callback_{d:x}, "Already defined a `callback \1` for this map"
|
||||||
|
DEF map_callback_{d:x} = 1
|
||||||
dbw \1, \2
|
dbw \1, \2
|
||||||
DEF {_NUM_CALLBACKS} += 1
|
DEF {_NUM_CALLBACKS} += 1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user