geos-1.html

来自「cc65 的编译器文档」· HTML 代码 · 共 104 行

HTML
104
字号
<!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 pointof view. That's not true. The designers of GEOS created flexible and powerful system, whichis easy to use and program.</P><P>Coding GEOS in C? That's something new. It is possible now - with Ulrich von Bassewitz's cc65package 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 functionsare 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 whenyou 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 otherthan 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 withdefault 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 inGEOS 2.0 so color functions are disabled. Both 40 and 80 columns modes are supportedand automatically detected.</P><P><CODE>tgi</CODE> - TGI driver for GEOS that supports both 40 and 80 columns modes but mode can not bechanged 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>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, ineither 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 bestavailable code (well, the best as for machine :). Many of the <CODE>void foo (void)</CODE> functions arejust raw calls to Kernal (assembled just as <CODE>jsr _foo</CODE>), look in <CODE>gsym.h</CODE>, where youwill find many definitions of standard GEOS locations. Access to these addresses is optimized bycc65 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 ofruning cc65. You will however need c64 or c128 emulator and GEOS image disks (.d64) to test yourprograms.</P><P>The software needed:<UL><LI><EM>cc65</EM> Excellent package containing C crosscompiler, crossassembler and linker, youcan 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, youcan 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 containsc1541 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 transferringobject files from PC to 1541. There's also one important ability of thistool - it automatically un-converts .cvt files into GEOS native format ondisk image files.</LI><LI><EM>cbm4linux</EM> A Linux kernel module that allows for communication with 1541 andother Commodore IEC bus drives. It can be replacement for Star Commander ifyou want only to transfer files to a disk and uncovert using GEOS program forthis 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 onlyneeds 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'sReference 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 areusing GEOSLib - not especially something big and important, mail me even if you are just playingwith 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>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?