switching from MEGA65 native mode to legacy mode works now
This commit is contained in:
1 parent
0ed000de30
commit
64ae9ad75b
7 files changed
+74
-41
No files matched your search
@@ -36,6 +36,8 @@
|
|||||||
.label setup_irq_timer = KERNAL_0.setup_irq_timer
|
.label setup_irq_timer = KERNAL_0.setup_irq_timer
|
||||||
.label wait_x_bars = KERNAL_0.wait_x_bars
|
.label wait_x_bars = KERNAL_0.wait_x_bars
|
||||||
.label viciv_unhide = KERNAL_0.viciv_unhide
|
.label viciv_unhide = KERNAL_0.viciv_unhide
|
||||||
|
.label viciv_init = KERNAL_0.viciv_init
|
||||||
|
.label viciv_shutdown = KERNAL_0.viciv_shutdown
|
||||||
|
|
||||||
.label m65_scrtab_txtwidth = KERNAL_0.m65_scrtab_txtwidth
|
.label m65_scrtab_txtwidth = KERNAL_0.m65_scrtab_txtwidth
|
||||||
.label m65_scrtab_txtheight = KERNAL_0.m65_scrtab_txtheight
|
.label m65_scrtab_txtheight = KERNAL_0.m65_scrtab_txtheight
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// #LAYOUT# M65 KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
//
|
||||||
|
// Routine to initialize VIC-IV for entering MEGA65 native mode
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
viciv_init:
|
||||||
|
|
||||||
|
// Switch VIC to VIC-IV mode
|
||||||
|
|
||||||
|
jsr viciv_unhide
|
||||||
|
|
||||||
|
// Disable badlines and slow interrupt emulation
|
||||||
|
|
||||||
|
lda #$00
|
||||||
|
sta MISC_EMU
|
||||||
|
|
||||||
|
// Set misc VIC-IV flags
|
||||||
|
|
||||||
|
lda #%01000000 // enable C65 character set
|
||||||
|
sta VIC_CTRLA
|
||||||
|
|
||||||
|
// XXX enable 48 MHz mode in VIC_CTRLC
|
||||||
|
|
||||||
|
rts
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
// #LAYOUT# M65 KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
//
|
||||||
|
// Routine to shutdown VIC-IV for leaving MEGA65 native mode
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
viciv_shutdown:
|
||||||
|
|
||||||
|
// Switch VIC to VIC-IV mode, temporarily
|
||||||
|
|
||||||
|
jsr viciv_unhide
|
||||||
|
|
||||||
|
// Reenable badlines and slow interrupt emulation
|
||||||
|
|
||||||
|
lda #$03
|
||||||
|
sta MISC_EMU
|
||||||
|
|
||||||
|
// Set misc VIC-IV flags
|
||||||
|
|
||||||
|
lda #%00000000
|
||||||
|
sta VIC_CTRLA // enable C64 character set
|
||||||
|
sta VIC_CTRLB // disable extended resolution and attributes
|
||||||
|
|
||||||
|
// Hide VIC-IV registers and quit
|
||||||
|
|
||||||
|
sta VIC_KEY
|
||||||
|
rts
|
||||||
@@ -1,15 +1,11 @@
|
|||||||
// #LAYOUT# STD * #TAKE
|
// #LAYOUT# M65 KERNAL_0 #TAKE
|
||||||
// #LAYOUT# X16 * #IGNORE
|
|
||||||
// #LAYOUT# * KERNAL_0 #TAKE
|
|
||||||
// #LAYOUT# * * #IGNORE
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
//
|
//
|
||||||
// Routine to unhide Mega65 extra registers
|
// Routine to unhide MEGA65 extra registers
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#if ROM_LAYOUT_M65
|
|
||||||
|
|
||||||
viciv_unhide:
|
viciv_unhide:
|
||||||
|
|
||||||
lda #$47
|
lda #$47
|
||||||
@@ -18,5 +14,3 @@ viciv_unhide:
|
|||||||
sta VIC_KEY
|
sta VIC_KEY
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -8,8 +8,6 @@ M65_MODE64:
|
|||||||
|
|
||||||
sei
|
sei
|
||||||
|
|
||||||
// XXX provide full implementation - switch back to normal text mode
|
|
||||||
|
|
||||||
// Set the magic string to mark legacy mode
|
// Set the magic string to mark legacy mode
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
@@ -17,19 +15,10 @@ M65_MODE64:
|
|||||||
sta M65_MAGICSTR+1
|
sta M65_MAGICSTR+1
|
||||||
sta M65_MAGICSTR+2
|
sta M65_MAGICSTR+2
|
||||||
|
|
||||||
// Reenable badlines and slow interrupt emulation
|
// Restore VIC-II configuration
|
||||||
|
|
||||||
lda #$03
|
jsr viciv_shutdown
|
||||||
sta MISC_EMU
|
jsr setup_vicii
|
||||||
|
|
||||||
// Set misc VIC-IV flags
|
|
||||||
|
|
||||||
lda %00000000 // enable C64 character set
|
|
||||||
sta VIC_CTRLA
|
|
||||||
|
|
||||||
// Switch to VIC-II mode
|
|
||||||
|
|
||||||
sta VIC_KEY
|
|
||||||
|
|
||||||
// Reenable interrupts
|
// Reenable interrupts
|
||||||
|
|
||||||
|
|||||||
@@ -21,27 +21,11 @@ M65_MODE65:
|
|||||||
lda #$35 // '5'
|
lda #$35 // '5'
|
||||||
sta M65_MAGICSTR+2
|
sta M65_MAGICSTR+2
|
||||||
|
|
||||||
// XXX find a better place for code below
|
// Initialize VIC-IV
|
||||||
|
|
||||||
// Switch VIC to VIC-IV mode
|
jsr viciv_init
|
||||||
|
|
||||||
jsr viciv_unhide
|
// Set screen mode to 80x50
|
||||||
|
|
||||||
// Disable badlines and slow interrupt emulation
|
|
||||||
|
|
||||||
lda #$00
|
|
||||||
sta MISC_EMU
|
|
||||||
|
|
||||||
// Set misc VIC-IV flags
|
|
||||||
|
|
||||||
lda %01000000 // enable C65 character set
|
|
||||||
sta VIC_CTRLA
|
|
||||||
|
|
||||||
// XXX enable 48 MHz mode in VIC_CTRLC
|
|
||||||
|
|
||||||
// XXX posibly alter other settings
|
|
||||||
|
|
||||||
// Set screen mode to 80x25
|
|
||||||
|
|
||||||
lda #$02
|
lda #$02
|
||||||
jsr m65_scrmodeset_internal
|
jsr m65_scrmodeset_internal
|
||||||
|
|||||||
@@ -16,6 +16,14 @@ panic:
|
|||||||
sei
|
sei
|
||||||
pha
|
pha
|
||||||
|
|
||||||
|
#if ROM_LAYOUT_M65
|
||||||
|
|
||||||
|
// Make sure we are in legacy mode
|
||||||
|
|
||||||
|
jsr M65_MODE64
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// Reinitialize the hardware
|
// Reinitialize the hardware
|
||||||
|
|
||||||
jsr IOINIT
|
jsr IOINIT
|
||||||
|
|||||||
Reference in new issue
Block a user