initial concept of ROM versioning, still needs quite some work
This commit is contained in:
1 parent
5b69467dc1
commit
890558213a
20 files changed
+191
-11
No files matched your search
@@ -4,6 +4,9 @@
|
||||
#import "KERNAL_combined.sym"
|
||||
|
||||
|
||||
.label panic_vector = KERNAL.panic_vector
|
||||
.label rom_revision_kernal = KERNAL.rom_revision_kernal
|
||||
|
||||
#if CONFIG_DBG_PRINTF
|
||||
.label printf = KERNAL.printf
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
|
||||
basic_cold_start:
|
||||
|
||||
// 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 !-
|
||||
|
||||
// Setup vectors at $300
|
||||
ldy #$0B
|
||||
!:
|
||||
@@ -32,3 +42,7 @@ basic_cold_start:
|
||||
|
||||
// jump into warm start loop
|
||||
jmp basic_warm_start
|
||||
|
||||
basic_cold_start_rom_mismatch:
|
||||
|
||||
panic #$01
|
||||
@@ -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 117) this area is unused - so a perfect place.
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
//
|
||||
// !!! 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.
|
||||
//
|
||||
|
||||
|
||||
rom_revision_basic:
|
||||
|
||||
// $BF52
|
||||
|
||||
.text "OR" // Magic string, 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
|
||||
|
||||
__rom_revision_basic_end:
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
//
|
||||
// Well-known BASIC routine, described in:
|
||||
//
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 212
|
||||
//
|
||||
// Prints the start-up messages
|
||||
//
|
||||
|
||||
INITMSG:
|
||||
jmp initmsg_real
|
||||
@@ -1,13 +1,8 @@
|
||||
|
||||
//
|
||||
// Well-known BASIC routine, described in:
|
||||
//
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 212
|
||||
//
|
||||
// Prints the start-up messages
|
||||
//
|
||||
// Routine is too long to fit in the original location
|
||||
|
||||
INITMSG:
|
||||
|
||||
initmsg_real:
|
||||
|
||||
// Print startup banner, up to 255 characters
|
||||
ldx #$00
|
||||
@@ -19,6 +14,10 @@ INITMSG:
|
||||
bne !-
|
||||
|
||||
!:
|
||||
// Print ROM revision
|
||||
lda #<rom_revision_basic_string
|
||||
ldy #>rom_revision_basic_string
|
||||
jsr STROUT
|
||||
|
||||
// Print PAL/NTSC, if configured
|
||||
|
||||
@@ -26,6 +25,9 @@ INITMSG:
|
||||
jsr print_pal_ntsc
|
||||
#endif
|
||||
|
||||
jsr initmsg_double_return
|
||||
jsr print_return
|
||||
|
||||
// Work out free bytes, display them
|
||||
jsr basic_do_new
|
||||
sec
|
||||
@@ -41,6 +43,6 @@ INITMSG:
|
||||
ldx #34
|
||||
jsr print_packed_message
|
||||
|
||||
// XXX put them into packed message
|
||||
initmsg_double_return:
|
||||
jsr print_return
|
||||
jmp print_return
|
||||
Reference in new issue
Block a user