Fix UART/input handling
Tested in MAME only for now.
diff --git a/contiki-vsmile/Makefile b/contiki-vsmile/Makefile
deleted file mode 100644
index b0113fb..0000000
--- a/contiki-vsmile/Makefile
+++ /dev/null
@@ -1,276 +0,0 @@
-#####################################################################
-#
-# Created by u'nSP IDE V4.0.0 22:11:18 09/21/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)\welcome.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" ".\conf\ctk-conf.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"
- 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" ".\conf\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" ".\conf\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" ".\conf\ctk-conf.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" ".\conf\ctk-conf.h" "..\contiki\ek\log.h" ".\conf\log-conf.h" "..\contiki\ek\loader.h" ".\conf\program-handler-conf.h" "..\contiki\ek\dsc.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" ".\conf\ctk-conf.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"
- 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" ".\conf\ctk-conf.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"
- 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"
-
-"$(OUTDIR)\welcome.asm": "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\apps\welcome.c" "..\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" ".\conf\ctk-conf.h" ".\ctk\ctk-arch.h" "..\contiki\ctk\ctk-conio.h" ".\ctk\conio.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"
- set PATH="$(APPDIR)\toolchain\";%PATH% & \
- $(CC) $(CFLAGS) -o "$(OUTDIR)\welcome.asm" "C:/Users/pulkomandy/Documents/GitHub/contiki-1.x/contiki-vsmile/apps/welcome.c"
-
-"$(OUTDIR)\welcome.obj": "$(OUTDIR)\welcome.asm"
- $(AS) $(CASFLAGS) $(INCLUDES) -o "$(OUTDIR)\welcome.obj" "$(OUTDIR)\welcome.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" \
- "$(OUTDIR)\welcome.obj" \
- "$(OUTDIR)\welcome.lst" \
- "$(OUTDIR)\welcome.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/apps/welcome.c b/contiki-vsmile/apps/welcome.c
index 70a359c..cd47974 100644
--- a/contiki-vsmile/apps/welcome.c
+++ b/contiki-vsmile/apps/welcome.c
@@ -42,15 +42,15 @@
static struct ctk_label welcomelabel1 =
{CTK_LABEL(1, 1, 30, 1, "Welcome to Contiki!")};
static struct ctk_label welcomelabel2 =
- {CTK_LABEL(2, 4, 28, 1, "F1 - open menus")};
+ {CTK_LABEL(2, 4, 28, 1, "Green - open menus")};
static struct ctk_label welcomelabel3 =
- {CTK_LABEL(2, 6, 28, 1, "F3 - cycle windows")};
+ {CTK_LABEL(2, 6, 28, 1, "ABC - cycle windows")};
static struct ctk_label welcomelabel4 =
- {CTK_LABEL(2, 8, 28, 1, "F5 - select up")};
+ {CTK_LABEL(2, 8, 28, 1, "Blue - select up")};
static struct ctk_label welcomelabel5 =
- {CTK_LABEL(2, 10, 28, 1, "F7 - select down")};
+ {CTK_LABEL(2, 10, 28, 1, "Yellow - select down")};
static struct ctk_label welcomelabel6 =
- {CTK_LABEL(2, 12, 28, 1, "Return - activate selected")};
+ {CTK_LABEL(2, 12, 28, 1, "OK - activate selected")};
static struct ctk_label welcomelabel7 =
{CTK_LABEL(3, 15, 25, 1, "Press any key to continue")};
diff --git a/contiki-vsmile/conf/ctk-conf.h b/contiki-vsmile/conf/ctk-conf.h
index 1d3da59..337f569 100644
--- a/contiki-vsmile/conf/ctk-conf.h
+++ b/contiki-vsmile/conf/ctk-conf.h
@@ -45,14 +45,14 @@
*/
/* Defines which key that is to be used for activating the menus */
-#define CTK_CONF_MENU_KEY 'm'
+#define CTK_CONF_MENU_KEY 0x91 // GREEN
/* Defines which key that is to be used for switching the frontmost
window. */
-#define CTK_CONF_WINDOWSWITCH_KEY 's'
+#define CTK_CONF_WINDOWSWITCH_KEY 0xa4 // ABC
-#define CTK_CONF_WIDGETDOWN_KEY '\t'
-#define CTK_CONF_WIDGETUP_KEY 'u'
+#define CTK_CONF_WIDGETDOWN_KEY 0x92
+#define CTK_CONF_WIDGETUP_KEY 0x94
#define CTK_CONF_MOUSE_SUPPORT 0
@@ -63,7 +63,7 @@
#define CTK_CONF_ICON_BITMAPS 0
/* Toggles support for icon textmaps. */
-#define CTK_CONF_ICON_TEXTMAPS 0
+#define CTK_CONF_ICON_TEXTMAPS 1
/* Toggles support for movable windows. */
#define CTK_CONF_WINDOWMOVE 1
diff --git a/contiki-vsmile/conf/ctk-conio-conf.h b/contiki-vsmile/conf/ctk-conio-conf.h
index da43c86..81add12 100644
--- a/contiki-vsmile/conf/ctk-conio-conf.h
+++ b/contiki-vsmile/conf/ctk-conio-conf.h
@@ -41,7 +41,7 @@
/* Blue color scheme: */
#define BORDERCOLOR 0
-#define SCREENCOLOR 1
+#define SCREENCOLOR 0
#define BACKGROUNDCOLOR 1
#define WINDOWCOLOR_FOCUS 5
@@ -59,4 +59,10 @@
#define OPENMENUCOLOR 3
#define ACTIVEMENUITEMCOLOR 4
+#define CH_ENTER 0xA1 // OK
+#define CH_F1 0xA3 // HELP
+#define CH_F3 0xA2 // QUIT
+#define CH_CURS_RIGHT 0xC7
+#define CH_CURS_LEFT 0xCF
+
#endif /* __CTK_CONIO_CONF_H__ */
diff --git a/contiki-vsmile/conf/libconio-conf.h b/contiki-vsmile/conf/libconio-conf.h
index 928cff8..5234e8b 100644
--- a/contiki-vsmile/conf/libconio-conf.h
+++ b/contiki-vsmile/conf/libconio-conf.h
@@ -36,7 +36,7 @@
#define __LIBCONIO_CONF_H__
#define LIBCONIO_CONF_SCREEN_WIDTH 40
-#define LIBCONIO_CONF_SCREEN_HEIGHT 25
+#define LIBCONIO_CONF_SCREEN_HEIGHT 30
#endif /* __LIBCONIO_CONF_H__ */
diff --git a/contiki-vsmile/contiki-main.c b/contiki-vsmile/contiki-main.c
index 4d20f85..6bd890f 100644
--- a/contiki-vsmile/contiki-main.c
+++ b/contiki-vsmile/contiki-main.c
@@ -65,8 +65,10 @@
program_handler_add(&irc_dsc, "IRC client", 1);
#endif
program_handler_add(&editor_dsc, "Editor", 1);
+#endif
program_handler_add(&calc_dsc, "Calculator", 1);
program_handler_add(&processes_dsc, "Processes", 1);
+#if 0
program_handler_add(&shell_dsc, "Command shell", 1);
#endif
program_handler_add(&about_dsc, "About Contiki", 0);
@@ -74,9 +76,7 @@
// Call ek_run until everything is initialized. Then, load welcome.prg.
while(1) {
if(ek_run() == 0) {
- //program_handler_load("welcome.prg", NULL);
welcome_init();
- //TODO we don't have a loader; so call the init func directly
break;
}
}
diff --git a/contiki-vsmile/contiki-vsmile.lik b/contiki-vsmile/contiki-vsmile.lik
index 7506b01..d3f16a7 100644
--- a/contiki-vsmile/contiki-vsmile.lik
+++ b/contiki-vsmile/contiki-vsmile.lik
@@ -17,63 +17,107 @@
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\welcome.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\processes.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\processes-dsc.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\calc.obj"
+Obj: "C:\Users\pulkomandy\Documents\GitHub\contiki-1.x\contiki-vsmile\Debug\calc-dsc.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 9F07 linkat 8
+;Locate: IRAM in "ctk.obj" at A930 linkat 8
;Align: IRAM in "ctk.obj" with 0
-;Locate: IRAM in "ctk-conio.obj" at 9F71 linkat 72
+;Locate: IRAM in "ctk-conio.obj" at A99A linkat 72
;Align: IRAM in "ctk-conio.obj" with 0
-;Locate: IRAM in "ek.obj" at 9F76 linkat 77
+;Locate: IRAM in "ek.obj" at A99F linkat 77
;Align: IRAM in "ek.obj" with 0
-;Locate: IRAM in "arg.obj" at A005 linkat 106
+;Locate: IRAM in "arg.obj" at AA2E linkat 106
;Align: IRAM in "arg.obj" with 0
-;Locate: IRAM in "conio.obj" at A086 linkat 187
+;Locate: IRAM in "conio.obj" at AAAF linkat 187
;Align: IRAM in "conio.obj" with 0
-;Locate: IRAM in "petsciiconv.obj" at AC89 linkat D8A
+;Locate: IRAM in "ctk-arch.obj" at B6B2 linkat D8A
+;Align: IRAM in "ctk-arch.obj" with 0
+;Locate: IRAM in "petsciiconv.obj" at B6B3 linkat D8B
;Align: IRAM in "petsciiconv.obj" with 0
-;Locate: IRAM in "program-handler.obj" at AD0C linkat E0D
+;Locate: IRAM in "program-handler.obj" at B736 linkat E0E
;Align: IRAM in "program-handler.obj" with 0
-;Locate: IRAM in "about.obj" at AD39 linkat E3A
+;Locate: IRAM in "about.obj" at B763 linkat E3B
;Align: IRAM in "about.obj" with 0
-;Locate: IRAM in "welcome.obj" at ADD9 linkat EDA
+;Locate: IRAM in "welcome.obj" at B803 linkat EDB
;Align: IRAM in "welcome.obj" with 0
-;Locate: CODE in "contiki-main.obj" at 9E6B
+;Locate: IRAM in "processes.obj" at B860 linkat F38
+;Align: IRAM in "processes.obj" with 0
+;Locate: IRAM in "calc.obj" at B9BA linkat 1092
+;Align: IRAM in "calc.obj" with 0
+;Locate: CODE in "contiki-main.obj" at A736
;Align: CODE in "contiki-main.obj" with 0
-;Locate: CODE in "strncmp.obj" at 9C03
+;Locate: CODE in "strncmp.obj" at A30C
;Align: CODE in "strncmp.obj" with 0
-;Locate: CODE in "ctk.obj" at 829B
+;Locate: CODE in "ctk.obj" at 83A6
;Align: CODE in "ctk.obj" with 0
-;Locate: CODE in "ctk-conio.obj" at 8DE5
+;Locate: CODE in "ctk-conio.obj" at 8EF4
;Align: CODE in "ctk-conio.obj" with 0
-;Locate: CODE in "ek.obj" at 972B
+;Locate: CODE in "ek.obj" at 9C2A
;Align: CODE in "ek.obj" with 0
-;Locate: CODE in "ek-service.obj" at 9C8E
+;Locate: CODE in "ek-service.obj" at A397
;Align: CODE in "ek-service.obj" with 0
-;Locate: CODE in "arg.obj" at 9ED5
+;Locate: CODE in "arg.obj" at A863
;Align: CODE in "arg.obj" with 0
-;Locate: CODE in "conio.obj" at 9465
+;Locate: CODE in "conio.obj" at 95BA
;Align: CODE in "conio.obj" with 0
-;Locate: CODE in "ctk-arch.obj" at 9E19
+;Locate: CODE in "ctk-arch.obj" at A522
;Align: CODE in "ctk-arch.obj" with 0
-;Locate: CODE in "timer.obj" at 9D14
+;Locate: CODE in "timer.obj" at A41D
;Align: CODE in "timer.obj" with 0
-;Locate: CODE in "petsciiconv.obj" at 9D98
+;Locate: CODE in "petsciiconv.obj" at A4A1
;Align: CODE in "petsciiconv.obj" with 0
-;Locate: CODE in "program-handler.obj" at 9AC0
+;Locate: CODE in "program-handler.obj" at A1C9
;Align: CODE in "program-handler.obj" with 0
-;Locate: about_init_ptsec in "about-dsc.obj" at 8299
+;Locate: about_init_ptsec in "about-dsc.obj" at 83A0
;Align: about_init_ptsec in "about-dsc.obj" with 0
-;Locate: CODE in "about.obj" at 99E4
+;Locate: CODE in "about.obj" at A0ED
;Align: CODE in "about.obj" with 0
-;Locate: CODE in "welcome.obj" at 9B6B
+;Locate: CODE in "welcome.obj" at A274
;Align: CODE in "welcome.obj" with 0
-;Locate: __sn_section_RES_FONT_BIN in "font_bin.res" at AE40
-;Locate: CODE in "_GPTag" of "CMacro1016.lib" at 9EFF
+;Locate: CODE in "processes.obj" at 9EE3
+;Align: CODE in "processes.obj" with 0
+;Locate: processes_init_ptsec in "processes-dsc.obj" at 83A2
+;Align: processes_init_ptsec in "processes-dsc.obj" with 0
+;Locate: CODE in "calc.obj" at 98F6
+;Align: CODE in "calc.obj" with 0
+;Locate: calc_init_ptsec in "calc-dsc.obj" at 83A4
+;Align: calc_init_ptsec in "calc-dsc.obj" with 0
+;Locate: __sn_section_RES_FONT_BIN in "font_bin.res" at BA80
+;Locate: CODE in "_GPTag" of "CMacro1016.lib" at A928
;Align: CODE in "_GPTag" of "CMacro1016.lib" with 0
-;Locate: CODE in "rshu2" of "CMacro1016.lib" at 9EA2
+;Locate: CODE in "rshu2" of "CMacro1016.lib" at A804
;Align: CODE in "rshu2" of "CMacro1016.lib" with 0
+;Locate: CODE in "modu1" of "CMacro1016.lib" at A686
+;Align: CODE in "modu1" of "CMacro1016.lib" with 0
+;Locate: CODE in "divu1" of "CMacro1016.lib" at A6E3
+;Align: CODE in "divu1" of "CMacro1016.lib" with 0
+;Locate: CODE in "divu2" of "CMacro1016.lib" at A599
+;Align: CODE in "divu2" of "CMacro1016.lib" with 0
+;Locate: CODE in "muliu2" of "CMacro1016.lib" at A8F9
+;Align: CODE in "muliu2" of "CMacro1016.lib" with 0
+;Locate: CODE in "modu2" of "CMacro1016.lib" at A610
+;Align: CODE in "modu2" of "CMacro1016.lib" with 0
+;Locate: CODE in "clz" of "CMacro1016.lib" at A781
+;Align: CODE in "clz" of "CMacro1016.lib" with 0
+;Locate: CODE in "__divi16_n" of "CMacro1016.lib" at A91E
+;Align: CODE in "__divi16_n" of "CMacro1016.lib" with 0
+;Locate: CODE in "lshiu1" of "CMacro1016.lib" at A8D7
+;Align: CODE in "lshiu1" of "CMacro1016.lib" with 0
+;Locate: CODE in "rshu1" of "CMacro1016.lib" at A8B5
+;Align: CODE in "rshu1" of "CMacro1016.lib" with 0
+;Locate: CODE in "__divi32_n" of "CMacro1016.lib" at A88D
+;Align: CODE in "__divi32_n" of "CMacro1016.lib" with 0
+;Locate: CODE in "lshiu2" of "CMacro1016.lib" at A7CA
+;Align: CODE in "lshiu2" of "CMacro1016.lib" with 0
+;Locate: CODE in "mul_r_r_uu" of "CMacro1016.lib" at A910
+;Align: CODE in "mul_r_r_uu" of "CMacro1016.lib" with 0
+;Locate: CODE in "__modi32_n" of "CMacro1016.lib" at A837
+;Align: CODE in "__modi32_n" 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 a9fa717..568de65 100644
--- a/contiki-vsmile/contiki-vsmile.opt
+++ b/contiki-vsmile/contiki-vsmile.opt
Binary files differ
diff --git a/contiki-vsmile/contiki-vsmile.spj b/contiki-vsmile/contiki-vsmile.spj
index 9a7deae..370407e 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
index 6125f36..0737949 100644
--- a/contiki-vsmile/ctk/conio.c
+++ b/contiki-vsmile/ctk/conio.c
@@ -63,18 +63,17 @@
static volatile int* const PPU_SPRITE_CTRL = 0x2842;
static volatile int* const PPU_COLOR = 0x2B00;
+
+ volatile unsigned int* const PORTC_DATA = 0x3D0B;
+ volatile unsigned int* const PORTC_DIR = 0x3D0D;
+ volatile unsigned int* const PORTC_ATTR = 0x3D0E;
+ volatile unsigned int* const PORTC_SPECIAL = 0x3D0F;
volatile unsigned int* const UART_CONTROL = 0x3D30;
+ volatile unsigned int* const UART_STATUS = 0x3D31;
volatile unsigned int* const UART_BAUDRATE_LOW = 0x3D33;
volatile unsigned int* const UART_BAUDRATE_HIGH = 0x3D34;
- volatile unsigned int* const PORTC_DATA = 0x3D3B;
- volatile unsigned int* const PORTC_DIR = 0x3D3D;
- volatile unsigned int* const PORTC_ATTR = 0x3D3E;
- volatile unsigned int* const PORTC_SPECIAL = 0x3D3F;
-
- int i;
-
*PPU_BG1_SCROLL_X = 0;
*PPU_BG1_SCROLL_Y = 0;
*PPU_BG1_ATTR = 0;
@@ -86,37 +85,39 @@
*PPU_BG1_ATTR_ADDR = vram_attr;
*PPU_BG1_SEGMENT_ADDR = RES_FONT_BIN_SA >> 6;
- PPU_COLOR[0] = make_color(0, 0, 0); // Border, unused?
+ PPU_COLOR[0] = make_color(0, 0, 0); // Border and screen
PPU_COLOR[1] = make_color(31, 31, 31);
- PPU_COLOR[16] = make_color(0, 0, 0); // Screen
+ PPU_COLOR[16] = make_color(8, 0, 8); // Background
PPU_COLOR[17] = make_color(18, 18, 31);
- PPU_COLOR[32] = make_color(0, 0, 0); // Windows, widgets, menu
- PPU_COLOR[33] = make_color(15, 15, 15);
+ PPU_COLOR[32] = make_color(8, 8, 12); // Windows, widgets, menu
+ PPU_COLOR[33] = make_color(31, 31, 31);
- PPU_COLOR[48] = make_color(0, 0, 0); // Open menu
- PPU_COLOR[49] = make_color(31, 15, 15);
+ PPU_COLOR[48] = make_color(5, 12, 12); // Open menu
+ PPU_COLOR[49] = make_color(31, 31, 31);
- PPU_COLOR[64] = make_color(0, 0, 0); // Active menu item
- PPU_COLOR[65] = make_color(30, 30, 30);
+ PPU_COLOR[64] = make_color(12, 12, 12); // Active menu item
+ PPU_COLOR[65] = make_color(31, 31, 31);
- PPU_COLOR[80] = make_color(12, 12, 31); // Focused window/dialog
- PPU_COLOR[81] = make_color(31, 31, 15);
+ PPU_COLOR[80] = make_color(11, 11, 15); // Focused window/dialog
+ PPU_COLOR[81] = make_color(31, 31, 31);
- PPU_COLOR[96] = make_color(0, 0, 8); // Hyperlinks
+ PPU_COLOR[96] = make_color(12, 12, 31); // Hyperlinks
PPU_COLOR[97] = make_color(24, 24, 31);
PPU_COLOR[112] = make_color(12, 12, 12); // Focused widget
PPU_COLOR[113] = make_color(24, 24, 24);
+ // Colors below are with "reverse" attribute on
+
PPU_COLOR[129] = make_color(0, 0, 0); // Border, unused?
PPU_COLOR[128] = make_color(31, 31, 31);
PPU_COLOR[129+16] = make_color(0, 0, 0); // Screen
PPU_COLOR[128+16] = make_color(18, 18, 31);
- PPU_COLOR[129+32] = make_color(0, 0, 0); // Windows, widgets, menu
+ PPU_COLOR[129+32] = make_color(0, 0, 0); // Menu
PPU_COLOR[128+32] = make_color(15, 15, 15);
PPU_COLOR[129+48] = make_color(0, 0, 0); // Open menu
@@ -134,16 +135,20 @@
PPU_COLOR[129+112] = make_color(12, 12, 12); // Focused widget
PPU_COLOR[128+112] = make_color(24, 24, 24);
+ // Enable controller CTS
+ *PORTC_DIR = 0x89c0;
+ *PORTC_ATTR = 0x89c0;
+ *PORTC_DATA = 0xf77f;
+
// Enable Uart RX (controller input)
*UART_BAUDRATE_LOW = 0xA0;
*UART_BAUDRATE_HIGH = 0xFE;
- *UART_CONTROL = 1 << 6;
+ *UART_CONTROL = 0xc3;
+ *UART_STATUS = 3;
- // Enable controller CTS
- *PORTC_DIR = 1 << 8;
- *PORTC_ATTR = 1 << 8;
- *PORTC_SPECIAL = 3 << 13; // UART Tx and Rx in "special" mode
- *PORTC_DATA = 1 << 8;
+ *PORTC_SPECIAL |= 0x6000; // UART Tx and Rx in "special" mode
+ *PORTC_ATTR |= 0x6000;
+ *PORTC_DIR |= 0x4000;
}
/*-----------------------------------------------------------------------------------*/
@@ -193,15 +198,41 @@
cclear(unsigned char length)
{
memset(vram + cursy * VRAM_WIDTH + cursx, 32, length);
+
+ if (cursx & 1) {
+ vram_attr[(cursy * VRAM_WIDTH + cursx) >> 1] &= 0xff;
+ vram_attr[(cursy * VRAM_WIDTH + cursx) >> 1] |= color << 8;
+ cursx++;
+ length--;
+ }
+
memset(vram_attr + ((cursy * VRAM_WIDTH + cursx) >> 1), (color | color << 8), length >> 1);
cursx += length;
+
+ if (cursx & 1) {
+ vram_attr[(cursy * VRAM_WIDTH + cursx) >> 1] &= 0xff00;
+ vram_attr[(cursy * VRAM_WIDTH + cursx) >> 1] |= color;
+ }
}
/*-----------------------------------------------------------------------------------*/
void
chline(unsigned char length)
{
+ int i;
+
memset(vram + cursy * VRAM_WIDTH + cursx, '-', length);
- memset(vram_attr + ((cursy * VRAM_WIDTH + cursx) >> 1), (color |color << 8), length >> 1);
+
+ // TODO optimize to use memset except for the first/last cell
+ for (i = 0; i < length; i++) {
+ if ((cursx + i) & 1) {
+ vram_attr[(cursy * VRAM_WIDTH + cursx + i) >> 1] &= 0xff;
+ vram_attr[(cursy * VRAM_WIDTH + cursx + i) >> 1] |= color << 8;
+ } else {
+ vram_attr[(cursy * VRAM_WIDTH + cursx + i) >> 1] &= 0xff00;
+ vram_attr[(cursy * VRAM_WIDTH + cursx + i) >> 1] |= color;
+ }
+ }
+
cursx += length;
}
/*-----------------------------------------------------------------------------------*/
diff --git a/contiki-vsmile/ctk/ctk-arch.c b/contiki-vsmile/ctk/ctk-arch.c
index 0ab5a3f..3726775 100644
--- a/contiki-vsmile/ctk/ctk-arch.c
+++ b/contiki-vsmile/ctk/ctk-arch.c
@@ -7,19 +7,33 @@
#include "ctk-arch.h"
#include "libconio.h"
+extern unsigned int vram[];
+
+ctk_arch_key_t key;
+
/* Keyboard management */
ctk_arch_key_t
ctk_arch_getkey(void)
{
- volatile unsigned int* const UART_RX = 0x3D36;
- return *UART_RX;
+ return key;
}
unsigned char kbhit(void)
{
volatile unsigned int* const UART_STATUS = 0x3D31;
+ volatile unsigned int* const UART_RX = 0x3D36;
+ unsigned int tmp;
- return *UART_STATUS & 1;
+ if ((*UART_STATUS & 1) == 0)
+ return 0;
+
+ tmp = *UART_RX;
+ if ((tmp == 0x55) || (tmp == 0xA0) || (tmp == 0x90) || (tmp == 0xC0) || (tmp == 0x80))
+ return 0;
+
+ key = tmp;
+
+ return 1;
}
#if 0
@@ -79,7 +93,6 @@
}
#endif
-extern int vram[];
extern int vram_attr[];
#define VRAM_WIDTH 64
@@ -101,4 +114,4 @@
vram_attr[(y * VRAM_WIDTH + x) / 2] &= 0xff00;
vram_attr[(y * VRAM_WIDTH + x) / 2] |= color;
}
-}
+}
\ No newline at end of file
diff --git a/contiki-vsmile/ctk/ctk-arch.h b/contiki-vsmile/ctk/ctk-arch.h
index bb39abc..7e10340 100644
--- a/contiki-vsmile/ctk/ctk-arch.h
+++ b/contiki-vsmile/ctk/ctk-arch.h
@@ -38,10 +38,10 @@
#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'
+#define CH_CURS_UP 0x87
+#define CH_CURS_LEFT 0xcf
+#define CH_CURS_RIGHT 0xc7
+#define CH_CURS_DOWN 0x8f
// FIXME use the semigraphics
#define CH_ULCORNER '/'
@@ -49,6 +49,7 @@
#define CH_LLCORNER '\\'
#define CH_LRCORNER '/'
+#include "ctk-conio-conf.h"
#include "ctk-conio.h"
#undef ctk_arch_getkey