mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
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:
parent
61521f4458
commit
0d682e076a
@ -13,6 +13,8 @@ page EQUS "db $50," ; Start a new Pokedex page.
|
|||||||
dex EQUS "db $e8, $50" ; End a Pokedex entry.
|
dex EQUS "db $e8, $50" ; End a Pokedex entry.
|
||||||
|
|
||||||
|
|
||||||
|
percent EQUS "* $ff / 100"
|
||||||
|
|
||||||
; macros require rst vectors to be defined
|
; macros require rst vectors to be defined
|
||||||
FarCall EQU $08
|
FarCall EQU $08
|
||||||
Bankswitch EQU $10
|
Bankswitch EQU $10
|
||||||
@ -118,15 +120,15 @@ B_ EQU 12
|
|||||||
|
|
||||||
|
|
||||||
bccoord: MACRO
|
bccoord: MACRO
|
||||||
ld bc, TileMap + SCREEN_WIDTH * \2 + \1
|
ld bc, TileMap + SCREEN_WIDTH * (\2) + (\1)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
decoord: MACRO
|
decoord: MACRO
|
||||||
ld de, TileMap + SCREEN_WIDTH * \2 + \1
|
ld de, TileMap + SCREEN_WIDTH * (\2) + (\1)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
hlcoord: MACRO
|
hlcoord: MACRO
|
||||||
ld hl, TileMap + SCREEN_WIDTH * \2 + \1
|
ld hl, TileMap + SCREEN_WIDTH * (\2) + (\1)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user