mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-10-14 05:24:07 +00:00
git-svn-id: http://svn.code.sf.net/p/netboot65/code@202 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
parent
8ef5101463
commit
9e55191aa6
@ -11,7 +11,7 @@
|
|||||||
errors: .res 1
|
errors: .res 1
|
||||||
sectors_in_track: .res 1
|
sectors_in_track: .res 1
|
||||||
sector_buffer_address: .res 2
|
sector_buffer_address: .res 2
|
||||||
|
output_buffer_address: .res 2
|
||||||
;the io_* and tftp_* routines both use the 'output_buffer' so we lose the data in the second sector
|
;the io_* and tftp_* routines both use the 'output_buffer' so we lose the data in the second sector
|
||||||
;therefore we need to copy the data to here before we use it
|
;therefore we need to copy the data to here before we use it
|
||||||
sector_buffer: .res 512
|
sector_buffer: .res 512
|
||||||
@ -67,23 +67,34 @@ upload_d64:
|
|||||||
kippercall #KPR_TFTP_CALLBACK_UPLOAD
|
kippercall #KPR_TFTP_CALLBACK_UPLOAD
|
||||||
jmp after_tftp_transfer
|
jmp after_tftp_transfer
|
||||||
|
|
||||||
|
copy_sector_buffer_to_output_buffer:
|
||||||
|
ldax #sector_buffer
|
||||||
|
stax copy_src
|
||||||
|
ldax output_buffer_address
|
||||||
|
stax copy_dest
|
||||||
|
ldax #$200
|
||||||
|
jmp copymem
|
||||||
|
|
||||||
read_next_block:
|
read_next_block:
|
||||||
;tftp upload callback routine
|
;tftp upload callback routine
|
||||||
;AX will point to address to fill
|
;AX will point to address to fill
|
||||||
|
stax output_buffer_address
|
||||||
|
ldax #sector_buffer
|
||||||
stax sector_buffer_address
|
stax sector_buffer_address
|
||||||
|
|
||||||
lda track
|
lda track
|
||||||
cmp #36
|
cmp #36
|
||||||
beq @past_last_track
|
beq @past_last_track
|
||||||
jsr read_sector
|
jsr read_sector
|
||||||
jsr move_to_next_sector
|
|
||||||
bcc @not_last_sector
|
bcc @not_last_sector
|
||||||
|
jsr copy_sector_buffer_to_output_buffer
|
||||||
ldax #$100
|
ldax #$100
|
||||||
rts
|
rts
|
||||||
@not_last_sector:
|
@not_last_sector:
|
||||||
inc sector_buffer_address+1
|
inc sector_buffer_address+1
|
||||||
ldax sector_buffer_address
|
ldax sector_buffer_address
|
||||||
jsr read_sector
|
jsr read_sector
|
||||||
jsr move_to_next_sector
|
jsr copy_sector_buffer_to_output_buffer
|
||||||
ldax #$200
|
ldax #$200
|
||||||
rts
|
rts
|
||||||
@past_last_track:
|
@past_last_track:
|
||||||
|
@ -34,6 +34,7 @@ class Netboot65TFTPServer
|
|||||||
|
|
||||||
attr_reader :bootfile_dir,:port,:server_thread
|
attr_reader :bootfile_dir,:port,:server_thread
|
||||||
def initialize(bootfile_dir,port=69)
|
def initialize(bootfile_dir,port=69)
|
||||||
|
@bootfile_dir=bootfile_dir
|
||||||
@file_list=FileList.new(bootfile_dir)
|
@file_list=FileList.new(bootfile_dir)
|
||||||
@port=port
|
@port=port
|
||||||
@server_thread=nil
|
@server_thread=nil
|
||||||
@ -189,7 +190,7 @@ class Netboot65TFTPServer
|
|||||||
file_handle=File.open(full_filename,"wb")
|
file_handle=File.open(full_filename,"wb")
|
||||||
Thread.new {recv_data(client_ip,client_port,full_filename,file_handle)}
|
Thread.new {recv_data(client_ip,client_port,full_filename,file_handle)}
|
||||||
rescue Exception=>e
|
rescue Exception=>e
|
||||||
send_error(client_ip,client_port,2,"error writing to '#{filename}':#{e.to_s}")
|
send_error(client_ip,client_port,2,"error writing to '#{full_filename}': #{e.to_s}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
when 0x65 : #DIR REQUEST
|
when 0x65 : #DIR REQUEST
|
||||||
|
Loading…
Reference in New Issue
Block a user