#ifndef h_PNOMain_h
#define h_PNOMain_h

#include "pnobridge.h"

#define TTD_HANDLE_EVENT_NOFUNC()  {\
		EventType myevent; \
		while ( SysEventAvail()) {\
		  	SysEventGet(&myevent,0); \
			if (myevent.eType==nilEvent) break; \
			switch (myevent.eType){\
				case appStopEvent:break;\
				case frmUpdateEvent:break;\
				case penDownEvent:break;\
				case penUpEvent:break;\
				case penMoveEvent:break;\
				case keyDownEvent:break;\
				case keyUpEvent:break;\
				case keyHoldEvent:break;\
				case winEnterEvent:\
				case winExitEvent:\
				SysHandleEvent(&myevent);break;\
				default:{\
					SysHandleEvent(&myevent);\
				}\
			}\
		}\
		}  


extern UInt16 ticks_per_sec;
extern pnobridge_t *g_pnobridge;
extern const void *g_my_emulStateP;
extern UInt16 display_pitch,display_height,display_width;

Err stub_SndStreamCreateExtended(	SndStreamRef *channel,	/* channel-ID is stored here */
	SndStreamMode mode,		/* input/output, enum */
	SndFormatType format,	/* enum, e.g., sndFormatMP3 */
	UInt32 samplerate,		/* in frames/second, e.g. 44100, 48000 */
	SndSampleType type,		/* enum, e.g. sndInt16, if applicable, or 0 otherwise */
	SndStreamWidth width,	/* enum, e.g. sndMono */
	SndStreamVariableBufferCallback func,	/* function that gets called to fill a buffer */
	void *userdata,			/* gets passed in to the above function */
	UInt32 buffsize,			/* preferred buffersize, use 0 for default */
	Boolean armNative);			/* true if callback is arm native */
	
Err stub_SndStreamCreate(SndStreamRef *channel,	/* channel-ID is stored here */
						SndStreamMode mode,			/* input/output, enum */
						UInt32 samplerate,				/* in frames/second, e.g. 44100, 48000 */
						SndSampleType type,				/* enum, e.g. sndInt16 */
						SndStreamWidth width,			/* enum, e.g. sndMono */
						SndStreamBufferCallback func,	/* function that gets called to fill a buffer */
						void *userdata,					/* gets passed in to the above function */
						UInt32 buffsize,				/* preferred buffersize in frames, not guaranteed, use 0 for default */
						Boolean armNative);
Err stub_SndStreamDelete(SndStreamRef channel);
Err stub_SndStreamStart(SndStreamRef channel);
Err stub_SndStreamStop(SndStreamRef channel);
Err stub_SndStreamSetVolume(SndStreamRef channel, Int32 volume);
Err stub_SndStreamGetVolume(SndStreamRef channel, Int32 *volume);
Err stub_DrawBeltBar(void);

void stub_fullscreen(int fs);
UInt32 stubzodiacblit ( UInt32 mode, UInt32 w,UInt32 h,UInt32 s );
UInt32 stub_BatteryInfo(void);

#endif
