rlm@1: #if !defined(AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_) rlm@1: #define AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_ rlm@1: rlm@1: #if _MSC_VER > 1000 rlm@1: #pragma once rlm@1: #endif // _MSC_VER > 1000 rlm@1: rlm@1: /* rlm@1: #ifndef __AFXWIN_H__ rlm@1: #error include 'stdafx.h' before including this file for PCH rlm@1: #endif rlm@1: */ rlm@1: rlm@1: #include rlm@1: rlm@1: #include "AcceleratorManager.h" rlm@1: #include "AVIWrite.h" rlm@1: #include "Display.h" rlm@1: #include "../common/System.h" rlm@1: rlm@1: ///////////////////////////////////////////////////////////////////////////// rlm@1: // VBA: rlm@1: // See VBA.cpp for the implementation of this class rlm@1: // rlm@1: rlm@1: enum rlm@1: { rlm@1: VIDEO_1X, VIDEO_2X, VIDEO_3X, VIDEO_4X, rlm@1: VIDEO_320x240, VIDEO_640x480, VIDEO_800x600, VIDEO_OTHER rlm@1: }; rlm@1: rlm@1: #define REWIND_SIZE 400000 rlm@1: #define MAX_REWIND_SLOTS 256 rlm@1: #define SCREEN_MESSAGE_SLOTS 8 rlm@1: rlm@1: ///////////////////////////////////////////////////////////////////////////// rlm@1: // forward decl rlm@1: class IUpdateListener; rlm@1: class Input; rlm@1: class ISound; rlm@1: class AVIWrite; rlm@1: class WavWriter; rlm@1: rlm@1: class VBA : public CWinApp rlm@1: { rlm@1: public: rlm@1: CMenu m_menu; rlm@1: HMENU menu; rlm@1: HMENU popup; rlm@1: bool mode320Available; rlm@1: bool mode640Available; rlm@1: bool mode800Available; rlm@1: int windowPositionX; rlm@1: int windowPositionY; rlm@1: void (*filterFunction)(u8 *, u32, u8 *, u8 *, u32, int, int); rlm@1: void (*ifbFunction)(u8 *, u32, int, int); rlm@1: int ifbType; rlm@1: int filterType; rlm@1: int filterWidth; rlm@1: int filterHeight; rlm@1: int fsWidth; rlm@1: int fsHeight; rlm@1: int fsColorDepth; rlm@1: bool fsForceChange; rlm@1: bool AsscWithSaveState; rlm@1: int sizeX; rlm@1: int sizeY; rlm@1: int surfaceSizeX; rlm@1: int surfaceSizeY; rlm@1: int videoOption; rlm@1: bool fullScreenStretch; rlm@1: bool disableStatusMessage; rlm@1: int showSpeed; rlm@1: BOOL showSpeedTransparent; rlm@1: int showRenderedFrames; rlm@1: bool screenMessage [SCREEN_MESSAGE_SLOTS]; rlm@1: CString screenMessageBuffer [SCREEN_MESSAGE_SLOTS]; rlm@1: DWORD screenMessageTime [SCREEN_MESSAGE_SLOTS]; rlm@1: int screenMessageDuration [SCREEN_MESSAGE_SLOTS]; rlm@1: CString screenMessageColorBuffer [SCREEN_MESSAGE_SLOTS]; rlm@1: u8 * delta[257 * 244 * 4]; rlm@1: bool menuToggle; rlm@1: IDisplay *display; rlm@1: bool soundInitialized; rlm@1: bool useBiosFile; rlm@1: bool skipBiosFile; rlm@1: CString biosFileName; rlm@1: bool allowLeftRight; rlm@1: bool autofireAccountForLag; rlm@1: bool nextframeAccountForLag; rlm@1: bool active; rlm@1: bool iconic; rlm@1: bool paused; rlm@1: CString recentFiles[10]; rlm@1: bool recentFreeze; rlm@1: bool autoSaveLoadCheatList; rlm@1: bool pauseDuringCheatSearch; rlm@1: bool modelessCheatDialogIsOpen; rlm@1: // FILE * winout; rlm@1: // bool removeIntros; rlm@1: bool autoIPS; rlm@1: int winGbBorderOn; rlm@1: bool hideMovieBorder; rlm@1: int winFlashSize; rlm@1: bool winRtcEnable; rlm@1: int winSaveType; rlm@1: char *rewindMemory; rlm@1: int rewindPos; rlm@1: int rewindTopPos; rlm@1: int rewindCounter; rlm@1: int rewindCount; rlm@1: bool rewindSaveNeeded; rlm@1: int rewindTimer; rlm@1: int rewindSlots; rlm@1: int captureFormat; rlm@1: bool tripleBuffering; rlm@1: bool autoHideMenu; rlm@1: bool speedupToggle; rlm@1: int throttle; rlm@1: u32 throttleLastTime; rlm@1: /// u32 autoFrameSkipLastTime; rlm@1: /// bool autoFrameSkip; rlm@1: bool accuratePitchThrottle; rlm@1: bool vsync; rlm@1: bool changingVideoSize; rlm@1: GUID videoDriverGUID; rlm@1: GUID * pVideoDriverGUID; rlm@1: DISPLAY_TYPE renderMethod; rlm@1: bool ddrawEmulationOnly; rlm@1: bool ddrawUsingEmulationOnly; rlm@1: bool ddrawDebug; rlm@1: bool ddrawUseVideoMemory; rlm@1: int d3dFilter; rlm@1: int glFilter; rlm@1: int glType; rlm@1: bool muteWhenInactive; rlm@1: bool muteFrameAdvance; rlm@1: bool pauseWhenInactive; rlm@1: bool enableBackgroundInput; rlm@1: bool alwaysOnTop; rlm@1: bool useOldSync; rlm@1: bool winGbPrinterEnabled; rlm@1: int threadPriority; rlm@1: bool disableMMX; rlm@1: int languageOption; rlm@1: CString languageName; rlm@1: HINSTANCE languageModule; rlm@1: int renderedFrames; rlm@1: Input * input; rlm@1: int joypadDefault; rlm@1: int autoFire, autoFire2; rlm@1: int autoHold; rlm@1: bool autoFireToggle; rlm@1: bool frameCounter; rlm@1: bool lagCounter; rlm@1: bool extraCounter; rlm@1: bool inputDisplay; rlm@1: bool movieReadOnly; rlm@1: bool movieOnEndPause; rlm@1: int movieOnEndBehavior; rlm@1: bool soundRecording; rlm@1: WavWriter * soundRecorder; rlm@1: CString soundRecordName; rlm@1: ISound * sound; rlm@1: bool aviRecording; rlm@1: AVIWrite * aviRecorder; rlm@1: CString aviRecordName; rlm@1: bool altAviRecordMethod; rlm@1: bool nvVideoLog; rlm@1: bool nvAudioLog; rlm@1: bool painting; // for systemDrawScreen() rlm@1: int mouseCounter; rlm@1: bool winMuteForNow; rlm@1: bool winPauseNextFrame; rlm@1: bool wasPaused; rlm@1: int fsMaxScale; rlm@1: int romSize; rlm@1: bool autoLoadMostRecent; rlm@1: bool loadMakesRecent; rlm@1: bool loadMakesCurrent; rlm@1: bool saveMakesCurrent; rlm@1: int currentSlot; rlm@1: bool showSlotTime; rlm@1: int filenamePreference; rlm@1: int LuaFastForward; rlm@1: bool frameSearching; rlm@1: bool frameSearchSkipping; rlm@1: bool frameSearchFirstStep; rlm@1: bool frameSearchLoadValid; rlm@1: int frameSearchLength; rlm@1: int frameSearchStart; rlm@1: u32 frameSearchOldInput[4]; rlm@1: char * frameSearchMemory; rlm@1: DWORD wmTimerRes; rlm@1: rlm@1: CList updateList; rlm@1: int updateCount; rlm@1: rlm@1: CAcceleratorManager winAccelMgr; rlm@1: HACCEL hAccel; rlm@1: rlm@1: RECT rect; rlm@1: RECT dest; rlm@1: rlm@1: struct EmulatedSystem &emulator; rlm@1: rlm@1: CString romFilename; rlm@1: CString gameFilename; rlm@1: CString exeName; rlm@1: CString exeDir; rlm@1: CString wndClass; rlm@1: rlm@1: public: rlm@1: VBA(); rlm@1: ~VBA(); rlm@1: rlm@1: void adjustDestRect(); rlm@1: void recreateMenuBar(); rlm@1: void updateIFB(); rlm@1: void updateFilter(); rlm@1: void updateMenuBar(); rlm@1: void winAddUpdateListener(IUpdateListener *l); rlm@1: void winRemoveUpdateListener(IUpdateListener *l); rlm@1: rlm@1: // Overrides rlm@1: // ClassWizard generated virtual function overrides rlm@1: //{{AFX_VIRTUAL(VBA) rlm@1: public: rlm@1: virtual BOOL InitInstance(); rlm@1: virtual BOOL OnIdle(LONG lCount); rlm@1: //}}AFX_VIRTUAL rlm@1: rlm@1: // Implementation rlm@1: public: rlm@1: HINSTANCE winLoadLanguage(const char *name); rlm@1: void winSetLanguageOption(int option, bool force); rlm@1: #ifdef MMX rlm@1: bool detectMMX(); rlm@1: #endif rlm@1: void updatePriority(); rlm@1: void shutdownDisplay(); rlm@1: void winCheckFullscreen(); rlm@1: bool updateRenderMethod(bool force); rlm@1: bool initDisplay(); rlm@1: void updateWindowSize(int value); rlm@1: void updateVideoSize(UINT id); rlm@1: void updateFrameSkip(); rlm@1: void loadSettings(); rlm@1: void saveSettings(); rlm@1: bool initInput(); rlm@1: void addRecentFile(const CString &file); rlm@1: void saveRewindStateIfNecessary(); rlm@1: //{{AFX_MSG(VBA) rlm@1: afx_msg void OnAppAbout(); rlm@1: // NOTE - the ClassWizard will add and remove member functions here. rlm@1: // DO NOT EDIT what you see in these blocks of generated code ! rlm@1: //}}AFX_MSG rlm@1: DECLARE_MESSAGE_MAP() rlm@1: }; rlm@1: rlm@1: extern VBA theApp; rlm@1: rlm@1: #ifdef MMX rlm@1: extern "C" bool cpu_mmx; rlm@1: #endif rlm@1: rlm@1: extern void DrawTextMessages(u8 *dest, int pitch, int left, int bottom); rlm@1: rlm@1: ///////////////////////////////////////////////////////////////////////////// rlm@1: rlm@1: //{{AFX_INSERT_LOCATION}} rlm@1: // Microsoft Visual C++ will insert additional declarations immediately before the previous line. rlm@1: rlm@1: #endif // !defined(AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_)