|
|
@ -1,8 +1,14 @@ |
|
|
|
DEF ITEM_ATTRF_NONE EQU 0 |
|
|
|
DEF ITEM_ATTRF_USABLE EQU (1 << 0) |
|
|
|
DEF ITEM_ATTRF_WEAPON EQU (1 << 1) |
|
|
|
DEF ITEM_ATTRF_ARMOR EQU (1 << 2) |
|
|
|
|
|
|
|
DEF NEXT_ITEM_ID SET 1 |
|
|
|
|
|
|
|
; Declare a new item |
|
|
|
; \1 Display name |
|
|
|
; \2 Sprite data filename |
|
|
|
; \2 Attributes |
|
|
|
; \3 Sprite data filename |
|
|
|
MACRO Item |
|
|
|
ASSERT STRLEN("\1") < 16 |
|
|
|
|
|
|
@ -12,6 +18,8 @@ MACRO Item |
|
|
|
EXPORT {ID_NAME} |
|
|
|
REDEF NEXT_ITEM_ID SET NEXT_ITEM_ID + 1 |
|
|
|
|
|
|
|
DB \2 |
|
|
|
|
|
|
|
; Display name |
|
|
|
DB "\1" |
|
|
|
REPT 16 - STRLEN("\1") |
|
|
@ -19,11 +27,11 @@ MACRO Item |
|
|
|
ENDR |
|
|
|
|
|
|
|
; Sprite data |
|
|
|
INCBIN \2 |
|
|
|
INCBIN \3 |
|
|
|
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" |
|
|
|
Item COIN, ITEM_ATTRF_NONE, "png/sprite/item/coin.2bpp" |