kipperkart works with w5100

git-svn-id: http://svn.code.sf.net/p/netboot65/code@296 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
jonnosan 2010-12-29 09:53:50 +00:00
parent 486b61f3c3
commit e6f1db0bb5
11 changed files with 145 additions and 47 deletions

View File

@ -1,10 +1,10 @@
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
@ -15,31 +15,48 @@ drivers:
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
kipperterm2:
make -C kipperterm2 all
wiznet:
make -C wiznet all
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
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
rm -f *~

Binary file not shown.

Binary file not shown.

View File

@ -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

View File

@ -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;
}

View File

@ -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
@ -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
@ -851,6 +852,37 @@ tcp_rx:
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

View File

@ -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

View File

@ -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=\

View File

@ -366,6 +366,7 @@ tcp_callback_routine:
lda #14
jsr print_a ;switch to lower case
ldax tcp_inbound_data_ptr
stax get_next_byte+1

13
client/wiznet/Makefile Normal file
View File

@ -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/

Binary file not shown.