rgbds-style inline macro definitions #64

Open
opened 2013-12-31 06:20:11 +00:00 by yenatch · 0 comments
yenatch commented 2013-12-31 06:20:11 +00:00 (Migrated from github.com)

Currently, adding and using a new macro in kanzure/pokecrystal requires the user to add a class to pokemontools/crystal.py.

Sometimes using a macro is the easiest way to arrange arbitrary data structures. For that purpose the macro does not need to be persistent and is best defined inline. bentley/rgbds already lets you do this, like so:

move: MACRO
        db \1 ; animation
        db \2 ; effect
        db \3 ; power
        db \4 ; type
        db \5 * $ff / 100 ; accuracy (percent)
        db \6 ; pp
        db \7 * $ff / 100  ; effect chance (percent)
ENDM
        move POUND, EFFECT_NORMAL_HIT, 40, NORMAL, 100, 35, 0

Apparently depending on rgbds is undesirable, and depending on pokemontools is not. In that case, this should be implemented in pokemontools.

Currently, adding and using a new macro in [kanzure/pokecrystal](https://github.com/kanzure/pokecrystal) requires the user to add a class to [pokemontools/crystal.py](pokemontools/crystal.py). Sometimes using a macro is the easiest way to arrange arbitrary data structures. For that purpose the macro does not need to be persistent and is best defined inline. [bentley/rgbds](https://github.com/bentley/rgbds) already lets you do this, like so: ``` asm move: MACRO db \1 ; animation db \2 ; effect db \3 ; power db \4 ; type db \5 * $ff / 100 ; accuracy (percent) db \6 ; pp db \7 * $ff / 100 ; effect chance (percent) ENDM ``` ``` asm move POUND, EFFECT_NORMAL_HIT, 40, NORMAL, 100, 35, 0 ``` Apparently depending on rgbds is undesirable, and depending on pokemontools is not. In that case, this should be implemented in pokemontools.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
decomp/pokemon-reverse-engineering-tools#64
No description provided.