// =============================================================================
// SOUNDEFFECTS MODULES A4 GLOBAL STORAGE - VERSION 1.0 - OCTOBER 1994
// ©1994 Alberto Ricci <fricci@polito.it>
// Many thanks to Alessandro Levi Montalcini
// DonŐt forget to send me any cool effect modules you create!
// This text looks best in monaco 9 font, 4 spaces per tab, no wrapping

#ifndef _H_a4globals
#define _H_a4globals

//==============================================================================

	#if defined(powerc) || defined(__powerc) // powerpc
	
		#define MAIN_SETUP_GLOBALS(x)
		#define MAIN_RESTORE_GLOBALS(x)
		#define TEMP_SETUP_GLOBALS(x)
		#define TEMP_RESTORE_GLOBALS(x)
	
	#elif defined(THINK_C) // think c
	
		#include <SetUpA4.h>
		#define MAIN_SETUP_GLOBALS(x)	{ RememberA0(); SetUpA4(); asm { MOVE.L (A7)+, x } }
		#define MAIN_RESTORE_GLOBALS(x)	{ asm { MOVE.L x, -(A7) } RestoreA4(); }
		#define TEMP_SETUP_GLOBALS(x)	{ SetUpA4(); asm { MOVE.L (A7)+, x } }
		#define TEMP_RESTORE_GLOBALS(x)	{ asm { MOVE.L x, -(A7) } RestoreA4(); }
	
	#elif defined(__MWERKS__) // code warrior
	
		#include <A4Stuff.h>
		#include <SetUpA4.h>
		#define MAIN_SETUP_GLOBALS(x)	{ x = SetCurrentA4(); RememberA4(); }
		#define MAIN_RESTORE_GLOBALS(x)	{ (void)SetA4(x); }
		#define TEMP_SETUP_GLOBALS(x)	{ x = SetUpA4(); }
		#define TEMP_RESTORE_GLOBALS(x)	{ (void)RestoreA4(x); }
	
	#else // unknown compiler, stop here
	
		*** unsupported compiler ! ***
	
	#endif // end of compiler-specific stuff

//==============================================================================

#endif // _H_a4globals
