![kueller](/assets/img/avatar_default.png)
git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_cc65@4236 504e572c-2e33-0410-9681-be2bf7408885
105 lines
6.0 KiB
HTML
105 lines
6.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20">
|
|
<TITLE>GEOSLib docs: Introduction</TITLE>
|
|
<LINK HREF="geos-2.html" REL=next>
|
|
|
|
<LINK HREF="geos.html#toc1" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
<A HREF="geos-2.html">Next</A>
|
|
Previous
|
|
<A HREF="geos.html#toc1">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="s1">1.</A> <A HREF="geos.html#toc1">Introduction</A></H2>
|
|
|
|
<P>As we all know that the best computers in the world are c64 and c128. They have their GUI too -
|
|
excellent GEOS. GEOS seems very difficult and cryptic for many people, from programmer's point
|
|
of view. That's not true. The designers of GEOS created flexible and powerful system, which
|
|
is easy to use and program.</P>
|
|
<P>Coding GEOS in C? That's something new. It is possible now - with Ulrich von Bassewitz's cc65
|
|
package and my GEOSLib you are able to create GEOS applications in no-time.</P>
|
|
<P>GEOSLib supports a subset of standard cc65 libraries. Whenever possible native Kernal functions
|
|
are used (e.g. <CODE>memset</CODE> is an alias for <CODE>FillRam</CODE>), however not all are supported. E.g.
|
|
string functions like <CODE>strcmp</CODE>, <CODE>strcpy</CODE> are doubled with native <CODE>CmpString</CODE>,
|
|
<CODE>CopyString</CODE> because the latter can handle only 256 byte strings. Keep this in mind when
|
|
you will write your program. If you don't need long strings simply use functions from Kernal,
|
|
resulting code will be smaller.</P>
|
|
<P><CODE>dio</CODE> - direct disk access is available, but you might have problems with devices other
|
|
than 1541, 1571 or 1581. RAM drives emulating these should work.</P>
|
|
<P><CODE>conio</CODE> - simple console input-output is available for command line applications.
|
|
This implementation assumes that one character will fit in 8x8 cell, so output with
|
|
default BSW font, which is has 9 points, might be a bit messy.
|
|
<CODE>cputs</CODE> will output characters with fixed width, for proportional spacing use
|
|
<CODE>cpputs</CODE> but this function does not update cursor. There is no color support in
|
|
GEOS 2.0 so color functions are disabled. Both 40 and 80 columns modes are supported
|
|
and automatically detected.</P>
|
|
<P><CODE>tgi</CODE> - TGI driver for GEOS that supports both 40 and 80 columns modes but mode can not be
|
|
changed between <CODE>tgi_init</CODE> and <CODE>tgi_done</CODE>.</P>
|
|
<P><CODE>joy</CODE> - JOY driver for GEOS supports only joystick, not current pointing device.</P>
|
|
<P>It is safe to use these standard includes and their contents:
|
|
<CODE>assert.h, conio.h, dio.h, errno.h, em.h, geos.h, joystick.h, modload.h, mouse.h, stdlib.h, string.h, tgi.h, time.h</CODE></P>
|
|
<P>For <CODE>time.h</CODE> functions <CODE>systime()</CODE> and <CODE>clock()</CODE> note that the resolution is one second.</P>
|
|
<P>It was not tested enough, but functions from these includes might work under GEOS:
|
|
<CODE>rs232.h, zlib.h</CODE></P>
|
|
<P>Functions from the headers above are either standard C library functions or cc65-specific, in
|
|
either case they are not GEOS specific and so they are not described here.</P>
|
|
<P>I am an assembler programmer and GEOSLib was designed in such way that cc65 could emit the best
|
|
available code (well, the best as for machine :). Many of the <CODE>void foo (void)</CODE> functions are
|
|
just raw calls to Kernal (assembled just as <CODE>jsr _foo</CODE>), look in <CODE>gsym.h</CODE>, where you
|
|
will find many definitions of standard GEOS locations. Access to these addresses is optimized by
|
|
cc65 to simple <CODE>lda</CODE> and <CODE>sta</CODE>. Don't be afraid to use C syntax.</P>
|
|
|
|
<H2><A NAME="ss1.1">1.1</A> <A HREF="geos.html#toc1.1">Requirements</A>
|
|
</H2>
|
|
|
|
<P>You will not need c64 or c128 for development. The only hardware requirement is a PC capable of
|
|
running cc65. You will however need c64 or c128 emulator and GEOS image disks (.d64) to test your
|
|
programs.</P>
|
|
<P>The software needed:
|
|
<UL>
|
|
<LI><EM>cc65</EM> Excellent package containing C crosscompiler, crossassembler and linker, you
|
|
can get it from:
|
|
<A HREF="http://www.von-bassewitz.de/uz/cc65/">http://www.von-bassewitz.de/uz/cc65/</A></LI>
|
|
<LI><EM>VICE</EM> This is portable C64, C128 and few other Commodore computers emulator, you
|
|
can obtain it from:
|
|
<A HREF="http://www.cs.cmu.edu/~dsladic/vice/vice.html">http://www.cs.cmu.edu/~dsladic/vice/vice.html</A>. VICE package contains
|
|
c1541 program that is able to convert/unconvert GEOS files to disk images.</LI>
|
|
<LI><EM>Star Commander</EM> This tool is only for DOS. You will need it for transferring
|
|
object files from PC to 1541. There's also one important ability of this
|
|
tool - it automatically un-converts .cvt files into GEOS native format on
|
|
disk image files.</LI>
|
|
<LI><EM>cbm4linux</EM> A Linux kernel module that allows for communication with 1541 and
|
|
other Commodore IEC bus drives. It can be replacement for Star Commander if
|
|
you want only to transfer files to a disk and unconvert using GEOS program for
|
|
this purpose. Check out:
|
|
<A HREF="http://www.lb.shuttle.de/puffin/cbm4linux/">http://www.lb.shuttle.de/puffin/cbm4linux</A></LI>
|
|
</UL>
|
|
</P>
|
|
<P>VICE and cc65 are portable - they run on variety of platforms - DOS, Win32 and UNIX. GEOSLib only
|
|
needs cc65.</P>
|
|
<P><EM>Update:</EM> starting from v2.5.0 GEOSLib is a part of cc65 package as its GEOS support library.</P>
|
|
|
|
<H2><A NAME="ss1.2">1.2</A> <A HREF="geos.html#toc1.2">Legal</A>
|
|
</H2>
|
|
|
|
<P>I want to thank Uz for his cc65 package, Alexander Boyce for his excellent GEOS Programmer's
|
|
Reference Guide and BSW for GEOS.</P>
|
|
<P>GEOSLib is covered by the same license as cc65. You can find the whole text among documentation.
|
|
I would really appreciate if you would like to send me your comments, suggestions, questions,
|
|
changes, bug reports etc. I will also appreciate if you will just give me a sign that you are
|
|
using GEOSLib - not especially something big and important, mail me even if you are just playing
|
|
with it.</P>
|
|
<P>You can send postcards with hellos to:</P>
|
|
<P>Maciej Witkowiak, ul. Slowackiego 6/57, 77-400 ZLOTOW</P>
|
|
<P>POLAND</P>
|
|
<P>e-mail: <CODE>ytm@elysium.pl</CODE></P>
|
|
|
|
<HR>
|
|
<A HREF="geos-2.html">Next</A>
|
|
Previous
|
|
<A HREF="geos.html#toc1">Contents</A>
|
|
</BODY>
|
|
</HTML>
|