[Next] [Previous] [Up] [Top] [Contents] [Index]

1.5 Compiling a PSYX

1.5.2 Testing Mode


Using THINK C, the PSYX may be developed within the "PsyScopeTest.xb9 " project for debugging purposes. The project contains a "PsyExtensionxTestTable.c" file, which contains a table matching PSYX names (specified as in the `PSYX' resource name; see "1.2 PSYX Naming") with function pointers. See this file for more instructions on setting up the testing environment.

Because PSYXs compiled into the PsyScope application use the A5 register for their global variables, while stand-alone PSYXs use the A4 register, it is frequently useful to define a macro that indicates whether the code is being compile for testing or stand-alone use. Most of the given examples use have the following

	#define testing 1			// set to 1 for testing, 0 for stand-alone
 

This macro can then be used in such places as VBL tasks and asynchronous i/o completion routines to determine whether the code needs to set up A4 or A5. For example:

static pascal void myVBLTask() {
	
	#if testing
		SetUpA5()
	#else
		SetUpA4()
	#endif

	/* do my VBL stuff using globals here */

	#if testing
		RestoreA5()
	#else
		RestoreA4()
	#endif
}

 


PSYX Programmer's Manual - 24 AUG 95
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with CERN WebMaker