Fill in the VSmile port
diff --git a/contiki-vsmile/Makefile b/contiki-vsmile/Makefile
index e69de29..20f5fe6 100644
--- a/contiki-vsmile/Makefile
+++ b/contiki-vsmile/Makefile
@@ -0,0 +1,265 @@
+#####################################################################
+#
+# Created by u'nSP IDE V4.0.0 22:55:41 09/20/21
+#
+#####################################################################
+
+
+
+
+PRJDIR = C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile
+
+APPDIR = C:\PROGRA~1\GENERA~1\UNSPID~1.0
+
+OUTDIR = .\Debug
+
+MK = $(APPDIR)\make
+
+CC = $(APPDIR)\toolchain\gcc
+
+AS = $(APPDIR)\toolchain\xasm16
+
+LD = $(APPDIR)\toolchain\xlink16
+
+AR = $(APPDIR)\toolchain\xlib16
+
+RESC = $(APPDIR)\toolchain\resc
+
+BHPCK = $(APPDIR)\toolchain\BootPacker
+
+RM = del /F 1>NUL 2>NUL
+
+STRIP = $(APPDIR)\toolchain\stripper
+
+S37STRIP = $(APPDIR)\toolchain\BinaryFileStripper
+
+RD = rd /S /Q
+
+BOOTPACKER = $(APPDIR)\toolchain\BootPacker
+
+LIKMODIFIER = $(APPDIR)\toolchain\unSP_LIKModifier
+
+INCLUDES = -I"C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki-vsmile" -I"C:/Program Files/Generalplus/unSPIDE 4.0.0/library/include" -I"C:/Program Files/Generalplus/unSPIDE 4.0.0/library/include/sys" -I"../contiki/ctk" -I"./conf/" -I"./ctk/" -I"../contiki/ek/" -I"../contiki/lib/" -I"../contiki/apps/"
+
+BODY = -body SPG200CartG -nobdy -bfile "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\contiki-vsmile.bdy"
+
+BODYFILE = "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\contiki-vsmile.bdy"
+
+BINFILE = "$(OUTDIR)\contiki-vsmile.TSK"
+
+BINFILENOEXT = $(OUTDIR)\contiki-vsmile
+
+ARYFILE = "$(OUTDIR)\contiki-vsmile.ary"
+
+SBMFILE = "$(OUTDIR)\contiki-vsmile.sbm"
+
+OPT = -S -Wall -O2 -mglobal-var-iram
+
+ASFLAGS = -t2 -sr
+
+CASFLAGS = -t2 -sr -wpop
+
+CFLAGS = $(OPT) -B$(APPDIR)\toolchain\ $(INCLUDES)
+
+BINTYPE = -at
+
+LDFLAGS = -blank 0x00
+
+EXTRAFLAGS =
+
+
+OBJFILES = \
+ "$(OUTDIR)\font_bin.res" \
+ "$(OUTDIR)\Resource.obj" \
+ "$(OUTDIR)\contiki-main.obj" \
+ "$(OUTDIR)\strncmp.obj" \
+ "$(OUTDIR)\ctk.obj" \
+ "$(OUTDIR)\ctk-conio.obj" \
+ "$(OUTDIR)\ek.obj" \
+ "$(OUTDIR)\ek-service.obj" \
+ "$(OUTDIR)\arg.obj" \
+ "$(OUTDIR)\conio.obj" \
+ "$(OUTDIR)\ctk-arch.obj" \
+ "$(OUTDIR)\timer.obj" \
+ "$(OUTDIR)\petsciiconv.obj" \
+ "$(OUTDIR)\program-handler.obj" \
+ "$(OUTDIR)\about-dsc.obj" \
+ "$(OUTDIR)\about.obj"
+
+"$(OUTDIR)\font_bin.res": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\font.bin"
+ $(RESC) "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\font.bin" "$(OUTDIR)\font_bin.res" RES_FONT_BIN
+
+"$(OUTDIR)\Resource.obj": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Resource.asm"
+ $(AS) $(ASFLAGS) $(INCLUDES) -o "$(OUTDIR)\Resource.obj" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Resource.asm"
+
+"$(OUTDIR)\contiki-main.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\contiki-main.c" "..\contiki\ctk\ctk.h" ".\ctk\ctk-arch.h" "..\contiki\ek\ek.h" "..\contiki\lib\cc.h" "..\contiki\ctk\ctk-conio.h" ".\conf\ek-conf.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\loader.h" ".\conf\cc-conf.h" ".\ctk\conio.h" ".\conf\clock-conf.h" "..\contiki\apps\program-handler.h" "..\contiki\ek\dsc.h" "..\contiki\apps\netconf-dsc.h" "..\contiki\apps\dhcp-dsc.h" "..\contiki\apps\www-dsc.h" "..\contiki\apps\webserver-dsc.h" "..\contiki\apps\ftp-dsc.h" "..\contiki\apps\telnet-dsc.h" "..\contiki\apps\email-dsc.h" "..\contiki\apps\irc-dsc.h" "..\contiki\apps\editor-dsc.h" "..\contiki\apps\calc-dsc.h" "..\contiki\apps\processes-dsc.h" "..\contiki\apps\shell-dsc.h" "..\contiki\apps\about-dsc.h" "ctk-conf.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\contiki-main.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki-vsmile/contiki-main.c"
+
+"$(OUTDIR)\contiki-main.obj": "$(OUTDIR)\contiki-main.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\contiki-main.obj" "$(OUTDIR)\contiki-main.asm"
+
+"$(OUTDIR)\strncmp.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\strncmp.c"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\strncmp.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki-vsmile/strncmp.c"
+
+"$(OUTDIR)\strncmp.obj": "$(OUTDIR)\strncmp.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\strncmp.obj" "$(OUTDIR)\strncmp.asm"
+
+"$(OUTDIR)\ctk.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk.c" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk-draw.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk-mouse.h" "..\contiki\ek\ek.h" ".\conf\ek-conf.h" "..\contiki\lib\cc.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\loader.h" ".\conf\cc-conf.h" "..\contiki\lib\cc.h" "ctk-conf.h" "..\contiki\lib\timer.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\lib\clock.h" ".\conf\clock-conf.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\string.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\stddef.h" ".\ctk\ctk-arch.h" "..\contiki\ctk\ctk-conio.h" ".\ctk\conio.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\ctk.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/ctk/ctk.c"
+
+"$(OUTDIR)\ctk.obj": "$(OUTDIR)\ctk.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\ctk.obj" "$(OUTDIR)\ctk.asm"
+
+"$(OUTDIR)\ctk-conio.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk-conio.c" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk-draw.h" ".\ctk\conio.h" ".\conf\ctk-conio-conf.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\string.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\stddef.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\ctype.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\_ansi.h" "ctk-conf.h" ".\ctk\ctk-arch.h" "..\contiki\ctk\ctk-conio.h" "..\contiki\ek\ek.h" ".\conf\ek-conf.h" "..\contiki\lib\cc.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\loader.h" ".\conf\cc-conf.h" "..\contiki\lib\cc.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\ctk-conio.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/ctk/ctk-conio.c"
+
+"$(OUTDIR)\ctk-conio.obj": "$(OUTDIR)\ctk-conio.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\ctk-conio.obj" "$(OUTDIR)\ctk-conio.asm"
+
+"$(OUTDIR)\ek.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\ek.c" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\ek.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\loader.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\string.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\stddef.h" ".\conf\ek-conf.h" "..\contiki\lib\cc.h" ".\conf\cc-conf.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\ek.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/ek/ek.c"
+
+"$(OUTDIR)\ek.obj": "$(OUTDIR)\ek.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\ek.obj" "$(OUTDIR)\ek.asm"
+
+"$(OUTDIR)\ek-service.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\ek-service.c" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\ek-service.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\log.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\ek.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\loader.h" ".\conf\log-conf.h" ".\conf\ek-conf.h" "..\contiki\lib\cc.h" ".\conf\cc-conf.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\ek-service.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/ek/ek-service.c"
+
+"$(OUTDIR)\ek-service.obj": "$(OUTDIR)\ek-service.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\ek-service.obj" "$(OUTDIR)\ek-service.asm"
+
+"$(OUTDIR)\arg.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.c" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\arg.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/ek/arg.c"
+
+"$(OUTDIR)\arg.obj": "$(OUTDIR)\arg.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\arg.obj" "$(OUTDIR)\arg.asm"
+
+"$(OUTDIR)\conio.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\ctk\conio.c" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\string.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\stddef.h" "..\contiki\lib\libconio.h" ".\conf\libconio-conf.h" "Resource.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\conio.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki-vsmile/ctk/conio.c"
+
+"$(OUTDIR)\conio.obj": "$(OUTDIR)\conio.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\conio.obj" "$(OUTDIR)\conio.asm"
+
+"$(OUTDIR)\ctk-arch.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\ctk\ctk-arch.c" ".\ctk\ctk-arch.h" "..\contiki\lib\libconio.h" ".\conf\libconio-conf.h" "..\contiki\ctk\ctk-conio.h" ".\ctk\conio.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\ctk-arch.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki-vsmile/ctk/ctk-arch.c"
+
+"$(OUTDIR)\ctk-arch.obj": "$(OUTDIR)\ctk-arch.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\ctk-arch.obj" "$(OUTDIR)\ctk-arch.asm"
+
+"$(OUTDIR)\timer.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\lib\timer.c" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\lib\timer.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\lib\clock.h" ".\conf\clock-conf.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\timer.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/lib/timer.c"
+
+"$(OUTDIR)\timer.obj": "$(OUTDIR)\timer.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\timer.obj" "$(OUTDIR)\timer.asm"
+
+"$(OUTDIR)\petsciiconv.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\lib\petsciiconv.c"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\petsciiconv.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/lib/petsciiconv.c"
+
+"$(OUTDIR)\petsciiconv.obj": "$(OUTDIR)\petsciiconv.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\petsciiconv.obj" "$(OUTDIR)\petsciiconv.asm"
+
+"$(OUTDIR)\program-handler.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\apps\program-handler.c" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\apps\program-handler.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\string.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\stddef.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\stdlib.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\reent.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\sys\reent.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\_ansi.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\machine/_types.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\assert.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\limits.h" "..\contiki\ek\ek.h" ".\conf\ek-conf.h" "..\contiki\lib\cc.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\loader.h" ".\conf\cc-conf.h" "..\contiki\lib\petsciiconv.h" "..\contiki\ctk\ctk.h" ".\ctk\ctk-arch.h" "..\contiki\ctk\ctk-conio.h" ".\ctk\conio.h" "..\contiki\ctk\ctk-draw.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk.h" "ctk-conf.h" "..\contiki\ek\log.h" ".\conf\log-conf.h" "..\contiki\ek\loader.h" ".\conf\program-handler-conf.h" "..\contiki\ek\dsc.h" "ctk-conf.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\program-handler.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/apps/program-handler.c"
+
+"$(OUTDIR)\program-handler.obj": "$(OUTDIR)\program-handler.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\program-handler.obj" "$(OUTDIR)\program-handler.asm"
+
+"$(OUTDIR)\about-dsc.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\apps\about-dsc.c" "..\contiki\ek\dsc.h" "..\contiki\ctk\ctk.h" ".\ctk\ctk-arch.h" "..\contiki\ek\ek.h" "..\contiki\lib\cc.h" "..\contiki\ctk\ctk-conio.h" ".\conf\ek-conf.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\loader.h" ".\conf\cc-conf.h" ".\ctk\conio.h" "ctk-conf.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\about-dsc.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/apps/about-dsc.c"
+
+"$(OUTDIR)\about-dsc.obj": "$(OUTDIR)\about-dsc.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\about-dsc.obj" "$(OUTDIR)\about-dsc.asm"
+
+"$(OUTDIR)\about.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\apps\about.c" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\string.h" "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\include\stddef.h" "..\contiki\ek\ek.h" ".\conf\ek-conf.h" "..\contiki\lib\cc.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\arg.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ek\loader.h" ".\conf\cc-conf.h" "..\contiki\ctk\ctk.h" ".\ctk\ctk-arch.h" "..\contiki\ctk\ctk-conio.h" ".\ctk\conio.h" "..\contiki\ctk\ctk-draw.h" "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki\ctk\ctk.h" "..\contiki\lib\petsciiconv.h" "..\contiki\ek\loader.h" "ctk-conf.h"
+ set PATH="$(APPDIR)\toolchain\";%PATH% & \
+ $(CC) $(CFLAGS) -o "$(OUTDIR)\about.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki/apps/about.c"
+
+"$(OUTDIR)\about.obj": "$(OUTDIR)\about.asm"
+ $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\about.obj" "$(OUTDIR)\about.asm"
+
+
+.SUFFIXES : .c .asm .obj .s37 .tsk .res
+
+all : BEFOREBUILD "$(OUTDIR)" $(BINFILE)
+
+BEFOREBUILD :
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)\$(NULL)" mkdir "$(OUTDIR)"
+
+$(BINFILE) : $(OBJFILES)
+ $(LD) $(BINTYPE) $(ARYFILE) $(BINFILE) $(LDFLAGS) $(BODY) $(EXTRAFLAGS) -undefined-opt __TgP190708CM -undefined-opt __TgP190708CL -undefined-opt __TgP190708M
+
+compile : $(OBJFILES)
+
+CLEANFILES = \
+ "$(OUTDIR)\font_bin.res" \
+ "$(OUTDIR)\Resource.obj" \
+ "$(OUTDIR)\Resource.lst" \
+ "$(OUTDIR)\contiki-main.obj" \
+ "$(OUTDIR)\contiki-main.lst" \
+ "$(OUTDIR)\contiki-main.asm" \
+ "$(OUTDIR)\strncmp.obj" \
+ "$(OUTDIR)\strncmp.lst" \
+ "$(OUTDIR)\strncmp.asm" \
+ "$(OUTDIR)\ctk.obj" \
+ "$(OUTDIR)\ctk.lst" \
+ "$(OUTDIR)\ctk.asm" \
+ "$(OUTDIR)\ctk-conio.obj" \
+ "$(OUTDIR)\ctk-conio.lst" \
+ "$(OUTDIR)\ctk-conio.asm" \
+ "$(OUTDIR)\ek.obj" \
+ "$(OUTDIR)\ek.lst" \
+ "$(OUTDIR)\ek.asm" \
+ "$(OUTDIR)\ek-service.obj" \
+ "$(OUTDIR)\ek-service.lst" \
+ "$(OUTDIR)\ek-service.asm" \
+ "$(OUTDIR)\arg.obj" \
+ "$(OUTDIR)\arg.lst" \
+ "$(OUTDIR)\arg.asm" \
+ "$(OUTDIR)\conio.obj" \
+ "$(OUTDIR)\conio.lst" \
+ "$(OUTDIR)\conio.asm" \
+ "$(OUTDIR)\ctk-arch.obj" \
+ "$(OUTDIR)\ctk-arch.lst" \
+ "$(OUTDIR)\ctk-arch.asm" \
+ "$(OUTDIR)\timer.obj" \
+ "$(OUTDIR)\timer.lst" \
+ "$(OUTDIR)\timer.asm" \
+ "$(OUTDIR)\petsciiconv.obj" \
+ "$(OUTDIR)\petsciiconv.lst" \
+ "$(OUTDIR)\petsciiconv.asm" \
+ "$(OUTDIR)\program-handler.obj" \
+ "$(OUTDIR)\program-handler.lst" \
+ "$(OUTDIR)\program-handler.asm" \
+ "$(OUTDIR)\about-dsc.obj" \
+ "$(OUTDIR)\about-dsc.lst" \
+ "$(OUTDIR)\about-dsc.asm" \
+ "$(OUTDIR)\about.obj" \
+ "$(OUTDIR)\about.lst" \
+ "$(OUTDIR)\about.asm" \
+ "$(BINFILENOEXT).s37" "$(BINFILENOEXT).tsk" "$(BINFILENOEXT)_SPI.bin*" "$(BINFILENOEXT).hdb" "$(BINFILENOEXT).lod" "$(BINFILENOEXT).map" "$(BINFILENOEXT).sbm" "$(BINFILENOEXT).sym" "$(BINFILENOEXT).smy" \
+ "$(SBMFILE)
+
+clean :
+ $(RM) $(wordlist 1,65536,$(CLEANFILES))
+
+.c.asm:
+ $(CC) $(CFLAGS) $(INCLUDES) -o "$(OUTDIR)\$@" $<
+
+.asm.obj:
+ $(AS) $(ASFLAGS) $(INCLUDES) -o "$(OUTDIR)\$@" $<
+
diff --git a/contiki-vsmile/Resource.h b/contiki-vsmile/Resource.h
index 1a3ec87..8e4f6a2 100644
--- a/contiki-vsmile/Resource.h
+++ b/contiki-vsmile/Resource.h
@@ -1,5 +1,12 @@
#ifndef __RESOURCE_H__
#define __RESOURCE_H__
// write your header here
-
#endif
+
+// Resource Table
+// Created by IDE, Do not modify this table
+
+extern unsigned long RES_Table;
+extern unsigned long RES_FONT_BIN_SA;
+
+// End Table
diff --git a/contiki-vsmile/Resource.inc b/contiki-vsmile/Resource.inc
index e69de29..8bfe7c7 100644
--- a/contiki-vsmile/Resource.inc
+++ b/contiki-vsmile/Resource.inc
@@ -0,0 +1,9 @@
+
+// Resource Table
+// Created by IDE, Do not modify this table
+
+.TEXT
+.external _RES_Table;
+.external _RES_FONT_BIN_SA;
+
+// End Table
diff --git a/contiki-vsmile/conf/cc-conf.h b/contiki-vsmile/conf/cc-conf.h
new file mode 100644
index 0000000..ff365d1
--- /dev/null
+++ b/contiki-vsmile/conf/cc-conf.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgement:
+ * This product includes software developed by Adam Dunkels.
+ * 4. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of the Contiki desktop OS
+ *
+ * $Id: cc-conf.h,v 1.1 2003/05/19 09:30:10 gpz Exp $
+ *
+ */
+#ifndef __CC_CONF_H__
+#define __CC_CONF_H__
+
+#define CC_CONF_REGISTER_ARGS 1
+#define CC_CONF_FUNCTION_POINTER_ARGS 1
+
+#define CC_CONF_FASTCALL
+
+#endif /* __CC_CONF_H__ */
+
diff --git a/contiki-vsmile/conf/clock-conf.h b/contiki-vsmile/conf/clock-conf.h
new file mode 100644
index 0000000..814861a
--- /dev/null
+++ b/contiki-vsmile/conf/clock-conf.h
@@ -0,0 +1,7 @@
+#ifndef __CLOCK_CONF_H__
+#define __CLOCK_CONF_H__
+
+typedef unsigned long clock_time_t;
+#define CLOCK_CONF_SECOND 60
+
+#endif /* __CLOCK_CONF_H__ */
diff --git a/contiki-vsmile/conf/ctk-conf.h b/contiki-vsmile/conf/ctk-conf.h
new file mode 100644
index 0000000..1d3da59
--- /dev/null
+++ b/contiki-vsmile/conf/ctk-conf.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2002, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgement:
+ * This product includes software developed by Adam Dunkels.
+ * 4. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of the "ctk" console GUI toolkit for cc65
+ *
+ * $Id: ctk-conf.h,v 1.2 2004/06/27 12:48:37 oliverschmidt Exp $
+ *
+ */
+
+#ifndef __CTK_CONF_H__
+#define __CTK_CONF_H__
+
+/*
+ * This file is used for setting various compile time settings for the
+ * CTK GUI toolkit.
+*/
+
+/* Defines which key that is to be used for activating the menus */
+#define CTK_CONF_MENU_KEY 'm'
+
+/* Defines which key that is to be used for switching the frontmost
+ window. */
+#define CTK_CONF_WINDOWSWITCH_KEY 's'
+
+#define CTK_CONF_WIDGETDOWN_KEY '\t'
+#define CTK_CONF_WIDGETUP_KEY 'u'
+
+#define CTK_CONF_MOUSE_SUPPORT 0
+
+/* Toggles support for icons. */
+#define CTK_CONF_ICONS 1
+
+/* Toggles support for icon bitmaps. */
+#define CTK_CONF_ICON_BITMAPS 0
+
+/* Toggles support for icon textmaps. */
+#define CTK_CONF_ICON_TEXTMAPS 0
+
+/* Toggles support for movable windows. */
+#define CTK_CONF_WINDOWMOVE 1
+
+/* Toggles support for closable windows. */
+#define CTK_CONF_WINDOWCLOSE 1
+
+/* Toggles support for menus. */
+#define CTK_CONF_MENUS 1
+
+/* Defines the default width of a menu. */
+#define CTK_CONF_MENUWIDTH 16
+/* The maximum number of menu items in each menu. */
+#define CTK_CONF_MAXMENUITEMS 10
+
+#endif /* __CTK_CONF_H__ */
diff --git a/contiki-vsmile/conf/ctk-conio-conf.h b/contiki-vsmile/conf/ctk-conio-conf.h
new file mode 100644
index 0000000..f0fa209
--- /dev/null
+++ b/contiki-vsmile/conf/ctk-conio-conf.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2002, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgement:
+ * This product includes software developed by Adam Dunkels.
+ * 4. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of the "ctk" console GUI toolkit for cc65
+ *
+ * $Id: ctk-conio-conf.h,v 1.2 2004/08/12 21:56:23 oliverschmidt Exp $
+ *
+ */
+
+#ifndef __CTK_CONIO_CONF_H__
+#define __CTK_CONIO_CONF_H__
+
+/* Blue color scheme: */
+#define BORDERCOLOR 0
+#define SCREENCOLOR 1
+#define BACKGROUNDCOLOR 1
+
+#define WINDOWCOLOR_FOCUS 5
+#define WINDOWCOLOR 8
+
+#define DIALOGCOLOR 5
+
+#define WIDGETCOLOR_HLINK 6
+#define WIDGETCOLOR_FWIN 5
+#define WIDGETCOLOR 8
+#define WIDGETCOLOR_DIALOG 5
+#define WIDGETCOLOR_FOCUS 7
+
+#define MENUCOLOR 2
+#define OPENMENUCOLOR 3
+#define ACTIVEMENUITEMCOLOR 4
+
+#endif /* __CTK_CONIO_CONF_H__ */
diff --git a/contiki-vsmile/conf/ek-conf.h b/contiki-vsmile/conf/ek-conf.h
new file mode 100644
index 0000000..26ae0a4
--- /dev/null
+++ b/contiki-vsmile/conf/ek-conf.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2002, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgement:
+ * This product includes software developed by Adam Dunkels.
+ * 4. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of the "ek" event kernel.
+ *
+ * $Id: ek-conf.h,v 1.1 2003/05/19 09:30:09 gpz Exp $
+ *
+ */
+
+
+#ifndef __EK_CONF_H__
+#define __EK_CONF_H__
+
+typedef void *ek_data_t;
+
+typedef unsigned char ek_signal_t;
+typedef unsigned char ek_event_t;
+typedef unsigned char ek_id_t;
+
+/* ek_ticks_t: should be defined to be the largest type that fits the
+ highest timeout value used by the system. For example, if all
+ timeouts are between 1 and 150, the ek_ticks_t can be typedef'd as
+ "unsigned char", but if the maximum timeout is over 256, "unsigned
+ short" is a better choise. */
+typedef unsigned short ek_ticks_t;
+
+/* ek_clock_t: should be defined to be the native clock ticks type
+ used by the underlying system. (Look for time_t or similar.) */
+typedef unsigned long ek_clock_t;
+
+#define EK_CONF_NUMLISTENERS 32 /* Must be 2^n */
+typedef unsigned char ek_num_listeners_t;
+
+#define EK_CONF_MAXPROCS 32
+
+#define EK_CONF_NUMEVENTS 32
+typedef unsigned char ek_num_events_t;
+
+#endif /* __EK_CONF_H__ */
diff --git a/contiki-vsmile/conf/libconio-conf.h b/contiki-vsmile/conf/libconio-conf.h
new file mode 100644
index 0000000..928cff8
--- /dev/null
+++ b/contiki-vsmile/conf/libconio-conf.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of the Contiki desktop OS
+ *
+ * $Id: libconio-conf.h,v 1.3 2004/07/04 21:15:53 adamdunkels Exp $
+ *
+ */
+#ifndef __LIBCONIO_CONF_H__
+#define __LIBCONIO_CONF_H__
+
+#define LIBCONIO_CONF_SCREEN_WIDTH 40
+#define LIBCONIO_CONF_SCREEN_HEIGHT 25
+
+#endif /* __LIBCONIO_CONF_H__ */
+
diff --git a/contiki-vsmile/conf/log-conf.h b/contiki-vsmile/conf/log-conf.h
new file mode 100644
index 0000000..642ac2b
--- /dev/null
+++ b/contiki-vsmile/conf/log-conf.h
@@ -0,0 +1,6 @@
+#ifndef __LOG_CONF_H__
+#define __LOG_CONF_H__
+
+#define LOG_CONF_ENABLED 1
+
+#endif /* __LOG_CONF__H__ */
diff --git a/contiki-vsmile/conf/program-handler-conf.h b/contiki-vsmile/conf/program-handler-conf.h
new file mode 100644
index 0000000..9e95053
--- /dev/null
+++ b/contiki-vsmile/conf/program-handler-conf.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2004, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Institute nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * This file is part of the Contiki operating system.
+ *
+ * Author: Adam Dunkels <adam@sics.se>
+ *
+ * $Id: program-handler-conf.h,v 1.1 2005/02/15 14:59:07 oliverschmidt Exp $
+ */
+#ifndef __PROGRAM_HANDLER_CONF_H__
+#define __PROGRAM_HANDLER_CONF_H__
+
+#define PROGRAM_HANDLER_CONF_MAX_NUMDSCS 10
+
+#endif /* __PROGRAM_HANDLER_CONF_H__ */
diff --git a/contiki-vsmile/contiki-main.c b/contiki-vsmile/contiki-main.c
new file mode 100644
index 0000000..a271b8a
--- /dev/null
+++ b/contiki-vsmile/contiki-main.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2021, Adrien Destugues, pulkomandy@pulkomandy.tk
+ * Distributed under terms of the MIT license.
+ */
+
+// Contiki includes
+#include "ctk.h"
+
+#include "clock-conf.h"
+
+#include "program-handler.h"
+
+// Applications
+#include "netconf-dsc.h"
+#include "dhcp-dsc.h"
+#include "www-dsc.h"
+#include "webserver-dsc.h"
+#include "ftp-dsc.h"
+#include "telnet-dsc.h"
+#include "email-dsc.h"
+#include "irc-dsc.h"
+#include "editor-dsc.h"
+#include "calc-dsc.h"
+#include "processes-dsc.h"
+#include "shell-dsc.h"
+#include "about-dsc.h"
+
+// Use the vga_frame counter as a main clock. It would be nice to have a
+// millisecond-precision (or more) clock, but this will do for now.
+clock_time_t clock_time(void)
+{
+ return 0;
+}
+
+// For debugging purposes only. Actually I didn't see it being called yet.
+void
+log_message(const char *part1, const char *part2)
+{
+ //printf("%s%s\n", part1, part2);
+}
+
+
+int main(void)
+{
+ static volatile int* const SYSTEM_CTRL = 0x3d20;
+ static volatile int* const WATCHDOG_CLEAR = 0x3d24;
+
+ *SYSTEM_CTRL = 0;
+ *WATCHDOG_CLEAR = 0x55aa;
+
+ ek_init();
+ conio_init();
+ ctk_init();
+
+ program_handler_init();
+#if 0
+#if 0
+ program_handler_add(&netconf_dsc, "Network setup", 1);
+ program_handler_add(&dhcp_dsc, "DHCP client", 1);
+ program_handler_add(&www_dsc, "Web browser", 1);
+ program_handler_add(&webserver_dsc, "Web server", 1);
+ program_handler_add(&ftp_dsc, "FTP client", 1);
+ program_handler_add(&telnet_dsc, "Telnet", 1);
+ program_handler_add(&email_dsc, "E-mail", 1);
+ program_handler_add(&irc_dsc, "IRC client", 1);
+#endif
+ program_handler_add(&editor_dsc, "Editor", 1);
+ program_handler_add(&calc_dsc, "Calculator", 1);
+ program_handler_add(&processes_dsc, "Processes", 1);
+ program_handler_add(&shell_dsc, "Command shell", 1);
+#endif
+ program_handler_add(&about_dsc, "About Contiki", 0);
+
+ // Call ek_run until everything is initialized. Then, load welcome.prg.
+ while(1) {
+ if(ek_run() == 0) {
+ //program_handler_load("welcome.prg", NULL);
+ about_init();
+ //TODO we don't have a loader; so call the init func directly
+ break;
+ }
+ }
+
+ // Run the main loop.
+ while(1) {
+ if (ek_run() == 0) {
+ // We are out of events to run, sleep a little.
+ // TODO wait_vsync(1);
+ }
+ }
+
+ return 0;
+}
diff --git a/contiki-vsmile/contiki-vsmile.bdy b/contiki-vsmile/contiki-vsmile.bdy
new file mode 100644
index 0000000..cf2d775
--- /dev/null
+++ b/contiki-vsmile/contiki-vsmile.bdy
@@ -0,0 +1,15 @@
+[ARCH]
+BODY=SPG200CartG;
+SEC=RAM,8,271F,W;
+SEC=ROM,8000,FBFF,R;
+SEC=ROM,10000,3FFFFF,R;
+SEC=SysROM,FC00,FFFF,R;
+SEC=Interrupt,FFF5,FFFF,R;
+SEC=I/O,2800,3FFF,W;
+BANK=40,FFFF;
+CPUTYPE=unsp002;
+DMAENABLE=1;
+DEFAULTISAVER=ISA11;
+MEMORYTYPE=GeneralFlash;
+LOCATE=IRQVec,FFF5;
+USB_SCK_SEL=1;
diff --git a/contiki-vsmile/contiki-vsmile.lik b/contiki-vsmile/contiki-vsmile.lik
new file mode 100644
index 0000000..2d09b2d
--- /dev/null
+++ b/contiki-vsmile/contiki-vsmile.lik
@@ -0,0 +1,74 @@
+Version: 3.0
+Options: tsk
+Obj: "C:\Program Files\Generalplus\unSPIDE 4.0.0\startupcode\startupD.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\Resource.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\contiki-main.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\strncmp.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\ctk.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\ctk-conio.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\ek.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\ek-service.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\arg.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\conio.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\ctk-arch.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\timer.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\petsciiconv.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\program-handler.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\about-dsc.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\about.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\font_bin.res"
+Lib: "C:\Program Files\Generalplus\unSPIDE 4.0.0\library\CMacro\CMacro1016.lib"
+Output: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\contiki-vsmile.TSK"
+;Align: __sn_section_RES_FONT_BIN in "font_bin.res" with 40
+;Locate: unSP_StartUp in "startupD.obj" at 8009
+;Align: unSP_StartUp in "startupD.obj" with 0
+;Locate: IRAM in "ctk.obj" at 9D0D linkat 8
+;Align: IRAM in "ctk.obj" with 0
+;Locate: IRAM in "ctk-conio.obj" at 9D77 linkat 72
+;Align: IRAM in "ctk-conio.obj" with 0
+;Locate: IRAM in "ek.obj" at 9D7C linkat 77
+;Align: IRAM in "ek.obj" with 0
+;Locate: IRAM in "arg.obj" at 9E0B linkat 106
+;Align: IRAM in "arg.obj" with 0
+;Locate: IRAM in "conio.obj" at 9E8C linkat 187
+;Align: IRAM in "conio.obj" with 0
+;Locate: IRAM in "petsciiconv.obj" at AA8F linkat D8A
+;Align: IRAM in "petsciiconv.obj" with 0
+;Locate: IRAM in "program-handler.obj" at AB12 linkat E0D
+;Align: IRAM in "program-handler.obj" with 0
+;Locate: IRAM in "about.obj" at AB3F linkat E3A
+;Align: IRAM in "about.obj" with 0
+;Locate: CODE in "contiki-main.obj" at 9C71
+;Align: CODE in "contiki-main.obj" with 0
+;Locate: CODE in "strncmp.obj" at 9A18
+;Align: CODE in "strncmp.obj" with 0
+;Locate: CODE in "ctk.obj" at 81F3
+;Align: CODE in "ctk.obj" with 0
+;Locate: CODE in "ctk-conio.obj" at 8D3D
+;Align: CODE in "ctk-conio.obj" with 0
+;Locate: CODE in "ek.obj" at 93C1
+;Align: CODE in "ek.obj" with 0
+;Locate: CODE in "ek-service.obj" at 9AA3
+;Align: CODE in "ek-service.obj" with 0
+;Locate: CODE in "arg.obj" at 9CDB
+;Align: CODE in "arg.obj" with 0
+;Locate: CODE in "conio.obj" at 967A
+;Align: CODE in "conio.obj" with 0
+;Locate: CODE in "ctk-arch.obj" at 9C2E
+;Align: CODE in "ctk-arch.obj" with 0
+;Locate: CODE in "timer.obj" at 9B29
+;Align: CODE in "timer.obj" with 0
+;Locate: CODE in "petsciiconv.obj" at 9BAD
+;Align: CODE in "petsciiconv.obj" with 0
+;Locate: CODE in "program-handler.obj" at 996D
+;Align: CODE in "program-handler.obj" with 0
+;Locate: about_init_ptsec in "about-dsc.obj" at 81F1
+;Align: about_init_ptsec in "about-dsc.obj" with 0
+;Locate: CODE in "about.obj" at 9891
+;Align: CODE in "about.obj" with 0
+;Locate: __sn_section_RES_FONT_BIN in "font_bin.res" at AC00
+;Locate: CODE in "_GPTag" of "CMacro1016.lib" at 9D05
+;Align: CODE in "_GPTag" of "CMacro1016.lib" with 0
+;Locate: CODE in "rshu2" of "CMacro1016.lib" at 9CA8
+;Align: CODE in "rshu2" of "CMacro1016.lib" with 0
+;Locate: __sn_init_table at 8000
diff --git a/contiki-vsmile/contiki-vsmile.opt b/contiki-vsmile/contiki-vsmile.opt
index e69de29..1164957 100644
--- a/contiki-vsmile/contiki-vsmile.opt
+++ b/contiki-vsmile/contiki-vsmile.opt
Binary files differ
diff --git a/contiki-vsmile/contiki-vsmile.rc b/contiki-vsmile/contiki-vsmile.rc
index a9b7baf..a90b6ee 100644
--- a/contiki-vsmile/contiki-vsmile.rc
+++ b/contiki-vsmile/contiki-vsmile.rc
@@ -1,4 +1,12 @@
# Begin Project
# Begin SubItem "contiki-vsmile Resources"
+# Begin Source File
+SOURCE=.\font.bin
+USEPARAM=FALSE
+PARAM=
+ID=RES_FONT_BIN
+EXPORT=1
+SPECIFICFLAG=0
+# End Source File
# End SubItem
# End Project
diff --git a/contiki-vsmile/contiki-vsmile.set b/contiki-vsmile/contiki-vsmile.set
index b59b62b..e3feceb 100644
--- a/contiki-vsmile/contiki-vsmile.set
+++ b/contiki-vsmile/contiki-vsmile.set
@@ -7,17 +7,17 @@
DebugOutput=.\Debug
EnableFunctionView=0
DownloadPrompt=0
-DiffDownload=1970040940
+DiffDownload=0
CHECK_DOWNLOAD_VERIFY=0
BodyName=SPG200CartG
[SetLink]
-ExeFile=1
-Output=.\Debug\contiki-vsmile.s37
+ExeFile=0
+Output=contiki-vsmile.TSK
INTVEC=1
STARTUP=1
-ALIGNRES=0
-ALIGNNUM=0
+ALIGNRES=1
+ALIGNNUM=40
FillUnusedNum=0
INITTABLE=1
NONPAGE0=0
@@ -31,17 +31,17 @@
Count=0
[Option]
-CC_LOC=$(APPDIR)\toolchain\udocc
-CC_FLAG_D=-S -gstabs -Wall
-CC_FLAG_R=-S -O1 -Wall
+CC_LOC=$(APPDIR)\toolchain\gcc
+CC_FLAG_D=-S -Wall -O2
+CC_FLAG_R=-S -O1 -Wall
AS_LOC=$(APPDIR)\toolchain\xasm16
-AS_FLAG_D=-t2 -d -sr
+AS_FLAG_D=-t2 -sr
AS_FLAG_R=-t2 -sr
LD_LOC=$(APPDIR)\toolchain\xlink16
-LD_FLAG_D=
-LD_FLAG_R=
-DebugOpt=0
-ReleaseOpt=2
+LD_FLAG_D= -blank 0x00
+LD_FLAG_R= -blank 0x00
+DebugOpt=2
+ReleaseOpt=1
IsGenMakefile=1
IsGenAryfile=1
IsGenRes=1
@@ -49,10 +49,10 @@
IsGenList=0
CurIsa=ISA11
IsWall=1
-POINTER=1
+POINTER=0
[AdvancedHard]
-nStackSize=10015
+nStackSize=2047
[Beforebuild]
Description=
diff --git a/contiki-vsmile/contiki-vsmile.spj b/contiki-vsmile/contiki-vsmile.spj
index af9b7e8..96fed2e 100644
--- a/contiki-vsmile/contiki-vsmile.spj
+++ b/contiki-vsmile/contiki-vsmile.spj
Binary files differ
diff --git a/contiki-vsmile/ctk/conio.c b/contiki-vsmile/ctk/conio.c
new file mode 100644
index 0000000..938cb62
--- /dev/null
+++ b/contiki-vsmile/ctk/conio.c
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2002, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: libconio.c,v 1.6 2004/09/12 20:24:55 adamdunkels Exp $
+ *
+ */
+
+#include <string.h>
+#include "libconio.h"
+
+#include "Resource.h"
+
+static unsigned char cursx, cursy;
+static unsigned char color;
+
+unsigned int vram[2048];
+unsigned int vram_attr[1024];
+
+
+#define make_color(r, g, b) ((r << 10) | (g << 5) | (b << 0))
+#define VRAM_WIDTH 64
+
+void conio_init(void)
+{
+ static volatile int* const PPU_BG1_SCROLL_X = 0x2810;
+ static volatile int* const PPU_BG1_SCROLL_Y = 0x2811;
+ static volatile int* const PPU_BG1_ATTR = 0x2812;
+ static volatile int* const PPU_BG1_CTRL = 0x2813;
+ static volatile int* const PPU_BG1_TILE_ADDR = 0x2814;
+ static volatile int* const PPU_BG1_ATTR_ADDR = 0x2815;
+
+ static volatile int* const PPU_BG2_CTRL = 0x2819;
+
+ static volatile int* const PPU_BG1_SEGMENT_ADDR = 0x2820;
+
+ static volatile int* const PPU_SPRITE_CTRL = 0x2842;
+ static volatile int* const PPU_COLOR = 0x2B00;
+ int i;
+
+ *PPU_BG1_SCROLL_X = 0;
+ *PPU_BG1_SCROLL_Y = 0;
+ *PPU_BG1_ATTR = 0;
+ *PPU_BG1_CTRL = 0x0a; // TODO 0x08 so that vram_attr is actually used for something. Once we can figure out how it works. There will be only 4 possible "colors" this way...
+ *PPU_BG2_CTRL = 0;
+ *PPU_SPRITE_CTRL = 0;
+
+ *PPU_BG1_TILE_ADDR = vram;
+ *PPU_BG1_ATTR_ADDR = vram_attr;
+ *PPU_BG1_SEGMENT_ADDR = RES_FONT_BIN_SA >> 6;
+
+ for (i = 0; i < 255; i++)
+ PPU_COLOR[i] = i;
+
+ PPU_COLOR[0] = make_color(0, 0, 0); // Border
+ PPU_COLOR[1] = make_color(18, 18, 31); // Screen
+ PPU_COLOR[3] = make_color(31, 31, 31); // Menu
+ PPU_COLOR[4] = make_color(31, 15, 15); // Active menu item
+ PPU_COLOR[5] = make_color(30, 30, 30); // Dialogs
+ PPU_COLOR[6] = make_color(12, 12, 31); // Hyperlinks
+ PPU_COLOR[7] = make_color(24, 24, 31); // Moving window
+ PPU_COLOR[8] = make_color(24, 24, 24); // Inactive window
+
+ PPU_COLOR[2+16] = make_color(31, 31, 31);
+ PPU_COLOR[6+16] = make_color(0, 0, 31);
+ PPU_COLOR[7+16] = make_color(31, 0, 31);
+}
+
+/*-----------------------------------------------------------------------------------*/
+unsigned char
+wherex(void)
+{
+ return cursx;
+}
+/*-----------------------------------------------------------------------------------*/
+unsigned char
+wherey(void)
+{
+ return cursy;
+}
+/*-----------------------------------------------------------------------------------*/
+void
+clrscr(void)
+{
+ memset(vram, 0, VRAM_WIDTH * LIBCONIO_SCREEN_HEIGHT);
+ memset(vram_attr, 0, VRAM_WIDTH * LIBCONIO_SCREEN_HEIGHT / 2);
+}
+/*-----------------------------------------------------------------------------------*/
+void
+revers(unsigned char c)
+{
+ if (c != 0) color |= 16;
+ else color &= ~16;
+}
+/*-----------------------------------------------------------------------------------*/
+void
+cputc(char c)
+{
+ ctk_arch_draw_char(c, cursx, cursy, 0, color);
+ ++cursx;
+}
+/*-----------------------------------------------------------------------------------*/
+void
+cputs(char *str)
+{
+ int i;
+ for (i = 0; str[i]; i++) {
+ cputc(str[i]);
+ }
+}
+/*-----------------------------------------------------------------------------------*/
+void
+cclear(unsigned char length)
+{
+ memset(vram + cursy * VRAM_WIDTH + cursx, 0, length);
+ memset(vram_attr + ((cursy * VRAM_WIDTH + cursx) >> 1), color, length >> 1);
+ cursx += length;
+}
+/*-----------------------------------------------------------------------------------*/
+void
+chline(unsigned char length)
+{
+ memset(vram + cursy * VRAM_WIDTH + cursx, 196, length);
+ memset(vram_attr + ((cursy * VRAM_WIDTH + cursx) >> 1), color, length >> 1);
+ cursx += length;
+}
+/*-----------------------------------------------------------------------------------*/
+void
+cvline(unsigned char length)
+{
+ int i;
+ for(i = 0; i < length; ++i) {
+ vram_attr[(cursy * VRAM_WIDTH + cursx) >> 1] = color;
+ vram[cursy++ * VRAM_WIDTH + cursx] = 179;
+ }
+}
+/*-----------------------------------------------------------------------------------*/
+void
+gotoxy(unsigned char x, unsigned char y)
+{
+ cursx = x;
+ cursy = y;
+}
+/*-----------------------------------------------------------------------------------*/
+void
+cclearxy(unsigned char x, unsigned char y, unsigned char length)
+{
+ gotoxy(x, y);
+ cclear(length);
+}
+/*-----------------------------------------------------------------------------------*/
+void
+chlinexy(unsigned char x, unsigned char y, unsigned char length)
+{
+ gotoxy(x, y);
+ chline(length);
+}
+/*-----------------------------------------------------------------------------------*/
+void
+cvlinexy(unsigned char x, unsigned char y, unsigned char length)
+{
+ gotoxy(x, y);
+ cvline(length);
+}
+/*-----------------------------------------------------------------------------------*/
+void
+cputsxy(unsigned char x, unsigned char y, char *str)
+{
+ gotoxy(x, y);
+ cputs(str);
+}
+/*-----------------------------------------------------------------------------------*/
+void
+cputcxy(unsigned char x, unsigned char y, char c)
+{
+ gotoxy(x, y);
+ cputc(c);
+}
+/*-----------------------------------------------------------------------------------*/
+void
+textcolor(unsigned char c)
+{
+ color &= 16;
+ color |= c;
+}
+/*-----------------------------------------------------------------------------------*/
+void
+bgcolor(unsigned char c)
+{
+
+}
+/*-----------------------------------------------------------------------------------*/
+void
+bordercolor(unsigned char c)
+{
+
+}
+/*-----------------------------------------------------------------------------------*/
+void
+screensize(unsigned char *x, unsigned char *y)
+{
+ *x = LIBCONIO_SCREEN_WIDTH;
+ *y = LIBCONIO_SCREEN_HEIGHT;
+}
+/*-----------------------------------------------------------------------------------*/
diff --git a/contiki-vsmile/ctk/conio.h b/contiki-vsmile/ctk/conio.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contiki-vsmile/ctk/conio.h
diff --git a/contiki-vsmile/ctk/ctk-arch.c b/contiki-vsmile/ctk/ctk-arch.c
new file mode 100644
index 0000000..4a8481b
--- /dev/null
+++ b/contiki-vsmile/ctk/ctk-arch.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2017, Adrien Destugues, pulkomandy@pulkomandy.tk
+ * Distributed under terms of the MIT license.
+ */
+
+
+#include "ctk-arch.h"
+#include "libconio.h"
+
+/* Keyboard management */
+ctk_arch_key_t
+ctk_arch_getkey(void)
+{
+ return 0;
+}
+
+unsigned char kbhit(void)
+{
+ return 0;
+}
+
+#if 0
+/* Mouse management */
+void ctk_mouse_init(void)
+{
+ mx = 50;
+ my = 20;
+}
+
+unsigned char ctk_mouse_xtoc(unsigned short x)
+{
+ return x;
+}
+
+unsigned char ctk_mouse_ytoc(unsigned short y)
+{
+ return y;
+}
+
+void ctk_mouse_hide(void)
+{
+ vram_attr[ctk_mouse_ytoc(my)][ctk_mouse_xtoc(mx)] &= ~32;
+}
+
+void ctk_mouse_show(void)
+{
+ vram_attr[ctk_mouse_ytoc(my)][ctk_mouse_xtoc(mx)] |= 32;
+}
+
+unsigned short ctk_mouse_x(void)
+{
+ if (mouse_x != 0)
+ {
+ ctk_mouse_hide();
+ mx += mouse_x; mouse_x = 0;
+ if (mx < 0) mx = 0;
+ if (mx >= LIBCONIO_SCREEN_WIDTH) mx = LIBCONIO_SCREEN_WIDTH - 1;
+ }
+ return mx;
+}
+
+unsigned short ctk_mouse_y(void)
+{
+ if (mouse_y != 0) {
+ ctk_mouse_hide();
+ my += mouse_y; mouse_y = 0;
+ if (my < 0) my = 0;
+ if (my >= LIBCONIO_SCREEN_HEIGHT) my = LIBCONIO_SCREEN_HEIGHT - 1;
+ }
+ return my;
+}
+
+unsigned char ctk_mouse_button(void)
+{
+ return mouse_buttons;
+}
+#endif
+
+extern int vram[];
+extern int vram_attr[];
+#define VRAM_WIDTH 64
+
+/* Character display */
+void
+ctk_arch_draw_char(char c,
+ unsigned char x, unsigned char y,
+ unsigned char reversed,
+ unsigned char color)
+{
+ vram[y * VRAM_WIDTH + x] = c;
+ if (x & 1) {
+ vram_attr[(y * VRAM_WIDTH + x) / 2] &= 0xff;
+ vram_attr[(y * VRAM_WIDTH + x) / 2] |= color << 8;
+ } else {
+ vram_attr[(y * VRAM_WIDTH + x) / 2] &= 0xff00;
+ vram_attr[(y * VRAM_WIDTH + x) / 2] |= color;
+ }
+}
diff --git a/contiki-vsmile/ctk/ctk-arch.h b/contiki-vsmile/ctk/ctk-arch.h
new file mode 100644
index 0000000..385db71
--- /dev/null
+++ b/contiki-vsmile/ctk/ctk-arch.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2002, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgement:
+ * This product includes software developed by Adam Dunkels.
+ * 4. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of the "ctk" console GUI toolkit for cc65
+ *
+ * $Id: ctk-arch.h,v 1.1 2003/05/19 09:30:03 gpz Exp $
+ *
+ */
+#ifndef __CTK_ARCH_H__
+#define __CTK_ARCH_H__
+#define CH_DEL '\b'
+#define CH_CURS_UP 'k'
+#define CH_CURS_LEFT 'h'
+#define CH_CURS_RIGHT 'l'
+#define CH_CURS_DOWN 'j'
+
+// FIXME use the semigraphics
+#define CH_ULCORNER '\xDA'
+#define CH_URCORNER '\xBF'
+#define CH_LLCORNER '\xC0'
+#define CH_LRCORNER '\xD9'
+
+#include "ctk-conio.h"
+
+#undef ctk_arch_getkey
+
+#endif /* __CTK_ARCH_H__ */
diff --git a/contiki-vsmile/strncmp.c b/contiki-vsmile/strncmp.c
new file mode 100644
index 0000000..bcc4407
--- /dev/null
+++ b/contiki-vsmile/strncmp.c
@@ -0,0 +1,34 @@
+int strncmp(const char *_l, const char *_r, int n)
+{
+ const unsigned char *l=(void *)_l, *r=(void *)_r;
+ if (!n--) return 0;
+ for (; *l && *r && n && *l == *r ; l++, r++, n--);
+ return *l - *r;
+}
+
+int strlen(const char *s)
+{
+ const char *a = s;
+
+ for (; *s; s++);
+ return s-a;
+}
+
+char *strcpy(char * d, const char * s)
+{
+ for (; (*d=*s); s++, d++);
+
+ return d;
+}
+
+void *memset(void *dest, int c, int n)
+{
+ unsigned char *s = dest;
+ for (; n; n--, s++) *s = c;
+ return dest;
+}
+
+int isprint(int c)
+{
+ return c > 32 && c < 256;
+}
\ No newline at end of file