changed CPU speed handling for MEGA65
This commit is contained in:
1 parent
121f49b763
commit
47b9676ca9
12 files changed
+142
-22
No files matched your search
@@ -20,9 +20,16 @@ iec_return_success:
|
||||
; BSOUR is certainly not valid anymore
|
||||
lda #$00
|
||||
sta C3PO
|
||||
|
||||
; Restore registers
|
||||
+ply_trash_a
|
||||
+plx_trash_a
|
||||
|
||||
!ifdef CONFIG_MB_M65 {
|
||||
; If in native mode, switch back to fast mode
|
||||
jsr m65_iec_fast
|
||||
}
|
||||
|
||||
; Report success
|
||||
clc
|
||||
rts
|
||||
@@ -31,12 +38,15 @@ iec_return_DEVICE_NOT_FOUND:
|
||||
|
||||
; Set IEC line to normal idle state
|
||||
jsr iec_set_idle
|
||||
|
||||
; BSOUR is certainly not valid anymore
|
||||
lda #$00
|
||||
sta C3PO
|
||||
|
||||
; Restore registers
|
||||
+ply_trash_a
|
||||
+plx_trash_a
|
||||
|
||||
; Report error
|
||||
jmp kernalerror_DEVICE_NOT_FOUND
|
||||
}
|
||||
@@ -16,6 +16,11 @@
|
||||
|
||||
iec_rx_dispatch:
|
||||
|
||||
!ifdef CONFIG_MB_M65 {
|
||||
; If in native mode, switch to 1 MHz
|
||||
jsr m65_iec_slow
|
||||
}
|
||||
|
||||
lda IECPROTO
|
||||
cmp #IEC_JIFFY
|
||||
+beq jiffydos_rx_byte
|
||||
@@ -27,6 +32,11 @@ iec_rx_dispatch:
|
||||
|
||||
iec_rx_byte:
|
||||
|
||||
!ifdef CONFIG_MB_M65 { !ifndef CONFIG_IEC_JIFFYDOS {
|
||||
; If in native mode, switch to 1 MHz
|
||||
jsr m65_iec_slow
|
||||
} }
|
||||
|
||||
; Store .X and .Y on the stack - preserve them
|
||||
+phx_trash_a
|
||||
+phy_trash_a
|
||||
@@ -60,7 +70,7 @@ iec_rx_byte:
|
||||
; For DolphinDOS just fetch the byte from parallel port
|
||||
lda CIA2_PRB
|
||||
pha
|
||||
jmp iec_rx_acknowledge
|
||||
+bra iec_rx_acknowledge
|
||||
|
||||
iec_rx_no_dolphindos:
|
||||
|
||||
@@ -124,7 +134,7 @@ iec_rx_clk_wait2:
|
||||
jsr kernalstatus_EOI
|
||||
pla
|
||||
|
||||
jmp iec_rx_end
|
||||
+bra iec_rx_end
|
||||
@2:
|
||||
; More bits?
|
||||
dex
|
||||
@@ -150,6 +160,11 @@ iec_rx_acknowledge:
|
||||
|
||||
iec_rx_end:
|
||||
|
||||
!ifdef CONFIG_MB_M65 {
|
||||
; If in native mode, switch back to fast mode
|
||||
jsr m65_iec_fast
|
||||
}
|
||||
|
||||
+ply_trash_a
|
||||
+plx_trash_a
|
||||
lda TBTCNT
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
iec_tx_dispatch:
|
||||
|
||||
php ; preserve C flag for EOI indication
|
||||
|
||||
!ifdef CONFIG_MB_M65 {
|
||||
; If in native mode, switch to 1 MHz
|
||||
jsr m65_iec_slow
|
||||
}
|
||||
|
||||
lda IECPROTO
|
||||
cmp #IEC_JIFFY
|
||||
bne @1
|
||||
@@ -34,6 +40,11 @@ iec_tx_dispatch:
|
||||
|
||||
iec_tx_byte:
|
||||
|
||||
!ifdef CONFIG_MB_M65 { !ifndef CONFIG_IEC_JIFFYDOS {
|
||||
; If in native mode, switch to 1 MHz
|
||||
jsr m65_iec_slow
|
||||
} }
|
||||
|
||||
; Store .X and .Y on the stack - preserve them
|
||||
+phx_trash_a
|
||||
+phy_trash_a
|
||||
@@ -84,7 +95,7 @@ iec_tx_common:
|
||||
jsr iec_pull_clk_release_data_oneshot
|
||||
|
||||
; Finish the flow
|
||||
jmp iec_tx_common_finalize
|
||||
+bra iec_tx_common_finalize
|
||||
|
||||
iec_tx_no_dolphindos:
|
||||
|
||||
@@ -122,7 +133,7 @@ iec_tx_common_sendbit:
|
||||
|
||||
; Bit is 0
|
||||
jsr iec_release_clk_pull_data
|
||||
jmp iec_tx_common_bit_is_sent
|
||||
+bra iec_tx_common_bit_is_sent
|
||||
@4:
|
||||
; Bit is 1
|
||||
jsr iec_release_clk_data
|
||||
|
||||
Reference in new issue
Block a user