From 5443c740e9e472b5d365ed7f067cb2d93fec591e Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Fri, 30 Oct 2015 16:48:00 +0100 Subject: [PATCH] Added 80 column IRC client / web browser for the C64. Recently support for 80 column CONIO based on 320x200 graphics was added to the cc65 C library for the C64. This change leverages this for the IRC client and the web browser. Because not everybody prefers this 'soft80' display with its small 4x8 charbox the 40 column programs are still available as before (with the new programs called 'irc80' and 'webbrowser80'). --- platform/c128/contiki-main.c | 2 -- platform/c64/Makefile.c64 | 4 ++++ platform/c64/contiki-conf.h | 12 ++++++++++ platform/c64/contiki-main.c | 6 ++++- tools/6502/Makefile | 44 +++++++++++++++++++++++++----------- 5 files changed, 52 insertions(+), 16 deletions(-) diff --git a/platform/c128/contiki-main.c b/platform/c128/contiki-main.c index bec91bc4d..a1856d405 100644 --- a/platform/c128/contiki-main.c +++ b/platform/c128/contiki-main.c @@ -32,8 +32,6 @@ * */ -#include - #include "contiki-net.h" #include "ctk/ctk.h" #include "sys/log.h" diff --git a/platform/c64/Makefile.c64 b/platform/c64/Makefile.c64 index ed548463b..bf0197565 100644 --- a/platform/c64/Makefile.c64 +++ b/platform/c64/Makefile.c64 @@ -38,6 +38,10 @@ include $(CONTIKI_CPU)/Makefile.6502 CFLAGS += -DWITH_PETSCII +ifeq ($(findstring WITH_80COL,$(DEFINES)),WITH_80COL) + LDFLAGS += c64-soft80.o +endif + ifeq ($(MAKECMDGOALS),disk) ifndef C1541 ${error C1541 not defined! You must specify where VICE c1541 resides} diff --git a/platform/c64/contiki-conf.h b/platform/c64/contiki-conf.h index 252c0d981..7d5a8d070 100644 --- a/platform/c64/contiki-conf.h +++ b/platform/c64/contiki-conf.h @@ -42,7 +42,11 @@ #define CTK_CONF_WIDGETUP_KEY CH_F5 #define CTK_CONF_WIDGETDOWN_KEY CH_F7 +#if WITH_80COL +#define MOUSE_CONF_XTOC(x) ((x) / 4) +#else #define MOUSE_CONF_XTOC(x) ((x) / 8) +#endif #define MOUSE_CONF_YTOC(y) ((y) / 8) #define BORDERCOLOR COLOR_BLACK @@ -55,14 +59,22 @@ #define WIDGETCOLOR_FWIN COLOR_GRAY3 #define WIDGETCOLOR_HLINK COLOR_CYAN +#if WITH_80COL +#define IRC_CONF_WIDTH 80 +#else #define IRC_CONF_WIDTH 40 +#endif #define IRC_CONF_HEIGHT 24 #ifndef TELNETD_CONF_MAX_IDLE_TIME #define TELNETD_CONF_MAX_IDLE_TIME 300 #endif +#if WITH_80COL +#define WWW_CONF_WEBPAGE_WIDTH 80 +#else #define WWW_CONF_WEBPAGE_WIDTH 40 +#endif #define WWW_CONF_WEBPAGE_HEIGHT 20 #define WWW_CONF_HISTORY_SIZE 4 #define WWW_CONF_WGET_EXEC(url) exec("wget", url) diff --git a/platform/c64/contiki-main.c b/platform/c64/contiki-main.c index fe88d1cc5..f2b4aae18 100644 --- a/platform/c64/contiki-main.c +++ b/platform/c64/contiki-main.c @@ -32,7 +32,7 @@ * */ -#include +#include #include "contiki-net.h" #include "ctk/ctk.h" @@ -79,6 +79,10 @@ main(void) #endif /* WITH_ARGS */ +#if WITH_80COL + _heapadd((void *)0x0400, 0x0400); +#endif /* WITH_80COL */ + process_init(); #if 1 diff --git a/tools/6502/Makefile b/tools/6502/Makefile index 57574a840..e1e0925ef 100644 --- a/tools/6502/Makefile +++ b/tools/6502/Makefile @@ -257,24 +257,38 @@ $(eval $(call makes,c64)) c64: contiki-c64.zip -contiki-c64.zip: contiki-c64-1.d64 contiki-c64-2.d64 contiki-c64.d71 contiki-c64.d81 +contiki-c64.zip: contiki-c64-1.d64 contiki-c64-2.d64 contiki-c64-3.d64 contiki-c64.d71 contiki-c64.d81 contiki-c64-1.d64: c64-makes $(C1541) -format contiki-1,00 d64 $@ - $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/ethconfig.c64 ethconfig,p - $(C1541) -attach $@ -write ../../cpu/6502/ipconfig/ipconfig.c64 ipconfig,p - $(C1541) -attach $@ -write ../../examples/webbrowser/webbrowser.c64 webbrowser,p - $(C1541) -attach $@ -write ../../examples/wget/wget.c64 wget,p - $(C1541) -attach $@ -write ../../examples/irc/irc-client.c64 irc,p - $(C1541) -attach $@ -write ../c64/default.cfg contiki.cfg,s - $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/cs8900a.eth cs8900a.eth,s - $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/lan91c96.eth lan91c96.eth,s - $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-1351.mou contiki.mou,s - $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-inkwell.mou inkwell.mou,s - $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-joy.mou joy.mou,s - $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-pot.mou pot.mou,s + $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/ethconfig.c64 ethconfig,p + $(C1541) -attach $@ -write ../../cpu/6502/ipconfig/ipconfig.c64 ipconfig,p + $(C1541) -attach $@ -write ../../examples/webbrowser/webbrowser.c64 webbrowser,p + $(C1541) -attach $@ -write ../../examples/webbrowser-80col/webbrowser.c64 webbrowser80,p + $(C1541) -attach $@ -write ../../examples/wget/wget.c64 wget,p + $(C1541) -attach $@ -write ../c64/default.cfg contiki.cfg,s + $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/cs8900a.eth cs8900a.eth,s + $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/lan91c96.eth lan91c96.eth,s + $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-1351.mou contiki.mou,s + $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-inkwell.mou inkwell.mou,s + $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-joy.mou joy.mou,s + $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-pot.mou pot.mou,s contiki-c64-2.d64: c64-makes + $(C1541) -format contiki-2,00 d64 $@ + $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/ethconfig.c64 ethconfig,p + $(C1541) -attach $@ -write ../../cpu/6502/ipconfig/ipconfig.c64 ipconfig,p + $(C1541) -attach $@ -write ../../examples/irc/irc-client.c64 irc,p + $(C1541) -attach $@ -write ../../examples/irc-80col/irc-client.c64 irc80,p + $(C1541) -attach $@ -write ../c64/default.cfg contiki.cfg,s + $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/cs8900a.eth cs8900a.eth,s + $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/lan91c96.eth lan91c96.eth,s + $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-1351.mou contiki.mou,s + $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-inkwell.mou inkwell.mou,s + $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-joy.mou joy.mou,s + $(C1541) -attach $@ -write $(CC65_HOME)/mou/c64-pot.mou pot.mou,s + +contiki-c64-3.d64: c64-makes $(C1541) -format contiki-3,00 d64 $@ $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/ethconfig.c64 ethconfig,p $(C1541) -attach $@ -write ../../cpu/6502/ipconfig/ipconfig.c64 ipconfig,p @@ -297,8 +311,10 @@ contiki-c64.d71: c64-makes $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/ethconfig.c64 ethconfig,p $(C1541) -attach $@ -write ../../cpu/6502/ipconfig/ipconfig.c64 ipconfig,p $(C1541) -attach $@ -write ../../examples/webbrowser/webbrowser.c64 webbrowser,p + $(C1541) -attach $@ -write ../../examples/webbrowser-80col/webbrowser.c64 webbrowser80,p $(C1541) -attach $@ -write ../../examples/wget/wget.c64 wget,p $(C1541) -attach $@ -write ../../examples/irc/irc-client.c64 irc,p + $(C1541) -attach $@ -write ../../examples/irc-80col/irc-client.c64 irc80,p $(C1541) -attach $@ -write ../../examples/webserver/webserver-example.c64 webserver,p $(C1541) -attach $@ -write ../../examples/telnet-server/telnet-server.c64 telnetd,p $(C1541) -attach $@ -write ../c64/default.cfg contiki.cfg,s @@ -318,8 +334,10 @@ contiki-c64.d81: c64-makes $(C1541) -attach $@ -write ../../cpu/6502/ethconfig/ethconfig.c64 ethconfig,p $(C1541) -attach $@ -write ../../cpu/6502/ipconfig/ipconfig.c64 ipconfig,p $(C1541) -attach $@ -write ../../examples/webbrowser/webbrowser.c64 webbrowser,p + $(C1541) -attach $@ -write ../../examples/webbrowser-80col/webbrowser.c64 webbrowser80,p $(C1541) -attach $@ -write ../../examples/wget/wget.c64 wget,p $(C1541) -attach $@ -write ../../examples/irc/irc-client.c64 irc,p + $(C1541) -attach $@ -write ../../examples/irc-80col/irc-client.c64 irc80,p $(C1541) -attach $@ -write ../../examples/webserver/webserver-example.c64 webserver,p $(C1541) -attach $@ -write ../../examples/telnet-server/telnet-server.c64 telnetd,p $(C1541) -attach $@ -write ../c64/default.cfg contiki.cfg,s