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 PicoErrNoRomsInArchive,
\r
56 PicoErrGenSnd, // 7 generic sound system error
\r
61 // needed for creating server thread.
\r
62 const TUint KPicoMaxHeapSize=0x00800000;
\r
64 // key config entry (touchpad areas)
\r
65 struct TPicoAreaConfigEntry {
\r
67 //unsigned long actions;
\r
70 struct TPicoKeyConfigEntry
\r
72 unsigned short keyCode;
\r
73 unsigned char scanCode;
\r
74 unsigned char flags; // lsb->msb: key_down, pulse_only, ?, ?, ?, ?, not_configurable, disabled
\r
75 TInt32 handle1; // for CancelCaptureKeyUpAndDowns()
\r
76 TInt32 handle2; // for CancelCaptureKey()
\r
81 // configuration data
\r
85 // void SetDefaults();
\r
86 // void InternalizeL(RReadStream &aStream);
\r
87 // void ExternalizeL(RWriteStream &aStream) const;
\r
89 enum TPicoScreenRotation {
\r
95 enum TPicoScreenMode {
\r
100 enum TPicoFrameSkip {
\r
106 TFileName iLastROMFile; // used as tmp only
\r
110 class CThreadWatcher : public CActive
\r
113 static CThreadWatcher* NewL(const TThreadId& aTid);
\r
116 TThreadId iTid; // thread id
\r
119 CThreadWatcher(const TThreadId& aTid);
\r
122 virtual void RunL();
\r
123 virtual void DoCancel();
\r
127 class CPicoGameSession
\r
130 static TInt Do(const TPicoServRqst what, TAny *param=0);
\r
131 static void freeResources();
\r
133 static TBool iEmuRunning;
\r
134 static TBuf<150> iRomInternalName;
\r
137 // services available
\r
138 static TInt StartEmuThread();
\r
139 static TInt ChangeRunState(TPicoGameState newstate, TPicoGameState newstate_next=(TPicoGameState)0);
\r
140 static TInt loadROM(TPtrC16 *pptr);
\r
141 static TInt changeConfig(TPicoConfig *aConfig);
\r
143 static CThreadWatcher *iThreadWatcher;
\r