4 #include <eikappui.h>
\r
5 #include <coecntrl.h>
\r
8 #include <MdaAudioOutputStream.h>
\r
9 #include <Mda\Common\Audio.h>
\r
11 #include <aknappUI.h>
\r
14 unsigned char *screen;
\r
15 TPoint point; // Screen to client point
\r
17 TInt scanline_length;
\r
55 enum TPicoControllerMenu
\r
66 ESelectControlsMenu,
\r
94 class CPicoAddCheatDlg:public CEikDialog
\r
97 CPicoAddCheatDlg(TDes8& aCheatCode):iCheatCode(aCheatCode){};
\r
98 ~CPicoAddCheatDlg(){ iEikonEnv->EikAppUi()->RemoveFromStack(this);}
\r
99 TBool OkToExitL(TInt /*aButtonId*/)
\r
101 static_cast<CEikEdwin*>(ControlOrNull(0x2000))->GetText(iUniCheatCode);
\r
102 iCheatCode.Copy(iUniCheatCode);
\r
106 void PreLayoutDynInitL()
\r
108 iEikonEnv->EikAppUi()->AddToStackL(this);
\r
112 TBuf<16> iUniCheatCode;
\r
116 class CPicoDriveDoc:public CAknDocument
\r
119 CPicoDriveDoc(CEikApplication& aApp);
\r
121 CEikAppUi* CreateAppUiL();
\r
124 class CPicoDriveApp:public CAknApplication
\r
129 TUid AppDllUid()const;
\r
130 CApaDocument* CreateDocumentL();
\r
133 * From @c CApaApplication. Opens the .ini file associated with the
\r
134 * application. By default, ini files are not supported by SERIES60
\r
135 * applications. If you want to use an ini file, either override this
\r
136 * function to base call @c CEikApplication::OpenIniFileLC, or call it
\r
138 * @param aFs File server session to use. Not used.
\r
139 * @return Pointer to the dictionary store object representing the
\r
140 * application's .ini file.
\r
142 CDictionaryStore* OpenIniFileLC(RFs& aFs) const;
\r
146 class CQPicoDriveView:public CCoeControl,public MDirectScreenAccess
\r
149 CQPicoDriveView() {};
\r
150 ~CQPicoDriveView();
\r
151 void Draw(const TRect& aRect) const;
\r
153 void PutBitmap(CFbsBitmap* aBitmap,TPoint aPoint,TRect aRect);
\r
154 void Restart(RDirectScreenAccess::TTerminationReasons aReason);
\r
155 void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
\r
156 void DrawText(const TDesC& aText,TPoint aPoint,TBool aHighLight=EFalse,TRgb aTextColour = KRgbWhite);
\r
157 TInt DrawTextInRect(const TDesC& aText,TRect aRect,TInt aStartPos);
\r
159 CDirectScreenAccess* iDsa;
\r
165 class CPicoDriveUi:public CAknAppUi,public MMdaAudioOutputStreamCallback
\r
171 void StartAsynchUpdate();
\r
173 static TInt AsyncUpdateL(TAny* aAppUi);
\r
174 void StartEmulatorL();
\r
175 virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
\r
176 void HandleForegroundEventL(TBool aForeground);
\r
178 void PutMainMenu();
\r
179 void PutScreenSelect();
\r
180 void PutControllerSelect();
\r
181 void PutConfigKeys();
\r
182 void PutSoundSelect();
\r
183 void PutCheatSelect();
\r
184 void PutAbout(TBool iOnlyRedraw = EFalse);
\r
186 // Asynch screen update callback
\r
187 void UpdateScreen();
\r
189 TInt SelectFile(TFileName& aFileName);
\r
190 // Emulation functions
\r
192 void EmulateExit();
\r
193 int EmulateFrame();
\r
196 void CalulateLineStarts();
\r
198 static TInt IdleCallBackStop(TAny* aAppUi);
\r
199 static TInt StartEmulatorL(TAny* aAppUi);
\r
200 // Settings storage
\r
201 void SaveSettingsL();
\r
202 void InternalizeL(const CDictionaryStore& aStore);
\r
203 void ExternalizeL( CDictionaryStore& aStore);
\r
205 // Save state handling
\r
206 int saveLoadGame(int load, int sram);
\r
209 * Calculates the palette table 0-4096
\r
211 void CalculatePaletteTable();
\r
212 CAsyncCallBack iIdleCallBack;
\r
217 TFileName iRomName;
\r
219 TInt iScanCodes[EPicoNoKeys];
\r
221 CDesCArrayFlat* iKeyNames;
\r
222 CDesCArrayFlat* iRegNames;
\r
224 CQPicoDriveView* iView;
\r
225 TInt iResourceFileId;
\r
226 CAsyncCallBack iStartUp;
\r
227 CFbsBitmap* iBackBuffer;
\r
228 TFileName iAppPath;
\r
232 TInt iSndSelection;
\r
233 TInt iCtrlSelection;
\r
234 TInt iCheatSelection;
\r
237 CEikDialog* iCheatDlg;
\r
242 TBool iInterpolate;
\r
244 TBool iEnableSixButtons;
\r
245 TPicoMenus iPicoMenu;
\r
246 CAsyncCallBack iAsyncUpdate;
\r
249 CMdaAudioOutputStream* iSndStream;
\r
250 TMdaAudioDataSettings iAudioSettings;
\r
251 TBuf8<442*2*6> iMonoSound;
\r
253 TBool iEnableSound;
\r
254 TBool iSndRateChanged;
\r
255 TInt iSoundVolume; // 0-10 in 10% percent
\r
256 void MaoscOpenComplete(TInt aError);
\r
257 void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer);
\r
258 void MaoscPlayComplete(TInt aError);
\r
259 // Update the sound output rate
\r
260 TBool UpdatePSndRate();
\r
263 unsigned char *RomData;
\r
264 unsigned int RomSize;
\r
268 int FramesPerSecond;
\r
269 TDisplayMode iDisplayMode;
\r
270 TInt iLastAboutPos;
\r
274 int (*myPicoScan)(unsigned int scan,unsigned short *pal);
\r
275 TBuf<1024> iTempString;
\r
276 // make save filename
\r
277 char saveFname[KMaxFileName];
\r