Mercurial > vba-clojure
diff src/win32/VBA.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/win32/VBA.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,274 @@ 1.4 +#if !defined(AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_) 1.5 +#define AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_ 1.6 + 1.7 +#if _MSC_VER > 1000 1.8 +#pragma once 1.9 +#endif // _MSC_VER > 1000 1.10 + 1.11 +/* 1.12 + #ifndef __AFXWIN_H__ 1.13 + #error include 'stdafx.h' before including this file for PCH 1.14 + #endif 1.15 + */ 1.16 + 1.17 +#include <afxtempl.h> 1.18 + 1.19 +#include "AcceleratorManager.h" 1.20 +#include "AVIWrite.h" 1.21 +#include "Display.h" 1.22 +#include "../common/System.h" 1.23 + 1.24 +///////////////////////////////////////////////////////////////////////////// 1.25 +// VBA: 1.26 +// See VBA.cpp for the implementation of this class 1.27 +// 1.28 + 1.29 +enum 1.30 +{ 1.31 + VIDEO_1X, VIDEO_2X, VIDEO_3X, VIDEO_4X, 1.32 + VIDEO_320x240, VIDEO_640x480, VIDEO_800x600, VIDEO_OTHER 1.33 +}; 1.34 + 1.35 +#define REWIND_SIZE 400000 1.36 +#define MAX_REWIND_SLOTS 256 1.37 +#define SCREEN_MESSAGE_SLOTS 8 1.38 + 1.39 +///////////////////////////////////////////////////////////////////////////// 1.40 +// forward decl 1.41 +class IUpdateListener; 1.42 +class Input; 1.43 +class ISound; 1.44 +class AVIWrite; 1.45 +class WavWriter; 1.46 + 1.47 +class VBA : public CWinApp 1.48 +{ 1.49 +public: 1.50 + CMenu m_menu; 1.51 + HMENU menu; 1.52 + HMENU popup; 1.53 + bool mode320Available; 1.54 + bool mode640Available; 1.55 + bool mode800Available; 1.56 + int windowPositionX; 1.57 + int windowPositionY; 1.58 + void (*filterFunction)(u8 *, u32, u8 *, u8 *, u32, int, int); 1.59 + void (*ifbFunction)(u8 *, u32, int, int); 1.60 + int ifbType; 1.61 + int filterType; 1.62 + int filterWidth; 1.63 + int filterHeight; 1.64 + int fsWidth; 1.65 + int fsHeight; 1.66 + int fsColorDepth; 1.67 + bool fsForceChange; 1.68 + bool AsscWithSaveState; 1.69 + int sizeX; 1.70 + int sizeY; 1.71 + int surfaceSizeX; 1.72 + int surfaceSizeY; 1.73 + int videoOption; 1.74 + bool fullScreenStretch; 1.75 + bool disableStatusMessage; 1.76 + int showSpeed; 1.77 + BOOL showSpeedTransparent; 1.78 + int showRenderedFrames; 1.79 + bool screenMessage [SCREEN_MESSAGE_SLOTS]; 1.80 + CString screenMessageBuffer [SCREEN_MESSAGE_SLOTS]; 1.81 + DWORD screenMessageTime [SCREEN_MESSAGE_SLOTS]; 1.82 + int screenMessageDuration [SCREEN_MESSAGE_SLOTS]; 1.83 + CString screenMessageColorBuffer [SCREEN_MESSAGE_SLOTS]; 1.84 + u8 * delta[257 * 244 * 4]; 1.85 + bool menuToggle; 1.86 + IDisplay *display; 1.87 + bool soundInitialized; 1.88 + bool useBiosFile; 1.89 + bool skipBiosFile; 1.90 + CString biosFileName; 1.91 + bool allowLeftRight; 1.92 + bool autofireAccountForLag; 1.93 + bool nextframeAccountForLag; 1.94 + bool active; 1.95 + bool iconic; 1.96 + bool paused; 1.97 + CString recentFiles[10]; 1.98 + bool recentFreeze; 1.99 + bool autoSaveLoadCheatList; 1.100 + bool pauseDuringCheatSearch; 1.101 + bool modelessCheatDialogIsOpen; 1.102 +// FILE * winout; 1.103 +// bool removeIntros; 1.104 + bool autoIPS; 1.105 + int winGbBorderOn; 1.106 + bool hideMovieBorder; 1.107 + int winFlashSize; 1.108 + bool winRtcEnable; 1.109 + int winSaveType; 1.110 + char *rewindMemory; 1.111 + int rewindPos; 1.112 + int rewindTopPos; 1.113 + int rewindCounter; 1.114 + int rewindCount; 1.115 + bool rewindSaveNeeded; 1.116 + int rewindTimer; 1.117 + int rewindSlots; 1.118 + int captureFormat; 1.119 + bool tripleBuffering; 1.120 + bool autoHideMenu; 1.121 + bool speedupToggle; 1.122 + int throttle; 1.123 + u32 throttleLastTime; 1.124 +/// u32 autoFrameSkipLastTime; 1.125 +/// bool autoFrameSkip; 1.126 + bool accuratePitchThrottle; 1.127 + bool vsync; 1.128 + bool changingVideoSize; 1.129 + GUID videoDriverGUID; 1.130 + GUID * pVideoDriverGUID; 1.131 + DISPLAY_TYPE renderMethod; 1.132 + bool ddrawEmulationOnly; 1.133 + bool ddrawUsingEmulationOnly; 1.134 + bool ddrawDebug; 1.135 + bool ddrawUseVideoMemory; 1.136 + int d3dFilter; 1.137 + int glFilter; 1.138 + int glType; 1.139 + bool muteWhenInactive; 1.140 + bool muteFrameAdvance; 1.141 + bool pauseWhenInactive; 1.142 + bool enableBackgroundInput; 1.143 + bool alwaysOnTop; 1.144 + bool useOldSync; 1.145 + bool winGbPrinterEnabled; 1.146 + int threadPriority; 1.147 + bool disableMMX; 1.148 + int languageOption; 1.149 + CString languageName; 1.150 + HINSTANCE languageModule; 1.151 + int renderedFrames; 1.152 + Input * input; 1.153 + int joypadDefault; 1.154 + int autoFire, autoFire2; 1.155 + int autoHold; 1.156 + bool autoFireToggle; 1.157 + bool frameCounter; 1.158 + bool lagCounter; 1.159 + bool extraCounter; 1.160 + bool inputDisplay; 1.161 + bool movieReadOnly; 1.162 + bool movieOnEndPause; 1.163 + int movieOnEndBehavior; 1.164 + bool soundRecording; 1.165 + WavWriter * soundRecorder; 1.166 + CString soundRecordName; 1.167 + ISound * sound; 1.168 + bool aviRecording; 1.169 + AVIWrite * aviRecorder; 1.170 + CString aviRecordName; 1.171 + bool altAviRecordMethod; 1.172 + bool nvVideoLog; 1.173 + bool nvAudioLog; 1.174 + bool painting; // for systemDrawScreen() 1.175 + int mouseCounter; 1.176 + bool winMuteForNow; 1.177 + bool winPauseNextFrame; 1.178 + bool wasPaused; 1.179 + int fsMaxScale; 1.180 + int romSize; 1.181 + bool autoLoadMostRecent; 1.182 + bool loadMakesRecent; 1.183 + bool loadMakesCurrent; 1.184 + bool saveMakesCurrent; 1.185 + int currentSlot; 1.186 + bool showSlotTime; 1.187 + int filenamePreference; 1.188 + int LuaFastForward; 1.189 + bool frameSearching; 1.190 + bool frameSearchSkipping; 1.191 + bool frameSearchFirstStep; 1.192 + bool frameSearchLoadValid; 1.193 + int frameSearchLength; 1.194 + int frameSearchStart; 1.195 + u32 frameSearchOldInput[4]; 1.196 + char * frameSearchMemory; 1.197 + DWORD wmTimerRes; 1.198 + 1.199 + CList<IUpdateListener *, IUpdateListener * &> updateList; 1.200 + int updateCount; 1.201 + 1.202 + CAcceleratorManager winAccelMgr; 1.203 + HACCEL hAccel; 1.204 + 1.205 + RECT rect; 1.206 + RECT dest; 1.207 + 1.208 + struct EmulatedSystem &emulator; 1.209 + 1.210 + CString romFilename; 1.211 + CString gameFilename; 1.212 + CString exeName; 1.213 + CString exeDir; 1.214 + CString wndClass; 1.215 + 1.216 +public: 1.217 + VBA(); 1.218 + ~VBA(); 1.219 + 1.220 + void adjustDestRect(); 1.221 + void recreateMenuBar(); 1.222 + void updateIFB(); 1.223 + void updateFilter(); 1.224 + void updateMenuBar(); 1.225 + void winAddUpdateListener(IUpdateListener *l); 1.226 + void winRemoveUpdateListener(IUpdateListener *l); 1.227 + 1.228 + // Overrides 1.229 + // ClassWizard generated virtual function overrides 1.230 + //{{AFX_VIRTUAL(VBA) 1.231 +public: 1.232 + virtual BOOL InitInstance(); 1.233 + virtual BOOL OnIdle(LONG lCount); 1.234 + //}}AFX_VIRTUAL 1.235 + 1.236 + // Implementation 1.237 +public: 1.238 + HINSTANCE winLoadLanguage(const char *name); 1.239 + void winSetLanguageOption(int option, bool force); 1.240 +#ifdef MMX 1.241 + bool detectMMX(); 1.242 +#endif 1.243 + void updatePriority(); 1.244 + void shutdownDisplay(); 1.245 + void winCheckFullscreen(); 1.246 + bool updateRenderMethod(bool force); 1.247 + bool initDisplay(); 1.248 + void updateWindowSize(int value); 1.249 + void updateVideoSize(UINT id); 1.250 + void updateFrameSkip(); 1.251 + void loadSettings(); 1.252 + void saveSettings(); 1.253 + bool initInput(); 1.254 + void addRecentFile(const CString &file); 1.255 + void saveRewindStateIfNecessary(); 1.256 + //{{AFX_MSG(VBA) 1.257 + afx_msg void OnAppAbout(); 1.258 + // NOTE - the ClassWizard will add and remove member functions here. 1.259 + // DO NOT EDIT what you see in these blocks of generated code ! 1.260 + //}}AFX_MSG 1.261 + DECLARE_MESSAGE_MAP() 1.262 +}; 1.263 + 1.264 +extern VBA theApp; 1.265 + 1.266 +#ifdef MMX 1.267 +extern "C" bool cpu_mmx; 1.268 +#endif 1.269 + 1.270 +extern void DrawTextMessages(u8 *dest, int pitch, int left, int bottom); 1.271 + 1.272 +///////////////////////////////////////////////////////////////////////////// 1.273 + 1.274 +//{{AFX_INSERT_LOCATION}} 1.275 +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 1.276 + 1.277 +#endif // !defined(AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_)