fox32rom: Add panic routine

This commit is contained in:
Ry 2022-03-18 21:59:51 -07:00
parent 7e239d18e2
commit 0d990b375c
3 changed files with 21 additions and 0 deletions

View File

@ -7,6 +7,7 @@ get_mouse_position: jmp [0xF0040008]
new_event: jmp [0xF004000C] new_event: jmp [0xF004000C]
wait_for_event: jmp [0xF0040010] wait_for_event: jmp [0xF0040010]
get_next_event: jmp [0xF0040014] get_next_event: jmp [0xF0040014]
panic: jmp [0xF0040018]
; generic drawing jump table ; generic drawing jump table
draw_str_generic: jmp [0xF0041000] draw_str_generic: jmp [0xF0041000]

View File

@ -154,6 +154,7 @@ get_rom_version:
#include "menu_bar.asm" #include "menu_bar.asm"
#include "mouse.asm" #include "mouse.asm"
#include "overlay.asm" #include "overlay.asm"
#include "panic.asm"
#include "vsync.asm" #include "vsync.asm"
@ -170,6 +171,7 @@ get_rom_version:
data.32 new_event data.32 new_event
data.32 wait_for_event data.32 wait_for_event
data.32 get_next_event data.32 get_next_event
data.32 panic
; generic drawing jump table ; generic drawing jump table
org.pad 0xF0041000 org.pad 0xF0041000

18
panic.asm Normal file
View File

@ -0,0 +1,18 @@
; panic routines
; panic and hang
; inputs:
; r0: pointer to null-terminated string, or zero for none
; outputs:
; none, does not return
panic:
icl
brk
cmp r0, 0
ifnz mov r0, panic_string
call debug_print
panic_loop:
jmp panic_loop
halt
panic_string: data.str "Panic occurred!" data.8 10 data.8 0