changed CPU speed handling for MEGA65

This commit is contained in:
FeralChild64 committed 2020-10-11 20:56:30 +02:00
1 parent 121f49b763
commit 47b9676ca9
12 files changed
+142 -22

No files matched your search

@@ -0,0 +1,45 @@
;; #LAYOUT# M65 KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
;
; Checks if system is in MEGA65 native mode; if so, switches CPU speed to fast/slow - for IEC routines;
; Alters only status bits, all remaining registers preserved
;
!ifdef CONFIG_IEC {
m65_iec_slow:
jsr M65_MODEGET
bcs m65_iec_fast_slow_done
; Switch CPU speed
pha
lda VIC_CTRLB
and #%10111111
bra m65_iec_fast_slow_common
m65_iec_fast:
jsr M65_MODEGET
bcs m65_iec_fast_slow_done
pha
lda VIC_CTRLB
ora #%01000000
; FALLTROUGH
m65_iec_fast_slow_common:
sta VIC_CTRLB
pla
; FALLTROUGH
m65_iec_fast_slow_done:
rts
}