summaryrefslogtreecommitdiff
path: root/macros.asm
diff options
context:
space:
mode:
authorpikalaxalt <PikalaxALT@gmail.com>2016-05-15 21:50:31 -0400
committerpikalaxalt <PikalaxALT@gmail.com>2016-05-15 22:00:17 -0400
commit87b733994bdcb85e544f99899e50193c407909c6 (patch)
tree11007cad7c5405c26c34488899c1deabd3f7cad0 /macros.asm
parenta5f5418faeb2ded9ddd898851ea0716e2d6ecf09 (diff)
SPRITE_ANIM_FRAME_IDX constants
Diffstat (limited to 'macros.asm')
-rw-r--r--macros.asm19
1 files changed, 19 insertions, 0 deletions
diff --git a/macros.asm b/macros.asm
index 6656ca038..4d67d5f5c 100644
--- a/macros.asm
+++ b/macros.asm
@@ -270,3 +270,22 @@ jumptable: MACRO
ld l, a
jp [hl]
endm
+
+maskbits: macro
+; returns to x
+; usage in rejection sampling
+; .loop
+; call Random
+; maskbits 30
+; and x
+; cp 30
+; jr nc, .loop
+
+x = 1
+rept 8
+IF \1 > x
+x = (x + 1) * 2 +- 1
+ENDC
+endr
+endm
+