; Function defined on pp272-273 of C64 Programmers Reference Guide ;; IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf ;; Definition of function from Compute's Mapping the 64 p231 ;; Expects that SETLFS and SETNAM are called before hand. ;; $YYXX = load address. ;; (ignored if SETLFS channel = 1, i.e., like ,8,1) ;; If A=1 then VERIFY instead of LOAD. ;; On exit, $YYXX is the highest address into which data ;; will have been placed. ;; Searching through Compute's Mapping the 64, we find the following ;; things are used: ;; $93 = kernal_load_or_verify_flag ;; $AC = current pointer for loading/verifying ;; $C1 = similar to the above. load: ;; Are we loading or verifying? sta kernal_load_or_verify_flag ;; Store start address of LOAD stx load_save_start_ptr+0 sty load_save_start_ptr+1 ;; We need our helpers to get to filenames under ROMs or IO area jsr install_ram_routines ;; Disable IRQs, since timing matters! SEI ;; Display SEARCHING FOR jsr printf .byte "SEARCHING FOR " ldy #0 print_filename_loop: cpy current_filename_length beq + lda (current_filename_ptr),y jsr $ffd2 iny jmp print_filename_loop * lda #$0d jsr $ffd2 ;; Begin sending under attention jsr iec_assert_atn ;; XXX - Use default device number ;; http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf ;; p13, 16. ;; also p16 tells us this routine doesn't mess with the file table in the C64, ;; only in the drive. ;; Begin sending under attention jsr iec_assert_atn ;; XXX - Use default device number ;; http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf ;; p13, 16. ;; also p16 tells us this routine doesn't mess with the file table in the C64, ;; only in the drive. ;; Call device to LISTEN (p16) lda #$28 jsr iec_tx_byte bcs load_error ;; Open channel #0 (p16) lda #$f0 jsr iec_tx_byte bcs load_error ;; (p16) jsr iec_release_atn ;; Send filename (p16) ldy #0 send_filename: cpy current_filename_length beq sent_filename ldx #