|
@ -0,0 +1,29 @@ |
|
|
|
|
|
DEF NEXT_ITEM_ID SET 1 |
|
|
|
|
|
|
|
|
|
|
|
; Declare a new item |
|
|
|
|
|
; \1 Display name |
|
|
|
|
|
; \2 Sprite data filename |
|
|
|
|
|
MACRO Item |
|
|
|
|
|
ASSERT STRLEN("\1") < 16 |
|
|
|
|
|
|
|
|
|
|
|
; Define item ID symbol |
|
|
|
|
|
DEF ID_NAME EQUS "\1_ID" |
|
|
|
|
|
DEF {ID_NAME} EQU NEXT_ITEM_ID |
|
|
|
|
|
EXPORT {ID_NAME} |
|
|
|
|
|
REDEF NEXT_ITEM_ID SET NEXT_ITEM_ID + 1 |
|
|
|
|
|
|
|
|
|
|
|
; Display name |
|
|
|
|
|
DB "\1" |
|
|
|
|
|
REPT 16 - STRLEN("\1") |
|
|
|
|
|
DB 0 |
|
|
|
|
|
ENDR |
|
|
|
|
|
|
|
|
|
|
|
; Sprite data |
|
|
|
|
|
INCBIN \2 |
|
|
|
|
|
ENDM |
|
|
|
|
|
|
|
|
|
|
|
SECTION "Item Data", ROM0 |
|
|
|
|
|
|
|
|
|
|
|
; NOTE: Macro invocation MUST be indented in order to be expanded correctly |
|
|
|
|
|
Items:: |
|
|
|
|
|
Item COIN, "png/sprite/item/coin.2bpp" |