mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-09-12 18:54:27 +00:00
git-svn-id: http://svn.code.sf.net/p/netboot65/code@120 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
parent
bc39ae74d9
commit
33689df9d3
@ -42,11 +42,11 @@ cfg_init:
|
|||||||
|
|
||||||
.segment "IP65_DEFAULTS"
|
.segment "IP65_DEFAULTS"
|
||||||
cfg_mac_default: .byte $00, $80, $10, $6d, $76, $30 ;mac address to be assigned to local machine
|
cfg_mac_default: .byte $00, $80, $10, $6d, $76, $30 ;mac address to be assigned to local machine
|
||||||
cfg_ip_default: .byte 192, 168, 1, 64 ;ip address of local machine (will be overwritten if dhcp_init is called)
|
;cfg_ip_default: .byte 192, 168, 1, 64 ;ip address of local machine (will be overwritten if dhcp_init is called)
|
||||||
;cfg_ip_default: .byte 0,0,0,0 ;ip address of local machine (will be overwritten if dhcp_init is called)
|
cfg_ip_default: .byte 0,0,0,0 ;ip address of local machine (will be overwritten if dhcp_init is called)
|
||||||
cfg_netmask_default: .byte 255, 255, 255, 0; netmask of local network (will be overwritten if dhcp_init is called)
|
cfg_netmask_default: .byte 255, 255, 255, 0; netmask of local network (will be overwritten if dhcp_init is called)
|
||||||
;cfg_gateway_default: .byte 0, 0, 0, 0 ;ip address of router on local network (will be overwritten if dhcp_init is called)
|
cfg_gateway_default: .byte 0, 0, 0, 0 ;ip address of router on local network (will be overwritten if dhcp_init is called)
|
||||||
cfg_gateway_default: .byte 192, 168, 1, 1 ;ip address of router on local network (will be overwritten if dhcp_init is called)
|
;cfg_gateway_default: .byte 192, 168, 1, 1 ;ip address of router on local network (will be overwritten if dhcp_init is called)
|
||||||
cfg_dns_default: .byte 0, 0, 0, 0; ip address of dns server to use (will be overwritten if dhcp_init is called)
|
cfg_dns_default: .byte 0, 0, 0, 0; ip address of dns server to use (will be overwritten if dhcp_init is called)
|
||||||
dhcp_server_default: .res 4 ;will be set address of dhcp server that configuration was obtained from
|
dhcp_server_default: .res 4 ;will be set address of dhcp server that configuration was obtained from
|
||||||
cfg_tftp_server_default: .byte $ff,$ff,$ff,$ff ; ip address of server to send tftp requests to (can be a broadcast address)
|
cfg_tftp_server_default: .byte $ff,$ff,$ff,$ff ; ip address of server to send tftp requests to (can be a broadcast address)
|
||||||
|
@ -111,10 +111,6 @@ nb65_dispatcher:
|
|||||||
bne irq_handler_installed
|
bne irq_handler_installed
|
||||||
jsr ip65_init
|
jsr ip65_init
|
||||||
bcs init_failed
|
bcs init_failed
|
||||||
jsr dhcp_init
|
|
||||||
bcc dhcp_ok
|
|
||||||
jmp ip65_init ;if DHCP failed, then reinite the IP stack (which will reset IP address etc to cartridge default values)
|
|
||||||
dhcp_ok:
|
|
||||||
;install our IRQ handler
|
;install our IRQ handler
|
||||||
ldax $314 ;previous IRQ handler
|
ldax $314 ;previous IRQ handler
|
||||||
stax jmp_old_irq+1
|
stax jmp_old_irq+1
|
||||||
@ -123,6 +119,10 @@ dhcp_ok:
|
|||||||
stax $314 ;previous IRQ handler
|
stax $314 ;previous IRQ handler
|
||||||
sta irq_handler_installed_flag
|
sta irq_handler_installed_flag
|
||||||
cli
|
cli
|
||||||
|
jsr dhcp_init
|
||||||
|
bcc dhcp_ok
|
||||||
|
jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc to cartridge default values)
|
||||||
|
dhcp_ok:
|
||||||
irq_handler_installed:
|
irq_handler_installed:
|
||||||
clc
|
clc
|
||||||
init_failed:
|
init_failed:
|
||||||
@ -138,6 +138,7 @@ init_failed:
|
|||||||
|
|
||||||
cpy #NB65_DNS_RESOLVE
|
cpy #NB65_DNS_RESOLVE
|
||||||
bne :+
|
bne :+
|
||||||
|
phax
|
||||||
ldy #NB65_DNS_HOSTNAME+1
|
ldy #NB65_DNS_HOSTNAME+1
|
||||||
lda (nb65_params),y
|
lda (nb65_params),y
|
||||||
tax
|
tax
|
||||||
@ -150,13 +151,17 @@ init_failed:
|
|||||||
|
|
||||||
ldy #NB65_DNS_HOSTNAME_IP
|
ldy #NB65_DNS_HOSTNAME_IP
|
||||||
ldx #4
|
ldx #4
|
||||||
|
plax
|
||||||
|
stax nb65_params
|
||||||
@copy_dns_ip:
|
@copy_dns_ip:
|
||||||
lda dns_ip,y
|
lda dns_ip,y
|
||||||
sta (nb65_params),y
|
sta (nb65_params),y
|
||||||
iny
|
iny
|
||||||
dex
|
dex
|
||||||
bne @copy_dns_ip
|
bne @copy_dns_ip
|
||||||
|
rts
|
||||||
@dns_error:
|
@dns_error:
|
||||||
|
plax
|
||||||
rts
|
rts
|
||||||
|
|
||||||
:
|
:
|
||||||
@ -300,7 +305,6 @@ init_failed:
|
|||||||
iny
|
iny
|
||||||
lda tftp_filesize+1
|
lda tftp_filesize+1
|
||||||
sta (nb65_params),y
|
sta (nb65_params),y
|
||||||
.byte $92
|
|
||||||
clc
|
clc
|
||||||
@tftp_error:
|
@tftp_error:
|
||||||
rts
|
rts
|
||||||
|
@ -341,7 +341,6 @@ send_tftp_packet: ;TFTP block should be created in tftp_outp, we just add the UD
|
|||||||
stax udp_send_len
|
stax udp_send_len
|
||||||
|
|
||||||
ldax #tftp_outp
|
ldax #tftp_outp
|
||||||
; .byte $92
|
|
||||||
jsr udp_send
|
jsr udp_send
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -454,7 +453,7 @@ tftp_in:
|
|||||||
lda udp_inp+5
|
lda udp_inp+5
|
||||||
cmp #$0c
|
cmp #$0c
|
||||||
bne @last_block
|
bne @last_block
|
||||||
|
beq @not_last_block
|
||||||
@not_data_block:
|
@not_data_block:
|
||||||
cmp #4 ;ACK is opcode 4
|
cmp #4 ;ACK is opcode 4
|
||||||
beq :+
|
beq :+
|
||||||
@ -487,11 +486,21 @@ tftp_in:
|
|||||||
lda tftp_data_block_length+1 ;get length of data we just sent (high byte)
|
lda tftp_data_block_length+1 ;get length of data we just sent (high byte)
|
||||||
cmp #2
|
cmp #2
|
||||||
bne @last_block
|
bne @last_block
|
||||||
|
@not_last_block:
|
||||||
|
inc tftp_filesize+1 ;add $200 to file size
|
||||||
|
inc tftp_filesize+1 ;add $200 to file size
|
||||||
|
|
||||||
@not_ack:
|
@not_ack:
|
||||||
@not_expected_block_number:
|
@not_expected_block_number:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@last_block:
|
@last_block:
|
||||||
|
lda tftp_data_block_length
|
||||||
|
sta tftp_filesize; this must be the first block that is not a multiple of 512, hence till now the low byte in tftp_filesize is still $00
|
||||||
|
lda tftp_data_block_length+1 ;this can only be 0 or 1
|
||||||
|
beq :+
|
||||||
|
inc tftp_filesize+1
|
||||||
|
:
|
||||||
lda #tftp_complete
|
lda #tftp_complete
|
||||||
sta tftp_state
|
sta tftp_state
|
||||||
rts
|
rts
|
||||||
|
Loading…
Reference in New Issue
Block a user