1 /*******************************************************************
\r
5 * Author: Peter van Sebille (peter@yipton.net)
\r
7 * Modified/adapted for picodriveN by notaz, 2006
\r
9 * (c) Copyright 2006, notaz
\r
10 * (c) Copyright 2002, Peter van Sebille
\r
11 * All Rights Reserved
\r
13 *******************************************************************/
\r
18 #include <e32base.h>
\r
25 enum TPicoGameState {
\r
34 enum TPicoServRqst {
\r
43 PicoMsgConfigChange,
\r
45 kDefaultMessageSlots // this is how many messages we need :)
\r
48 enum TPicoGenErrors { // generic errors
\r
49 PicoErrNoErr = 0, // OK
\r
50 PicoErrRomOpenFailed,
\r
53 PicoErrGenSnd, // generic sound system error
\r
58 // needed for creating server thread.
\r
59 const TUint KPicoMaxHeapSize=0x00800000;
\r
61 // key config entry (touchpad areas)
\r
62 struct TPicoAreaConfigEntry {
\r
64 //unsigned long actions;
\r
67 struct TPicoKeyConfigEntry
\r
69 unsigned short keyCode;
\r
70 unsigned char scanCode;
\r
71 unsigned char flags; // lsb->msb: key_down, pulse_only, ?, ?, ?, ?, not_configurable, disabled
\r
72 TInt32 handle1; // for CancelCaptureKeyUpAndDowns()
\r
73 TInt32 handle2; // for CancelCaptureKey()
\r
78 // configuration data
\r
82 // void SetDefaults();
\r
83 // void InternalizeL(RReadStream &aStream);
\r
84 // void ExternalizeL(RWriteStream &aStream) const;
\r
86 enum TPicoScreenRotation {
\r
92 enum TPicoScreenMode {
\r
97 enum TPicoFrameSkip {
\r
103 TFileName iLastROMFile; // used as tmp only
\r
107 class CThreadWatcher : public CActive
\r
110 static CThreadWatcher* NewL(const TThreadId& aTid);
\r
113 TThreadId iTid; // thread id
\r
116 CThreadWatcher(const TThreadId& aTid);
\r
119 virtual void RunL();
\r
120 virtual void DoCancel();
\r
124 class CPicoGameSession
\r
127 static TInt Do(const TPicoServRqst what, TAny *param=0);
\r
128 static void freeResources();
\r
130 static TBool iEmuRunning;
\r
131 static TBuf<150> iRomInternalName;
\r
134 // services available
\r
135 static TInt StartEmuThread();
\r
136 static TInt ChangeRunState(TPicoGameState newstate, TPicoGameState newstate_next=(TPicoGameState)0);
\r
137 static TInt loadROM(TPtrC16 *pptr);
\r
138 static TInt changeConfig(TPicoConfig *aConfig);
\r
140 static CThreadWatcher *iThreadWatcher;
\r