diff --git a/cfg/a2bin.cfg b/cfg/a2bin.cfg deleted file mode 100644 index 0d8c631..0000000 --- a/cfg/a2bin.cfg +++ /dev/null @@ -1,21 +0,0 @@ -SYMBOLS { - __EXEHDR__: type = import; - __LOADADDR__: type = weak, value = __STARTUP_RUN__; - __LOADSIZE__: type = weak, value = __BSS_RUN__ - __STARTUP_RUN__; -} -MEMORY { - ZP: start = $00, size = $08; - IP65ZP: start = $E0, size = $00; #zero size as we hand allocate all ZP locations - HEADER: start = $0800, size = $04, file = %O; - RAM: start = $0803, size = $77FC, file = %O; -} -SEGMENTS { - ZEROPAGE: load = ZP, type = zp; - IP65ZP: load = IP65ZP, type = zp, optional = yes; - EXEHDR: load = HEADER, type = ro; - STARTUP: load = RAM, type = ro, define = yes; - CODE: load = RAM, type = ro; - RODATA: load = RAM, type = ro; - DATA: load = RAM, type = rw; - BSS: load = RAM, type = bss, define = yes; -} diff --git a/cfg/c64prg.cfg b/cfg/c64prg.cfg deleted file mode 100644 index 6b3eaf5..0000000 --- a/cfg/c64prg.cfg +++ /dev/null @@ -1,22 +0,0 @@ -SYMBOLS { - __LOADADDR__: type = import; - __EXEHDR__: type = import; -} -MEMORY { - ZP: start = $02, size = $1A; - IP65ZP: start = $5F, size = $10; - LOADADDR: start = $07FF, size = $02, file = %O; - HEADER: start = $0801, size = $0C, file = %O; - RAM: start = $080D, size = $77F3, file = %O; -} -SEGMENTS { - ZEROPAGE: load = ZP, type = zp; - IP65ZP: load = IP65ZP, type = zp, optional = yes; - LOADADDR: load = LOADADDR, type = ro; - EXEHDR: load = HEADER, type = ro; - STARTUP: load = RAM, type = ro, define = yes; - CODE: load = RAM, type = ro; - RODATA: load = RAM, type = ro, optional = yes; - DATA: load = RAM, type = rw; - BSS: load = RAM, type = bss; -} diff --git a/cfg/vic20prg.cfg b/cfg/vic20prg.cfg deleted file mode 100644 index 156ed02..0000000 --- a/cfg/vic20prg.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# Memory configuration for the VIC20 with 32K RAM Cartridge -SYMBOLS { - __LOADADDR__: type = import; - __EXEHDR__: type = import; -} -MEMORY { - ZP: start = $02, size = $1A; - IP65ZP: start = $5F, size = $10; - LOADADDR: start = $11FF, size = $02, file = %O; - HEADER: start = $1201, size = $0C, file = %O; - RAM: start = $120D, size = $6DF3, file = %O; -} -SEGMENTS { - ZEROPAGE: load = ZP, type = zp; - IP65ZP: load = IP65ZP, type = zp, optional = yes; - LOADADDR: load = LOADADDR, type = ro; - EXEHDR: load = HEADER, type = ro; - STARTUP: load = RAM, type = ro, define = yes; - CODE: load = RAM, type = ro; - RODATA: load = RAM, type = ro, optional = yes; - DATA: load = RAM, type = rw; - BSS: load = RAM, type = bss; -} diff --git a/drivers/Makefile b/drivers/Makefile index e67c9b6..7542496 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -23,10 +23,10 @@ DRIVERS=\ all: $(DRIVERS) -c64rrnet.lib: rr-net.o cs8900a.o c64print.o c64timer.o c64kernal.o c64input.o petscii_charconv.o generic_zero_page.o +c64rrnet.lib: rr-net.o cs8900a.o c64zeropage.o c64print.o c64timer.o c64kernal.o c64input.o petscii_charconv.o ar65 a $@ $^ -c64wiznet.lib: w5100.o c64print.o c64timer.o c64kernal.o c64input.o petscii_charconv.o generic_zero_page.o +c64wiznet.lib: w5100.o c64zeropage.o c64print.o c64timer.o c64kernal.o c64input.o petscii_charconv.o ar65 a $@ $^ a2lancegs.lib: lan91c96.o a2print.o a2timer.o a2kernal.o a2input.o a2charconv.o a2_zero_page.o @@ -35,7 +35,7 @@ a2lancegs.lib: lan91c96.o a2print.o a2timer.o a2kernal.o a2input.o a2charconv.o a2uther.lib: uthernet.o cs8900a.o a2print.o a2timer.o a2kernal.o a2input.o a2charconv.o a2_zero_page.o ar65 a $@ $^ -vic20rrnet.lib: vic20-rr-net.o cs8900a.o vic20print.o vic20timer.o vic20kernal.o vic20input.o petscii_charconv.o generic_zero_page.o +vic20rrnet.lib: vic20-rr-net.o cs8900a.o vic20zeropage.o vic20print.o vic20timer.o vic20kernal.o vic20input.o petscii_charconv.o ar65 a $@ $^ clean: diff --git a/drivers/generic_zero_page.s b/drivers/c64zeropage.s similarity index 59% rename from drivers/generic_zero_page.s rename to drivers/c64zeropage.s index 3226414..af40c2e 100644 --- a/drivers/generic_zero_page.s +++ b/drivers/c64zeropage.s @@ -1,8 +1,4 @@ ; zero page definitions -; this 'generic' file just puts everything into a ZP segment -; and lets LD65 in conjunction with cfg files assign zero page locations -; however this can be overridden in the case that all necessary zp variables -; cant be crammed into a contiguous segment, e.g. on the Apple ][ .exportzp copy_src .exportzp copy_dest @@ -11,15 +7,12 @@ .exportzp buffer_ptr .exportzp eth_packet - -.segment "IP65ZP" : zeropage - -copy_src: .res 2 ; source pointer -copy_dest: .res 2 ; destination pointer -dns_hostname: .res 2 -tftp_filename: .res 2 ; name of file to d/l or filemask to get directory listing for -buffer_ptr: .res 2 ; source pointer -eth_packet: .res 2 +copy_src = $5F ; also $60 - source pointer +copy_dest = $61 ; also $62 - destination pointer +dns_hostname = $63 ; also $64 +tftp_filename = $65 ; also $66 - name of file to d/l or filemask to get directory listing for +buffer_ptr = $67 ; also $68 - source pointer +eth_packet = $69 ; also $6A diff --git a/drivers/vic20zeropage.s b/drivers/vic20zeropage.s new file mode 100644 index 0000000..af40c2e --- /dev/null +++ b/drivers/vic20zeropage.s @@ -0,0 +1,36 @@ +; zero page definitions + +.exportzp copy_src +.exportzp copy_dest +.exportzp dns_hostname +.exportzp tftp_filename +.exportzp buffer_ptr +.exportzp eth_packet + +copy_src = $5F ; also $60 - source pointer +copy_dest = $61 ; also $62 - destination pointer +dns_hostname = $63 ; also $64 +tftp_filename = $65 ; also $66 - name of file to d/l or filemask to get directory listing for +buffer_ptr = $67 ; also $68 - source pointer +eth_packet = $69 ; also $6A + + + +; -- LICENSE -- +; 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 ip65. +; +; The Initial Developer of the Original Code is Jonno Downes, +; jonno@jamtronix.com. +; Portions created by the Initial Developer are Copyright (C) 2013 +; Jonno Downes. All Rights Reserved. +; -- LICENSE END -- diff --git a/libnet/c64libnet.cfg b/libnet/c64libnet.cfg deleted file mode 100644 index f32fdda..0000000 --- a/libnet/c64libnet.cfg +++ /dev/null @@ -1,38 +0,0 @@ -MEMORY { - ZP: start = $02, size = $1A, type = rw ,define = yes ; - IP65ZP: start = $5f, size = $10, type = rw,define = yes; - RAM: start = $07FF, size = $c7ab, file = %O,define = yes; -} - -SEGMENTS { - STARTUP: load = RAM, type = ro; - LOWCODE: load = RAM, type = ro, optional = yes; - INIT: load = RAM, type = ro, define = yes, optional = yes; - CODE: load = RAM, type = ro; - RODATA: load = RAM, type = ro; - DATA: load = RAM, type = rw; - BSS: load = RAM, type = bss, define = yes; - HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack - ZPSAVE: load = RAM, type = bss; - - ZEROPAGE: load = ZP, type = zp; - IP65ZP: load = IP65ZP, type = zp, optional=yes; - -} -FEATURES { - CONDES: segment = INIT, - type = constructor, - label = __CONSTRUCTOR_TABLE__, - count = __CONSTRUCTOR_COUNT__; - CONDES: segment = RODATA, - type = destructor, - label = __DESTRUCTOR_TABLE__, - count = __DESTRUCTOR_COUNT__; - CONDES: segment = RODATA, - type = interruptor, - label = __INTERRUPTOR_TABLE__, - count = __INTERRUPTOR_COUNT__; -} -SYMBOLS { - __STACKSIZE__: value = $0800, weak = yes; # 2k stack -} diff --git a/test/Makefile b/test/Makefile index bb6a9a5..87a8be8 100644 --- a/test/Makefile +++ b/test/Makefile @@ -90,23 +90,23 @@ dsk: ip65.dsk %.o: %.s $(AS) $(AFLAGS) $< -%.prg: %.o $(IP65LIB) $(C64DRIVERLIB) $(INCFILES) ../cfg/c64prg.cfg - $(LD) -o $*.prg -C ../cfg/c64prg.cfg -m $*.c64.map -vm $< $(IP65LIB) $(C64DRIVERLIB) c64.lib +%.prg: %.o $(IP65LIB) $(C64DRIVERLIB) $(INCFILES) + $(LD) -o $*.prg -t c64 -m $*.c64.map -vm $< $(IP65LIB) $(C64DRIVERLIB) c64.lib -%_tcp.prg: %.o $(IP65TCPLIB) $(C64DRIVERLIB) $(INCFILES) ../cfg/c64prg.cfg - $(LD) -o $(subst _tcp,,$*).prg -C ../cfg/c64prg.cfg -m $(subst _tcp,,$*).c64.map -vm $< $(IP65TCPLIB) $(C64DRIVERLIB) c64.lib +%_tcp.prg: %.o $(IP65TCPLIB) $(C64DRIVERLIB) $(INCFILES) + $(LD) -o $(subst _tcp,,$*).prg -t c64 -m $(subst _tcp,,$*).c64.map -vm $< $(IP65TCPLIB) $(C64DRIVERLIB) c64.lib -%.bin: %.o $(IP65LIB) $(A2DRIVERLIB) $(INCFILES) ../cfg/a2bin.cfg - $(LD) -o $*.bin -C ../cfg/a2bin.cfg -m $*.a2.map -vm $< $(IP65LIB) $(A2DRIVERLIB) apple2.lib +%.bin: %.o $(IP65LIB) $(A2DRIVERLIB) $(INCFILES) + $(LD) -o $*.bin -t apple2 -m $*.a2.map -vm $< $(IP65LIB) $(A2DRIVERLIB) apple2.lib -%_tcp.bin: %.o $(IP65TCPLIB) $(A2DRIVERLIB) $(INCFILES) ../cfg/a2bin.cfg - $(LD) -o $(subst _tcp,,$*).bin -C ../cfg/a2bin.cfg -m $(subst _tcp,,$*).a2.map -vm $< $(IP65TCPLIB) $(A2DRIVERLIB) apple2.lib +%_tcp.bin: %.o $(IP65TCPLIB) $(A2DRIVERLIB) $(INCFILES) + $(LD) -o $(subst _tcp,,$*).bin -t apple2 -m $(subst _tcp,,$*).a2.map -vm $< $(IP65TCPLIB) $(A2DRIVERLIB) apple2.lib -%.vicprg: %.o $(IP65LIB) $(VICDRIVERLIB) $(INCFILES) ../cfg/vic20prg.cfg - $(LD) -o $*.vicprg -C ../cfg/vic20prg.cfg -m $*.vic.map -vm $< $(IP65LIB) $(VICDRIVERLIB) vic20.lib +%.vicprg: %.o $(IP65LIB) $(VICDRIVERLIB) $(INCFILES) + $(LD) -o $*.vicprg -C vic20-32k.cfg -m $*.vic.map -vm $< $(IP65LIB) $(VICDRIVERLIB) vic20.lib -%_tcp.vicprg: %.o $(IP65TCPLIB) $(VICDRIVERLIB) $(INCFILES) ../cfg/vic20prg.cfg - $(LD) -o $(subst _tcp,,$*).vicprg -C ../cfg/vic20prg.cfg -m $(subst _tcp,,$*).vic.map -vm $< $(IP65TCPLIB) $(VICDRIVERLIB) vic20.lib +%_tcp.vicprg: %.o $(IP65TCPLIB) $(VICDRIVERLIB) $(INCFILES) + $(LD) -o $(subst _tcp,,$*).vicprg -C vic20-32k.cfg -m $(subst _tcp,,$*).vic.map -vm $< $(IP65TCPLIB) $(VICDRIVERLIB) vic20.lib ip65.d64: prg $(C1541) -format ip65,00 d64 $@ diff --git a/test/cifs.s b/test/cifs.s index 493e386..4543cb2 100644 --- a/test/cifs.s +++ b/test/cifs.s @@ -10,6 +10,10 @@ .import cifs_start +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset diff --git a/test/dns.s b/test/dns.s index e442ac4..42459b3 100644 --- a/test/dns.s +++ b/test/dns.s @@ -11,6 +11,10 @@ .import cfg_get_configuration_ptr +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset diff --git a/test/dottedquad.s b/test/dottedquad.s index 19afc2c..bd17ed4 100644 --- a/test/dottedquad.s +++ b/test/dottedquad.s @@ -8,6 +8,10 @@ .import dotted_quad_value +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset diff --git a/test/geturl.s b/test/geturl.s index 3f70cfd..8ab7bcc 100644 --- a/test/geturl.s +++ b/test/geturl.s @@ -22,6 +22,10 @@ temp_buff = copy_dest +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset diff --git a/test/httpd.s b/test/httpd.s index 3cfc372..266ba31 100644 --- a/test/httpd.s +++ b/test/httpd.s @@ -8,6 +8,10 @@ .import http_get_value +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" lda #14 diff --git a/test/parsequerystring.s b/test/parsequerystring.s index c146882..a64d27f 100644 --- a/test/parsequerystring.s +++ b/test/parsequerystring.s @@ -11,6 +11,10 @@ .import http_get_value +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset diff --git a/test/parser.s b/test/parser.s index d583c54..bdf6243 100644 --- a/test/parser.s +++ b/test/parser.s @@ -19,6 +19,10 @@ temp_buff = copy_dest +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset diff --git a/test/ping.s b/test/ping.s index 8d4a788..f68f387 100644 --- a/test/ping.s +++ b/test/ping.s @@ -13,6 +13,10 @@ .import icmp_ping +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset diff --git a/test/sntp.s b/test/sntp.s index 2e6d37e..640734e 100644 --- a/test/sntp.s +++ b/test/sntp.s @@ -13,6 +13,10 @@ .import sntp_get_time +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" lda #14 diff --git a/test/tcp.s b/test/tcp.s index e33f34d..8ece24d 100644 --- a/test/tcp.s +++ b/test/tcp.s @@ -34,6 +34,10 @@ .import sub_16_16 +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset diff --git a/test/tftp.s b/test/tftp.s index ba68fcb..ba1a1c7 100644 --- a/test/tftp.s +++ b/test/tftp.s @@ -17,6 +17,10 @@ .importzp tftp_filename +; keep LD65 happy +.segment "ZPSAVE" + + .segment "STARTUP" ; switch to lower case charset