mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-09-12 02:54:54 +00:00
resurrect sntp
git-svn-id: http://svn.code.sf.net/p/netboot65/code@325 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
parent
ea18bde291
commit
9821cf7e95
@ -119,8 +119,9 @@ are also set to indicate current connection state and error conditions (if any).
|
|||||||
<td>none</td>
|
<td>none</td>
|
||||||
<td>POLL</td>
|
<td>POLL</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
<td>TCPSEND</td>
|
<td>TCPSEND</td>
|
||||||
<td>Send a string (up to 255 bytes) over a previously opened connection.Integer variables CO% and ER% ae aset to indicate current connection state and any error condition which may occur during the sending of the file. <i>NB - in the current implementation of Kipper BASIC, it is possible for data to arrive during a call to TCPSEND, which may not be passed through to the BASIC program.</i></td>
|
<td>Send a string (up to 255 bytes) over a previously opened connection.Integer variables CO% and ER% are set to indicate current connection state and any error condition which may occur during the sending of the file. <i>NB - in the current implementation of Kipper BASIC, it is possible for data to arrive during a call to TCPSEND, which may not be passed through to the BASIC program.</i></td>
|
||||||
<td><li>data (string)</td>
|
<td><li>data (string)</td>
|
||||||
<td><li>TCPSEND"HELLO "+"WORLD"</td>
|
<td><li>TCPSEND"HELLO "+"WORLD"</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -129,7 +130,17 @@ are also set to indicate current connection state and error conditions (if any).
|
|||||||
<td>Send a file (of any length) over a previously opened connection. The file will be looked for on the current 'default' device, i.e. which ever drive was last accessed. Integer variables CO% and ER% ae aset to indicate current connection state and any error condition which may occur during the sending of the file. <i>NB - in the current implementation of Kipper BASIC, it is possible for data to arrive during a call to TCPSEND, which may not be passed through to the BASIC program.</i></td>
|
<td>Send a file (of any length) over a previously opened connection. The file will be looked for on the current 'default' device, i.e. which ever drive was last accessed. Integer variables CO% and ER% ae aset to indicate current connection state and any error condition which may occur during the sending of the file. <i>NB - in the current implementation of Kipper BASIC, it is possible for data to arrive during a call to TCPSEND, which may not be passed through to the BASIC program.</i></td>
|
||||||
<td><li>filename (string)</td>
|
<td><li>filename (string)</td>
|
||||||
<td><li>TCPBLAT"GOPHERMAP.TXT"</td>
|
<td><li>TCPBLAT"GOPHERMAP.TXT"</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>UDPSEND</td>
|
||||||
|
<td>Send a string (up to 255 bytes) over UDP . There is no need to connect first </i></td>
|
||||||
|
<td>
|
||||||
|
<li>destination hostname or IP address (string)
|
||||||
|
<li>destination port number (1..65535)
|
||||||
|
<li>local port number (1..65535)
|
||||||
|
<li>data (string)
|
||||||
|
</td>
|
||||||
|
<td><li>UDPSEND"JAMTRONIX.COM",7,6464,"echo test"</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
@ -32,18 +32,11 @@ kipperbasv20.prg: kipperbasv20.o $(IP65LIB) $(VIC20RRNETLIB) $(INCFILES) ../cfg/
|
|||||||
|
|
||||||
|
|
||||||
bails.d64: bails.prg
|
bails.d64: bails.prg
|
||||||
# ripxplore.rb -r -e kbload $@ -o kbload
|
c1541 -format bails,bb d64 $@ -attach $@ -write bails.prg
|
||||||
# ripxplore.rb -r -e kbapp $@ -o kbapp
|
|
||||||
# ripxplore.rb $@ -I CbmDos -a kipperbas.prg
|
|
||||||
ripxplore.rb $@ -a bails.prg
|
|
||||||
|
|
||||||
kipperbas.d64: kipperbas.prg chat
|
kipperbas.d64: kipperbas.prg
|
||||||
# ripxplore.rb -r -e kbload $@ -o kbload
|
c1541 -format kipperbas,kb d64 $@ -attach $@ -write kipperbas.prg
|
||||||
# ripxplore.rb -r -e kbapp $@ -o kbapp
|
|
||||||
ripxplore.rb $@ -I CbmDos -a kipperbas.prg
|
|
||||||
# ripxplore.rb $@ -a kipperbas.prg
|
|
||||||
cp chat autoexec.bas
|
|
||||||
ripxplore.rb $@ -a autoexec.bas -t C64Prg
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *.bin *.map *.prg
|
rm -f *.o *.bin *.map *.prg
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -92,6 +92,14 @@ crunched_line = $0200 ;Input buffer
|
|||||||
.import timer_read
|
.import timer_read
|
||||||
.import native_to_ascii
|
.import native_to_ascii
|
||||||
.import ascii_to_native
|
.import ascii_to_native
|
||||||
|
.import udp_send_dest
|
||||||
|
.import udp_send_dest_port
|
||||||
|
.import udp_send_src_port
|
||||||
|
.import udp_send_len
|
||||||
|
.import udp_send
|
||||||
|
.import udp_add_listener
|
||||||
|
.import udp_remove_listener
|
||||||
|
.import udp_callback
|
||||||
.zeropage
|
.zeropage
|
||||||
temp: .res 2
|
temp: .res 2
|
||||||
temp2: .res 2
|
temp2: .res 2
|
||||||
@ -1335,12 +1343,16 @@ tcpconnect_callback:
|
|||||||
sta connection_state
|
sta connection_state
|
||||||
rts
|
rts
|
||||||
@not_end_packet:
|
@not_end_packet:
|
||||||
|
|
||||||
|
stax inbound_data_length
|
||||||
|
set_packet_vars:
|
||||||
|
|
||||||
jsr copymem
|
jsr copymem
|
||||||
ldx tcp_inbound_data_length+1
|
ldx inbound_data_length+1
|
||||||
beq @short_packet
|
beq @short_packet
|
||||||
lda #$ff
|
lda #$ff
|
||||||
@short_packet:
|
@short_packet:
|
||||||
lda tcp_inbound_data_length
|
lda inbound_data_length
|
||||||
set_input_string:
|
set_input_string:
|
||||||
pha
|
pha
|
||||||
lda #'I'
|
lda #'I'
|
||||||
@ -1374,10 +1386,10 @@ set_input_string:
|
|||||||
lda #'I'+$80
|
lda #'I'+$80
|
||||||
ldx #'L'+$80
|
ldx #'L'+$80
|
||||||
jsr find_var
|
jsr find_var
|
||||||
lda tcp_inbound_data_length+1
|
lda inbound_data_length+1
|
||||||
sta (VARPNT),y
|
sta (VARPNT),y
|
||||||
iny
|
iny
|
||||||
lda tcp_inbound_data_length
|
lda inbound_data_length
|
||||||
sta (VARPNT),y
|
sta (VARPNT),y
|
||||||
|
|
||||||
rts
|
rts
|
||||||
@ -1461,6 +1473,7 @@ tcpblat_keyword:
|
|||||||
@eof:
|
@eof:
|
||||||
and #$40 ; end of file?
|
and #$40 ; end of file?
|
||||||
beq @readerror
|
beq @readerror
|
||||||
|
beq @readerror
|
||||||
lda #$00
|
lda #$00
|
||||||
sty tcp_send_data_len
|
sty tcp_send_data_len
|
||||||
sta tcp_send_data_len+1
|
sta tcp_send_data_len+1
|
||||||
@ -1486,6 +1499,53 @@ tcpblat_keyword:
|
|||||||
lda #KPR_ERROR_FILE_ACCESS_FAILURE
|
lda #KPR_ERROR_FILE_ACCESS_FAILURE
|
||||||
jmp @store_error
|
jmp @store_error
|
||||||
|
|
||||||
|
;send udp packet
|
||||||
|
|
||||||
|
udpsend_keyword:
|
||||||
|
ldax #udp_send_dest
|
||||||
|
jsr get_ip_parameter
|
||||||
|
bcc @no_error
|
||||||
|
rts
|
||||||
|
@no_error:
|
||||||
|
jsr skip_comma_get_integer
|
||||||
|
stax udp_send_dest_port
|
||||||
|
|
||||||
|
jsr skip_comma_get_integer
|
||||||
|
stax udp_send_src_port
|
||||||
|
jsr CHRGOT
|
||||||
|
jsr CHKCOM ;make sure next char is a comma (and skip it)
|
||||||
|
jsr extract_string
|
||||||
|
inc $d020
|
||||||
|
|
||||||
|
ldy param_length
|
||||||
|
sty udp_send_len
|
||||||
|
ldy #0
|
||||||
|
sty udp_send_len+1
|
||||||
|
ldax #transfer_buffer
|
||||||
|
jsr udp_send
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta ip65_error
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
udplisten_keyword:
|
||||||
|
ldax #udp_handler
|
||||||
|
stax udp_callback
|
||||||
|
jsr get_integer ;port number
|
||||||
|
stax port
|
||||||
|
jsr udp_remove_listener
|
||||||
|
ldax port
|
||||||
|
jsr udp_add_listener
|
||||||
|
bcc @ok
|
||||||
|
ldax #too_many_listeners
|
||||||
|
jmp print_error
|
||||||
|
@ok:
|
||||||
|
rts
|
||||||
|
|
||||||
|
udp_handler:
|
||||||
|
inc $d020
|
||||||
|
rts
|
||||||
evaluate:
|
evaluate:
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
@ -1557,6 +1617,8 @@ dhcp_server_msg:
|
|||||||
tftp_server_msg:
|
tftp_server_msg:
|
||||||
.byte "TFTP SERVER : ", 0
|
.byte "TFTP SERVER : ", 0
|
||||||
|
|
||||||
|
too_many_listeners:
|
||||||
|
.byte "TOO MANY LISTENERS",0
|
||||||
address_resolution:
|
address_resolution:
|
||||||
.byte "ADDRESS RESOLUTION",0
|
.byte "ADDRESS RESOLUTION",0
|
||||||
|
|
||||||
@ -1604,8 +1666,10 @@ keywords:
|
|||||||
.byte "TCP",$A0,$F0 ;TCPLOSE - BASIC will replace CLOSE with $A0
|
.byte "TCP",$A0,$F0 ;TCPLOSE - BASIC will replace CLOSE with $A0
|
||||||
.byte "TCPBLAT",$F1
|
.byte "TCPBLAT",$F1
|
||||||
.byte "MAC",$F2
|
.byte "MAC",$F2
|
||||||
.byte $00 ;end of list
|
.byte "UDPS",$80,$F3 ;UDPSEND - BASIC will replace END with $80
|
||||||
HITOKEN=$F3
|
.byte "UDP",$9B,"EN",$F4 ;UDPLISTEN - BASIC will replace LIST with $9b
|
||||||
|
.byte $00 ;end of list
|
||||||
|
HITOKEN=$F5
|
||||||
|
|
||||||
;
|
;
|
||||||
; Table of token locations-1
|
; Table of token locations-1
|
||||||
@ -1630,6 +1694,8 @@ EF: .word tcpsend_keyword-1
|
|||||||
FO: .word tcpclose_keyword-1
|
FO: .word tcpclose_keyword-1
|
||||||
F1: .word tcpblat_keyword-1
|
F1: .word tcpblat_keyword-1
|
||||||
F2: .word mac_keyword-1
|
F2: .word mac_keyword-1
|
||||||
|
F3: .word udpsend_keyword-1
|
||||||
|
F4: .word udplisten_keyword-1
|
||||||
|
|
||||||
.segment "SELF_MODIFIED_CODE"
|
.segment "SELF_MODIFIED_CODE"
|
||||||
|
|
||||||
@ -1669,3 +1735,5 @@ connection_state: .res 1
|
|||||||
netcat_timeout: .res 1
|
netcat_timeout: .res 1
|
||||||
buffer_length: .res 2
|
buffer_length: .res 2
|
||||||
cursor_state: .res 1
|
cursor_state: .res 1
|
||||||
|
port: .res 2
|
||||||
|
inbound_data_length: .res 2
|
1
client/basic/timestamp.rb
Normal file
1
client/basic/timestamp.rb
Normal file
@ -0,0 +1 @@
|
|||||||
|
puts Time.now.strftime(".byte \" (%Y-%m-%d)\"")
|
@ -103,9 +103,7 @@ kipperkart_rr.bin: kipperkart.bin
|
|||||||
ruby fix_cart.rb $@ 32768
|
ruby fix_cart.rb $@ 32768
|
||||||
|
|
||||||
kipperdisk.d64: kipperkart.prg kipperterm.prg kipperkart.prg kippergo.prg
|
kipperdisk.d64: kipperkart.prg kipperterm.prg kipperkart.prg kippergo.prg
|
||||||
ripxplore.rb --init CbmDos $@ -a kipperkart.prg
|
c1541 -format kipperdisk,kd d64 $@ -attach $@ -write kipperkart.prg -write kipperterm.prg -write kippergo.prg
|
||||||
ripxplore.rb $@ -a kipperterm.prg
|
|
||||||
ripxplore.rb $@ -a kippergo.prg
|
|
||||||
cp $@ ../../server/boot/
|
cp $@ ../../server/boot/
|
||||||
|
|
||||||
bobcart.bin: bobcart.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg
|
bobcart.bin: bobcart.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg
|
||||||
@ -132,7 +130,7 @@ telnetd.prg: telnetd.bin cartheader.prg
|
|||||||
|
|
||||||
d64_upload.d64: d64_upload.prg
|
d64_upload.d64: d64_upload.prg
|
||||||
cp d64_upload.prg ../../server/boot/
|
cp d64_upload.prg ../../server/boot/
|
||||||
ripxplore.rb --init CbmDos $@ -a d64_upload.prg
|
c1541 -format d64upload,kd d64 $@ -attach $@ -write d64_upload.prg
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *.bin *.map *.prg *.pg2 *.dsk *.d64
|
rm -f *.o *.bin *.map *.prg *.pg2 *.dsk *.d64
|
||||||
|
@ -62,13 +62,14 @@ end
|
|||||||
end
|
end
|
||||||
option_offset=start_of_kipper_cart_image+offsets[0]-7
|
option_offset=start_of_kipper_cart_image+offsets[0]-7
|
||||||
option_length=offsets[1]
|
option_length=offsets[1]
|
||||||
|
|
||||||
if option_length==6 then
|
if option_length==6 then
|
||||||
if value.downcase=="auto" then
|
if value.downcase=="auto" then
|
||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
digest = Digest::MD5.digest(Time.now.to_s)
|
digest = Digest::MD5.digest(Time.now.to_s).bytes.to_a
|
||||||
mac=[0x00,0x80,0x10,digest[0],digest[1],Kernel.rand(255)]
|
mac=[0x00,0x80,0x10,digest[0],digest[1],Kernel.rand(255)]
|
||||||
else
|
else
|
||||||
|
|
||||||
split_values=value.split(":")
|
split_values=value.split(":")
|
||||||
if (split_values.length!=6) || (split_values[5].nil?) then
|
if (split_values.length!=6) || (split_values[5].nil?) then
|
||||||
puts "'#{value}' is not a valid MAC address. (e.g. 12:34:56:78:ab:cd)"
|
puts "'#{value}' is not a valid MAC address. (e.g. 12:34:56:78:ab:cd)"
|
||||||
|
@ -56,16 +56,12 @@ upnatom.prg: upnatom.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.c
|
|||||||
|
|
||||||
upnatom.d64: upnatom.prg url.cfg
|
upnatom.d64: upnatom.prg url.cfg
|
||||||
cp upnatom.prg autoexec.prg
|
cp upnatom.prg autoexec.prg
|
||||||
ripxplore.rb --init CbmDos upnatom.d64 -a autoexec.prg
|
c1541 -format upnatom,up d64 $@ -attach $@ -write ../carts/kipperkart.prg "kipperkart.prg" -write autoexec.prg -write "url.cfg" "url.cfg,s"
|
||||||
ripxplore.rb upnatom.d64 -a url.cfg -t C64Seq
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
webnoter.d64: webnoter.prg
|
webnoter.d64: webnoter.prg
|
||||||
cp webnoter.prg autoexec.prg
|
cp webnoter.prg autoexec.prg
|
||||||
ripxplore.rb --init CbmDos webnoter.d64 -a ../carts/kipperkart.prg
|
c1541 -format webnoter,wn d64 $@ -attach $@ -write ../carts/kipperkart.prg "kipperkart.prg" -write autoexec.prg
|
||||||
ripxplore.rb webnoter.d64 -a autoexec.prg
|
|
||||||
|
|
||||||
|
|
||||||
httpd.prg: httpd.asm
|
httpd.prg: httpd.asm
|
||||||
$(DA) httpd.asm -ohttpd.prg
|
$(DA) httpd.asm -ohttpd.prg
|
||||||
@ -74,9 +70,8 @@ httpd.prg: httpd.asm
|
|||||||
|
|
||||||
%.d64: %.prg
|
%.d64: %.prg
|
||||||
cp $*.prg autoexec.prg
|
cp $*.prg autoexec.prg
|
||||||
ripxplore.rb --init CbmDos $*.d64 -a autoexec.prg
|
c1541 -format kipper,kp d64 $@ -attach $@ -write autoexec.prg
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *.pg2 *.prg *.map upnatom.d64
|
rm -f *.o *.pg2 *.prg *.map upnatom.d64
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
.byte "1.0.39"
|
.byte "1.0.41"
|
||||||
|
@ -38,6 +38,7 @@ ETHOBJS= \
|
|||||||
url.o \
|
url.o \
|
||||||
arithmetic.o\
|
arithmetic.o\
|
||||||
ip.o \
|
ip.o \
|
||||||
|
sntp.o \
|
||||||
icmp.o \
|
icmp.o \
|
||||||
cifs.o \
|
cifs.o \
|
||||||
udp.o
|
udp.o
|
||||||
|
213
client/ip65/sntp.s
Normal file
213
client/ip65/sntp.s
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
; Simple Network Time Protocol implementation - per RFC 2030
|
||||||
|
|
||||||
|
MAX_SNTP_MESSAGES_SENT=8
|
||||||
|
.include "../inc/common.i"
|
||||||
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
.define EQU =
|
||||||
|
.include "../inc/kipper_constants.i"
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.export sntp_ip
|
||||||
|
.export sntp_utc_timestamp
|
||||||
|
.export sntp_get_time
|
||||||
|
|
||||||
|
.import ip65_process
|
||||||
|
.import ip65_error
|
||||||
|
|
||||||
|
|
||||||
|
.import udp_add_listener
|
||||||
|
.import udp_remove_listener
|
||||||
|
|
||||||
|
.import udp_callback
|
||||||
|
.import udp_send
|
||||||
|
|
||||||
|
.import udp_inp
|
||||||
|
.import output_buffer
|
||||||
|
.importzp udp_data
|
||||||
|
|
||||||
|
.import udp_send_dest
|
||||||
|
.import udp_send_src_port
|
||||||
|
.import udp_send_dest_port
|
||||||
|
.import udp_send_len
|
||||||
|
.import check_for_abort_key
|
||||||
|
.import timer_read
|
||||||
|
|
||||||
|
.segment "IP65ZP" : zeropage
|
||||||
|
|
||||||
|
|
||||||
|
.data
|
||||||
|
sntp_ip: .byte $ff,$ff,$ff,$ff ;can be set to ip address of server that will be queried via sntp (default is a local LAN broadcast)
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
; sntp packet offsets
|
||||||
|
sntp_inp = udp_inp + udp_data
|
||||||
|
|
||||||
|
sntp_server_port=123
|
||||||
|
sntp_client_port=123
|
||||||
|
|
||||||
|
sntp_utc_timestamp: .res 4 ; will be set to seconds (only) part of utc timestamp (seconds since 00:00 on Jan 1, 1900)
|
||||||
|
|
||||||
|
; sntp state machine
|
||||||
|
sntp_initializing = 1 ; initial state
|
||||||
|
sntp_query_sent = 2 ; sent a query, waiting for a response
|
||||||
|
sntp_completed = 3 ; got a good response
|
||||||
|
|
||||||
|
sntp_timer: .res 1
|
||||||
|
sntp_loop_count: .res 1
|
||||||
|
sntp_break_polling_loop: .res 1
|
||||||
|
|
||||||
|
sntp_state: .res 1
|
||||||
|
sntp_message_sent_count: .res 1
|
||||||
|
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
; query an sntp server for current UTC time
|
||||||
|
; inputs:
|
||||||
|
; sntp_ip must point to an SNTP server
|
||||||
|
; outputs:
|
||||||
|
; carry flag is set if there was an error, clear otherwise
|
||||||
|
; sntp_utc_timestamp: set to the number of seconds (seconds since 00:00 on Jan 1, 1900) - timezone is UTC
|
||||||
|
sntp_get_time:
|
||||||
|
ldax #sntp_in
|
||||||
|
stax udp_callback
|
||||||
|
ldax #sntp_client_port
|
||||||
|
jsr udp_add_listener
|
||||||
|
bcc :+
|
||||||
|
rts
|
||||||
|
:
|
||||||
|
|
||||||
|
lda #sntp_initializing
|
||||||
|
sta sntp_state
|
||||||
|
lda #0 ;reset the "message sent" counter
|
||||||
|
sta sntp_message_sent_count
|
||||||
|
jsr send_sntp_query
|
||||||
|
|
||||||
|
@sntp_polling_loop:
|
||||||
|
lda sntp_message_sent_count
|
||||||
|
adc #10
|
||||||
|
sta sntp_loop_count
|
||||||
|
@outer_delay_loop:
|
||||||
|
lda #0
|
||||||
|
sta sntp_break_polling_loop
|
||||||
|
jsr timer_read
|
||||||
|
stx sntp_timer ;we only care about the high byte
|
||||||
|
|
||||||
|
@inner_delay_loop:
|
||||||
|
jsr ip65_process
|
||||||
|
jsr check_for_abort_key
|
||||||
|
bcc @no_abort
|
||||||
|
lda #KPR_ERROR_ABORTED_BY_USER
|
||||||
|
sta ip65_error
|
||||||
|
rts
|
||||||
|
@no_abort:
|
||||||
|
|
||||||
|
lda sntp_state
|
||||||
|
cmp #sntp_completed
|
||||||
|
beq @complete
|
||||||
|
|
||||||
|
lda sntp_break_polling_loop
|
||||||
|
bne @break_polling_loop
|
||||||
|
jsr timer_read
|
||||||
|
cpx sntp_timer ;this will tick over after about 1/4 of a second
|
||||||
|
beq @inner_delay_loop
|
||||||
|
|
||||||
|
dec sntp_loop_count
|
||||||
|
bne @outer_delay_loop
|
||||||
|
|
||||||
|
@break_polling_loop:
|
||||||
|
jsr send_sntp_query
|
||||||
|
inc sntp_message_sent_count
|
||||||
|
lda sntp_message_sent_count
|
||||||
|
cmp #MAX_SNTP_MESSAGES_SENT-1
|
||||||
|
bpl @too_many_messages_sent
|
||||||
|
jmp @sntp_polling_loop
|
||||||
|
|
||||||
|
@complete:
|
||||||
|
|
||||||
|
ldax #sntp_client_port
|
||||||
|
jsr udp_remove_listener
|
||||||
|
rts
|
||||||
|
|
||||||
|
@too_many_messages_sent:
|
||||||
|
@failed:
|
||||||
|
ldax #sntp_client_port
|
||||||
|
jsr udp_remove_listener
|
||||||
|
lda #KPR_ERROR_TIMEOUT_ON_RECEIVE
|
||||||
|
sta ip65_error
|
||||||
|
sec ;signal an error
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
send_sntp_query:
|
||||||
|
|
||||||
|
;make a zero filled buffer
|
||||||
|
lda #$0
|
||||||
|
ldx #$30
|
||||||
|
stx udp_send_len
|
||||||
|
sta udp_send_len+1
|
||||||
|
:
|
||||||
|
sta output_buffer,x
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
;set the flags field
|
||||||
|
lda #$E3 ; flags - LI=11 (unknown), VN=100 (4), MODE=011 (client)
|
||||||
|
sta output_buffer
|
||||||
|
|
||||||
|
ldax #sntp_client_port
|
||||||
|
stax udp_send_src_port
|
||||||
|
ldax #sntp_server_port
|
||||||
|
stax udp_send_dest_port
|
||||||
|
ldx #3 ; set destination address
|
||||||
|
: lda sntp_ip,x
|
||||||
|
sta udp_send_dest,x
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
ldax #output_buffer
|
||||||
|
jsr udp_send
|
||||||
|
bcs @error_on_send
|
||||||
|
lda #sntp_query_sent
|
||||||
|
sta sntp_state
|
||||||
|
@error_on_send:
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
sntp_in:
|
||||||
|
|
||||||
|
ldx #3
|
||||||
|
ldy #0
|
||||||
|
:
|
||||||
|
lda sntp_inp+$28,x ;the 'transmit' timestamp (in big end order)
|
||||||
|
sta sntp_utc_timestamp,y
|
||||||
|
iny
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
inc sntp_break_polling_loop
|
||||||
|
lda #sntp_completed
|
||||||
|
sta sntp_state
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;-- LICENSE FOR sntp.s --
|
||||||
|
; The contents of this file are subject to the Mozilla Public License
|
||||||
|
; Version 1.1 (the "License"); you may not use this file except in
|
||||||
|
; compliance with the License. You may obtain a copy of the License at
|
||||||
|
; http://www.mozilla.org/MPL/
|
||||||
|
;
|
||||||
|
; Software distributed under the License is distributed on an "AS IS"
|
||||||
|
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||||
|
; License for the specific language governing rights and limitations
|
||||||
|
; under the License.
|
||||||
|
;
|
||||||
|
; The Original Code is ip65.
|
||||||
|
;
|
||||||
|
; The Initial Developer of the Original Code is Jonno Downes,
|
||||||
|
; jonno@jamtronix.com.
|
||||||
|
; Portions created by the Initial Developer are Copyright (C) 2009,2011
|
||||||
|
; Jonno Downes. All Rights Reserved.
|
||||||
|
; -- LICENSE END --
|
@ -38,15 +38,11 @@ kt2wiz.prg: kipperterm2.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c6
|
|||||||
|
|
||||||
|
|
||||||
kipperterm2.d64: kipperterm2.prg addresses.txt abe.bas
|
kipperterm2.d64: kipperterm2.prg addresses.txt abe.bas
|
||||||
ripxplore.rb --init CbmDos $@ -a kipperterm2.prg
|
c1541 -format kipperterm2,k2 d64 $@ -attach $@ -write kipperterm2.prg -write "addresses.txt " "addresses.txt,s" -write abe
|
||||||
ripxplore.rb $@ -a addresses.txt -t C64Seq
|
|
||||||
ripxplore.rb $@ -a abe -t C64Prg
|
|
||||||
cp kipperterm2.d64 ../../server/boot
|
cp kipperterm2.d64 ../../server/boot
|
||||||
|
|
||||||
kt2wiz.d64: kt2wiz.prg addresses.txt abe.bas
|
kt2wiz.d64: kt2wiz.prg addresses.txt abe.bas
|
||||||
ripxplore.rb --init CbmDos $@ -a kt2wiz.prg
|
c1541 -format kt2wiz,kw d64 $@ -attach $@ -write kt2wiz.prg -write "addresses.txt " "addresses.txt,s" -write abe
|
||||||
ripxplore.rb $@ -a addresses.txt -t C64Seq
|
|
||||||
ripxplore.rb $@ -a abe -t C64Prg
|
|
||||||
cp kt2wiz.d64 ../wiznet/
|
cp kt2wiz.d64 ../wiznet/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -1 +1 @@
|
|||||||
.byte "2011-06-10"
|
.byte "2012-01-08"
|
||||||
|
@ -33,7 +33,7 @@ all: \
|
|||||||
testtftp.pg2 \
|
testtftp.pg2 \
|
||||||
test_cart_api.prg \
|
test_cart_api.prg \
|
||||||
test_vt100.prg \
|
test_vt100.prg \
|
||||||
testdottedquad.pg2 \
|
test_sntp.prg \
|
||||||
testdottedquad.prg \
|
testdottedquad.prg \
|
||||||
test_tcp.prg \
|
test_tcp.prg \
|
||||||
test_xmodem.prg \
|
test_xmodem.prg \
|
||||||
@ -44,7 +44,8 @@ all: \
|
|||||||
test_get_url.prg \
|
test_get_url.prg \
|
||||||
test_wiznet.prg \
|
test_wiznet.prg \
|
||||||
test_parse_querystring.prg \
|
test_parse_querystring.prg \
|
||||||
test_lancegs.pg2 \
|
test_sntp.prg \
|
||||||
|
# test_lancegs.pg2 \
|
||||||
# test_xmodem.d64 \
|
# test_xmodem.d64 \
|
||||||
# httpd_test.d64 \
|
# httpd_test.d64 \
|
||||||
# ip65test.dsk \
|
# ip65test.dsk \
|
||||||
@ -71,7 +72,6 @@ test_tcp.prg: test_tcp.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.
|
|||||||
test_xmodem.o: test_xmodem.s ../ip65/xmodem.s
|
test_xmodem.o: test_xmodem.s ../ip65/xmodem.s
|
||||||
$(AS) $(AFLAGS) $<
|
$(AS) $(AFLAGS) $<
|
||||||
|
|
||||||
|
|
||||||
test_xmodem.prg: test_xmodem.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
test_xmodem.prg: test_xmodem.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
||||||
$(LD) -m test_xmodem.map -vm -C ../cfg/c64prg.cfg -o test_xmodem.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
|
$(LD) -m test_xmodem.map -vm -C ../cfg/c64prg.cfg -o test_xmodem.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
|
||||||
|
|
||||||
|
@ -68,10 +68,7 @@ wizbobcart.prg: wizbobcart.bin cartheader.prg
|
|||||||
cat cartheader.prg wizbobcart.bin > $@
|
cat cartheader.prg wizbobcart.bin > $@
|
||||||
|
|
||||||
wiztest.d64: wiztest.prg wizboot.prg wizflash.prg
|
wiztest.d64: wiztest.prg wizboot.prg wizflash.prg
|
||||||
ripxplore.rb -I CbmDos $@
|
c1541 -format wiztest,wt d64 $@ -attach $@ -write wizboot.prg -write wiztest.prg -write wizflash.prg
|
||||||
ripxplore.rb -a wizboot.prg $@
|
|
||||||
ripxplore.rb -a wiztest.prg $@
|
|
||||||
ripxplore.rb -a wizflash.prg $@
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *.bin *.map *.prg *.pg2 *.dsk *.d64
|
rm -f *.o *.bin *.map *.prg *.pg2 *.dsk *.d64
|
||||||
|
2
dist/version_number.txt
vendored
2
dist/version_number.txt
vendored
@ -1 +1 @@
|
|||||||
1.0.39
|
1.0.41
|
Loading…
Reference in New Issue
Block a user