improved tape support with Mega65 native mode
This commit is contained in:
1 parent
11aa1f114a
commit
ffdc67d5ca
8 files changed
+49
-50
No files matched your search
@@ -183,9 +183,9 @@
|
||||
.label C65_EXTKEYS_PR = $D607
|
||||
.label C65_EXTKEYS_DDR = $D608
|
||||
|
||||
.label M65_BADL_SLI = $D710
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if !CONFIG_MB_MEGA_65
|
||||
|
||||
// SuperCPU registers
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
.label VIC_KEY = $D02F
|
||||
|
||||
.label VIC_SCFLAGS = $D031
|
||||
.label VIC_CTRLB = $D031
|
||||
|
||||
.label VIC_XPOS = $D050
|
||||
|
||||
@@ -21,4 +21,8 @@
|
||||
|
||||
.label VIC_CHARPTR = $D068 // 3 bytes
|
||||
|
||||
// MISC registers
|
||||
|
||||
.label MISC_EMU = $D710 // to enable badlines and slow interrupts
|
||||
|
||||
#endif
|
||||
@@ -11,7 +11,12 @@
|
||||
.label STOP = KERNAL_0.STOP
|
||||
.label M65_SLOW = KERNAL_0.M65_SLOW
|
||||
.label M65_FAST = KERNAL_0.M65_FAST
|
||||
.label M65_ISMODE65 = KERNAL_0.M65_ISMODE65
|
||||
|
||||
#if (CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO) || (CONFIG_IEC_JIFFYDOS && !CONFIG_MEMORY_MODEL_60K)
|
||||
.label screen_on = KERNAL_0.screen_on
|
||||
.label screen_off = KERNAL_0.screen_off
|
||||
#endif
|
||||
|
||||
.label hw_entry_reset = KERNAL_0.hw_entry_reset
|
||||
.label return_from_interrupt = KERNAL_0.return_from_interrupt
|
||||
|
||||
@@ -8,7 +8,7 @@ M65_MODE64:
|
||||
|
||||
sei
|
||||
|
||||
// XXX provide full implementation
|
||||
// XXX provide full implementation - switch back to normal text mode
|
||||
|
||||
// Set the magic string to mark legacy mode
|
||||
|
||||
@@ -17,6 +17,15 @@ M65_MODE64:
|
||||
sta M65_MAGICSTR+1
|
||||
sta M65_MAGICSTR+2
|
||||
|
||||
// Reenable badlines and slow interrupt emulation
|
||||
|
||||
lda #$03
|
||||
sta MISC_EMU
|
||||
|
||||
// Switch to VIC-II mode
|
||||
|
||||
sta VIC_KEY
|
||||
|
||||
// Reenable interrupts
|
||||
|
||||
cli
|
||||
|
||||
@@ -21,10 +21,19 @@ M65_MODE65:
|
||||
lda #$35 // '5'
|
||||
sta M65_MAGICSTR+2
|
||||
|
||||
// XXX find a better place for code below
|
||||
|
||||
// Switch VIC to VIC-IV mode
|
||||
|
||||
jsr viciv_unhide
|
||||
|
||||
// Disable badlines and slow interrupt emulation
|
||||
|
||||
lda #$00
|
||||
sta MISC_EMU
|
||||
|
||||
// XXX
|
||||
|
||||
// Set screen mode to 80x25
|
||||
|
||||
lda #$01
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
//
|
||||
|
||||
|
||||
#if (CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO) && !CONFIG_MB_MEGA_65
|
||||
#if (CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO) || (CONFIG_IEC_JIFFYDOS && !CONFIG_MEMORY_MODEL_60K)
|
||||
|
||||
|
||||
screen_on:
|
||||
|
||||
@@ -60,38 +60,19 @@ m65_scrmodeset_internal: // entry point for M65_MODE65
|
||||
stx VIC_SCRNPTR+1
|
||||
stx M65_SCRTXTBASE+1
|
||||
|
||||
// Set flags for 40/80 columns and 25/50 rows
|
||||
// Set flags/varaibles for 40/80 columns and 25/50 rows
|
||||
|
||||
asl
|
||||
tax
|
||||
lda VIC_SCFLAGS
|
||||
jsr_ind_x m65_scrmodeset_flagtab
|
||||
|
||||
lda m65_scrtab_vic_ctrlb,x
|
||||
sta VIC_CTRLB
|
||||
|
||||
rts
|
||||
|
||||
m65_scrmodeset_flagtab:
|
||||
|
||||
.word m65_scrmodeset_40x25
|
||||
.word m65_scrmodeset_80x25
|
||||
.word m65_scrmodeset_80x50
|
||||
|
||||
|
||||
m65_scrmodeset_40x25:
|
||||
m65_scrtab_vic_ctrlb:
|
||||
|
||||
and #$77
|
||||
bra !+
|
||||
|
||||
m65_scrmodeset_80x25:
|
||||
|
||||
and #$F7
|
||||
ora #$80
|
||||
skip_2_bytes_trash_nvz
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
m65_scrmodeset_80x50:
|
||||
|
||||
ora #$88
|
||||
!:
|
||||
sta VIC_SCFLAGS
|
||||
rts
|
||||
.byte %00000000 // 40x25
|
||||
.byte %10000000 // 80x25
|
||||
.byte %10000100 // 80x50
|
||||
@@ -11,8 +11,6 @@
|
||||
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
|
||||
|
||||
|
||||
// XXX for Mega65 do not disable screen, just disable badline emulation
|
||||
|
||||
|
||||
tape_screen_on_motor_off:
|
||||
|
||||
@@ -21,18 +19,14 @@ tape_screen_on_motor_off:
|
||||
lda COLSTORE
|
||||
sta VIC_EXTCOL
|
||||
|
||||
#if !CONFIG_MB_MEGA_65
|
||||
#if !ROM_LAYOUT_M65
|
||||
|
||||
jmp screen_on
|
||||
|
||||
#else
|
||||
|
||||
// On Mega65 just reenable badline emulation
|
||||
|
||||
lda #$FF
|
||||
sta M65_BADL_SLI
|
||||
sta VIC_KEY
|
||||
|
||||
jsr M65_ISMODE65
|
||||
bne_16 screen_on // MEGA65 native mode does not have badlines, no need to enable/disable screen
|
||||
rts
|
||||
|
||||
#endif
|
||||
@@ -51,22 +45,19 @@ tape_screen_off_motor_on:
|
||||
lda VIC_EXTCOL
|
||||
sta COLSTORE
|
||||
|
||||
#if !CONFIG_MB_MEGA_65
|
||||
|
||||
#if !ROM_LAYOUT_M65
|
||||
|
||||
jsr screen_off
|
||||
|
||||
#else
|
||||
|
||||
// On Mega65 we do not have to turn the screen off;
|
||||
// it is enough to disable badline emulation
|
||||
|
||||
jsr viciv_unhide
|
||||
lda #$00
|
||||
sta M65_BADL_SLI
|
||||
jsr M65_ISMODE65
|
||||
beq !+ // MEGA65 native mode does not have badlines, no need to enable/disable screen
|
||||
jsr screen_off
|
||||
!:
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
jmp tape_motor_on
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user