51 minutes ago, Jesper Gravgaard said:
Hi
@TomXP411 Thank you for trying out KickC. I hope you like it, and would appreciate any feedback from you to improve it!
I have found out why you are getting the "Called procedure not found" error. It is an embarrassing forgotten include. If you add the following line at the top of
lib/cx16-conio.c. then
helloworld.c will compile as it should
#include <veralib.h> In the other included CX16 example programs veralib.h is included in the main C-file, so the compiler is happy.
Let me know, if this works for you. I will of course include the fix in the next release.
Yep, that worked!
There are a couple of other minor nags, but they are not deal breakers:
I'd like to be able to include
-scale 2 in the command line to start the emulator, but when I tried to add that to the platform files, the emulator just didn't start at all...
printf seems to use conio.h, which appears to talk directly to VERA. This works fine when you need performance, but it loses a lot of CHROUT's functinality. No console sequences (ie: cursor movement, etc) and text can't be redirected to an output channel for saving to disk, printing, or RS-232.
It might be nice if printf() used CHROUT to write to the screen, and cprintf used memory I/O to talk to the screen. This would let printf work as expected with PETSCII console sequences, and it would keep the BASIC screen in sync with the text from a C program. This is also, more or less, the standard behavior on PC compilers, and would make the transition easier for people used to that method of doing things.
So my thought was to change the existing printf() definitions, with the VERA functions, to "cprintf" and introduce a new version of the printf functions that uses CHROUT. While this is slower, it will allow printf to be re-directed to a printer, to RS-232, or to a file - all things you can't do with cprintf(). I'd be happy to do the work; I need to brush up on my C, anyway - it's been a while since I've done any real work in ANSI C.
Also... dumb question, but I can't find any file I/O commands. Am I missing something, or do I need to implement the basic file I/O functions?