mirror of
https://github.com/gbdk-2020/gbdk-2020.git
synced 2026-02-20 00:32:21 +01:00
GB: fix the crash_handler
This commit is contained in:
@@ -15,11 +15,15 @@
|
||||
#ifndef __CRASH_HANDLER_INCLUDE
|
||||
#define __CRASH_HANDLER_INCLUDE
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/** Display the crash dump screen.
|
||||
|
||||
See the intro for this file for more details.
|
||||
*/
|
||||
void __HandleCrash(void);
|
||||
static void * __CRASH_HANDLER_INIT = &__HandleCrash;
|
||||
#if defined(__SDCC)
|
||||
static void __CRASH_HANDLER_INIT__(void) __naked { __asm__(".globl ___HandleCrash"); }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -48,9 +48,9 @@ ___HandleCrash::
|
||||
ld a, #LCDCF_ON ; LCDCF_ON Make sure the LCD is turned on to avoid waiting infinitely
|
||||
ldh (.LCDC), a
|
||||
ld a, #IEF_VBLANK ; IEF_VBLANK
|
||||
ld (.IE), a
|
||||
ldh (.IE), a
|
||||
ld a, #0 ; `xor a` would overwrite flags
|
||||
ld (.IF), a ; No point in backing up that register, it's always changing
|
||||
ldh (.IF), a ; No point in backing up that register, it's always changing
|
||||
halt ; With interrupts disabled, this will exit when `IE & IF != 0`
|
||||
nop ; Handle hardware bug if it becomes true *before* starting to execute the instruction (1-cycle window)
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ ___HandleCrash::
|
||||
ld a, #LCDCF_ON ; LCDCF_ON Make sure the LCD is turned on to avoid waiting infinitely
|
||||
ldh (.LCDC), a
|
||||
ld a, #IEF_VBLANK ; IEF_VBLANK
|
||||
ld (.IE), a
|
||||
ldh (.IE), a
|
||||
ld a, #0 ; `xor a` would overwrite flags
|
||||
ld (.IF), a ; No point in backing up that register, it's always changing
|
||||
ldh (.IF), a ; No point in backing up that register, it's always changing
|
||||
halt ; With interrupts disabled, this will exit when `IE & IF != 0`
|
||||
nop ; Handle hardware bug if it becomes true *before* starting to execute the instruction (1-cycle window)
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ ___HandleCrash::
|
||||
ld a, #LCDCF_ON ; LCDCF_ON Make sure the LCD is turned on to avoid waiting infinitely
|
||||
ldh (.LCDC), a
|
||||
ld a, #IEF_VBLANK ; IEF_VBLANK
|
||||
ld (.IE), a
|
||||
ldh (.IE), a
|
||||
ld a, #0 ; `xor a` would overwrite flags
|
||||
ld (.IF), a ; No point in backing up that register, it's always changing
|
||||
ldh (.IF), a ; No point in backing up that register, it's always changing
|
||||
halt ; With interrupts disabled, this will exit when `IE & IF != 0`
|
||||
nop ; Handle hardware bug if it becomes true *before* starting to execute the instruction (1-cycle window)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user