diff --git a/VBA2008.vcproj b/VBA2008.vcproj
index 0108d3e2..a9ce9f0c 100644
--- a/VBA2008.vcproj
+++ b/VBA2008.vcproj
@@ -743,6 +743,10 @@
RelativePath=".\src\win32\MemoryViewerDlg.cpp"
>
+
+
@@ -795,6 +799,10 @@
RelativePath=".\src\win32\WinResUtil.cpp"
>
+
+
@@ -899,10 +907,6 @@
RelativePath=".\src\win32\LoadOAL.cpp"
>
-
-
@@ -1269,6 +1273,10 @@
RelativePath=".\src\win32\MemoryViewerDlg.h"
>
+
+
@@ -1325,6 +1333,10 @@
RelativePath=".\src\win32\WinResUtil.h"
>
+
+
@@ -1381,10 +1393,6 @@
RelativePath=".\src\win32\Input.h"
>
-
-
diff --git a/src/win32/MainWnd.cpp b/src/win32/MainWnd.cpp
index dd060ea3..8fd62539 100644
--- a/src/win32/MainWnd.cpp
+++ b/src/win32/MainWnd.cpp
@@ -442,6 +442,8 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_SELECT_PLUGIN, &MainWnd::OnUpdateOptionsSelectPlugin)
ON_COMMAND(ID_LOADGAME_DONOTCHANGEBATTERYSAVE, &MainWnd::OnLoadgameDonotchangebatterysave)
ON_UPDATE_COMMAND_UI(ID_LOADGAME_DONOTCHANGEBATTERYSAVE, &MainWnd::OnUpdateLoadgameDonotchangebatterysave)
+ ON_COMMAND(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnOutputapiXaudio2config)
+ ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnUpdateOutputapiXaudio2config)
END_MESSAGE_MAP()
diff --git a/src/win32/MainWnd.h b/src/win32/MainWnd.h
index cd4f64c5..a0758237 100644
--- a/src/win32/MainWnd.h
+++ b/src/win32/MainWnd.h
@@ -1,7 +1,7 @@
-// -*- C++ -*-
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2005 Forgotten and the VBA development team
+// Copyright (C) 2007-2008 VBA-M development team
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,424 +17,396 @@
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#if !defined(AFX_MAINWND_H__E8AD28B9_C9FB_4EC2_A2DC_DD1BBA55A275__INCLUDED_)
-#define AFX_MAINWND_H__E8AD28B9_C9FB_4EC2_A2DC_DD1BBA55A275__INCLUDED_
-
-#if _MSC_VER > 1000
#pragma once
-#endif // _MSC_VER > 1000
-// MainWnd.h : header file
-//
#include "stdafx.h"
-/////////////////////////////////////////////////////////////////////////////
-// MainWnd window
class MainWnd : public CWnd
{
- // Construction
- public:
- MainWnd();
-
- // Attributes
- public:
-
- // Operations
- public:
- bool FileRun();
-
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(MainWnd)
- public:
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- //}}AFX_VIRTUAL
-
- // Implementation
- public:
- HCURSOR arrow;
- void winMouseOn();
- void screenCapture(int captureNumber);
- HACCEL m_hAccelTable;
- bool fileOpenSelect( int system );
- afx_msg LRESULT OnMySysCommand(WPARAM, LPARAM);
- afx_msg void OnUpdateFileLoadGameSlot(CCmdUI *pCmdUI);
- afx_msg void OnUpdateFileSaveGameSlot(CCmdUI *pCmdUI);
- afx_msg void OnUpdateOptionsJoypadAutofire(CCmdUI *pCmdUI);
- afx_msg BOOL OnOptionsJoypadAutofire(UINT nID);
- afx_msg void OnUpdateOptionsJoypadDefault(CCmdUI *pCmdUI);
- afx_msg BOOL OnOptionsJoypadDefault(UINT nID);
- afx_msg void OnUpdateOptionsFilterIFB(CCmdUI *pCmdUI);
- afx_msg BOOL OnOptionsFilterIFB(UINT nID);
- afx_msg void OnUpdateOptionsFilter(CCmdUI *pCmdUI);
- afx_msg BOOL OnOptionsFilter(UINT nID);
- afx_msg void OnUpdateOptionsPriority(CCmdUI *pCmdUI);
- afx_msg BOOL OnOptionsPriority(UINT nID);
- void updateSoundChannels(UINT nID);
- afx_msg void OnUpdateOptionsSoundVolume(CCmdUI *pCmdUI);
- afx_msg BOOL OnOptionsSoundVolume(UINT nID);
- afx_msg void OnUpdateOptionsEmulatorShowSpeed(CCmdUI *pCmdUI);
- afx_msg BOOL OnOptionsEmulatorShowSpeed(UINT nID);
- afx_msg void OnSystemMinimize();
- afx_msg void OnUpdateVideoLayer(CCmdUI* pCmdUI);
- afx_msg BOOL OnVideoLayer(UINT nID);
- afx_msg BOOL OnOptionVideoSize(UINT nID);
- afx_msg BOOL OnOptionsFrameskip(UINT nID);
- bool fileImportGSACodeFile(CString& fileName);
- bool writeSaveGame(const char *name);
- bool loadSaveGame(const char *name);
- CString winLoadFilter(UINT id);
- void winLoadCheatList(const char *name);
- void winLoadCheatListDefault();
- void readBatteryFile();
- void writeBatteryFile();
- bool isDriveRoot(CString& file);
- CString getDirFromFile(CString& file);
- void winSaveCheatList(const char *name);
- void winSaveCheatListDefault();
- virtual ~MainWnd();
-
- // Generated message map functions
- protected:
- //{{AFX_MSG(MainWnd)
- afx_msg void OnClose();
- afx_msg void OnHelpAbout();
- afx_msg void OnHelpFaq();
- afx_msg void OnFileOpen();
- afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
- afx_msg void OnFilePause();
- afx_msg void OnUpdateFilePause(CCmdUI* pCmdUI);
- afx_msg void OnFileReset();
- afx_msg void OnUpdateFileReset(CCmdUI* pCmdUI);
- afx_msg void OnUpdateFileRecentFreeze(CCmdUI* pCmdUI);
- afx_msg void OnFileRecentReset();
- afx_msg void OnFileRecentFreeze();
- afx_msg void OnFileExit();
- afx_msg void OnFileClose();
- afx_msg void OnUpdateFileClose(CCmdUI* pCmdUI);
- afx_msg void OnFileOpengameboy();
- afx_msg void OnFileLoad();
- afx_msg void OnUpdateFileLoad(CCmdUI* pCmdUI);
- afx_msg void OnFileSave();
- afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
- afx_msg void OnFileImportBatteryfile();
- afx_msg void OnUpdateFileImportBatteryfile(CCmdUI* pCmdUI);
- afx_msg void OnFileImportGamesharkcodefile();
- afx_msg void OnUpdateFileImportGamesharkcodefile(CCmdUI* pCmdUI);
- afx_msg void OnFileImportGamesharksnapshot();
- afx_msg void OnUpdateFileImportGamesharksnapshot(CCmdUI* pCmdUI);
- afx_msg void OnFileExportBatteryfile();
- afx_msg void OnUpdateFileExportBatteryfile(CCmdUI* pCmdUI);
- afx_msg void OnFileExportGamesharksnapshot();
- afx_msg void OnUpdateFileExportGamesharksnapshot(CCmdUI* pCmdUI);
- afx_msg void OnFileScreencapture();
- afx_msg void OnUpdateFileScreencapture(CCmdUI* pCmdUI);
- afx_msg void OnFileRominformation();
- afx_msg void OnUpdateFileRominformation(CCmdUI* pCmdUI);
- afx_msg void OnFileTogglemenu();
- afx_msg void OnUpdateFileTogglemenu(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsFrameskipThrottleNothrottle(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsFrameskipThrottle25(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsFrameskipThrottle50(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsFrameskipThrottle100(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsFrameskipThrottle150(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsFrameskipThrottle200(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsFrameskipThrottleOther(CCmdUI* pCmdUI);
- afx_msg void OnOptionsFrameskipThrottleNothrottle();
- afx_msg void OnOptionsFrameskipThrottle25();
- afx_msg void OnOptionsFrameskipThrottle50();
- afx_msg void OnOptionsFrameskipThrottle100();
- afx_msg void OnOptionsFrameskipThrottle150();
- afx_msg void OnOptionsFrameskipThrottle200();
- afx_msg void OnOptionsFrameskipThrottleOther();
- afx_msg void OnUpdateOptionsVideoFrameskip0(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip1(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip2(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip3(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip4(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip5(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip6(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip7(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip8(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFrameskip9(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoVsync();
- afx_msg void OnUpdateOptionsVideoVsync(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoX1(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoX2(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoX3(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoX4(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFullscreen320x240(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFullscreen640x480(CCmdUI* pCmdUI);
- afx_msg void OnUpdateOptionsVideoFullscreen800x600(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoFullscreen320x240();
- afx_msg void OnOptionsVideoFullscreen640x480();
- afx_msg void OnOptionsVideoFullscreen800x600();
- afx_msg void OnOptionsVideoFullscreen();
- afx_msg void OnUpdateOptionsVideoFullscreen(CCmdUI* pCmdUI);
- afx_msg void OnMove(int x, int y);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnOptionsVideoDisablesfx();
- afx_msg void OnUpdateOptionsVideoDisablesfx(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoFullscreenstretchtofit();
- afx_msg void OnUpdateOptionsVideoFullscreenstretchtofit(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoRendermethodDirectdraw();
- afx_msg void OnUpdateOptionsVideoRendermethodDirectdraw(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoRendermethodDirect3d();
- afx_msg void OnUpdateOptionsVideoRendermethodDirect3d(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoRendermethodOpengl();
- afx_msg void OnUpdateOptionsVideoRendermethodOpengl(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoTriplebuffering();
- afx_msg void OnUpdateOptionsVideoTriplebuffering(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoRenderoptionsD3dnofilter();
- afx_msg void OnUpdateOptionsVideoRenderoptionsD3dnofilter(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoRenderoptionsD3dbilinear();
- afx_msg void OnUpdateOptionsVideoRenderoptionsD3dbilinear(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoRenderoptionsGlnearest();
- afx_msg void OnUpdateOptionsVideoRenderoptionsGlnearest(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoRenderoptionsGlbilinear();
- afx_msg void OnUpdateOptionsVideoRenderoptionsGlbilinear(CCmdUI* pCmdUI);
- afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
- afx_msg void OnOptionsEmulatorAssociate();
- afx_msg void OnOptionsEmulatorDirectories();
- afx_msg void OnOptionsEmulatorDisablestatusmessages();
- afx_msg void OnUpdateOptionsEmulatorDisablestatusmessages(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSynchronize();
- afx_msg void OnUpdateOptionsEmulatorSynchronize(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorPausewheninactive();
- afx_msg void OnUpdateOptionsEmulatorPausewheninactive(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSpeeduptoggle();
- afx_msg void OnUpdateOptionsEmulatorSpeeduptoggle(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorAutomaticallyipspatch();
- afx_msg void OnUpdateOptionsEmulatorAutomaticallyipspatch(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorAgbprint();
- afx_msg void OnUpdateOptionsEmulatorAgbprint(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorRealtimeclock();
- afx_msg void OnUpdateOptionsEmulatorRealtimeclock(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorGenericflashcard();
- afx_msg void OnUpdateOptionsEmulatorGenericflashcard(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorRewindinterval();
- afx_msg void OnOptionsEmulatorSavetypeAutomatic();
- afx_msg void OnUpdateOptionsEmulatorSavetypeAutomatic(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSavetypeEeprom();
- afx_msg void OnUpdateOptionsEmulatorSavetypeEeprom(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSavetypeSram();
- afx_msg void OnUpdateOptionsEmulatorSavetypeSram(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSavetypeFlash();
- afx_msg void OnUpdateOptionsEmulatorSavetypeFlash(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSavetypeEepromsensor();
- afx_msg void OnUpdateOptionsEmulatorSavetypeEepromsensor(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSavetypeNone();
- afx_msg void OnUpdateOptionsEmulatorSavetypeNone(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSavetypeFlash512k();
- afx_msg void OnUpdateOptionsEmulatorSavetypeFlash512k(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorSavetypeFlash1m();
- afx_msg void OnUpdateOptionsEmulatorSavetypeFlash1m(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorPngformat();
- afx_msg void OnUpdateOptionsEmulatorPngformat(CCmdUI* pCmdUI);
- afx_msg void OnOptionsEmulatorBmpformat();
- afx_msg void OnUpdateOptionsEmulatorBmpformat(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundOff();
- afx_msg void OnUpdateOptionsSoundOff(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundMute();
- afx_msg void OnUpdateOptionsSoundMute(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundOn();
- afx_msg void OnUpdateOptionsSoundOn(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundEcho();
- afx_msg void OnUpdateOptionsSoundEcho(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundLowpassfilter();
- afx_msg void OnUpdateOptionsSoundLowpassfilter(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundReversestereo();
- afx_msg void OnUpdateOptionsSoundReversestereo(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSound11khz();
- afx_msg void OnUpdateOptionsSound11khz(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSound22khz();
- afx_msg void OnUpdateOptionsSound22khz(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSound44khz();
- afx_msg void OnUpdateOptionsSound44khz(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundChannel1();
- afx_msg void OnUpdateOptionsSoundChannel1(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundChannel2();
- afx_msg void OnUpdateOptionsSoundChannel2(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundChannel3();
- afx_msg void OnUpdateOptionsSoundChannel3(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundChannel4();
- afx_msg void OnUpdateOptionsSoundChannel4(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundDirectsounda();
- afx_msg void OnUpdateOptionsSoundDirectsounda(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundDirectsoundb();
- afx_msg void OnUpdateOptionsSoundDirectsoundb(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyBorder();
- afx_msg void OnUpdateOptionsGameboyBorder(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyPrinter();
- afx_msg void OnUpdateOptionsGameboyPrinter(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyBorderAutomatic();
- afx_msg void OnUpdateOptionsGameboyBorderAutomatic(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyAutomatic();
- afx_msg void OnUpdateOptionsGameboyAutomatic(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyGba();
- afx_msg void OnUpdateOptionsGameboyGba(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyCgb();
- afx_msg void OnUpdateOptionsGameboyCgb(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboySgb();
- afx_msg void OnUpdateOptionsGameboySgb(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboySgb2();
- afx_msg void OnUpdateOptionsGameboySgb2(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyGb();
- afx_msg void OnUpdateOptionsGameboyGb(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyRealcolors();
- afx_msg void OnUpdateOptionsGameboyRealcolors(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyGameboycolors();
- afx_msg void OnUpdateOptionsGameboyGameboycolors(CCmdUI* pCmdUI);
- afx_msg void OnOptionsGameboyColors();
- afx_msg void OnOptionsFilterDisablemmx();
- afx_msg void OnUpdateOptionsFilterDisablemmx(CCmdUI* pCmdUI);
- afx_msg void OnOptionsLanguageSystem();
- afx_msg void OnUpdateOptionsLanguageSystem(CCmdUI* pCmdUI);
- afx_msg void OnOptionsLanguageEnglish();
- afx_msg void OnUpdateOptionsLanguageEnglish(CCmdUI* pCmdUI);
- afx_msg void OnOptionsLanguageOther();
- afx_msg void OnUpdateOptionsLanguageOther(CCmdUI* pCmdUI);
- afx_msg void OnOptionsJoypadConfigure1();
- afx_msg void OnUpdateOptionsJoypadConfigure1(CCmdUI* pCmdUI);
- afx_msg void OnOptionsJoypadConfigure2();
- afx_msg void OnUpdateOptionsJoypadConfigure2(CCmdUI* pCmdUI);
- afx_msg void OnOptionsJoypadConfigure3();
- afx_msg void OnUpdateOptionsJoypadConfigure3(CCmdUI* pCmdUI);
- afx_msg void OnOptionsJoypadConfigure4();
- afx_msg void OnUpdateOptionsJoypadConfigure4(CCmdUI* pCmdUI);
- afx_msg void OnOptionsJoypadMotionconfigure();
- afx_msg void OnUpdateOptionsJoypadMotionconfigure(CCmdUI* pCmdUI);
- afx_msg void OnCheatsSearchforcheats();
- afx_msg void OnUpdateCheatsSearchforcheats(CCmdUI* pCmdUI);
- afx_msg void OnCheatsCheatlist();
- afx_msg void OnUpdateCheatsCheatlist(CCmdUI* pCmdUI);
- afx_msg void OnCheatsAutomaticsaveloadcheats();
- afx_msg void OnCheatsLoadcheatlist();
- afx_msg void OnUpdateCheatsLoadcheatlist(CCmdUI* pCmdUI);
- afx_msg void OnCheatsSavecheatlist();
- afx_msg void OnUpdateCheatsSavecheatlist(CCmdUI* pCmdUI);
- afx_msg void OnToolsDisassemble();
- afx_msg void OnUpdateToolsDisassemble(CCmdUI* pCmdUI);
- afx_msg void OnToolsLogging();
- afx_msg void OnUpdateToolsLogging(CCmdUI* pCmdUI);
- afx_msg void OnToolsIoviewer();
- afx_msg void OnUpdateToolsIoviewer(CCmdUI* pCmdUI);
- afx_msg void OnToolsMapview();
- afx_msg void OnUpdateToolsMapview(CCmdUI* pCmdUI);
- afx_msg void OnToolsMemoryviewer();
- afx_msg void OnUpdateToolsMemoryviewer(CCmdUI* pCmdUI);
- afx_msg void OnToolsOamviewer();
- afx_msg void OnUpdateToolsOamviewer(CCmdUI* pCmdUI);
- afx_msg void OnToolsPaletteview();
- afx_msg void OnUpdateToolsPaletteview(CCmdUI* pCmdUI);
- afx_msg void OnToolsTileviewer();
- afx_msg void OnUpdateToolsTileviewer(CCmdUI* pCmdUI);
- afx_msg void OnDebugNextframe();
- afx_msg void OnUpdateCheatsAutomaticsaveloadcheats(CCmdUI* pCmdUI);
- afx_msg void OnToolsDebugGdb();
- afx_msg void OnUpdateToolsDebugGdb(CCmdUI* pCmdUI);
- afx_msg void OnToolsDebugLoadandwait();
- afx_msg void OnUpdateToolsDebugLoadandwait(CCmdUI* pCmdUI);
- afx_msg void OnToolsDebugBreak();
- afx_msg void OnUpdateToolsDebugBreak(CCmdUI* pCmdUI);
- afx_msg void OnToolsDebugDisconnect();
- afx_msg void OnUpdateToolsDebugDisconnect(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundStartrecording();
- afx_msg void OnUpdateOptionsSoundStartrecording(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundStoprecording();
- afx_msg void OnUpdateOptionsSoundStoprecording(CCmdUI* pCmdUI);
- afx_msg void OnToolsRecordStartavirecording();
- afx_msg void OnUpdateToolsRecordStartavirecording(CCmdUI* pCmdUI);
- afx_msg void OnToolsRecordStopavirecording();
- afx_msg void OnUpdateToolsRecordStopavirecording(CCmdUI* pCmdUI);
- afx_msg void OnPaint();
- afx_msg void OnToolsRecordStartmovierecording();
- afx_msg void OnUpdateToolsRecordStartmovierecording(CCmdUI* pCmdUI);
- afx_msg void OnToolsRecordStopmovierecording();
- afx_msg void OnUpdateToolsRecordStopmovierecording(CCmdUI* pCmdUI);
- afx_msg void OnToolsPlayStartmovieplaying();
- afx_msg void OnUpdateToolsPlayStartmovieplaying(CCmdUI* pCmdUI);
- afx_msg void OnToolsPlayStopmovieplaying();
- afx_msg void OnUpdateToolsPlayStopmovieplaying(CCmdUI* pCmdUI);
- afx_msg void OnToolsRewind();
- afx_msg void OnUpdateToolsRewind(CCmdUI* pCmdUI);
- afx_msg void OnToolsCustomize();
- afx_msg void OnUpdateToolsCustomize(CCmdUI* pCmdUI);
- afx_msg void OnHelpBugreport();
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnInitMenu(CMenu* pMenu);
- afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
- afx_msg void OnDropFiles(HDROP hDropInfo);
- afx_msg void OnFileSavegameOldestslot();
- afx_msg void OnUpdateFileSavegameOldestslot(CCmdUI* pCmdUI);
- afx_msg void OnFileLoadgameMostrecent();
- afx_msg void OnUpdateFileLoadgameMostrecent(CCmdUI* pCmdUI);
- afx_msg void OnFileLoadgameAutoloadmostrecent();
- afx_msg void OnUpdateFileLoadgameAutoloadmostrecent(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundVolume25x();
- afx_msg void OnUpdateOptionsSoundVolume25x(CCmdUI* pCmdUI);
- afx_msg void OnOptionsSoundVolume5x();
- afx_msg void OnUpdateOptionsSoundVolume5x(CCmdUI* pCmdUI);
- afx_msg void OnCheatsDisablecheats();
- afx_msg void OnUpdateCheatsDisablecheats(CCmdUI* pCmdUI);
- afx_msg void OnOptionsVideoFullscreenmaxscale();
- afx_msg void OnOptionsSelectPlugin();
- afx_msg void OnOptionsEmulatorGameoverrides();
- afx_msg void OnUpdateOptionsEmulatorGameoverrides(CCmdUI* pCmdUI);
- afx_msg void OnHelpGnupubliclicense();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- afx_msg BOOL OnFileRecentFile(UINT nID);
- afx_msg BOOL OnFileLoadSlot(UINT nID);
- afx_msg BOOL OnFileSaveSlot(UINT nID);
- afx_msg void OnOptionsFilterLcdcolors();
- afx_msg void OnUpdateOptionsFilterLcdcolors(CCmdUI *pCmdUI);
-
- afx_msg BOOL OnOptionsSoundPcminterpolation(UINT nID);
- afx_msg void OnUpdateOptionsSoundPcminterpolation(CCmdUI *pCmdUI);
public:
+ MainWnd();
+ virtual ~MainWnd();
+
+ HCURSOR arrow;
+ HACCEL m_hAccelTable;
+
+ bool FileRun();
+ void winMouseOn();
+ void screenCapture(int captureNumber);
+ bool fileOpenSelect( int system );
+ void updateSoundChannels(UINT nID);
+ bool fileImportGSACodeFile(CString& fileName);
+ bool writeSaveGame(const char *name);
+ bool loadSaveGame(const char *name);
+ CString winLoadFilter(UINT id);
+ void winLoadCheatList(const char *name);
+ void winLoadCheatListDefault();
+ void readBatteryFile();
+ void writeBatteryFile();
+ bool isDriveRoot(CString& file);
+ CString getDirFromFile(CString& file);
+ void winSaveCheatList(const char *name);
+ void winSaveCheatListDefault();
+
+ virtual BOOL PreTranslateMessage(MSG* pMsg);
+
+ afx_msg LRESULT OnMySysCommand(WPARAM, LPARAM);
+ afx_msg void OnUpdateFileLoadGameSlot(CCmdUI *pCmdUI);
+ afx_msg void OnUpdateFileSaveGameSlot(CCmdUI *pCmdUI);
+ afx_msg void OnUpdateOptionsJoypadAutofire(CCmdUI *pCmdUI);
+ afx_msg BOOL OnOptionsJoypadAutofire(UINT nID);
+ afx_msg void OnUpdateOptionsJoypadDefault(CCmdUI *pCmdUI);
+ afx_msg BOOL OnOptionsJoypadDefault(UINT nID);
+ afx_msg void OnUpdateOptionsFilterIFB(CCmdUI *pCmdUI);
+ afx_msg BOOL OnOptionsFilterIFB(UINT nID);
+ afx_msg void OnUpdateOptionsFilter(CCmdUI *pCmdUI);
+ afx_msg BOOL OnOptionsFilter(UINT nID);
+ afx_msg void OnUpdateOptionsPriority(CCmdUI *pCmdUI);
+ afx_msg BOOL OnOptionsPriority(UINT nID);
+ afx_msg void OnUpdateOptionsSoundVolume(CCmdUI *pCmdUI);
+ afx_msg BOOL OnOptionsSoundVolume(UINT nID);
+ afx_msg void OnUpdateOptionsEmulatorShowSpeed(CCmdUI *pCmdUI);
+ afx_msg BOOL OnOptionsEmulatorShowSpeed(UINT nID);
+ afx_msg void OnSystemMinimize();
+ afx_msg void OnUpdateVideoLayer(CCmdUI* pCmdUI);
+ afx_msg BOOL OnVideoLayer(UINT nID);
+ afx_msg BOOL OnOptionVideoSize(UINT nID);
+ afx_msg BOOL OnOptionsFrameskip(UINT nID);
+ afx_msg void OnClose();
+ afx_msg void OnHelpAbout();
+ afx_msg void OnHelpFaq();
+ afx_msg void OnFileOpen();
+ afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
+ afx_msg void OnFilePause();
+ afx_msg void OnUpdateFilePause(CCmdUI* pCmdUI);
+ afx_msg void OnFileReset();
+ afx_msg void OnUpdateFileReset(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateFileRecentFreeze(CCmdUI* pCmdUI);
+ afx_msg void OnFileRecentReset();
+ afx_msg void OnFileRecentFreeze();
+ afx_msg void OnFileExit();
+ afx_msg void OnFileClose();
+ afx_msg void OnUpdateFileClose(CCmdUI* pCmdUI);
+ afx_msg void OnFileOpengameboy();
+ afx_msg void OnFileLoad();
+ afx_msg void OnUpdateFileLoad(CCmdUI* pCmdUI);
+ afx_msg void OnFileSave();
+ afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
+ afx_msg void OnFileImportBatteryfile();
+ afx_msg void OnUpdateFileImportBatteryfile(CCmdUI* pCmdUI);
+ afx_msg void OnFileImportGamesharkcodefile();
+ afx_msg void OnUpdateFileImportGamesharkcodefile(CCmdUI* pCmdUI);
+ afx_msg void OnFileImportGamesharksnapshot();
+ afx_msg void OnUpdateFileImportGamesharksnapshot(CCmdUI* pCmdUI);
+ afx_msg void OnFileExportBatteryfile();
+ afx_msg void OnUpdateFileExportBatteryfile(CCmdUI* pCmdUI);
+ afx_msg void OnFileExportGamesharksnapshot();
+ afx_msg void OnUpdateFileExportGamesharksnapshot(CCmdUI* pCmdUI);
+ afx_msg void OnFileScreencapture();
+ afx_msg void OnUpdateFileScreencapture(CCmdUI* pCmdUI);
+ afx_msg void OnFileRominformation();
+ afx_msg void OnUpdateFileRominformation(CCmdUI* pCmdUI);
+ afx_msg void OnFileTogglemenu();
+ afx_msg void OnUpdateFileTogglemenu(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsFrameskipThrottleNothrottle(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsFrameskipThrottle25(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsFrameskipThrottle50(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsFrameskipThrottle100(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsFrameskipThrottle150(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsFrameskipThrottle200(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsFrameskipThrottleOther(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsFrameskipThrottleNothrottle();
+ afx_msg void OnOptionsFrameskipThrottle25();
+ afx_msg void OnOptionsFrameskipThrottle50();
+ afx_msg void OnOptionsFrameskipThrottle100();
+ afx_msg void OnOptionsFrameskipThrottle150();
+ afx_msg void OnOptionsFrameskipThrottle200();
+ afx_msg void OnOptionsFrameskipThrottleOther();
+ afx_msg void OnUpdateOptionsVideoFrameskip0(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip1(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip2(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip3(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip4(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip5(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip6(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip7(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip8(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFrameskip9(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoVsync();
+ afx_msg void OnUpdateOptionsVideoVsync(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoX1(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoX2(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoX3(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoX4(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFullscreen320x240(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFullscreen640x480(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateOptionsVideoFullscreen800x600(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoFullscreen320x240();
+ afx_msg void OnOptionsVideoFullscreen640x480();
+ afx_msg void OnOptionsVideoFullscreen800x600();
+ afx_msg void OnOptionsVideoFullscreen();
+ afx_msg void OnUpdateOptionsVideoFullscreen(CCmdUI* pCmdUI);
+ afx_msg void OnMove(int x, int y);
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ afx_msg void OnOptionsVideoDisablesfx();
+ afx_msg void OnUpdateOptionsVideoDisablesfx(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoFullscreenstretchtofit();
+ afx_msg void OnUpdateOptionsVideoFullscreenstretchtofit(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoRendermethodDirectdraw();
+ afx_msg void OnUpdateOptionsVideoRendermethodDirectdraw(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoRendermethodDirect3d();
+ afx_msg void OnUpdateOptionsVideoRendermethodDirect3d(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoRendermethodOpengl();
+ afx_msg void OnUpdateOptionsVideoRendermethodOpengl(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoTriplebuffering();
+ afx_msg void OnUpdateOptionsVideoTriplebuffering(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoRenderoptionsD3dnofilter();
+ afx_msg void OnUpdateOptionsVideoRenderoptionsD3dnofilter(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoRenderoptionsD3dbilinear();
+ afx_msg void OnUpdateOptionsVideoRenderoptionsD3dbilinear(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoRenderoptionsGlnearest();
+ afx_msg void OnUpdateOptionsVideoRenderoptionsGlnearest(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoRenderoptionsGlbilinear();
+ afx_msg void OnUpdateOptionsVideoRenderoptionsGlbilinear(CCmdUI* pCmdUI);
+ afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
+ afx_msg void OnOptionsEmulatorAssociate();
+ afx_msg void OnOptionsEmulatorDirectories();
+ afx_msg void OnOptionsEmulatorDisablestatusmessages();
+ afx_msg void OnUpdateOptionsEmulatorDisablestatusmessages(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSynchronize();
+ afx_msg void OnUpdateOptionsEmulatorSynchronize(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorPausewheninactive();
+ afx_msg void OnUpdateOptionsEmulatorPausewheninactive(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSpeeduptoggle();
+ afx_msg void OnUpdateOptionsEmulatorSpeeduptoggle(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorAutomaticallyipspatch();
+ afx_msg void OnUpdateOptionsEmulatorAutomaticallyipspatch(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorAgbprint();
+ afx_msg void OnUpdateOptionsEmulatorAgbprint(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorRealtimeclock();
+ afx_msg void OnUpdateOptionsEmulatorRealtimeclock(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorGenericflashcard();
+ afx_msg void OnUpdateOptionsEmulatorGenericflashcard(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorRewindinterval();
+ afx_msg void OnOptionsEmulatorSavetypeAutomatic();
+ afx_msg void OnUpdateOptionsEmulatorSavetypeAutomatic(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSavetypeEeprom();
+ afx_msg void OnUpdateOptionsEmulatorSavetypeEeprom(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSavetypeSram();
+ afx_msg void OnUpdateOptionsEmulatorSavetypeSram(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSavetypeFlash();
+ afx_msg void OnUpdateOptionsEmulatorSavetypeFlash(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSavetypeEepromsensor();
+ afx_msg void OnUpdateOptionsEmulatorSavetypeEepromsensor(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSavetypeNone();
+ afx_msg void OnUpdateOptionsEmulatorSavetypeNone(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSavetypeFlash512k();
+ afx_msg void OnUpdateOptionsEmulatorSavetypeFlash512k(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorSavetypeFlash1m();
+ afx_msg void OnUpdateOptionsEmulatorSavetypeFlash1m(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorPngformat();
+ afx_msg void OnUpdateOptionsEmulatorPngformat(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsEmulatorBmpformat();
+ afx_msg void OnUpdateOptionsEmulatorBmpformat(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundOff();
+ afx_msg void OnUpdateOptionsSoundOff(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundMute();
+ afx_msg void OnUpdateOptionsSoundMute(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundOn();
+ afx_msg void OnUpdateOptionsSoundOn(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundEcho();
+ afx_msg void OnUpdateOptionsSoundEcho(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundLowpassfilter();
+ afx_msg void OnUpdateOptionsSoundLowpassfilter(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundReversestereo();
+ afx_msg void OnUpdateOptionsSoundReversestereo(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSound11khz();
+ afx_msg void OnUpdateOptionsSound11khz(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSound22khz();
+ afx_msg void OnUpdateOptionsSound22khz(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSound44khz();
+ afx_msg void OnUpdateOptionsSound44khz(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundChannel1();
+ afx_msg void OnUpdateOptionsSoundChannel1(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundChannel2();
+ afx_msg void OnUpdateOptionsSoundChannel2(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundChannel3();
+ afx_msg void OnUpdateOptionsSoundChannel3(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundChannel4();
+ afx_msg void OnUpdateOptionsSoundChannel4(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundDirectsounda();
+ afx_msg void OnUpdateOptionsSoundDirectsounda(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundDirectsoundb();
+ afx_msg void OnUpdateOptionsSoundDirectsoundb(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyBorder();
+ afx_msg void OnUpdateOptionsGameboyBorder(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyPrinter();
+ afx_msg void OnUpdateOptionsGameboyPrinter(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyBorderAutomatic();
+ afx_msg void OnUpdateOptionsGameboyBorderAutomatic(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyAutomatic();
+ afx_msg void OnUpdateOptionsGameboyAutomatic(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyGba();
+ afx_msg void OnUpdateOptionsGameboyGba(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyCgb();
+ afx_msg void OnUpdateOptionsGameboyCgb(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboySgb();
+ afx_msg void OnUpdateOptionsGameboySgb(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboySgb2();
+ afx_msg void OnUpdateOptionsGameboySgb2(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyGb();
+ afx_msg void OnUpdateOptionsGameboyGb(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyRealcolors();
+ afx_msg void OnUpdateOptionsGameboyRealcolors(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyGameboycolors();
+ afx_msg void OnUpdateOptionsGameboyGameboycolors(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsGameboyColors();
+ afx_msg void OnOptionsFilterDisablemmx();
+ afx_msg void OnUpdateOptionsFilterDisablemmx(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsLanguageSystem();
+ afx_msg void OnUpdateOptionsLanguageSystem(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsLanguageEnglish();
+ afx_msg void OnUpdateOptionsLanguageEnglish(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsLanguageOther();
+ afx_msg void OnUpdateOptionsLanguageOther(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsJoypadConfigure1();
+ afx_msg void OnUpdateOptionsJoypadConfigure1(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsJoypadConfigure2();
+ afx_msg void OnUpdateOptionsJoypadConfigure2(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsJoypadConfigure3();
+ afx_msg void OnUpdateOptionsJoypadConfigure3(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsJoypadConfigure4();
+ afx_msg void OnUpdateOptionsJoypadConfigure4(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsJoypadMotionconfigure();
+ afx_msg void OnUpdateOptionsJoypadMotionconfigure(CCmdUI* pCmdUI);
+ afx_msg void OnCheatsSearchforcheats();
+ afx_msg void OnUpdateCheatsSearchforcheats(CCmdUI* pCmdUI);
+ afx_msg void OnCheatsCheatlist();
+ afx_msg void OnUpdateCheatsCheatlist(CCmdUI* pCmdUI);
+ afx_msg void OnCheatsAutomaticsaveloadcheats();
+ afx_msg void OnCheatsLoadcheatlist();
+ afx_msg void OnUpdateCheatsLoadcheatlist(CCmdUI* pCmdUI);
+ afx_msg void OnCheatsSavecheatlist();
+ afx_msg void OnUpdateCheatsSavecheatlist(CCmdUI* pCmdUI);
+ afx_msg void OnToolsDisassemble();
+ afx_msg void OnUpdateToolsDisassemble(CCmdUI* pCmdUI);
+ afx_msg void OnToolsLogging();
+ afx_msg void OnUpdateToolsLogging(CCmdUI* pCmdUI);
+ afx_msg void OnToolsIoviewer();
+ afx_msg void OnUpdateToolsIoviewer(CCmdUI* pCmdUI);
+ afx_msg void OnToolsMapview();
+ afx_msg void OnUpdateToolsMapview(CCmdUI* pCmdUI);
+ afx_msg void OnToolsMemoryviewer();
+ afx_msg void OnUpdateToolsMemoryviewer(CCmdUI* pCmdUI);
+ afx_msg void OnToolsOamviewer();
+ afx_msg void OnUpdateToolsOamviewer(CCmdUI* pCmdUI);
+ afx_msg void OnToolsPaletteview();
+ afx_msg void OnUpdateToolsPaletteview(CCmdUI* pCmdUI);
+ afx_msg void OnToolsTileviewer();
+ afx_msg void OnUpdateToolsTileviewer(CCmdUI* pCmdUI);
+ afx_msg void OnDebugNextframe();
+ afx_msg void OnUpdateCheatsAutomaticsaveloadcheats(CCmdUI* pCmdUI);
+ afx_msg void OnToolsDebugGdb();
+ afx_msg void OnUpdateToolsDebugGdb(CCmdUI* pCmdUI);
+ afx_msg void OnToolsDebugLoadandwait();
+ afx_msg void OnUpdateToolsDebugLoadandwait(CCmdUI* pCmdUI);
+ afx_msg void OnToolsDebugBreak();
+ afx_msg void OnUpdateToolsDebugBreak(CCmdUI* pCmdUI);
+ afx_msg void OnToolsDebugDisconnect();
+ afx_msg void OnUpdateToolsDebugDisconnect(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundStartrecording();
+ afx_msg void OnUpdateOptionsSoundStartrecording(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundStoprecording();
+ afx_msg void OnUpdateOptionsSoundStoprecording(CCmdUI* pCmdUI);
+ afx_msg void OnToolsRecordStartavirecording();
+ afx_msg void OnUpdateToolsRecordStartavirecording(CCmdUI* pCmdUI);
+ afx_msg void OnToolsRecordStopavirecording();
+ afx_msg void OnUpdateToolsRecordStopavirecording(CCmdUI* pCmdUI);
+ afx_msg void OnPaint();
+ afx_msg void OnToolsRecordStartmovierecording();
+ afx_msg void OnUpdateToolsRecordStartmovierecording(CCmdUI* pCmdUI);
+ afx_msg void OnToolsRecordStopmovierecording();
+ afx_msg void OnUpdateToolsRecordStopmovierecording(CCmdUI* pCmdUI);
+ afx_msg void OnToolsPlayStartmovieplaying();
+ afx_msg void OnUpdateToolsPlayStartmovieplaying(CCmdUI* pCmdUI);
+ afx_msg void OnToolsPlayStopmovieplaying();
+ afx_msg void OnUpdateToolsPlayStopmovieplaying(CCmdUI* pCmdUI);
+ afx_msg void OnToolsRewind();
+ afx_msg void OnUpdateToolsRewind(CCmdUI* pCmdUI);
+ afx_msg void OnToolsCustomize();
+ afx_msg void OnUpdateToolsCustomize(CCmdUI* pCmdUI);
+ afx_msg void OnHelpBugreport();
+ afx_msg void OnMouseMove(UINT nFlags, CPoint point);
+ afx_msg void OnInitMenu(CMenu* pMenu);
+ afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
+ afx_msg void OnDropFiles(HDROP hDropInfo);
+ afx_msg void OnFileSavegameOldestslot();
+ afx_msg void OnUpdateFileSavegameOldestslot(CCmdUI* pCmdUI);
+ afx_msg void OnFileLoadgameMostrecent();
+ afx_msg void OnUpdateFileLoadgameMostrecent(CCmdUI* pCmdUI);
+ afx_msg void OnFileLoadgameAutoloadmostrecent();
+ afx_msg void OnUpdateFileLoadgameAutoloadmostrecent(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundVolume25x();
+ afx_msg void OnUpdateOptionsSoundVolume25x(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsSoundVolume5x();
+ afx_msg void OnUpdateOptionsSoundVolume5x(CCmdUI* pCmdUI);
+ afx_msg void OnCheatsDisablecheats();
+ afx_msg void OnUpdateCheatsDisablecheats(CCmdUI* pCmdUI);
+ afx_msg void OnOptionsVideoFullscreenmaxscale();
+ afx_msg void OnOptionsSelectPlugin();
+ afx_msg void OnOptionsEmulatorGameoverrides();
+ afx_msg void OnUpdateOptionsEmulatorGameoverrides(CCmdUI* pCmdUI);
+ afx_msg void OnHelpGnupubliclicense();
+ afx_msg BOOL OnFileRecentFile(UINT nID);
+ afx_msg BOOL OnFileLoadSlot(UINT nID);
+ afx_msg BOOL OnFileSaveSlot(UINT nID);
+ afx_msg void OnOptionsFilterLcdcolors();
+ afx_msg void OnUpdateOptionsFilterLcdcolors(CCmdUI *pCmdUI);
+ afx_msg BOOL OnOptionsSoundPcminterpolation(UINT nID);
+ afx_msg void OnUpdateOptionsSoundPcminterpolation(CCmdUI *pCmdUI);
afx_msg void OnOptionsSoundHardwareacceleration();
afx_msg void OnUpdateOptionsSoundHardwareacceleration(CCmdUI *pCmdUI);
afx_msg void OnOptionsVideoFullscreen1280x1024();
afx_msg void OnOptionsVideoFullscreen1024x768();
afx_msg void OnUpdateOptionsVideoFullscreen1024x768(CCmdUI *pCmdUI);
afx_msg void OnUpdateOptionsVideoFullscreen1280x1024(CCmdUI *pCmdUI);
- afx_msg void OnLinkOptions();
+ afx_msg void OnLinkOptions();
afx_msg void OnOptionsLinkLog() ;
afx_msg void OnUpdateOptionsLinkLog(CCmdUI* pCmdUI) ;
afx_msg void OnOptionsLinkRFU() ;
afx_msg void OnUpdateOptionsLinkRFU(CCmdUI* pCmdUI) ;
afx_msg void OnOptionsLinkEnable() ;
afx_msg void OnUpdateOptionsLinkEnable(CCmdUI* pCmdUI) ;
+
afx_msg void OnOutputapiDirectsound();
afx_msg void OnUpdateOutputapiDirectsound(CCmdUI *pCmdUI);
+
afx_msg void OnOutputapiOpenal();
afx_msg void OnUpdateOutputapiOpenal(CCmdUI *pCmdUI);
afx_msg void OnOutputapiOalconfiguration();
afx_msg void OnUpdateOutputapiOalconfiguration(CCmdUI *pCmdUI);
- afx_msg void OnMoving(UINT fwSide, LPRECT pRect);
- afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
+
+ afx_msg void OnOutputapiXaudio2();
+ afx_msg void OnUpdateOutputapiXaudio2(CCmdUI *pCmdUI);
+ afx_msg void OnOutputapiXaudio2config();
+ afx_msg void OnUpdateOutputapiXaudio2config(CCmdUI *pCmdUI);
+
afx_msg void OnRenderapiD3dmotionblur();
afx_msg void OnUpdateRenderapiD3dmotionblur(CCmdUI *pCmdUI);
+ afx_msg void OnPixelfilterMultiThreading();
+
+ afx_msg void OnMoving(UINT fwSide, LPRECT pRect);
+ afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
afx_msg void OnEmulatorBiosfiles();
afx_msg void OnFileOpenGbc();
afx_msg void OnNcRButtonDown(UINT nHitTest, CPoint point);
- afx_msg void OnOutputapiXaudio2();
- afx_msg void OnUpdateOutputapiXaudio2(CCmdUI *pCmdUI);
- afx_msg void OnPixelfilterMultiThreading();
afx_msg void OnUpdatePixelfilterMultiThreading(CCmdUI *pCmdUI);
afx_msg void OnUpdateOptionsSelectPlugin(CCmdUI *pCmdUI);
afx_msg void OnLoadgameDonotchangebatterysave();
afx_msg void OnUpdateLoadgameDonotchangebatterysave(CCmdUI *pCmdUI);
+
+ DECLARE_MESSAGE_MAP()
};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MAINWND_H__E8AD28B9_C9FB_4EC2_A2DC_DD1BBA55A275__INCLUDED_)
diff --git a/src/win32/MainWndOptions.cpp b/src/win32/MainWndOptions.cpp
index ba70358b..2152c230 100644
--- a/src/win32/MainWndOptions.cpp
+++ b/src/win32/MainWndOptions.cpp
@@ -33,6 +33,7 @@
#include "WinResUtil.h"
#include "SelectPlugin.h"
#include "OALConfig.h"
+#include "XAudio2_Config.h"
#include "BIOSDialog.h"
#include "../System.h"
@@ -1831,6 +1832,36 @@ void MainWnd::OnUpdateOutputapiOalconfiguration(CCmdUI *pCmdUI)
#endif
}
+void MainWnd::OnOutputapiXaudio2config()
+{
+#ifndef NO_XAUDIO2
+ XAudio2_Config dlg;
+
+ dlg.m_selected_device_index = theApp.xa2Device;
+ dlg.m_buffer_count = theApp.xa2BufferCount;
+ dlg.m_enable_upmixing = theApp.xa2Upmixing;
+
+ if( dlg.DoModal() == IDOK ) {
+ systemSoundShutdown();
+
+ theApp.xa2Device = dlg.m_selected_device_index;
+ theApp.xa2BufferCount = dlg.m_buffer_count;
+ theApp.xa2Upmixing = dlg.m_enable_upmixing;
+
+ systemSoundInit();
+ }
+#endif
+}
+
+void MainWnd::OnUpdateOutputapiXaudio2config(CCmdUI *pCmdUI)
+{
+#ifndef NO_XAUDIO2
+ pCmdUI->Enable(!theApp.aviRecording && !theApp.soundRecording);
+#else
+ pCmdUI->Enable( FALSE );
+#endif
+}
+
void MainWnd::OnRenderapiD3dmotionblur()
{
#ifndef NO_D3D
diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp
index 8a2ed048..bf54bb20 100644
--- a/src/win32/VBA.cpp
+++ b/src/win32/VBA.cpp
@@ -294,11 +294,16 @@ VBA::VBA()
oalDevice = NULL;
oalBufferCount = 5;
#endif
- iconic = false;
+#ifndef NO_XAUDIO2
+ xa2Device = 0;
+ xa2BufferCount = 4;
+ xa2Upmixing = false;
+#endif
#ifndef NO_D3D
d3dFilter = 0;
d3dMotionBlur = false;
#endif
+ iconic = false;
glFilter = 0;
regEnabled = false;
pauseWhenInactive = true;
@@ -1795,6 +1800,12 @@ void VBA::loadSettings()
oalBufferCount = regQueryDwordValue( "oalBufferCount", 5 );
#endif
+#ifndef NO_XAUDIO2
+ xa2Device = regQueryDwordValue( "xa2Device", 0 );
+ xa2BufferCount = regQueryDwordValue( "xa2BufferCount", 4 );
+ xa2Upmixing = ( 1 == regQueryDwordValue( "xa2Upmixing", 0 ) );
+#endif
+
if( ( maxCpuCores == 1 ) && filterMT ) {
// multi-threading use useless for just one core
filterMT = false;
@@ -2689,6 +2700,12 @@ void VBA::saveSettings()
regSetStringValue( "oalDevice", oalDevice );
regSetDwordValue( "oalBufferCount", oalBufferCount );
#endif
+
+#ifndef NO_XAUDIO2
+ regSetDwordValue( "xa2Device", xa2Device );
+ regSetDwordValue( "xa2BufferCount", xa2BufferCount );
+ regSetDwordValue( "xa2Upmixing", xa2Upmixing ? 1 : 0 );
+#endif
}
unsigned int VBA::detectCpuCores()
diff --git a/src/win32/VBA.h b/src/win32/VBA.h
index 43198d60..821ece9c 100644
--- a/src/win32/VBA.h
+++ b/src/win32/VBA.h
@@ -157,11 +157,16 @@ class VBA : public CWinApp
TCHAR *oalDevice;
int oalBufferCount;
#endif
- bool iconic;
+#ifndef NO_XAUDIO2
+ UINT32 xa2Device;
+ UINT32 xa2BufferCount;
+ bool xa2Upmixing;
+#endif
#ifndef NO_D3D
int d3dFilter;
bool d3dMotionBlur;
#endif
+ bool iconic;
int glFilter;
bool dinputKeyFocus;
bool pauseWhenInactive;
diff --git a/src/win32/VBA.rc b/src/win32/VBA.rc
index f61b2925..47b1e110 100644
--- a/src/win32/VBA.rc
+++ b/src/win32/VBA.rc
@@ -22,60 +22,26 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,8,0,0
- PRODUCTVERSION 1,8,0,0
- FILEFLAGSMASK 0x17L
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "Comments", "VBA-M comes with NO WARRANTY. Use it at your own risk."
- VALUE "CompanyName", "http://vba-m.ngemu.com/"
- VALUE "FileDescription", "GB & GBA emulator for Windows"
- VALUE "FileVersion", "1, 8, 0, 0"
- VALUE "InternalName", "VBA-M"
- VALUE "LegalCopyright", "Copyright © 2008 VBA-M development team"
- VALUE "OriginalFilename", "VisualBoyAdvance.exe"
- VALUE "ProductName", "VBA-M - A VisualBoyAdvance Fork"
- VALUE "ProductVersion", "1, 8, 0, 0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_MAINICON ICON "VBA-M.ico"
-
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
+IDD_XAUDIO2_CONFIG DIALOGEX 0, 0, 160, 144
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "XAudio2"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,42,126,54,14
+ PUSHBUTTON "Cancel",IDCANCEL,102,126,54,14
+ COMBOBOX IDC_COMBO_DEV,6,18,150,60,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Enable stereo upmixing",IDC_CHECK_UPMIX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,108,150,8
+ LTEXT "Select device:",IDC_STATIC,6,6,150,8
+ GROUPBOX "Number of sound buffers:",IDC_STATIC,6,42,150,54
+ CONTROL "",IDC_SLIDER_BUFFER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,12,54,138,24
+ CTEXT "bufferInfo",IDC_INFO_BUFFER,12,78,138,12,0,WS_EX_DLGMODALFRAME
+END
+
IDD_OAL_CONFIG DIALOGEX 0, 0, 167, 114
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "OpenAL configuration"
@@ -1161,6 +1127,14 @@ END
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
+ IDD_XAUDIO2_CONFIG, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 153
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 137
+ END
+
IDD_OAL_CONFIG, DIALOG
BEGIN
LEFTMARGIN, 7
@@ -1497,6 +1471,55 @@ END
#endif // APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,8,0,0
+ PRODUCTVERSION 1,8,0,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "VBA-M comes with NO WARRANTY. Use it at your own risk."
+ VALUE "CompanyName", "http://vba-m.ngemu.com/"
+ VALUE "FileDescription", "GB & GBA emulator for Windows"
+ VALUE "FileVersion", "1, 8, 0, 0"
+ VALUE "InternalName", "VBA-M"
+ VALUE "LegalCopyright", "Copyright © 2008 VBA-M development team"
+ VALUE "OriginalFilename", "VisualBoyAdvance.exe"
+ VALUE "ProductName", "VBA-M - A VisualBoyAdvance Fork"
+ VALUE "ProductVersion", "1, 8, 0, 0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAINICON ICON "VBA-M.ico"
+
/////////////////////////////////////////////////////////////////////////////
//
// Menu
@@ -1674,6 +1697,7 @@ BEGIN
MENUITEM "DirectSound", ID_OUTPUTAPI_DIRECTSOUND
MENUITEM SEPARATOR
MENUITEM "XAudio2", ID_OUTPUTAPI_XAUDIO2
+ MENUITEM " Configuration...", ID_OUTPUTAPI_XAUDIO2CONFIG
MENUITEM SEPARATOR
MENUITEM "OpenAL", ID_OUTPUTAPI_OPENAL
MENUITEM " Configuration...", ID_OUTPUTAPI_OALCONFIGURATION
@@ -2202,6 +2226,8 @@ BEGIN
"XAudio2: Creating mastering voice failed!"
IDS_XAUDIO2_CANNOT_CREATE_SOURCEVOICE
"XAudio2: Creating source voice failed!"
+ IDS_XAUDIO2_CANNOT_ENUMERATE_DEVICES
+ "XAudio2: Enumerating devices failed!"
IDS_CHEATS_DISABLED "Cheats disabled"
IDS_CHEATS_ENABLED "Cheats enabled"
END
diff --git a/src/win32/XAudio2.cpp b/src/win32/XAudio2.cpp
index a22cb59a..96787c76 100644
--- a/src/win32/XAudio2.cpp
+++ b/src/win32/XAudio2.cpp
@@ -21,10 +21,6 @@
#ifndef NO_XAUDIO2
-
-#define NBUFFERS 4
-#define STEREO_UPMIXING
-
// MFC
#include "stdafx.h"
@@ -32,7 +28,7 @@
#include "Sound.h"
// XAudio2
-#include
+#include
// Internals
#include "../Sound.h" // for soundBufferLen, soundFinalWave and soundQuality
@@ -101,6 +97,7 @@ private:
bool initialized;
bool playing;
UINT32 freq;
+ UINT32 bufferCount;
BYTE *buffers;
int currentBuffer;
@@ -120,6 +117,7 @@ XAudio2_Output::XAudio2_Output()
initialized = false;
playing = false;
freq = 0;
+ bufferCount = theApp.xa2BufferCount;
buffers = NULL;
currentBuffer = 0;
@@ -166,12 +164,12 @@ bool XAudio2_Output::init()
HRESULT hr;
// Initialize XAudio2
- UINT32 Flags = 0;
+ UINT32 flags = 0;
#ifdef _DEBUG
- Flags = XAUDIO2_DEBUG_ENGINE;
+ flags = XAUDIO2_DEBUG_ENGINE;
#endif
- hr = XAudio2Create( &xaud, Flags );
+ hr = XAudio2Create( &xaud, flags );
if( hr != S_OK ) {
systemMessage( IDS_XAUDIO2_FAILURE, NULL );
failed = true;
@@ -187,7 +185,7 @@ bool XAudio2_Output::init()
// create own buffers to store sound data because it must not be
// manipulated while the voice plays from it
- buffers = (BYTE *)malloc( ( NBUFFERS + 1 ) * soundBufferLen );
+ buffers = (BYTE *)malloc( ( bufferCount + 1 ) * soundBufferLen );
// + 1 because we need one temporary buffer when all others are in use
WAVEFORMATEX wfx;
@@ -201,7 +199,13 @@ bool XAudio2_Output::init()
// create sound receiver
- hr = xaud->CreateMasteringVoice( &mVoice );
+ hr = xaud->CreateMasteringVoice(
+ &mVoice,
+ XAUDIO2_DEFAULT_CHANNELS,
+ XAUDIO2_DEFAULT_SAMPLERATE,
+ 0,
+ theApp.xa2Device,
+ NULL );
if( hr != S_OK ) {
systemMessage( IDS_XAUDIO2_CANNOT_CREATE_MASTERINGVOICE, NULL );
failed = true;
@@ -218,66 +222,66 @@ bool XAudio2_Output::init()
}
-#ifdef STEREO_UPMIXING
- // set up stereo upmixing
- XAUDIO2_DEVICE_DETAILS dd;
- ZeroMemory( &dd, sizeof( dd ) );
- hr = xaud->GetDeviceDetails( 0, &dd );
- ASSERT( hr == S_OK );
- float *matrix = NULL;
- matrix = (float*)malloc( sizeof( float ) * 2 * dd.OutputFormat.Format.nChannels );
- switch( dd.OutputFormat.Format.nChannels ) {
- case 4: // 4.0
-//Speaker \ Left Source Right Source
-/*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
-/*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
-/*Back L*/ matrix[4] = 1.0000f; matrix[5] = 0.0000f;
-/*Back R*/ matrix[6] = 0.0000f; matrix[7] = 1.0000f;
- break;
- case 5: // 5.0
-//Speaker \ Left Source Right Source
-/*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
-/*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
-/*Front C*/ matrix[4] = 0.7071f; matrix[5] = 0.7071f;
-/*Side L*/ matrix[6] = 1.0000f; matrix[7] = 0.0000f;
-/*Side R*/ matrix[8] = 0.0000f; matrix[9] = 1.0000f;
- break;
- case 6: // 5.1
-//Speaker \ Left Source Right Source
-/*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
-/*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
-/*Front C*/ matrix[4] = 0.7071f; matrix[5] = 0.7071f;
-/*LFE */ matrix[6] = 0.0000f; matrix[7] = 0.0000f;
-/*Side L*/ matrix[8] = 1.0000f; matrix[9] = 0.0000f;
-/*Side R*/ matrix[10] = 0.0000f; matrix[11] = 1.0000f;
- break;
- case 7: // 6.1
-//Speaker \ Left Source Right Source
-/*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
-/*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
-/*Front C*/ matrix[4] = 0.7071f; matrix[5] = 0.7071f;
-/*LFE */ matrix[6] = 0.0000f; matrix[7] = 0.0000f;
-/*Side L*/ matrix[8] = 1.0000f; matrix[9] = 0.0000f;
-/*Side R*/ matrix[10] = 0.0000f; matrix[11] = 1.0000f;
-/*Back C*/ matrix[12] = 0.7071f; matrix[13] = 0.7071f;
- break;
- case 8: // 7.1
-//Speaker \ Left Source Right Source
-/*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
-/*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
-/*Front C*/ matrix[4] = 0.7071f; matrix[5] = 0.7071f;
-/*LFE */ matrix[6] = 0.0000f; matrix[7] = 0.0000f;
-/*Back L*/ matrix[8] = 1.0000f; matrix[9] = 0.0000f;
-/*Back R*/ matrix[10] = 0.0000f; matrix[11] = 1.0000f;
-/*Side L*/ matrix[12] = 1.0000f; matrix[13] = 0.0000f;
-/*Side R*/ matrix[14] = 0.0000f; matrix[15] = 1.0000f;
- break;
+ if( theApp.xa2Upmixing ) {
+ // set up stereo upmixing
+ XAUDIO2_DEVICE_DETAILS dd;
+ ZeroMemory( &dd, sizeof( dd ) );
+ hr = xaud->GetDeviceDetails( 0, &dd );
+ ASSERT( hr == S_OK );
+ float *matrix = NULL;
+ matrix = (float*)malloc( sizeof( float ) * 2 * dd.OutputFormat.Format.nChannels );
+ switch( dd.OutputFormat.Format.nChannels ) {
+ case 4: // 4.0
+ //Speaker \ Left Source Right Source
+ /*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
+ /*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
+ /*Back L*/ matrix[4] = 1.0000f; matrix[5] = 0.0000f;
+ /*Back R*/ matrix[6] = 0.0000f; matrix[7] = 1.0000f;
+ break;
+ case 5: // 5.0
+ //Speaker \ Left Source Right Source
+ /*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
+ /*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
+ /*Front C*/ matrix[4] = 0.7071f; matrix[5] = 0.7071f;
+ /*Side L*/ matrix[6] = 1.0000f; matrix[7] = 0.0000f;
+ /*Side R*/ matrix[8] = 0.0000f; matrix[9] = 1.0000f;
+ break;
+ case 6: // 5.1
+ //Speaker \ Left Source Right Source
+ /*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
+ /*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
+ /*Front C*/ matrix[4] = 0.7071f; matrix[5] = 0.7071f;
+ /*LFE */ matrix[6] = 0.0000f; matrix[7] = 0.0000f;
+ /*Side L*/ matrix[8] = 1.0000f; matrix[9] = 0.0000f;
+ /*Side R*/ matrix[10] = 0.0000f; matrix[11] = 1.0000f;
+ break;
+ case 7: // 6.1
+ //Speaker \ Left Source Right Source
+ /*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
+ /*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
+ /*Front C*/ matrix[4] = 0.7071f; matrix[5] = 0.7071f;
+ /*LFE */ matrix[6] = 0.0000f; matrix[7] = 0.0000f;
+ /*Side L*/ matrix[8] = 1.0000f; matrix[9] = 0.0000f;
+ /*Side R*/ matrix[10] = 0.0000f; matrix[11] = 1.0000f;
+ /*Back C*/ matrix[12] = 0.7071f; matrix[13] = 0.7071f;
+ break;
+ case 8: // 7.1
+ //Speaker \ Left Source Right Source
+ /*Front L*/ matrix[0] = 1.0000f; matrix[1] = 0.0000f;
+ /*Front R*/ matrix[2] = 0.0000f; matrix[3] = 1.0000f;
+ /*Front C*/ matrix[4] = 0.7071f; matrix[5] = 0.7071f;
+ /*LFE */ matrix[6] = 0.0000f; matrix[7] = 0.0000f;
+ /*Back L*/ matrix[8] = 1.0000f; matrix[9] = 0.0000f;
+ /*Back R*/ matrix[10] = 0.0000f; matrix[11] = 1.0000f;
+ /*Side L*/ matrix[12] = 1.0000f; matrix[13] = 0.0000f;
+ /*Side R*/ matrix[14] = 0.0000f; matrix[15] = 1.0000f;
+ break;
+ }
+ hr = sVoice->SetOutputMatrix( NULL, 2, dd.OutputFormat.Format.nChannels, matrix );
+ ASSERT( hr == S_OK );
+ free( matrix );
+ matrix = NULL;
}
- hr = sVoice->SetOutputMatrix( NULL, 2, dd.OutputFormat.Format.nChannels, matrix );
- ASSERT( hr == S_OK );
- free( matrix );
- matrix = NULL;
-#endif
hr = sVoice->Start( 0 );
@@ -298,9 +302,9 @@ void XAudio2_Output::write()
while( true ) {
sVoice->GetState( &vState );
- ASSERT( vState.BuffersQueued <= NBUFFERS );
+ ASSERT( vState.BuffersQueued <= bufferCount );
- if( vState.BuffersQueued < NBUFFERS ) {
+ if( vState.BuffersQueued < bufferCount ) {
if( vState.BuffersQueued == 0 ) {
// buffers ran dry
if( systemVerbose & VERBOSE_SOUNDOUTPUT ) {
@@ -329,7 +333,7 @@ void XAudio2_Output::write()
buf.pAudioData = &buffers[ currentBuffer * soundBufferLen ];
currentBuffer++;
- currentBuffer %= ( NBUFFERS + 1 ); // + 1 because we need one temporary buffer
+ currentBuffer %= ( bufferCount + 1 ); // + 1 because we need one temporary buffer
HRESULT hr = sVoice->SubmitSourceBuffer( &buf ); // send buffer to queue
ASSERT( hr == S_OK );
diff --git a/src/win32/XAudio2_Config.cpp b/src/win32/XAudio2_Config.cpp
new file mode 100644
index 00000000..390b7e95
--- /dev/null
+++ b/src/win32/XAudio2_Config.cpp
@@ -0,0 +1,164 @@
+// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
+// Copyright (C) 1999-2003 Forgotten
+// Copyright (C) 2005 Forgotten and the VBA development team
+// Copyright (C) 2007-2008 VBA-M development team
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or(at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifndef NO_XAUDIO2
+
+#include "stdafx.h"
+#include "XAudio2_Config.h"
+
+#include
+
+
+// XAudio2_Config dialog
+
+IMPLEMENT_DYNAMIC(XAudio2_Config, CDialog)
+
+XAudio2_Config::XAudio2_Config(CWnd* pParent /*=NULL*/)
+ : CDialog(XAudio2_Config::IDD, pParent)
+ , m_selected_device_index(0)
+ , m_enable_upmixing(false)
+ , m_buffer_count(0)
+{
+}
+
+XAudio2_Config::~XAudio2_Config()
+{
+}
+
+void XAudio2_Config::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_COMBO_DEV, m_combo_dev);
+ DDX_Control(pDX, IDC_SLIDER_BUFFER, m_slider_buffer);
+ DDX_Control(pDX, IDC_INFO_BUFFER, m_info_buffer);
+ DDX_Control(pDX, IDC_CHECK_UPMIX, m_check_upmix);
+
+ if( pDX->m_bSaveAndValidate == TRUE ) {
+ if( CB_ERR != m_combo_dev.GetCurSel() ) {
+ if( CB_ERR != m_combo_dev.GetItemData( m_combo_dev.GetCurSel() ) ) {
+ m_selected_device_index = m_combo_dev.GetItemData( m_combo_dev.GetCurSel() );
+ }
+ }
+
+ m_enable_upmixing = ( m_check_upmix.GetCheck() == BST_CHECKED );
+
+ m_buffer_count = (UINT32)m_slider_buffer.GetPos();
+ } else {
+ m_check_upmix.SetCheck( m_enable_upmixing ? BST_CHECKED : BST_UNCHECKED );
+ }
+}
+
+
+BEGIN_MESSAGE_MAP(XAudio2_Config, CDialog)
+ ON_WM_HSCROLL()
+END_MESSAGE_MAP()
+
+
+// XAudio2_Config message handlers
+
+BOOL XAudio2_Config::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ m_combo_dev.ResetContent();
+
+ m_slider_buffer.SetRange( 2, 10, FALSE );
+ m_slider_buffer.SetTicFreq( 1 );
+ m_slider_buffer.SetPos( (int)m_buffer_count );
+
+ CString info;
+ int pos = m_slider_buffer.GetPos();
+ info.Format( _T("%i frames = %.2f ms"), pos, (float)pos / 60.0f * 1000.0f );
+ m_info_buffer.SetWindowText( info );
+
+ HRESULT hr;
+ IXAudio2 *xa = NULL;
+ UINT32 flags = 0;
+#ifdef _DEBUG
+ flags = XAUDIO2_DEBUG_ENGINE;
+#endif
+
+ hr = XAudio2Create( &xa, flags );
+ if( hr != S_OK ) {
+ systemMessage( IDS_XAUDIO2_FAILURE, NULL );
+ } else {
+ UINT32 dev_count = 0;
+ hr = xa->GetDeviceCount( &dev_count );
+ if( hr != S_OK ) {
+ systemMessage( IDS_XAUDIO2_CANNOT_ENUMERATE_DEVICES, NULL );
+ } else {
+ XAUDIO2_DEVICE_DETAILS dd;
+ for( UINT32 i = 0; i < dev_count; i++ ) {
+ hr = xa->GetDeviceDetails( i, &dd );
+ if( hr != S_OK ) {
+ systemMessage( IDS_XAUDIO2_CANNOT_ENUMERATE_DEVICES, NULL );
+ break;
+ } else {
+#ifdef _MBCS
+ CHAR temp[256];
+ ZeroMemory( temp, sizeof( temp ) );
+ WideCharToMultiByte(
+ CP_ACP,
+ WC_NO_BEST_FIT_CHARS,
+ dd.DisplayName,
+ -1,
+ temp,
+ sizeof( temp ) - 1,
+ NULL,
+ NULL );
+
+ int id = m_combo_dev.AddString( temp );
+#endif
+#ifdef _UNICODE
+ int id = m_combo_dev.AddString( dd.DisplayName );
+#endif
+ if( id < 0 ) {
+ systemMessage( IDS_XAUDIO2_CANNOT_ENUMERATE_DEVICES, NULL );
+ break;
+ } else {
+ m_combo_dev.SetItemData( id, i );
+ }
+ }
+ }
+ if( m_combo_dev.GetCount() > 0 ) {
+ if( m_selected_device_index < (UINT32)(m_combo_dev.GetCount()) ) {
+ m_combo_dev.SetCurSel( m_selected_device_index );
+ }
+ }
+ }
+ xa->Release();
+ xa = NULL;
+ }
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+void XAudio2_Config::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
+{
+ CString info;
+ int pos = m_slider_buffer.GetPos();
+ info.Format( _T("%i frames = %.2f ms"), pos, (float)pos / 60.0f * 1000.0f );
+ m_info_buffer.SetWindowText( info );
+
+ CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
+}
+
+#endif
diff --git a/src/win32/XAudio2_Config.h b/src/win32/XAudio2_Config.h
new file mode 100644
index 00000000..d6a55ada
--- /dev/null
+++ b/src/win32/XAudio2_Config.h
@@ -0,0 +1,59 @@
+// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
+// Copyright (C) 1999-2003 Forgotten
+// Copyright (C) 2005 Forgotten and the VBA development team
+// Copyright (C) 2007-2008 VBA-M development team
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or(at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifndef NO_XAUDIO2
+
+#pragma once
+#include "afxwin.h"
+#include "afxcmn.h"
+
+
+class XAudio2_Config : public CDialog
+{
+ DECLARE_DYNAMIC(XAudio2_Config)
+ DECLARE_MESSAGE_MAP()
+
+public:
+ UINT32 m_selected_device_index;
+ UINT32 m_buffer_count;
+ bool m_enable_upmixing;
+
+private:
+ CComboBox m_combo_dev;
+ CSliderCtrl m_slider_buffer;
+ CStatic m_info_buffer;
+ CButton m_check_upmix;
+
+
+public:
+ XAudio2_Config(CWnd* pParent = NULL); // standard constructor
+ virtual ~XAudio2_Config();
+
+// Dialog Data
+ enum { IDD = IDD_XAUDIO2_CONFIG };
+
+ virtual BOOL OnInitDialog();
+ afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+};
+
+#endif
diff --git a/src/win32/resource.h b/src/win32/resource.h
index 1acb47c9..fe01a034 100644
--- a/src/win32/resource.h
+++ b/src/win32/resource.h
@@ -100,6 +100,7 @@
#define IDD_OAL_CONFIG 160
#define IDD_BIOS 161
#define IDD_FULLSCREEN 162
+#define IDD_XAUDIO2_CONFIG 163
#define IDC_R0 1000
#define IDC_EDIT_UP 1000
#define IDC_R1 1001
@@ -534,6 +535,10 @@
#define IDC_COMBO_DEVICE 1283
#define IDC_CHECK1 1284
#define IDC_ALWAYSLASTROMDIR 1284
+#define IDC_CHECK_UPMIX 1284
+#define IDC_COMBO_DEV 1285
+#define IDC_SLIDER_BUFFER 1286
+#define IDC_INFO_BUFFER 1287
#define IDS_OAL_NODEVICE 2000
#define IDS_OAL_NODLL 2001
#define IDS_AVI_CANNOT_CREATE_AVI 2002
@@ -546,8 +551,9 @@
#define IDS_XAUDIO2_FAILURE 2009
#define IDS_XAUDIO2_CANNOT_CREATE_MASTERINGVOICE 2010
#define IDS_XAUDIO2_CANNOT_CREATE_SOURCEVOICE 2011
-#define IDS_CHEATS_DISABLED 2012
-#define IDS_CHEATS_ENABLED 2013
+#define IDS_XAUDIO2_CANNOT_ENUMERATE_DEVICES 2012
+#define IDS_CHEATS_DISABLED 2013
+#define IDS_CHEATS_ENABLED 2014
#define ID_HELP_ABOUT 40001
#define ID_FILE_EXIT 40002
#define ID_OPTIONS_VIDEO_FRAMESKIP_0 40003
@@ -859,14 +865,16 @@
#define ID_PIXELFILTER_MULTI 40360
#define ID_EMULATOR_LOADSTATESHOULD 40361
#define ID_LOADGAME_DONOTCHANGEBATTERYSAVE 40362
+#define ID_OUTPUTAPI_CONFIGURATION40363 40363
+#define ID_OUTPUTAPI_XAUDIO2CONFIG 40364
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 163
-#define _APS_NEXT_COMMAND_VALUE 40363
-#define _APS_NEXT_CONTROL_VALUE 1285
+#define _APS_NEXT_RESOURCE_VALUE 164
+#define _APS_NEXT_COMMAND_VALUE 40365
+#define _APS_NEXT_CONTROL_VALUE 1288
#define _APS_NEXT_SYMED_VALUE 103
#endif
#endif