more work on reading second copy from tape, some cleanup
This commit is contained in:
1 parent
28a96a7ffc
commit
92c8a9d03d
11 files changed
+84
-36
No files matched your search
@@ -1,9 +1,8 @@
|
|||||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
|
||||||
cartridge_signature:
|
cartridge_signature:
|
||||||
|
|
||||||
.byte $C3,$C2,$CD,$38,$30
|
.byte $C3,$C2,$CD,$38,$30
|
||||||
|
|
||||||
|
|
||||||
#endif // ROM layout
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
|
||||||
// CHR$ codes for the 16 colours
|
// CHR$ codes for the 16 colours
|
||||||
|
|
||||||
colour_codes:
|
colour_codes:
|
||||||
.byte 144,5,28,159,156,30,31,158
|
.byte 144,5,28,159,156,30,31,158
|
||||||
.byte 129,149,150,151,152,153,154,155
|
.byte 129,149,150,151,152,153,154,155
|
||||||
|
|
||||||
|
|
||||||
#endif // ROM layout
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
//
|
//
|
||||||
// Default values for Kernal vectors - described in:
|
// Default values for Kernal vectors - described in:
|
||||||
@@ -25,6 +27,3 @@ vector_defaults:
|
|||||||
.word default_brk_handler // USRCMD
|
.word default_brk_handler // USRCMD
|
||||||
.word LOAD // ILOAD
|
.word LOAD // ILOAD
|
||||||
.word SAVE // ISAVE
|
.word SAVE // ISAVE
|
||||||
|
|
||||||
|
|
||||||
#endif // ROM layout
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
//
|
//
|
||||||
// Values for IRQ generation timer - original idea was:
|
// Values for IRQ generation timer - original idea was:
|
||||||
@@ -22,6 +24,3 @@ irq_timing_hi: // high bytes
|
|||||||
|
|
||||||
.byte >17045 // NTSC
|
.byte >17045 // NTSC
|
||||||
.byte >16421 // PAL
|
.byte >16421 // PAL
|
||||||
|
|
||||||
|
|
||||||
#endif // ROM layout
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
//
|
//
|
||||||
// Values for IRQ generation timer - original idea was:
|
// Values for IRQ generation timer - original idea was:
|
||||||
@@ -22,6 +24,3 @@ irq_timing_lo: // low bytes
|
|||||||
|
|
||||||
.byte <17045 // NTSC
|
.byte <17045 // NTSC
|
||||||
.byte <16421 // PAL
|
.byte <16421 // PAL
|
||||||
|
|
||||||
|
|
||||||
#endif // ROM layout
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
//
|
//
|
||||||
// Messages to be prined out by Kernal
|
// Messages to be prined out by Kernal
|
||||||
@@ -111,6 +113,3 @@ __msg_kernalfeatures:
|
|||||||
.byte $80 + $0D // end of string mark + return
|
.byte $80 + $0D // end of string mark + return
|
||||||
|
|
||||||
#endif // CONFIG_SHOW_FEATURES
|
#endif // CONFIG_SHOW_FEATURES
|
||||||
|
|
||||||
|
|
||||||
#endif // ROM layout
|
|
||||||
@@ -74,7 +74,7 @@ save_iec:
|
|||||||
jsr iec_tx_byte
|
jsr iec_tx_byte
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
jsr lvs_setup_MEMUSS
|
jsr lvs_STAL_to_MEMUSS
|
||||||
ldy #$00
|
ldy #$00
|
||||||
iec_save_loop:
|
iec_save_loop:
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ lvs_handle_byte_verify:
|
|||||||
|
|
||||||
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO || CONFIG_IEC
|
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO || CONFIG_IEC
|
||||||
|
|
||||||
lvs_setup_MEMUSS:
|
lvs_STAL_to_MEMUSS:
|
||||||
|
|
||||||
lda STAL+0
|
lda STAL+0
|
||||||
sta MEMUSS+0
|
sta MEMUSS+0
|
||||||
|
|||||||
@@ -60,15 +60,17 @@ load_tape_normal_takeover: // entry point for turbo->normal takeover
|
|||||||
|
|
||||||
load_tape_normal_header:
|
load_tape_normal_header:
|
||||||
|
|
||||||
|
jsr load_MEMUSS_to_STAL
|
||||||
|
|
||||||
// Try to load header into tape buffer (we will restore MEMUSS later)
|
// Try to load header into tape buffer (we will restore MEMUSS later)
|
||||||
|
|
||||||
jsr tape_normal_get_pilot_header
|
jsr tape_normal_get_pilot_header
|
||||||
|
|
||||||
jsr load_tape_normal_buf_MEMUSS
|
jsr load_TAPE1_to_MEMUSS
|
||||||
jsr tape_normal_get_data_1
|
jsr tape_normal_get_data_1
|
||||||
bcs load_tape_normal_header // unable to read block, try again XXX jump to turbo detection
|
bcs load_tape_normal_header // unable to read block, try again XXX jump to turbo detection
|
||||||
|
|
||||||
jsr load_tape_normal_buf_MEMUSS
|
jsr load_TAPE1_to_MEMUSS
|
||||||
jsr tape_normal_get_data_2
|
jsr tape_normal_get_data_2
|
||||||
bcs load_tape_normal_header // block load error, try again XXX jump to turbo detection
|
bcs load_tape_normal_header // block load error, try again XXX jump to turbo detection
|
||||||
|
|
||||||
@@ -90,7 +92,7 @@ load_tape_normal_header:
|
|||||||
!:
|
!:
|
||||||
// Restore MEMUSS, handle header
|
// Restore MEMUSS, handle header
|
||||||
|
|
||||||
jsr lvs_setup_MEMUSS
|
jsr lvs_STAL_to_MEMUSS
|
||||||
jsr tape_handle_header
|
jsr tape_handle_header
|
||||||
bcs load_tape_normal_header // if name does not match, look for other header
|
bcs load_tape_normal_header // if name does not match, look for other header
|
||||||
|
|
||||||
@@ -108,14 +110,15 @@ load_tape_normal_payload:
|
|||||||
jsr lvs_check_EAL
|
jsr lvs_check_EAL
|
||||||
bne_16 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
|
||||||
|
|
||||||
// XXX setup MEMUSS once again
|
jsr lvs_STAL_to_MEMUSS
|
||||||
jsr tape_normal_get_data_2
|
jsr tape_normal_get_data_2
|
||||||
bcs_16 tape_load_error
|
bcs_16 tape_load_error
|
||||||
|
|
||||||
jmp tape_load_success
|
jmp tape_load_success
|
||||||
|
|
||||||
|
|
||||||
load_tape_normal_buf_MEMUSS: // set MEMUSS (start address) as tape buffer
|
|
||||||
|
load_TAPE1_to_MEMUSS: // set MEMUSS (start address) as tape buffer
|
||||||
|
|
||||||
lda TAPE1+1
|
lda TAPE1+1
|
||||||
sta MEMUSS+1
|
sta MEMUSS+1
|
||||||
@@ -124,5 +127,14 @@ load_tape_normal_buf_MEMUSS: // set MEMUSS (start address) as tape buf
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
load_MEMUSS_to_STAL: // preserve MEMUSS
|
||||||
|
|
||||||
|
lda MEMUSS+1
|
||||||
|
sta STAL+1
|
||||||
|
lda MEMUSS+0
|
||||||
|
sta STAL+0
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -160,7 +160,7 @@ tape_handle_header:
|
|||||||
sbc STAL+1
|
sbc STAL+1
|
||||||
sta EAL+1
|
sta EAL+1
|
||||||
|
|
||||||
// STAL = MEMUSS XXX is it needed?
|
// STAL = MEMUSS
|
||||||
|
|
||||||
lda MEMUSS+0
|
lda MEMUSS+0
|
||||||
sta STAL+0
|
sta STAL+0
|
||||||
@@ -179,7 +179,7 @@ tape_handle_header:
|
|||||||
!:
|
!:
|
||||||
// Setup MEMUSS (see Mapping the C64, page 36)
|
// Setup MEMUSS (see Mapping the C64, page 36)
|
||||||
|
|
||||||
jsr lvs_setup_MEMUSS
|
jsr lvs_STAL_to_MEMUSS
|
||||||
|
|
||||||
// Print LOADING and start address
|
// Print LOADING and start address
|
||||||
|
|
||||||
|
|||||||
@@ -9,13 +9,20 @@
|
|||||||
|
|
||||||
#if CONFIG_TAPE_NORMAL
|
#if CONFIG_TAPE_NORMAL
|
||||||
|
|
||||||
|
tape_normal_get_data_2:
|
||||||
|
|
||||||
|
lda RIPRTY
|
||||||
|
cmp #$01
|
||||||
|
rts
|
||||||
|
|
||||||
|
#elif DISABLED_DISABLED
|
||||||
|
|
||||||
tape_normal_get_data_2:
|
tape_normal_get_data_2:
|
||||||
|
|
||||||
// First check if there is a need to read anything
|
// First check if there is a need to read anything
|
||||||
|
|
||||||
lda PTR1
|
// XXX lda PTR1
|
||||||
beq tape_normal_get_data_2_checksum
|
// XXX beq tape_normal_get_data_2_checksum
|
||||||
|
|
||||||
// Read sync of the block
|
// Read sync of the block
|
||||||
|
|
||||||
@@ -28,7 +35,32 @@ tape_normal_get_data_2:
|
|||||||
|
|
||||||
tape_normal_get_data_2_loop:
|
tape_normal_get_data_2_loop:
|
||||||
|
|
||||||
// XXX read missing bytes
|
// Read missing bytes
|
||||||
|
|
||||||
|
jsr tape_normal_get_byte
|
||||||
|
bcc tape_normal_get_data_2_loop_byte_OK
|
||||||
|
|
||||||
|
// Problem reading byte
|
||||||
|
|
||||||
|
jsr load_cmp_log_MEMUSS
|
||||||
|
bne tape_normal_get_data_2_loop_advance
|
||||||
|
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
|
||||||
|
tape_normal_get_data_2_loop_byte_OK:
|
||||||
|
|
||||||
|
jsr load_cmp_log_MEMUSS
|
||||||
|
bne tape_normal_get_data_2_loop_advance
|
||||||
|
|
||||||
|
// This is a byte from the log
|
||||||
|
|
||||||
|
// XXX store correct byte
|
||||||
|
|
||||||
|
|
||||||
|
tape_normal_get_data_2_loop_advance:
|
||||||
|
|
||||||
|
// XXX finish the implementation
|
||||||
|
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
@@ -48,4 +80,13 @@ tape_normal_get_data_2_done:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
load_cmp_log_MEMUSS:
|
||||||
|
|
||||||
|
// XXX
|
||||||
|
|
||||||
|
!:
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user