aboutsummaryrefslogtreecommitdiff
path: root/src-z80/core/macro.z80
diff options
context:
space:
mode:
Diffstat (limited to 'src-z80/core/macro.z80')
-rw-r--r--src-z80/core/macro.z8041
1 files changed, 41 insertions, 0 deletions
diff --git a/src-z80/core/macro.z80 b/src-z80/core/macro.z80
new file mode 100644
index 0000000..eedd527
--- /dev/null
+++ b/src-z80/core/macro.z80
@@ -0,0 +1,41 @@
+;****************************************************************************
+; PollPCM
+; Used to update PCM while not idle
+;----------------------------------------------------------------------------
+; breaks: af
+;****************************************************************************
+
+PollPCM: macro
+ ld a, ($4000)
+ rrca
+ rst $08
+ endm
+
+;****************************************************************************
+; BankSwitch
+; Switches into a new bank (won't update player status!)
+;----------------------------------------------------------------------------
+; input A .... New bank to switch into
+; input HL ... Must be $60xx
+;----------------------------------------------------------------------------
+; breaks ..... AF
+;****************************************************************************
+
+BankSwitch: macro
+ ld (hl), a
+ rrca
+ ld (hl), a
+ rrca
+ ld (hl), a
+ rrca
+ ld (hl), a
+ rrca
+ ld (hl), a
+ rrca
+ ld (hl), a
+ rrca
+ ld (hl), a
+ ld (hl), h
+ rrca
+ ld (hl), a
+ endm