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

+4
View File
@@ -0,0 +1,4 @@
// Compute's Mapping the C64 p88
.word basic_cold_start
+3
View File
@@ -0,0 +1,3 @@
// Compute's Mapping the C64 p88
.word basic_warm_start
@@ -0,0 +1,36 @@
//
// Continuation of the BASIC cold start routine
//
basic_cold_start_internal:
// Setup vectors at $300
ldy #$0B
!:
lda basic_vector_defaults_1, y
sta IERROR, y
dey
bpl !-
// Setup misc vectors
ldy #$04
!:
lda basic_vector_defaults_2, y
sta ADRAY1, y
dey
bpl !-
// Setup USRPOK
lda #$4C // JMP opcode
sta USRPOK
lda #<do_ILLEGAL_QUANTITY_error
sta USRADD+0
lda #>do_ILLEGAL_QUANTITY_error
sta USRADD+1
// Print startup messages
jsr INITMSG
// jump into warm start loop
jmp basic_warm_start
+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'.
+11
View File
@@ -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
+3
View File
@@ -0,0 +1,3 @@
This routine is mentionned in the cartridge writing tutorial here: https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image
We have to implement (or at least provide stub), otherwise cartridges will crash.
+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
+81
View File
@@ -0,0 +1,81 @@
//
// Startup banner, to be displayed during cold start
//
.macro BANNER_TEXT() {
#if CONFIG_VARIANT_GENERIC
.text "OPEN ROMS GENERIC BUILD"
#elif CONFIG_VARIANT_MEGA_65
.text "OPEN ROMS FOR MEGA65"
#elif CONFIG_VARIANT_ULTIMATE_64
.text "OPEN ROMS FOR ULTIMATE 64"
#endif
}
startup_banner:
#if CONFIG_BANNER_SIMPLE
.text " "
BANNER_TEXT()
.byte $00
#elif CONFIG_BANNER_FANCY
BANNER_TEXT()
.byte $00
rainbow_logo:
.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
pre_revision_string:
.text "RELEASE "
.byte $00
#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
.byte $20, $1f, $20, $9a, $a9, $20, $20, $20, $92, $a1, $1f, $12, $20, $9a, $a9, $20
.byte $20, $20, $7f, $1f, $20, $20, $9a, $a3, $a3, $a3, $a3, $a3, $a3, $a3, $1f, $20
.byte $20, $20, $20, $05, $92, $4d, $45, $47, $41, $9a, $12, $20, $20, $20, $20, $20
.byte $20, $1f, $20, $9a, $20, $20, $92, $a2, $bb, $1f, $12, $20, $9a, $20, $20, $92
.byte $ac, $a2, $a2, $1f, $12, $20, $9a, $20, $20, $1f, $20, $9a, $20, $20, $1f, $20
.byte $20, $1e, $a3, $a3, $a3, $a3, $a3, $a3, $1f, $20, $20, $20, $20, $05, $92, $42
.byte $41, $53, $49, $43, $9a, $12, $20, $20, $92, $7f, $a9, $12, $20, $20, $1f, $20
.byte $9a, $20, $20, $a2, $92, $be, $1f, $12, $20, $9a, $20, $20, $92, $bc, $12, $20
.byte $20, $1f, $20, $9a, $20, $20, $20, $20, $20, $1f, $20, $20, $9e, $a3, $a3, $a3
.byte $a3, $a3, $1f, $20, $20, $20, $20, $05, $92, $2d, $2d, $2d, $2d, $2d, $2d, $9a
.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, $00
// Original Mega65 banner - supplied by Deft
// .byte $9A,$12,$A3,$A3,$A3,$A3,$A3,$A3,$DF,$9B,$92,$20,$05,$12,$A0,$A0
// .byte $DF,$9B,$92,$20,$05,$12,$A0,$A0,$DF,$9B,$92,$20,$05,$12,$A0,$A0
// .byte $DF,$9B,$92,$20,$05,$12,$A0,$A0,$DF,$9A,$92,$20,$05,$20,$20,$20
// .byte $4D,$20,$45,$20,$47,$20,$41,$0D,$99,$12,$A3,$A3,$A3,$A3,$A3,$A3
// .byte $A3,$DF,$92,$7F,$12,$CD,$CD,$DF,$92,$7F,$12,$DF,$05,$92,$20,$20
// .byte $99,$7F,$12,$DF,$05,$92,$20,$20,$99,$7F,$12,$DF,$92,$7F,$12,$DF
// .byte $05,$92,$20,$20,$99,$42,$20,$41,$20,$53,$20,$49,$20,$43,$0D,$9E
// .byte $12,$A3,$A3,$A3,$A3,$A3,$A3,$A3,$A3,$DF,$9B,$92,$7F,$12,$DF,$92
// .byte $7F,$12,$DF,$92,$7F,$12,$CD,$05,$92,$20,$20,$9B,$7F,$12,$CD,$92
// .byte $7F,$12,$DF,$92,$7F,$12,$CD,$92,$7F,$12,$DF,$9A,$92,$20,$05,$20
// .byte $9A,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$0D,$96,$12,$A3,$A3,$A3,$A3,$A3
// .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,$00
#endif