fixed LOAD command for CBDOS
This commit is contained in:
1 parent
eec5a0680b
commit
67e9be4372
2 files changed
+74
No files matched your search
@@ -7,6 +7,9 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
; XXX This is suspiciously complicated, most likely something is really wrong with the IEC support
|
||||||
|
|
||||||
|
|
||||||
!ifdef CONFIG_IEC {
|
!ifdef CONFIG_IEC {
|
||||||
|
|
||||||
|
|
||||||
@@ -57,6 +60,11 @@ load_iec:
|
|||||||
jsr TALK
|
jsr TALK
|
||||||
bcs load_iec_error
|
bcs load_iec_error
|
||||||
|
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
jsr m65dos_check
|
||||||
|
+bcc m65dos_load_part ; branch if device is handeld by internal DOS
|
||||||
|
}
|
||||||
|
|
||||||
!ifdef HAS_IEC_BURST {
|
!ifdef HAS_IEC_BURST {
|
||||||
jsr burst_advertise
|
jsr burst_advertise
|
||||||
}
|
}
|
||||||
@@ -83,6 +91,10 @@ load_iec:
|
|||||||
jsr load_iec_get_addr_byte
|
jsr load_iec_get_addr_byte
|
||||||
sta EAL+1
|
sta EAL+1
|
||||||
|
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
load_iec_m65cont:
|
||||||
|
}
|
||||||
|
|
||||||
; If secondary address is 0, override EAL with STAL
|
; If secondary address is 0, override EAL with STAL
|
||||||
|
|
||||||
lda SA
|
lda SA
|
||||||
@@ -126,6 +138,11 @@ load_iec:
|
|||||||
|
|
||||||
load_iec_loop:
|
load_iec_loop:
|
||||||
|
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
jsr m65dos_check
|
||||||
|
+bcc m65dos_load_loop ; branch if device is handeld by internal DOS
|
||||||
|
}
|
||||||
|
|
||||||
; We are now ready to receive bytes
|
; We are now ready to receive bytes
|
||||||
!ifdef CONFIG_IEC_JIFFYDOS {
|
!ifdef CONFIG_IEC_JIFFYDOS {
|
||||||
jsr iec_rx_dispatch
|
jsr iec_rx_dispatch
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
;; #LAYOUT# M65 KERNAL_0 #TAKE
|
||||||
|
;; #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
;
|
||||||
|
; MEGA65 pseudo-IEC internal DOS support - part of the LOAD routine
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
m65dos_load_part:
|
||||||
|
|
||||||
|
; Open channel for loading
|
||||||
|
|
||||||
|
lda #$60
|
||||||
|
jsr m65dos_tksa
|
||||||
|
|
||||||
|
jsr m65dos_get_addr_byte
|
||||||
|
sta EAL+0
|
||||||
|
|
||||||
|
jsr m65dos_get_addr_byte
|
||||||
|
sta EAL+1
|
||||||
|
|
||||||
|
jmp load_iec_m65cont
|
||||||
|
|
||||||
|
m65dos_get_addr_byte:
|
||||||
|
|
||||||
|
jsr m65dos_acptr
|
||||||
|
bcs @1
|
||||||
|
lda IOSTATUS
|
||||||
|
and #K_STS_EOI
|
||||||
|
bne @1
|
||||||
|
lda TBTCNT
|
||||||
|
rts
|
||||||
|
@1:
|
||||||
|
pla
|
||||||
|
pla
|
||||||
|
|
||||||
|
jmp load_iec_file_not_found
|
||||||
|
|
||||||
|
m65dos_load_loop:
|
||||||
|
|
||||||
|
jsr m65dos_acptr
|
||||||
|
|
||||||
|
; Handle the byte (store in memory / verify)
|
||||||
|
jsr lvs_handle_byte_load_verify
|
||||||
|
+bcs load_iec_error
|
||||||
|
|
||||||
|
; Advance pointer to data; it is OK if it advances past $FFFF,
|
||||||
|
; one autostart technique does exactly this
|
||||||
|
inw EAL+0
|
||||||
|
|
||||||
|
; Check for EOI - if so, this was the last byte
|
||||||
|
bit IOSTATUS
|
||||||
|
bvc m65dos_load_loop
|
||||||
|
|
||||||
|
; FALLTROUGH
|
||||||
|
|
||||||
|
jmp load_iec_loop_end
|
||||||
Reference in new issue
Block a user