aboutsummaryrefslogtreecommitdiff
path: root/src-z80/core/macro.z80
blob: eedd527b2cb84c5928dab85b30f1473a739b12d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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