diff --git a/client/Makefile b/client/Makefile index ff7f533..3099b42 100644 --- a/client/Makefile +++ b/client/Makefile @@ -1,45 +1,62 @@ TARGET=c64 -.PHONY: ip65 drivers test clean distclean carts examples basic kipperterm2 +.PHONY: ip65 drivers test clean distclean kipperterm2 examples carts basic wiznet -all: ip65 drivers test carts examples basic kipperterm2 +all: ip65 drivers test carts examples basic kipperterm2 wiznet ip65: make -C ip65 all -drivers: - make -C drivers all - -examples: - make -C examples all - -test: - make -C test TARGET=$(TARGET) all - -carts: - make -C carts all - -basic: - make -C basic all - -kipperterm2: - make -C kipperterm2 all +drivers: + make -C drivers all + +examples: + make -C examples all + + + +test: + make -C test TARGET=$(TARGET) all + + +kipperterm2: + make -C kipperterm2 all + + +carts: + make -C carts all + +basic: + make -C basic all + +wiznet: + make -C wiznet all + clean: - make -C ip65 clean + make -C ip65 clean + make -C drivers clean make -C test clean - make -C carts clean - make -C kipperterm2 clean - make -C basic clean + make -C carts clean + + make -C kipperterm2 clean + + make -C basic clean + distclean: - make -C ip65 distclean + make -C ip65 distclean + make -C drivers clean - make -C test distclean - make -C carts distclean - make -C kipperterm2 distclean - make -C basic distclean + make -C test distclean + + make -C carts distclean + + make -C kipperterm2 distclean + + make -C basic distclean + rm -f *~ diff --git a/client/basic/bails.d64 b/client/basic/bails.d64 index 9807d69..319b598 100644 Binary files a/client/basic/bails.d64 and b/client/basic/bails.d64 differ diff --git a/client/basic/kipperbas.d64 b/client/basic/kipperbas.d64 index 9940325..524b33b 100644 Binary files a/client/basic/kipperbas.d64 and b/client/basic/kipperbas.d64 differ diff --git a/client/carts/Makefile b/client/carts/Makefile index 0a3339a..cb533a7 100644 --- a/client/carts/Makefile +++ b/client/carts/Makefile @@ -12,12 +12,28 @@ INCFILES=\ ../inc/version.i\ IP65LIB=../ip65/ip65.lib - IP65TCPLIB=../ip65/ip65_tcp.lib - C64RRNETLIB=../drivers/c64rrnet.lib +C64WIZNETLIB=../drivers/c64wiznet.lib +IP65WIZNETLIB=../ip65/ip65_wiznet.lib + +all: ip65 drivers\ + kkwiz.bin \ + kkwiz.prg \ + bobcart.bin \ + kipperkart.bin \ + kipperkart_rr.bin \ + netboot.bin \ + kipperterm.bin \ + kipperkart.prg \ + kipperterm.prg \ + kipperterm_rr.bin \ + kippergo.bin \ + kipperkart.prg \ + kippergo.prg \ + kippergo_rr.bin \ + kipperdisk.d64 \ -all: bobcart.bin kipperkart.bin kipperkart_rr.bin netboot.bin kipperterm.bin kipperkart.prg kipperterm.prg kipperterm_rr.bin kippergo.bin kipperkart.prg kippergo.prg kippergo_rr.bin kipperdisk.d64 kipperkart.o: kipperkart.s $(INCFILES) ../inc/ping.i ../inc/disk_transfer.i ../inc/sidplay.i ../inc/config_menu.i $(AS) $(AFLAGS) -o $@ $< @@ -34,6 +50,9 @@ kippergo.o: kippergo.s $(INCFILES) ../inc/gopher.i ../inc/telnet.i ../inc/config kipperkart.prg: kipperkart.bin c64_cart_ram_header.prg cat c64_cart_ram_header.prg kipperkart.bin > kipperkart.prg +kkwiz.prg: kkwiz.bin c64_cart_ram_header.prg + cat c64_cart_ram_header.prg kkwiz.bin > kkwiz.prg + kipperterm.prg: kipperterm.bin c64_cart_ram_header.prg cat c64_cart_ram_header.prg kipperterm.bin > kipperterm.prg @@ -89,6 +108,12 @@ bobcart.bin: bobcart.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcar $(LD) -m bobcart.map -vm -C ../cfg/c64_8kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB) ruby fix_cart.rb $@ 8192 +kkwiz.bin: kipperkart.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64_16kcart.cfg + $(LD) -m kkwiz.map -vm -C ../cfg/c64_16kcart.cfg -o $@ $< $(IP65WIZNETLIB) $(C64WIZNETLIB) + ruby fix_cart.rb $@ 16384 +# ruby set_ip_config.rb $@ mac auto + + d64_upload.d64: d64_upload.prg cp d64_upload.prg ../../server/boot/ @@ -99,3 +124,9 @@ clean: distclean: clean rm -f *~ + +ip65: + make -C ../ip65 all + +drivers: + make -C ../drivers all diff --git a/client/cfg/c64_16kcart.cfg b/client/cfg/c64_16kcart.cfg index 352bace..7823820 100644 --- a/client/cfg/c64_16kcart.cfg +++ b/client/cfg/c64_16kcart.cfg @@ -16,13 +16,16 @@ SEGMENTS { CARTRIDGE_HEADER: load = HEADER, type = ro; IP65_DEFAULTS: load = DEFAULTS, type = ro; CODE: load = ROM, type = ro; + RODATA: load = ROM, run=ROM, type = ro; DATA: load = ROM, run = RAM, type = rw, define = yes; SELF_MODIFIED_CODE: load = ROM, run = RAM2, type = rw, define = yes; + BSS: load = RAM, type = bss; APP_SCRATCH: load = RAM4, type = bss; TCP_VARS: load = RAM2, type = bss; HTTP_VARS: load=ROM, run = RAM3, type = rw,define = yes; + IP65ZP: load = IP65ZP, type = zp; ZEROPAGE: load = ZP, type = zp, optional=yes; } diff --git a/client/drivers/w5100.s b/client/drivers/w5100.s index 8001a43..a86f66f 100644 --- a/client/drivers/w5100.s +++ b/client/drivers/w5100.s @@ -66,9 +66,6 @@ DEFAULT_W5100_BASE = $DF20 .import ip65_process .import check_for_abort_key - .segment "IP65ZP" : zeropage - - .code @@ -752,6 +749,7 @@ tcp_rx: lda #$ff sta tcp_inbound_data_length sta tcp_inbound_data_length+1 + jsr @make_fake_eth_header jsr jmp_to_callback ;let the caller see the connection has closed sec ;don't poll the MAC RAW socket, else it may clobber the output buffer rts @@ -768,8 +766,11 @@ tcp_rx: ;20 bytes of TCP header stax tcp_inbound_data_ptr + + sta eth_ptr_lo stx eth_ptr_hi + lda #0 sta byte_ctr_lo sta byte_ctr_hi @@ -789,7 +790,7 @@ tcp_rx: ldax rx_rd_ptr jsr w5100_read_register jsr next_eth_packet_byte - + jsr @inc_rx_rd_ptr inc byte_ctr_lo @@ -824,7 +825,7 @@ tcp_rx: ldy #W5100_CMD_RECV jsr w5100_write_register - + jsr @make_fake_eth_header jsr jmp_to_callback ;let the caller see the connection has closed sec ;don't poll the MAC RAW socket, else it may clobber the output buffer rts @@ -850,7 +851,38 @@ tcp_rx: jsr w5100_read_register sta rx_rd_ptr rts + +;the function dispatcher (and possibly other parts of the ip65 stack) expect to find valid values in the eth_inp frame +;when processing tcp data +@make_fake_eth_header: + + .import ip_inp + .import udp_inp + ;first set the TCP protocol value + lda #6 ;TCP protocol number + sta ip_inp+9 ;proto number + ;now copy the remote IP address + ldx #0 +@ip_loop: + lda tcp_remote_ip,x + sta ip_inp+12,x ;src IP + inx + cpx #$04 + bne @ip_loop + + ;now the local & remote ports + lda tcp_connect_remote_port + sta udp_inp+1 ;remote port (lo byte) + lda tcp_connect_remote_port+1 + sta udp_inp+0 ;remote port (high byte) + lda tcp_local_port + sta udp_inp+3 ;local port (lo byte) + lda tcp_local_port+1 + sta udp_inp+2 ;local port (high byte) + + rts + jmp_to_callback: jmp (tcp_callback) @@ -988,9 +1020,11 @@ next_eth_packet_byte: eth_ptr_lo=next_eth_packet_byte+1 eth_ptr_hi=next_eth_packet_byte+2 +; .bss +; don't use BSS because we are out of room in the location that lives in the +; config used for 16K carts ($C010..$CFFF) +;there seems to be a little room still free in the seg used for SELF_MODIFIED_CODE - - .bss w5100_addr: .res 2 byte_ctr_lo: .res 1 byte_ctr_hi: .res 1 @@ -1009,8 +1043,8 @@ tcp_send_data_len: .res 2 tcp_send_data_ptr = eth_ptr_lo -tcp_inbound_data_ptr: .res 2 tcp_inbound_data_length: .res 2 +tcp_inbound_data_ptr: .res 2 tcp_connect_remote_port: .res 2 tcp_remote_ip = tcp_connect_ip diff --git a/client/kipperterm2/Makefile b/client/kipperterm2/Makefile index ce7d755..011397b 100644 --- a/client/kipperterm2/Makefile +++ b/client/kipperterm2/Makefile @@ -18,7 +18,7 @@ IP65WIZNETLIB=../ip65/ip65_wiznet.lib C64WIZNETLIB=../drivers/c64wiznet.lib -all: ip65 drivers kipperterm2.prg kipperterm2wiz.prg kipperterm2.d64 +all: ip65 drivers kipperterm2.prg kt2wiz.prg kipperterm2.d64 kipperterm2.o: kipperterm2.s $(INCFILES) ../inc/telnet.i ../inc/config_menu.i ../inc/gopher.i @@ -31,14 +31,13 @@ kipperterm2.o: kipperterm2.s $(INCFILES) ../inc/telnet.i ../inc/config_menu.i .. $(LD) -m $*.map -vm -C ../cfg/c64fullprg.cfg -o $*.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB) ruby ../carts/set_ip_config.rb $@ mac auto -kipperterm2wiz.prg: kipperterm2.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64fullprg.cfg - $(LD) -m kipperterm2wiz.map -vm -C ../cfg/c64fullprg.cfg -o kipperterm2wiz.prg $(AFLAGS) $< $(IP65WIZNETLIB) $(C64WIZNETLIB) - cp kipperterm2wiz.prg ../../server/boot/autoexec.prg +kt2wiz.prg: kipperterm2.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64fullprg.cfg + $(LD) -m kt2wiz.map -vm -C ../cfg/c64fullprg.cfg -o kt2wiz.prg $(AFLAGS) $< $(IP65WIZNETLIB) $(C64WIZNETLIB) + cp kt2wiz.prg ../../server/boot/autoexec.prg -kipperterm2.d64: kipperterm2.prg kipperterm2wiz.prg addresses.txt abe.bas +kipperterm2.d64: kipperterm2.prg kt2wiz.prg addresses.txt abe.bas ripxplore.rb --init CbmDos $@ -a kipperterm2.prg - ripxplore.rb $@ -a kipperterm2wiz.prg -t C64Prg ripxplore.rb $@ -a 80columns -t C64Prg ripxplore.rb $@ -a addresses.txt -t C64Seq ripxplore.rb $@ -a abe -t C64Prg diff --git a/client/test/Makefile b/client/test/Makefile index 26bb1ae..1517c2c 100644 --- a/client/test/Makefile +++ b/client/test/Makefile @@ -7,10 +7,10 @@ AFLAGS= IP65LIB=../ip65/ip65.lib -IP65WIZNETLIB=../ip65/ip65_wiznet.lib IP65TCPLIB=../ip65/ip65_tcp.lib C64RRNETLIB=../drivers/c64rrnet.lib C64WIZNETLIB=../drivers/c64wiznet.lib +IP65WIZNETLIB=../ip65/ip65_wiznet.lib APPLE2PROGLIB=../drivers/apple2prog.lib INCFILES=\ diff --git a/client/test/test_wiznet.s b/client/test/test_wiznet.s index 415e935..c27523c 100644 --- a/client/test/test_wiznet.s +++ b/client/test/test_wiznet.s @@ -365,7 +365,8 @@ tcp_callback_routine: @not_end_of_file: lda #14 jsr print_a ;switch to lower case - + + ldax tcp_inbound_data_ptr stax get_next_byte+1 diff --git a/client/wiznet/Makefile b/client/wiznet/Makefile new file mode 100644 index 0000000..dcc869c --- /dev/null +++ b/client/wiznet/Makefile @@ -0,0 +1,13 @@ + + +all: kipperwizdisk.d64 + +#../basic/wizkb.prg ../basic/wizbob.prg + +kipperwizdisk.d64: ../carts/kkwiz.prg ../kipperterm2/kt2wiz.prg + ripxplore.rb --init CbmDos $@ -a ../carts/kkwiz.prg + ripxplore.rb $@ -a ../kipperterm2/addresses.txt -t C64Seq + ripxplore.rb $@ -a ../kipperterm2/abe -t C64Prg + ripxplore.rb $@ -a ../kipperterm2/kt2wiz.prg -t C64Prg + ripxplore.rb $@ -a ../examples/webnoter.prg -t C64Prg + cp $@ ../../server/boot/ diff --git a/client/wiznet/kipperwizdisk.d64 b/client/wiznet/kipperwizdisk.d64 new file mode 100644 index 0000000..2428a76 Binary files /dev/null and b/client/wiznet/kipperwizdisk.d64 differ