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

+7 -3
View File
@@ -4,17 +4,21 @@
#import "KERNAL_combined.sym"
.label panic_vector = KERNAL.panic_vector
.label rom_revision_kernal = KERNAL.rom_revision_kernal
#if CONFIG_PANIC_SCREEN
.label panic = KERNAL.panic
#endif
.label hw_entry_reset = KERNAL.hw_entry_reset
#if CONFIG_DBG_PRINTF
.label printf = KERNAL.printf
#endif
.label plot_set = KERNAL.plot_set
.label print_hex_byte = KERNAL.print_hex_byte
.label print_return = KERNAL.print_return
.label print_space = KERNAL.print_space
#if CONFIG_BANNER_PAL_NTSC
#if CONFIG_SHOW_PAL_NTSC
.label print_pal_ntsc = KERNAL.print_pal_ntsc
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,17 +1,9 @@
// BASIC Cold start entry point
// Compute's Mapping the 64 p211
basic_cold_start:
//
// Continuation of the BASIC cold start routine
//
// Before doing anything, check if we have a compatible Kernal
ldy #(__rom_revision_basic_end - rom_revision_basic - 1)
!:
lda rom_revision_basic, y
cmp rom_revision_kernal, y
bne basic_cold_start_rom_mismatch
dey
bpl !-
basic_cold_start_internal:
// Setup vectors at $300
ldy #$0B
@@ -42,7 +34,3 @@ basic_cold_start:
// jump into warm start loop
jmp basic_warm_start
basic_cold_start_rom_mismatch:
panic #$01
+22
View File
@@ -0,0 +1,22 @@
// BASIC Cold start entry point
// Compute's Mapping the 64 p211
basic_cold_start:
// Before doing anything, check if we have a compatible BASIC/KERNAL pair
ldy #(__rom_revision_basic_end - rom_revision_basic - 1)
!:
lda rom_revision_basic, y
cmp rom_revision_kernal, y
beq !+
panic #P_ERR_ROM_MISMATCH
!:
dey
bpl !--
// Remaining part wouldn't fit here
jmp basic_cold_start_internal
+8
View File
@@ -0,0 +1,8 @@
The address of the BASIC cold start routine (see Compute's Mapping the Commodore 64, page 211) is well known, see for example here:
- https://www.lemon64.com/forum/viewtopic.php?t=70680&sid=3ff66caf7f5fdf2a3c2ff2ee31fc3fd8
Fixing this routine also has a great advantage for us - since it's address lies in the uppeer ROM region, it's easier to bailout
when someone tries to use our 'kernal.rom' with the original 'basic.rom'.
File renamed without changes.
File renamed without changes.
+21
View File
@@ -0,0 +1,21 @@
//
// Print out the amount of free bytes - for the startup banner
//
initmsg_bytes_free:
jsr basic_do_new
sec
lda MEMSIZ+0
sbc TXTTAB+0
tax
lda MEMSIZ+1
sbc TXTTAB+1
jsr print_integer
// Print rest of the start up message
ldx #34
jmp print_packed_message
+95
View File
@@ -0,0 +1,95 @@
// Routine is too long to fit in the original location
initmsg_real:
#if CONFIG_BANNER_SIMPLE
lda #<startup_banner
ldy #>startup_banner
jsr STROUT
ldx #$02
ldy #$02
jsr plot_set
lda #<rom_revision_basic_string
ldy #>rom_revision_basic_string
jsr STROUT
ldx #$04
ldy #$02
jsr plot_set
#if CONFIG_SHOW_PAL_NTSC
jsr print_pal_ntsc
#endif
jsr initmsg_bytes_free
ldx #$07
ldy #$00
jmp plot_set
#elif CONFIG_BANNER_FANCY
lda #<rainbow_logo
ldy #>rainbow_logo
jsr STROUT
ldx #$01
ldy #$0A
jsr plot_set
lda #<startup_banner
ldy #>startup_banner
jsr STROUT
ldx #$03
ldy #$0A
jsr plot_set
lda #<pre_revision_string
ldy #>pre_revision_string
jsr STROUT
lda #<rom_revision_basic_string
ldy #>rom_revision_basic_string
jsr STROUT
ldx #$05
ldy #$00
jsr plot_set
#if CONFIG_SHOW_PAL_NTSC
jsr print_pal_ntsc
#endif
jsr initmsg_bytes_free
ldx #$07
ldy #$00
jmp plot_set
#elif CONFIG_BANNER_VARIANT && CONFIG_VARIANT_MEGA_65
lda #<startup_banner
ldy #>startup_banner
jsr STROUT
lda #<rom_revision_basic_string
ldy #>rom_revision_basic_string
jsr STROUT
ldx #$03
ldy #$12
jsr plot_set
jsr initmsg_bytes_free
ldx #$05
ldy #$00
jmp plot_set
#endif
@@ -16,39 +16,33 @@
}
startup_banner:
#if !CONFIG_BANNER_FANCY
// Simple banner
#if CONFIG_BANNER_SIMPLE
.text " "
BANNER_TEXT()
.byte $0D, $0D
.text " "
.byte $00
#endif
#elif CONFIG_BANNER_FANCY
BANNER_TEXT()
.byte $00
#if CONFIG_BANNER_FANCY && !CONFIG_VARIANT_MEGA_65
rainbow_logo:
// Fancy banner
.byte $1C, $12, $A4, $A4, $A4, $A4, $A4, $A4, $A4, $0D
.byte $9E, $12, $A4, $A4, $A4, $A4, $A4, $A4, $0D
.byte $1E, $12, $A4, $A4, $A4, $A4, $A4, $0D
.byte $9F, $12, $A4, $A4, $A4, $A4, $92
.byte $05, $00
.byte $1C, $12, $A4, $A4, $A4, $A4, $A4, $A4, $A4, $92, $0D
.byte $9E, $12, $A4, $A4, $A4, $A4, $A4, $A4, $92, $05, $20
.text " "
BANNER_TEXT()
.byte $0D
.byte $1E, $12, $A4, $A4, $A4, $A4, $A4, $92, $0D
.byte $9F, $12, $A4, $A4, $A4, $A4, $92, $20, $05, $20, $20
.text " "
pre_revision_string:
#endif
.text "RELEASE "
.byte $00
#if CONFIG_BANNER_FANCY && CONFIG_VARIANT_MEGA_65
#elif CONFIG_BANNER_VARIANT && CONFIG_VARIANT_MEGA_65
// Fancy Mega65 banner - from Retrofan
.byte $9a, $12, $20, $20, $7f, $a9, $20, $20, $1f, $20, $9a, $20, $20, $20
@@ -65,7 +59,7 @@ startup_banner:
.byte $12, $20, $20, $1f, $20, $20, $9a, $20, $20, $1f, $20, $9a, $20, $20, $20, $20
.byte $1f, $20, $9a, $20, $20, $20, $20, $20, $1f, $20, $9a, $20, $20, $1f, $20, $9a
.byte $20, $20, $1f, $20, $20, $96, $a3, $a3, $a3, $a3, $1f
.byte $92, $0D, $0D, $05
.byte $92, $0D, $0D, $05, $00
// Original Mega65 banner - supplied by Deft
// .byte $9A,$12,$A3,$A3,$A3,$A3,$A3,$A3,$DF,$9B,$92,$20,$05,$12,$A0,$A0
@@ -82,10 +76,6 @@ startup_banner:
// .byte $A3,$A3,$A3,$A3,$DF,$9A,$92,$7F,$12,$DF,$92,$7F,$9B,$20,$9A,$7F
// .byte $12,$A0,$A0,$9B,$92,$20,$9A,$7F,$12,$A0,$A0,$9B,$92,$20,$9A,$7F
// .byte $12,$DF,$92,$7F,$9B,$20,$9A,$20,$9B,"0.2.0.0",$0D
// .byte $0D,$05,$92
// .byte $0D,$05,$92,$00
#endif
.byte $00 // end of banner
-48
View File
@@ -1,48 +0,0 @@
// Routine is too long to fit in the original location
initmsg_real:
// Print startup banner, up to 255 characters
ldx #$00
!:
lda startup_banner, x
beq !+ // 0 means end of banner
jsr JCHROUT
inx
bne !-
!:
// Print ROM revision
lda #<rom_revision_basic_string
ldy #>rom_revision_basic_string
jsr STROUT
// Print PAL/NTSC, if configured
#if CONFIG_BANNER_PAL_NTSC
jsr print_pal_ntsc
#endif
jsr initmsg_double_return
jsr print_return
// Work out free bytes, display them
jsr basic_do_new
sec
lda MEMSIZ+0
sbc TXTTAB+0
tax
lda MEMSIZ+1
sbc TXTTAB+1
jsr print_integer
// Print rest of the start up message
ldx #34
jsr print_packed_message
initmsg_double_return:
jsr print_return
jmp print_return
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -14,12 +14,12 @@ rom_revision_basic:
// $BF52
.text "OR" // Magic string, after "Open ROMs"
.byte CONFIG_ID // Config file ID, might change between revisions
.text "OR" // project signature, after "Open ROMs"
.byte CONFIG_ID // config file ID, might change between revisions
rom_revision_basic_string:
.text "DEVEL SNAPSHOT" // Actual ROM revision string
.byte $00
.text "(DEVEL SNAPSHOT)" // actual ROM revision string; up to 16 characters
.byte $00 // marks the end of string
__rom_revision_basic_end:
+2
View File
@@ -0,0 +1,2 @@
Special case - we need a constant memory location where we can put an ID and a revision string. According to Compute's Mapping the Commodore 64 (page 213) this area is unused - so a perfect place.
@@ -0,0 +1,39 @@
//
// !!! PROPOSAL ONLY !!! PROPOSAL ONLY !!! NOT FOR USING EXTERNALLY YET !!!
//
//
// Do not change! Locations of the following data should be constant - now and forever!
//
// If you want to integrate Open ROMs support in your emulator, FPGA ccomputer, etc. - this
// is the official way to recognize the ROM and it's revision.
//
// $E4B7
// This vector is to be used by non-Kernal ROMs, if they want to
// complain about incompatible ROM releases - don't use it directly,
// use a 'panic' pseudocommand with error code (will be passed using .A)
// #P_ERR_ROM_MISMATCH - it should remain stable even between releases
#if CONFIG_PANIC_SCREEN
.word panic
#else
.word hw_entry_reset
#endif
rom_revision_kernal:
// $E4B9
.text "OR" // project signature, after "Open ROMs"
.byte CONFIG_ID // config file ID, might change between revisions
rom_revision_kernal_string:
.text "(DEVEL SNAPSHOT)" // actual ROM revision string; up to 16 characters
.byte $00 // marks the end of string
__rom_revision_kernal_end: