From 32b02147925566bac93bf71b002860335583574c Mon Sep 17 00:00:00 2001 From: ElectroDeoxys Date: Thu, 9 Sep 2021 08:51:12 +0100 Subject: Split home bank --- src/home/interrupt.asm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/home/interrupt.asm (limited to 'src/home/interrupt.asm') diff --git a/src/home/interrupt.asm b/src/home/interrupt.asm new file mode 100644 index 0000000..4b39271 --- /dev/null +++ b/src/home/interrupt.asm @@ -0,0 +1,37 @@ +; enable timer interrupt +EnableInt_Timer: ; 02dd (0:02dd) + ldh a, [rIE] + or 1 << INT_TIMER + ldh [rIE], a + ret + +; enable vblank interrupt +EnableInt_VBlank: ; 02e4 (0:02e4) + ldh a, [rIE] + or 1 << INT_VBLANK + ldh [rIE], a + ret + +; enable lcdc interrupt on hblank mode +EnableInt_HBlank: ; 02eb (0:02eb) + ldh a, [rSTAT] + or 1 << STAT_MODE_HBLANK + ldh [rSTAT], a + xor a + ldh [rIF], a + ldh a, [rIE] + or 1 << INT_LCD_STAT + ldh [rIE], a + ret + +; disable lcdc interrupt and the hblank mode trigger +DisableInt_HBlank: ; 02fb (0:02fb) + ldh a, [rSTAT] + and ~(1 << STAT_MODE_HBLANK) + ldh [rSTAT], a + xor a + ldh [rIF], a + ldh a, [rIE] + and ~(1 << INT_LCD_STAT) + ldh [rIE], a + ret -- cgit v1.2.3 From 0017fc2d171c87d7bab4c9be90e1069ae95a8071 Mon Sep 17 00:00:00 2001 From: ElectroDeoxys Date: Thu, 9 Sep 2021 08:54:29 +0100 Subject: Remove home bank address comments --- src/home/interrupt.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/home/interrupt.asm') diff --git a/src/home/interrupt.asm b/src/home/interrupt.asm index 4b39271..19709c6 100644 --- a/src/home/interrupt.asm +++ b/src/home/interrupt.asm @@ -1,19 +1,19 @@ ; enable timer interrupt -EnableInt_Timer: ; 02dd (0:02dd) +EnableInt_Timer: ldh a, [rIE] or 1 << INT_TIMER ldh [rIE], a ret ; enable vblank interrupt -EnableInt_VBlank: ; 02e4 (0:02e4) +EnableInt_VBlank: ldh a, [rIE] or 1 << INT_VBLANK ldh [rIE], a ret ; enable lcdc interrupt on hblank mode -EnableInt_HBlank: ; 02eb (0:02eb) +EnableInt_HBlank: ldh a, [rSTAT] or 1 << STAT_MODE_HBLANK ldh [rSTAT], a @@ -25,7 +25,7 @@ EnableInt_HBlank: ; 02eb (0:02eb) ret ; disable lcdc interrupt and the hblank mode trigger -DisableInt_HBlank: ; 02fb (0:02fb) +DisableInt_HBlank: ldh a, [rSTAT] and ~(1 << STAT_MODE_HBLANK) ldh [rSTAT], a -- cgit v1.2.3