From ecdaac2ff8ee462ebb85aaf009b3e82bf80a7e06 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Fri, 13 Dec 2013 22:24:03 +0100 Subject: [PATCH] Distilled IP65 out of NETBOOT65. --- Makefile | 24 - {client/cfg => cfg}/a2bin.cfg | 50 +- {client/cfg => cfg}/c64prg.cfg | 32 +- {client/cfg => cfg}/vic20prg.cfg | 46 +- client/Makefile | 61 - client/a2/Makefile | 54 - client/a2/amper.s | 646 --- client/a2/autoexec.applesoft | 17 - client/a2/autoexec.bas | Bin 297 -> 0 bytes client/a2/autoexec.s | 24 - client/a2/hello.applesoft | 1 - client/a2/ip65test.dsk.original | Bin 143360 -> 0 bytes client/a2/make | Bin 143360 -> 0 bytes client/basic/BoB.htm | 189 - client/basic/KB.htm | 193 - client/basic/Makefile | 44 - client/basic/addresses.txt | 14 - client/basic/bails.d64 | Bin 174848 -> 0 bytes client/basic/bails.s | 1725 ------- client/basic/favicon.ico | Bin 3638 -> 0 bytes client/basic/gophermap.txt | 2 - client/basic/index.bas.txt | 25 - client/basic/kipperbas.d64 | Bin 174848 -> 0 bytes client/basic/kipperbas.s | 1739 ------- client/basic/kipperbasv20.s | 1658 ------- client/basic/timestamp.rb | 1 - client/basic/welcome_banner.txt | 1 - client/carts/Makefile | 145 - client/carts/bobcart.s | 1671 ------- client/carts/bootmenu.s | 164 - client/carts/c64_cart_ram_header.s | 117 - client/carts/cartheader.s | 54 - client/carts/crt8040.obj | Bin 8192 -> 0 bytes client/carts/crt8040.src | 107 - client/carts/d64_upload.s | 562 --- client/carts/dupe_cart.rb | 33 - client/carts/fix_cart.rb | 44 - client/carts/hello | Bin 256 -> 0 bytes client/carts/kippergo.s | 303 -- client/carts/kipperkart.s | 724 --- client/carts/kipperterm.s | 677 --- client/carts/nb65_skeleton.s | 173 - client/carts/netboot.s | 392 -- client/carts/set_ip_config.rb | 128 - client/carts/telnetd.s | 366 -- client/carts/timestamp.rb | 1 - client/cfg/a2language_card.cfg | 23 - client/cfg/a2rom.cfg | 48 - client/cfg/c64_16kcart.cfg | 31 - client/cfg/c64_8kcart.cfg | 29 - client/cfg/c64_mlstub.cfg | 25 - client/cfg/c64fullprg.cfg | 26 - client/cfg/kipperbas.cfg | 29 - client/cfg/kipperbasv20.cfg | 26 - client/cfg/rrbin.cfg | 21 - client/d64_test.bat | 1 - client/examples/Makefile | 80 - client/examples/dasm_d64_upload.asm | 489 -- client/examples/dasm_example.asm | 255 - client/examples/font16x8.bin | Bin 2048 -> 0 bytes client/examples/form.html | 12 - client/examples/gamemusic.bin | Bin 694 -> 0 bytes client/examples/httpd.asm | 471 -- client/examples/irc.s | 324 -- client/examples/make_sine_data.rb | 37 - client/examples/powertrain.bin | Bin 3763 -> 0 bytes client/examples/raster.s | 293 -- client/examples/sidplay.s | 250 - client/examples/sidplay_zigzag.s | 122 - client/examples/sine_data.i | 37 - client/examples/spud_letters.spr | Bin 2048 -> 0 bytes client/examples/tune.bin | Bin 2321 -> 0 bytes client/examples/upnatom.s | 949 ---- client/examples/url.cfg | 1 - client/examples/webnoter.s | 941 ---- client/inc/a2const.i | 551 --- client/inc/a2keycodes.i | 28 - client/inc/c64keycodes.i | 36 - client/inc/config_menu.i | 212 - client/inc/disk_transfer.i | 268 -- client/inc/gopher.i | 680 --- client/inc/menu.i | 341 -- client/inc/petscii.i | 43 - client/inc/ping.i | 87 - client/inc/sidplay.i | 300 -- client/inc/telnet.i | 171 - client/kipperterm2/80columns | Bin 3013 -> 0 bytes client/kipperterm2/Makefile | 58 - client/kipperterm2/TODO.txt | 9 - client/kipperterm2/abe | Bin 2707 -> 0 bytes client/kipperterm2/abe.bas | Bin 2669 -> 0 bytes client/kipperterm2/addresses.txt | 14 - client/kipperterm2/kipperterm2.s | 781 --- client/kipperterm2/timestamp.i | 1 - client/tcp_test.bat | 1 - client/test/atom_test.xml | 242 - client/test/file1.html | 3 - client/test/index.html | 3 - client/uthernet/Makefile | 44 - client/uthernet/bankswitch_eeprom.s | 51 - client/uthernet/c700_rom.s | 69 - client/uthernet/patch_applewin.rb | 52 - client/uthernet/utherboot.s | 342 -- client/v1541/Makefile | 35 - client/v1541/v1541.cfg | 24 - client/v1541/v1541.prg | Bin 7473 -> 0 bytes client/v1541/v1541.s | 745 --- client/wiznet/Makefile | 94 - client/wiznet/cartheader.s | 54 - client/wiznet/commonprint.i | 377 -- client/wiznet/kipperwizdisk.d64 | Bin 174848 -> 0 bytes client/wiznet/telnetd.s | 366 -- client/wiznet/timestamp.rb | 1 - client/wiznet/wizbobcart.cfg | 27 - client/wiznet/wizbobcart.s | 1755 ------- client/wiznet/wizboot.s | 353 -- client/wiznet/wizboot2.s | 121 - client/wiznet/wizflashheader.s | 423 -- client/wiznet/wiztest.s | 1289 ----- dist/add_license.rb | 97 - dist/document_ca65_source_as_html.rb | 328 -- dist/make_dist.rb | 75 - dist/make_dist_ip65.rb | 45 - dist/make_error_codes.rb | 11 - dist/update_netboot65_web.bat | 1 - dist/version_number.txt | 1 - doc/BOOTSTRAPPING.txt | 15 - doc/BUILD_REQUIREMENTS.txt | 9 - doc/C64 gopher client.txt | 33 - doc/CHANGES.txt | 56 - doc/CONTRIBUTORS.txt | 6 - doc/LICENSE.txt | 471 -- doc/README.Apple2.html | 70 - doc/README.C64.html | 172 - doc/apple_dos_33_memory_layout.txt | 46 - doc/ca65-doc-style.css | 55 - doc/ip65.html | 232 - doc/kipper_api_technical_reference.doc | Bin 207360 -> 0 bytes doc/netboot65.html | 122 - doc/protocol.txt | 155 - {client/drivers => drivers}/Makefile | 0 {client/drivers => drivers}/a2_zero_page.s | 76 +- {client/drivers => drivers}/a2charconv.s | 76 +- {client/drivers => drivers}/a2input.s | 422 +- {client/drivers => drivers}/a2kernal.s | 50 +- {client/drivers => drivers}/a2print.s | 152 +- {client/drivers => drivers}/a2timer.s | 132 +- {client/drivers => drivers}/c64_vt100.s | 4248 ++++++++--------- {client/drivers => drivers}/c64inputs.s | 408 +- {client/drivers => drivers}/c64kernal.s | 54 +- {client/drivers => drivers}/c64print.s | 224 +- {client/drivers => drivers}/c64timer.s | 140 +- {client/drivers => drivers}/cbm_disk_access.s | 1284 ++--- {client/drivers => drivers}/cs8900a.i | 62 +- {client/drivers => drivers}/cs8900a.s | 584 +-- .../drivers => drivers}/generic_zero_page.s | 86 +- {client/drivers => drivers}/lan91c96.s | 922 ++-- .../drivers => drivers}/petscii_charconv.s | 152 +- {client/drivers => drivers}/rr-net.s | 126 +- {client/drivers => drivers}/uthernet.s | 104 +- {client/drivers => drivers}/vic20-rr-net.s | 114 +- {client/drivers => drivers}/vic20input.s | 406 +- {client/drivers => drivers}/vic20print.s | 190 +- {client/drivers => drivers}/vic20timer.s | 248 +- {client/drivers => drivers}/w5100.i | 0 {client/drivers => drivers}/w5100.s | 2112 ++++---- {client/inc => inc}/common.i | 130 +- {client/inc => inc}/commonprint.i | 860 ++-- {client/inc => inc}/kipper_constants.i | 342 +- {client/inc => inc}/net.i | 124 +- {client/inc => inc}/printf.i | 152 +- {client/inc => inc}/version.i | 0 {client/inc => inc}/vt100_font.bin | Bin {client/ip65 => ip65}/Makefile | 0 {client/ip65 => ip65}/arithmetic.s | 340 +- {client/ip65 => ip65}/arp.s | 884 ++-- {client/ip65 => ip65}/cifs.s | 1836 +++---- {client/ip65 => ip65}/config.s | 186 +- {client/ip65 => ip65}/copymem.s | 140 +- {client/ip65 => ip65}/debug.s | 328 +- {client/ip65 => ip65}/dhcp.s | 1016 ++-- {client/ip65 => ip65}/dns.s | 968 ++-- {client/ip65 => ip65}/dottedquad.s | 210 +- {client/ip65 => ip65}/eth.s | 200 +- {client/ip65 => ip65}/function_dispatcher.s | 1398 +++--- {client/ip65 => ip65}/http.s | 510 +- {client/ip65 => ip65}/httpd.s | 1252 ++--- {client/ip65 => ip65}/icmp.s | 938 ++-- {client/ip65 => ip65}/ip.s | 1020 ++-- {client/ip65 => ip65}/ip65.s | 294 +- {client/ip65 => ip65}/output_buffer.s | 54 +- {client/ip65 => ip65}/parser.s | 208 +- {client/ip65 => ip65}/printf.s | 856 ++-- {client/ip65 => ip65}/sntp.s | 422 +- {client/ip65 => ip65}/string_utils.s | 228 +- {client/ip65 => ip65}/tcp.s | 2192 ++++----- {client/ip65 => ip65}/telnet.s | 992 ++-- {client/ip65 => ip65}/tftp.s | 1190 ++--- {client/ip65 => ip65}/timer.s | 118 +- {client/ip65 => ip65}/udp.s | 720 +-- {client/ip65 => ip65}/url.s | 916 ++-- {client/ip65 => ip65}/xmodem.s | 1198 ++--- {client/libnet => libnet}/Makefile | 0 {client/libnet => libnet}/c64libnet.cfg | 0 {client/libnet => libnet}/libnet.h | 0 {client/libnet => libnet}/libnet.s | 190 +- {client/libnet => libnet}/test_sntp.c | 0 server/bin/import_ags_games.rb | 32 - server/bin/netboot65_server.rb | 34 - server/bin/tftp_cat.rb | 21 - server/bin/tftp_only_server.rb | 30 - server/lib/SubclassTracking.rb | 11 - server/lib/file_list.rb | 69 - server/lib/tftp_server.rb | 228 - server/lib/tndp.rb | 459 -- server/lib/tndp_server.rb | 178 - server/test/tc_file_list.rb | 65 - server/test/tc_test_message_formats.rb | 41 - server/test/tc_test_server.rb | 116 - server/test/ts_test_all.rb | 10 - {client/test => test}/Makefile | 0 {client/test => test}/test_cart_api.s | 882 ++-- {client/test => test}/test_cifs.s | 280 +- {client/test => test}/test_disk_io.s | 942 ++-- {client/test => test}/test_get_url.s | 304 +- {client/test => test}/test_getc.s | 392 +- {client/test => test}/test_httpd.s | 454 +- {client/test => test}/test_lancegs.s | 60 +- .../test => test}/test_parse_querystring.s | 284 +- {client/test => test}/test_parser.s | 472 +- {client/test => test}/test_ping.s | 188 +- {client/test => test}/test_sntp.s | 262 +- {client/test => test}/test_tcp.s | 1290 ++--- {client/test => test}/test_vic20.s | 180 +- {client/test => test}/test_vt100.s | 210 +- {client/test => test}/test_wiznet.s | 910 ++-- {client/test => test}/test_xmodem.s | 652 +-- {client/test => test}/testdns.s | 314 +- {client/test => test}/testdottedquad.s | 268 +- {client/test => test}/testtftp.s | 280 +- 240 files changed, 21768 insertions(+), 51712 deletions(-) delete mode 100644 Makefile rename {client/cfg => cfg}/a2bin.cfg (97%) rename {client/cfg => cfg}/c64prg.cfg (98%) rename {client/cfg => cfg}/vic20prg.cfg (97%) delete mode 100644 client/Makefile delete mode 100644 client/a2/Makefile delete mode 100644 client/a2/amper.s delete mode 100644 client/a2/autoexec.applesoft delete mode 100644 client/a2/autoexec.bas delete mode 100644 client/a2/autoexec.s delete mode 100644 client/a2/hello.applesoft delete mode 100644 client/a2/ip65test.dsk.original delete mode 100644 client/a2/make delete mode 100644 client/basic/BoB.htm delete mode 100644 client/basic/KB.htm delete mode 100644 client/basic/Makefile delete mode 100644 client/basic/addresses.txt delete mode 100644 client/basic/bails.d64 delete mode 100644 client/basic/bails.s delete mode 100644 client/basic/favicon.ico delete mode 100644 client/basic/gophermap.txt delete mode 100644 client/basic/index.bas.txt delete mode 100644 client/basic/kipperbas.d64 delete mode 100644 client/basic/kipperbas.s delete mode 100644 client/basic/kipperbasv20.s delete mode 100644 client/basic/timestamp.rb delete mode 100644 client/basic/welcome_banner.txt delete mode 100644 client/carts/Makefile delete mode 100644 client/carts/bobcart.s delete mode 100644 client/carts/bootmenu.s delete mode 100644 client/carts/c64_cart_ram_header.s delete mode 100644 client/carts/cartheader.s delete mode 100644 client/carts/crt8040.obj delete mode 100644 client/carts/crt8040.src delete mode 100644 client/carts/d64_upload.s delete mode 100644 client/carts/dupe_cart.rb delete mode 100644 client/carts/fix_cart.rb delete mode 100644 client/carts/hello delete mode 100644 client/carts/kippergo.s delete mode 100644 client/carts/kipperkart.s delete mode 100644 client/carts/kipperterm.s delete mode 100644 client/carts/nb65_skeleton.s delete mode 100644 client/carts/netboot.s delete mode 100644 client/carts/set_ip_config.rb delete mode 100644 client/carts/telnetd.s delete mode 100644 client/carts/timestamp.rb delete mode 100644 client/cfg/a2language_card.cfg delete mode 100644 client/cfg/a2rom.cfg delete mode 100644 client/cfg/c64_16kcart.cfg delete mode 100644 client/cfg/c64_8kcart.cfg delete mode 100644 client/cfg/c64_mlstub.cfg delete mode 100644 client/cfg/c64fullprg.cfg delete mode 100644 client/cfg/kipperbas.cfg delete mode 100644 client/cfg/kipperbasv20.cfg delete mode 100644 client/cfg/rrbin.cfg delete mode 100644 client/d64_test.bat delete mode 100644 client/examples/Makefile delete mode 100644 client/examples/dasm_d64_upload.asm delete mode 100644 client/examples/dasm_example.asm delete mode 100644 client/examples/font16x8.bin delete mode 100644 client/examples/form.html delete mode 100644 client/examples/gamemusic.bin delete mode 100644 client/examples/httpd.asm delete mode 100644 client/examples/irc.s delete mode 100644 client/examples/make_sine_data.rb delete mode 100644 client/examples/powertrain.bin delete mode 100644 client/examples/raster.s delete mode 100644 client/examples/sidplay.s delete mode 100644 client/examples/sidplay_zigzag.s delete mode 100644 client/examples/sine_data.i delete mode 100644 client/examples/spud_letters.spr delete mode 100644 client/examples/tune.bin delete mode 100644 client/examples/upnatom.s delete mode 100644 client/examples/url.cfg delete mode 100644 client/examples/webnoter.s delete mode 100644 client/inc/a2const.i delete mode 100644 client/inc/a2keycodes.i delete mode 100644 client/inc/c64keycodes.i delete mode 100644 client/inc/config_menu.i delete mode 100644 client/inc/disk_transfer.i delete mode 100644 client/inc/gopher.i delete mode 100644 client/inc/menu.i delete mode 100644 client/inc/petscii.i delete mode 100644 client/inc/ping.i delete mode 100644 client/inc/sidplay.i delete mode 100644 client/inc/telnet.i delete mode 100644 client/kipperterm2/80columns delete mode 100644 client/kipperterm2/Makefile delete mode 100644 client/kipperterm2/TODO.txt delete mode 100644 client/kipperterm2/abe delete mode 100644 client/kipperterm2/abe.bas delete mode 100644 client/kipperterm2/addresses.txt delete mode 100644 client/kipperterm2/kipperterm2.s delete mode 100644 client/kipperterm2/timestamp.i delete mode 100644 client/tcp_test.bat delete mode 100644 client/test/atom_test.xml delete mode 100644 client/test/file1.html delete mode 100644 client/test/index.html delete mode 100644 client/uthernet/Makefile delete mode 100644 client/uthernet/bankswitch_eeprom.s delete mode 100644 client/uthernet/c700_rom.s delete mode 100644 client/uthernet/patch_applewin.rb delete mode 100644 client/uthernet/utherboot.s delete mode 100644 client/v1541/Makefile delete mode 100644 client/v1541/v1541.cfg delete mode 100644 client/v1541/v1541.prg delete mode 100644 client/v1541/v1541.s delete mode 100644 client/wiznet/Makefile delete mode 100644 client/wiznet/cartheader.s delete mode 100644 client/wiznet/commonprint.i delete mode 100644 client/wiznet/kipperwizdisk.d64 delete mode 100644 client/wiznet/telnetd.s delete mode 100644 client/wiznet/timestamp.rb delete mode 100644 client/wiznet/wizbobcart.cfg delete mode 100644 client/wiznet/wizbobcart.s delete mode 100644 client/wiznet/wizboot.s delete mode 100644 client/wiznet/wizboot2.s delete mode 100644 client/wiznet/wizflashheader.s delete mode 100644 client/wiznet/wiztest.s delete mode 100644 dist/add_license.rb delete mode 100644 dist/document_ca65_source_as_html.rb delete mode 100644 dist/make_dist.rb delete mode 100644 dist/make_dist_ip65.rb delete mode 100644 dist/make_error_codes.rb delete mode 100644 dist/update_netboot65_web.bat delete mode 100644 dist/version_number.txt delete mode 100644 doc/BOOTSTRAPPING.txt delete mode 100644 doc/BUILD_REQUIREMENTS.txt delete mode 100644 doc/C64 gopher client.txt delete mode 100644 doc/CHANGES.txt delete mode 100644 doc/CONTRIBUTORS.txt delete mode 100644 doc/LICENSE.txt delete mode 100644 doc/README.Apple2.html delete mode 100644 doc/README.C64.html delete mode 100644 doc/apple_dos_33_memory_layout.txt delete mode 100644 doc/ca65-doc-style.css delete mode 100644 doc/ip65.html delete mode 100644 doc/kipper_api_technical_reference.doc delete mode 100644 doc/netboot65.html delete mode 100644 doc/protocol.txt rename {client/drivers => drivers}/Makefile (100%) rename {client/drivers => drivers}/a2_zero_page.s (97%) rename {client/drivers => drivers}/a2charconv.s (96%) rename {client/drivers => drivers}/a2input.s (95%) rename {client/drivers => drivers}/a2kernal.s (97%) rename {client/drivers => drivers}/a2print.s (95%) rename {client/drivers => drivers}/a2timer.s (96%) rename {client/drivers => drivers}/c64_vt100.s (95%) rename {client/drivers => drivers}/c64inputs.s (95%) rename {client/drivers => drivers}/c64kernal.s (96%) rename {client/drivers => drivers}/c64print.s (94%) rename {client/drivers => drivers}/c64timer.s (95%) rename {client/drivers => drivers}/cbm_disk_access.s (95%) rename {client/drivers => drivers}/cs8900a.i (96%) rename {client/drivers => drivers}/cs8900a.s (94%) rename {client/drivers => drivers}/generic_zero_page.s (97%) rename {client/drivers => drivers}/lan91c96.s (95%) rename {client/drivers => drivers}/petscii_charconv.s (97%) rename {client/drivers => drivers}/rr-net.s (96%) rename {client/drivers => drivers}/uthernet.s (96%) rename {client/drivers => drivers}/vic20-rr-net.s (96%) rename {client/drivers => drivers}/vic20input.s (95%) rename {client/drivers => drivers}/vic20print.s (95%) rename {client/drivers => drivers}/vic20timer.s (95%) rename {client/drivers => drivers}/w5100.i (100%) rename {client/drivers => drivers}/w5100.s (95%) rename {client/inc => inc}/common.i (95%) rename {client/inc => inc}/commonprint.i (94%) rename {client/inc => inc}/kipper_constants.i (98%) rename {client/inc => inc}/net.i (95%) rename {client/inc => inc}/printf.i (95%) rename {client/inc => inc}/version.i (100%) rename {client/inc => inc}/vt100_font.bin (100%) rename {client/ip65 => ip65}/Makefile (100%) rename {client/ip65 => ip65}/arithmetic.s (94%) rename {client/ip65 => ip65}/arp.s (95%) rename {client/ip65 => ip65}/cifs.s (95%) rename {client/ip65 => ip65}/config.s (97%) rename {client/ip65 => ip65}/copymem.s (94%) rename {client/ip65 => ip65}/debug.s (95%) rename {client/ip65 => ip65}/dhcp.s (95%) rename {client/ip65 => ip65}/dns.s (96%) rename {client/ip65 => ip65}/dottedquad.s (95%) rename {client/ip65 => ip65}/eth.s (96%) rename {client/ip65 => ip65}/function_dispatcher.s (94%) rename {client/ip65 => ip65}/http.s (95%) rename {client/ip65 => ip65}/httpd.s (94%) rename {client/ip65 => ip65}/icmp.s (95%) rename {client/ip65 => ip65}/ip.s (95%) rename {client/ip65 => ip65}/ip65.s (96%) rename {client/ip65 => ip65}/output_buffer.s (97%) rename {client/ip65 => ip65}/parser.s (95%) rename {client/ip65 => ip65}/printf.s (92%) rename {client/ip65 => ip65}/sntp.s (95%) rename {client/ip65 => ip65}/string_utils.s (94%) rename {client/ip65 => ip65}/tcp.s (96%) rename {client/ip65 => ip65}/telnet.s (95%) rename {client/ip65 => ip65}/tftp.s (96%) rename {client/ip65 => ip65}/timer.s (96%) rename {client/ip65 => ip65}/udp.s (95%) rename {client/ip65 => ip65}/url.s (95%) rename {client/ip65 => ip65}/xmodem.s (94%) rename {client/libnet => libnet}/Makefile (100%) rename {client/libnet => libnet}/c64libnet.cfg (100%) rename {client/libnet => libnet}/libnet.h (100%) rename {client/libnet => libnet}/libnet.s (95%) rename {client/libnet => libnet}/test_sntp.c (100%) delete mode 100644 server/bin/import_ags_games.rb delete mode 100644 server/bin/netboot65_server.rb delete mode 100644 server/bin/tftp_cat.rb delete mode 100644 server/bin/tftp_only_server.rb delete mode 100644 server/lib/SubclassTracking.rb delete mode 100644 server/lib/file_list.rb delete mode 100644 server/lib/tftp_server.rb delete mode 100644 server/lib/tndp.rb delete mode 100644 server/lib/tndp_server.rb delete mode 100644 server/test/tc_file_list.rb delete mode 100644 server/test/tc_test_message_formats.rb delete mode 100644 server/test/tc_test_server.rb delete mode 100644 server/test/ts_test_all.rb rename {client/test => test}/Makefile (100%) rename {client/test => test}/test_cart_api.s (94%) rename {client/test => test}/test_cifs.s (95%) rename {client/test => test}/test_disk_io.s (94%) rename {client/test => test}/test_get_url.s (95%) rename {client/test => test}/test_getc.s (95%) rename {client/test => test}/test_httpd.s (94%) rename {client/test => test}/test_lancegs.s (96%) rename {client/test => test}/test_parse_querystring.s (95%) rename {client/test => test}/test_parser.s (94%) rename {client/test => test}/test_ping.s (95%) rename {client/test => test}/test_sntp.s (95%) rename {client/test => test}/test_tcp.s (93%) rename {client/test => test}/test_vic20.s (95%) rename {client/test => test}/test_vt100.s (95%) rename {client/test => test}/test_wiznet.s (93%) rename {client/test => test}/test_xmodem.s (94%) rename {client/test => test}/testdns.s (95%) rename {client/test => test}/testdottedquad.s (95%) rename {client/test => test}/testtftp.s (95%) diff --git a/Makefile b/Makefile deleted file mode 100644 index 47b521b..0000000 --- a/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -.PHONY: client clean dist distclean - -all: client dist dist-ip65 - -client: - make -C client all - -clean: - make -C client clean - rm -rf dist/netboot65 - rm -rf dist/ip65 - rm -f dist/*.zip - -dist: - rm -rf dist/netboot65 - ruby dist/make_dist.rb - -dist-ip65: - rm -rf dist/ip65 - ruby dist/make_dist_ip65.rb - -distclean: - make -C client distclean - rm -f *~ diff --git a/client/cfg/a2bin.cfg b/cfg/a2bin.cfg similarity index 97% rename from client/cfg/a2bin.cfg rename to cfg/a2bin.cfg index c792f94..775830c 100644 --- a/client/cfg/a2bin.cfg +++ b/cfg/a2bin.cfg @@ -1,25 +1,25 @@ - -MEMORY { - ZP: start = $00, size = $08, type = rw, define = yes; #zero size as we hand allocate all ZP locations - IP65ZP: start = $E0, size = $0, type = rw, define = yes; #zero size as we hand allocate all ZP locations - HEADER: start = $0000, size = $10, file = %O; - RAM: start = $800, size = $8000, file = %O, define=yes; - PAGE3: start = $2C0, size = 272; -} -SEGMENTS { - EXEHDR: load = HEADER, type = ro; - STARTUP: load = RAM,run=RAM, type = ro, define = yes, optional=yes; - CODE: load = RAM, run=RAM, type = ro, define = yes; - RODATA: load = RAM, run=RAM, type = ro , define = yes; - IP65_DEFAULTS: load = RAM, run=RAM, type = ro , define = yes; - DATA: load = RAM, run=RAM, type = rw , define = yes; - PAGE3: load = RAM,run=PAGE3, type = rw, define = yes, optional=yes; - HTTP_VARS: load = RAM, run=RAM, type = rw, optional=yes; - TCP_VARS: load = RAM, type = bss, optional=yes; - APP_SCRATCH: load = RAM, type = bss , optional=yes; - BSS: load=RAM, type = bss, define = yes; - ZEROPAGE: load = ZP, type = zp , optional=yes; - IP65ZP: load = IP65ZP, type = zp,optional=yes; -} - - + +MEMORY { + ZP: start = $00, size = $08, type = rw, define = yes; #zero size as we hand allocate all ZP locations + IP65ZP: start = $E0, size = $0, type = rw, define = yes; #zero size as we hand allocate all ZP locations + HEADER: start = $0000, size = $10, file = %O; + RAM: start = $800, size = $8000, file = %O, define=yes; + PAGE3: start = $2C0, size = 272; +} +SEGMENTS { + EXEHDR: load = HEADER, type = ro; + STARTUP: load = RAM,run=RAM, type = ro, define = yes, optional=yes; + CODE: load = RAM, run=RAM, type = ro, define = yes; + RODATA: load = RAM, run=RAM, type = ro , define = yes; + IP65_DEFAULTS: load = RAM, run=RAM, type = ro , define = yes; + DATA: load = RAM, run=RAM, type = rw , define = yes; + PAGE3: load = RAM,run=PAGE3, type = rw, define = yes, optional=yes; + HTTP_VARS: load = RAM, run=RAM, type = rw, optional=yes; + TCP_VARS: load = RAM, type = bss, optional=yes; + APP_SCRATCH: load = RAM, type = bss , optional=yes; + BSS: load=RAM, type = bss, define = yes; + ZEROPAGE: load = ZP, type = zp , optional=yes; + IP65ZP: load = IP65ZP, type = zp,optional=yes; +} + + diff --git a/client/cfg/c64prg.cfg b/cfg/c64prg.cfg similarity index 98% rename from client/cfg/c64prg.cfg rename to cfg/c64prg.cfg index 2ed6dd2..7a5e6cd 100644 --- a/client/cfg/c64prg.cfg +++ b/cfg/c64prg.cfg @@ -1,29 +1,29 @@ MEMORY { ZP: start = $02, size = $1A, type = rw ; IP65ZP: start = $5f, size = $10, type = rw; - RAM: start = $07FF, size = $77ab, file = %O; - RAM3000: start = $3000, size = $4800, type=rw; - RAM4000: start = $4000, size = $3800, type=rw; - RAM6000: start = $6000, size = $1800, type=rw; + RAM: start = $07FF, size = $77ab, file = %O; + RAM3000: start = $3000, size = $4800, type=rw; + RAM4000: start = $4000, size = $3800, type=rw; + RAM6000: start = $6000, size = $1800, type=rw; DISCARD: start = $77FF, size = $10; } SEGMENTS { STARTUP: load = RAM, type = ro ,define = yes, optional=yes; CODE: load = RAM, type = ro,define = yes; - DATA: load = RAM, type = rw,define = yes; - SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes; + DATA: load = RAM, type = rw,define = yes; + SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes; VIC_DATA: load = RAM, type = rw,align = $800, optional=yes; - RODATA: load = RAM, type = ro,define = yes, optional=yes; - IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes; - BSS: load = RAM, type = bss, optional=yes; - SAFE_BSS: load = RAM3000, type = bss, optional=yes; - BSS4K: load = RAM4000, type = bss, optional=yes; - DATA6K: load = RAM, run = RAM6000, type = rw, define = yes, optional=yes; + RODATA: load = RAM, type = ro,define = yes, optional=yes; + IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes; + BSS: load = RAM, type = bss, optional=yes; + SAFE_BSS: load = RAM3000, type = bss, optional=yes; + BSS4K: load = RAM4000, type = bss, optional=yes; + DATA6K: load = RAM, run = RAM6000, type = rw, define = yes, optional=yes; APP_SCRATCH: load = RAM, type = bss, optional=yes; ZEROPAGE: load = ZP, type = zp, optional=yes; - IP65ZP: load = IP65ZP, type = zp, optional=yes; - EXEHDR: load = DISCARD, type = ro, optional=yes; - TCP_VARS: load = RAM, type = bss, optional=yes; - HTTP_VARS: load = RAM, type = bss, optional=yes; + IP65ZP: load = IP65ZP, type = zp, optional=yes; + EXEHDR: load = DISCARD, type = ro, optional=yes; + TCP_VARS: load = RAM, type = bss, optional=yes; + HTTP_VARS: load = RAM, type = bss, optional=yes; } diff --git a/client/cfg/vic20prg.cfg b/cfg/vic20prg.cfg similarity index 97% rename from client/cfg/vic20prg.cfg rename to cfg/vic20prg.cfg index 7c6c198..98d6b90 100644 --- a/client/cfg/vic20prg.cfg +++ b/cfg/vic20prg.cfg @@ -1,23 +1,23 @@ -#assumes a fully expanded VIC 20 -MEMORY { - ZP: start = $02, size = $1A, type = rw ; - IP65ZP: start = $5f, size = $10, type = rw; - RAM: start = $11FF, size = $6e00, file = %O; -} -SEGMENTS { - STARTUP: load = RAM, type = ro ,define = yes, optional=yes; - CODE: load = RAM, type = ro,define = yes; - DATA: load = RAM, type = rw,define = yes; - SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes; - VIC_DATA: load = RAM, type = rw,align = $800, optional=yes; - RODATA: load = RAM, type = ro,define = yes, optional=yes; - IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes; - BSS: load = RAM, type = bss, optional=yes; -# SAFE_BSS: load = RAM3000, type = bss, optional=yes; - APP_SCRATCH: load = RAM, type = bss, optional=yes; - ZEROPAGE: load = ZP, type = zp, optional=yes; - IP65ZP: load = IP65ZP, type = zp, optional=yes; - TCP_VARS: load = RAM, type = bss, optional=yes; - HTTP_VARS: load = RAM, type = bss, optional=yes; - -} +#assumes a fully expanded VIC 20 +MEMORY { + ZP: start = $02, size = $1A, type = rw ; + IP65ZP: start = $5f, size = $10, type = rw; + RAM: start = $11FF, size = $6e00, file = %O; +} +SEGMENTS { + STARTUP: load = RAM, type = ro ,define = yes, optional=yes; + CODE: load = RAM, type = ro,define = yes; + DATA: load = RAM, type = rw,define = yes; + SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes; + VIC_DATA: load = RAM, type = rw,align = $800, optional=yes; + RODATA: load = RAM, type = ro,define = yes, optional=yes; + IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes; + BSS: load = RAM, type = bss, optional=yes; +# SAFE_BSS: load = RAM3000, type = bss, optional=yes; + APP_SCRATCH: load = RAM, type = bss, optional=yes; + ZEROPAGE: load = ZP, type = zp, optional=yes; + IP65ZP: load = IP65ZP, type = zp, optional=yes; + TCP_VARS: load = RAM, type = bss, optional=yes; + HTTP_VARS: load = RAM, type = bss, optional=yes; + +} diff --git a/client/Makefile b/client/Makefile deleted file mode 100644 index 544281c..0000000 --- a/client/Makefile +++ /dev/null @@ -1,61 +0,0 @@ - -.PHONY: ip65 drivers test clean distclean kipperterm2 examples carts basic wiznet a2 - - -all: ip65 drivers test carts examples basic kipperterm2 wiznet a2 - -ip65: - make -C ip65 all - -drivers: - make -C drivers all - -examples: - make -C examples all - -a2: - make -C a2 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 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 *~ diff --git a/client/a2/Makefile b/client/a2/Makefile deleted file mode 100644 index 62ad876..0000000 --- a/client/a2/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -CC=cl65 -AS=ca65 -LD=ld65 -CFLAGS=-Oirs -t $(TARGET) -AFLAGS= - - - -IP65LIB=../ip65/ip65.lib -IP65TCPLIB=../ip65/ip65_tcp.lib -A2UTHERLIB=../drivers/a2uther.lib - -INCFILES=\ - ../inc/common.i\ - ../inc/commonprint.i\ - ../inc/net.i\ - -all: \ - ip65 \ - drivers \ - amper.dsk \ - - -ip65: - make -C ../ip65 all - -drivers: - make -C ../drivers all - -%.o: %.s - $(AS) $(AFLAGS) $< - -#tokenize_asoft comes from http://www.deater.net/weave/vmwprod/apple/dos33fs.html -%.bas: %.applesoft - tokenize_asoft < $*.applesoft > $*.bas - -%.pg2: %.o $(IP65LIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg - $(LD) -vm --mapfile $*.map -C ../cfg/a2bin.cfg -o $*.pg2 $(AFLAGS) $< $(IP65TCPLIB) $(A2UTHERLIB) - -amper.dsk: autoexec.bas amper.pg2 hello.bas - ripxplore.rb amper.dsk --init AppleDos - ripxplore.rb amper.dsk -a amper.pg2 -t AppleBinary - cp hello.bas hello - ripxplore.rb amper.dsk -a hello -t Applesoft - rm hello - ripxplore.rb amper.dsk -a autoexec.bas -t Applesoft - -clean: - rm -f *.o *.pg2 *.map *.lst - rm -f ip65test.dsk - rm -f amper.dsk - -distclean: clean - rm -f *~ diff --git a/client/a2/amper.s b/client/a2/amper.s deleted file mode 100644 index c0b9863..0000000 --- a/client/a2/amper.s +++ /dev/null @@ -1,646 +0,0 @@ - .include "../inc/common.i" - .include "../inc/commonprint.i" - .include "../inc/a2const.i" - .include "../inc/net.i" - - .import exit_to_basic - .import cfg_get_configuration_ptr - .import dns_ip - .import dns_resolve - .import dns_set_hostname - .import icmp_ping - .import icmp_echo_ip - - - .import copymem - .importzp copy_src - - .importzp copy_dest - .importzp buffer_ptr - .importzp scratch_ptr - - .import http_parse_request - .import http_get_value - .import http_variables_buffer - - .import tcp_inbound_data_ptr - .import tcp_inbound_data_length - .import tcp_send_data_len - .import tcp_send - .import check_for_abort_key - .import tcp_connect_remote_port - .import tcp_remote_ip - .import tcp_listen - .import tcp_callback - .import tcp_close - - .import __CODE_LOAD__ - .import __CODE_SIZE__ - .import __RODATA_SIZE__ - .import __DATA_SIZE__ - .import __IP65_DEFAULTS_SIZE__ - .import __BSS_RUN__ - .import __BSS_SIZE__ - - END_OF_BSS = __BSS_RUN__+__BSS_SIZE__ - -.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2 - .addr __CODE_LOAD__-$03 ; Start address - .word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+__IP65_DEFAULTS_SIZE__+4 ; file size - jmp init -.code - -init: - jsr ip65_init - bcc @init_ok - ldax #@no_nic - jsr print - - jmp exit_to_basic -@no_nic: - .byte "NO NIC - UNINSTALLING",0 -@install_msg: - .byte " FOUND",13,"APPLESOFT.NET USING $801-$" - - .byte 0 -@init_ok: - ;print the banner - ldax #eth_driver_name - jsr print_ascii_as_native - ldax #@install_msg - jsr print - print_hex_double #END_OF_BSS - jsr print_cr - - ;take over the ampersand vector - ldax AMPERSAND_VECTOR+1 - stax old_amper_handler - ldax #amper_handler - stax AMPERSAND_VECTOR+1 - - lda #$FF - sta CURLIN+1 ;put into 'immediate' mode - ldax #END_OF_BSS+1 - stax TXTTAB - lda #0 - sta END_OF_BSS ;if the byte before the start of the BASIC is not zero, we - ;get a weird 'SYNTAX ERROR IN LINE' because - ;STXTPT (called by RUN) sets TXTPTR (address of next BASIC token) to be TXTTAB-1 - ;if this byte is zero, then NEWSTT tries to execute that byte - jsr SCRTCH ;reset BASIC now we have updated the start address - lday #chain_cmd - jsr STROUT - jmp exit_to_basic - -print_error: - jsr print - ldax #error - jsr print - lda ip65_error - jsr print_hex - jsr print_cr - sec - rts -amper_handler: - ;see if & is followed by one of our keywords - - ldx #0 - ldy #0 - lda keyword_table - -@check_one_handler: - cmp #$FF ;end of table? - beq exit_to_old_handler - cmp (TXTPTR),y ;char in line - beq @this_char_ok -@skip_to_next_handler_loop: - inx - lda keyword_table,x - bne @skip_to_next_handler_loop - inx ;skip first part of handler address - inx ;skip next part of handler address - ldy #$FF -@this_char_ok: - iny - inx - lda keyword_table,x ;get cmd char - bne @check_one_handler - ;if we get here, we have matched a keyword, and X points to the zero terminating the keyword, Y is length of keyword - lda keyword_table+2,x ;get high byte of handler address - pha - lda keyword_table+1,x ;get low byte of handler address - pha - jmp ADDON ;fix-up TXTPTR - on return control will transfer to address we just pushed - -exit_to_old_handler: - jmp $ffff -old_amper_handler=exit_to_old_handler+1 - - get_optional_byte: - jsr CHRGOT - beq @no_param ;leave X as it was - jmp COMBYTE -@no_param: - rts - -extract_string: - jsr FRMEVL - jsr FRESTR ;if not string, will create type mismatch error - sta param_length - tay - lda #0 - sta transfer_buffer,y - dey -@loop: - lda (INDEX),y - sta transfer_buffer,y - dey - bpl @loop - rts - -get_ip_parameter: - stax buffer_ptr - jsr extract_string - ldax #transfer_buffer - - jsr dns_set_hostname - - bcs @error - jsr dns_resolve - bcc @ok -@error: - ldax #address_resolution - jmp print_error - -@ok: - ldax #dns_ip - ldx #4 -@copy_dns_ip: - lda dns_ip,y - sta (buffer_ptr),y - iny - dex - bne @copy_dns_ip - rts - -ipcfg_handler: - jmp print_ip_config - -ping_handler: - ldax #icmp_echo_ip - jsr get_ip_parameter - bcc @no_error - rts -@no_error: - ;is there an optional parameter? - ldx #3 - jsr get_optional_byte - stx ping_counter - - ldax #pinging - jsr print - ldax #dns_ip - jsr print_dotted_quad - jsr print_cr - -@ping_loop: - jsr icmp_ping - bcs @error - lda #'.' -@print_and_loop: - jsr print_a - lda $c000 ;key pressed - sta $c010 ;clear keyboard - cmp #$9B ;escape - beq @done - dec ping_counter - bne @ping_loop -@done: - jmp print_cr -@error: - lda #'!' - jmp @print_and_loop - - -dhcp_handler: - jsr dhcp_init - bcc @init_ok - jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to default values) - -@init_failed: - ldax #dhcp - jmp print_error -@init_ok: - rts - -myip_handler: - ldax #cfg_ip - jmp get_ip_parameter - -dns_handler: - ldax #cfg_dns - jmp get_ip_parameter - -gateway_handler: - ldax #cfg_gateway - jmp get_ip_parameter - -netmask_handler: - ldax #cfg_netmask - jmp get_ip_parameter - - -skip_comma_get_integer: - jsr CHKCOM - get_integer: - jsr CHRGOT - jsr LINGET - ldax LINNUM - rts - - -httpd_handler: - jsr flush_handler ;clean out the last connection - jsr get_integer - stax httpd_port_number - tsx - stx top_of_stack - ldax #__http_variables_buffer - stax http_variables_buffer - - ldax #listening - jsr print - ldax #cfg_ip - jsr print_dotted_quad - lda #':' - jsr print_a - ldax httpd_port_number - jsr print_integer - jsr print_cr - -@listen: - jsr tcp_close - ldax httpd_io_buffer - stax tcp_buffer_ptr - - ldax #http_callback - stax tcp_callback - ldax httpd_port_number - - jsr tcp_listen - bcc @connect_ok - jmp END4 - -@connect_ok: - ldax #connection_from - jsr print - ldax #tcp_remote_ip - jsr print_dotted_quad - lda #':' - jsr print_a - ldax tcp_connect_remote_port - - jsr print_integer - jsr print_cr - lda #0 - sta connection_closed - sta found_eol - sta polling_counter - -@main_polling_loop: - jsr ip65_process - jsr ISCNTC ;check for ^C, if so print error message, warm start BASIC - - lda found_eol - bne @got_eol - lda #75 - jsr $fca8 ;wait for about 15ms - this gives a total timeout of ~4seconds - inc polling_counter - bne @main_polling_loop - jmp @listen - -@got_eol: - - jsr reset_output_buffer - - ldy #$FF -: - iny - lda status_ok,y - sta status_code_buffer,y - bne :- - - ldy #$FF -: - iny - lda text_html,y - sta content_type_buffer,y - bne :- - - sta sent_header - - ldax httpd_io_buffer - jmp got_http_request - -http_callback: - lda tcp_inbound_data_length+1 - cmp #$ff - bne @not_eof - inc connection_closed -@done: - rts -@not_eof: - lda found_eol - bne @done - -;copy this chunk to our input buffer - ldax tcp_buffer_ptr - stax copy_dest - ldax tcp_inbound_data_ptr - stax copy_src - ldax tcp_inbound_data_length - jsr copymem - -;increment the pointer into the input buffer - clc - lda tcp_buffer_ptr - adc tcp_inbound_data_length - sta tcp_buffer_ptr - sta copy_src - lda tcp_buffer_ptr+1 - adc tcp_inbound_data_length+1 - sta tcp_buffer_ptr+1 - sta copy_src+1 - -;put a null byte at the end (assumes we have set copy_src already) - lda #0 - tay - sta (copy_src),y - -;look for CR or LF in input - sta found_eol - ldax httpd_io_buffer - stax get_next_byte+1 - -@look_for_eol: - jsr get_next_byte - cmp #$0a - beq @found_eol - cmp #$0d - bne @not_eol -@found_eol: - inc found_eol - rts -@not_eol: - cmp #0 - bne @look_for_eol - rts - -send_buffer: - ldax output_buffer_length - stax tcp_send_data_len - ldax httpd_io_buffer - jsr tcp_send - -reset_output_buffer: - ldax httpd_io_buffer - sta xmit_a_ptr+1 - stx xmit_a_ptr+2 - lda #0 - sta output_buffer_length - sta output_buffer_length+1 - rts - - -emit_string: - stax scratch_ptr - ldy #0 -@next_byte: - lda (scratch_ptr),y - beq @done - jsr xmit_a - iny - bne @next_byte -@done: - rts - -got_http_request: - - jsr http_parse_request - - ldax #path - jsr print - lda #$02 - jsr http_get_value - stax scratch_ptr - jsr print - jsr print_cr - - ldy #0 -@find_null: - lda (scratch_ptr),y - beq @found_null - iny - bne @find_null -@found_null: - sty param_length - - lda #'P' - sta VARNAM - lda #'A'+$80 - sta VARNAM+1 - - jsr GETVAR ;find the variable of this name (or else make a blank one) - lda param_length - jsr GETSPA ;create space in the string table of appropriate length - ldy #$00 ;set up string variable pointer - sta (VARPNT),Y ;string length - iny - lda FRESPC ;lo byte of area just reserved - sta (VARPNT),Y - iny - lda FRESPC+1 ;hi byte of area just reserved - sta (VARPNT),Y - - ldx scratch_ptr - ldy scratch_ptr+1 - lda param_length - jsr MOVSTR - - ;now restore stack to how it was when &HTTPD was called, and return to BASIC - ldx top_of_stack - txs - rts - - -bang_handler: - jsr extract_string - lda sent_header - bne :+ - jsr send_header -: - ldy #0 - sty string_ptr -@loop: - lda transfer_buffer,y - jsr xmit_a - inc string_ptr - ldy string_ptr - cpy param_length - bne @loop - rts - -send_header: - inc sent_header - ldax #http_version - jsr emit_string - ldax #status_code_buffer - jsr emit_string - ldax #crlf - jsr emit_string - ldax #content_type - jsr emit_string - ldax #content_type_buffer - jsr emit_string - ldax #end_of_header - jsr emit_string - -flush_handler: - lda output_buffer_length - bne :+ - ldx output_buffer_length+1 - bne :+ - rts -: - jmp send_buffer - -.rodata -keyword_table: -.byte "IPCFG",0 -.word ipcfg_handler-1 -.byte "DHCP",0 -.word dhcp_handler-1 -.byte "PING",0 -.word ping_handler-1 -.byte "MYIP",0 -.word myip_handler-1 -.byte "DNS",0 -.word dns_handler-1 -.byte "G",$c5,"EWAY",0 ;$C5 is token for 'AT' -.word gateway_handler-1 -.byte "NETMASK",0 -.word netmask_handler-1 -.byte "HTTPD",0 -.word httpd_handler-1 -.byte "!",0 -.word bang_handler-1 -.byte "FLUSH",0 -.word flush_handler-1 - -.byte $ff - -keyword_table_size=*-keyword_table -.if keyword_table_size>255 - .error "KEYWORD TABLE TOO BIG!" -.endif - -CR=$0D -LF=$0A - -dhcp: -.byte "DHCP",0 -address_resolution: -.byte "ADDRESS RESOLUTION",0 -error: -.byte " ERROR $",0 -pinging: -.byte "PINGING ",0 - -path: - .byte "PATH: ",0 -http_version: - .byte "HTTP/1.0 ",0 - -status_ok: - .byte "200 OK",0 -status_error: - .byte "500 " -system_error: - .byte "SYSTEM ERROR",0 -content_type: - .byte "Content-Type: ",0 -text_html: - .byte "text/html",0 - -end_of_header: - .byte CR,LF - .byte "Connection: Close",CR,LF - .byte "Server: AppleSoft.NET/0.2",CR,LF -crlf: - .byte CR,LF,0 - -connection_from: .byte "CONNECTION FROM ",0 -chain_cmd: - -.byte 13,4,"RUN AUTOEXEC.BAS",13,0 - -listening: -.byte"LISTENING ON ",0 - - - -.data - - -httpd_io_buffer: .word __httpd_io_buffer -httpd_port_number: .word 80 - - -get_next_byte: - lda $ffff - inc get_next_byte+1 - bne @skip - inc get_next_byte+2 -@skip: - rts - - -xmit_a: - -xmit_a_ptr: - sta $ffff - inc xmit_a_ptr+1 - bne :+ - inc xmit_a_ptr+2 -: - inc output_buffer_length - bne :+ - inc output_buffer_length+1 - lda output_buffer_length+1 - cmp #2 - bne :+ - stx temp_x - jsr send_buffer - ldx temp_x -: - rts - -.bss - -param_length: .res 1 -ping_counter: .res 1 -handler_address: .res 2 -temp_x: .res 1 -output_buffer_length: .res 2 -sent_header: .res 1 -content_type_buffer: .res 128 -status_code_buffer: .res 128 -found_eol: .byte 0 -connection_closed: .byte 0 -tcp_buffer_ptr: .res 2 -top_of_stack: .res 1 -polling_counter: .res 1 -string_ptr: .res 1 -transfer_buffer: .res 256 -__http_variables_buffer: .res 256; temp buffer for storing variables -__httpd_io_buffer: .res 1024 ;temp buffer for storing inbound requests. diff --git a/client/a2/autoexec.applesoft b/client/a2/autoexec.applesoft deleted file mode 100644 index f3cc47e..0000000 --- a/client/a2/autoexec.applesoft +++ /dev/null @@ -1,17 +0,0 @@ -10 PRINT "HELLO FROM BASIC" -20 &MYIP"1.2.3.4" -21 &NETMASK"255.0.255.0" -22 &GATEWAY"7.6.5.4" -23 &DNS"8.8.7.6" -25 &IPCFG -30 &DHCP -40 &IPCFG -50 &PING "192.168.10.2" -60 &PING "192.168.10.2" , 5 -70 PA$="DUMMY" -100 &HTTPD 8080 -1000 PRINT "HELLO FOO!" -1005 PRINT PA$ -1010 &!"HOWDY DOODY DOO!" -1020 &FLUSH -1030 GOTO 100 \ No newline at end of file diff --git a/client/a2/autoexec.bas b/client/a2/autoexec.bas deleted file mode 100644 index 068853e6f811a2f15aac162ee6f2e4f82a371967..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 297 zcmZvXJxjzu7=%Y6^2Sp9;0h)8B67vCB+;BJ*u;Eel3h%WBiP#7Tig3HtghJp8Y^r4 z1=co#*a;R!MJt;ro|$2o(b9lcvEV!@OXZ|zs&Y=krid70T8F8+LbE4)u`do7DQ&>i zNn3@@Df>YnT=A`pbJ~Q-?vq*A@u8TA;46MfTQG6muoP1ClyOA^m_kQshHKjC%{!ACR?Q+b$lTusbGXWiM| z#F?>O;!V_M_26#vcB;T7NLzE^(OJvl|WWL?s06)#zXz1EDM zMQ2#uf8X9~g`@5HDNS$u&j;fled%G%gaE71i7aLSkRYAIZ{J;97AvHPL zH7$+TYUicvYI4?>t1XSgv~zqzg|D~dkvi=h_kVklc|XXz$mxr+fqZmPR@fc~d%|Ci zQx{)yB2scbA{)e>h}acTIwIod5!oo7ipXa1bR=**QdE3~o&F}Wh6z!b^Y)m%E6n7T zh_CmJl9Lg>Wd|VetGvqbNapD?EI#asXCmzo@5h8-@0$q3VW%$Dr92Z40c0D5%{*Zc zd+Q)8IN4uF35eGXS7#6mmpH@s5iY`U#*>!>1ArL5`hfFs zlCh{}^7P4E1N&RgZR_lq>pAV?)@hx-IZ>`*?7d#Dq0RoSkhywH$qGwUY>bvPX8eo7 zHMrB{UhjW24l8bSy1FE@(?#mH6lp#3VX|e5OxZ?(%{pnWW~%2J=J#%+(Xm@A#&{ux z;>IHFq(7}|J{LO}Tw&=uTF-53(YpG=k!@S#Pk&76B-`tS4df2dg%qa?qCnn)#QEm7 zWqc1&7jO;Z*k9@7mZmiAq#%(Z{V@n^|32@q_Dxr8ua#hW+epr>(qM47S>1X@SA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{6L5?^1IL=j4;@IkO8K^Bhxd zojL8cR48uJegD(S{NGic!9Okq{CDMm>7oD%pa2S>01BW03ZMWApa2S>!2cfs_P;-q zuJZo^bXk4~KL1~)z)uuF0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$ z0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(1 z6hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwK zKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$ z0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(1 z6hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwK zKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$ N0Te(16!;T?{{$U>Bb@*M diff --git a/client/a2/make b/client/a2/make deleted file mode 100644 index 925025dc4d8dba4015c2083b30c491ce40815d96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 143360 zcmeIuF%Ez*2nEpJcmeAbyk!q>>(bf5F2+X!EQG*I1OWmB2oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PJ^>pq4GUo?dNp;3&zt=dMZb?{dYC6*tV^bOHnj z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N K0t5(rSzrJ?reSpe diff --git a/client/basic/BoB.htm b/client/basic/BoB.htm deleted file mode 100644 index ef84c8c..0000000 --- a/client/basic/BoB.htm +++ /dev/null @@ -1,189 +0,0 @@ -

BASIC ON BAILS

-

COMMAND SUMMARY

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescrptionParametersExample
IPCFGDisplay the current IP stack configurationnone
  • IPCFG
  • MACSet the last 3 bytes of the MAC address. Top 3 bytes will always be "00:80:10".
    This command - also resets the whole IP stack, so new IP address will need to be assigned (via MYIP or DHCP) after calling MAC
    3 byte string
  • MAC "FOO" - MAC will become 00:80:10:46:4F:4F (in PETSCII, $46 is 'F' and $4F is 'O')
  • DHCPUse DHCP to assign IP address, netmask, default gateway and DNS server none
  • DHCP
  • MYIPAssign a new IP address
  • IP address (string)
  • MYIP"10.1.1.2"
  • NETMASKAssign a new netmask
  • netmask (string)
  • NETMASK"255.255.255.0"
  • GATEWAYAssign a new default gateway (router to send non-local traffic to)
  • gateway IP address (string)
  • GATEWAY"10.1.1.1"
  • DNSSpecify the DNS server to be used for resolving hostnames
  • DNS server IP address (string)
  • DNS"10.1.1.1"
  • PINGSends a number of ICMP echo requests to the specified host. For each packet sent, if a response is received a "." is displayed, if an error occurs (including a timeout) then a "!" is displayed.
  • hostname or IP ddress (string)
  • [optional] number of PING request to be sent (1..255) - default is 3
  • PING"JAMTRONIX.COM"
  • PING"10.1.1.1",10
  • HTTPDstart listening on a TCP port for inbound HTTP requests. When a HTTP request is received, go to the specified -default line number, unless the request happens to be for a path that has previously been HOOKed
  • port number (1..65535)
  • line number (1..65535)
  • HTTPD80,100 - will listen on port 80 and GOTO line 100 when a HTTP request is received
  • HOOKsociate the 'path' part of a URL with a BASIC line number to jump to when a request for the specified path is received
  • path (string) - must start with "/"
  • line number (1..65535)
  • HOOK"/HELLO",200 - line 200 will be executed if request for "/HELLO" is received
  • TYPEchange the HTTP Content Type field in the HTTP header -from the default "text/html" to whatever is specified. Be careful with -case - the remote end will be expecting ASCII not PETSCII! For this to be effective, it must -be set BEFORE any data is output with the ! or XSEND keywords
  • mime type (string)
  • TYPE"application/octet-stream"
  • STATUSchange the HTTP status line from default -"200 OK". Be careful you include the 3 digit code (as an ASCII string) -then a space then a free form status description (ASCII NOT PETSCII). -To be effective, it must be set BEFORE any data is output with the ! or XSEND keywords
  • HTTP status line (string)
  • STATUS"404 File Not Found"
  • !Send specified string expression. If no -HTTP header has been sent yet, one will be sent now. -
  • string to output
  • !"<H1>HELLO WORLD</H1>"
  • XSENDSend a file from the default drive. If the file does -not exist, then an error message will be sent to the remote browser. If no HTTP header has -been sent yet, one will be sent first.
  • filename (string)
  • XSEND"FAVICON.ICO"
  • YIELDfinish processing the current request, go back and wait for -another HTTP request.
  • none
  • YIELD
  • -

    Magic Variables

    -The following BASIC variables are set by BASIC ON BAILS whenever a HTTP request is being handled. -

    PA$

    -Set to the "path" part of the HTTP request. -

    Query String Variables

    -For each variable in the query string part of the HTTP request,the value is -decoded and stuck into a BASIC string variable. -
    -
    -Only the first letter of the query string variable is significant, -i.e. query strings N, NA, NAME, all would map to N$. -
    -
    -If there are multiple query string variables that all start with the -same letter, the LAST such variable in the query string is the one -that would be effective -.e.g if BASIC ON BAILS is processing a HTTP request with a query string /FOO?N=1&NA=2?NAME=3 then -in the BASIC handler, N$ would be "3", and NA$ and NAME$ would be -empty (BASIC only treats first 2 chars as significant anyway, so NA$ -is same as NAME$) -
    -

    STARTUP

    -If you try and load BASIC ON BAILS twice (or some other BASIC extender before BASIC ON BAILS) you will get an 'insufficient memory' error. -
    -
    - -After BASIC ON BAILS has been installed, it will attempt to load (and run) a file (from whatever device BASIC ON BAILS was loaded from itself) called "INDEX.BAS". -If this file does not exist, then BASIC ON BAILS will exit with 'FILE NOT FOUND ERROR IN 10". This error can be ignored - you can load any file you want from then, or type -in a new one, or even use the commands in interactive mode. -
    -
    -

    ERROR HANDLING

    -Before HTTPD is called, BASIC errors are treated normally, i.e. on a SYNTAX ERROR or TYPE MISMATCH error, an error will be displayed on the screen, and -program execution will stop. But once you have fired up HTTPD, any BASIC errors are displayed on the -screen AND passed back to the browser as a HTTP error, and are non-fatal i.e. the HTTPD loop will keep running. You can exit HTTPD by -pressing RUN/STOP though. -

    EXAMPLE

    -
    -
    -5 MAC CHR$(192)+CHR$(29)+CHR$(85)
    -10 DHCP
    -20 HOOK"/HELLO",1000 
    -25 FA$="/"+CHR$(102)+CHR$(97)+CHR$(118)+CHR$(105)+CHR$(99)+CHR$(111)
    -27 FA$=FA$+CHR$(110)+CHR$(46)+CHR$(105)+CHR$(99)+CHR$(111)
    -30 HOOKFA$,2000
    -40 HTTPD80,100
    -
    -100 !"<H1>HELLO</H1>"
    -110 !"<FORM ACTION=/HELLO>"
    -120 !"WHAT'S YOUR NAME?"
    -130 !"<INPUT TYPE=TEXT NAME=N>"
    -140 !"</FORM>"
    -200 YIELD
    -
    -1000!"HELLO "+N$+", I'M A C64 RUNNING BASIC ON BAILS."
    -1010 FOR I=1 TO 10
    -1020 !"<BR>"
    -1030 !STR$(I)
    -1040 NEXT I
    -1100 YIELD
    -
    -2000 TYPE"IMAGE/X-ICON"
    -2010 XSEND"FAVICON.ICO"
    -2020 YIELD
    -
    -
    -
    - - diff --git a/client/basic/KB.htm b/client/basic/KB.htm deleted file mode 100644 index bfba08f..0000000 --- a/client/basic/KB.htm +++ /dev/null @@ -1,193 +0,0 @@ -

    KIPPER BASIC

    -

    COMMAND SUMMARY

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CommandDescrptionParametersExample
    IPCFGDisplay the current IP stack configurationnone
  • IPCFG
  • MACSet the last 3 bytes of the MAC address. Top 3 bytes will always be "00:80:10".
    This command - also resets the whole IP stack, so new IP address will need to be assigned (via MYIP or DHCP) after calling MAC
    3 byte string
  • MAC "FOO" - MAC will become 00:80:10:46:4F:4F (in PETSCII, $46 is 'F' and $4F is 'O')
  • DHCPUse DHCP to assign IP address, netmask, default gateway and DNS server none
  • DHCP
  • MYIPAssign a new IP address
  • IP address (string)
  • MYIP"10.1.1.2"
  • NETMASKAssign a new netmask
  • netmask (string)
  • NETMASK"255.255.255.0"
  • GATEWAYAssign a new default gateway (router to send non-local traffic to)
  • gateway IP address (string)
  • GATEWAY"10.1.1.1"
  • DNSSpecify the DNS server to be used for resolving hostnames
  • DNS server IP address (string)
  • DNS"10.1.1.1"
  • TFTPSpecify the TFTP server that will be accessed by TFPUT and TFGET.
  • TFTP server IP address or hostname (string)
  • TFTP"10.1.1.5"
  • TFTP"JAMTRONIX.COM"
  • PINGSends a number of ICMP echo requests to the specified host. For each packet sent, if a response is received a "." is displayed, if an error occurs (including a timeout) then a "!" is displayed.
  • hostname or IP ddress (string)
  • [optional] number of PING request to be sent (1..255) - default is 3
  • PING"JAMTRONIX.COM"
  • PING"10.1.1.1",10
  • NETCATOpen a TCP connection to a remote server. Any data received on the connection will be displayed on screen, any keypress will be sent to the remote server. To exit, hit RUN/STOP.

    The optional mode paramater determines whether the connection should be in PETSCII 'char at a time' mode, where every keypress is sent 'as is' to the remote site, or ASCII 'line mode', which allows a line to be edited and is sent (with a CR/LF at the end) only when the RETURN key is pressed. In this mode, data is converted between the PETSCII character set and standard ASCII - you will need to shift to the "lower case" char set for this to display properly. -

    The PETSCII mode is appropriate for connecting to e.g. a PETSCII BBS. The ASCII mode is appropriate for connecting to a server running a "network ASCII" derived protocol, e.g. SMTP or HTTP. - ' - -
  • hostname or IP ddress (string)
  • port number (1..65535)
  • [optional] mode:
    • 0=PETSCII (default)
    • 1=ASCII
  • NETCAT"JAMTRONIX.COM",6464
  • NETCAT"10.1.1.1",25,1
  • TFPUTUpload a file to a TFTP server. By default, TFPUT will use the broadcast address (255.255.255.255), meaning -any TFTP server on the LAN will respond. To send a file to a specific TFTP server (including one not on the local network), specify the -destination TFTP server with the "TFTP" command prior to calling TFPUT. The filename specified will be looked for on whichever drive was last accessed.
  • filename (string)
  • TFPUT"KIPPERBAS.PRG"
  • TFGETDownload a file from a TFTP server. By default, TFPUT will use the broadcast address (255.255.255.255), meaning -any TFTP server on the LAN will respond. To download a file from a specific TFTP server (including one not on the local network), specify the -destination TFTP server with the "TFTP" command prior to calling TFGET. The file will be written (as a PRG file) to whichever drive was last accessed.
  • filename (string)
  • TFGET"KIPPERBAS.PRG"
  • TCPCONNECTOpen a TCP connection to a remote server.
  • hostname or IP address (string)
  • port number (1..65535)
  • TCPCONNECT"JAMTRONIX.COM",70
  • TCPCONNECT"10.1.1.1",80
  • TCPLISTENWait for an inbound TCP connection from a remote client. This is a blocking command, i.e. the BASIC program will not continue executing until either an inbound connection is made, or the program is terminated by pressing RUN/STOP
  • port number (1..65535)
  • TCPLISTEN 80
  • POLLCheck for network traffic. If data has arrived on a previously opened TCP connection, that data (up to a maximum of 255 bytes) will be set into string variable IN$.If no data has arrived since the last POLL, then IN$ will be an empty string. Integer variables CO% and ER% -are also set to indicate current connection state and error conditions (if any). - - -nonePOLL
    TCPSENDSend 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. 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.
  • data (string)
  • TCPSEND"HELLO "+"WORLD"
  • TCPBLATSend 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. 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.
  • filename (string)
  • TCPBLAT"GOPHERMAP.TXT"
  • UDPSENDSend a string (up to 255 bytes) over UDP . There is no need to connect first -
  • destination hostname or IP address (string) -
  • destination port number (1..65535) -
  • local port number (1..65535) -
  • data (string) -
  • UDPSEND"JAMTRONIX.COM",7,6464,"echo test"
  • - -

    Magic Variables

    -The following BASIC variables are set by the TCP commands and POLL. -

    CO%

    -
  • CO%=1 means there is a current TCP connection
  • -
  • CO%=0 means there is no current TCP connection (either one has never been opened, or else it has been closed) - -

    ER%

    -ER% is set to indicate any error occuring inside the ip65 TCP/IP stack that Kipper BASIC is built on top of. -Possible values: - - - - - - - - - - - - - - - - - - - -
    ERROR CODE
    HEX / DEC
    DESCRIPTION
    $80 / 128PORT IN USE
    $81 / 129TIMEOUT ON RECEIVE
    $82 / 130TRANSMIT FAILED
    $83 / 131TRANSMISSION REJECTED BY PEER
    $84 / 132INPUT TOO LARGE
    $85 / 133DEVICE FAILURE
    $86 / 134ABORTED BY USER
    $87 / 135LISTENER NOT AVAILABLE
    $88 / 136NO SUCH LISTENER
    $89 / 137CONNECTION RESET BY PEER
    $8A / 138CONNECTION CLOSED
    $8B / 139TOO MANY ERRORS
    $90 / 140FILE ACCESS FAILURE
    $A0 / 160MALFORMED URL
    $A1 / 161DNS LOOKUP FAILED
    $FE / 254OPTION NOT SUPPORTED
    $FF / 255FUNCTION NOT SUPPORTED
    - -

    STARTUP

    -If you try and load Kipper BASIC twice (or some other BASIC extender before Kipper BASIC) you will get an 'insufficient memory' error. -
    -
    - -After Kipper BASIC has been installed, it will attempt to load (and run) a file (from whatever device Kipper BASIC was loaded from) called "AUTOEXEC.BAS". -If this file does not exist, then Kipper BASIC will exit with 'FILE NOT FOUND ERROR IN 10". This error can be ignored - you can load any file you want from then, or type -in a new one, or even use the commands in interactive mode. -
    -
    -For example, try: -
    -DHCP:NETCAT"JAMTRONIX.COM",6464
    -
    - - diff --git a/client/basic/Makefile b/client/basic/Makefile deleted file mode 100644 index c2d6d83..0000000 --- a/client/basic/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -AS=ca65 -LD=ld65 -CFLAGS=-Oirs -t $(TARGET) -AFLAGS= - -INCFILES=\ - ../inc/common.i\ - ../inc/commonprint.i\ - ../inc/net.i\ - ../inc/menu.i\ - ../inc/kipper_constants.i\ - ../inc/version.i\ - -IP65LIB=../ip65/ip65_tcp.lib -C64RRNETLIB=../drivers/c64rrnet.lib -VIC20RRNETLIB=../drivers/vic20rrnet.lib - -all: ip65 kipperbas.d64 bails.d64 kipperbasv20.prg - -ip65: - make -C ../ip65 all - -%.o: %.s $(INCFILES) timestamp.rb - ruby timestamp.rb > timestamp.i - $(AS) $(AFLAGS) $< - -%.prg: %.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/kipperbas.cfg - $(LD) -m $*.map -vm -C ../cfg/kipperbas.cfg -o $*.prg $(AFLAGS) $< $(IP65LIB) $(C64RRNETLIB) - -kipperbasv20.prg: kipperbasv20.o $(IP65LIB) $(VIC20RRNETLIB) $(INCFILES) ../cfg/kipperbasv20.cfg - $(LD) -m kipperbasv20.map -vm -C ../cfg/kipperbasv20.cfg -o kipperbasv20.prg $(AFLAGS) $< $(IP65LIB) $(VIC20RRNETLIB) - - -bails.d64: bails.prg - c1541 -format bails,bb d64 $@ -attach $@ -write bails.prg - -kipperbas.d64: kipperbas.prg - c1541 -format kipperbas,kb d64 $@ -attach $@ -write kipperbas.prg - -clean: - rm -f *.o *.bin *.map *.prg - -distclean: clean - rm -f *~ diff --git a/client/basic/addresses.txt b/client/basic/addresses.txt deleted file mode 100644 index b65da5a..0000000 --- a/client/basic/addresses.txt +++ /dev/null @@ -1,14 +0,0 @@ -1FLOODGAP GOPHER / GOPHER.FLOODGAP.COM 70 -8JAMTRONIX PETSCIIMATION /n JAMTRONIX.COM 6464 -8ANTIDOTE /n ANTIDOTE.HOPTO.ORG 23 -8EXCALIBUR'S STONE /n BBS.EXCALIBURSSTONE.COM 6400 -8JAMMING SIGNAL /n BBS.JAMMINGSIGNAL.COM 23 -8MAD WORLD /n MADWORLD.BOUNCEME.NET 23 -8REALMS OF MYSTERY /n BBS.PIPESUP.CA 6400 -8RIKTRONICS /n RKBBS.NET 23 -8WIZARD'S REALM /n WIZBBS.DYNDNS.ORG 23 -8COTTONWOOD BBS /n COTTONWOOD.SERVEBBS.COM 23 -8COTTONWOOD II /n COTTONWOOD.SERVEBBS.COM 6400 -8THE HIDDEN /n THE-HIDDEN.HOPTO.ORG 23 - -. \ No newline at end of file diff --git a/client/basic/bails.d64 b/client/basic/bails.d64 deleted file mode 100644 index f55ff1681a4ac3780a67d5ba0756a7a6f4fba93d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 174848 zcmeI&4|Eh&o-gp~bka#WBy=EPi$P2NgZv3dAOuG9{|^*NNP>VfBNa%X3c;QoQ`z#o zyYm4V(`v|rBBk^^ifr=aahmNPK*1JZgN@+7yBa1Dw)c#Q;OoBq1&40gr26kPw06X zcS6tATqpEmE%}7uIjOBtN7tydGQ38$t~h%sjsJvLrBC8ti%ayUKS8+}u2bnQ&2>uD zAJwu>Y7?o(Dy{)CcEgI}E^<;ItkFHT2 z7x|L&_BD~8xsI(|5qp0fyW7g7b?X{iwJ#Qke(}KFs`fQCco!>+VwLwz=;Ds9kwc~C z;E?Z(@H8J*;7W^Df-l=$b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1~m;-2GL5+3~pR%YRM? z-gV=@l9H}v#caoT?EU|C8GkIBb1u5LuD){Yy4SBT_xc)EAOHafKmY;|fB*y_009U< z00Izz00bZa0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa z0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV= z5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV=5P$##AOHaf zKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_ z009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz z00bZa0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_< z0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb S2tWV=5P$##An^Y~;Qs*Fzfoua diff --git a/client/basic/bails.s b/client/basic/bails.s deleted file mode 100644 index 6a9ecf3..0000000 --- a/client/basic/bails.s +++ /dev/null @@ -1,1725 +0,0 @@ - -.include "../inc/common.i" -;.ifndef KPR_API_VERSION_NUMBER -; .define EQU = -; .include "../inc/kipper_constants.i" -;.endif - - -HTTPD_TIMEOUT_SECONDS=5 ;what's the maximum time we let 1 connection be open for? - -;DEBUG=1 - -VARTAB = $2D ;BASIC variable table storage -ARYTAB = $2F ;BASIC array table storage -FREETOP = $33 ;bottom of string text storage area -MEMSIZ = $37 ;highest address used by BASIC -VARNAM = $45 ;current BASIC variable name -VARPNT = $47 ; pointer to current BASIC variable value - -SETNAM = $FFBD -SETLFS = $FFBA -LOAD = $FFD5 -OPEN = $FFC0 -CHKIN = $FFC6 -READST = $FFB7 ; read status byte -CHRIN = $FFCF ; get a byte from file -CLOSE = $FFC3 -MEMTOP = $FE25 -TXTPTR = $7A ;BASIC text pointer -IERROR = $0300 -ICRUNCH = $0304 ;Crunch ASCII into token -IQPLOP = $0306 ;List -IGONE = $0308 ;Execute next BASIC token - -CHRGET = $73 -CHRGOT = $79 -CHROUT = $FFD2 -GETBYT = $B79E ;BASIC routine -GETPAR = $B7EB ;Get a 16,8 pair of numbers -CHKCOM = $AEFD -NEW = $A642 -CLR = $A65E -NEWSTT = $A7AE -GETVAR = $B0E7 ;find or create a variable -FRMEVL = $AD9E ;evaluate expression -FRESTR = $B6A3 ;free temporary string -FRMNUM = $AD8A ;get a number -GETADR = $B7F7 ;convert number to 16 bit integer -INLIN = $A560 ; read a line from keyboard - -VALTYP=$0D ;00=number, $FF=string - -LINNUM = $14 ;Number returned by GETPAR - -crunched_line = $0200 ;Input buffer - -.import copymem -.importzp copy_src -.importzp copy_dest -.import dhcp_init -.import ip65_init -.import cfg_get_configuration_ptr -.import ip65_process -.import ip65_error -.import cfg_ip -.import cfg_dns -.import cfg_gateway -.import cfg_netmask -.import icmp_ping -.import icmp_echo_ip -.import dns_set_hostname -.import dns_resolve -.import dns_ip - -.import print_a -.import print_cr -.import dhcp_server -.import cfg_mac -.import cfg_mac_default -.import eth_driver_name -.import get_key_if_available -.import timer_read -.import native_to_ascii -.import ascii_to_native - -.import http_parse_request -.import http_get_value -.import http_variables_buffer - -.import tcp_inbound_data_ptr -.import tcp_inbound_data_length -.import tcp_send_data_len -.import tcp_send -.import check_for_abort_key -.import tcp_connect_remote_port -.import tcp_remote_ip -.import tcp_listen -.import tcp_callback -.import tcp_close - -temp_ptr =copy_src - - -.zeropage -temp: .res 2 -temp2: .res 2 -pptr=temp -.segment "STARTUP" ;this is what gets put at the start of the file on the C64 -.word basicstub ; load address -basicstub: - .word @nextline - .word 10 ;line number - .byte $9e ;SYS - .byte <(((relocate / 1000) .mod 10) + $30) - .byte <(((relocate / 100 ) .mod 10) + $30) - .byte <(((relocate / 10 ) .mod 10) + $30) - .byte <(((relocate ) .mod 10) + $30) - .byte ":" - .byte "D" - .byte $b2 ;= - .byte $c2 ;PEEK - .byte "(186):" - .byte $93 ;LOAD - .byte $22,"INDEX.BAS",$22,",D" - .byte 0 -@nextline: - .word 0 -relocate: - lda MEMSIZ+1 - cmp #$A0 ;standard end of memory - beq ok_to_install - - ldy #0 -@loop: - lda not_installing,y - beq @done - jsr $ffd2 - iny - bne @loop -@done: - rts -not_installing: - .byte "INSUFFICIENT FREE MEMORY",0 -ok_to_install: - - ldax #end_of_loader - stax copy_src - ldax #main_start - stax copy_dest - stax MEMSIZ -FS=$8000-main_start - ldax #FS - -;copy memory - sta end - ldy #0 - - cpx #0 - beq @tail - -: lda (copy_src),y - sta (copy_dest),y - iny - bne :- - inc copy_src+1 ;next page - inc copy_dest+1 ;next page - dex - bne :- - -@tail: - lda end - beq @done - -: lda (copy_src),y - sta (copy_dest),y - iny - cpy end - bne :- - -@done: - ldax #welcome_banner - jsr print - - ldx #5 ;Copy CURRENT vectors -@copy_old_vectors_loop: - lda ICRUNCH,x - sta oldcrunch,x - dex - bpl @copy_old_vectors_loop - - ldx #5 ;Copy CURRENT vectors -install_new_vectors_loop: - lda vectors,x - sta ICRUNCH,x - dex - bpl install_new_vectors_loop - -;copy error handlers: - ldax IERROR - stax olderror - ldax #error_handler - stax IERROR - - ;BASIC keywords installed, now bring up the ip65 stack - - jsr ip65_init - bcc @init_ok - ldax #@no_nic - jsr print -@reboot: - jsr $e453 ;reset vectors - jsr $e3bf ;init BASIC - jsr $a644 ;NEW - jmp $e39d -@no_nic: - .byte "NO RR-NET FOUND - UNINSTALLING",0 - -@init_ok: - -; jsr $A644 ;do a "NEW" -; jmp $A474 ;"READY" prompt - rts ;so BASIC will LOAD & RUN INDEX.BAS - -welcome_banner: -.byte "### BASIC ON BAILS ###",13 -.byte 0 -end: .res 1 -end_of_loader: - -.segment "MAINSTART" -main_start: - -safe_getvar: ;if GETVAR doesn't find the desired variable name in the VARTABLE, a routine at $B11D will create it - ;however that routine checks if the low byte of the return address of the caller is $2A. if it is, - ;it assumes the caller is the routine at $AF28 which just wants to get the variable value, and - ;returns a pointer to a dummy 'zero' pointer. - ;so if user code that is calling GETVAR happens to be compiled to an address $xx28, it will - ;trigger this check, and not create a new variable, which (from painful experience) will create - ;a really nasty condition to debug! - ;so vector to GETVAR via here, so the return address seen by $B11D is here, and never $xx28 - jsr GETVAR - rts -.code - - -; CRUNCH -- If this is one of our keywords, then tokenize it -; -crunch: - jsr jmp_crunch ;First crunch line normally - ldy #05 ;Offset for KERNAL - ;Y will contain line length+5 -@loop: - sty temp - jsr isword ;Are we at a keyword? - bcs @gotcha -@next: - jsr nextchar - bne @loop ;Null byte marks end - sta crunched_line-3,Y ;00 line number - lda #$FF ;'tis what A should be - rts ;Buh-bye - -; Insert token and crunch line -@gotcha: - ldx temp ;If so, A contains opcode - sta crunched_line-5,X -@move: - inx - lda crunched_line-5,Y - sta crunched_line-5,X ;Move text backwards - beq @next - iny - bpl @move - - -; ISWORD -- Checks to see if word is -; in table. If a word is found, then -; C is set, Y is one past the last char -; and A contains opcode. Otherwise, -; carry is clear. -; -; On entry, TEMP must contain current -; character position. -; -isword: - ldx #00 -@loop: - ldy temp -@loop2: - lda keywords,x - beq @notmine - cmp #$E0 - bcs @done ;Tokens are >=$E0 - cmp crunched_line-5,Y - bne @next - iny ;Success! Go to next char - inx - bne @loop2 -@next: - inx - lda keywords,x ;Find next keyword - cmp #$E0 - bcc @next - inx - bne @loop ;And check again -@notmine: - clc -@done: - rts - - -; NEXTCHAR finds the next char -; in the buffer, skipping -; spaces and quotes. On -; entry, TEMP contains the -; position of the last spot -; read. On exit, Y contains -; the index to the next char, -; A contains that char, and Z is set if at end of line. - -nextchar: - ldy temp -@loop: - iny - lda crunched_line-5,Y - beq @done - cmp #$8F ;REM - bne @cont - lda #00 -@skip: - sta temp2 ;Find matching character -@loop2: - iny - lda crunched_line-5,Y - beq @done - cmp temp2 - bne @loop2 ;Skip to end of line - beq @loop -@cont: - cmp #$20 ;space - beq @loop - cmp #$22 ;quote - beq @skip -@done: - rts - - -; -; LIST -- patches the LIST routine -; to list our new tokens correctly. -; - -list: - cmp #$E0 - bcc @notmine ;Not my token - cmp #HITOKEN - bcs @notmine - bit $0F ;Check for quote mode - bmi @notmine - sec - sbc #$DF ;Find the corresponding text - tax - sty $49 - ldy #00 -@loop: - dex - beq @done -@loop2: - iny - lda keywords,y - cmp #$E0 - bcc @loop2 - iny - bne @loop -@done: - lda keywords,y - cmp #$91 ;is it "ON"? - bne @not_on - lda #'O' - jsr CHROUT - lda #'N' - bne @skip - -@not_on: - cmp #$9B ;is it "LIST"? - - bne @not_list - lda #'L' - jsr CHROUT - lda #'I' - jsr CHROUT - lda #'S' - jsr CHROUT - lda #'T' - bne @skip -@not_list: - lda keywords,y - bmi @out ;is it >=$80? -@skip: - jsr CHROUT - iny - bne @done -@out: - cmp #$E0 ;It might be BASIC token - bcs @cont - ldy $49 -@notmine: - and #$FF - jmp (oldlist) -@cont: - ldy $49 - jmp $A700 ;Normal exit - - - -; -; EXECUTE -- if this is one of our new -; tokens, then execute it. -execute: - jsr CHRGET -execute_a: - php - cmp #':' ;is it a colon? - beq execute;if so, skip over and go to next token - cmp #$8B ;is it 'IF'? - bne @not_if - lda #$E0 ;our dummy IF token -@not_if: - cmp #$E0 - bcc @notmine - cmp #HITOKEN - bcs @notmine - plp - jsr @disp - jmp NEWSTT -@disp: - eor #$E0 - asl ;multiply by 2 - tax - lda token_routines+1,x - pha - lda token_routines,x - pha - jmp CHRGET ;exit to routine (via RTS) -@notmine: - plp - cmp #0 ;reset flags - jmp $A7E7 - -;the standard BASIC IF routine calls the BASIC EXECUTE routine directly, -;without going through the vector. That means an extended keyword following THEN -;will lead to a syntax error. So we have to reimpliment IF here -;this is taken from TransBASIC - The Transactor, vol 5, Issue 04 (March 1985) page 34 -if_keyword: - jsr FRMEVL ;evaluate expression - jsr CHRGOT - cmp #$89 ;is next token GOTO? - beq @ok - lda #$A7 ;is next token THEN - jsr $AEFF ;will generate SYNTAX ERROR if not -@ok: - jsr CHRGOT - ldx $61 ;result of expression : 0 means false - bne @expression_was_true - jmp $A93B ;go to REM implementation - skips rest of line -@expression_was_true: - bcs @not_numeric;CHRGOT clears carry flag if current char is a number - jmp $A8A0 ;do a GOTO -@not_numeric: - pla - pla ;pop the return address off the stack - jsr CHRGOT - jmp execute_a ;execute current token - - - -;emit the 4 bytes pointed at by AX as dotted decimals -emit_dotted_quad: - sta pptr - stx pptr + 1 - ldy #0 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #1 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #2 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #3 - lda (pptr),y - jsr emit_decimal - - rts - -emit_decimal: ;emit byte in A as a decimal number - pha - sta temp_bin ;save - sed ; Switch to decimal mode - lda #0 ; Ensure the result is clear - sta temp_bcd - sta temp_bcd+1 - ldx #8 ; The number of source bits - : - asl temp_bin+0 ; Shift out one bit - lda temp_bcd+0 ; And add into result - adc temp_bcd+0 - sta temp_bcd+0 - lda temp_bcd+1 ; propagating any carry - adc temp_bcd+1 - sta temp_bcd+1 - dex ; And repeat for next bit - bne :- - - cld ;back to binary - - pla ;get back the original passed in number - bmi @emit_hundreds ; if N is set, the number is >=128 so emit all 3 digits - cmp #10 - bmi @emit_units - cmp #100 - bmi @emit_tens -@emit_hundreds: - lda temp_bcd+1 ;get the most significant digit - and #$0f - clc - adc #'0' - jsr emit_a - -@emit_tens: - lda temp_bcd - lsr - lsr - lsr - lsr - clc - adc #'0' - jsr emit_a -@emit_units: - lda temp_bcd - and #$0f - clc - adc #'0' - jsr emit_a - - rts - -print: - sta pptr - stx pptr + 1 - -@print_loop: - ldy #0 - lda (pptr),y - beq @done_print - jsr print_a - inc pptr - bne @print_loop - inc pptr+1 - bne @print_loop ;if we ever get to $ffff, we've probably gone far enough ;-) -@done_print: - rts - - -extract_string: - jsr FRMEVL - jsr FRESTR ;if not string, will create type mismatch error - sta param_length - tay - lda #0 - sta transfer_buffer,y - dey -@loop: - lda ($22),y - sta transfer_buffer,y - dey - bpl @loop - jmp FRESTR ;free up the temp string created by FRMEVL - -;get a string value from BASIC command, turn into a 32 bit IP address,save it in the 4 bytes pointed at by AX -get_ip_parameter: - stax temp2 - jsr extract_string - ldax #transfer_buffer - jsr dns_set_hostname - - bcs @error - jsr dns_resolve - bcc @ok -@error: - ldax #address_resolution - jmp print_error - -@ok: - ldax #dns_ip - ldx #4 -@copy_dns_ip: - lda dns_ip,y - sta (temp2),y - iny - dex - bne @copy_dns_ip - rts - - -reset_string: - ldy #string_buffer - sty current_output_ptr+1 - rts - -print_dotted_quad: - jsr reset_string - jsr emit_dotted_quad -make_null_terminated_and_print: - lda #0 - jsr emit_a - ldax #string_buffer - jmp print - -print_integer: -sta $63 -stx $62 -jmp $bdd1 ;BASIC routine - -print_decimal: - jsr reset_string - jsr emit_decimal - jmp make_null_terminated_and_print - -print_mac: - jsr reset_string - jsr emit_mac - jmp make_null_terminated_and_print - -;print 6 bytes printed at by AX as a MAC address -emit_mac: - stax pptr - ldy #0 -@one_mac_digit: - tya ;just to set the Z flag - pha - beq @dont_print_colon - lda #':' - jsr emit_a -@dont_print_colon: - pla - tay - lda (pptr),y - jsr emit_hex - iny - cpy #06 - bne @one_mac_digit - rts - -emit_hex: - pha - pha - lsr - lsr - lsr - lsr - tax - lda hexdigits,x - jsr emit_a - pla - and #$0F - tax - lda hexdigits,x - jsr emit_a - pla - rts - -print_hex: - jsr reset_string - jsr emit_hex - jmp make_null_terminated_and_print - -print_error: - jsr print - ldax #error - jsr print - lda ip65_error - jsr print_hex - jsr print_cr - sec - rts - -get_optional_byte: - jsr CHRGOT - beq @no_param ;leave X as it was - jsr CHKCOM ;make sure next char is a comma (and skip it) - jsr CHRGOT - beq @eol - jsr GETBYT -@no_param: - rts -@eol: - jmp $AF08 ;SYNTAX ERROR - -ipcfg_keyword: - - ldax #interface_type - jsr print - - ldax #eth_driver_name - jsr print - jsr print_cr - - ldax #mac_address_msg - jsr print - ldax #cfg_mac - jsr print_mac - jsr print_cr - - ldax #ip_address_msg - jsr print - ldax #cfg_ip - jsr print_dotted_quad - jsr print_cr - - ldax #netmask_msg - jsr print - ldax #cfg_netmask - jsr print_dotted_quad - jsr print_cr - - ldax #gateway_msg - jsr print - ldax #cfg_gateway - jsr print_dotted_quad - jsr print_cr - - ldax #dns_server_msg - jsr print - ldax #cfg_dns - jsr print_dotted_quad - jsr print_cr - - - ldax #dhcp_server_msg - jsr print - ldax #dhcp_server - jsr print_dotted_quad - jsr print_cr - rts - - -dhcp_keyword: - jsr dhcp_init - bcc @init_ok - jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to default values) - -@init_failed: - ldax #dhcp - jmp print_error -@init_ok: - rts - -ping_keyword: - ldax #icmp_echo_ip - jsr get_ip_parameter - bcc @no_error - rts -@no_error: - - ;is there an optional parameter? - ldx #3 - jsr get_optional_byte - stx ping_counter - - ldax #pinging - jsr print - ldax #dns_ip - jsr print_dotted_quad - jsr print_cr - -@ping_loop: - jsr icmp_ping - bcs @error - lda #'.' -@print_and_loop: - jsr print_a - lda $cb ;current key pressed - cmp #$3F ;RUN/STOP? - beq @done - dec ping_counter - bne @ping_loop -@done: - jmp print_cr -@error: - lda #'!' - jmp @print_and_loop - - -myip_keyword: - ldax #cfg_ip - jmp get_ip_parameter - -dns_keyword: - ldax #cfg_dns - jmp get_ip_parameter - -gateway_keyword: - ldax #cfg_gateway - jmp get_ip_parameter - -netmask_keyword: - ldax #cfg_netmask - jmp get_ip_parameter - -mac_keyword: - jsr extract_string - ldy #2 -: - lda transfer_buffer,y - sta cfg_mac_default+3,y - dey - bpl:- - jsr ip65_init - rts - - -skip_comma_get_integer: - jsr CHRGOT - jsr CHKCOM ;make sure next char is a comma (and skip it) -get_integer: - jsr CHRGOT - beq @eol - jsr FRMNUM - jsr GETADR - ldax LINNUM -@no_param: - rts -@eol: - jmp $AF08 ;SYNTAX ERROR - - -hook_keyword: - jsr extract_string - ldax #transfer_buffer - jsr skip_comma_get_integer - stax handler_address - jsr find_hook - bcc @existing_entry - - lda hooks - cmp #MAX_HOOKS - bmi @got_space - ldx #$10 ;OUT OF MEMORY - jmp $A437 ;print error -@got_space: - clc - lda #0 - adc hooks - adc hooks - adc hooks - adc hooks - adc hooks - adc hooks - tay - inc hooks - @existing_entry: - ;y now points to free slot in hook table - lda transfer_buffer - sta hook_table,y - lda transfer_buffer+1 - sta hook_table+1,y - lda param_length - sta hook_table+2,y - lda hash - sta hook_table+3,y - lda handler_address - sta hook_table+4,y - lda handler_address+1 - sta hook_table+5,y - rts - - -goto: - sta $14 - sta $39 - stx $15 - stx $3a - - jmp $a8a3 ;GOTO keyword - - -find_hook: - jsr calc_hash - ldy #0 - ldx hooks - beq @done -@compare_one_entry: - lda transfer_buffer - cmp hook_table,y - bne @nope - lda transfer_buffer+1 - cmp hook_table+1,y - bne @nope - lda param_length - cmp hook_table+2,y - bne @nope - lda hash - cmp hook_table+3,y - bne @nope -;found it! - clc - rts -@nope: - dex - beq @done - iny - iny - iny - iny - iny - iny - - bne @compare_one_entry -@done: - sec - rts - -calc_hash: - clc - lda #0 - ldy param_length - beq @done -@loop: - adc transfer_buffer,y - dey - bne @loop -@done: - sta hash - rts - - -yield_keyword: - jsr flush_keyword - jsr tcp_close - .ifdef DEBUG - dec $d020 - .endif - jmp httpd_start - - -bang_keyword: - jsr extract_string - lda sent_header - bne :+ - jsr send_header -: - ldy #0 - sty string_ptr -@loop: - lda transfer_buffer,y - jsr xmit_a - inc string_ptr - ldy string_ptr - cpy param_length - bne @loop - rts - - - -got_http_request: - jsr http_parse_request - ldax #path - jsr print - lda #$02 - jsr http_get_value - stax copy_src - jsr print - jsr print_cr - ldy #0 -@copy_path: - lda (copy_src),y - beq @done - sta transfer_buffer,y - iny - bne @copy_path -@done: - sty string_length - lda #0 - sta transfer_buffer,y - sty param_length - sty tmp_length - clc - lda #'P' - sta VARNAM - lda #'A'+$80 - jmp @set_var_value -@copy_vars: - iny - lda (copy_src),y - beq @last_var - tax ;var name - iny - clc - tya - adc copy_src - sta copy_src - bcc :+ - inc copy_src+1 -: - ldy #0 -: - lda (copy_src),y - beq @end_of_var - iny - bne :- -@end_of_var: - sty tmp_length - clc - stx VARNAM - lda #$80 -@set_var_value: - sta VARNAM+1 - jsr safe_getvar - ldy #0 - lda tmp_length - sta (VARPNT),y - iny - lda copy_src - sta (VARPNT),y - iny - lda copy_src+1 - sta (VARPNT),y - ldy tmp_length - jmp @copy_vars - - - @last_var: - - jsr find_hook - bcc @got_hook - ldax default_line_number - jmp goto - @got_hook: - lda hook_table+4,y - ldx hook_table+5,y - jmp goto - - -;start a HTTP server -;this routine will stay in an endless loop that is broken only if user press the ABORT key (runstop on a c64) -;inputs: -; none -;outputs: -; none -httpd_start: - ldx top_of_stack - txs - ldax #listening - jsr print - ldax #cfg_ip - jsr print_dotted_quad - lda #':' - jsr print_a - ldax httpd_port_number - jsr print_integer - jsr print_cr - lda #0 - sta $dc08 ;make sure TOD clock is started - -@listen: - jsr tcp_close - ldax httpd_io_buffer - stax tcp_buffer_ptr - ldax #http_callback - stax tcp_callback - ldax httpd_port_number - - jsr tcp_listen - bcs @abort_key_pressed - -@connect_ok: -.ifdef DEBUG - inc $d020 -.endif - ldax #connection_from - jsr print - ldax #tcp_remote_ip - jsr print_dotted_quad - lda #':' - jsr print_a - ldax tcp_connect_remote_port - - jsr print_integer - jsr print_cr - lda #0 - sta connection_closed - sta found_eol - clc - lda $dc09 ;time of day clock: seconds (in BCD) - sed - adc #HTTPD_TIMEOUT_SECONDS - cmp #$60 - bcc @timeout_set - sec - sbc #$60 -@timeout_set: - cld - sta connection_timeout_seconds - -@main_polling_loop: - jsr ip65_process - jsr check_for_abort_key - bcc @no_abort -@abort_key_pressed: - lda #0 - sta error_handling_mode - ldx #$1E ;break - jmp $e38b ;print error message, warm start BASIC - -@no_abort: - lda found_eol - bne @got_eol - - lda $dc09 ;time of day clock: seconds - - cmp connection_timeout_seconds - beq @connection_timed_out - lda connection_closed - beq @main_polling_loop -@connection_timed_out: -.ifdef DEBUG - dec $d020 -.endif - jmp @listen - -@got_eol: - - jsr reset_output_buffer - - ldy #$FF -: - iny - lda status_ok,y - sta status_code_buffer,y - bne :- - - ldy #$FF -: - iny - lda text_html,y - sta content_type_buffer,y - bne :- - - sta sent_header - - ldax httpd_io_buffer - jmp got_http_request - -http_callback: - lda tcp_inbound_data_length+1 - cmp #$ff - bne @not_eof - inc connection_closed -@done: - rts -@not_eof: - lda found_eol - bne @done - -;copy this chunk to our input buffer - ldax tcp_buffer_ptr - stax copy_dest - ldax tcp_inbound_data_ptr - stax copy_src - ldax tcp_inbound_data_length - jsr copymem - -;increment the pointer into the input buffer - clc - lda tcp_buffer_ptr - adc tcp_inbound_data_length - sta tcp_buffer_ptr - sta temp_ptr - lda tcp_buffer_ptr+1 - adc tcp_inbound_data_length+1 - sta tcp_buffer_ptr+1 - sta temp_ptr+1 - -;put a null byte at the end (assumes we have set temp_ptr already) - lda #0 - tay - sta (temp_ptr),y - -;look for CR or LF in input - sta found_eol - ldax httpd_io_buffer - stax get_next_byte+1 - -@look_for_eol: - jsr get_next_byte - cmp #$0a - beq @found_eol - cmp #$0d - bne @not_eol -@found_eol: - inc found_eol - rts -@not_eol: - cmp #0 - bne @look_for_eol - rts - - - -reset_output_buffer: - ldax httpd_io_buffer - sta xmit_a_ptr+1 - stx xmit_a_ptr+2 - lda #0 - sta output_buffer_length - sta output_buffer_length+1 - rts - - -send_buffer: - ldax output_buffer_length - stax tcp_send_data_len - ldax httpd_io_buffer - jsr tcp_send - jmp reset_output_buffer - - -emit_string: - stax temp_ptr - ldy #0 -@next_byte: - lda (temp_ptr),y - beq @done - jsr xmit_a - iny - bne @next_byte -@done: - rts - - - -httpd_keyword: - jsr get_integer - stax httpd_port_number - jsr skip_comma_get_integer - stax default_line_number - inc error_handling_mode - tsx - stx top_of_stack - jmp httpd_start - -status_keyword: - jsr extract_string - ldy #$FF -@loop: - iny - lda transfer_buffer,y - sta status_code_buffer,y - bne @loop - rts - - -type_keyword: - jsr extract_string - ldy #$FF -@loop: - iny - lda transfer_buffer,y - sta content_type_buffer,y - bne @loop - rts - -send_header: - inc sent_header - ldax #http_version - jsr emit_string - ldax #status_code_buffer - jsr emit_string - ldax #crlf - jsr emit_string - ldax #content_type - jsr emit_string - ldax #content_type_buffer - jsr emit_string - ldax #end_of_header - jmp emit_string - - -flush_keyword: - - lda output_buffer_length - bne :+ - ldx output_buffer_length+1 - bne :+ - rts -: - jmp send_buffer - - -xsend_keyword: - - jsr extract_string - - ldx #transfer_buffer - lda param_length - jsr SETNAM - lda #$02 ; file number 2 - ldx $BA ; last used device number - bne @skip - ldx #$08 ; default to device 8 -@skip: - ldy #$02 ; secondary address 2 - jsr SETLFS - jsr OPEN - bcs @error ; if carry set, the file could not be opened - ldx #$02 ; filenumber 2 - jsr CHKIN - -@loop: - jsr CHRIN - sta tmp_a - jsr READST - bne @eof ; either EOF or read error - lda sent_header - bne :+ - jsr send_header -: - lda tmp_a - jsr xmit_a - jmp @loop -@eof: - and #$40 ; end of file? - beq @error - lda tmp_a - jsr xmit_a - -@close_handles: - lda #$02 ; filenumber 2 - jsr CLOSE - ldx #$00 ; filenumber 0 = keyboard - jsr CHKIN ;keyboard now input device again - rts - - - @error: - - lda #$00 ; no filename - tax - tay - jsr SETNAM - lda #$0f ;file number 15 - ldx $ba ;drive number - ldy #$0f ; secondary address 15 (error channel) - jsr SETLFS - jsr OPEN - LDX #$0F ; filenumber 15 - JSR CHKIN ;(file 15 now used as input) - LDY #$00 -@error_loop: - JSR READST ;(read status byte) - BNE @error_eof ; either EOF or read error - JSR CHRIN ;(get a byte from file) - sta error_buffer,y - iny - - JMP @error_loop ; next byte -@error_eof: - lda #0 - sta error_buffer,y - LDX #$00 ; filenumber 0 = keyboard - JSR CHKIN ;(keyboard now input device again) - - - jsr @close_handles - jmp create_error - -create_error: - lda sent_header - bne @header_sent - ldy #$FF -: - iny - lda status_error,y - sta status_code_buffer,y - bne :- - jsr send_header - -@header_sent: - ldax #error_start - jsr emit_string - ldax #system_error - jsr print - lda $3a ;current line number - ldx $39 - sta $62 - stx $63 - ldx #$90 ;exponent to 16 - sec - jsr $bc49 ;pad out flp acc - jsr $bddf ;convert to string - jsr $b487 ;move string descriptor into flp acc - jsr $b6a6 ;get text pointer into $22/$23 - tay - lda #0 - sta ($22),y - lda $22 - ldx $23 - jsr emit_string - jsr emit_br - ldax #line_number - jsr print - lda $22 - ldx $23 - jsr print - jsr print_cr - ldax #error_buffer - jsr emit_string - ldax #error_buffer - jsr print - jmp yield_keyword - -emit_br: - ldax #br - jmp emit_string - -error_handler: - ldy error_handling_mode - bne @send_error_to_browser - jmp (olderror) -@send_error_to_browser: - txa - asl a - tax - lda $a326,x ; fetch address from table of error messages - sta $22 - lda $a327,x ; fetch address from table of error messages - sta $23 - ldy #0 -@one_char: - lda ($22),y - pha - and #$7f - sta error_buffer,y - iny - pla - bpl @one_char - lda #0 - sta error_buffer,y - jmp create_error - -.rodata -vectors: - .word crunch - .word list - .word execute - -hexdigits: -.byte "0123456789ABCDEF" - -CR=$0D -LF=$0A - -error_start: -.byte "

    SYSTEM ERROR


    " -line_number: -.byte " LINE NUMBER: ",0 -br: -.byte "
    ",CR,LF,0 - -listening: -.byte"LISTENING ON ",0 - -pinging: -.byte"PINGING ",0 -interface_type: -.byte "INTERFACE : ",0 - -mac_address_msg: -.byte "MAC ADDRESS : ", 0 - -ip_address_msg: -.byte "IP ADDRESS : ", 0 - -netmask_msg: -.byte "NETMASK : ", 0 - -gateway_msg: -.byte "GATEWAY : ", 0 - -dns_server_msg: -.byte "DNS SERVER : ", 0 - -dhcp_server_msg: -.byte "DHCP SERVER : ", 0 - - -address_resolution: -.byte "ADDRESS RESOLUTION",0 - -tftp: -.byte "TFTP",0 -dhcp: -.byte "DHCP",0 - -connect: -.byte "CONNECT",0 - -error: -.byte " ERROR $",0 - -disconnected: -.byte 13,"DIS" -connected_msg: -.byte "CONNECTED",13,0 - -loaded: - .byte " LOADED",13,0 -skipped: - .byte " SKIPPED",13,0 - -path: - .byte "PATH: ",0 - -http_version: - .byte "HTTP/1.0 ",0 - -status_ok: - .byte "200 OK",0 -status_error: - .byte "500 " -system_error: - .byte "SYSTEM ERROR",0 -content_type: - .byte "Content-Type: ",0 -text_html: - .byte "text/html",0 - -end_of_header: - .byte CR,LF - .byte "Connection: Close",CR,LF - .byte "Server: BoB_httpd/0.c64",CR,LF -crlf: - .byte CR,LF,0 - -connection_from: .byte "CONNECTION FROM ",0 - - -; Keyword list -; Keywords are stored as normal text, -; followed by the token number. -; All tokens are >$80, -; so they easily mark the end of the keyword -keywords: - .byte "IF",$E0 ;our dummy 'IF' entry takes $E0 - .byte "IPCFG",$E1 - .byte "DHCP",$E2 - .byte "PING",$E3 - .byte "MYIP",$E4 - .byte "NETMASK",$E5 - .byte "GATEWAY",$E6 - .byte "DNS",$E7 - .byte "HOOK",$E8 - .byte "YIELD",$E9 - .byte "XS",$80,$EA ;BASIC will replace 'END' with $80 - .byte "!",$EB - .byte "HTTPD",$EC - .byte "TYPE",$ED - .byte "STATUS",$EE - .byte "FLUSH",$EF - .byte "MAC",$F0 - .byte $00 ;end of list -HITOKEN=$F1 - -; -; Table of token locations-1 -; -token_routines: -E0: .word if_keyword-1 -E1: .word ipcfg_keyword-1 -E2: .word dhcp_keyword-1 -E3: .word ping_keyword-1 -E4: .word myip_keyword-1 -E5: .word netmask_keyword-1 -E6: .word gateway_keyword-1 -E7: .word dns_keyword-1 -E8: .word hook_keyword-1 -E9: .word yield_keyword-1 -EA: .word xsend_keyword-1 -EB: .word bang_keyword-1 -EC: .word httpd_keyword-1 -ED: .word type_keyword-1 -EE: .word status_keyword-1 -EF: .word flush_keyword-1 -F0: .word mac_keyword-1 - -.segment "SELF_MODIFIED_CODE" - - -jmp_crunch: .byte $4C ;JMP -oldcrunch: .res 2 ;Old CRUNCH vector -oldlist: .res 2 -oldexec: .res 2 -olderror: .res 2 - -emit_a: -current_output_ptr=emit_a+1 - sta $ffff - inc string_length - inc current_output_ptr - bne :+ - inc current_output_ptr+1 -: - rts - -MAX_HOOKS=40 - -hook_table: -.res MAX_HOOKS*6 -;format is: -; $00/$01 first 2 chars of hook name -; $02 length of name -; $03 hash of name -; $04/$05 line number that hook handler starts at - -hooks: .byte 0 -error_handling_mode: .byte 0 - -.bss -string_length: .res 1 -param_length: .res 1 -tmp_length: .res 1 -temp_bin: .res 1 -temp_bcd: .res 2 -ping_counter: .res 1 -http_buffer: .res 256 -string_buffer: .res 128 -content_type_buffer: .res 128 -status_code_buffer: .res 128 -transfer_buffer: .res 256 -handler_address: .res 2 -hash: .res 1 -string_ptr: .res 1 -default_line_number: .res 2 -found_eol: .byte 0 -connection_closed: .byte 0 -output_buffer_length: .res 2 -connection_timeout_seconds: .byte 0 -tcp_buffer_ptr: .res 2 -buffer_size: .res 1 -temp_x: .res 1 -sent_header: .res 1 -tmp_a: .res 1 -error_buffer: .res 80 -top_of_stack: .res 1 -.segment "TCP_VARS" - -__httpd_io_buffer: .res 1024 ;temp buffer for storing inbound requests. - -.segment "HTTP_VARS" - -httpd_io_buffer: .word __httpd_io_buffer -httpd_port_number: .word 80 - - -get_next_byte: - lda $ffff - inc get_next_byte+1 - bne @skip - inc get_next_byte+2 -@skip: - rts - - -xmit_a: - -xmit_a_ptr: - sta $ffff - inc xmit_a_ptr+1 - bne :+ - inc xmit_a_ptr+2 -: - inc output_buffer_length - bne :+ - inc output_buffer_length+1 - lda output_buffer_length+1 - cmp #2 - bne :+ - stx temp_x - jsr send_buffer - ldx temp_x -: - rts - - -;-- LICENSE FOR bails.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 netboot65. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009,2010 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/client/basic/favicon.ico b/client/basic/favicon.ico deleted file mode 100644 index acec6de0543f329a35108ad550791e80f1134810..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3638 zcmeHJy-veG40e*1Rw`24rE4k%#1pW#V(F{!3@k+AEszi^kH8p&#K<$;BQSPAIsBdP z$7xPNVnngzyR$#rcX2G=5fxO@c1t|Z>19rINkpra$hT9XPu5+rj!kIK3_DOWanoRU zy}72xiw)gv&gpRYpvB^e*6Vg)H!8*qj2ZYp8L-w;m#FfTG6 zkwS*Db*D0f!gL{I4C%ofc7O%fdDvf8z?<3(db(cVlj0g$GA>@(}14Pma>AP}^h^?Fec4F#J phello" -110 !"
    " -120 !"what's your name?" -130 !"" -140 !"
    " -200 yield - -1000!"hello "+n$+", i'm a c64 running basic on bails." -1010 for i=1 to 10 -1020 !"
    " -1030 !str$(i) -1040 next i -1100 yield - -2000 type"IMAGE/X-ICON" -2010 xsend"favicon.ico" -2020 yield diff --git a/client/basic/kipperbas.d64 b/client/basic/kipperbas.d64 deleted file mode 100644 index 459d8e0a6164dc16a93ce62979f871fd0622a6a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 174848 zcmeI2dwdjCn)j>Ioz6XUAV3QQ3*;_=a0$eqkXt8dQsf@)It4`RR+7R?@2pduGp=J8 z%y4?c>dcBxYoqjK1lN#2RJyb#{jgGddVA^puVYg4*wMs*{M0 z^X~hZcmLQw9zLWlr_Qau=Q+>$J*S%E@E;OD0!RP}AOR$R1dsp{Kmter2_OL^fCP{L z5<4RV@-`RKQ zggT3aXA_#?4`llJ6>cRXD>jyyi}%` zd7+`eY~u9Vx-DaL4hiHDg$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V9=Cqg zUrs!3`SKszlXNwLAn%#@S5wxrx|H2aH1%J5jz65kO*XoszOm~1mX`h3wuQAJ0VIF~ zkN^@u0!RP}AOR$R1dsp{Kmter2_OL^fCP{L5=$E0 - cmp crunched_line-5,Y - bne @next - iny ;Success! Go to next char - inx - bne @loop2 -@next: - inx - lda keywords,x ;Find next keyword - cmp #$E0 - bcc @next - inx - bne @loop ;And check again -@notmine: - clc -@done: - rts - - -; NEXTCHAR finds the next char -; in the buffer, skipping -; spaces and quotes. On -; entry, TEMP contains the -; position of the last spot -; read. On exit, Y contains -; the index to the next char, -; A contains that char, and Z is set if at end of line. - -nextchar: - ldy temp -@loop: - iny - lda crunched_line-5,Y - beq @done - cmp #$8F ;REM - bne @cont - lda #00 -@skip: - sta temp2 ;Find matching character -@loop2: - iny - lda crunched_line-5,Y - beq @done - cmp temp2 - bne @loop2 ;Skip to end of line - beq @loop -@cont: - cmp #$20 ;space - beq @loop - cmp #$22 ;quote - beq @skip -@done: - rts - - -; -; LIST -- patches the LIST routine -; to list our new tokens correctly. -; - -list: - cmp #$E0 - bcc @notmine ;Not my token - cmp #HITOKEN - bcs @notmine - bit $0F ;Check for quote mode - bmi @notmine - sec - sbc #$DF ;Find the corresponding text - tax - sty $49 - ldy #00 -@loop: - dex - beq @done -@loop2: - iny - lda keywords,y - cmp #$E0 - bcc @loop2 - iny - bne @loop -@done: - lda keywords,y - cmp #$91 ;is it "ON"? - bne @not_on - lda #'O' - jsr CHROUT - lda #'N' - bne @skip - -@not_on: - cmp #$9B ;is it "LIST"? - - bne @not_list - lda #'L' - jsr CHROUT - lda #'I' - jsr CHROUT - lda #'S' - jsr CHROUT - lda #'T' - bne @skip -@not_list: - lda keywords,y - bmi @out ;is it >=$80? -@skip: - jsr CHROUT - iny - bne @done -@out: - cmp #$E0 ;It might be BASIC token - bcs @cont - ldy $49 -@notmine: - and #$FF - jmp (oldlist) -@cont: - ldy $49 - jmp $A700 ;Normal exit - - - -; -; EXECUTE -- if this is one of our new -; tokens, then execute it. -execute: - jsr CHRGET -execute_a: - php - cmp #':' ;is it a colon? - beq execute;if so, skip over and go to next token - cmp #$8B ;is it 'IF'? - bne @not_if - lda #$E0 ;our dummy IF token -@not_if: - cmp #$E0 - bcc @notmine - cmp #HITOKEN - bcs @notmine - plp - jsr @disp - jmp NEWSTT -@disp: - eor #$E0 - asl ;multiply by 2 - tax - lda token_routines+1,x - pha - lda token_routines,x - pha - jmp CHRGET ;exit to routine (via RTS) -@notmine: - plp - cmp #0 ;reset flags - jmp $A7E7 - -;the standard BASIC IF routine calls the BASIC EXECUTE routine directly, -;without going through the vector. That means an extended keyword following THEN -;will lead to a syntax error. So we have to reimpliment IF here -;this is taken from TransBASIC - The Transactor, vol 5, Issue 04 (March 1985) page 34 -if_keyword: - jsr FRMEVL ;evaluate expression - jsr CHRGOT - cmp #$89 ;is next token GOTO? - beq @ok - lda #$A7 ;is next token THEN - jsr $AEFF ;will generate SYNTAX ERROR if not -@ok: - jsr CHRGOT - ldx $61 ;result of expression : 0 means false - bne @expression_was_true - jmp $A93B ;go to REM implementation - skips rest of line -@expression_was_true: - bcs @not_numeric;CHRGOT clears carry flag if current char is a number - jmp $A8A0 ;do a GOTO -@not_numeric: - pla - pla ;pop the return address off the stack - jsr CHRGOT - jmp execute_a ;execute current token - - - -find_var: - sta VARNAM - stx VARNAM+1 - jsr safe_getvar - ldy #0 - rts - -set_connection_state: - lda #'C'+$80 - ldx #'O'+$80 - jsr find_var - tya - sta (VARPNT),y - iny - lda connection_state - sta (VARPNT),y - -set_error: - lda #'E'+$80 - ldx #'R'+$80 - sta VARNAM+1 - jsr find_var - lda #0 - sta (VARPNT),y - iny - lda ip65_error - sta (VARPNT),y - - rts - - -;emit the 4 bytes pointed at by AX as dotted decimals -emit_dotted_quad: - sta pptr - stx pptr + 1 - ldy #0 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #1 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #2 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #3 - lda (pptr),y - jsr emit_decimal - - rts - -emit_decimal: ;emit byte in A as a decimal number - pha - sta temp_bin ;save - sed ; Switch to decimal mode - lda #0 ; Ensure the result is clear - sta temp_bcd - sta temp_bcd+1 - ldx #8 ; The number of source bits - : - asl temp_bin+0 ; Shift out one bit - lda temp_bcd+0 ; And add into result - adc temp_bcd+0 - sta temp_bcd+0 - lda temp_bcd+1 ; propagating any carry - adc temp_bcd+1 - sta temp_bcd+1 - dex ; And repeat for next bit - bne :- - - cld ;back to binary - - pla ;get back the original passed in number - bmi @emit_hundreds ; if N is set, the number is >=128 so emit all 3 digits - cmp #10 - bmi @emit_units - cmp #100 - bmi @emit_tens -@emit_hundreds: - lda temp_bcd+1 ;get the most significant digit - and #$0f - clc - adc #'0' - jsr emit_a - -@emit_tens: - lda temp_bcd - lsr - lsr - lsr - lsr - clc - adc #'0' - jsr emit_a -@emit_units: - lda temp_bcd - and #$0f - clc - adc #'0' - jsr emit_a - - rts - -print: - sta pptr - stx pptr + 1 - -@print_loop: - ldy #0 - lda (pptr),y - beq @done_print - jsr print_a - inc pptr - bne @print_loop - inc pptr+1 - bne @print_loop ;if we ever get to $ffff, we've probably gone far enough ;-) -@done_print: - rts - - -extract_string: - - jsr FRMEVL - - jsr FRESTR ;if not string, will create type mismatch error - - sta param_length - tay - lda #0 - sta transfer_buffer,y - dey -@loop: - lda ($22),y - sta transfer_buffer,y - dey - bpl @loop - jmp FRESTR ;free up the temp string created by FRMEVL - -;get a string value from BASIC command, turn into a 32 bit IP address,save it in the 4 bytes pointed at by AX -get_ip_parameter: - stax temp2 - jsr extract_string - ldax #transfer_buffer - jsr dns_set_hostname - - bcs @error - jsr dns_resolve - bcc @ok -@error: - ldax #address_resolution - jmp print_error - -@ok: - ldax #dns_ip - ldx #4 -@copy_dns_ip: - lda dns_ip,y - sta (temp2),y - iny - dex - bne @copy_dns_ip - rts - - -reset_string: - ldy #string_buffer - sty current_output_ptr+1 - rts - -print_dotted_quad: - jsr reset_string - jsr emit_dotted_quad -make_null_terminated_and_print: - lda #0 - jsr emit_a - ldax #string_buffer - jmp print - -print_mac: - jsr reset_string - jsr emit_mac - jmp make_null_terminated_and_print - -;print 6 bytes printed at by AX as a MAC address -emit_mac: - stax pptr - ldy #0 -@one_mac_digit: - tya ;just to set the Z flag - pha - beq @dont_print_colon - lda #':' - jsr emit_a -@dont_print_colon: - pla - tay - lda (pptr),y - jsr emit_hex - iny - cpy #06 - bne @one_mac_digit - rts - -emit_hex: - pha - pha - lsr - lsr - lsr - lsr - tax - lda hexdigits,x - jsr emit_a - pla - and #$0F - tax - lda hexdigits,x - jsr emit_a - pla - rts - -print_hex: - jsr reset_string - jsr emit_hex - jmp make_null_terminated_and_print - -print_error: - jsr print - ldax #error - jsr print - lda ip65_error - jsr print_hex - jsr print_cr - jsr set_error - sec - rts - -get_optional_byte: - jsr CHRGOT - beq @no_param ;leave X as it was - jsr CHKCOM ;make sure next char is a comma (and skip it) - jsr CHRGOT - beq @eol - jsr GETBYT -@no_param: - rts -@eol: - jmp $AF08 ;SYNTAX ERROR - -ipcfg_keyword: - - ldax #interface_type - jsr print - - ldax #eth_driver_name - jsr print - jsr print_cr - - ldax #mac_address_msg - jsr print - ldax #cfg_mac - jsr print_mac - jsr print_cr - - ldax #ip_address_msg - jsr print - ldax #cfg_ip - jsr print_dotted_quad - jsr print_cr - - ldax #netmask_msg - jsr print - ldax #cfg_netmask - jsr print_dotted_quad - jsr print_cr - - ldax #gateway_msg - jsr print - ldax #cfg_gateway - jsr print_dotted_quad - jsr print_cr - - ldax #dns_server_msg - jsr print - ldax #cfg_dns - jsr print_dotted_quad - jsr print_cr - - - ldax #dhcp_server_msg - jsr print - ldax #dhcp_server - jsr print_dotted_quad - jsr print_cr - - ldax #tftp_server_msg - jsr print - ldax #cfg_tftp_server - jsr print_dotted_quad - jsr print_cr - -clear_error: - lda #0 - sta ip65_error - jmp set_error - -dhcp_keyword: - jsr dhcp_init - bcc @init_ok - jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to default values) - -@init_failed: - jsr set_error - ldax #dhcp - jmp print_error -@init_ok: - jmp clear_error - rts - -mac_keyword: - jsr extract_string - ldy #2 -: - lda transfer_buffer,y - sta cfg_mac_default+3,y - dey - bpl:- - jsr ip65_init - rts - -ping_keyword: - ldax #icmp_echo_ip - jsr get_ip_parameter - bcc @no_error - rts -@no_error: - - ;is there an optional parameter? - ldx #3 - jsr get_optional_byte - stx ping_counter - - ldax #pinging - jsr print - ldax #dns_ip - jsr print_dotted_quad - jsr print_cr - -@ping_loop: - jsr icmp_ping - bcs @error - lda #'.' -@print_and_loop: - jsr print_a - lda $cb ;current key pressed - cmp #$3F ;RUN/STOP? - beq @done - lda ping_counter - beq @ping_loop - dec ping_counter - cmp #1 - bne @ping_loop -@done: - jsr print_cr - jmp set_error -@error: - lda #'!' - jmp @print_and_loop - - -myip_keyword: - ldax #cfg_ip - jmp get_ip_parameter - -dns_keyword: - ldax #cfg_dns - jmp get_ip_parameter - -gateway_keyword: - ldax #cfg_gateway - jmp get_ip_parameter - -netmask_keyword: - ldax #cfg_netmask - jmp get_ip_parameter - -tftp_keyword: - ldax #cfg_tftp_server - jmp get_ip_parameter - - -tf_param_setup: - jsr print - jsr extract_string - ldax #transfer_buffer - stax tftp_filename - jsr print - lda #' ' - jsr print_a - lda #'(' - jsr print_a - ldax #cfg_tftp_server - jsr print_dotted_quad - lda #')' - jsr print_a - - jsr print_cr - - ldx #$03 -: - lda cfg_tftp_server,x - sta tftp_ip,x - dex - bpl :- - rts - -tfget_keyword: - ldax #get_msg - jsr tf_param_setup - ldax #tftp_download_callback - jsr tftp_set_callback_vector - lda #0 - sta file_opened -;make file output name - lda #'@' - sta string_buffer - lda #':' - sta string_buffer+1 - ldy #$FF -@loop: - iny - lda transfer_buffer,y - sta string_buffer+2,y - bne @loop - iny - iny - lda #',' - sta string_buffer,y - iny - lda #'P' - sta string_buffer,y - iny - lda #',' - sta string_buffer,y - iny - lda #'W' - sta string_buffer,y - iny - sta string_length - - jsr tftp_download -after_tftp_xfer: - bcc @no_error - ldax #tftp -@error_set: - jsr print_error -@no_error: - jsr close_file - jmp set_error - -close_file: - lda #$02 ; filenumber 2 - jsr $FFC3 ; call CLOSE - rts - -open_file: - ;A,X,Y set up ready for a call to SETNAM for file #2 - jsr $FFBD ; call SETNAM - lda #$02 ; file number 2 - ldx $BA ; last used drive - - ldy #$02 ; secondary address 2 - jsr $FFBA ; call SETLFS - - jmp $FFC0 ; call OPEN - - -tftp_download_callback: - - ;buffer pointed at by AX now contains "tftp_data_block_length" bytes - stax temp - - lda #'.' - jsr print_a - lda file_opened - bne @already_opened - lda string_length - ldx #string_buffer - jsr open_file - -@already_opened: - - ldx #$02 ; filenumber 2 = output file - jsr $FFC9 ; call CHKOUT - -@copy_one_byte: - lda tftp_data_block_length - bne @not_done - lda tftp_data_block_length+1 - beq @done - -@not_done: - ldy #2 ;we want to skip the first 2 bytes in the buffer - lda (temp),y - jsr $ffd2 ;write byte - inc temp - bne :+ - inc temp+1 -: - lda tftp_data_block_length - dec tftp_data_block_length - cmp #0 - bne @copy_one_byte - dec tftp_data_block_length+1 - jmp @copy_one_byte -@done: - - ldx #$00 ; filenumber 0 = console - jmp $FFC9 ; call CHKOUT - - -tfput_keyword: - ldax #put_msg - jsr tf_param_setup - - lda param_length - ldx #transfer_buffer - jsr open_file - bcs @error - lda $90 ;get ST - beq @ok -@error: - - ldx #4 ;"FILE NOT FOUND" error - jmp $A437 ;error -@ok: - ldax #tftp_upload_callback - jsr tftp_set_callback_vector - jsr tftp_upload - jmp after_tftp_xfer - - -tftp_upload_callback: - stax copy_dest - lda #'.' - jsr print_a - lda #0 - sta bytes_read - sta bytes_read+1 - - ldx #$02 ; filenumber 2 = output file - jsr $FFC6 ; call CHKIN (file 2 now used as input) -@loop: - jsr $FFCF ; call CHRIN (get a byte from file) - ldy #0 - sta (copy_dest),y - inc copy_dest - bne :+ - inc copy_dest+1 -: - inc bytes_read - bne :+ - inc bytes_read+1 -: - lda bytes_read+1 - cmp #2 - beq @done - jsr $FFB7 ; call READST (read status byte) - beq @loop ; nonzero mean either EOF or read error - -@done: - ldx #$00 ; filenumber 0 = console - jsr $FFC6 ; call CHKIN (console now used as input) - ldax bytes_read - rts - -skip_comma_get_integer: - jsr CHRGOT - jsr CHKCOM ;make sure next char is a comma (and skip it) -get_integer: - jsr CHRGOT - beq @eol - jsr FRMNUM - jsr GETADR - ldax LINNUM -@no_param: - rts -@eol: - jmp $AF08 ;SYNTAX ERROR - - -make_tcp_connection: - lda #0 - sta connection_state - jsr set_connection_state - ldax #tcp_connect_ip - jsr get_ip_parameter - bcc @no_error - rts -@no_error: - jsr skip_comma_get_integer - jsr tcp_connect - bcc :+ -@connect_error: - ldax #connect - jmp print_error -: - ldax #connected_msg - jsr print - lda #1 - sta connection_state - lda #0 - sta ip65_error - jsr set_connection_state - clc - rts - -netcat_keyword: - lda $CC - sta cursor_state - lda #$0 - sta $CC ;enable blinking cursor - ldax #netcat_callback - stax tcp_callback - jsr make_tcp_connection - bcs @exit - - ;is there an optional parameter? - ldx #0 - jsr get_optional_byte - stx netcat_mode -@main_polling_loop: - - jsr timer_read - txa - adc #$20 ;32 x 1/4 = ~ 8seconds - sta netcat_timeout -@wait_for_keypress: - jsr timer_read - cpx netcat_timeout - bne @no_timeout - jsr tcp_send_keep_alive - jmp @main_polling_loop -@no_timeout: - jsr ip65_process - lda connection_state - bne @not_disconnected -@disconnected: - ldax #disconnected - jsr print -@exit: - lda cursor_state - sta $CC - rts -@not_disconnected: - - lda netcat_mode - beq @not_line_mode - - lda #$00 - sta string_length - -;process inbound ip packets while waiting for a keypress -@read_line: - lda $cb ;current key pressed - cmp #$3F ;RUN/STOP? - beq @runstop - jsr ip65_process - lda connection_state - beq @disconnected - - jsr $f142 ;not officially documented - where F13E (GETIN) falls through to if device # is 0 (KEYBD) - - beq @read_line - - cmp #$14 ;Delete - beq @delete - - cmp #$0d ;Return - beq @input_done - - ;End reached? - ldy string_length - cpy #$FF - beq @read_line - - jsr $ffd2 ;Print it - jsr native_to_ascii - sta transfer_buffer,y ;Add it to string - - inc string_length - - ;Not yet. - jmp @read_line - - -@delete: - ;First, check if we're at the beginning. - lda string_length - bne @delete_ok - jmp @read_line - - ;At least one character entered. -@delete_ok: - ;Move pointer back. - dec string_length - - ;Print the delete char - lda #$14 - jsr $ffd2 - - ;Wait for next char - jmp @read_line - -@input_done: - jsr reset_cursor - lda #$0d - jsr $ffd2 ;print a newline - ldy string_length - lda #$0d - sta transfer_buffer,y - iny - lda #$0a - sta transfer_buffer,y - iny - sty tcp_send_data_len - jmp @send_buffer -@not_line_mode: - - ;is there anything in the input buffer? - lda $c6 ;NDX - chars in keyboard buffer - bne :+ - jmp @wait_for_keypress -: - lda #0 - sta tcp_send_data_len - sta tcp_send_data_len+1 -@get_next_char: - lda $cb ;current key pressed - cmp #$3F ;RUN/STOP? - bne @not_runstop -@runstop: - lda #0 - sta $cb ;overwrite "current key pressed" else it's seen by the tcp stack and the close aborts - lda cursor_state - sta $CC - - jmp tcp_close -@not_runstop: - jsr $ffe4 ;getkey - 0 means no input - tax - beq @no_more_input - txa - - ldy tcp_send_data_len - sta transfer_buffer,y - inc tcp_send_data_len - jmp @get_next_char -@no_more_input: -@send_buffer: - ldax #transfer_buffer - jsr tcp_send - bcs @error_on_send - jmp @main_polling_loop - -@error_on_send: - lda cursor_state - sta $CC - - ldax #transmission - jmp print_error - -reset_cursor: - lda $cf ;0 means last cursor blink set char to be reversed - beq @done - lda $ce ;original value of cursor char - ldx $287 ;original colour - ldy #$0 ;blink phase - sty $cf - jsr $ea13 ;restore char & colour -@done: - rts -netcat_callback: - jsr reset_cursor - lda tcp_inbound_data_length+1 - cmp #$ff - bne @not_eof - lda #0 - sta connection_state - rts -@not_eof: - - ldax tcp_inbound_data_ptr - stax temp2 - lda tcp_inbound_data_length - sta buffer_length - lda tcp_inbound_data_length+1 - sta buffer_length+1 - -@next_byte: - lda $cb ;current key pressed - cmp #$3F ;RUN/STOP? - beq @finished - - ldy #0 - lda (temp2),y - ldx netcat_mode - beq @no_transform - jsr ascii_to_native -@no_transform: - jsr print_a - inc temp2 - bne :+ - inc temp2+1 -: - lda buffer_length+1 - beq @last_page - lda buffer_length - bne @not_end_of_page - dec buffer_length+1 -@not_end_of_page: - dec buffer_length - jmp @next_byte -@last_page: - dec buffer_length - beq @finished - - jmp @next_byte - -@finished: - - rts - - -tcpconnect_keyword: - ldax #tcpconnect_callback - stax tcp_callback - jmp make_tcp_connection - -tcpconnect_callback: - - ldax #transfer_buffer - stax copy_dest - ldax tcp_inbound_data_ptr - stax copy_src - - - lda tcp_inbound_data_length - ldx tcp_inbound_data_length+1 - cpx #$ff - bne @not_end_packet - -@end_packet: - lda #0 - sta connection_state - rts -@not_end_packet: - - stax inbound_data_length -set_packet_vars: - - jsr copymem - ldx inbound_data_length+1 - beq @short_packet - lda #$ff -@short_packet: - lda inbound_data_length -set_input_string: - pha - lda #'I' - ldx #'N'+$80 - jsr find_var - ldy #0 - pla - pha - sta (VARPNT),y - iny - lda #transfer_buffer - sta (VARPNT),y - pla - beq :+ - ldx #0 - jsr copymem -: - - lda #'I'+$80 - ldx #'P'+$80 - jsr find_var - lda #transfer_buffer - sta (VARPNT),y - - lda #'I'+$80 - ldx #'L'+$80 - jsr find_var - lda inbound_data_length+1 - sta (VARPNT),y - iny - lda inbound_data_length - sta (VARPNT),y - - rts - -poll_keyword: - lda #0 - sta tcp_inbound_data_length - sta tcp_inbound_data_length+1 - jsr set_input_string - jsr set_connection_state - jsr ip65_process - lda ip65_error - beq @no_error - jmp set_error -@no_error: - jmp set_connection_state - -tcplisten_keyword: - lda #0 - sta connection_state - sta ip65_error - ldax #tcpconnect_callback - stax tcp_callback - jsr get_integer - jsr tcp_listen - bcs :+ - inc connection_state -: - jmp set_connection_state - -tcpsend_keyword: - jsr extract_string - ldy param_length - sty tcp_send_data_len - ldy #0 - sty tcp_send_data_len+1 - ldax #transfer_buffer - jsr tcp_send - jmp set_connection_state - -tcpclose_keyword: - lda #0 - sta connection_state - jsr tcp_close - jmp set_connection_state - -tcpblat_keyword: - - jsr extract_string - - ldx #transfer_buffer - lda param_length - jsr SETNAM - lda #$02 ; file number 2 - ldx $BA ; last used device number - bne @skip - ldx #$08 ; default to device 8 -@skip: - ldy #$02 ; secondary address 2 - jsr SETLFS - jsr OPEN - bcs @error ; if carry set, the file could not be opened - ldx #$02 ; filenumber 2 - jsr CHKIN - ldy #$00 -@loop: - jsr READST - bne @eof ; either EOF or read error - jsr CHRIN - sta transfer_buffer,y - iny - bne @loop - ldax #$100 - stax tcp_send_data_len - ldax #transfer_buffer - jsr tcp_send - bcs @error_stored - ldy #0 - jmp @loop -@eof: - and #$40 ; end of file? - beq @readerror - beq @readerror - lda #$00 - sty tcp_send_data_len - sta tcp_send_data_len+1 - ldax #transfer_buffer - jsr tcp_send - bcs @error_stored - -@close: - lda #0 -@store_error: - sta ip65_error -@error_stored: - lda #$02 ; filenumber 2 - jsr CLOSE - ldx #$00 ; filenumber 0 = keyboard - jsr CHKIN ;keyboard now input device again - jmp set_error - -@error: - lda #KPR_ERROR_DEVICE_FAILURE - jmp @store_error -@readerror: - lda #KPR_ERROR_FILE_ACCESS_FAILURE - 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: - - lda #$00 - sta $0D ;set string flag to not stringe - jsr CHRGET - cmp #$E3 ; PING keyword - bne @done - - jsr CHRGET ;take PING command off stack - - ldax #icmp_echo_ip - jsr get_ip_parameter - lda #$00 - sta $0D ;set string flag to not string - - bcs @error - jsr icmp_ping - bcc @no_error -@error: - lda #$ff - tax -@no_error: - tay - txa - jmp $b395 ;signed 16 bit number to floating point - rts - -@done: - jsr CHRGOT - jmp $AE8D ;inside original EVAL routine - -.rodata -vectors: - .word crunch - .word list - .word execute - .word evaluate -; Keyword list -; Keywords are stored as normal text, -; followed by the token number. -; All tokens are >$80, -; so they easily mark the end of the keyword -hexdigits: -.byte "0123456789ABCDEF" - -pinging: -.byte"PINGING ",0 -interface_type: -.byte "INTERFACE : ",0 - -mac_address_msg: -.byte "MAC ADDRESS : ", 0 - -ip_address_msg: -.byte "IP ADDRESS : ", 0 - -netmask_msg: -.byte "NETMASK : ", 0 - -gateway_msg: -.byte "GATEWAY : ", 0 - -dns_server_msg: -.byte "DNS SERVER : ", 0 - -dhcp_server_msg: -.byte "DHCP SERVER : ", 0 - -tftp_server_msg: -.byte "TFTP SERVER : ", 0 - -too_many_listeners: -.byte "TOO MANY LISTENERS",0 -address_resolution: -.byte "ADDRESS RESOLUTION",0 - -get_msg: -.byte "GETTING ",0 -put_msg: -.byte "PUTTING ",0 - -tftp: -.byte "TFTP",0 -dhcp: -.byte "DHCP",0 - -connect: -.byte "CONNECT",0 - -transmission: -.byte "TRANSMISSION",0 - -error: -.byte " ERROR $",0 - -disconnected: -.byte 13,"DIS" -connected_msg: -.byte "CONNECTED",13,0 - -keywords: - .byte "IF",$E0 ;our dummy 'IF' entry takes $E0 - .byte "IPCFG",$E1 - .byte "DHCP",$E2 - .byte "PING",$E3 - .byte "MYIP",$E4 - .byte "NETMASK",$E5 - .byte "GATEWAY",$E6 - .byte "DNS",$E7 - .byte "TFTP",$E8 - .byte "TF",$A1,$E9 ;TFGET - BASIC will replace GET with A1 - .byte "TFPUT",$EA - .byte "NETCAT",$EB - .byte "TCPC",$91,"NECT",$EC ; TCPCONNECT - BASIC will replace ON with $91 - .byte "POLL",$ED - .byte "TCP",$9B,"EN",$EE ;TCPLISTEN - BASIC will replace LIST with $9b - .byte "TCPS",$80,$EF ;TCPSEND - BASIC will replace END with $80 - .byte "TCP",$A0,$F0 ;TCPLOSE - BASIC will replace CLOSE with $A0 - .byte "TCPBLAT",$F1 - .byte "MAC",$F2 - .byte "UDPS",$80,$F3 ;UDPSEND - BASIC will replace END with $80 - .byte "UDP",$9B,"EN",$F4 ;UDPLISTEN - BASIC will replace LIST with $9b - .byte $00 ;end of list -HITOKEN=$F5 - -; -; Table of token locations-1 -; -token_routines: -E0: .word if_keyword-1 -E1: .word ipcfg_keyword-1 -E2: .word dhcp_keyword-1 -E3: .word ping_keyword-1 -E4: .word myip_keyword-1 -E5: .word netmask_keyword-1 -E6: .word gateway_keyword-1 -E7: .word dns_keyword-1 -E8: .word tftp_keyword-1 -E9: .word tfget_keyword-1 -EA: .word tfput_keyword-1 -EB: .word netcat_keyword-1 -EC: .word tcpconnect_keyword-1 -ED: .word poll_keyword-1 -EE: .word tcplisten_keyword-1 -EF: .word tcpsend_keyword-1 -FO: .word tcpclose_keyword-1 -F1: .word tcpblat_keyword-1 -F2: .word mac_keyword-1 -F3: .word udpsend_keyword-1 -F4: .word udplisten_keyword-1 - -.segment "SELF_MODIFIED_CODE" - - -jmp_crunch: .byte $4C ;JMP -oldcrunch: .res 2 ;Old CRUNCH vector -oldlist: .res 2 -oldexec: .res 2 -oldeval: .res 2 -emit_a: -current_output_ptr=emit_a+1 - sta $ffff - inc string_length - inc current_output_ptr - bne :+ - inc current_output_ptr+1 -: - rts - - -.bss -netcat_mode: .res 1 -bytes_read: .res 2 -string_length: .res 1 -param_length: .res 1 -ip_string: .res 15 -netmask_string: .res 15 -dns_string: .res 15 -gateway_string: .res 15 - temp_bin: .res 1 -temp_bcd: .res 2 -ping_counter: .res 1 -string_buffer: .res 128 -transfer_buffer: .res 1500 -file_opened: .res 1 -connection_state: .res 1 -netcat_timeout: .res 1 -buffer_length: .res 2 -cursor_state: .res 1 -port: .res 2 -inbound_data_length: .res 2 \ No newline at end of file diff --git a/client/basic/kipperbasv20.s b/client/basic/kipperbasv20.s deleted file mode 100644 index 8e4f0ee..0000000 --- a/client/basic/kipperbasv20.s +++ /dev/null @@ -1,1658 +0,0 @@ - -.ifndef SCREEN_WIDTH - SCREEN_WIDTH = 22 -.endif - -.include "../inc/common.i" -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif - -VARTAB = $2D ;BASIC variable table storage -ARYTAB = $2F ;BASIC array table storage -FREETOP = $33 ;bottom of string text storage area -MEMSIZ = $37 ;highest address used by BASIC -VARNAM = $45 ;current BASIC variable name -VARPNT = $47 ; pointer to current BASIC variable value - -SETNAM = $FFBD -SETLFS = $FFBA -OPEN = $FFC0 -CHKIN = $FFC6 -READST = $FFB7 ; read status byte -CHRIN = $FFCF ; get a byte from file -CLOSE = $FFC3 -MEMTOP = $FE25 -TXTPTR = $7A ;BASIC text pointer -IERROR = $0300 -ICRUNCH = $0304 ;Crunch ASCII into token -IQPLOP = $0306 ;List -IGONE = $0308 ;Execute next BASIC token -IEVAL = $30A ; evaluate expression -CHRGET = $73 -CHRGOT = $79 -CHROUT = $FFD2 -GETBYT = $D79E ;BASIC routine -GETPAR = $D7EB ;Get a 16,8 pair of numbers -CHKCOM = $CEFD -NEW = $C642 -CLR = $C65E -NEWSTT = $C7AE -GETVAR = $D0E7 ;find or create a variable -FRMEVL = $CD9E ;evaluate expression -FRESTR = $D6A3 ;free temporary string -FRMNUM = $CD8A ;get a number -GETADR = $D7F7 ;convert number to 16 bit integer -INLIN = $C560 ; read a line from keyboard - -VALTYP=$0D ;00=number, $FF=string - -LINNUM = $14 ;Number returned by GETPAR - -crunched_line = $0200 ;Input buffer - -.import copymem -.importzp copy_src -.importzp copy_dest -.import dhcp_init -.import ip65_init -.import cfg_get_configuration_ptr -.import tcp_listen -.import tcp_callback -.import tcp_connect_ip -.import tcp_send -.import tcp_connect -.import tcp_close -.import tcp_send_data_len -.import tcp_inbound_data_ptr -.import tcp_inbound_data_length -.import dns_set_hostname -.import dns_resolve -.import dns_ip -.import ip65_process -.import ip65_error -.import cfg_ip -.import cfg_dns -.import cfg_gateway -.import cfg_netmask -.import cfg_tftp_server -.import icmp_ping -.import icmp_echo_ip -.import print_a -.import print_cr -.import dhcp_server -.import cfg_mac -.import cfg_mac_default -.import eth_driver_name -.importzp tftp_filename -.import tftp_ip -.import tftp_download -.import tftp_set_callback_vector -.import tftp_data_block_length -.import tftp_upload -.import get_key_if_available -.import tcp_send_keep_alive -.import timer_read -.import native_to_ascii -.import ascii_to_native -.zeropage -temp: .res 2 -temp2: .res 2 -pptr=temp -.segment "STARTUP" ;this is what gets put at the start of the file on the Vic 20 -.word basicstub ; load address -basicstub: - .word @nextline - .word 10 ;line number - .byte $9e ;SYS - .byte <(((relocate / 1000) .mod 10) + $30) - .byte <(((relocate / 100 ) .mod 10) + $30) - .byte <(((relocate / 10 ) .mod 10) + $30) - .byte <(((relocate ) .mod 10) + $30) -; .byte ":" -; .byte "D" -; .byte $b2 ;= -; .byte $c2 ;PEEK -; .byte "(186):" -; .byte $93 ;LOAD -; .byte $22,"AUTOEXEC.BAS",$22,",D" - .byte 0 -@nextline: - .word 0 -relocate: - lda MEMSIZ+1 - cmp #$80 ;standard end of memory - beq ok_to_install - ldy #0 -@loop: - lda not_installing,y - beq @done - jsr $ffd2 - iny - bne @loop -@done: - rts -not_installing: - .byte "INSUFFICIENT FREE MEMORY",13,0 -ok_to_install: - - ldax #end_of_loader - stax copy_src - ldax #main_start - stax copy_dest - stax MEMSIZ - FS= $3FC9 ;how much data to relocate? - ldax #FS - -;copy memory - sta end - ldy #0 - - cpx #0 - beq @tail - -: lda (copy_src),y - sta (copy_dest),y - iny - bne :- - inc copy_src+1 ;next page - inc copy_dest+1 ;next page - dex - bne :- - -@tail: - lda end - beq @done - -: lda (copy_src),y - sta (copy_dest),y - iny - cpy end - bne :- - -@done: - ldax #welcome_banner - - jsr print - - - ldx #7 ;Copy CURRENT vectors -@copy_old_vectors_loop: - lda ICRUNCH,x - sta oldcrunch,x - dex - bpl @copy_old_vectors_loop - - ldx #7 ;Copy CURRENT vectors -install_new_vectors_loop: - lda vectors,x - sta ICRUNCH,x - dex - bpl install_new_vectors_loop - - ;BASIC keywords installed, now bring up the ip65 stack - - jsr ip65_init - bcc @init_ok - bcs @init_ok ;FIXME - ldax #@no_nic - jsr print -@reboot: - - ldax #$8000 - stax MEMSIZ - - jsr $e45b ;reset vectors - - jsr $c642 ;NEW - jsr $c65e ;CLR - jsr $e3a4 ;init RAM - jmp $e467 ;BASIC warm start - -@no_nic: - .byte "NO RR-NET FOUND!",13,0 - -@init_ok: - - lda #0 - sta ip65_error - sta connection_state - jsr set_error - -@exit: - - ; jsr $C644 ;do a "NEW" - ; jmp $C474 ;"READY" prompt - jmp $e467 ;BASIC warm start - rts - -welcome_banner: -.byte "** KIPPER BASIC 1.1 **" -.byte 0 -end: .res 1 -end_of_loader: - -.segment "MAINSTART" -main_start: - -safe_getvar: ;if GETVAR doesn't find the desired variable name in the VARTABLE, a routine at $D11D will create it - ;however that routine checks if the low byte of the return address of the caller is $2A. if it is, - ;it assumes the caller is the routine at $CF28 which just wants to get the variable value, and - ;returns a pointer to a dummy 'zero' pointer. - ;so if user code that is calling GETVAR happens to be compiled to an address $xx28, it will - ;trigger this check, and not create a new variable, which (from painful experience) will create - ;a really nasty condition to debug! - ;so vector to GETVAR via here, so the return address seen by $D11D is here, and never $xx28 - jsr GETVAR - rts -.code - - -; CRUNCH -- If this is one of our keywords, then tokenize it -; -crunch: - jsr jmp_crunch ;First crunch line normally - ldy #05 ;Offset for KERNAL - ;Y will contain line length+5 -@loop: - sty temp - jsr isword ;Are we at a keyword? - bcs @gotcha -@next: - jsr nextchar - bne @loop ;Null byte marks end - sta crunched_line-3,Y ;00 line number - lda #$FF ;'tis what A should be - rts ;Buh-bye - -; Insert token and crunch line -@gotcha: - ldx temp ;If so, A contains opcode - sta crunched_line-5,X -@move: - inx - lda crunched_line-5,Y - sta crunched_line-5,X ;Move text backwards - beq @next - iny - bpl @move - - -; ISWORD -- Checks to see if word is -; in table. If a word is found, then -; C is set, Y is one past the last char -; and A contains opcode. Otherwise, -; carry is clear. -; -; On entry, TEMP must contain current -; character position. -; -isword: - ldx #00 -@loop: - ldy temp -@loop2: - lda keywords,x - beq @notmine - cmp #$E0 - bcs @done ;Tokens are >=$E0 - cmp crunched_line-5,Y - bne @next - iny ;Success! Go to next char - inx - bne @loop2 -@next: - inx - lda keywords,x ;Find next keyword - cmp #$E0 - bcc @next - inx - bne @loop ;And check again -@notmine: - clc -@done: - rts - - -; NEXTCHAR finds the next char -; in the buffer, skipping -; spaces and quotes. On -; entry, TEMP contains the -; position of the last spot -; read. On exit, Y contains -; the index to the next char, -; A contains that char, and Z is set if at end of line. - -nextchar: - ldy temp -@loop: - iny - lda crunched_line-5,Y - beq @done - cmp #$8F ;REM - bne @cont - lda #00 -@skip: - sta temp2 ;Find matching character -@loop2: - iny - lda crunched_line-5,Y - beq @done - cmp temp2 - bne @loop2 ;Skip to end of line - beq @loop -@cont: - cmp #$20 ;space - beq @loop - cmp #$22 ;quote - beq @skip -@done: - rts - - -; -; LIST -- patches the LIST routine -; to list our new tokens correctly. -; - -list: - cmp #$E0 - bcc @notmine ;Not my token - cmp #HITOKEN - bcs @notmine - bit $0F ;Check for quote mode - bmi @notmine - sec - sbc #$DF ;Find the corresponding text - tax - sty $49 - ldy #00 -@loop: - dex - beq @done -@loop2: - iny - lda keywords,y - cmp #$E0 - bcc @loop2 - iny - bne @loop -@done: - lda keywords,y - cmp #$91 ;is it "ON"? - bne @not_on - lda #'O' - jsr CHROUT - lda #'N' - bne @skip - -@not_on: - cmp #$9B ;is it "LIST"? - - bne @not_list - lda #'L' - jsr CHROUT - lda #'I' - jsr CHROUT - lda #'S' - jsr CHROUT - lda #'T' - bne @skip -@not_list: - lda keywords,y - bmi @out ;is it >=$80? -@skip: - jsr CHROUT - iny - bne @done -@out: - cmp #$E0 ;It might be BASIC token - bcs @cont - ldy $49 -@notmine: - and #$FF - jmp (oldlist) -@cont: - ldy $49 - jmp $C700 ;Normal exit - - - -; -; EXECUTE -- if this is one of our new -; tokens, then execute it. -execute: - jsr CHRGET -execute_a: - php - cmp #':' ;is it a colon? - beq execute;if so, skip over and go to next token - cmp #$8B ;is it 'IF'? - bne @not_if - lda #$E0 ;our dummy IF token -@not_if: - cmp #$E0 - bcc @notmine - cmp #HITOKEN - bcs @notmine - plp - jsr @disp - jmp NEWSTT -@disp: - eor #$E0 - asl ;multiply by 2 - tax - lda token_routines+1,x - pha - lda token_routines,x - pha - jmp CHRGET ;exit to routine (via RTS) -@notmine: - plp - cmp #0 ;reset flags - jmp $C7E7 - -;the standard BASIC IF routine calls the BASIC EXECUTE routine directly, -;without going through the vector. That means an extended keyword following THEN -;will lead to a syntax error. So we have to reimpliment IF here -;this is taken from TransBASIC - The Transactor, vol 5, Issue 04 (March 1985) page 34 -if_keyword: - jsr FRMEVL ;evaluate expression - jsr CHRGOT - cmp #$89 ;is next token GOTO? - beq @ok - lda #$A7 ;is next token THEN - jsr $CEFF ;will generate SYNTAX ERROR if not -@ok: - jsr CHRGOT - ldx $61 ;result of expression : 0 means false - bne @expression_was_true - jmp $C93B ;go to REM implementation - skips rest of line -@expression_was_true: - bcs @not_numeric;CHRGOT clears carry flag if current char is a number - jmp $C8A0 ;do a GOTO -@not_numeric: - pla - pla ;pop the return address off the stack - jsr CHRGOT - jmp execute_a ;execute current token - - - -find_var: - sta VARNAM - stx VARNAM+1 - jsr safe_getvar - ldy #0 - rts - -set_connection_state: - lda #'C'+$80 - ldx #'O'+$80 - jsr find_var - tya - sta (VARPNT),y - iny - lda connection_state - sta (VARPNT),y - -set_error: - lda #'E'+$80 - ldx #'R'+$80 - sta VARNAM+1 - jsr find_var - lda #0 - sta (VARPNT),y - iny - lda ip65_error - sta (VARPNT),y - - rts - - -;emit the 4 bytes pointed at by AX as dotted decimals -emit_dotted_quad: - sta pptr - stx pptr + 1 - ldy #0 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #1 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #2 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #3 - lda (pptr),y - jsr emit_decimal - - rts - -emit_decimal: ;emit byte in A as a decimal number - pha - sta temp_bin ;save - sed ; Switch to decimal mode - lda #0 ; Ensure the result is clear - sta temp_bcd - sta temp_bcd+1 - ldx #8 ; The number of source bits - : - asl temp_bin+0 ; Shift out one bit - lda temp_bcd+0 ; And add into result - adc temp_bcd+0 - sta temp_bcd+0 - lda temp_bcd+1 ; propagating any carry - adc temp_bcd+1 - sta temp_bcd+1 - dex ; And repeat for next bit - bne :- - - cld ;back to binary - - pla ;get back the original passed in number - bmi @emit_hundreds ; if N is set, the number is >=128 so emit all 3 digits - cmp #10 - bmi @emit_units - cmp #100 - bmi @emit_tens -@emit_hundreds: - lda temp_bcd+1 ;get the most significant digit - and #$0f - clc - adc #'0' - jsr emit_a - -@emit_tens: - lda temp_bcd - lsr - lsr - lsr - lsr - clc - adc #'0' - jsr emit_a -@emit_units: - lda temp_bcd - and #$0f - clc - adc #'0' - jsr emit_a - - rts - -print: - sta pptr - stx pptr + 1 - -@print_loop: - ldy #0 - lda (pptr),y - beq @done_print - jsr print_a - inc pptr - bne @print_loop - inc pptr+1 - bne @print_loop ;if we ever get to $ffff, we've probably gone far enough ;-) -@done_print: - rts - - -extract_string: - - jsr FRMEVL - - jsr FRESTR ;if not string, will create type mismatch error - - sta param_length - tay - lda #0 - sta transfer_buffer,y - dey -@loop: - lda ($22),y - sta transfer_buffer,y - dey - bpl @loop - jmp FRESTR ;free up the temp string created by FRMEVL - -;get a string value from BASIC command, turn into a 32 bit IP address,save it in the 4 bytes pointed at by AX -get_ip_parameter: - stax temp2 - jsr extract_string - ldax #transfer_buffer - jsr dns_set_hostname - - bcs @error - jsr dns_resolve - bcc @ok -@error: - ldax #address_resolution - jmp print_error - -@ok: - ldax #dns_ip - ldx #4 -@copy_dns_ip: - lda dns_ip,y - sta (temp2),y - iny - dex - bne @copy_dns_ip - rts - - -reset_string: - ldy #string_buffer - sty current_output_ptr+1 - rts - -print_dotted_quad: - jsr reset_string - jsr emit_dotted_quad -make_null_terminated_and_print: - lda #0 - jsr emit_a - ldax #string_buffer - jmp print - -print_mac: - jsr reset_string - jsr emit_mac - jmp make_null_terminated_and_print - -;print 6 bytes printed at by AX as a MAC address -emit_mac: - stax pptr - ldy #0 -@one_mac_digit: - tya ;just to set the Z flag - pha - beq @dont_print_colon - lda #':' - jsr emit_a -@dont_print_colon: - pla - tay - lda (pptr),y - jsr emit_hex - iny - cpy #06 - bne @one_mac_digit - rts - -emit_hex: - pha - pha - lsr - lsr - lsr - lsr - tax - lda hexdigits,x - jsr emit_a - pla - and #$0F - tax - lda hexdigits,x - jsr emit_a - pla - rts - -print_hex: - jsr reset_string - jsr emit_hex - jmp make_null_terminated_and_print - -print_error: - jsr print - ldax #error - jsr print - lda ip65_error - jsr print_hex - jsr print_cr - jsr set_error - sec - rts - -get_optional_byte: - jsr CHRGOT - beq @no_param ;leave X as it was - jsr CHKCOM ;make sure next char is a comma (and skip it) - jsr CHRGOT - beq @eol - jsr GETBYT -@no_param: - rts -@eol: - jmp $CF08 ;SYNTAX ERROR - -ipcfg_keyword: - - ldax #interface_type - jsr print - - ldax #eth_driver_name - jsr print - jsr print_cr - - ldax #mac_address_msg - jsr print - ldax #cfg_mac - jsr print_mac - jsr print_cr - - ldax #ip_address_msg - jsr print - ldax #cfg_ip - jsr print_dotted_quad - jsr print_cr - - ldax #netmask_msg - jsr print - ldax #cfg_netmask - jsr print_dotted_quad - jsr print_cr - - ldax #gateway_msg - jsr print - ldax #cfg_gateway - jsr print_dotted_quad - jsr print_cr - - ldax #dns_server_msg - jsr print - ldax #cfg_dns - jsr print_dotted_quad - jsr print_cr - - - ldax #dhcp_server_msg - jsr print - ldax #dhcp_server - jsr print_dotted_quad - jsr print_cr - - ldax #tftp_server_msg - jsr print - ldax #cfg_tftp_server - jsr print_dotted_quad - jsr print_cr - -clear_error: - lda #0 - sta ip65_error - jmp set_error - -dhcp_keyword: - jsr dhcp_init - bcc @init_ok - jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to default values) - -@init_failed: - jsr set_error - ldax #dhcp - jmp print_error -@init_ok: - jmp clear_error - rts - -mac_keyword: - jsr extract_string - ldy #2 -: - lda transfer_buffer,y - sta cfg_mac_default+3,y - dey - bpl:- - jsr ip65_init - rts - -ping_keyword: - ldax #icmp_echo_ip - jsr get_ip_parameter - bcc @no_error - rts -@no_error: - - ;is there an optional parameter? - ldx #3 - jsr get_optional_byte - stx ping_counter - - ldax #pinging - jsr print - ldax #dns_ip - jsr print_dotted_quad - jsr print_cr - -@ping_loop: - - jsr icmp_ping - bcs @error - lda #'.' -@print_and_loop: - jsr print_a - lda $cb ;current key pressed - cmp #$18 ;RUN/STOP? - beq @done - lda ping_counter - beq @ping_loop - dec ping_counter - cmp #1 - bne @ping_loop -@done: - jsr print_cr - jmp set_error -@error: - lda #'!' - jmp @print_and_loop - - -myip_keyword: - ldax #cfg_ip - jmp get_ip_parameter - -dns_keyword: - ldax #cfg_dns - jmp get_ip_parameter - -gateway_keyword: - ldax #cfg_gateway - jmp get_ip_parameter - -netmask_keyword: - ldax #cfg_netmask - jmp get_ip_parameter - -tftp_keyword: - ldax #cfg_tftp_server - jmp get_ip_parameter - - -tf_param_setup: - jsr print - jsr extract_string - ldax #transfer_buffer - stax tftp_filename - jsr print - lda #' ' - jsr print_a - lda #'(' - jsr print_a - ldax #cfg_tftp_server - jsr print_dotted_quad - lda #')' - jsr print_a - - jsr print_cr - - ldx #$03 -: - lda cfg_tftp_server,x - sta tftp_ip,x - dex - bpl :- - rts - -tfget_keyword: - ldax #get_msg - jsr tf_param_setup - ldax #tftp_download_callback - jsr tftp_set_callback_vector - lda #0 - sta file_opened -;make file output name - lda #'@' - sta string_buffer - lda #':' - sta string_buffer+1 - ldy #$FF -@loop: - iny - lda transfer_buffer,y - sta string_buffer+2,y - bne @loop - iny - iny - lda #',' - sta string_buffer,y - iny - lda #'P' - sta string_buffer,y - iny - lda #',' - sta string_buffer,y - iny - lda #'W' - sta string_buffer,y - iny - sta string_length - - jsr tftp_download -after_tftp_xfer: - bcc @no_error - ldax #tftp -@error_set: - jsr print_error -@no_error: - jsr close_file - jmp set_error - -close_file: - lda #$02 ; filenumber 2 - jsr $FFC3 ; call CLOSE - rts - -open_file: - ;A,X,Y set up ready for a call to SETNAM for file #2 - jsr $FFBD ; call SETNAM - lda #$02 ; file number 2 - ldx $BA ; last used drive - - ldy #$02 ; secondary address 2 - jsr $FFBA ; call SETLFS - - jmp $FFC0 ; call OPEN - - -tftp_download_callback: - - ;buffer pointed at by AX now contains "tftp_data_block_length" bytes - stax temp - - lda #'.' - jsr print_a - lda file_opened - bne @already_opened - lda string_length - ldx #string_buffer - jsr open_file - -@already_opened: - - ldx #$02 ; filenumber 2 = output file - jsr $FFC9 ; call CHKOUT - -@copy_one_byte: - lda tftp_data_block_length - bne @not_done - lda tftp_data_block_length+1 - beq @done - -@not_done: - ldy #2 ;we want to skip the first 2 bytes in the buffer - lda (temp),y - jsr $ffd2 ;write byte - inc temp - bne :+ - inc temp+1 -: - lda tftp_data_block_length - dec tftp_data_block_length - cmp #0 - bne @copy_one_byte - dec tftp_data_block_length+1 - jmp @copy_one_byte -@done: - - ldx #$00 ; filenumber 0 = console - jmp $FFC9 ; call CHKOUT - - -tfput_keyword: - ldax #put_msg - jsr tf_param_setup - - lda param_length - ldx #transfer_buffer - jsr open_file - bcs @error - lda $90 ;get ST - beq @ok -@error: - - ldx #4 ;"FILE NOT FOUND" error - jmp $C437 ;error -@ok: - ldax #tftp_upload_callback - jsr tftp_set_callback_vector - jsr tftp_upload - jmp after_tftp_xfer - - -tftp_upload_callback: - stax copy_dest - lda #'.' - jsr print_a - lda #0 - sta bytes_read - sta bytes_read+1 - - ldx #$02 ; filenumber 2 = output file - jsr $FFC6 ; call CHKIN (file 2 now used as input) -@loop: - jsr $FFCF ; call CHRIN (get a byte from file) - ldy #0 - sta (copy_dest),y - inc copy_dest - bne :+ - inc copy_dest+1 -: - inc bytes_read - bne :+ - inc bytes_read+1 -: - lda bytes_read+1 - cmp #2 - beq @done - jsr $FFB7 ; call READST (read status byte) - beq @loop ; nonzero mean either EOF or read error - -@done: - ldx #$00 ; filenumber 0 = console - jsr $FFC6 ; call CHKIN (console now used as input) - ldax bytes_read - rts - -skip_comma_get_integer: - jsr CHRGOT - jsr CHKCOM ;make sure next char is a comma (and skip it) -get_integer: - jsr CHRGOT - beq @eol - jsr FRMNUM - jsr GETADR - ldax LINNUM -@no_param: - rts -@eol: - jmp $CF08 ;SYNTAX ERROR - - -make_tcp_connection: - lda #0 - sta connection_state - jsr set_connection_state - ldax #tcp_connect_ip - jsr get_ip_parameter - bcc @no_error - rts -@no_error: - jsr skip_comma_get_integer - jsr tcp_connect - bcc :+ -@connect_error: - ldax #connect - jmp print_error -: - ldax #connected_msg - jsr print - lda #1 - sta connection_state - lda #0 - sta ip65_error - jsr set_connection_state - clc - rts - -netcat_keyword: - lda $CC - sta cursor_state - lda #$0 - sta $CC ;enable blinking cursor - ldax #netcat_callback - stax tcp_callback - jsr make_tcp_connection - bcs @exit - - ;is there an optional parameter? - ldx #0 - jsr get_optional_byte - stx netcat_mode -@main_polling_loop: - - jsr timer_read - txa - adc #$20 ;32 x 1/4 = ~ 8seconds - sta netcat_timeout -@wait_for_keypress: - jsr timer_read - cpx netcat_timeout - bne @no_timeout - jsr tcp_send_keep_alive - jmp @main_polling_loop -@no_timeout: - jsr ip65_process - lda connection_state - bne @not_disconnected -@disconnected: - ldax #disconnected - jsr print -@exit: - lda cursor_state - sta $CC - rts -@not_disconnected: - - lda netcat_mode - beq @not_line_mode - - lda #$00 - sta string_length - -;process inbound ip packets while waiting for a keypress -@read_line: - lda $cb ;current key pressed - cmp #$18 ;RUN/STOP? - beq @runstop - jsr ip65_process - lda connection_state - beq @disconnected - - jsr $f142 ;not officially documented - where F13E (GETIN) falls through to if device # is 0 (KEYBD) - - beq @read_line - - cmp #$14 ;Delete - beq @delete - - cmp #$0d ;Return - beq @input_done - - ;End reached? - ldy string_length - cpy #$FF - beq @read_line - - jsr $ffd2 ;Print it - jsr native_to_ascii - sta transfer_buffer,y ;Add it to string - - inc string_length - - ;Not yet. - jmp @read_line - - -@delete: - ;First, check if we're at the beginning. - lda string_length - bne @delete_ok - jmp @read_line - - ;At least one character entered. -@delete_ok: - ;Move pointer back. - dec string_length - - ;Print the delete char - lda #$14 - jsr $ffd2 - - ;Wait for next char - jmp @read_line - -@input_done: - jsr reset_cursor - lda #$0d - jsr $ffd2 ;print a newline - ldy string_length - lda #$0d - sta transfer_buffer,y - iny - lda #$0a - sta transfer_buffer,y - iny - sty tcp_send_data_len - jmp @send_buffer -@not_line_mode: - - ;is there anything in the input buffer? - lda $c6 ;NDX - chars in keyboard buffer - bne :+ - jmp @wait_for_keypress -: - lda #0 - sta tcp_send_data_len - sta tcp_send_data_len+1 -@get_next_char: - lda $cb ;current key pressed - cmp #$18 ;RUN/STOP? - bne @not_runstop -@runstop: - lda #0 - sta $cb ;overwrite "current key pressed" else it's seen by the tcp stack and the close aborts - lda cursor_state - sta $CC - - jmp tcp_close -@not_runstop: - jsr $ffe4 ;getkey - 0 means no input - tax - beq @no_more_input - txa - - ldy tcp_send_data_len - sta transfer_buffer,y - inc tcp_send_data_len - jmp @get_next_char -@no_more_input: -@send_buffer: - ldax #transfer_buffer - jsr tcp_send - bcs @error_on_send - jmp @main_polling_loop - -@error_on_send: - lda cursor_state - sta $CC - - ldax #transmission - jmp print_error - -reset_cursor: - lda $cf ;0 means last cursor blink set char to be reversed - beq @done - lda $ce ;original value of cursor char - ldx $287 ;original colour - ldy #$0 ;blink phase - sty $cf - jsr $ea13 ;restore char & colour -@done: - rts -netcat_callback: - jsr reset_cursor - lda tcp_inbound_data_length+1 - cmp #$ff - bne @not_eof - lda #0 - sta connection_state - rts -@not_eof: - - ldax tcp_inbound_data_ptr - stax temp2 - lda tcp_inbound_data_length - sta buffer_length - lda tcp_inbound_data_length+1 - sta buffer_length+1 - -@next_byte: - lda $cb ;current key pressed - cmp #$18 ;RUN/STOP? - beq @finished - - ldy #0 - lda (temp2),y - ldx netcat_mode - beq @no_transform - jsr ascii_to_native -@no_transform: - jsr print_a - inc temp2 - bne :+ - inc temp2+1 -: - lda buffer_length+1 - beq @last_page - lda buffer_length - bne @not_end_of_page - dec buffer_length+1 -@not_end_of_page: - dec buffer_length - jmp @next_byte -@last_page: - dec buffer_length - beq @finished - - jmp @next_byte - -@finished: - - rts - - -tcpconnect_keyword: - ldax #tcpconnect_callback - stax tcp_callback - jmp make_tcp_connection - -tcpconnect_callback: - - ldax #transfer_buffer - stax copy_dest - ldax tcp_inbound_data_ptr - stax copy_src - lda tcp_inbound_data_length - ldx tcp_inbound_data_length+1 - beq @short_packet - cpx #$ff - bne @not_end_packet - lda #0 - sta connection_state - rts -@not_end_packet: - lda #$ff -@short_packet: - -set_input_string: - pha - lda #'I' - ldx #'N'+$80 - jsr find_var - ldy #0 - pla - pha - sta (VARPNT),y - iny - lda #transfer_buffer - sta (VARPNT),y - pla - beq :+ - ldx #0 - jsr copymem -: - rts - -poll_keyword: - lda #0 - jsr set_input_string - jsr set_connection_state - jsr ip65_process - lda ip65_error - beq @no_error - jmp set_error -@no_error: - jmp set_connection_state - -tcplisten_keyword: - lda #0 - sta connection_state - sta ip65_error - ldax #tcpconnect_callback - stax tcp_callback - jsr get_integer - jsr tcp_listen - bcs :+ - inc connection_state -: - jmp set_connection_state - -tcpsend_keyword: - jsr extract_string - ldy param_length - sty tcp_send_data_len - ldy #0 - sty tcp_send_data_len+1 - ldax #transfer_buffer - jsr tcp_send - jmp set_connection_state - -tcpclose_keyword: - lda #0 - sta connection_state - jsr tcp_close - jmp set_connection_state - -tcpblat_keyword: - - jsr extract_string - - ldx #transfer_buffer - lda param_length - jsr SETNAM - lda #$02 ; file number 2 - ldx $BA ; last used device number - bne @skip - ldx #$08 ; default to device 8 -@skip: - ldy #$02 ; secondary address 2 - jsr SETLFS - jsr OPEN - bcs @error ; if carry set, the file could not be opened - ldx #$02 ; filenumber 2 - jsr CHKIN - ldy #$00 -@loop: - jsr READST - bne @eof ; either EOF or read error - jsr CHRIN - sta transfer_buffer,y - iny - bne @loop - ldax #$100 - stax tcp_send_data_len - ldax #transfer_buffer - jsr tcp_send - bcs @error_stored - ldy #0 - jmp @loop -@eof: - and #$40 ; end of file? - beq @readerror - lda #$00 - sty tcp_send_data_len - sta tcp_send_data_len+1 - ldax #transfer_buffer - jsr tcp_send - bcs @error_stored - -@close: - lda #0 -@store_error: - sta ip65_error -@error_stored: - lda #$02 ; filenumber 2 - jsr CLOSE - ldx #$00 ; filenumber 0 = keyboard - jsr CHKIN ;keyboard now input device again - jmp set_error - -@error: - lda #KPR_ERROR_DEVICE_FAILURE - jmp @store_error -@readerror: - lda #KPR_ERROR_FILE_ACCESS_FAILURE - jmp @store_error - -evaluate: - lda $00 - sta $0D ;set string flag to not string - jsr CHRGET - cmp #$E3 ; PING keyword - bne @done - - jsr CHRGET ;take PING command off stack - - ldax #icmp_echo_ip - jsr get_ip_parameter - lda #$00 - sta $0D ;set string flag to not string - - bcs @error - jsr icmp_ping - bcc @no_error -@error: - lda #$ff - tax -@no_error: - tay - txa - jmp $D395 ;signed 16 bit number to floating point - rts - -@done: - jsr CHRGOT - jmp $CE8D ;inside original EVAL routine - -.rodata -vectors: - .word crunch - .word list - .word execute - .word evaluate -; Keyword list -; Keywords are stored as normal text, -; followed by the token number. -; All tokens are >$80, -; so they easily mark the end of the keyword -hexdigits: -.byte "0123456789ABCDEF" - -pinging: -.byte"PINGING ",0 -interface_type: -.byte $12,"INTERFACE",$92,13,0 - -mac_address_msg: -.byte $12,"MAC ADDRESS",$92,13,0 - -ip_address_msg: -.byte $12,"IP ADDRESS",$92,13,0 - -netmask_msg: -.byte $12,"NETMASK",$92,13,0 - -gateway_msg: -.byte $12,"GATEWAY",$92,13,0 - -dns_server_msg: -.byte $12,"DNS SERVER",$92,13,0 - -dhcp_server_msg: -.byte $12,"DHCP SERVER",$92,13,0 - -tftp_server_msg: -.byte $12,"TFTP SERVER",$92,13,0 - -address_resolution: -.byte "ADDRESS RESOLUTION",0 - -get_msg: -.byte "GETTING ",0 -put_msg: -.byte "PUTTING ",0 - -tftp: -.byte "TFTP",0 -dhcp: -.byte "DHCP",0 - -connect: -.byte "CONNECT",0 - -transmission: -.byte "TRANSMISSION",0 - -error: -.byte " ERROR $",0 - -disconnected: -.byte 13,"DIS" -connected_msg: -.byte "CONNECTED",13,0 - -keywords: - .byte "IF",$E0 ;our dummy 'IF' entry takes $E0 - .byte "IPCFG",$E1 - .byte "DHCP",$E2 - .byte "PING",$E3 - .byte "MYIP",$E4 - .byte "NETMASK",$E5 - .byte "GATEWAY",$E6 - .byte "DNS",$E7 - .byte "TFTP",$E8 - .byte "TF",$A1,$E9 ;TFGET - BASIC will replace GET with A1 - .byte "TFPUT",$EA - .byte "NETCAT",$EB - .byte "TCPC",$91,"NECT",$EC ; TCPCONNECT - BASIC will replace ON with $91 - .byte "POLL",$ED - .byte "TCP",$9B,"EN",$EE ;TCPLISTEN - BASIC will replace LIST with $9b - .byte "TCPS",$80,$EF ;TCPSEND - BASIC will replace END with $80 - .byte "TCP",$A0,$F0 ;TCPLOSE - BASIC will replace CLOSE with $A0 - .byte "TCPBLAT",$F1 - .byte "MAC",$F2 - .byte $00 ;end of list -HITOKEN=$F3 - -; -; Table of token locations-1 -; -token_routines: -E0: .word if_keyword-1 -E1: .word ipcfg_keyword-1 -E2: .word dhcp_keyword-1 -E3: .word ping_keyword-1 -E4: .word myip_keyword-1 -E5: .word netmask_keyword-1 -E6: .word gateway_keyword-1 -E7: .word dns_keyword-1 -E8: .word tftp_keyword-1 -E9: .word tfget_keyword-1 -EA: .word tfput_keyword-1 -EB: .word netcat_keyword-1 -EC: .word tcpconnect_keyword-1 -ED: .word poll_keyword-1 -EE: .word tcplisten_keyword-1 -EF: .word tcpsend_keyword-1 -FO: .word tcpclose_keyword-1 -F1: .word tcpblat_keyword-1 -F2: .word mac_keyword-1 - -.segment "SELF_MODIFIED_CODE" - - -jmp_crunch: .byte $4C ;JMP -oldcrunch: .res 2 ;Old CRUNCH vector -oldlist: .res 2 -oldexec: .res 2 -oldeval: .res 2 -emit_a: -current_output_ptr=emit_a+1 - sta $ffff - inc string_length - inc current_output_ptr - bne :+ - inc current_output_ptr+1 -: - rts - - -.bss -netcat_mode: .res 1 -bytes_read: .res 2 -string_length: .res 1 -param_length: .res 1 -ip_string: .res 15 -netmask_string: .res 15 -dns_string: .res 15 -gateway_string: .res 15 - temp_bin: .res 1 -temp_bcd: .res 2 -ping_counter: .res 1 -string_buffer: .res 128 -transfer_buffer: .res 256 -file_opened: .res 1 -connection_state: .res 1 -netcat_timeout: .res 1 -buffer_length: .res 2 -cursor_state: .res 1 diff --git a/client/basic/timestamp.rb b/client/basic/timestamp.rb deleted file mode 100644 index a061cf9..0000000 --- a/client/basic/timestamp.rb +++ /dev/null @@ -1 +0,0 @@ -puts Time.now.strftime(".byte \" (%Y-%m-%d)\"") \ No newline at end of file diff --git a/client/basic/welcome_banner.txt b/client/basic/welcome_banner.txt deleted file mode 100644 index 1182c50..0000000 --- a/client/basic/welcome_banner.txt +++ /dev/null @@ -1 +0,0 @@ -**** KIPPER BASIC 1.1 **** diff --git a/client/carts/Makefile b/client/carts/Makefile deleted file mode 100644 index 3c012cf..0000000 --- a/client/carts/Makefile +++ /dev/null @@ -1,145 +0,0 @@ -AS=ca65 -LD=ld65 -CFLAGS=-Oirs -t $(TARGET) -AFLAGS= - -INCFILES=\ - ../inc/common.i\ - ../inc/commonprint.i\ - ../inc/net.i\ - ../inc/menu.i\ - ../inc/kipper_constants.i\ - ../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 \ - kkwiz_rr.bin \ - telnetd.prg \ - kipperdisk.d64 \ - -kipperkart.o: kipperkart.s $(INCFILES) ../inc/ping.i ../inc/disk_transfer.i ../inc/sidplay.i ../inc/config_menu.i - $(AS) $(AFLAGS) -o $@ $< - -kipperterm.o: kipperterm.s $(INCFILES) ../inc/telnet.i ../inc/config_menu.i - $(AS) $(AFLAGS) -o $@ $< - -kippergo.o: kippergo.s $(INCFILES) ../inc/gopher.i ../inc/telnet.i ../inc/config_menu.i - $(AS) $(AFLAGS) -o $@ $< - -%.o: %.s $(INCFILES) - ruby timestamp.rb > timestamp.i - $(AS) $(AFLAGS) $< - -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 - -kippergo.prg: kippergo.bin c64_cart_ram_header.prg - cat c64_cart_ram_header.prg kippergo.bin > kippergo.prg - -%.prg: %.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg - $(LD) -m $*.map -vm -C ../cfg/c64prg.cfg -o $*.prg $(AFLAGS) $< $(IP65LIB) $(C64RRNETLIB) - - -netboot.bin: netboot.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg - $(LD) -m netboot.map -vm -C ../cfg/c64_8kcart.cfg -o $@ $< $(IP65LIB) $(C64RRNETLIB) - ruby fix_cart.rb $@ 8192 - -kipperkart.bin: kipperkart.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_16kcart.cfg - $(LD) -m kipperkart.map -vm -C ../cfg/c64_16kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB) - ruby fix_cart.rb $@ 16384 - ruby set_ip_config.rb $@ mac auto - ruby dupe_cart.rb kipperkart.bin kipperkart_29c040.bin 32 - -kipperterm.bin: kipperterm.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_16kcart.cfg - $(LD) -m kipperterm.map -vm -C ../cfg/c64_16kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB) - ruby fix_cart.rb $@ 16384 - ruby dupe_cart.rb kipperterm.bin kipperterm_29c040.bin 32 - -kipperterm_rr.bin: kipperterm.bin - cp crt8040.obj rrnet_header.bin - cat rrnet_header.bin kipperterm.bin > kipperterm_rr.bin - ruby fix_cart.rb $@ 32768 - - -kippergo.bin: kippergo.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_16kcart.cfg - $(LD) -m kippergo.map -vm -C ../cfg/c64_16kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB) - ruby fix_cart.rb $@ 16384 - ruby dupe_cart.rb kippergo.bin kippergo_29c040.bin 32 - -kippergo_rr.bin: kippergo.bin - cp crt8040.obj rrnet_header.bin - cat rrnet_header.bin kippergo.bin > kippergo_rr.bin - ruby fix_cart.rb $@ 32768 - -kipperkart_rr.bin: kipperkart.bin - cp crt8040.obj rrnet_header.bin - cat rrnet_header.bin kipperkart.bin > kipperkart_rr.bin - ruby fix_cart.rb $@ 32768 - -kipperdisk.d64: kipperkart.prg kipperterm.prg kipperkart.prg kippergo.prg - c1541 -format kipperdisk,kd d64 $@ -attach $@ -write kipperkart.prg -write kipperterm.prg -write kippergo.prg - cp $@ ../../server/boot/ - -bobcart.bin: bobcart.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg - $(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 - -kkwiz_rr.bin: kkwiz.bin - cp crt8040.obj rrnet_header.bin - cat rrnet_header.bin kkwiz.bin > kkwiz_rr.bin - ruby fix_cart.rb $@ 32768 - cp kkwiz_rr.bin ../wiznet/ - -telnetd.bin: telnetd.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg - $(LD) -m telnetd.map -vm -C ../cfg/c64_8kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB) - ruby ../carts/fix_cart.rb $@ 8192 - -telnetd.prg: telnetd.bin cartheader.prg - cat cartheader.prg telnetd.bin > $@ - -d64_upload.d64: d64_upload.prg - cp d64_upload.prg ../../server/boot/ - c1541 -format d64upload,kd d64 $@ -attach $@ -write d64_upload.prg - -clean: - rm -f *.o *.bin *.map *.prg *.pg2 *.dsk *.d64 - -distclean: clean - rm -f *~ - -ip65: - make -C ../ip65 all - -drivers: - make -C ../drivers all diff --git a/client/carts/bobcart.s b/client/carts/bobcart.s deleted file mode 100644 index dabd5f4..0000000 --- a/client/carts/bobcart.s +++ /dev/null @@ -1,1671 +0,0 @@ - -.include "../inc/common.i" -;.ifndef KPR_API_VERSION_NUMBER -; .define EQU = -; .include "../inc/kipper_constants.i" -;.endif - - -HTTPD_TIMEOUT_SECONDS=5 ;what's the maximum time we let 1 connection be open for? - -;DEBUG=1 - -VARTAB = $2D ;BASIC variable table storage -ARYTAB = $2F ;BASIC array table storage -FREETOP = $33 ;bottom of string text storage area -MEMSIZ = $37 ;highest address used by BASIC -VARNAM = $45 ;current BASIC variable name -VARPNT = $47 ; pointer to current BASIC variable value - -SETNAM = $FFBD -SETLFS = $FFBA -LOAD = $FFD5 -OPEN = $FFC0 -CHKIN = $FFC6 -READST = $FFB7 ; read status byte -CHRIN = $FFCF ; get a byte from file -CLOSE = $FFC3 -MEMTOP = $FE25 -TXTPTR = $7A ;BASIC text pointer -IERROR = $0300 -ICRUNCH = $0304 ;Crunch ASCII into token -IQPLOP = $0306 ;List -IGONE = $0308 ;Execute next BASIC token - -CHRGET = $73 -CHRGOT = $79 -CHROUT = $FFD2 -GETBYT = $B79E ;BASIC routine -GETPAR = $B7EB ;Get a 16,8 pair of numbers -CHKCOM = $AEFD -NEW = $A642 -CLR = $A65E -NEWSTT = $A7AE -GETVAR = $B0E7 ;find or create a variable -FRMEVL = $AD9E ;evaluate expression -FRESTR = $B6A3 ;free temporary string -FRMNUM = $AD8A ;get a number -GETADR = $B7F7 ;convert number to 16 bit integer -INLIN = $A560 ; read a line from keyboard - -VALTYP=$0D ;00=number, $FF=string - -LINNUM = $14 ;Number returned by GETPAR - -crunched_line = $0200 ;Input buffer - -.import copymem -.importzp copy_src -.importzp copy_dest -.import ip65_init -.import cfg_get_configuration_ptr -.import ip65_process -.import ip65_error -.import cfg_ip -.import cfg_dns -.import cfg_gateway -.import cfg_netmask -.import icmp_ping -.import icmp_echo_ip -.import dotted_quad_value -.import parse_dotted_quad - -.import print_a -.import print_cr -.import cfg_mac -.import eth_driver_name -.import get_key_if_available -.import timer_read -.import native_to_ascii -.import ascii_to_native -.import eth_init - -.import http_parse_request -.import http_get_value -.import http_variables_buffer - -.import tcp_inbound_data_ptr -.import tcp_inbound_data_length -.import tcp_send_data_len -.import tcp_send -.import check_for_abort_key -.import tcp_connect_remote_port -.import tcp_remote_ip -.import tcp_listen -.import tcp_callback -.import tcp_close - -.import __DATA_LOAD__ -.import __DATA_RUN__ -.import __DATA_SIZE__ -.import __SELF_MODIFIED_CODE_LOAD__ -.import __SELF_MODIFIED_CODE_RUN__ -.import __SELF_MODIFIED_CODE_SIZE__ - -temp_ptr =copy_src -temp=copy_src -temp2=copy_dest - -;.zeropage -;temp: .res 2 -;temp2: .res 2 -pptr=temp_ptr -.segment "CARTRIDGE_HEADER" -.word init ;cold start vector -.word $FE47 ;warm start vector -.byte $C3,$C2,$CD,$38,$30 ; "CBM80" -.byte "KIPBOB" -.byte $0,$0,$0 ;reserved for future use -.byte $0,$0,$0 ;reserved for future use -.byte $0,$0,$0 ;reserved for future use - -.code - -init: -;first let the kernal do a normal startup - sei - jsr $fda3 ;initialize CIA I/O - jsr $fd50 ;RAM test, set pointers - jsr $fd15 ;set vectors for KERNAL - jsr $ff5B ;init. VIC - cli ;KERNAL init. finished - - -;we need to set up BASIC as well - jsr $e453 ;set BASIC vectors - jsr $e3bf ;initialize zero page - - - -;make some room for extra RAM - - ldax #$5800 - stax MEMSIZ - - stax http_variables_buffer - - ldax #welcome_banner - jsr print - lda #$90 ;'rest of banner - ldy #$E4 - -;print rest of startup banner - JSR $E42D - -;relocate our r/w data - ldax #__DATA_LOAD__ - stax copy_src - ldax #__DATA_RUN__ - stax copy_dest - ldax #__DATA_SIZE__ - jsr copymem - - ldax #__SELF_MODIFIED_CODE_LOAD__ - stax copy_src - ldax #__SELF_MODIFIED_CODE_RUN__ - stax copy_dest - ldax #__SELF_MODIFIED_CODE_SIZE__ - jsr copymem - - - ldx #5 ;Copy CURRENT vectors -@copy_old_vectors_loop: - lda ICRUNCH,x - sta oldcrunch,x - dex - bpl @copy_old_vectors_loop - - ldx #5 ;Copy CURRENT vectors -install_new_vectors_loop: - lda vectors,x - sta ICRUNCH,x - dex - bpl install_new_vectors_loop - -;copy error handlers: - ldax IERROR - stax olderror - ldax #error_handler - stax IERROR - - ;BASIC keywords installed, now bring up the ip65 stack - - jsr ip65_init - bcc @init_ok - ldax #@no_nic - jsr print -@reboot: - jsr $e453 ;reset vectors - jsr $e3bf ;init BASIC - jsr $a644 ;NEW - jmp $e39d -@no_nic: - .byte 13,"RR-NET NOT FOUND",13,0 - -@init_ok: - - jsr $A644 ;do a "NEW" - jmp $A474 ;"READY" prompt -; rts ;so BASIC will LOAD & RUN INDEX.BAS - -welcome_banner: -.byte $93,$0d," **** C64 BASIC ON BAILS" -.byte 0 - - -safe_getvar: ;if GETVAR doesn't find the desired variable name in the VARTABLE, a routine at $B11D will create it - ;however that routine checks if the low byte of the return address of the caller is $2A. if it is, - ;it assumes the caller is the routine at $AF28 which just wants to get the variable value, and - ;returns a pointer to a dummy 'zero' pointer. - ;so if user code that is calling GETVAR happens to be compiled to an address $xx28, it will - ;trigger this check, and not create a new variable, which (from painful experience) will create - ;a really nasty condition to debug! - ;so vector to GETVAR via here, so the return address seen by $B11D is here, and never $xx28 - jsr GETVAR - rts -.code - - -; CRUNCH -- If this is one of our keywords, then tokenize it -; -crunch: - jsr jmp_crunch ;First crunch line normally - ldy #05 ;Offset for KERNAL - ;Y will contain line length+5 -@loop: - sty temp - jsr isword ;Are we at a keyword? - bcs @gotcha -@next: - jsr nextchar - bne @loop ;Null byte marks end - sta crunched_line-3,Y ;00 line number - lda #$FF ;'tis what A should be - rts ;Buh-bye - -; Insert token and crunch line -@gotcha: - ldx temp ;If so, A contains opcode - sta crunched_line-5,X -@move: - inx - lda crunched_line-5,Y - sta crunched_line-5,X ;Move text backwards - beq @next - iny - bpl @move - - -; ISWORD -- Checks to see if word is -; in table. If a word is found, then -; C is set, Y is one past the last char -; and A contains opcode. Otherwise, -; carry is clear. -; -; On entry, TEMP must contain current -; character position. -; -isword: - ldx #00 -@loop: - ldy temp -@loop2: - lda keywords,x - beq @notmine - cmp #$E0 - bcs @done ;Tokens are >=$E0 - cmp crunched_line-5,Y - bne @next - iny ;Success! Go to next char - inx - bne @loop2 -@next: - inx - lda keywords,x ;Find next keyword - cmp #$E0 - bcc @next - inx - bne @loop ;And check again -@notmine: - clc -@done: - rts - - -; NEXTCHAR finds the next char -; in the buffer, skipping -; spaces and quotes. On -; entry, TEMP contains the -; position of the last spot -; read. On exit, Y contains -; the index to the next char, -; A contains that char, and Z is set if at end of line. - -nextchar: - ldy temp -@loop: - iny - lda crunched_line-5,Y - beq @done - cmp #$8F ;REM - bne @cont - lda #00 -@skip: - sta temp2 ;Find matching character -@loop2: - iny - lda crunched_line-5,Y - beq @done - cmp temp2 - bne @loop2 ;Skip to end of line - beq @loop -@cont: - cmp #$20 ;space - beq @loop - cmp #$22 ;quote - beq @skip -@done: - rts - - -; -; LIST -- patches the LIST routine -; to list our new tokens correctly. -; - -list: - cmp #$E0 - bcc @notmine ;Not my token - cmp #HITOKEN - bcs @notmine - bit $0F ;Check for quote mode - bmi @notmine - sec - sbc #$DF ;Find the corresponding text - tax - sty $49 - ldy #00 -@loop: - dex - beq @done -@loop2: - iny - lda keywords,y - cmp #$E0 - bcc @loop2 - iny - bne @loop -@done: - lda keywords,y - cmp #$91 ;is it "ON"? - bne @not_on - lda #'O' - jsr CHROUT - lda #'N' - bne @skip - -@not_on: - cmp #$9B ;is it "LIST"? - - bne @not_list - lda #'L' - jsr CHROUT - lda #'I' - jsr CHROUT - lda #'S' - jsr CHROUT - lda #'T' - bne @skip -@not_list: - lda keywords,y - bmi @out ;is it >=$80? -@skip: - jsr CHROUT - iny - bne @done -@out: - cmp #$E0 ;It might be BASIC token - bcs @cont - ldy $49 -@notmine: - and #$FF - jmp (oldlist) -@cont: - ldy $49 - jmp $A700 ;Normal exit - - - -; -; EXECUTE -- if this is one of our new -; tokens, then execute it. -execute: - jsr CHRGET -execute_a: - php - cmp #':' ;is it a colon? - beq execute;if so, skip over and go to next token - cmp #$8B ;is it 'IF'? - bne @not_if - lda #$E0 ;our dummy IF token -@not_if: - cmp #$E0 - bcc @notmine - cmp #HITOKEN - bcs @notmine - plp - jsr @disp - jmp NEWSTT -@disp: - eor #$E0 - asl ;multiply by 2 - tax - lda token_routines+1,x - pha - lda token_routines,x - pha - jmp CHRGET ;exit to routine (via RTS) -@notmine: - plp - cmp #0 ;reset flags - jmp $A7E7 - -;the standard BASIC IF routine calls the BASIC EXECUTE routine directly, -;without going through the vector. That means an extended keyword following THEN -;will lead to a syntax error. So we have to reimpliment IF here -;this is taken from TransBASIC - The Transactor, vol 5, Issue 04 (March 1985) page 34 -if_keyword: - jsr FRMEVL ;evaluate expression - jsr CHRGOT - cmp #$89 ;is next token GOTO? - beq @ok - lda #$A7 ;is next token THEN - jsr $AEFF ;will generate SYNTAX ERROR if not -@ok: - jsr CHRGOT - ldx $61 ;result of expression : 0 means false - bne @expression_was_true - jmp $A93B ;go to REM implementation - skips rest of line -@expression_was_true: - bcs @not_numeric;CHRGOT clears carry flag if current char is a number - jmp $A8A0 ;do a GOTO -@not_numeric: - pla - pla ;pop the return address off the stack - jsr CHRGOT - jmp execute_a ;execute current token - - - -;emit the 4 bytes pointed at by AX as dotted decimals -emit_dotted_quad: - sta pptr - stx pptr + 1 - ldy #0 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #1 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #2 - lda (pptr),y - jsr emit_decimal - lda #'.' - jsr emit_a - - ldy #3 - lda (pptr),y - jsr emit_decimal - - rts - -emit_decimal: ;emit byte in A as a decimal number - pha - sta temp_bin ;save - sed ; Switch to decimal mode - lda #0 ; Ensure the result is clear - sta temp_bcd - sta temp_bcd+1 - ldx #8 ; The number of source bits - : - asl temp_bin+0 ; Shift out one bit - lda temp_bcd+0 ; And add into result - adc temp_bcd+0 - sta temp_bcd+0 - lda temp_bcd+1 ; propagating any carry - adc temp_bcd+1 - sta temp_bcd+1 - dex ; And repeat for next bit - bne :- - - cld ;back to binary - - pla ;get back the original passed in number - bmi @emit_hundreds ; if N is set, the number is >=128 so emit all 3 digits - cmp #10 - bmi @emit_units - cmp #100 - bmi @emit_tens -@emit_hundreds: - lda temp_bcd+1 ;get the most significant digit - and #$0f - clc - adc #'0' - jsr emit_a - -@emit_tens: - lda temp_bcd - lsr - lsr - lsr - lsr - clc - adc #'0' - jsr emit_a -@emit_units: - lda temp_bcd - and #$0f - clc - adc #'0' - jsr emit_a - - rts - -print: - sta pptr - stx pptr + 1 - -@print_loop: - ldy #0 - lda (pptr),y - beq @done_print - jsr print_a - inc pptr - bne @print_loop - inc pptr+1 - bne @print_loop ;if we ever get to $ffff, we've probably gone far enough ;-) -@done_print: - rts - - -extract_string: - jsr FRMEVL - jsr FRESTR ;if not string, will create type mismatch error - sta param_length - tay - lda #0 - sta transfer_buffer,y - dey -@loop: - lda ($22),y - sta transfer_buffer,y - dey - bpl @loop - jmp FRESTR ;free up the temp string created by FRMEVL - -;get a string value from BASIC command, turn into a 32 bit IP address,save it in the 4 bytes pointed at by AX -get_ip_parameter: - stax temp2 - jsr extract_string - ldax #transfer_buffer - jsr parse_dotted_quad - - bcc @ok -@error: - ldax #address_resolution - jmp print_error - -@ok: - ldax #dotted_quad_value - ldx #4 -@copy_dotted_quad_value: - lda dotted_quad_value,y - sta (temp2),y - iny - dex - bne @copy_dotted_quad_value - rts - - -reset_string: - ldy #string_buffer - sty current_output_ptr+1 - rts - -print_dotted_quad: - jsr reset_string - jsr emit_dotted_quad -make_null_terminated_and_print: - lda #0 - jsr emit_a - ldax #string_buffer - jmp print - -print_integer: -sta $63 -stx $62 -jmp $bdd1 ;BASIC routine - -print_decimal: - jsr reset_string - jsr emit_decimal - jmp make_null_terminated_and_print - -print_mac: - jsr reset_string - jsr emit_mac - jmp make_null_terminated_and_print - -;print 6 bytes printed at by AX as a MAC address -emit_mac: - stax pptr - ldy #0 -@one_mac_digit: - tya ;just to set the Z flag - pha - beq @dont_print_colon - lda #':' - jsr emit_a -@dont_print_colon: - pla - tay - lda (pptr),y - jsr emit_hex - iny - cpy #06 - bne @one_mac_digit - rts - -emit_hex: - pha - pha - lsr - lsr - lsr - lsr - tax - lda hexdigits,x - jsr emit_a - pla - and #$0F - tax - lda hexdigits,x - jsr emit_a - pla - rts - -print_hex: - jsr reset_string - jsr emit_hex - jmp make_null_terminated_and_print - -print_error: - jsr print - ldax #error - jsr print - lda ip65_error - jsr print_hex - jsr print_cr - sec - rts - -get_optional_byte: - jsr CHRGOT - beq @no_param ;leave X as it was - jsr CHKCOM ;make sure next char is a comma (and skip it) - jsr CHRGOT - beq @eol - jsr GETBYT -@no_param: - rts -@eol: - jmp $AF08 ;SYNTAX ERROR - -ipcfg_keyword: - - ldax #interface_type - jsr print - - ldax #eth_driver_name - jsr print - jsr print_cr - - ldax #mac_address_msg - jsr print - ldax #cfg_mac - jsr print_mac - jsr print_cr - - ldax #ip_address_msg - jsr print - ldax #cfg_ip - jsr print_dotted_quad - jsr print_cr - - ldax #netmask_msg - jsr print - ldax #cfg_netmask - jsr print_dotted_quad - jsr print_cr - - ldax #gateway_msg - jsr print - ldax #cfg_gateway - jsr print_dotted_quad - jsr print_cr - - - - rts - - - -ping_keyword: - ldax #icmp_echo_ip - jsr get_ip_parameter - bcc @no_error - rts -@no_error: - - ;is there an optional parameter? - ldx #3 - jsr get_optional_byte - stx ping_counter - - ldax #pinging - jsr print - ldax #icmp_echo_ip - jsr print_dotted_quad - jsr print_cr - -@ping_loop: - jsr icmp_ping - bcs @error - lda #'.' -@print_and_loop: - jsr print_a - lda $cb ;current key pressed - cmp #$3F ;RUN/STOP? - beq @done - dec ping_counter - bne @ping_loop -@done: - jmp print_cr -@error: - jsr print_error - lda #'!' - jmp @print_and_loop - - -myip_keyword: - ldax #cfg_ip - jmp get_ip_parameter - -gateway_keyword: - ldax #cfg_gateway - jmp get_ip_parameter - -netmask_keyword: - ldax #cfg_netmask - jmp get_ip_parameter - -mac_keyword: - jsr extract_string - ldy #2 -: - lda transfer_buffer,y - sta cfg_mac+3,y - dey - bpl:- - jsr eth_init - rts - - -skip_comma_get_integer: - jsr CHRGOT - jsr CHKCOM ;make sure next char is a comma (and skip it) -get_integer: - jsr CHRGOT - beq @eol - jsr FRMNUM - jsr GETADR - ldax LINNUM -@no_param: - rts -@eol: - jmp $AF08 ;SYNTAX ERROR - - -hook_keyword: - jsr extract_string - ldax #transfer_buffer - jsr skip_comma_get_integer - stax handler_address - jsr find_hook - bcc @existing_entry - - lda hooks - cmp #MAX_HOOKS - bmi @got_space - ldx #$10 ;OUT OF MEMORY - jmp $A437 ;print error -@got_space: - clc - lda #0 - adc hooks - adc hooks - adc hooks - adc hooks - adc hooks - adc hooks - tay - inc hooks - @existing_entry: - ;y now points to free slot in hook table - lda transfer_buffer - sta hook_table,y - lda transfer_buffer+1 - sta hook_table+1,y - lda param_length - sta hook_table+2,y - lda hash - sta hook_table+3,y - lda handler_address - sta hook_table+4,y - lda handler_address+1 - sta hook_table+5,y - rts - - -goto: - sta $14 - sta $39 - stx $15 - stx $3a - - jmp $a8a3 ;GOTO keyword - - -find_hook: - jsr calc_hash - ldy #0 - ldx hooks - beq @done -@compare_one_entry: - lda transfer_buffer - cmp hook_table,y - bne @nope - lda transfer_buffer+1 - cmp hook_table+1,y - bne @nope - lda param_length - cmp hook_table+2,y - bne @nope - lda hash - cmp hook_table+3,y - bne @nope -;found it! - clc - rts -@nope: - dex - beq @done - iny - iny - iny - iny - iny - iny - - bne @compare_one_entry -@done: - sec - rts - -calc_hash: - clc - lda #0 - ldy param_length - beq @done -@loop: - adc transfer_buffer,y - dey - bne @loop -@done: - sta hash - rts - - -yield_keyword: - jsr flush_keyword - jsr tcp_close - .ifdef DEBUG - dec $d020 - .endif - jmp httpd_start - -gosub: - -bang_keyword: - jsr extract_string - lda sent_header - bne :+ - jsr send_header -: - ldy #0 - sty string_ptr -@loop: - lda transfer_buffer,y - jsr xmit_a - inc string_ptr - ldy string_ptr - cpy param_length - bne @loop - rts - - - -got_http_request: - jsr http_parse_request - ldax #path - jsr print - lda #$02 - jsr http_get_value - stax copy_src - jsr print - jsr print_cr - ldy #0 -@copy_path: - lda (copy_src),y - beq @done - sta transfer_buffer,y - iny - bne @copy_path -@done: - sty string_length - lda #0 - sta transfer_buffer,y - sty param_length - sty tmp_length - clc - lda #'P' - sta VARNAM - lda #'A'+$80 - jmp @set_var_value -@copy_vars: - iny - lda (copy_src),y - beq @last_var - tax ;var name - iny - clc - tya - adc copy_src - sta copy_src - bcc :+ - inc copy_src+1 -: - ldy #0 -: - lda (copy_src),y - beq @end_of_var - iny - bne :- -@end_of_var: - sty tmp_length - clc - stx VARNAM - lda #$80 -@set_var_value: - sta VARNAM+1 - jsr safe_getvar - ldy #0 - lda tmp_length - sta (VARPNT),y - iny - lda copy_src - sta (VARPNT),y - iny - lda copy_src+1 - sta (VARPNT),y - ldy tmp_length - jmp @copy_vars - - - @last_var: - - jsr find_hook - bcc @got_hook - ldax default_line_number - jmp goto - @got_hook: - lda hook_table+4,y - ldx hook_table+5,y - jmp goto - - -;start a HTTP server -;this routine will stay in an endless loop that is broken only if user press the ABORT key (runstop on a c64) -;inputs: -; none -;outputs: -; none -httpd_start: - ldx top_of_stack - txs - ldax #listening - jsr print - ldax #cfg_ip - jsr print_dotted_quad - lda #':' - jsr print_a - ldax httpd_port_number - jsr print_integer - jsr print_cr - lda #0 - sta $dc08 ;make sure TOD clock is started - -@listen: - jsr tcp_close - ldax httpd_io_buffer - stax tcp_buffer_ptr - ldax #http_callback - stax tcp_callback - ldax httpd_port_number - - jsr tcp_listen - bcs @abort_key_pressed - -@connect_ok: -.ifdef DEBUG - inc $d020 -.endif - ldax #connection_from - jsr print - ldax #tcp_remote_ip - jsr print_dotted_quad - lda #':' - jsr print_a - ldax tcp_connect_remote_port - - jsr print_integer - jsr print_cr - lda #0 - sta connection_closed - sta found_eol - clc - lda $dc09 ;time of day clock: seconds (in BCD) - sed - adc #HTTPD_TIMEOUT_SECONDS - cmp #$60 - bcc @timeout_set - sec - sbc #$60 -@timeout_set: - cld - sta connection_timeout_seconds - -@main_polling_loop: - jsr ip65_process - jsr check_for_abort_key - bcc @no_abort -@abort_key_pressed: - lda #0 - sta error_handling_mode - ldx #$1E ;break - jmp $e38b ;print error message, warm start BASIC - -@no_abort: - lda found_eol - bne @got_eol - - lda $dc09 ;time of day clock: seconds - - cmp connection_timeout_seconds - beq @connection_timed_out - lda connection_closed - beq @main_polling_loop -@connection_timed_out: -.ifdef DEBUG - dec $d020 -.endif - jmp @listen - -@got_eol: - - jsr reset_output_buffer - - ldy #$FF -: - iny - lda status_ok,y - sta status_code_buffer,y - bne :- - - ldy #$FF -: - iny - lda text_html,y - sta content_type_buffer,y - bne :- - - sta sent_header - - ldax httpd_io_buffer - jmp got_http_request - -http_callback: - lda tcp_inbound_data_length+1 - cmp #$ff - bne @not_eof - inc connection_closed -@done: - rts -@not_eof: - lda found_eol - bne @done - -;copy this chunk to our input buffer - ldax tcp_buffer_ptr - stax copy_dest - ldax tcp_inbound_data_ptr - stax copy_src - ldax tcp_inbound_data_length - jsr copymem - -;increment the pointer into the input buffer - clc - lda tcp_buffer_ptr - adc tcp_inbound_data_length - sta tcp_buffer_ptr - sta temp_ptr - lda tcp_buffer_ptr+1 - adc tcp_inbound_data_length+1 - sta tcp_buffer_ptr+1 - sta temp_ptr+1 - -;put a null byte at the end (assumes we have set temp_ptr already) - lda #0 - tay - sta (temp_ptr),y - -;look for CR or LF in input - sta found_eol - ldax httpd_io_buffer - stax get_next_byte+1 - -@look_for_eol: - jsr get_next_byte - cmp #$0a - beq @found_eol - cmp #$0d - bne @not_eol -@found_eol: - - inc found_eol - rts -@not_eol: - cmp #0 - bne @look_for_eol - rts - - - -reset_output_buffer: - ldax httpd_io_buffer - sta xmit_a_ptr+1 - stx xmit_a_ptr+2 - lda #0 - sta output_buffer_length - sta output_buffer_length+1 - rts - - -send_buffer: - ldax output_buffer_length - stax tcp_send_data_len - ldax httpd_io_buffer - jsr tcp_send - jmp reset_output_buffer - - -emit_string: - stax temp_ptr - ldy #0 -@next_byte: - lda (temp_ptr),y - beq @done - jsr xmit_a - iny - bne @next_byte -@done: - rts - - - -httpd_keyword: - jsr get_integer - stax httpd_port_number - jsr skip_comma_get_integer - stax default_line_number - inc error_handling_mode - tsx - stx top_of_stack - jmp httpd_start - -status_keyword: - jsr extract_string - ldy #$FF -@loop: - iny - lda transfer_buffer,y - sta status_code_buffer,y - bne @loop - rts - - -type_keyword: - jsr extract_string - ldy #$FF -@loop: - iny - lda transfer_buffer,y - sta content_type_buffer,y - bne @loop - rts - -send_header: - inc sent_header - ldax #http_version - jsr emit_string - ldax #status_code_buffer - jsr emit_string - ldax #crlf - jsr emit_string - ldax #content_type - jsr emit_string - ldax #content_type_buffer - jsr emit_string - ldax #end_of_header - jmp emit_string - - -flush_keyword: - - lda output_buffer_length - bne :+ - ldx output_buffer_length+1 - bne :+ - rts -: - jmp send_buffer - - -xsend_keyword: - - jsr extract_string - - ldx #transfer_buffer - lda param_length - jsr SETNAM - lda #$02 ; file number 2 - ldx $BA ; last used device number - bne @skip - ldx #$08 ; default to device 8 -@skip: - ldy #$02 ; secondary address 2 - jsr SETLFS - jsr OPEN - bcs @error ; if carry set, the file could not be opened - ldx #$02 ; filenumber 2 - jsr CHKIN - -@loop: - jsr CHRIN - sta tmp_a - jsr READST - bne @eof ; either EOF or read error - lda sent_header - bne :+ - jsr send_header -: - lda tmp_a - jsr xmit_a - jmp @loop -@eof: - and #$40 ; end of file? - beq @error - lda tmp_a - jsr xmit_a - -@close_handles: - lda #$02 ; filenumber 2 - jsr CLOSE - ldx #$00 ; filenumber 0 = keyboard - jsr CHKIN ;keyboard now input device again - rts - - - @error: - - lda #$00 ; no filename - tax - tay - jsr SETNAM - lda #$0f ;file number 15 - ldx $ba ;drive number - ldy #$0f ; secondary address 15 (error channel) - jsr SETLFS - jsr OPEN - LDX #$0F ; filenumber 15 - JSR CHKIN ;(file 15 now used as input) - LDY #$00 -@error_loop: - JSR READST ;(read status byte) - BNE @error_eof ; either EOF or read error - JSR CHRIN ;(get a byte from file) - sta error_buffer,y - iny - - JMP @error_loop ; next byte -@error_eof: - lda #0 - sta error_buffer,y - LDX #$00 ; filenumber 0 = keyboard - JSR CHKIN ;(keyboard now input device again) - - - jsr @close_handles - jmp create_error - -create_error: - lda sent_header - bne @header_sent - ldy #$FF -: - iny - lda status_error,y - sta status_code_buffer,y - bne :- - jsr send_header - -@header_sent: - ldax #error_start - jsr emit_string - ldax #system_error - jsr print - lda $3a ;current line number - ldx $39 - sta $62 - stx $63 - ldx #$90 ;exponent to 16 - sec - jsr $bc49 ;pad out flp acc - jsr $bddf ;convert to string - jsr $b487 ;move string descriptor into flp acc - jsr $b6a6 ;get text pointer into $22/$23 - tay - lda #0 - sta ($22),y - lda $22 - ldx $23 - jsr emit_string - jsr emit_br - ldax #line_number - jsr print - lda $22 - ldx $23 - jsr print - jsr print_cr - ldax #error_buffer - jsr emit_string - ldax #error_buffer - jsr print - jmp yield_keyword - -emit_br: - ldax #br - jmp emit_string - -error_handler: - ldy error_handling_mode - bne @send_error_to_browser - jmp (olderror) -@send_error_to_browser: - txa - asl a - tax - lda $a326,x ; fetch address from table of error messages - sta $22 - lda $a327,x ; fetch address from table of error messages - sta $23 - ldy #0 -@one_char: - lda ($22),y - pha - and #$7f - sta error_buffer,y - iny - pla - bpl @one_char - lda #0 - sta error_buffer,y - jmp create_error - -.rodata -vectors: - .word crunch - .word list - .word execute - -hexdigits: -.byte "0123456789ABCDEF" - -CR=$0D -LF=$0A - -error_start: -.byte "

    SYSTEM ERROR


    " -line_number: -.byte " LINE NUMBER: ",0 -br: -.byte "
    ",CR,LF,0 - -listening: -.byte"LISTENING ON ",0 - -pinging: -.byte"PINGING ",0 -interface_type: -.byte "INTERFACE : ",0 - -mac_address_msg: -.byte "MAC ADDRESS : ", 0 - -ip_address_msg: -.byte "IP ADDRESS : ", 0 - -netmask_msg: -.byte "NETMASK : ", 0 - -gateway_msg: -.byte "GATEWAY : ", 0 - - -address_resolution: -.byte "ADDRESS RESOLUTION",0 - - -connect: -.byte "CONNECT",0 - -error: -.byte " ERROR $",0 - -disconnected: -.byte 13,"DIS" -connected_msg: -.byte "CONNECTED",13,0 - - -path: - .byte "PATH: ",0 - -http_version: - .byte "HTTP/1.0 ",0 - -status_ok: - .byte "200 OK",0 -status_error: - .byte "500 " -system_error: - .byte "SYSTEM ERROR",0 -content_type: - .byte "Content-Type: ",0 -text_html: - .byte "text/html",0 - -end_of_header: - .byte CR,LF - .byte "Connection: Close",CR,LF - .byte "Server: BoB_httpd/0.c64",CR,LF -crlf: - .byte CR,LF,0 - -connection_from: .byte "CONNECTION FROM ",0 - - -; Keyword list -; Keywords are stored as normal text, -; followed by the token number. -; All tokens are >$80, -; so they easily mark the end of the keyword -keywords: - .byte "IF",$E0 ;our dummy 'IF' entry takes $E0 - .byte "IPCFG",$E1 - .byte "DHCP",$E2 ;DUMMY! - .byte "PING",$E3 - .byte "MYIP",$E4 - .byte "NETMASK",$E5 - .byte "GATEWAY",$E6 - .byte "DNS",$E7 ;DUMMY! - .byte "HOOK",$E8 - .byte "YIELD",$E9 - .byte "XS",$80,$EA ;BASIC will replace 'END' with $80 - .byte "!",$EB - .byte "HTTPD",$EC - .byte "TYPE",$ED - .byte "STATUS",$EE - .byte "FLUSH",$EF - .byte "MAC",$F0 - .byte $00 ;end of list -HITOKEN=$F1 - -; -; Table of token locations-1 -; -token_routines: -E0: .word if_keyword-1 -E1: .word ipcfg_keyword-1 -E2: .word ipcfg_keyword-1 ;dummy -E3: .word ping_keyword-1 -E4: .word myip_keyword-1 -E5: .word netmask_keyword-1 -E6: .word gateway_keyword-1 -E7: .word ipcfg_keyword-1 ;dummy -E8: .word hook_keyword-1 -E9: .word yield_keyword-1 -EA: .word xsend_keyword-1 -EB: .word bang_keyword-1 -EC: .word httpd_keyword-1 -ED: .word type_keyword-1 -EE: .word status_keyword-1 -EF: .word flush_keyword-1 -F0: .word mac_keyword-1 - -.segment "SELF_MODIFIED_CODE" - - -jmp_crunch: .byte $4C ;JMP -oldcrunch: .res 2 ;Old CRUNCH vector -oldlist: .res 2 -oldexec: .res 2 -olderror: .res 2 - -emit_a: -current_output_ptr=emit_a+1 - sta $ffff - inc string_length - inc current_output_ptr - bne :+ - inc current_output_ptr+1 -: - rts - -MAX_HOOKS=10 - -hook_table: -.res MAX_HOOKS*6 -;format is: -; $00/$01 first 2 chars of hook name -; $02 length of name -; $03 hash of name -; $04/$05 line number that hook handler starts at - -hooks: .byte 0 -error_handling_mode: .byte 0 -connection_timeout_seconds: .byte 0 -found_eol: .byte 0 -connection_closed: .byte 0 - -httpd_io_buffer: .word __httpd_io_buffer -httpd_port_number: .word 80 - - -get_next_byte: - lda $ffff - inc get_next_byte+1 - bne @skip - inc get_next_byte+2 -@skip: - rts - - -xmit_a: - -xmit_a_ptr: - sta $ffff - inc xmit_a_ptr+1 - bne :+ - inc xmit_a_ptr+2 -: - inc output_buffer_length - bne :+ - inc output_buffer_length+1 - lda output_buffer_length+1 - cmp #2 - bne :+ - stx temp_x - jsr send_buffer - ldx temp_x -: - rts - -.bss -string_length: .res 1 -param_length: .res 1 -tmp_length: .res 1 -temp_bin: .res 1 -temp_bcd: .res 2 -ping_counter: .res 1 -http_buffer: .res 256 -string_buffer: .res 128 -transfer_buffer: .res 256 -handler_address: .res 2 -hash: .res 1 -string_ptr: .res 1 -default_line_number: .res 2 -output_buffer_length: .res 2 -tcp_buffer_ptr: .res 2 -buffer_size: .res 1 -temp_x: .res 1 -sent_header: .res 1 -tmp_a: .res 1 -error_buffer: .res 80 -top_of_stack: .res 1 -.segment "TCP_VARS" - -__httpd_io_buffer: .res 1024 ;temp buffer for storing inbound requests. -content_type_buffer: .res 128 -status_code_buffer: .res 128 - - - - -;-- LICENSE FOR bails.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 netboot65. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009,2010 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/client/carts/bootmenu.s b/client/carts/bootmenu.s deleted file mode 100644 index d63d48b..0000000 --- a/client/carts/bootmenu.s +++ /dev/null @@ -1,164 +0,0 @@ -;############# -; -; This program looks for a TNDP server on the network, presents a catalog of volumes on that server, and allows a volume to be attached -; -; jonno@jamtronix.com - January 2009 -; - - .include "../inc/common.i" - .include "../inc/commonprint.i" - .include "../inc/net.i" - .import cls - - .import exit_to_basic - - .import copymem - .importzp copy_src - .importzp copy_dest - - .import __STARTUP_LOAD__ - .import __STARTUP_SIZE__ - .import __BSS_LOAD__ - .import __DATA_LOAD__ - .import __DATA_RUN__ - .import __DATA_SIZE__ - .import __RODATA_LOAD__ - .import __RODATA_RUN__ - .import __RODATA_SIZE__ - .import __CODE_LOAD__ - .import __CODE_RUN__ - .import __CODE_SIZE__ - -.segment "PAGE3" - -disable_language_card: .res 3 -bin_file_jmp: .res 3 - -; ------------------------------------------------------------------------ - - .segment "EXEHDR" - - .addr __STARTUP_LOAD__ ; Start address - .word __STARTUP_SIZE__+__CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; Size - -; ------------------------------------------------------------------------ - - -.segment "STARTUP" - - - lda $c089 ;enable language : card read ROM, write RAM, BANK 1 - - ;copy the monitor rom on to the language card - ldax #$f800 - stax copy_src - stax copy_dest - ldax #$0800 - jsr startup_copymem - - - lda $c08b ;enable language : card read RAM, write RAM, BANK 1 - lda $c08b ;this soft switch needs to be read twice - - - ;relocate the CODE segment - ldax #__CODE_LOAD__ - stax copy_src - ldax #__CODE_RUN__ - stax copy_dest - ldax #__CODE_SIZE__ - jsr startup_copymem - - - ;relocate the RODATA segment - ldax #__RODATA_LOAD__ - stax copy_src - ldax #__RODATA_RUN__ - stax copy_dest - ldax #__RODATA_SIZE__ - jsr startup_copymem - - ;relocate the DATA segment - ldax #__DATA_LOAD__ - stax copy_src - ldax #__DATA_RUN__ - stax copy_dest - ldax #__DATA_SIZE__ - jsr startup_copymem - - jmp init - -; copy memory -; set copy_src and copy_dest, length in A/X - - -end: .res 1 - -startup_copymem: - sta end - ldy #0 - - cpx #0 - beq @tail - -: lda (copy_src),y - sta (copy_dest),y - iny - bne :- - inc copy_src+1 ;next page - inc copy_dest+1 ;next page - dex - bne :- - -@tail: - lda end - beq @done - -: lda (copy_src),y - sta (copy_dest),y - iny - cpy end - bne :- - -@done: - rts - -.code - - -init: - - jsr cls - - ldax #startup_msg - jsr print - jsr print_cr - - jmp exit_to_basic - - .rodata -startup_msg: .byte "NETBOOT65 FOR APPLE 2 V0.1",13 -.byte "SEE README.TXT FOR MORE INFO (INCLUDING",13 -.byte "HOW TO RUN SOMETHING MORE INTERESTING)",13 -.byte 0 - - - -;-- LICENSE FOR bootmenu.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 netboot65. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/client/carts/c64_cart_ram_header.s b/client/carts/c64_cart_ram_header.s deleted file mode 100644 index a598645..0000000 --- a/client/carts/c64_cart_ram_header.s +++ /dev/null @@ -1,117 +0,0 @@ -.segment "IP65ZP" : zeropage - -; pointers for copying -copy_src: .res 2 ; source pointer -copy_dest: .res 2 ; destination pointer -end: .res 1 - -.segment "STARTUP" ;this is what gets put at the start of the file on the C64 - - .word basicstub ; load address -.include "../inc/common.i" - -basicstub: - .word @nextline - .word 2003 - .byte $9e - .byte <(((init / 1000) .mod 10) + $30) - .byte <(((init / 100 ) .mod 10) + $30) - .byte <(((init / 10 ) .mod 10) + $30) - .byte <(((init ) .mod 10) + $30) - .byte 0 -@nextline: - .word 0 - -init: - - ;clear screen - lda #147 ; 'CLR/HOME' - jsr $ffd2 - ;turn off BASIC - lda $01 - and #$FE ;mask out bit 0 - sta $01 - - ;now relocate the cart - - ldax #cart_data - stax copy_src - ldax #$8000 - stax copy_dest - ldax #$4000 - jsr copymem - - - ;if this is a KIPPERKART, then set default drive to - ;be whatever we just booted from - - lda $8009 - cmp #'K' - bne @drive_done - lda $8009 - cmp #'K' - bne @drive_done - lda $8036 ;location in cart config of default drive - cmp #08 - bne @drive_done - lda $ba - sta $8036 -@drive_done: - jmp ($8002) ;warm start vector - -;copy memory -;inputs: -; copy_src is address of buffer to copy from -; copy_dest is address of buffer to copy to -; AX = number of bytes to copy -;outputs: none -copymem: - sta end - ldy #0 - - cpx #0 - beq @tail - -: lda (copy_src),y - sta (copy_dest),y - iny - bne :- - inc copy_src+1 ;next page - inc copy_dest+1 ;next page - dex - bne :- - -@tail: - lda end - beq @done - -: lda (copy_src),y - sta (copy_dest),y - iny - cpy end - bne :- - -@done: - rts - -;this is where the cart data will be appended to: - cart_data: - -;-- LICENSE FOR c64_cart_ram_header.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 netboot65. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/client/carts/cartheader.s b/client/carts/cartheader.s deleted file mode 100644 index f49c65c..0000000 --- a/client/carts/cartheader.s +++ /dev/null @@ -1,54 +0,0 @@ - -.include "../inc/common.i" - -.import copymem -.importzp copy_src -.importzp copy_dest - -.segment "STARTUP" ;this is what gets put at the start of the file on the C64 - -.word basicstub ; load address - -basicstub: - .word @nextline - .word 2003 - .byte $9e - .byte <(((init / 1000) .mod 10) + $30) - .byte <(((init / 100 ) .mod 10) + $30) - .byte <(((init / 10 ) .mod 10) + $30) - .byte <(((init ) .mod 10) + $30) - .byte 0 -@nextline: - .word 0 - -init: - -;copy BASIC to RAM - ldax #$A000 - stax copy_src - stax copy_dest - ldax #$2000 - jsr copymem - -;copy cart data from end of file to $8000 (RAM) - ldax #cart_data - stax copy_src - ldax #$8000 - stax copy_dest - ldax #$2000 - jsr copymem - -;swap out the cartridge (also swaps out BASIC) - - lda $01 - and #$fe ;reset bit 0 - sta $01 - -;execute the cartridge from RAM - jmp ($8002) - - -.bss - -cart_data: ;this should point to where the cart data gets appended. - .res $2000 \ No newline at end of file diff --git a/client/carts/crt8040.obj b/client/carts/crt8040.obj deleted file mode 100644 index b5ab5c15fb4a1333c78f131e17485bb29ccd71fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeIuAqoOP7>40r*fL>ts~~7F2o}YlH_%}41fIY{%mwxU8w8p5hdqG7;+ADWm;>ly zHcZ_jqCvcY?fv5Wwa3`)t2kd46J4gQ+HFofyBAX>&037>A4JEg)Q{3Xk8;l>Dt)7~ zUx_lYpAtGI3{4pLD)Bn~zIlAj<6FDyb-vQV$!I557y<|&fB*srAbcname - jsr SETNAM - lda #02 - ldx #08 - ldy #02 - jsr SETLFS - jsr OPEN - bcs @error - ldx #command_buffer - lda #12 - jsr SETNAM - lda #15 - ldx $BA ;use whatever was last device # - ldy #15 - jsr SETLFS - jsr OPEN - bcs @error - - - jsr check_error_channel - lda #$30 - cmp error_buffer - beq @was_not_an_error - print #error_buffer - - @was_not_an_error: - ldx #$02 ; filenumber 2 - jsr CHKIN ;(file 2 now used as input) - - lda sector_buffer_address - sta temp_ptr - lda sector_buffer_address+1 - sta temp_ptr+1 - ldy #$00 -@loop: - jsr CHRIN ;(get a byte from file) - sta (temp_ptr),Y ; write byte to memory - iny - bne @loop ; next byte, end when 256 bytes are read -@close: - lda #15 ; filenumber 15 - jsr CLOSE - lda #$02 ; filenumber 2 - jsr CLOSE - ldx #$00 ; filenumber 0 = keyboard - jsr CHKIN ;(keyboard now input device again) - rts -@error: - pha - print #error_opening_channel - pla - call #NB65_PRINT_HEX - jmp @close - -check_error_channel: - LDX #$0F ; filenumber 15 - JSR CHKIN ;(file 15 now used as input) - LDY #$00 -@loop: - JSR READST ;(read status byte) - BNE @eof ; either EOF or read error - JSR CHRIN ;(get a byte from file) - sta error_buffer,y - iny - JMP @loop ; next byte - -@eof: - lda #0 - sta error_buffer,y - LDX #$00 ; filenumber 0 = keyboard - JSR CHKIN ;(keyboard now input device again) - RTS - -bad_boot: - print #press_a_key_to_continue -restart: - jsr get_key - jmp $fce2 ;do a cold start - - -print_a_as_errorcode: - pha - lda #' ' - jsr print_a - print #error_code - pla - call #NB65_PRINT_HEX - rts - -print_nb65_errorcode: - print #error_code - call #NB65_GET_LAST_ERROR - call #NB65_PRINT_HEX - print_cr - rts - -nb65_signature_not_found: - - ldy #0 -: - lda nb65_signature_not_found_message,y - beq restart - jsr print_a - iny - jmp :- - - - -make_read_sector_command: -;fill command buffer with command to read in track & sector -;returns length of command in Y - - ldy #0 - lda #85 ;"U" - sta command_buffer,y - iny - lda #$31 ;"1" - sta command_buffer,y - iny - lda #$20 ;" " - sta command_buffer,y - iny - lda #$32 ;"2" - file number - sta command_buffer,y - iny - lda #$20 ;" " - sta command_buffer,y - iny - lda #$30 ;"0" - drive number - sta command_buffer,y - iny - lda #$20 ;" " - sta command_buffer,y - iny - lda track - jsr byte_to_ascii - pha - txa - sta command_buffer,y - pla - iny - sta command_buffer,y - iny - lda #$20 ;" " - sta command_buffer,y - iny - lda sector - jsr byte_to_ascii - pha - txa - sta command_buffer,y - pla - iny - sta command_buffer,y - iny - - lda #0 - sta command_buffer,y ;make it ASCIIZ so we can print it - - rts - -byte_to_ascii: - cmp #30 - bmi @not_30 - ldx #$33 - clc - adc #18 - rts -@not_30: - cmp #20 - bmi @not_20 - ldx #$32 - clc - adc #28 - rts -@not_20: - cmp #10 - bmi @not_10 - ldx #$31 - clc - adc #38 - rts -@not_10: - ldx #$30 - clc - adc #48 - rts - - -reset_counters_to_first_sector: - ldx #1 - stx track - dex - stx sector - ldx #21 - stx sectors_in_track - rts - -move_to_next_sector: - inc sector - lda sector - cmp sectors_in_track - beq @move_to_next_track - rts -@move_to_next_track: - lda #0 - sta sector - inc track - lda track - cmp #18 - bne @not_track_18 - lda #19 - sta sectors_in_track - clc - rts -@not_track_18: - cmp #25 - bne @not_track_25 - lda #18 - sta sectors_in_track - clc - rts -@not_track_25: - cmp #31 - bne @not_track_31 - lda #17 - sta sectors_in_track - clc - rts -@not_track_31: - lda track - cmp #36 ;carry will be set if hit track 36 - rts - - -.rodata - -error_code: - .byte "ERROR CODE: $",0 -press_a_key_to_continue: - .byte "PRESS A KEY TO CONTINUE",13,0 - -failed: - .byte "FAILED ", 0 - -ok: - .byte "OK ", 0 - -initializing: - .byte "INITIALIZING ",0 -track_no: - .byte "TRACK ",0 - - -sector_no: - .byte " SECTOR ",0 - -signon_message: - .byte "D64 UPLOADER V0.1",13,0 - -enter_filename: -.byte "SEND AS: ",0 - -drive_error: - .byte "DRIVE ACCESS ERROR - ",0 - nb65_signature_not_found_message: - .byte "NO NB65 API FOUND",13,"PRESS ANY KEY TO RESET", 0 - error_opening_channel: - .byte "ERROR OPENING CHANNEL $",0 - -disk_access: -.byte 13,13,13,13,13,"SENDING TO CHANNEL $",0 - -nb65_signature: - .byte $4E,$42,$36,$35 ; "NB65" - API signature - .byte ' ',0 ; so we can use this as a string -position_cursor_for_track_display: -; .byte $13,13,13,13,13,13,13,13,13,13,13," SENDING ",0 -.byte $13,13,13,"SENDING ",0 -position_cursor_for_error_display: - .byte $13,13,13,13,"LAST ",0 - -cname: .byte '#' -;-- LICENSE FOR d64_upload.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 netboot65. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/client/carts/dupe_cart.rb b/client/carts/dupe_cart.rb deleted file mode 100644 index a686ece..0000000 --- a/client/carts/dupe_cart.rb +++ /dev/null @@ -1,33 +0,0 @@ -infilename=ARGV[0] -outfilename=ARGV[1] -duplication=ARGV[2].to_i - -if duplication.nil? then - puts "usage: dupe_cart.rb [input filename] [output filename] [number of duplications]" - exit -end - - -infile=File.open(infilename,"rb").read -puts "copying #{infilename} to #{outfilename} #{duplication} times" -outfile=File.open(outfilename,"wb") -duplication.times {outfile<temp_filename_start - - -open_file: - ;A,X,Y set up ready for a call to SETNAM for file #2 - jsr $FFBD ; call SETNAM - lda #$02 ; file number 2 -.import cfg_default_drive - ldx cfg_default_drive - - ldy #$02 ; secondary address 2 - jsr $FFBA ; call SETLFS - - jsr $FFC0 ; call OPEN - bcs @error ; if carry set, the file could not be opened - rts -@error: - sta ip65_error - jsr close_file - sec - rts - -write_byte: - pha - ldx #$02 ; filenumber 2 = output file - jsr $FFC9 ; call CHKOUT - pla - jsr $ffd2 ;write byte - JSR $FFB7 ; call READST (read status byte) - bne @error - ldx #$00 ; filenumber 0 = console - jsr $FFC9 ; call CHKOUT - rts -@error: - lda #KPR_ERROR_FILE_ACCESS_FAILURE - sta ip65_error - jsr close_file - sec - rts - - -close_file: - - lda #$02 ; filenumber 2 - jsr $FFC3 ; call CLOSE - rts - - -rename_file: -;AX points at new filename - stax copy_src - ldx #0 - ldy #0 - ;first the "RENAME0:" - -: - lda rename_cmd,y - sta command_buffer,x - inx - iny - cmp #':' - bne :- - - ;now the new filename - ldy #0 -: - lda (copy_src),y - beq @end_of_new_filename - sta command_buffer,x - inx - iny - bne :- -@end_of_new_filename: - - ;now the "=" - lda #'=' - sta command_buffer,x - inx - - ;now the old filename - ldy #0 -: - lda temp_filename,y - cmp #',' - beq @end_of_old_filename - sta command_buffer,x - inx - iny - bne :- -@end_of_old_filename: - txa ;filename length - ldx #command_buffer - - jsr $FFBD ; call SETNAM - lda #$0F ; filenumber 15 - ldx cfg_default_drive - ldy #$0F ; secondary address 15 - jsr $FFBA ; call SETLFS - jsr $FFC0 ; call OPEN - lda #$0F ; filenumber 15 - jsr $FFC3 ; call CLOSE - rts - -rename_cmd: - .byte "RENAME0:" - -exit_telnet: -exit_gopher: - jsr setup_screen - jmp main_menu -.rodata - -menu_header_msg: -.byte $13,10,"KipperTerm V" -.include "../inc/version.i" -.byte 10,0 -main_menu_msg: -.byte 10,"Main Menu",10,10 -.byte "F1: Telnet ",10 -.byte "F7: Config F8: Credits",10,10 - -.byte 0 - - -telnet_menu_msg: -.byte 10,10,10 -.byte "F1: D/L File (XMODEM)",10 -.byte "F3: U/L File (XMODEM)",10 -.byte "F5: Send ASCII char",10 -.byte "F7: Return",10,10 -.byte 0 - -telnet_header: .byte "telnet",10,0 - -opening_file: -.byte 10,"opening file",10,0 -transfer_complete: -.byte "transfer complete.",10,0 -prompt_for_filename: .byte "save file as?",10,0 -current: -.byte "current ",0 - -enter_ascii: -.byte 10,"ASCII value (0..255)? ",0 - -byte_sent: -.byte 10,"byte sent.",0 - -new: -.byte"new ",0 - -resolving: - .byte "resolving ",0 - -no_files: - .byte "no files",10,0 - -dir_listing_fail_msg: - .byte "directory listing failed",10,0 - -temp_filename_start: .byte "@" -temp_filename: -.byte "0:XMODEM.TMP,P,W" ; @0: means 'overwrite if existing', ',P,W' is required to make this an output file -temp_filename_end: -.byte 0 - -credits: -.byte 10,"License: Mozilla Public License v1.1",10 -.byte 10 -.byte 10,"Contributors:",10 -.byte 10,"Jonno Downes" -.byte 10,"Glenn Holmer" -.byte 10,"Per Olofsson" -.byte 10,"Lars Stollenwerk" -.byte 10,10 -.byte 0 - -.segment "APP_SCRATCH" - -temp_font: .res 1 -temp_border: .res 1 -temp_text_back: .res 1 -temp_text_fore: .res 1 -temp_page_zero_vars: .res $28 -temp_screen_chars: .res $400 -temp_colour_ram: .res $400 -command_buffer: .res $80 -eof: .res 1 -ascii_packet: .res 1 - -;-- LICENSE FOR kipperterm.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 KipperTerm. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/client/carts/nb65_skeleton.s b/client/carts/nb65_skeleton.s deleted file mode 100644 index 84ba806..0000000 --- a/client/carts/nb65_skeleton.s +++ /dev/null @@ -1,173 +0,0 @@ -;use the NB65 API to send a d64 disk via TFTP - -.ifndef NB65_API_VERSION_NUMBER - .define EQU = - .include "../inc/nb65_constants.i" -.endif - -.include "../ip65/copymem.s" -.include "../inc/common.i" - -.import print_a -.import get_key -.macro cout arg - lda arg - jsr print_a -.endmacro - - .zeropage - temp_ptr: .res 2 - - .bss - nb65_param_buffer: .res $20 - block_number: .res $0 - -.segment "STARTUP" ;this is what gets put at the start of the file on the C64 - -.word basicstub ; load address - -.macro print arg - ldax arg - ldy #NB65_PRINT_ASCIIZ - jsr NB65_DISPATCH_VECTOR -.endmacro - -.macro print_cr - lda #13 - jsr print_a -.endmacro - -.macro call arg - ldy arg - jsr NB65_DISPATCH_VECTOR -.endmacro - -basicstub: - .word @nextline - .word 2003 - .byte $9e - .byte <(((init / 1000) .mod 10) + $30) - .byte <(((init / 100 ) .mod 10) + $30) - .byte <(((init / 10 ) .mod 10) + $30) - .byte <(((init ) .mod 10) + $30) - .byte 0 -@nextline: - .word 0 - - -;look for NB65 signature at location pointed at by AX -look_for_signature: - stax temp_ptr - ldy #3 -@check_one_byte: - lda (temp_ptr),y - cmp nb65_signature,y - bne @bad_match - dey - bpl@check_one_byte - clc - rts -@bad_match: - sec - rts -init: - - print #signon_message - - ldax #NB65_CART_SIGNATURE ;where signature should be in cartridge - jsr look_for_signature - bcc @found_nb65_signature - - ldax #NB65_RAM_STUB_SIGNATURE ;where signature should be in RAM - jsr look_for_signature - bcc :+ - jmp nb65_signature_not_found -: - jsr NB65_RAM_STUB_ACTIVATE ;we need to turn on NB65 cartridge - -@found_nb65_signature: - - print #initializing - print #nb65_signature - ldy #NB65_INITIALIZE - jsr NB65_DISPATCH_VECTOR - bcc :+ - print #failed - jsr print_errorcode - jmp bad_boot -: - print #ok - print_cr - -; ######################## -; main program goes here: -; - rts - -bad_boot: - print #press_a_key_to_continue -restart: - jsr get_key - jmp $fce2 ;do a cold start - - -print_errorcode: - print #error_code - call #NB65_GET_LAST_ERROR - call #NB65_PRINT_HEX - print_cr - rts - -nb65_signature_not_found: - - ldy #0 -: - lda nb65_signature_not_found_message,y - beq restart - jsr print_a - iny - jmp :- - -.rodata - -error_code: - .asciiz "ERROR CODE: $" -press_a_key_to_continue: - .byte "PRESS A KEY TO CONTINUE",13,0 - -failed: - .byte "FAILED ", 0 - -ok: - .byte "OK ", 0 - -initializing: - .byte "INITIALIZING ",0 - -signon_message: - .byte "NB65 UNNAMED TOOL V0.1",13,0 - - nb65_signature_not_found_message: - .byte "NO NB65 API FOUND",13,"PRESS ANY KEY TO RESET", 0 - -nb65_signature: - .byte $4E,$42,$36,$35 ; "NB65" - API signature - .byte ' ',0 ; so we can use this as a string -;-- LICENSE FOR nb65_skeleton.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 netboot65. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/client/carts/netboot.s b/client/carts/netboot.s deleted file mode 100644 index 9e88135..0000000 --- a/client/carts/netboot.s +++ /dev/null @@ -1,392 +0,0 @@ -; ############# -; -; This will boot a C64 with an RR-NET compatible cs8900a from the network -; requires -; 1) a DHCP server, and -; 2) a TFTP server that responds to requests on the broadcast address (255.255.255.255) and that will serve a file called 'BOOTC64.PRG'. -; -; jonno@jamtronix.com - January 2009 -; - - - .include "../inc/common.i" - .include "../inc/commonprint.i" - .include "../inc/c64keycodes.i" - .include "../inc/menu.i" - - .import ip65_init - .import dhcp_init - .import tftp_ip - .importzp tftp_filename - .import tftp_load_address - .import tftp_download - - .import cls - .import beep - .import exit_to_basic - .import timer_vbl_handler - .import get_key_ip65 - .import cfg_ip - .import cfg_netmask - .import cfg_gateway - .import cfg_dns - .import cfg_tftp_server - .import cfg_get_configuration_ptr - - - .import copymem - .importzp copy_src - .importzp copy_dest - .import get_filtered_input - .import __DATA_LOAD__ - .import __DATA_RUN__ - .import __DATA_SIZE__ - .import __SELF_MODIFIED_CODE_LOAD__ - .import __SELF_MODIFIED_CODE_RUN__ - .import __SELF_MODIFIED_CODE_SIZE__ - - - directory_buffer = $6020 - .bss -tmp_load_address: .res 2 - - .data -exit_cart: - - lda #$02 - sta $de00 ;turns off RR cartridge by modifying GROUND and EXROM -call_downloaded_prg: - jsr $0000 ;overwritten when we load a file - jmp init - -get_value_of_axy: ;some more self-modifying code - lda $ffff,y - rts - - -.segment "CARTRIDGE_HEADER" -.word init ;cold start vector -.word $FE47 ;warm start vector -.byte $C3,$C2,$CD,$38,$30 ; "CBM80" -.byte $0,$0,$0 ;reserved for future use -.byte $0,$0,$0 ;reserved for future use -.byte $0,$0,$0 ;reserved for future use -.byte $0,$0,$0 ;reserved for future use -.byte $0,$0,$0 ;reserved for future use - -.code - - - -init: - - - ;first let the kernal do a normal startup - sei - jsr $fda3 ;initialize CIA I/O - jsr $fd50 ;RAM test, set pointers - jsr $fd15 ;set vectors for KERNAL - jsr $ff5B ;init. VIC - cli ;KERNAL init. finished - - -;we need to set up BASIC as well - jsr $e453 ;set BASIC vectors - jsr $e3bf ;initialize zero page - - - ;set some funky colours - LDA #$05 ;green - STA $D020 ;border - LDA #$00 ;black - STA $D021 ;background - - lda #$05 ;petscii for white text - - - jsr print_a - - -;relocate our r/w data - ldax #__DATA_LOAD__ - stax copy_src - ldax #__DATA_RUN__ - stax copy_dest - ldax #__DATA_SIZE__ - jsr copymem - ldax #__SELF_MODIFIED_CODE_LOAD__ - stax copy_src - ldax #__SELF_MODIFIED_CODE_RUN__ - stax copy_dest - ldax #__SELF_MODIFIED_CODE_SIZE__ - jsr copymem - - - ldax #netboot_msg - jsr print_ascii_as_native - - print_driver_init - - - jsr ip65_init - - - - bcs @init_failed - jsr dhcp_init - bcc init_ok - jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to cartridge default values) - bcc init_ok -@init_failed: - - print_failed - jsr print_errorcode - jsr wait_for_keypress - jmp exit_to_basic - - -init_ok: - - - - ldx #$03 -: - lda cfg_tftp_server,x - sta tftp_ip,x - dex - bpl :- - - jsr print_cr - jsr print_ip_config -tftp_boot: - - ldax #tftp_dir_filemask - jsr get_tftp_directory_listing - bcs return_to_main - -@boot_filename_set: - ;AX now points to filename - jsr download - bcc file_downloaded_ok -tftp_boot_failed: - jsr wait_for_keypress -return_to_main: - jmp tftp_boot - -file_downloaded_ok: -ldax tftp_load_address - -boot_into_file: - stax tmp_load_address ;use the param buffer as a temp holding place for the load address - ;get ready to bank out - - jsr $ffe7 ; make sure all files have been closed. - - ;check whether the file we just downloaded was a BASIC prg - lda tmp_load_address - cmp #01 - bne @not_a_basic_file - - lda tmp_load_address+1 - cmp #$08 - bne @not_a_basic_file - - - jsr $e453 ;set BASIC vectors - jsr $e3bf ;initialize BASIC - jsr $a86e - jsr $a533 ; re-bind BASIC lines - ldx $22 ;load end-of-BASIC pointer (lo byte) - ldy $23 ;load end-of-BASIC pointer (hi byte) - stx $2d ;save end-of-BASIC pointer (lo byte) - sty $2e ;save end-of-BASIC pointer (hi byte) - jsr $a659 ; CLR (reset variables) - ldax #$a7ae ; jump to BASIC interpreter loop - jmp exit_cart_via_ax - -@not_a_basic_file: - ldax tmp_load_address -exit_cart_via_ax: - sta call_downloaded_prg+1 - stx call_downloaded_prg+2 - jmp exit_cart - -get_tftp_directory_listing: - stax tftp_filename - - ldax #directory_buffer - stax tftp_load_address - - ldax #getting_dir_listing_msg - jsr print_ascii_as_native - - jsr tftp_download - - bcs @dir_failed - - lda directory_buffer ;get the first byte that was downloaded - bne :+ - jmp @no_files_on_server -: - - ;switch to lower case charset - lda #23 - sta $d018 - -@loop_till_filename_entered: - ldax #directory_buffer - ldy #1 ;filenames will be ASCII - jsr select_option_from_menu - bcs @loop_till_filename_entered -@tftp_filename_set: - stax copy_dest - stax get_value_of_axy+1 - ldy #0 - jsr get_value_of_axy ;A now == first char in string we just downloaded - cmp #'$' - bne @not_directory_name - ;it's a directory name, so we need to append the file mask to end of it - ;this will fail if the file path is more than 255 characters long -@look_for_trailing_zero: - iny - inc copy_dest - bne :+ - inc copy_dest+1 -: - jsr get_value_of_axy ;A now == next char in string we just downloaded - bne @look_for_trailing_zero - -; got trailing zero - ldax #tftp_dir_filemask+1 ;skip the leading '$' - stax copy_src - ldax #$07 - jsr copymem - ldax get_value_of_axy+1 - jmp get_tftp_directory_listing - -@not_directory_name: - ldax get_value_of_axy+1 - clc - rts - - -@dir_failed: - ldax #dir_listing_fail_msg - jsr print_ascii_as_native - jsr print_errorcode - jsr print_cr - - ldax #tftp_file - jmp @tftp_filename_set - -@no_files_on_server: - ldax #no_files - jsr print_ascii_as_native - - jmp tftp_boot_failed - - - -bad_boot: - jsr wait_for_keypress - jmp $fe66 ;do a wam start - -download: ;AX should point at filename to download - stax tftp_filename - - ldax #$0000 ;load address will be first 2 bytes of file we download (LO/HI order) - stax tftp_load_address - - ldax #downloading_msg - jsr print_ascii_as_native - ldax tftp_filename - jsr print_ascii_as_native - jsr print_cr - - jsr tftp_download - - bcc :+ - - ldax #tftp_download_fail_msg - jsr print_ascii_as_native - jsr print_errorcode - sec - rts - -: - ldax #tftp_download_ok_msg - jsr print_ascii_as_native - clc - rts - -wait_for_keypress: - ldax #press_a_key_to_continue - jsr print_ascii_as_native -@loop: - jsr $ffe4 - beq @loop - rts - -get_key: -@loop: - jsr $ffe4 - beq @loop - rts - - -.rodata - -netboot_msg: -.byte 14,10,"NETBOOT - V" -.include "../inc/version.i" -.byte 10,0 -downloading_msg: .byte "down" -loading_msg: .asciiz "loading " - -getting_dir_listing_msg: .byte "fetching directory",10,0 - -dir_listing_fail_msg: - .byte "dir failed",10,0 - -tftp_download_fail_msg: - .byte "download failed", 10, 0 - -tftp_download_ok_msg: - .byte "down" -load_ok_msg: - .byte "load OK", 10, 0 - - - -tftp_dir_filemask: - .asciiz "$/*.prg" - -tftp_file: - .asciiz "BOOTC64.PRG" - -no_files: - .byte "No files",10,0 - - -;we need a 'dummy' segment here - some drivers use this segment (e.g. wiznet), some don't (e.g. rr-net) -;if we don't declare this, we get an 'undefined segment' error when linking to a driver that doesn't use it. -.segment "SELF_MODIFIED_CODE" - -;-- LICENSE FOR netboot.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 netboot65. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/client/carts/set_ip_config.rb b/client/carts/set_ip_config.rb deleted file mode 100644 index 6ba2649..0000000 --- a/client/carts/set_ip_config.rb +++ /dev/null @@ -1,128 +0,0 @@ -#cartridge offsets: -# $18=MAC address (6 bytes) -# $1E=IP address (4 bytes) -# $22=netmask (4 bytes) -# $26=gateway (4 bytes) -# $2A=DNS (4 bytes) -# $2E= DHCP server (4 bytes) (not changeable) -# $32=TFTP server (4 bytes) -# $36=drive (1 byte) - -@cartridge_offsets={ -#symobol => offset, length - :mac=>[0x18,6], - :ip=>[0x1e,4], - :netmask=>[0x22,4], - :gateway=>[0x26,4], - :dns=>[0x2a,4], - :tftp=>[0x32,4], - :drive=>[0x36,1] - } - - @progname=File.basename($0) - def show_options - puts "valid options are: #{@cartridge_offsets.keys.join(", ")}" - puts "mac auto will automagically generate a pseudorandom MAC" -end - def usage - puts "#{@progname}