[cc65] Please be patient... More questions

From: Payton Byrd <plbyrd1gmail.com>
Date: 2010-04-22 04:30:03
I have so much to learn about CC65, so please be patient with me as Google
doesn't return much about CC65.

So, my next question is two-fold.  I have found the c128.h header has the
methods I'm looking for to change the video mode and to set the speed of the
system.  However, what it doesn't have is a method to tell me the current
video mode.  I don't want to force a video mode on the user when they start
the application, I want to read the current mode and scale accordingly.

So, after some digging in the C128 PRG, I found the SCRORG kernel routine
which does exactly what I want.  It takes the current mode and places it in
the accumulator.  Superb.  Now, I want to create a method to call the kernel
routine and return the value in the accumulator such as:

unsigned char getScreenSize(void);

I realize this will require some inline assembler.  This is where my
question comes in.  How do I do inline assembler.  I Googled for over an
hour and couldn't find a single example, just vague references to it.  I
know I've seen an example in the past, and I'm pretty sure it was on this
mailing list, but I no longer have an archive of the list and Google doesn't
seem to have an archive of it either. I also scoured the libsrc directory of
the sources but I couldn't find a c128.c file to correspond to the c128.h
file.  So I'm assuming that the various assembler files are somehow glued
together to the c128.h file by the linker, but I don't know enough about
assembler to go that route yet.

Would someone mind posting an example of creating a method that utilizes
inline assembler to call a kernel routine?

Thanks!

PS.  This is the kind of stuff that would be great for the wiki, as well as
things like my adventures in makefile creation.  I also have some very
valuable insights on using VS 2010 as a full-blown IDE for cc65 (I have
everything working except intellisense).

-- 
Payton Byrd
<http://www.paytonbyrd.com>
<http://it.toolbox.com/blogs/paytonbyrd>

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Apr 22 04:30:30 2010

This archive was generated by hypermail 2.1.8 : 2010-04-22 04:30:34 CEST