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

This commit is contained in:
jonnosan 2009-04-05 02:47:08 +00:00
parent 141f82e863
commit 96886b84f6
2 changed files with 26 additions and 4 deletions

View File

@ -43,7 +43,7 @@
; dns packet offsets
dns_inp = udp_inp + udp_data
dns_outp: .res 256
dns_outp: .res 220
dns_id = 0
dns_flags=2
dns_qdcount=4

View File

@ -7,6 +7,9 @@
.bss
nb65_param_buffer: .res $10
.zeropage
buffer_ptr: .res 2
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
.word basicstub ; load address
@ -47,6 +50,8 @@ init:
jsr print_ip_config
jmp callback_test
ldax #hostname_1
jsr do_dns_query
@ -67,12 +72,14 @@ init:
callback_test:
ldax #64
stax nb65_param_buffer+NB65_UDP_LISTENER_PORT
ldax #udp_callback
stax nb65_param_buffer+NB65_UDP_LISTENER_CALLBACK
ldax #nb65_param_buffer
ldy #NB65_UDP_ADD_LISTENER
jsr NB65_DISPATCH_VECTOR
bcc :+
@ -80,6 +87,9 @@ init:
jsr print_errorcode
jmp bad_boot
:
ldax #listening
jsr print
@loop_forever:
jsr NB65_PERIODIC_PROCESSING_VECTOR
jmp @loop_forever
@ -87,8 +97,14 @@ init:
jmp $a7ae ;exit to basic
udp_callback:
lda #'*'
jmp print_a
ldax #recv_from
jsr print
ldy #NB65_GET_INPUT_PACKET_PTR
jsr NB65_DISPATCH_VECTOR
stax buffer_ptr
rts
do_dns_query: ;AX points at the hostname on entry
stax nb65_param_buffer+NB65_DNS_HOSTNAME
@ -162,6 +178,12 @@ hostname_6:
.endrepeat
.byte 0 ;this should generate an error as it is too long
recv_from:
.asciiz "RECEIVED FROM: "
listening:
.byte "LISTENING.",13,0
error_code:
.asciiz "ERROR CODE: "
press_a_key_to_continue: