retrohackers.org
http://retrohackers.org/

C64, cc65 and cscanf
http://retrohackers.org/viewtopic.php?f=4&t=316
Page 1 of 1

Author:  Nappe1 [ Fri Dec 14, 2007 9:12 am ]
Post subject:  C64, cc65 and cscanf

Hello,
As with being coming with Big Blue land and with minor C (major C++ and Pascal / Delphi) experience, I decided to give a try to cc65, as at it is still closer than ASM to my knowledge. (I do have a bit of experience with C64, but that was in '89-93 and I only worked with Basic V2 / Simons Basic / Simons Basic Extensions. and even though the last one had huge possibilities, like having sprites moving with raster interrupts, it was still complete different world.)

Anyways, I started with very simple program and needed to get few chars (more than one) off the keyboard. I decided to use conio instead of stdio, it being a bit faster and my program being single screen tool application. So, I looked at the header files and found cscanf that should be working like scanf, just with direct keyboard input. however, when I compile/link, I get unresolved external on this, so is it really supported on C64 platform? if not, is there any other way than just make my own function using cgetc?

thanks for replies forehand...

Author:  RaveGuru [ Thu Dec 20, 2007 7:21 pm ]
Post subject: 

Hello and welcome to the club! :)

First of all you must link your c64 projects with c64.o and c64.lib. The order on the command line seems to matter, so this is the order i'm using:

ld65 -C config.txt -L{CC65}lib -o main.o {CC65}lib\c64.o main.c c64.lib

..where {CC65} is the full path to your CC65 directory.

Hope this helps!

RG

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/