diff --git a/client/basic/bails.d64 b/client/basic/bails.d64 index 1e98dda..64ab10a 100644 Binary files a/client/basic/bails.d64 and b/client/basic/bails.d64 differ diff --git a/client/basic/kipperbas.d64 b/client/basic/kipperbas.d64 index d84ae75..f7943c8 100644 Binary files a/client/basic/kipperbas.d64 and b/client/basic/kipperbas.d64 differ diff --git a/client/carts/Makefile b/client/carts/Makefile index 7b8b7c9..0c89a95 100644 --- a/client/carts/Makefile +++ b/client/carts/Makefile @@ -33,6 +33,7 @@ all: ip65 drivers\ kippergo.prg \ kippergo_rr.bin \ kipperdisk.d64 \ + netbootwiz.bin \ kipperkart.o: kipperkart.s $(INCFILES) ../inc/ping.i ../inc/disk_transfer.i ../inc/sidplay.i ../inc/config_menu.i $(AS) $(AFLAGS) -o $@ $< @@ -114,6 +115,10 @@ kkwiz.bin: kipperkart.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64_ ruby fix_cart.rb $@ 16384 # ruby set_ip_config.rb $@ mac auto +netbootwiz.bin: netboot.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg + $(LD) -m netboot.map -vm -C ../cfg/c64_8kcart.cfg -o $@ $< $(IP65WIZNETLIB) $(C64WIZNETLIB) + ruby fix_cart.rb $@ 8192 + d64_upload.d64: d64_upload.prg diff --git a/client/carts/kippergo.s b/client/carts/kippergo.s index cf20eaa..3934fba 100644 --- a/client/carts/kippergo.s +++ b/client/carts/kippergo.s @@ -115,9 +115,9 @@ warm_init: ldax #menu_header_msg jsr print_ascii_as_native - ldax #init_msg+1 - jsr print_ascii_as_native - +; ldax #init_msg+1 +; jsr print_ascii_as_native + print_driver_init jsr ip65_init bcs init_failed jsr dhcp_init diff --git a/client/carts/kipperkart.s b/client/carts/kipperkart.s index 0eae121..1689e59 100644 --- a/client/carts/kipperkart.s +++ b/client/carts/kipperkart.s @@ -166,7 +166,7 @@ warm_init: ldax #menu_header_msg jsr print_ascii_as_native ldax #init_msg+1 - jsr print_ascii_as_native + jsr print_ascii_as_native kippercall #KPR_INITIALIZE bcc init_ok diff --git a/client/carts/kipperterm.s b/client/carts/kipperterm.s index 787a927..bb05ded 100644 --- a/client/carts/kipperterm.s +++ b/client/carts/kipperterm.s @@ -130,7 +130,7 @@ warm_init: ldax #menu_header_msg jsr print_ascii_as_native ldax #init_msg+1 - jsr print_ascii_as_native + jsr print_ascii_as_native jsr ip65_init bcs init_failed diff --git a/client/carts/netboot.s b/client/carts/netboot.s index 7227012..9e88135 100644 --- a/client/carts/netboot.s +++ b/client/carts/netboot.s @@ -68,12 +68,19 @@ get_value_of_axy: ;some more self-modifying code .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 @@ -107,22 +114,31 @@ init: 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 - ldax #init_msg+1 - jsr print + 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 @@ -130,6 +146,9 @@ init: init_ok: + + + ldx #$03 : lda cfg_tftp_server,x @@ -199,7 +218,7 @@ get_tftp_directory_listing: stax tftp_load_address ldax #getting_dir_listing_msg - jsr print + jsr print_ascii_as_native jsr tftp_download @@ -253,7 +272,7 @@ get_tftp_directory_listing: @dir_failed: ldax #dir_listing_fail_msg - jsr print + jsr print_ascii_as_native jsr print_errorcode jsr print_cr @@ -262,7 +281,7 @@ get_tftp_directory_listing: @no_files_on_server: ldax #no_files - jsr print + jsr print_ascii_as_native jmp tftp_boot_failed @@ -279,9 +298,9 @@ download: ;AX should point at filename to download stax tftp_load_address ldax #downloading_msg - jsr print + jsr print_ascii_as_native ldax tftp_filename - jsr print + jsr print_ascii_as_native jsr print_cr jsr tftp_download @@ -289,20 +308,20 @@ download: ;AX should point at filename to download bcc :+ ldax #tftp_download_fail_msg - jsr print + jsr print_ascii_as_native jsr print_errorcode sec rts : ldax #tftp_download_ok_msg - jsr print + jsr print_ascii_as_native clc rts wait_for_keypress: ldax #press_a_key_to_continue - jsr print + jsr print_ascii_as_native @loop: jsr $ffe4 beq @loop @@ -318,30 +337,26 @@ get_key: .rodata netboot_msg: -.byte 13,"NETBOOT - V" +.byte 14,10,"NETBOOT - V" .include "../inc/version.i" -.byte 13,0 -downloading_msg: .byte "DOWN" -loading_msg: .asciiz "LOADING " +.byte 10,0 +downloading_msg: .byte "down" +loading_msg: .asciiz "loading " -getting_dir_listing_msg: .byte "FETCHING DIRECTORY",13,0 +getting_dir_listing_msg: .byte "fetching directory",10,0 dir_listing_fail_msg: - .byte "DIR FAILED",13,0 + .byte "dir failed",10,0 tftp_download_fail_msg: - .byte "DOWNLOAD FAILED", 13, 0 + .byte "download failed", 10, 0 tftp_download_ok_msg: - .byte "DOWN" + .byte "down" load_ok_msg: - .byte "LOAD OK", 13, 0 + .byte "load OK", 10, 0 -current: -.byte "CURRENT ",0 -new: -.byte"NEW ",0 tftp_dir_filemask: .asciiz "$/*.prg" @@ -350,7 +365,12 @@ tftp_file: .asciiz "BOOTC64.PRG" no_files: - .byte "NO FILES",13,0 + .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 diff --git a/client/drivers/lan91c96.s b/client/drivers/lan91c96.s index 089e453..37e9422 100644 --- a/client/drivers/lan91c96.s +++ b/client/drivers/lan91c96.s @@ -16,7 +16,7 @@ .export eth_rx .export eth_tx .export eth_driver_name - + .export eth_driver_io_base .import eth_inp .import eth_inp_len .import eth_outp @@ -443,7 +443,9 @@ lan_self_modify: .rodata eth_driver_name: .asciiz "LANceGS (91C96)" - +eth_driver_io_base=fixlan01+1 + + ; 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 diff --git a/client/drivers/rr-net.s b/client/drivers/rr-net.s index 8e21a99..4059c81 100644 --- a/client/drivers/rr-net.s +++ b/client/drivers/rr-net.s @@ -9,13 +9,16 @@ .export cs_tx_cmd .export cs_tx_len .export eth_driver_name - -rr_ctl = $de01 ;address of 'control' port on Retro-Replay -cs_packet_page = $de02 ;address of 'packet page' port on RR-Net -cs_packet_data = $de04;address of 'packet data' port on RR-Net -cs_rxtx_data = $de08 ;address of 'recieve/transmit data' port on RR-Net -cs_tx_cmd = $de0c;address of 'transmit command' port on RR-Net -cs_tx_len = $de0e;address of 'transmission length' port on RR-Net + .export eth_driver_io_base + +IO_BASE=$de00 +;IO_BASE=$df00 +rr_ctl = IO_BASE+1 ;address of 'control' port on Retro-Replay +cs_packet_page = IO_BASE+2 ;address of 'packet page' port on RR-Net +cs_packet_data = IO_BASE+4;address of 'packet data' port on RR-Net +cs_rxtx_data = IO_BASE+8 ;address of 'recieve/transmit data' port on RR-Net +cs_tx_cmd = IO_BASE+$0c;address of 'transmit command' port on RR-Net +cs_tx_len = IO_BASE+$0e;address of 'transmission length' port on RR-Net .code @@ -31,8 +34,13 @@ cs_init: .rodata eth_driver_name: - .asciiz "RR-NET" - +.if IO_BASE=$de00 +.byte "RR-NET",0 +.else +.byte "64NIC+",0 +.endif +eth_driver_io_base: +.word IO_BASE ;-- LICENSE FOR rr-net.s -- diff --git a/client/drivers/uthernet.s b/client/drivers/uthernet.s index 8bd9b6b..9e9cbd3 100644 --- a/client/drivers/uthernet.s +++ b/client/drivers/uthernet.s @@ -9,8 +9,9 @@ .export cs_rxtx_data .export cs_tx_cmd .export cs_tx_len - .export eth_driver_name - + .export eth_driver_name + .export eth_driver_io_base + cs_rxtx_data = $c0b0 ;address of 'recieve/transmit data' port on Uthernet cs_tx_cmd = $c0b4;address of 'transmit command' port on Uthernet cs_tx_len = $c0b6;address of 'transmission length' port on Uthernet @@ -27,6 +28,8 @@ cs_init: .rodata eth_driver_name: .byte "UTHERNET",0 +eth_driver_io_base: + .word cs_rxtx_data ;-- LICENSE FOR uthernet.s -- diff --git a/client/drivers/vic20-rr-net.s b/client/drivers/vic20-rr-net.s index 925ea13..e851e49 100644 --- a/client/drivers/vic20-rr-net.s +++ b/client/drivers/vic20-rr-net.s @@ -8,8 +8,8 @@ .export cs_rxtx_data .export cs_tx_cmd .export cs_tx_len - .export eth_driver_name - + .export eth_driver_name + .export eth_driver_io_base rr_ctl = $9801 ;address of 'control' port on Retro-Replay cs_packet_page = $9802 ;address of 'packet page' port on RR-Net @@ -33,7 +33,8 @@ cs_init: .rodata eth_driver_name: .asciiz "VIC20 RR-NET" - +eth_driver_io_base: + .word rr_ctl-1 ;-- LICENSE FOR vic20-rr-net.s -- diff --git a/client/drivers/w5100.s b/client/drivers/w5100.s index a86f66f..8194f2e 100644 --- a/client/drivers/w5100.s +++ b/client/drivers/w5100.s @@ -10,14 +10,16 @@ .include "w5100.i" -DEFAULT_W5100_BASE = $DF20 +;DEFAULT_W5100_BASE = $DF20 + +DEFAULT_W5100_BASE = $DE04 ;DEBUG = 1 .export eth_init .export eth_rx .export eth_tx .export eth_driver_name - + .export eth_driver_io_base .import eth_inp .import eth_inp_len .import eth_outp @@ -77,6 +79,8 @@ DEFAULT_W5100_BASE = $DF20 ;w5100 aware apps can use w5100_init and pass in a different ;base address eth_init: + + ldax #DEFAULT_W5100_BASE ;initialize the w5100 ethernet adaptor @@ -950,6 +954,9 @@ read_reg_and_inc: .rodata eth_driver_name: .asciiz "WIZNET 5100" + +eth_driver_io_base=read_mode_reg+1 + w5100_config_data: .byte $00 ;no interrupts .byte $0f ;400ms retry (default) @@ -1007,10 +1014,10 @@ inc_hi: read_mode_reg: - lda $FFFF ;WIZNET_BASE + lda DEFAULT_W5100_BASE ;WIZNET_BASE rts write_mode_reg: - sta $FFFF ;WIZNET_BASE + sta DEFAULT_W5100_BASE ;WIZNET_BASE rts next_eth_packet_byte: diff --git a/client/inc/commonprint.i b/client/inc/commonprint.i index a994f23..3900e96 100644 --- a/client/inc/commonprint.i +++ b/client/inc/commonprint.i @@ -32,6 +32,7 @@ .import eth_driver_name +.import eth_driver_io_base .importzp copy_src .import cfg_tftp_server ;reuse the copy_src zero page var @@ -45,8 +46,19 @@ temp_ptr: .res 2 .macro print_driver_init ldax #eth_driver_name jsr print_ascii_as_native + lda #'(' + jsr print_a + lda #'$' + jsr print_a + lda eth_driver_io_base+1 + jsr print_hex + lda eth_driver_io_base + jsr print_hex + lda #')' + jsr print_a + ldax #init_msg - jsr print_ascii_as_native + jsr print_ascii_as_native .endmacro diff --git a/client/kipperterm2/Makefile b/client/kipperterm2/Makefile index 2f0e153..c6a27f9 100644 --- a/client/kipperterm2/Makefile +++ b/client/kipperterm2/Makefile @@ -34,7 +34,7 @@ kipperterm2.o: kipperterm2.s $(INCFILES) ../inc/telnet.i ../inc/config_menu.i .. kt2wiz.prg: kipperterm2.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64fullprg.cfg $(LD) -m kt2wiz.map -vm -C ../cfg/c64fullprg.cfg -o kt2wiz.prg $(AFLAGS) $< $(IP65WIZNETLIB) $(C64WIZNETLIB) -# cp kt2wiz.prg ../../server/boot/autoexec.prg + cp kt2wiz.prg ../../server/boot kipperterm2.d64: kipperterm2.prg kt2wiz.prg addresses.txt abe.bas diff --git a/client/kipperterm2/kipperterm2.s b/client/kipperterm2/kipperterm2.s index 6d420c1..18049d3 100644 --- a/client/kipperterm2/kipperterm2.s +++ b/client/kipperterm2/kipperterm2.s @@ -106,7 +106,16 @@ init: jsr print_ascii_as_native ldax #init_msg+1 jsr print_ascii_as_native - + ldax #eth_driver_name + jsr print_ascii_as_native + lda #' ' + jsr print_a + lda eth_driver_io_base+1 + jsr print_hex + lda eth_driver_io_base + jsr print_hex + lda #' ' + jsr print_a jsr ip65_init bcs init_failed jsr dhcp_init diff --git a/client/kipperterm2/timestamp.i b/client/kipperterm2/timestamp.i index 0daffbe..8ae485c 100644 --- a/client/kipperterm2/timestamp.i +++ b/client/kipperterm2/timestamp.i @@ -1 +1 @@ -.byte "2011-01-29" +.byte "2011-05-22" diff --git a/client/test/test_wiznet.s b/client/test/test_wiznet.s index c27523c..3960a84 100644 --- a/client/test/test_wiznet.s +++ b/client/test/test_wiznet.s @@ -53,6 +53,12 @@ basicstub: init: + ldax #starting + jsr print +@loop: + inc $d020 + jmp @loop + ldax #$DE00 jsr probe_for_w5100 @@ -402,6 +408,7 @@ get_next_byte: .rodata +starting: .byte "STARTING",13,0 ms: .byte " MS",13,0 pinging: .byte "PINGING ",0 connecting: .byte "CONNECTING ",0 diff --git a/client/wiznet/kipperwizdisk.d64 b/client/wiznet/kipperwizdisk.d64 index 2fb51fa..1d4f3f9 100644 Binary files a/client/wiznet/kipperwizdisk.d64 and b/client/wiznet/kipperwizdisk.d64 differ