added panic screen, added versioning mechanism proposal

This commit is contained in:
FeralChild64 committed 2019-10-13 11:29:02 +02:00
1 parent 890558213a
commit 5a231c1847
40 files changed
+363 -182

No files matched your search

+21 -5
View File
@@ -3,19 +3,29 @@
// Something terrible happened - show the panic screen
//
// .A = 0 - just panic, no extra message
// .A = 1 - ROM version mismatch
#if CONFIG_PANIC_SCREEN
panic:
// Disable interrupts, store error code on stack
sei
pha
// Reinitialize the hardware
jsr IOINIT
jsr setup_vicii
jsr clear_screen
// XXX disable NMIs
// Disable NMIs - our routine checks for NULL vector
lda #$00
sta NMINV+0
sta NMINV+1
// Display KERNAL PANIC message
ldx #$14
ldy #$0E
@@ -24,6 +34,8 @@ panic:
ldx #__MSG_KERNAL_PANIC
jsr print_kernal_message
// Display error code and message (if known)
pla
beq kernal_panic_infinite_loop
pha
@@ -37,12 +49,14 @@ panic:
jsr print_hex_byte
pla
cmp #$01
cmp #P_ERR_ROM_MISMATCH
bne kernal_panic_infinite_loop
ldx #__MSG_KERNAL_PANIC_VERSION
ldx #__MSG_KERNAL_PANIC_ROM_MISMATCH
jsr print_kernal_message
// Display some raster effect in the infinitew loop
kernal_panic_infinite_loop:
ldx #$00
stx VIC_EXTCOL
@@ -59,3 +73,5 @@ kernal_panic_infinite_loop:
bne !-
beq kernal_panic_infinite_loop // branch always
#endif // CONFIG_PANIC_SCREEN