$FFE7/65511 Close All Channels And Files
Init: // ======================== // Serial Bus Clock Pulse Output lda $dd00 ora #$13 sta $dd00 InitializeDrive: ldx #6 !: lda SetParameters,x sta $b7,x // Set SETLFS & SETNAM dex bpl !- jsr $ffc0 lda #$0f jsr $ffc3 rts SetParameters: .byte $01 // Length of Filename .byte $0f // Logical File Number .byte $6f // Channel .byte $08 // Device .word FormatName FormatName: .text "I" //--------------------------------------------------------------------- // Save memory to a file // // A = File Number/Pointer SaveFile: asl // A = File Pointer x 2 tax // X = File Pointer x 2 lda $01 pha // Preserve Memory Configuration lda #$36 sta $01 // BANK KERNAL+IO+RAM lda $d015 pha lda #$00 sta $d015 lda FileLocationRAM_End,x sta !SMC1++1 // File Save Memory Stop LoByte lda FileLocationRAM_End+1,x sta !SMC2++1 // File Save Memory Stop HiByte lda FileLocationRAM_Start,x sta ZP_Vector1Lo // File Save Memory Start LoByte lda FileLocationRAM_Start+1,x sta ZP_Vector1Hi // File Save Memory Start HiByte ldy FileNameList+1,x // Pointer to Filename LoByte lda FileNameList,x // Pointer to Filename HiByte tax lda #$03 // All filenames are 3 characters long jsr $ffbd // SETNAM lda #$00 tay ldx #$08 // Device Number jsr $ffba // SETLFS !SMC1: ldx #$00 !SMC2: ldy #$00 lda #ZP_Vector1 // Start Address (ZP_Vector1) jsr $ffd8 // SAVE pla sta $d015 pla sta $01 rts FileLocationRAM_Start: .word $c000, $c000, $c000, $c000, $c000, $c000, $c000, $c000 .word $c000, $c000, $c000, $c000, $c000, $c000, $c000, $c000 .word $c000, $c000, $c000, $c000, $c000, $c000, $c000, $c000 .word $c000, $c000, $c000, $c000, $c000, $c000, $c000, $c000 .word $c000, $c000, $c000, $c000, $c000, $c000, $c000 FileLocationRAM_End: .word $c080, $c080, $c080, $c080, $c080, $c080, $c080, $c080 .word $c080, $c080, $c080, $c080, $c080, $c080, $c080, $c080 .word $c080, $c080, $c080, $c080, $c080, $c080, $c080, $c080 .word $c080, $c080, $c080, $c080, $c080, $c080, $c080, $c080 .word $c080, $d000, $c7b0, $c7b0, $c7b0, $c7b0, $c7b0 FileNameList: .word FileName00, FileName01, FileName02, FileName03, FileName04, FileName05, FileName06, FileName07 .word FileName08, FileName09, FileName0a, FileName0b, FileName0c, FileName0d, FileName0e, FileName0f .word FileName10, FileName11, FileName12, FileName13, FileName14, FileName15, FileName16, FileName17 .word FileName18, FileName19, FileName1a, FileName1b, FileName1c, FileName1d, FileName1e, FileName1f .word FileName20, FileName21, FileName22, FileName23, FileName24, FileName25, FileName26 FileName00: .text "T00" FileName01: .text "W00" FileName02: .text "W01" FileName03: .text "W02" FileName04: .text "W03" FileName05: .text "W04" FileName06: .text "W05" FileName07: .text "W06" FileName08: .text "W07" FileName09: .text "W08" FileName0a: .text "W09" FileName0b: .text "W0A" FileName0c: .text "W0B" FileName0d: .text "W0C" FileName0e: .text "W0D" FileName0f: .text "W0E" FileName10: .text "W0F" FileName11: .text "W80" FileName12: .text "W81" FileName13: .text "W82" FileName14: .text "W83" FileName15: .text "W84" FileName16: .text "W85" FileName17: .text "W86" FileName18: .text "W87" FileName19: .text "W88" FileName1a: .text "W89" FileName1b: .text "W8A" FileName1c: .text "W8B" FileName1d: .text "W8C" FileName1e: .text "W8D" FileName1f: .text "W8E" FileName20: .text "W8F" FileName21: .text "WFF" FileName22: .text "R00" FileName23: .text "R01" FileName24: .text "R02" FileName25: .text "R03" FileName26: .text "R04"