diff options
Diffstat (limited to 'utils.gbasm')
-rw-r--r-- | utils.gbasm | 25 |
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 |