           SETTING YOUR PROGRAM'S STACK using _stackinit
           =============================================

Note: by default SNMAIN start-up module does not initialise an
extra stack. By default your program will use the already existing
system stack which is 4Kbytes big.

If you need more stack you should set the _stackinit variable
in your C source code.

eg: put these 2 lines in your main C source file where you have your
global data (usually near the beginning, before any functions) :-

int mystack[4096];
void *_stackinit=&mystack[4096];

In this case the stack pointer is initialised to the top of a 16Kbyte
area of your BSS. (Handy Tip: the BSS is cleared at the start of your
program so putting it here will make it easy to look at the stack in
the debugger and see just how much of it has been used).

Alternatively you can just initialise _stackinit to point to a label
in another section (grouped at start of BSS) of your program and let
the PSYLINK linker fix it up.



             ACCESSING SATURN CD-ROM IN YOUR PROGRAM
             =======================================

You don't need to do any of this unless you're going to access the
Saturn CD drive or Psy-Q CD emulator for CD-ROM data. However, if you
do want to perform CD-ROM access then...


You must perform a PSYQcdinit() in your program to set-up the CD
system before you perform any CD ops. Ideally you will do this right
at the beginning of your program as it can take about 2 seconds.

Alternatively, you can make a little program which just performs this
function and returns. Then run this before you download and run your
main program.

If you use this function you must also ensure that your link
stage includes the CDC library (e.g. add it to stdlib in PSYQ.INI)

When you run PSYQcdinit you should also ensure that there is a CD
in the drive and the door is closed!

function: int PSYQcdinit(void)
passed:   void
performs: init CD. Perform security check. Wait for completion.
returns:  int = CD status (see CDC_ST_ etc in SEGA_CDC.H)

prototype is in LIBSN.H



example usage:-

-----------------------------------------------------------
#include <libsn.h>    /* For Psy-Q prototypes */
#include <sega_cdc.h> /* if you want CDC lib functions */
#include <sega_gfs.h> /* if you want GFS lib functions */

int main()
{
	int	cdstat;

	cdstat = PSYQcdinit();

	if ((cdstat == CDC_ST_OPEN) || (cdstat == CDC_ST_NODISC))
		return -1; /* if it failed! */

	/*... Now you can use CDC and GFS functions ... */
	
}
-----------------------------------------------------------
