Jupiter Ace - Dependent Library Functions

Discussion about other targets
Post Reply
Steve(spt)
New member
Posts: 7
Joined: Wed Nov 05, 2008 8:12 pm

Jupiter Ace - Dependent Library Functions

Post by Steve(spt) »

Hello guys,

Can someone tell me how to go about putting together a set of functions for the Ace in a library?

Is any one in control of how it should be done?

example;

How do I in C read one of the Aces System Variables ( or write to it).


KEYCOD 3C26 15398 1 byte. The ASCII code of the last key pressed.


Would the Keycod sys var have to be defined in a C header file so it could be used with C?

would I have to create some Z80 asm to read the keycod and link it ti a C function in some way?

Would it (or other functions) be contained in a .H header file which could be in inclueded as compile time?

Would this be the same to call rom calls?

if I have Ace ROM call at decimal 2589 which clears the screen (CLS) how would this need to be defind, would I have to create a asm
section within the header to the effect of 'CALL 2589'

BTY the CLS call is a real call to the Aces link field to the forth word CLS which runs the Z80 code in the Aces ROM

I only know very small bits of C so creating header file and fuction to be called in new to me, I work in Foth most of the time.

Could someone give me an example please to get me started? Then may be we can imporve support for the Ace and port some new software.

many thanks in advance,
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Welcome !
There are many different methods to get the things you're asking for, the best one depends on how big is the program you're working on.
First, a quick and dirty approach for cls, could just be:

Code: Select all

void ace_cls()
{
#asm
CALL 2589
#endasm
}
Honestly, you shouldn't need a cls, since printing character 12 should do the same.
Functions getting parameters is slightly more difficult, in any case you could have a look here:
http://www.z88dk.org/wiki/doku.php
Search for the "Advanced Topics".

Then, how to interface known memory locations to C ?
Here one way I like very much: look at the ACE version of Death Star,
http://z88dk.cvs.sourceforge.net/viewvc ... iew=markup
Line 45 ...
Post Reply