more compatible STAL/EAL/MEMUSS handling

This commit is contained in:
FeralChild64 committed 2019-11-07 19:00:09 +01:00
1 parent 2e9a0b1610
commit ce68834035
5 files changed
+65 -33

No files matched your search

+19 -10
View File
@@ -61,36 +61,45 @@ load_tape_turbo_header_loop: // this strange loop puts metadata after
load_tape_turbo_payload:
// Initial checksum value
lda #$00
sta PRTY
// Read file payload
jsr tape_turbo_sync_payload
ldy #$00
sty PRTY // initial checksum value
// FALLTROUGH
load_tape_turbo_loop:
jsr tape_turbo_get_byte
sta (STAL),y
sta (MEMUSS),y
eor PRTY // handle checksum
sta PRTY
jsr lvs_advance_pointer
lda STAL+1
// Advance MEMUSS (see Mapping the C64, page 36)
inc MEMUSS+0
bne !+
inc MEMUSS+1
!:
lda MEMUSS+1
cmp EAL+1
bne load_tape_turbo_loop
lda STAL+0
lda MEMUSS+0
cmp EAL+0
bne load_tape_turbo_loop
// Verify the checksum
// Get the checksum
jsr tape_turbo_get_byte
cmp PRTY
tax
// Verify the checksum
cpx PRTY
beq_far tape_load_success
jmp tape_load_error
+22 -2
View File
@@ -208,9 +208,29 @@ tape_handle_header:
adc STAL+1
sta EAL+1
!:
// Print LOADING
// Setup MEMUSS (see Mapping the C64, page 36)
jsr lvs_display_loading_verifying
lda STAL+0
sta MEMUSS+0
lda STAL+1
sta MEMUSS+1
// Print LOADING and start address
lda MSGFLG
bpl tape_handle_header_displayed
ldx #__MSG_KERNAL_LOADING
jsr print_kernal_message
ldx #__MSG_KERNAL_FROM_HEX
jsr print_kernal_message
lda STAL+1
jsr print_hex_byte
lda STAL+0
jsr print_hex_byte
tape_handle_header_displayed:
// Load the file