more work towards Mega65 banking support
This commit is contained in:
1 parent
734ec07afb
commit
49693f1543
26 files changed
+118
-65
No files matched your search
+5
-3
@@ -1,11 +1,13 @@
|
||||
#if (ROM_LAYOUT_M65 && SEGMENT_KERNAL_1)
|
||||
|
||||
//
|
||||
// Definitions for communication with Mega65 segment KERNAL_1
|
||||
//
|
||||
|
||||
|
||||
// XXX this is for testing only
|
||||
|
||||
sed
|
||||
sed
|
||||
rts
|
||||
rts_32
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -14,18 +14,18 @@ chkin_iec:
|
||||
|
||||
lda LAT, Y
|
||||
cmp #$01
|
||||
beq_far chkin_file_not_input
|
||||
beq_16 chkin_file_not_input
|
||||
|
||||
// Send TALK + TKSA first
|
||||
lda FAT,Y
|
||||
|
||||
jsr TALK
|
||||
bcs_far chkinout_device_not_present
|
||||
bcs_16 chkinout_device_not_present
|
||||
|
||||
lda LAT, Y
|
||||
ora #$60
|
||||
jsr TKSA
|
||||
bcs_far chkinout_device_not_present
|
||||
bcs_16 chkinout_device_not_present
|
||||
|
||||
jmp chkin_set_device
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ chrout_iec:
|
||||
|
||||
lda SCHAR
|
||||
jsr JCIOUT
|
||||
bcc_far chrout_done_success
|
||||
bcc_16 chrout_done_success
|
||||
jmp chrout_done_fail
|
||||
|
||||
|
||||
|
||||
@@ -13,18 +13,18 @@ ckout_iec:
|
||||
// Fail if the file is open for reading (secondary address 0)
|
||||
|
||||
lda LAT, Y
|
||||
beq_far ckout_file_not_output
|
||||
beq_16 ckout_file_not_output
|
||||
|
||||
// Send LISTEN + SECOND first
|
||||
lda FAT,Y
|
||||
|
||||
jsr LISTEN
|
||||
bcs_far chkinout_device_not_present
|
||||
bcs_16 chkinout_device_not_present
|
||||
|
||||
lda LAT, Y
|
||||
ora #$60
|
||||
jsr SECOND
|
||||
bcs_far chkinout_device_not_present
|
||||
bcs_16 chkinout_device_not_present
|
||||
|
||||
jmp ckout_set_device
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ clrchn_iec:
|
||||
jsr iec_check_devnum_oc
|
||||
|
||||
// If it was IEC device - send UNLSN first
|
||||
bcc_far UNLSN
|
||||
bcc_16 UNLSN
|
||||
|
||||
rts
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ iec_rx_dispatch:
|
||||
|
||||
lda IECPROTO
|
||||
cmp #$01
|
||||
beq_far jiffydos_rx_byte
|
||||
beq_16 jiffydos_rx_byte
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ load_iec:
|
||||
|
||||
// Check file name
|
||||
lda FNLEN
|
||||
beq_far kernalerror_FILE_NAME_MISSING
|
||||
beq_16 kernalerror_FILE_NAME_MISSING
|
||||
|
||||
// Display SEARCHING FOR + filename
|
||||
jsr lvs_display_searching_for
|
||||
@@ -106,12 +106,12 @@ load_iec:
|
||||
|
||||
#if CONFIG_IEC_JIFFYDOS
|
||||
cmp #$01
|
||||
beq_far jiffydos_load // branch if JiffyDOS
|
||||
beq_16 jiffydos_load // branch if JiffyDOS
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEC_DOLPHINDOS
|
||||
cmp #$02
|
||||
beq_far dolphindos_load // branch if DolphinDOS
|
||||
beq_16 dolphindos_load // branch if DolphinDOS
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -149,7 +149,7 @@ load_iec_loop:
|
||||
phx_trash_a
|
||||
jsr udtim_keyboard
|
||||
jsr STOP
|
||||
bcs_far load_break_error
|
||||
bcs_16 load_break_error
|
||||
plx_trash_a
|
||||
!:
|
||||
// Check for EOI - if so, this was the last byte
|
||||
|
||||
@@ -16,7 +16,7 @@ save_iec:
|
||||
|
||||
// Check file name
|
||||
lda FNLEN
|
||||
beq_far kernalerror_FILE_NAME_MISSING
|
||||
beq_16 kernalerror_FILE_NAME_MISSING
|
||||
|
||||
// Display SAVING
|
||||
jsr lvs_display_saving
|
||||
|
||||
@@ -20,17 +20,17 @@ CHRIN:
|
||||
lda DFLTN
|
||||
|
||||
// Try $00 - keyboard
|
||||
beq_far chrin_keyboard
|
||||
beq_16 chrin_keyboard
|
||||
|
||||
// XXX Try $03 - screen
|
||||
// cmp #$03
|
||||
// beq_far chrin_screen
|
||||
// beq_16 chrin_screen
|
||||
|
||||
#if HAS_RS232
|
||||
|
||||
// Try $02 - RS-232
|
||||
cmp #$02
|
||||
beq_far chrin_rs232
|
||||
beq_16 chrin_rs232
|
||||
|
||||
#endif // HAS_RS232
|
||||
|
||||
@@ -40,7 +40,7 @@ chrin_getin: // jump entry for GETIN
|
||||
|
||||
// Try IEC devices
|
||||
jsr iec_check_devnum_oc
|
||||
bcc_far chrin_iec
|
||||
bcc_16 chrin_iec
|
||||
|
||||
#endif // CONFIG_IEC
|
||||
|
||||
|
||||
@@ -28,16 +28,16 @@ CHROUT:
|
||||
lda DFLTO
|
||||
|
||||
cmp #$03 // screen
|
||||
beq_far chrout_screen
|
||||
beq_16 chrout_screen
|
||||
|
||||
#if HAS_RS232
|
||||
cmp #$02
|
||||
beq_far chrout_rs232
|
||||
beq_16 chrout_rs232
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEC
|
||||
jsr iec_check_devnum_oc
|
||||
bcc_far chrout_iec
|
||||
bcc_16 chrout_iec
|
||||
#endif
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
@@ -23,7 +23,7 @@ CHKIN:
|
||||
|
||||
txa
|
||||
jsr find_fls
|
||||
bcs_far chkinout_file_not_open
|
||||
bcs_16 chkinout_file_not_open
|
||||
|
||||
// Now we have table index in Y
|
||||
|
||||
@@ -38,19 +38,19 @@ CHKIN:
|
||||
#if HAS_RS232
|
||||
|
||||
cmp #$02
|
||||
beq_far chkin_rs232
|
||||
beq_16 chkin_rs232
|
||||
|
||||
#endif // HAS_RS232
|
||||
|
||||
#if CONFIG_IEC
|
||||
|
||||
jsr iec_check_devnum_oc
|
||||
bcc_far chkin_iec
|
||||
bcc_16 chkin_iec
|
||||
|
||||
#endif // CONFIG_IEC
|
||||
|
||||
cmp #$03 // screen - only legal one left
|
||||
bne_far chkinout_device_not_present
|
||||
bne_16 chkinout_device_not_present
|
||||
|
||||
chkin_set_device:
|
||||
lda FAT,Y
|
||||
|
||||
@@ -23,7 +23,7 @@ CKOUT:
|
||||
|
||||
txa
|
||||
jsr find_fls
|
||||
bcs_far chkinout_file_not_open
|
||||
bcs_16 chkinout_file_not_open
|
||||
|
||||
// Now we have table index in Y
|
||||
|
||||
@@ -38,19 +38,19 @@ CKOUT:
|
||||
#if HAS_RS232
|
||||
|
||||
cmp #$02
|
||||
beq_far ckout_rs232
|
||||
beq_16 ckout_rs232
|
||||
|
||||
#endif // HAS_RS232
|
||||
|
||||
#if CONFIG_IEC
|
||||
|
||||
jsr iec_check_devnum_oc
|
||||
bcc_far ckout_iec
|
||||
bcc_16 ckout_iec
|
||||
|
||||
#endif // CONFIG_IEC
|
||||
|
||||
cmp #$03 // screen - only legal one left
|
||||
bne_far chkinout_device_not_present
|
||||
bne_16 chkinout_device_not_present
|
||||
|
||||
ckout_set_device:
|
||||
lda FAT,Y
|
||||
|
||||
@@ -25,12 +25,12 @@ CLOSE:
|
||||
|
||||
#if HAS_RS232
|
||||
cmp #$02
|
||||
beq_far close_rs232
|
||||
beq_16 close_rs232
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEC
|
||||
jsr iec_check_devnum_oc
|
||||
bcc_far close_iec
|
||||
bcc_16 close_iec
|
||||
#endif
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
@@ -60,14 +60,14 @@ open_has_space:
|
||||
#if HAS_RS232
|
||||
|
||||
cmp #$02
|
||||
beq_far open_rs232
|
||||
beq_16 open_rs232
|
||||
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEC
|
||||
|
||||
jsr iec_check_devnum_oc
|
||||
bcc_far open_iec
|
||||
bcc_16 open_iec
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -43,17 +43,17 @@ LOAD:
|
||||
|
||||
#if CONFIG_TAPE_NORMAL
|
||||
cmp #$01
|
||||
beq_far load_tape_normal
|
||||
beq_16 load_tape_normal
|
||||
#endif
|
||||
|
||||
#if CONFIG_TAPE_TURBO
|
||||
cmp #$07
|
||||
beq_far load_tape_turbo
|
||||
beq_16 load_tape_turbo
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEC
|
||||
jsr iec_check_devnum_lvs
|
||||
bcc_far load_iec
|
||||
bcc_16 load_iec
|
||||
#endif
|
||||
|
||||
jmp lvs_illegal_device_number
|
||||
|
||||
@@ -25,7 +25,7 @@ SAVE:
|
||||
|
||||
#if CONFIG_IEC
|
||||
jsr iec_check_devnum_lvs
|
||||
bcc_far save_iec
|
||||
bcc_16 save_iec
|
||||
#endif
|
||||
|
||||
jmp lvs_illegal_device_number
|
||||
|
||||
@@ -16,13 +16,13 @@ getin_real:
|
||||
lda DFLTN
|
||||
|
||||
// Try $00 - keyboard
|
||||
beq_far getin_keyboard
|
||||
beq_16 getin_keyboard
|
||||
|
||||
#if HAS_RS232
|
||||
|
||||
// Try $02 - RS-232
|
||||
cmp #$02
|
||||
beq_far getin_rs232
|
||||
beq_16 getin_rs232
|
||||
|
||||
#endif // HAS_RS232
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ chrout_screen_CRSR_RIGHT:
|
||||
|
||||
jsr screen_get_clipped_PNTR
|
||||
cpy #39
|
||||
beq_far screen_advance_to_next_line
|
||||
beq_16 screen_advance_to_next_line
|
||||
|
||||
iny
|
||||
!:
|
||||
|
||||
@@ -14,7 +14,7 @@ chrout_screen_INS:
|
||||
|
||||
// Not space, we cannot insert anything
|
||||
|
||||
bne_far chrout_screen_done
|
||||
bne_16 chrout_screen_done
|
||||
|
||||
chrout_screen_ins_possible:
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ load_tape_normal_header:
|
||||
lda (TAPE1),y
|
||||
|
||||
cmp #$05
|
||||
beq_far tape_load_error // end of tape mark, nothing to load
|
||||
beq_16 tape_load_error // end of tape mark, nothing to load
|
||||
|
||||
cmp #$01
|
||||
beq !+
|
||||
@@ -125,10 +125,10 @@ load_tape_normal_payload:
|
||||
jsr tape_normal_pilot_data
|
||||
ldy #$00 // no data size limit
|
||||
jsr tape_normal_get_data
|
||||
bcs_far tape_load_error
|
||||
bcs_16 tape_load_error
|
||||
|
||||
jsr lvs_check_EAL
|
||||
bne_far tape_load_error // amount of data read does not match header info
|
||||
bne_16 tape_load_error // amount of data read does not match header info
|
||||
|
||||
jmp tape_load_success
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ load_tape_turbo_loop:
|
||||
|
||||
// Verify the checksum
|
||||
cpx PRTY
|
||||
beq_far tape_load_success
|
||||
beq_16 tape_load_success
|
||||
jmp tape_load_error
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user