gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-lib/libc/targets/z80/set_interrupts.s
1 .include "global.s"
2
3 .title "Set interrupts"
4 .module SetInterrupts
5
6 .globl _shadow_VDP_R0
7 .globl _shadow_VDP_R1
8
9 .area _HOME
10
11 _set_interrupts::
12 di
13
14 ld a, (_shadow_VDP_R1)
15 bit 0, l
16 jr z, 1$
17 or #.R1_IE
18 jr 2$
19 1$:
20 and #~.R1_IE
21 2$:
22 ld (_shadow_VDP_R1), a
23 out (.VDP_CMD), a
24 ld a, #.VDP_R1
25 out (.VDP_CMD), a
26
27 ld a, (_shadow_VDP_R0)
28 bit 1, l
29 jr z, 3$
30 or #.R0_IE1
31 jr 4$
32 3$:
33 and #~.R0_IE1
34 4$:
35 ld (_shadow_VDP_R0), a
36 out (.VDP_CMD), a
37 ld a, #.VDP_R0
38 out (.VDP_CMD), a
39
40 ei
41 ret
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.