aboutsummaryrefslogtreecommitdiff
path: root/utils.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-04-11 11:41:48 +0200
committerAstatin <[email protected]>2025-04-11 11:41:48 +0200
commit690ff7c09726d9e760b52b717c70e9567531175c (patch)
tree4e951d5ca5914b998dbb066aee11b03955e7281b /utils.gbasm
parent5eb4fc176cae7907a90789051e1e3a9d1fc10f37 (diff)
Add per entity spawning rate
Diffstat (limited to 'utils.gbasm')
-rw-r--r--utils.gbasm25
1 files changed, 25 insertions, 0 deletions
diff --git a/utils.gbasm b/utils.gbasm
index ba808bd..38ae74a 100644
--- a/utils.gbasm
+++ b/utils.gbasm
@@ -298,6 +298,31 @@ MUL: ; B x C => EA
.bit0:
RET
+RRx: ; B is the number to rotate, A & 7 is how many bits to rotate it
+ AND $07
+
+ CP $04
+ CALL NC, =.swap
+ CP $00
+ RET Z
+
+ RRC B
+ DEC A
+ RET Z
+
+ RRC B
+ DEC A
+ RET Z
+
+ RRC B
+ DEC A
+ RET
+
+ .swap:
+ SWAP B
+ SUB $04
+ RET
+
VBlank_Wait:
PUSH AF
LD A, $reg_lcd_controller