summaryrefslogtreecommitdiff
path: root/macros/code.asm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/code.asm')
-rw-r--r--macros/code.asm9
1 files changed, 4 insertions, 5 deletions
diff --git a/macros/code.asm b/macros/code.asm
index 5ec214d50..6e9c378e3 100644
--- a/macros/code.asm
+++ b/macros/code.asm
@@ -35,19 +35,18 @@ jumptable: MACRO
jp hl
ENDM
-; Many mobile functions were dummied out in localization.
-mobile EQUS "ret"
-
maskbits: MACRO
+; masks just enough bits to cover the argument
+; e.g. "maskbits %00010100" becomes "and %00011111"
; example usage in rejection sampling:
; .loop
; call Random
-; maskbits 30
+; maskbits 30 +- 1
; cp 30
; jr nc, .loop
x = 1
rept 8
-if \1 > x
+if x < (\1)
x = (x + 1) * 2 +- 1
endc
endr