Fix argument handling in *coord macros. Add a "percent" shortcut.

Random returns a value from 0 to 0xff.
Instead of doing extra work, most probabilities are out of 0xff.
Convert these from percentages at build time for readability.
This commit is contained in:
yenatch 2014-06-10 23:03:21 -07:00
parent 61521f4458
commit 0d682e076a

View File

@ -13,6 +13,8 @@ page EQUS "db $50," ; Start a new Pokedex page.
dex EQUS "db $e8, $50" ; End a Pokedex entry.
percent EQUS "* $ff / 100"
; macros require rst vectors to be defined
FarCall EQU $08
Bankswitch EQU $10
@ -118,15 +120,15 @@ B_ EQU 12
bccoord: MACRO
ld bc, TileMap + SCREEN_WIDTH * \2 + \1
ld bc, TileMap + SCREEN_WIDTH * (\2) + (\1)
ENDM
decoord: MACRO
ld de, TileMap + SCREEN_WIDTH * \2 + \1
ld de, TileMap + SCREEN_WIDTH * (\2) + (\1)
ENDM
hlcoord: MACRO
ld hl, TileMap + SCREEN_WIDTH * \2 + \1
ld hl, TileMap + SCREEN_WIDTH * (\2) + (\1)
ENDM