reading second file copy finished, but not tested yet
This commit is contained in:
1 parent
92c8a9d03d
commit
32a37e9e6f
1 file changed
+52
-10
@@ -15,7 +15,7 @@ tape_normal_get_data_2:
|
|||||||
cmp #$01
|
cmp #$01
|
||||||
rts
|
rts
|
||||||
|
|
||||||
#elif DISABLED_DISABLED
|
#elif XXX_DISABLED
|
||||||
|
|
||||||
tape_normal_get_data_2:
|
tape_normal_get_data_2:
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ tape_normal_get_data_2:
|
|||||||
|
|
||||||
ldy #$09
|
ldy #$09
|
||||||
jsr tape_normal_sync
|
jsr tape_normal_sync
|
||||||
bcs tape_normal_get_data_2_done // Carry already set, will indicate error
|
bcs tape_normal_get_data_2_done // Carry already set, will indicate error
|
||||||
jsr tape_normal_get_marker
|
jsr tape_normal_get_marker
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
@@ -51,27 +51,50 @@ tape_normal_get_data_2_loop:
|
|||||||
tape_normal_get_data_2_loop_byte_OK:
|
tape_normal_get_data_2_loop_byte_OK:
|
||||||
|
|
||||||
jsr load_cmp_log_MEMUSS
|
jsr load_cmp_log_MEMUSS
|
||||||
bne tape_normal_get_data_2_loop_advance
|
beq tape_normal_get_data_2_loop_byte_correct // branch if byte from the log
|
||||||
|
|
||||||
|
jsr tape_normal_get_marker
|
||||||
|
bcs tape_normal_get_data_2_log_checksum // branch if end of blocks
|
||||||
|
bcc tape_normal_get_data_2_loop_advance
|
||||||
|
|
||||||
|
|
||||||
|
tape_normal_get_data_2_loop_byte_correct:
|
||||||
|
|
||||||
// This is a byte from the log
|
// This is a byte from the log
|
||||||
|
|
||||||
// XXX store correct byte
|
jsr tape_normal_get_marker
|
||||||
|
bcs !+
|
||||||
|
|
||||||
|
lda INBIT
|
||||||
|
ldy #$00
|
||||||
|
sta (MEMUSS), y
|
||||||
|
!:
|
||||||
|
jsr tape_normal_update_checksum
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
tape_normal_get_data_2_loop_advance:
|
tape_normal_get_data_2_loop_advance:
|
||||||
|
|
||||||
// XXX finish the implementation
|
// Advance pointer
|
||||||
|
#if !HAS_OPCODES_65CE02
|
||||||
|
jsr lvs_advance_MEMUSS
|
||||||
|
#else
|
||||||
|
inw MEMUSS+0
|
||||||
|
#endif
|
||||||
|
|
||||||
sec
|
jmp tape_normal_get_data_2_loop
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
tape_normal_get_data_2_checksum:
|
tape_normal_get_data_2_log_checksum:
|
||||||
|
|
||||||
|
lda PTR1
|
||||||
|
cmp PTR2
|
||||||
|
bne tape_normal_get_data_2_done // Carry already set
|
||||||
|
|
||||||
// Validate checksum
|
// Validate checksum
|
||||||
|
|
||||||
lda RIPRTY
|
lda RIPRTY
|
||||||
cmp #$01 // sets Carry if checksum verification fails
|
cmp #$01 // sets Carry if checksum verification fails
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
@@ -83,8 +106,27 @@ tape_normal_get_data_2_done:
|
|||||||
|
|
||||||
load_cmp_log_MEMUSS:
|
load_cmp_log_MEMUSS:
|
||||||
|
|
||||||
// XXX
|
lda PTR1 // XXX this comparison can be probably moved somewhere else
|
||||||
|
cmp PTR2
|
||||||
|
bne !+
|
||||||
|
|
||||||
|
lda #$01 // to clear Zero flag
|
||||||
|
rts
|
||||||
|
!:
|
||||||
|
ldx PTR2
|
||||||
|
lda STACK+0, x
|
||||||
|
cmp MEMUSS+0
|
||||||
|
bne !+
|
||||||
|
|
||||||
|
lda STACK+1, x
|
||||||
|
cmp MEMUSS+1
|
||||||
|
bne !+
|
||||||
|
|
||||||
|
// MEMUSS matches address from the log
|
||||||
|
|
||||||
|
inc PTR2
|
||||||
|
inc PTR2
|
||||||
|
lda #$00 // to set Zero flag
|
||||||
!:
|
!:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user