From 624ab62d25df1f15768bef2ac62a930c060674c7 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Sun, 15 Dec 2013 22:50:01 +0100
Subject: [PATCH] Some test program cleanup.
- Simplify Makefile by allowing to use suffix '_tcp' to denote the requirement to link against TCP-capable IP65 lib.
- Remove 'test' or 'test_' prefix from test program names - every program in 'test' is a test program.
- Have some more test programs switch to lower case charset on the C64.
- I'm no Ruby guy so don't rely on Ruby for building disk images.
---
drivers/Makefile | 17 +-
ip65/Makefile | 8 +-
test/Makefile | 155 ++++++++----------
test/{test_cart_api.s => cartapi.s} | 0
test/{test_cifs.s => cifs.s} | 0
test/{test_disk_io.s => diskio.s} | 0
test/{testdns.s => dns.s} | 6 +-
test/{testdottedquad.s => dottedquad.s} | 8 +-
test/{test_getc.s => getc.s} | 0
test/{test_get_url.s => geturl.s} | 2 +-
test/{test_httpd.s => httpd.s} | 0
test/{test_lancegs.s => lancegs.s} | 0
...parse_querystring.s => parsequerystring.s} | 0
test/{test_parser.s => parser.s} | 0
test/{test_ping.s => ping.s} | 5 +
test/{test_sntp.s => sntp.s} | 0
test/{test_tcp.s => tcp.s} | 6 +-
test/{testtftp.s => tftp.s} | 5 +
test/{test_vic20.s => vic20.s} | 0
test/{test_vt100.s => vt100.s} | 0
test/{test_wiznet.s => wiznet.s} | 0
test/{test_xmodem.s => xmodem.s} | 0
22 files changed, 98 insertions(+), 114 deletions(-)
rename test/{test_cart_api.s => cartapi.s} (100%)
rename test/{test_cifs.s => cifs.s} (100%)
rename test/{test_disk_io.s => diskio.s} (100%)
rename test/{testdns.s => dns.s} (98%)
rename test/{testdottedquad.s => dottedquad.s} (98%)
rename test/{test_getc.s => getc.s} (100%)
rename test/{test_get_url.s => geturl.s} (99%)
rename test/{test_httpd.s => httpd.s} (100%)
rename test/{test_lancegs.s => lancegs.s} (100%)
rename test/{test_parse_querystring.s => parsequerystring.s} (100%)
rename test/{test_parser.s => parser.s} (100%)
rename test/{test_ping.s => ping.s} (97%)
rename test/{test_sntp.s => sntp.s} (100%)
rename test/{test_tcp.s => tcp.s} (99%)
rename test/{testtftp.s => tftp.s} (98%)
rename test/{test_vic20.s => vic20.s} (100%)
rename test/{test_vt100.s => vt100.s} (100%)
rename test/{test_wiznet.s => wiznet.s} (100%)
rename test/{test_xmodem.s => xmodem.s} (100%)
diff --git a/drivers/Makefile b/drivers/Makefile
index 96397d8..b4a6d69 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -2,29 +2,25 @@ AS=ca65
LD=ld65
AFLAGS=
-
%.o: %.c
$(CC) -c $(CFLAGS) $<
%.o: %.s
$(AS) $(AFLAGS) $<
-
-# a2uther.lib Apple //, with an Uthernet card (cs8900a chipset) in slot #3
-# a2lancegs.lib Apple //, with a LANceGS card (lan91c96)
-# c64rrnet.lib C64 with RR-NET or clone at $de0x
-# c64wiznet.lib C64 with Wiznet W5100 addressed at $df2x
-# vic20rrnet.lib C64 with RR-NET or clone at $980x
-
+# a2uther.lib : Apple //, with an Uthernet card (cs8900a chipset) in slot #3
+# a2lancegs.lib : Apple //, with a LANceGS card (lan91c96)
+# c64rrnet.lib : C64 with RR-NET or clone at $de0x
+# c64wiznet.lib : C64 with Wiznet W5100 addressed at $df2x
+# vic20rrnet.lib : C64 with RR-NET or clone at $980x
DRIVERS=\
a2uther.lib \
a2lancegs.lib \
c64rrnet.lib \
c64wiznet.lib \
- vic20rrnet.lib \
+ vic20rrnet.lib
-
all: $(DRIVERS)
a2lancegs.lib: a2print.o lan91c96.o a2timer.o a2kernal.o a2input.o a2charconv.o a2_zero_page.o
@@ -42,7 +38,6 @@ c64wiznet.lib: w5100.o c64print.o c64timer.o c64kernal.o c64inputs.o cbm_disk_a
vic20rrnet.lib: vic20print.o vic20-rr-net.o vic20timer.o vic20input.o cbm_disk_access.o petscii_charconv.o cs8900a.o generic_zero_page.o
ar65 a $@ $^
-
clean:
rm -f *.o
rm -f *.lib
diff --git a/ip65/Makefile b/ip65/Makefile
index eb6fd65..606506d 100644
--- a/ip65/Makefile
+++ b/ip65/Makefile
@@ -2,20 +2,17 @@ AS=ca65
LD=ld65
AFLAGS=
-
# ip65.lib : minimal IP stack (UDP only)
# ip65_tcp.lib : full featured TCP/IP stack
# ip65_wiznet.lib : hybrid stack for use with the w5100 chip : UDP,ICMP & ARP is done on host, TCP is on w5100
-
%.o: %.c
$(CC) -c $(CFLAGS) $<
%.o: %.s
$(AS) $(AFLAGS) $<
-
-ETHOBJS= \
+ETHOBJS=\
copymem.o \
config.o \
timer.o \
@@ -42,7 +39,7 @@ ETHOBJS= \
icmp.o \
cifs.o \
udp.o
-
+
all: ip65.lib ip65_tcp.lib ip65_wiznet.lib
ip65.lib: $(ETHOBJS) function_dispatcher.s
@@ -69,6 +66,5 @@ clean:
rm -f ip65_tcp.lib
rm -f ip65_wiznet.lib
-
distclean: clean
rm -f *~
diff --git a/test/Makefile b/test/Makefile
index 270bada..c39eb23 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -4,8 +4,6 @@ LD=ld65
CFLAGS=-Oirs -t $(TARGET)
AFLAGS=
-
-
IP65LIB=../ip65/ip65.lib
IP65TCPLIB=../ip65/ip65_tcp.lib
C64RRNETLIB=../drivers/c64rrnet.lib
@@ -15,42 +13,43 @@ A2UTHERLIB=../drivers/a2uther.lib
A2LANCEGSLIB=../drivers/a2lancegs.lib
VIC20RRNETLIB=../drivers/vic20rrnet.lib
-
INCFILES=\
../inc/common.i\
../inc/commonprint.i\
../inc/net.i\
-all: \
+all: prg bin
+
+prg: \
ip65 \
drivers \
- test_getc.prg \
- testdns.prg \
- test_cifs.prg \
- test_disk_io.prg \
- testdns.pg2 \
- testtftp.prg \
- testtftp.pg2 \
- test_cart_api.prg \
- test_vt100.prg \
- test_sntp.prg \
- testdottedquad.prg \
- test_tcp.prg \
- test_xmodem.prg \
- test_vic20.prg \
- test_httpd.prg \
- test_parser.prg \
- test_ping.prg \
- test_get_url.prg \
- test_wiznet.prg \
- test_parse_querystring.prg \
- test_sntp.prg \
-# test_lancegs.pg2 \
-# test_xmodem.d64 \
-# httpd_test.d64 \
- ip65test.dsk \
-# test_disk_io.d64 \
+ cartapi.prg \
+ cifs_tcp.prg \
+ diskio.prg \
+ dns.prg \
+ dottedquad.prg \
+ getc.prg \
+ geturl_tcp.prg \
+ httpd.prg \
+ parsequerystring.prg \
+ parser_tcp.prg \
+ ping_tcp.prg \
+ sntp.prg \
+ tcp_tcp.prg \
+ tftp.prg \
+ vic20.prg \
+ vt100.prg \
+ wiznet.prg \
+ xmodem_tcp.prg
+bin: \
+ ip65 \
+ drivers \
+ dns.bin \
+ dottedquad.bin \
+ lancegs.bin \
+ tcp_tcp.bin \
+ tftp.bin
ip65:
make -C ../ip65 all
@@ -58,81 +57,55 @@ ip65:
drivers:
make -C ../drivers all
+d64: ip65.d64
+
+dsk: ip65.dsk
+
%.o: %.s
$(AS) $(AFLAGS) $<
-
%.prg: %.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
- $(LD) -m $*.map -vm -C ../cfg/c64prg.cfg -o $*.prg $(AFLAGS) $< $(IP65LIB) $(C64RRNETLIB)
+ $(LD) -o $*.prg -C ../cfg/c64prg.cfg -m $*.c64.map -vm $< $(IP65LIB) $(C64RRNETLIB)
+%_tcp.prg: %.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
+ $(LD) -o $(subst _tcp,,$*).prg -C ../cfg/c64prg.cfg -m $(subst _tcp,,$*).c64.map -vm $< $(IP65TCPLIB) $(C64RRNETLIB)
-test_tcp.prg: test_tcp.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
- $(LD) -m test_tcp.map -vm -C ../cfg/c64prg.cfg -o test_tcp.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
+%.bin: %.o $(IP65LIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg
+ $(LD) -o $*.bin -C ../cfg/a2bin.cfg -m $*.a2.map -vm $< $(IP65LIB) $(A2UTHERLIB)
-test_xmodem.o: test_xmodem.s ../ip65/xmodem.s
- $(AS) $(AFLAGS) $<
+%_tcp.bin: %.o $(IP65TCPLIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg
+ $(LD) -o $(subst _tcp,,$*).bin -C ../cfg/a2bin.cfg -m $(subst _tcp,,$*).a2.map -vm $< $(IP65TCPLIB) $(A2UTHERLIB)
-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)
+wiznet.prg: wiznet.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64prg.cfg
+ $(LD) -o wiznet.prg -C ../cfg/c64prg.cfg -m wiznet.map -vm $< $(IP65WIZNETLIB) $(C64WIZNETLIB)
-test_parser.prg: test_parser.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
- $(LD) -m test_parser.map -vm -C ../cfg/c64prg.cfg -o test_parser.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
+vic20.prg: vic20.o $(IP65TCPLIB) $(VIC20RRNETLIB) $(INCFILES) ../cfg/vic20prg.cfg
+ $(LD) -o vic20.prg -C ../cfg/vic20prg.cfg -m vic20.map -vm $< $(IP65TCPLIB) $(VIC20RRNETLIB)
+lancegs.bin: lancegs.o $(IP65LIB) $(A2LANCEGSLIB) $(INCFILES) ../cfg/a2bin.cfg
+ $(LD) -o lancegs.bin -C ../cfg/a2bin.cfg -m lancegs.a2.map -vm $< $(IP65LIB) $(A2LANCEGSLIB)
-test_get_url.prg: test_get_url.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
- $(LD) -m test_get_url.map -vm -C ../cfg/c64prg.cfg -o test_get_url.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
+ip65.d64: prg
+ $(C1541) -format ip65,00 d64 $@
+ $(C1541) -attach $@ -write dns.prg dns,p
+ $(C1541) -attach $@ -write dottedquad.prg dottedquad,p
+ $(C1541) -attach $@ -write geturl.prg geturl,p
+ $(C1541) -attach $@ -write parser.prg parser,p
+ $(C1541) -attach $@ -write ping.prg ping,p
+ $(C1541) -attach $@ -write sntp.prg sntp,p
+ $(C1541) -attach $@ -write tcp.prg tcp,p
+ $(C1541) -attach $@ -write tftp.prg tftp,p
-
-test_ping.prg: test_ping.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
- $(LD) -m test_ping.map -vm -C ../cfg/c64prg.cfg -o test_ping.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
-
-test_wiznet.prg: test_wiznet.o $(C64WIZNETLIB) $(IP65WIZNETLIB) $(INCFILES) ../cfg/c64prg.cfg
- $(LD) -m test_wiznet.map -vm -C ../cfg/c64prg.cfg -o test_wiznet.prg $(AFLAGS) $< $(IP65WIZNETLIB) $(C64WIZNETLIB)
-
-
-test_cifs.prg: test_cifs.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
- $(LD) -m test_cifs.map -vm -C ../cfg/c64prg.cfg -o test_cifs.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
-
-
-test_vic20.prg: test_vic20.o $(IP65TCPLIB) $(VIC20RRNETLIB) $(INCFILES) ../cfg/vic20prg.cfg
- $(LD) -m test_vic20.map -vm -C ../cfg/vic20prg.cfg -o test_vic20.prg $(AFLAGS) $< $(IP65TCPLIB) $(VIC20RRNETLIB)
-
-
-%.pg2: %.o $(IP65LIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg
- $(LD) -C ../cfg/a2bin.cfg -o $*.pg2 $(AFLAGS) $< $(IP65LIB) $(A2UTHERLIB)
-
-test_lancegs.pg2: test_lancegs.o $(IP65LIB) $(A2LANCEGSLIB) $(INCFILES) ../cfg/a2bin.cfg
- $(LD) -C ../cfg/a2bin.cfg -o test_lancegs.pg2 $(AFLAGS) $< $(IP65LIB) $(A2LANCEGSLIB)
-
-httpd_test.d64: test_httpd.prg index.html file1.html
- cp test_httpd.prg autoexec.prg
- ripxplore.rb --init CbmDos httpd_test.d64 -a autoexec.prg
- ripxplore.rb httpd_test.d64 -a index.html -t C64Seq
- ripxplore.rb httpd_test.d64 -a file1.html -t C64Seq
-
-
-ip65test.dsk: testdns.pg2 testdottedquad.pg2 testtftp.pg2 #test_lancegs.pg2
-
-# ripxplore.rb --init AppleDos ip65test.dsk -a test_lancegs.pg2 -t AppleBinary
- ripxplore.rb --init BeautifulBoot ip65testb.dsk -a testtftp.pg2 -t AppleBinary
-# ripxplore.rb ip65test.dsk -a testdottedquad.pg2 -t AppleBinary
-# ripxplore.rb ip65test.dsk -a testdns.pg2 -t AppleBinary
-
-
-test_disk_io.d64: test_disk_io.prg
-
- ripxplore.rb --init CbmDos test_disk_io.d64 -a test_disk_io.prg
- cp screen_prg.bin screen.prg
- ripxplore.rb test_disk_io.d64 -a screen.prg
-
-
-test_xmodem.d64: test_xmodem.prg
- ripxplore.rb --init CbmDos test_xmodem.d64 -a test_xmodem.prg
+ip65.dsk: bin
+ cp prodos.dsk $@
+ java -jar $(AC) -cc65 $@ dns bin 0 < dns.bin
+ java -jar $(AC) -cc65 $@ dottedquad bin 0 < dottedquad.bin
+ java -jar $(AC) -cc65 $@ tcp bin 0 < tcp.bin
+ java -jar $(AC) -cc65 $@ tftp bin 0 < tftp.bin
clean:
- rm -f *.o *.pg2 *.prg
- rm -f ip65test.dsk
+ rm -f *.o *.bin *.prg *.map
+ rm -f ip65.d64 ip65.dsk
-
distclean: clean
rm -f *~
diff --git a/test/test_cart_api.s b/test/cartapi.s
similarity index 100%
rename from test/test_cart_api.s
rename to test/cartapi.s
diff --git a/test/test_cifs.s b/test/cifs.s
similarity index 100%
rename from test/test_cifs.s
rename to test/cifs.s
diff --git a/test/test_disk_io.s b/test/diskio.s
similarity index 100%
rename from test/test_disk_io.s
rename to test/diskio.s
diff --git a/test/testdns.s b/test/dns.s
similarity index 98%
rename from test/testdns.s
rename to test/dns.s
index af7cc17..bd3a1dd 100644
--- a/test/testdns.s
+++ b/test/dns.s
@@ -41,7 +41,11 @@ basicstub:
.code
init:
-
+
+ ;switch to lower case charset
+ lda #23
+ sta $d018
+
jsr print_cr
jsr print_ip_config
init_ip_via_dhcp
diff --git a/test/testdottedquad.s b/test/dottedquad.s
similarity index 98%
rename from test/testdottedquad.s
rename to test/dottedquad.s
index d4ed4d1..4265b94 100644
--- a/test/testdottedquad.s
+++ b/test/dottedquad.s
@@ -37,9 +37,13 @@ basicstub:
.code
init:
-
+
+ ;switch to lower case charset
+ lda #23
+ sta $d018
+
jsr print_cr
-
+
ldax #dotted_quad_1
jsr test_dotted_quad_string
diff --git a/test/test_getc.s b/test/getc.s
similarity index 100%
rename from test/test_getc.s
rename to test/getc.s
diff --git a/test/test_get_url.s b/test/geturl.s
similarity index 99%
rename from test/test_get_url.s
rename to test/geturl.s
index 8751639..ef20edc 100644
--- a/test/test_get_url.s
+++ b/test/geturl.s
@@ -54,7 +54,7 @@ init:
jsr test_url_download
ldax #url_2
- jsr test_url_download
+; jsr test_url_download
rts
diff --git a/test/test_httpd.s b/test/httpd.s
similarity index 100%
rename from test/test_httpd.s
rename to test/httpd.s
diff --git a/test/test_lancegs.s b/test/lancegs.s
similarity index 100%
rename from test/test_lancegs.s
rename to test/lancegs.s
diff --git a/test/test_parse_querystring.s b/test/parsequerystring.s
similarity index 100%
rename from test/test_parse_querystring.s
rename to test/parsequerystring.s
diff --git a/test/test_parser.s b/test/parser.s
similarity index 100%
rename from test/test_parser.s
rename to test/parser.s
diff --git a/test/test_ping.s b/test/ping.s
similarity index 97%
rename from test/test_ping.s
rename to test/ping.s
index 9b8275e..32728c5 100644
--- a/test/test_ping.s
+++ b/test/ping.s
@@ -37,6 +37,11 @@ basicstub:
.code
init:
+
+ ;switch to lower case charset
+ lda #23
+ sta $d018
+
jsr print_cr
init_ip_via_dhcp
jsr print_ip_config
diff --git a/test/test_sntp.s b/test/sntp.s
similarity index 100%
rename from test/test_sntp.s
rename to test/sntp.s
diff --git a/test/test_tcp.s b/test/tcp.s
similarity index 99%
rename from test/test_tcp.s
rename to test/tcp.s
index c579812..07c8cdb 100644
--- a/test/test_tcp.s
+++ b/test/tcp.s
@@ -72,7 +72,10 @@ get_next_byte:
.code
init:
-
+
+ ;switch to lower case charset
+ lda #23
+ sta $d018
ldax #$1234
stax acc16
@@ -84,7 +87,6 @@ init:
ldax #$28
jsr test_sub_16_16
- rts
ldax #$ff34
stax acc16
ldax #$1235
diff --git a/test/testtftp.s b/test/tftp.s
similarity index 98%
rename from test/testtftp.s
rename to test/tftp.s
index c889803..67b5c6b 100644
--- a/test/testtftp.s
+++ b/test/tftp.s
@@ -45,6 +45,11 @@ basicstub:
.code
init:
+
+ ;switch to lower case charset
+ lda #23
+ sta $d018
+
jsr print_cr
init_ip_via_dhcp
jsr print_ip_config
diff --git a/test/test_vic20.s b/test/vic20.s
similarity index 100%
rename from test/test_vic20.s
rename to test/vic20.s
diff --git a/test/test_vt100.s b/test/vt100.s
similarity index 100%
rename from test/test_vt100.s
rename to test/vt100.s
diff --git a/test/test_wiznet.s b/test/wiznet.s
similarity index 100%
rename from test/test_wiznet.s
rename to test/wiznet.s
diff --git a/test/test_xmodem.s b/test/xmodem.s
similarity index 100%
rename from test/test_xmodem.s
rename to test/xmodem.s