annotate src/win32/VBA.h @ 2:3549bbe597ed

adding makefile.am
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:47 -0600
parents f9f4f1b99eed
children
rev   line source
rlm@1 1 #if !defined(AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_)
rlm@1 2 #define AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_
rlm@1 3
rlm@1 4 #if _MSC_VER > 1000
rlm@1 5 #pragma once
rlm@1 6 #endif // _MSC_VER > 1000
rlm@1 7
rlm@1 8 /*
rlm@1 9 #ifndef __AFXWIN_H__
rlm@1 10 #error include 'stdafx.h' before including this file for PCH
rlm@1 11 #endif
rlm@1 12 */
rlm@1 13
rlm@1 14 #include <afxtempl.h>
rlm@1 15
rlm@1 16 #include "AcceleratorManager.h"
rlm@1 17 #include "AVIWrite.h"
rlm@1 18 #include "Display.h"
rlm@1 19 #include "../common/System.h"
rlm@1 20
rlm@1 21 /////////////////////////////////////////////////////////////////////////////
rlm@1 22 // VBA:
rlm@1 23 // See VBA.cpp for the implementation of this class
rlm@1 24 //
rlm@1 25
rlm@1 26 enum
rlm@1 27 {
rlm@1 28 VIDEO_1X, VIDEO_2X, VIDEO_3X, VIDEO_4X,
rlm@1 29 VIDEO_320x240, VIDEO_640x480, VIDEO_800x600, VIDEO_OTHER
rlm@1 30 };
rlm@1 31
rlm@1 32 #define REWIND_SIZE 400000
rlm@1 33 #define MAX_REWIND_SLOTS 256
rlm@1 34 #define SCREEN_MESSAGE_SLOTS 8
rlm@1 35
rlm@1 36 /////////////////////////////////////////////////////////////////////////////
rlm@1 37 // forward decl
rlm@1 38 class IUpdateListener;
rlm@1 39 class Input;
rlm@1 40 class ISound;
rlm@1 41 class AVIWrite;
rlm@1 42 class WavWriter;
rlm@1 43
rlm@1 44 class VBA : public CWinApp
rlm@1 45 {
rlm@1 46 public:
rlm@1 47 CMenu m_menu;
rlm@1 48 HMENU menu;
rlm@1 49 HMENU popup;
rlm@1 50 bool mode320Available;
rlm@1 51 bool mode640Available;
rlm@1 52 bool mode800Available;
rlm@1 53 int windowPositionX;
rlm@1 54 int windowPositionY;
rlm@1 55 void (*filterFunction)(u8 *, u32, u8 *, u8 *, u32, int, int);
rlm@1 56 void (*ifbFunction)(u8 *, u32, int, int);
rlm@1 57 int ifbType;
rlm@1 58 int filterType;
rlm@1 59 int filterWidth;
rlm@1 60 int filterHeight;
rlm@1 61 int fsWidth;
rlm@1 62 int fsHeight;
rlm@1 63 int fsColorDepth;
rlm@1 64 bool fsForceChange;
rlm@1 65 bool AsscWithSaveState;
rlm@1 66 int sizeX;
rlm@1 67 int sizeY;
rlm@1 68 int surfaceSizeX;
rlm@1 69 int surfaceSizeY;
rlm@1 70 int videoOption;
rlm@1 71 bool fullScreenStretch;
rlm@1 72 bool disableStatusMessage;
rlm@1 73 int showSpeed;
rlm@1 74 BOOL showSpeedTransparent;
rlm@1 75 int showRenderedFrames;
rlm@1 76 bool screenMessage [SCREEN_MESSAGE_SLOTS];
rlm@1 77 CString screenMessageBuffer [SCREEN_MESSAGE_SLOTS];
rlm@1 78 DWORD screenMessageTime [SCREEN_MESSAGE_SLOTS];
rlm@1 79 int screenMessageDuration [SCREEN_MESSAGE_SLOTS];
rlm@1 80 CString screenMessageColorBuffer [SCREEN_MESSAGE_SLOTS];
rlm@1 81 u8 * delta[257 * 244 * 4];
rlm@1 82 bool menuToggle;
rlm@1 83 IDisplay *display;
rlm@1 84 bool soundInitialized;
rlm@1 85 bool useBiosFile;
rlm@1 86 bool skipBiosFile;
rlm@1 87 CString biosFileName;
rlm@1 88 bool allowLeftRight;
rlm@1 89 bool autofireAccountForLag;
rlm@1 90 bool nextframeAccountForLag;
rlm@1 91 bool active;
rlm@1 92 bool iconic;
rlm@1 93 bool paused;
rlm@1 94 CString recentFiles[10];
rlm@1 95 bool recentFreeze;
rlm@1 96 bool autoSaveLoadCheatList;
rlm@1 97 bool pauseDuringCheatSearch;
rlm@1 98 bool modelessCheatDialogIsOpen;
rlm@1 99 // FILE * winout;
rlm@1 100 // bool removeIntros;
rlm@1 101 bool autoIPS;
rlm@1 102 int winGbBorderOn;
rlm@1 103 bool hideMovieBorder;
rlm@1 104 int winFlashSize;
rlm@1 105 bool winRtcEnable;
rlm@1 106 int winSaveType;
rlm@1 107 char *rewindMemory;
rlm@1 108 int rewindPos;
rlm@1 109 int rewindTopPos;
rlm@1 110 int rewindCounter;
rlm@1 111 int rewindCount;
rlm@1 112 bool rewindSaveNeeded;
rlm@1 113 int rewindTimer;
rlm@1 114 int rewindSlots;
rlm@1 115 int captureFormat;
rlm@1 116 bool tripleBuffering;
rlm@1 117 bool autoHideMenu;
rlm@1 118 bool speedupToggle;
rlm@1 119 int throttle;
rlm@1 120 u32 throttleLastTime;
rlm@1 121 /// u32 autoFrameSkipLastTime;
rlm@1 122 /// bool autoFrameSkip;
rlm@1 123 bool accuratePitchThrottle;
rlm@1 124 bool vsync;
rlm@1 125 bool changingVideoSize;
rlm@1 126 GUID videoDriverGUID;
rlm@1 127 GUID * pVideoDriverGUID;
rlm@1 128 DISPLAY_TYPE renderMethod;
rlm@1 129 bool ddrawEmulationOnly;
rlm@1 130 bool ddrawUsingEmulationOnly;
rlm@1 131 bool ddrawDebug;
rlm@1 132 bool ddrawUseVideoMemory;
rlm@1 133 int d3dFilter;
rlm@1 134 int glFilter;
rlm@1 135 int glType;
rlm@1 136 bool muteWhenInactive;
rlm@1 137 bool muteFrameAdvance;
rlm@1 138 bool pauseWhenInactive;
rlm@1 139 bool enableBackgroundInput;
rlm@1 140 bool alwaysOnTop;
rlm@1 141 bool useOldSync;
rlm@1 142 bool winGbPrinterEnabled;
rlm@1 143 int threadPriority;
rlm@1 144 bool disableMMX;
rlm@1 145 int languageOption;
rlm@1 146 CString languageName;
rlm@1 147 HINSTANCE languageModule;
rlm@1 148 int renderedFrames;
rlm@1 149 Input * input;
rlm@1 150 int joypadDefault;
rlm@1 151 int autoFire, autoFire2;
rlm@1 152 int autoHold;
rlm@1 153 bool autoFireToggle;
rlm@1 154 bool frameCounter;
rlm@1 155 bool lagCounter;
rlm@1 156 bool extraCounter;
rlm@1 157 bool inputDisplay;
rlm@1 158 bool movieReadOnly;
rlm@1 159 bool movieOnEndPause;
rlm@1 160 int movieOnEndBehavior;
rlm@1 161 bool soundRecording;
rlm@1 162 WavWriter * soundRecorder;
rlm@1 163 CString soundRecordName;
rlm@1 164 ISound * sound;
rlm@1 165 bool aviRecording;
rlm@1 166 AVIWrite * aviRecorder;
rlm@1 167 CString aviRecordName;
rlm@1 168 bool altAviRecordMethod;
rlm@1 169 bool nvVideoLog;
rlm@1 170 bool nvAudioLog;
rlm@1 171 bool painting; // for systemDrawScreen()
rlm@1 172 int mouseCounter;
rlm@1 173 bool winMuteForNow;
rlm@1 174 bool winPauseNextFrame;
rlm@1 175 bool wasPaused;
rlm@1 176 int fsMaxScale;
rlm@1 177 int romSize;
rlm@1 178 bool autoLoadMostRecent;
rlm@1 179 bool loadMakesRecent;
rlm@1 180 bool loadMakesCurrent;
rlm@1 181 bool saveMakesCurrent;
rlm@1 182 int currentSlot;
rlm@1 183 bool showSlotTime;
rlm@1 184 int filenamePreference;
rlm@1 185 int LuaFastForward;
rlm@1 186 bool frameSearching;
rlm@1 187 bool frameSearchSkipping;
rlm@1 188 bool frameSearchFirstStep;
rlm@1 189 bool frameSearchLoadValid;
rlm@1 190 int frameSearchLength;
rlm@1 191 int frameSearchStart;
rlm@1 192 u32 frameSearchOldInput[4];
rlm@1 193 char * frameSearchMemory;
rlm@1 194 DWORD wmTimerRes;
rlm@1 195
rlm@1 196 CList<IUpdateListener *, IUpdateListener * &> updateList;
rlm@1 197 int updateCount;
rlm@1 198
rlm@1 199 CAcceleratorManager winAccelMgr;
rlm@1 200 HACCEL hAccel;
rlm@1 201
rlm@1 202 RECT rect;
rlm@1 203 RECT dest;
rlm@1 204
rlm@1 205 struct EmulatedSystem &emulator;
rlm@1 206
rlm@1 207 CString romFilename;
rlm@1 208 CString gameFilename;
rlm@1 209 CString exeName;
rlm@1 210 CString exeDir;
rlm@1 211 CString wndClass;
rlm@1 212
rlm@1 213 public:
rlm@1 214 VBA();
rlm@1 215 ~VBA();
rlm@1 216
rlm@1 217 void adjustDestRect();
rlm@1 218 void recreateMenuBar();
rlm@1 219 void updateIFB();
rlm@1 220 void updateFilter();
rlm@1 221 void updateMenuBar();
rlm@1 222 void winAddUpdateListener(IUpdateListener *l);
rlm@1 223 void winRemoveUpdateListener(IUpdateListener *l);
rlm@1 224
rlm@1 225 // Overrides
rlm@1 226 // ClassWizard generated virtual function overrides
rlm@1 227 //{{AFX_VIRTUAL(VBA)
rlm@1 228 public:
rlm@1 229 virtual BOOL InitInstance();
rlm@1 230 virtual BOOL OnIdle(LONG lCount);
rlm@1 231 //}}AFX_VIRTUAL
rlm@1 232
rlm@1 233 // Implementation
rlm@1 234 public:
rlm@1 235 HINSTANCE winLoadLanguage(const char *name);
rlm@1 236 void winSetLanguageOption(int option, bool force);
rlm@1 237 #ifdef MMX
rlm@1 238 bool detectMMX();
rlm@1 239 #endif
rlm@1 240 void updatePriority();
rlm@1 241 void shutdownDisplay();
rlm@1 242 void winCheckFullscreen();
rlm@1 243 bool updateRenderMethod(bool force);
rlm@1 244 bool initDisplay();
rlm@1 245 void updateWindowSize(int value);
rlm@1 246 void updateVideoSize(UINT id);
rlm@1 247 void updateFrameSkip();
rlm@1 248 void loadSettings();
rlm@1 249 void saveSettings();
rlm@1 250 bool initInput();
rlm@1 251 void addRecentFile(const CString &file);
rlm@1 252 void saveRewindStateIfNecessary();
rlm@1 253 //{{AFX_MSG(VBA)
rlm@1 254 afx_msg void OnAppAbout();
rlm@1 255 // NOTE - the ClassWizard will add and remove member functions here.
rlm@1 256 // DO NOT EDIT what you see in these blocks of generated code !
rlm@1 257 //}}AFX_MSG
rlm@1 258 DECLARE_MESSAGE_MAP()
rlm@1 259 };
rlm@1 260
rlm@1 261 extern VBA theApp;
rlm@1 262
rlm@1 263 #ifdef MMX
rlm@1 264 extern "C" bool cpu_mmx;
rlm@1 265 #endif
rlm@1 266
rlm@1 267 extern void DrawTextMessages(u8 *dest, int pitch, int left, int bottom);
rlm@1 268
rlm@1 269 /////////////////////////////////////////////////////////////////////////////
rlm@1 270
rlm@1 271 //{{AFX_INSERT_LOCATION}}
rlm@1 272 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
rlm@1 273
rlm@1 274 #endif // !defined(AFX_VBA_H__57514A10_49F9_4B83_A928_0D8A4A7306A3__INCLUDED_)