git-svn-id: http://svn.code.sf.net/p/netboot65/code@110 93682198-c243-4bdb-bd91-e943c89aac3b

This commit is contained in:
jonnosan 2009-04-16 05:41:04 +00:00
parent 60a7676dea
commit c29d63971d

View File

@ -17,10 +17,10 @@
.export tftp_download .export tftp_download
.export tftp_directory_listing .export tftp_directory_listing
.export tftp_data_block_length .export tftp_data_block_length
.export tftp_set_download_callback .export tftp_set_callback_vector
.export tftp_data_block_length .export tftp_data_block_length
.export tftp_clear_callbacks .export tftp_clear_callbacks
.import output_buffer
.import ip65_process .import ip65_process
.import ip65_error .import ip65_error
@ -57,7 +57,7 @@ tftp_filename: .res 2 ;name of file to d/l or filemask to get directory listing
;packet offsets ;packet offsets
tftp_inp = udp_inp + udp_data tftp_inp = udp_inp + udp_data
tftp_outp: .res 128 tftp_outp = output_buffer
;= output_buffer ;= output_buffer
;everything after filename in a request at a relative address, not fixed, so don't bother defining offset constants ;everything after filename in a request at a relative address, not fixed, so don't bother defining offset constants
@ -383,7 +383,7 @@ tftp_in:
ldax #udp_inp+$0e ldax #udp_inp+$0e
@got_pointer_to_tftp_data: @got_pointer_to_tftp_data:
jsr tftp_download_callback jsr tftp_callback_vector
lda udp_inp+4 ;check the length of the UDP packet lda udp_inp+4 ;check the length of the UDP packet
cmp #02 cmp #02
@ -429,22 +429,24 @@ copy_tftp_block_to_ram:
; inputs: ; inputs:
; AX - address of routine to call for each packet. ; AX - address of routine to call for each packet.
; outputs: none ; outputs: none
tftp_set_download_callback: tftp_set_callback_vector:
stax tftp_download_callback+1 stax tftp_callback_vector+1
rts rts
;clear callback vectors, i.e. all future transfers read from/write to RAM ;clear callback vectors, i.e. all future transfers read from/write to RAM
;inputs: none ;inputs: none
;outputs: none ;outputs: none
tftp_clear_callbacks: tftp_clear_callbacks:
lda #0
sta tftp_callback_address_set
ldax #copy_tftp_block_to_ram ldax #copy_tftp_block_to_ram
jmp tftp_set_download_callback jmp tftp_set_callback_vector
.rodata .rodata
tftp_octet_mode: .asciiz "OCTET" tftp_octet_mode: .asciiz "OCTET"
.data .data
tftp_download_callback: tftp_callback_vector:
jmp copy_tftp_block_to_ram ;vector for action to take when a data block received (default is to store block in RAM) jmp copy_tftp_block_to_ram ;vector for action to take when a data block received (default is to store block in RAM)
tftp_callback_address_set: .byte 0 tftp_callback_address_set: .byte 0