From: izydorst Date: Fri, 10 Jan 2003 20:57:46 +0000 (+0000) Subject: GEOS no longer requires explicit exit() call, now explicit MainLoop() is required X-Git-Tag: V2.12.0~1786 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c094dc65c101bbd1177e304b4cc6757ec2755f21;p=cc65 GEOS no longer requires explicit exit() call, now explicit MainLoop() is required git-svn-id: svn://svn.cc65.org/cc65/trunk@1898 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/doc/geos.sgml b/doc/geos.sgml index f60d49a67..ac0d595d2 100644 --- a/doc/geos.sgml +++ b/doc/geos.sgml @@ -111,18 +111,13 @@ e-mail: This chapter describes some rules you ought to obey, and how to use GEOSLib. -General rules -

-Think twice before you use standard C library function. In current implementation almost always -you will get better code using only Usage

Apart from this file, which merely describes only standard GEOS library functions, you should read Usage +and in what order. Please also read cc65's documentation on how to compile C, assembler and link +everything together.

All in all, you just need to place @@ -130,11 +125,6 @@ All in all, you just need to place on top of your source.

-Please read cc65's documentation on how to compile C, assembler and link everything together. -

-GEOSLib building process isn't yet defined stable. Detailed information how to link everything -together is in separated file together with resource compiler documentation. -

As a general rule read the sources of example programs and read the headers. These are the most reliable sources of knowledge ;). You will also find there many C macros representing various arguments passed to functions. Please use them. You will find your sources easier to understand, @@ -146,12 +136,17 @@ Screen coordinates are given in pixels unless stated differently. Notes on style

-All programs start their execution on +For GEOS GUI applications the recommended program structure is to have everything initialized +in Whenever possible use definitions from -Do not try to compile in strict ANSI mode. I'm using some cc65 extensions which are not available in +Do not try to compile in strict ANSI mode. Library uses cc65 extensions which are not available in ANSI. Library Functions @@ -1191,16 +1186,19 @@ do something with IO registers or call one of Kernal's routines.

-Your programs exits to MainLoop upon exiting from EnterDeskTop

-This is default exit code of your application. It is finish of ToBASIC

@@ -1208,6 +1206,7 @@ in other places of application.

This one is another way of finishing application - forcing GEOS to shutdown and exit to BASIC. I was considering whether to include it or not, but maybe someone will need it. Which is I doubt. +It has the same dangerous features as Panic

@@ -1220,7 +1219,8 @@ System error at:xxxx where -System is halted after call to CallRoutine

@@ -1228,14 +1228,15 @@ System is halted after call to This is system caller routine. You need to provide pointer to a function and it will be immediately called, unless the pointer is equal to GetSerialNumber

-This function returns the serial number of system. It might be used for copy-protection, but you -shouldn't do this. Please remember that the Free Software is a true power. +This function returns the serial number of system. It might be used for copy-protection. +However, please remember that the Free Software is a true power and you are using it +right now. GetRandom

diff --git a/libsrc/geos/devel/crt0.s b/libsrc/geos/devel/crt0.s index d43ee0fbf..32ff757b9 100644 --- a/libsrc/geos/devel/crt0.s +++ b/libsrc/geos/devel/crt0.s @@ -54,7 +54,6 @@ cli ldy #4 ; Argument size jsr _main ; call the users code - jmp _MainLoop ; jump to GEOS MainLoop ; Call module destructors. This is also the _exit entry which must be called ; explicitly by the code. diff --git a/libsrc/geos/system/mainloop.s b/libsrc/geos/system/mainloop.s index f90a9f9c8..411294929 100644 --- a/libsrc/geos/system/mainloop.s +++ b/libsrc/geos/system/mainloop.s @@ -1,8 +1,8 @@ ; -; Maciej 'YTM/Alliance' Witkowiak +; Maciej 'YTM/Elysium' Witkowiak ; -; 30.10.99 +; 30.10.1999, 10.01.2003 ; void MainLoop (void); @@ -10,4 +10,5 @@ .include "../inc/jumptab.inc" -_MainLoop = MainLoop \ No newline at end of file +_MainLoop: + jmp MainLoop