Added Copy EFB hotkey to OpenGL plugin (to be able to easily switch back and forth during emulation). Added Unlimited JIT cache option to debugger. It may fix the Zelda TP crashes.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1243 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2008-11-22 16:46:12 +00:00
parent 36bf2fedf6
commit f0596fee55
16 changed files with 492 additions and 411 deletions

View File

@ -37,14 +37,16 @@ struct SCoreStartupParameter
// flags // flags
bool bEnableDebugging; bool bEnableDebugging;
bool bUseJIT; bool bUseJIT;
bool bJITOff;
bool bJITLoadStoreOff; bool bJITUnlimitedCache, bJITOff; // JIT
bool bJITLoadStoreOff, bJITLoadStorelXzOff, bJITLoadStorelwzOff, bJITLoadStorelbzxOff;
bool bJITLoadStoreFloatingOff; bool bJITLoadStoreFloatingOff;
bool bJITLoadStorePairedOff; bool bJITLoadStorePairedOff;
bool bJITFloatingPointOff; bool bJITFloatingPointOff;
bool bJITIntegerOff; bool bJITIntegerOff;
bool bJITPairedOff; bool bJITPairedOff;
bool bJITSystemRegistersOff; bool bJITSystemRegistersOff;
bool bUseDualCore; bool bUseDualCore;
bool bSkipIdle; bool bSkipIdle;
bool bNTSC; bool bNTSC;

View File

@ -50,11 +50,13 @@ namespace Jit64
enum enum
{ {
CODE_SIZE = 1024*1024*8, //CODE_SIZE = 1024*1024*8,
GEN_SIZE = 4096, GEN_SIZE = 4096,
TRAMPOLINE_SIZE = 1024*1024, TRAMPOLINE_SIZE = 1024*1024,
MAX_NUM_BLOCKS = 65536, //MAX_NUM_BLOCKS = 65536,
}; };
int CODE_SIZE = 1024*1024*8; // nonconstant to be able to have an option for it
int MAX_NUM_BLOCKS = 65536;
static u8 **blockCodePointers; // cut these in half and force below 2GB? static u8 **blockCodePointers; // cut these in half and force below 2GB?
@ -75,6 +77,12 @@ namespace Jit64
void InitCache() void InitCache()
{ {
if(Core::g_CoreStartupParameter.bJITUnlimitedCache)
{
CODE_SIZE *= 8;
MAX_NUM_BLOCKS *= 8;
}
codeCache = (u8*)AllocateExecutableMemory(CODE_SIZE); codeCache = (u8*)AllocateExecutableMemory(CODE_SIZE);
genFunctions = (u8*)AllocateExecutableMemory(GEN_SIZE); genFunctions = (u8*)AllocateExecutableMemory(GEN_SIZE);
trampolineCache = (u8*)AllocateExecutableMemory(TRAMPOLINE_SIZE); trampolineCache = (u8*)AllocateExecutableMemory(TRAMPOLINE_SIZE);
@ -103,6 +111,8 @@ namespace Jit64
numBlocks = 0; numBlocks = 0;
} }
/* This clears the JIT cache. It's called from JitCache.cpp when the JIT cache
is full and when saving and loading states */
void ClearCache() void ClearCache()
{ {
Core::DisplayMessage("Cleared code cache.", 3000); Core::DisplayMessage("Cleared code cache.", 3000);
@ -165,6 +175,10 @@ namespace Jit64
if (GetCodePtr() >= codeCache + CODE_SIZE - 0x10000 || numBlocks >= MAX_NUM_BLOCKS - 1) if (GetCodePtr() >= codeCache + CODE_SIZE - 0x10000 || numBlocks >= MAX_NUM_BLOCKS - 1)
{ {
LOG(DYNA_REC, "JIT cache full - clearing.") LOG(DYNA_REC, "JIT cache full - clearing.")
if(Core::g_CoreStartupParameter.bJITUnlimitedCache)
{
PanicAlert("What? JIT cache still full - clearing.");
}
ClearCache(); ClearCache();
} }

View File

@ -55,7 +55,8 @@ namespace Jit64
void lbzx(UGeckoInstruction inst) void lbzx(UGeckoInstruction inst)
{ {
#ifdef JIT_OFF_OPTIONS #ifdef JIT_OFF_OPTIONS
if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff
|| Core::g_CoreStartupParameter.bJITLoadStorelbzxOff)
{Default(inst); return;} // turn off from debugger {Default(inst); return;} // turn off from debugger
#endif #endif
INSTRUCTION_START; INSTRUCTION_START;
@ -80,7 +81,8 @@ namespace Jit64
void lXz(UGeckoInstruction inst) void lXz(UGeckoInstruction inst)
{ {
#ifdef JIT_OFF_OPTIONS #ifdef JIT_OFF_OPTIONS
if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff
|| Core::g_CoreStartupParameter.bJITLoadStorelXzOff)
{Default(inst); return;} // turn off from debugger {Default(inst); return;} // turn off from debugger
#endif #endif
INSTRUCTION_START; INSTRUCTION_START;
@ -125,10 +127,16 @@ namespace Jit64
int accessSize; int accessSize;
switch (inst.OPCD) switch (inst.OPCD)
{ {
case 32: accessSize = 32; break; //lwz case 32:
accessSize = 32;
if(Core::g_CoreStartupParameter.bJITLoadStorelwzOff) {Default(inst); return;}
break; //lwz
case 40: accessSize = 16; break; //lhz case 40: accessSize = 16; break; //lhz
case 34: accessSize = 8; break; //lbz case 34: accessSize = 8; break; //lbz
default: _assert_msg_(DYNA_REC, 0, "lXz: invalid access size"); return; default:
//_assert_msg_(DYNA_REC, 0, "lXz: invalid access size");
PanicAlert("lXz: invalid access size");
return;
} }
//Still here? Do regular path. //Still here? Do regular path.

View File

@ -92,14 +92,18 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleVideoWindow) EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleVideoWindow)
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnInterpreter) // CPU Mode EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnInterpreter) // CPU Mode
EVT_MENU(IDM_JITUNLIMITED, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITOFF, CCodeWindow::OnJITOff) EVT_MENU(IDM_JITOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnJITLSOff) EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITLSFOFF, CCodeWindow::OnJITLSFOff) EVT_MENU(IDM_JITLSLXZOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITLSPOFF, CCodeWindow::OnJITLSPOff) EVT_MENU(IDM_JITLSLWZOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnJITFPOff) EVT_MENU(IDM_JITLSLBZXOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITIOFF, CCodeWindow::OnJITIOff) EVT_MENU(IDM_JITLSFOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITPOFF, CCodeWindow::OnJITPOff) EVT_MENU(IDM_JITLSPOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITSROFF, CCodeWindow::OnJITSROff) EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITIOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITPOFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_JITSROFF, CCodeWindow::OnJITOff)
EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu) EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu) EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu)
@ -335,29 +339,19 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
pCoreMenu->AppendSeparator(); pCoreMenu->AppendSeparator();
#ifdef JIT_OFF_OPTIONS #ifdef JIT_OFF_OPTIONS
jitunlimited = pCoreMenu->Append(IDM_JITUNLIMITED, _T("&Unlimited JIT Cache"), wxEmptyString, wxITEM_CHECK);
pCoreMenu->AppendSeparator();
jitoff = pCoreMenu->Append(IDM_JITOFF, _T("&JIT off (JIT core)"), wxEmptyString, wxITEM_CHECK); jitoff = pCoreMenu->Append(IDM_JITOFF, _T("&JIT off (JIT core)"), wxEmptyString, wxITEM_CHECK);
jitoff->Check(_LocalCoreStartupParameter.bJITOff);
jitlsoff = pCoreMenu->Append(IDM_JITLSOFF, _T("&JIT LoadStore off"), wxEmptyString, wxITEM_CHECK); jitlsoff = pCoreMenu->Append(IDM_JITLSOFF, _T("&JIT LoadStore off"), wxEmptyString, wxITEM_CHECK);
jitlsoff->Check(_LocalCoreStartupParameter.bJITLoadStoreOff); jitlslbzxoff = pCoreMenu->Append(IDM_JITLSLBZXOFF, _T(" &JIT LoadStore lbzx off"), wxEmptyString, wxITEM_CHECK);
jitlslxzoff = pCoreMenu->Append(IDM_JITLSLXZOFF, _T(" &JIT LoadStore lXz off"), wxEmptyString, wxITEM_CHECK);
jitlslwzoff = pCoreMenu->Append(IDM_JITLSLWZOFF, _T(" &JIT LoadStore lwz off"), wxEmptyString, wxITEM_CHECK);
jitlspoff = pCoreMenu->Append(IDM_JITLSFOFF, _T("&JIT LoadStore Floating off"), wxEmptyString, wxITEM_CHECK); jitlspoff = pCoreMenu->Append(IDM_JITLSFOFF, _T("&JIT LoadStore Floating off"), wxEmptyString, wxITEM_CHECK);
jitlspoff->Check(_LocalCoreStartupParameter.bJITLoadStoreFloatingOff);
jitlsfoff = pCoreMenu->Append(IDM_JITLSPOFF, _T("&JIT LoadStore Paired off"), wxEmptyString, wxITEM_CHECK); jitlsfoff = pCoreMenu->Append(IDM_JITLSPOFF, _T("&JIT LoadStore Paired off"), wxEmptyString, wxITEM_CHECK);
jitlsfoff->Check(_LocalCoreStartupParameter.bJITLoadStorePairedOff);
jitfpoff = pCoreMenu->Append(IDM_JITFPOFF, _T("&JIT FloatingPoint off"), wxEmptyString, wxITEM_CHECK); jitfpoff = pCoreMenu->Append(IDM_JITFPOFF, _T("&JIT FloatingPoint off"), wxEmptyString, wxITEM_CHECK);
jitfpoff->Check(_LocalCoreStartupParameter.bJITFloatingPointOff);
jitioff = pCoreMenu->Append(IDM_JITIOFF, _T("&JIT Integer off"), wxEmptyString, wxITEM_CHECK); jitioff = pCoreMenu->Append(IDM_JITIOFF, _T("&JIT Integer off"), wxEmptyString, wxITEM_CHECK);
jitioff->Check(_LocalCoreStartupParameter.bJITIntegerOff);
jitpoff = pCoreMenu->Append(IDM_JITPOFF, _T("&JIT Paired off"), wxEmptyString, wxITEM_CHECK); jitpoff = pCoreMenu->Append(IDM_JITPOFF, _T("&JIT Paired off"), wxEmptyString, wxITEM_CHECK);
jitpoff->Check(_LocalCoreStartupParameter.bJITPairedOff);
jitsroff = pCoreMenu->Append(IDM_JITSROFF, _T("&JIT SystemRegisters off"), wxEmptyString, wxITEM_CHECK); jitsroff = pCoreMenu->Append(IDM_JITSROFF, _T("&JIT SystemRegisters off"), wxEmptyString, wxITEM_CHECK);
jitsroff->Check(_LocalCoreStartupParameter.bJITSystemRegistersOff);
#endif #endif
// wxMenuItem* dualcore = pDebugMenu->Append(IDM_DUALCORE, _T("&DualCore"), wxEmptyString, wxITEM_CHECK); // wxMenuItem* dualcore = pDebugMenu->Append(IDM_DUALCORE, _T("&DualCore"), wxEmptyString, wxITEM_CHECK);
@ -459,43 +453,58 @@ void CCodeWindow::OnInterpreter(wxCommandEvent& event)
wxMessageBox(_T("Please pause the emulator before changing mode.")); wxMessageBox(_T("Please pause the emulator before changing mode."));
} }
} }
void CCodeWindow::DoJITOff(wxCommandEvent& event, wxMenuItem* a, bool& b)
void CCodeWindow::OnJITOff(wxCommandEvent& event)
{ {
if (Core::GetState() == Core::CORE_UNINITIALIZED) if (Core::GetState() == Core::CORE_UNINITIALIZED)
{ {
// we disallow changing the status here because it will be reset to the defult when BootCore() // we disallow changing the status here because it will be reset to the defult when BootCore()
// creates the SCoreStartupParameter as a game is loaded // creates the SCoreStartupParameter as a game is loaded
a->Check(!a->IsChecked()); GetMenuBar()->Check(event.GetId(),!event.IsChecked());
wxMessageBox(_T("Please start a game before changing mode.")); wxMessageBox(_T("Please start a game before changing mode."));
} else { } else {
if (Core::GetState() != Core::CORE_RUN) if (Core::GetState() != Core::CORE_RUN)
{ {
b = !b; switch (event.GetId())
{
case IDM_JITUNLIMITED:
Core::g_CoreStartupParameter.bJITUnlimitedCache = event.IsChecked();
Jit64::ClearCache(); // allow InitCache() even after the game has started
Jit64::InitCache();
GetMenuBar()->Enable(event.GetId(),!event.IsChecked());
break;
case IDM_JITOFF:
Core::g_CoreStartupParameter.bJITOff = event.IsChecked(); break;
case IDM_JITLSOFF:
Core::g_CoreStartupParameter.bJITLoadStoreOff = event.IsChecked(); break;
case IDM_JITLSLXZOFF:
Core::g_CoreStartupParameter.bJITLoadStorelXzOff = event.IsChecked(); break;
case IDM_JITLSLWZOFF:
Core::g_CoreStartupParameter.bJITLoadStorelwzOff = event.IsChecked(); break;
case IDM_JITLSLBZXOFF:
Core::g_CoreStartupParameter.bJITLoadStorelbzxOff = event.IsChecked(); break;
case IDM_JITLSFOFF:
Core::g_CoreStartupParameter.bJITLoadStoreFloatingOff = event.IsChecked(); break;
case IDM_JITLSPOFF:
Core::g_CoreStartupParameter.bJITLoadStorePairedOff = event.IsChecked(); break;
case IDM_JITFPOFF:
Core::g_CoreStartupParameter.bJITFloatingPointOff = event.IsChecked(); break;
case IDM_JITIOFF:
Core::g_CoreStartupParameter.bJITIntegerOff = event.IsChecked(); break;
case IDM_JITPOFF:
Core::g_CoreStartupParameter.bJITPairedOff = event.IsChecked(); break;
case IDM_JITSROFF:
Core::g_CoreStartupParameter.bJITSystemRegistersOff = event.IsChecked(); break;
}
Jit64::ClearCache(); Jit64::ClearCache();
} else { } else {
//event.Skip(); // this doesn't work //event.Skip(); // this doesn't work
a->Check(!a->IsChecked()); GetMenuBar()->Check(event.GetId(),!event.IsChecked());
wxMessageBox(_T("Please pause the emulator before changing mode.")); wxMessageBox(_T("Please pause the emulator before changing mode."));
} }
} }
} }
void CCodeWindow::OnJITOff(wxCommandEvent& event) {DoJITOff(event, jitoff,
Core::g_CoreStartupParameter.bJITOff);}
void CCodeWindow::OnJITLSOff(wxCommandEvent& event) {DoJITOff(event, jitlsoff,
Core::g_CoreStartupParameter.bJITLoadStoreOff);}
void CCodeWindow::OnJITLSFOff(wxCommandEvent& event) {DoJITOff(event, jitlsoff,
Core::g_CoreStartupParameter.bJITLoadStoreFloatingOff);}
void CCodeWindow::OnJITLSPOff(wxCommandEvent& event) {DoJITOff(event, jitlsoff,
Core::g_CoreStartupParameter.bJITLoadStorePairedOff);}
void CCodeWindow::OnJITFPOff(wxCommandEvent& event) {DoJITOff(event, jitfpoff,
Core::g_CoreStartupParameter.bJITFloatingPointOff);}
void CCodeWindow::OnJITIOff(wxCommandEvent& event) {DoJITOff(event, jitioff,
Core::g_CoreStartupParameter.bJITIntegerOff);}
void CCodeWindow::OnJITPOff(wxCommandEvent& event) {DoJITOff(event, jitpoff,
Core::g_CoreStartupParameter.bJITPairedOff);}
void CCodeWindow::OnJITSROff(wxCommandEvent& event) {DoJITOff(event, jitsroff,
Core::g_CoreStartupParameter.bJITSystemRegistersOff);}
// ============== // ==============

View File

@ -79,14 +79,15 @@ class CCodeWindow
IDM_CALLSLIST, IDM_CALLSLIST,
IDM_SYMBOLLIST, IDM_SYMBOLLIST,
IDM_INTERPRETER, IDM_INTERPRETER,
IDM_JITOFF, // jit
IDM_JITLSOFF, IDM_JITUNLIMITED, IDM_JITOFF, // jit
IDM_JITLSPOFF, IDM_JITLSOFF, IDM_JITLSLXZOFF, IDM_JITLSLWZOFF, IDM_JITLSLBZXOFF,
IDM_JITLSFOFF, IDM_JITLSPOFF, IDM_JITLSFOFF,
IDM_JITIOFF, IDM_JITIOFF,
IDM_JITFPOFF, IDM_JITFPOFF,
IDM_JITPOFF, IDM_JITPOFF,
IDM_JITSROFF, IDM_JITSROFF,
IDM_DUALCORE, IDM_DUALCORE,
IDM_LOGWINDOW, IDM_LOGWINDOW,
IDM_REGISTERWINDOW, IDM_REGISTERWINDOW,
@ -129,8 +130,8 @@ class CCodeWindow
CMemoryWindow* m_MemoryWindow; CMemoryWindow* m_MemoryWindow;
CJitWindow* m_JitWindow; CJitWindow* m_JitWindow;
wxMenuItem* jitoff; wxMenuItem* jitunlimited, *jitoff;
wxMenuItem* jitlsoff; wxMenuItem* jitlsoff, *jitlslxzoff, *jitlslwzoff, *jitlslbzxoff;
wxMenuItem* jitlspoff; wxMenuItem* jitlspoff;
wxMenuItem* jitlsfoff; wxMenuItem* jitlsfoff;
wxMenuItem* jitfpoff; wxMenuItem* jitfpoff;
@ -176,14 +177,6 @@ class CCodeWindow
void OnInterpreter(wxCommandEvent& event); // cpu mode menu void OnInterpreter(wxCommandEvent& event); // cpu mode menu
void OnJITOff(wxCommandEvent& event); void OnJITOff(wxCommandEvent& event);
void OnJITLSOff(wxCommandEvent& event);
void OnJITLSPOff(wxCommandEvent& event);
void OnJITLSFOff(wxCommandEvent& event);
void OnJITFPOff(wxCommandEvent& event);
void OnJITIOff(wxCommandEvent& event);
void OnJITPOff(wxCommandEvent& event);
void OnJITSROff(wxCommandEvent& event);
void DoJITOff(wxCommandEvent& event, wxMenuItem* a, bool& b);
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter); void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter);

View File

@ -613,12 +613,19 @@ void CFrame::OnToggleStatusbar(wxCommandEvent& event)
void CFrame::OnKeyDown(wxKeyEvent& event) void CFrame::OnKeyDown(wxKeyEvent& event)
{ {
// Toggle fullscreen from Alt + Enter or Esc
if (((event.GetKeyCode() == WXK_RETURN) && (event.GetModifiers() == wxMOD_ALT)) || if (((event.GetKeyCode() == WXK_RETURN) && (event.GetModifiers() == wxMOD_ALT)) ||
(event.GetKeyCode() == WXK_ESCAPE)) (event.GetKeyCode() == WXK_ESCAPE))
{ {
ShowFullScreen(!IsFullScreen()); ShowFullScreen(!IsFullScreen());
UpdateGUI(); UpdateGUI();
} }
#ifdef _WIN32
else if(event.GetKeyCode() == 'E') // Send this to the video plugin WndProc
{
PostMessage((HWND)Core::GetWindowHandle(), WM_KEYDOWN, event.GetKeyCode(), 0);
}
#endif
else else
{ {
event.Skip(); event.Skip();

View File

@ -50,6 +50,24 @@ CConfigDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BO
m_comboSampleRate.AddString("48000"); m_comboSampleRate.AddString("48000");
m_comboSampleRate.SetCurSel(g_Config.m_SampleRate == 44100 ? 0 : 1); m_comboSampleRate.SetCurSel(g_Config.m_SampleRate == 44100 ? 0 : 1);
// Add tooltips
CToolTipCtrl ToolTips;
ToolTips.Create(m_hWnd);
ToolTips.Activate(true);
ToolTips.SetMaxTipWidth(200); // limit the width
ToolTips.SetDelayTime(TTDT_AUTOPOP, 20 * 1000); // give us time to read it
CToolInfo tiHLE(TTF_SUBCLASS, m_buttonEnableHLEAudio, 0, NULL,
"This is the most common sound type");
CToolInfo tiDTK(TTF_SUBCLASS, m_buttonEnableDTKMusic, 0, NULL,
"This is sometimes used to play music tracks from the disc");
CToolInfo tiOther(TTF_SUBCLASS, m_buttonEnableThrottle, 0, NULL,
"This is sometimes used together with pre-rendered movies. Disabling this"
" also disables the speed throttle that is causes. Meaning that"
" there will be no upper limit on your FPS.");
ToolTips.AddTool(tiHLE);
ToolTips.AddTool(tiDTK);
ToolTips.AddTool(tiOther);
return(TRUE); return(TRUE);
} }

View File

@ -109,7 +109,6 @@ void Mixer_PushSamples(short *buffer, int num_stereo_samples, int sample_rate) {
Sleep(0); Sleep(0);
} }
} else { } else {
wprintf("Tab");
return; return;
} }
#else #else

View File

@ -111,7 +111,7 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
ratioFactor = 32000.0f / 44100.0f; ratioFactor = 32000.0f / 44100.0f;
#endif #endif
if(!Wii) DoVoiceHacks(pb); DoVoiceHacks(pb, Wii);
// ============= // =============
if (pb.running) if (pb.running)
@ -148,7 +148,7 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
//if (pb.src_type == 2 && (pb.src.ratio_hi == 0 && pb.src.ratio_lo == 0)) //if (pb.src_type == 2 && (pb.src.ratio_hi == 0 && pb.src.ratio_lo == 0))
if (pb.running && (pb.src.ratio_hi == 0 && pb.src.ratio_lo == 0)) if (pb.running && (pb.src.ratio_hi == 0 && pb.src.ratio_lo == 0))
{ {
pb.src.ratio_hi = 1; //pb.src.ratio_hi = 1;
} }
// ============= // =============
@ -299,7 +299,7 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
// Voice hacks // Voice hacks
// -------------- // --------------
template<class ParamBlockType> template<class ParamBlockType>
inline void DoVoiceHacks(ParamBlockType &pb) inline void DoVoiceHacks(ParamBlockType &pb, bool Wii)
{ {
// get necessary values // get necessary values
const u32 sampleEnd = (pb.audio_addr.end_addr_hi << 16) | pb.audio_addr.end_addr_lo; const u32 sampleEnd = (pb.audio_addr.end_addr_hi << 16) | pb.audio_addr.end_addr_lo;
@ -317,6 +317,7 @@ inline void DoVoiceHacks(ParamBlockType &pb)
if ( if (
(sampleEnd > (0x017fffff * 2) || loopPos > (0x017fffff * 2)) // ARAM bounds in nibbles (sampleEnd > (0x017fffff * 2) || loopPos > (0x017fffff * 2)) // ARAM bounds in nibbles
&& gSSBMremedy1 && gSSBMremedy1
&& !Wii
) )
{ {
pb.running = 0; pb.running = 0;
@ -356,6 +357,7 @@ inline void DoVoiceHacks(ParamBlockType &pb)
&& pb.mixer_control == 0 // only use this in SSBM && pb.mixer_control == 0 // only use this in SSBM
&& gSSBMremedy2 // let us turn this fix on and off && gSSBMremedy2 // let us turn this fix on and off
&& !Wii
) )
{ {
// reset the detection values // reset the detection values

View File

@ -78,6 +78,7 @@ void Config::Load()
iniFile.Get("Hacks", "EFBToTextureDisable", &bEBFToTextureDisable, 0); iniFile.Get("Hacks", "EFBToTextureDisable", &bEBFToTextureDisable, 0);
iniFile.Get("Hacks", "EBFToTextureDisableHotKey", &bEBFToTextureDisableHotKey, 0);
iniFile.Get("Hacks", "ProjectionHax1", &bProjectionHax1, 0); iniFile.Get("Hacks", "ProjectionHax1", &bProjectionHax1, 0);
iniFile.Get("Hacks", "ProjectionHax2", &bProjectionHax2, 0); iniFile.Get("Hacks", "ProjectionHax2", &bProjectionHax2, 0);
} }
@ -112,6 +113,7 @@ void Config::Save()
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso); iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
iniFile.Set("Hacks", "EFBToTextureDisable", bEBFToTextureDisable); iniFile.Set("Hacks", "EFBToTextureDisable", bEBFToTextureDisable);
iniFile.Set("Hacks", "EBFToTextureDisableHotKey", &bEBFToTextureDisableHotKey);
iniFile.Set("Hacks", "ProjectionHax1", bProjectionHax1); iniFile.Set("Hacks", "ProjectionHax1", bProjectionHax1);
iniFile.Set("Hacks", "ProjectionHax2", bProjectionHax2); iniFile.Set("Hacks", "ProjectionHax2", bProjectionHax2);

View File

@ -62,7 +62,7 @@ struct Config
bool bDumpTextures; bool bDumpTextures;
// Hacks // Hacks
bool bEBFToTextureDisable; bool bEBFToTextureDisable; bool bEBFToTextureDisableHotKey;
bool bProjectionHax1; bool bProjectionHax1;
bool bProjectionHax2; bool bProjectionHax2;

View File

@ -97,7 +97,12 @@ void ConfigDialog::CreateGUIControls()
m_Fullscreen->SetValue(g_Config.bFullscreen); m_Fullscreen->SetValue(g_Config.bFullscreen);
m_RenderToMainWindow = new wxCheckBox(m_PageGeneral, ID_RENDERTOMAINWINDOW, wxT("Render to main window"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_RenderToMainWindow = new wxCheckBox(m_PageGeneral, ID_RENDERTOMAINWINDOW, wxT("Render to main window"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_RenderToMainWindow->SetValue(g_Config.renderToMainframe); m_RenderToMainWindow->SetValue(g_Config.renderToMainframe);
m_StretchToFit = new wxCheckBox(m_PageGeneral, ID_STRETCHTOFIT, wxT("Stretch to fit (instead of changing res.)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_StretchToFit = new wxCheckBox(m_PageGeneral, ID_STRETCHTOFIT, wxT("Stretch to fit"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_StretchToFit->SetToolTip
("This will use the game's native resolution and stretch it to fill the"
"\nwindow instead of changing the internal display resolution. It"
"\nmay result in a slightly blurrier image, but it may also give a higher"
"\nFPS if you have a slow graphics card.");
m_StretchToFit->SetValue(g_Config.bStretchToFit); m_StretchToFit->SetValue(g_Config.bStretchToFit);
m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_KeepAR->SetValue(g_Config.bKeepAR); m_KeepAR->SetValue(g_Config.bKeepAR);
@ -188,11 +193,20 @@ void ConfigDialog::CreateGUIControls()
// Hacks // Hacks
sbHacks = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Hacks")); sbHacks = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Hacks"));
m_EFBToTextureDisable = new wxCheckBox(m_PageAdvanced, ID_EFBTOTEXTUREDISABLE, wxT("Disable copy EFB to texture"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_EFBToTextureDisable = new wxCheckBox(m_PageAdvanced,
ID_EFBTOTEXTUREDISABLE, wxT("Disable copy EFB to texture"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_EFBToTextureDisable->SetToolTip("Do not copy the Embedded Framebuffer (EFB)"
" to the\nTexture. This may result in a speed increase.");
m_EFBToTextureDisable->Enable(true); m_EFBToTextureDisable->Enable(true);
m_EFBToTextureDisable->SetValue(g_Config.bEBFToTextureDisable); m_EFBToTextureDisable->SetValue(g_Config.bEBFToTextureDisable);
m_EFBToTextureDisableHotKey = new wxCheckBox(m_PageAdvanced,
ID_EFBTOTEXTUREDISABLEHOTKEY, wxT("with hotkey E"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_EFBToTextureDisableHotKey->SetToolTip("Use the E key to turn this option on and off");
m_EFBToTextureDisableHotKey->SetValue(g_Config.bEBFToTextureDisableHotKey);
m_ProjectionHax1 = new wxCheckBox(m_PageAdvanced, ID_PROJECTIONHACK1, wxT("Projection before R945"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_ProjectionHax1 = new wxCheckBox(m_PageAdvanced, ID_PROJECTIONHACK1, wxT("Projection before R945"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_ProjectionHax1->SetToolTip("This may reveal otherwise invisible graphics"
" in\ngames like Mario Galaxy or Ikaruga.");
m_ProjectionHax1->Enable(true); m_ProjectionHax1->Enable(true);
m_ProjectionHax1->SetValue(g_Config.bProjectionHax1); m_ProjectionHax1->SetValue(g_Config.bProjectionHax1);
@ -226,6 +240,7 @@ void ConfigDialog::CreateGUIControls()
sHacks = new wxGridBagSizer(0, 0); sHacks = new wxGridBagSizer(0, 0);
sHacks->Add(m_EFBToTextureDisable, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5); sHacks->Add(m_EFBToTextureDisable, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5);
sHacks->Add(m_EFBToTextureDisableHotKey, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
sHacks->Add(m_ProjectionHax1, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5); sHacks->Add(m_ProjectionHax1, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
sHacks->Add(m_ProjectionHax2, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5); sHacks->Add(m_ProjectionHax2, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
sbHacks->Add(sHacks); sbHacks->Add(sHacks);
@ -355,6 +370,9 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event)
case ID_EFBTOTEXTUREDISABLE: case ID_EFBTOTEXTUREDISABLE:
g_Config.bEBFToTextureDisable = m_EFBToTextureDisable->IsChecked(); g_Config.bEBFToTextureDisable = m_EFBToTextureDisable->IsChecked();
break; break;
case ID_EFBTOTEXTUREDISABLEHOTKEY:
g_Config.bEBFToTextureDisableHotKey = m_EFBToTextureDisableHotKey->IsChecked();
break;
case ID_PROJECTIONHACK1: case ID_PROJECTIONHACK1:
g_Config.bProjectionHax1 = m_ProjectionHax1->IsChecked(); g_Config.bProjectionHax1 = m_ProjectionHax1->IsChecked();
break; break;

View File

@ -93,7 +93,7 @@ class ConfigDialog : public wxDialog
wxCheckBox *m_DisableTexturing; wxCheckBox *m_DisableTexturing;
wxCheckBox *m_DumpTextures; wxCheckBox *m_DumpTextures;
wxDirPickerCtrl *m_TexturePath; wxDirPickerCtrl *m_TexturePath;
wxCheckBox *m_EFBToTextureDisable; wxCheckBox *m_EFBToTextureDisable, *m_EFBToTextureDisableHotKey;
wxCheckBox *m_ProjectionHax1; wxCheckBox *m_ProjectionHax1;
wxCheckBox *m_ProjectionHax2; wxCheckBox *m_ProjectionHax2;
@ -135,7 +135,7 @@ class ConfigDialog : public wxDialog
ID_DUMPTEXTURES, ID_DUMPTEXTURES,
ID_TEXTUREPATH, ID_TEXTUREPATH,
ID_EFBTOTEXTUREDISABLE, ID_EFBTOTEXTUREDISABLE, ID_EFBTOTEXTUREDISABLEHOTKEY,
ID_PROJECTIONHACK1, ID_PROJECTIONHACK1,
ID_PROJECTIONHACK2 ID_PROJECTIONHACK2
}; };

View File

@ -29,8 +29,9 @@
#include "main.h" #include "main.h"
#include "Win32.h" #include "Win32.h"
#include "Render.h" // for AddMessage
#include "IniFile.h" // we need this for the debugger to work #include "StringUtil.h" // for StringFromFormat
void OpenConsole(); void OpenConsole();
void CloseConsole(); void CloseConsole();
@ -136,6 +137,14 @@ namespace EmuWindow
case MY_KEYS: case MY_KEYS:
hypotheticalScene->sendMessage(KEYDOWN...); hypotheticalScene->sendMessage(KEYDOWN...);
*/ */
case 'E': // EFB hotkey
if(g_Config.bEBFToTextureDisableHotKey)
{
g_Config.bEBFToTextureDisable = !g_Config.bEBFToTextureDisable;
Renderer::AddMessage(StringFromFormat("Copy EFB was turned %s",
g_Config.bEBFToTextureDisable ? "off" : "on").c_str(), 5000);
}
break;
} }
g_VideoInitialize.pKeyPress(LOWORD(wParam), GetAsyncKeyState(VK_SHIFT) != 0, GetAsyncKeyState(VK_CONTROL) != 0); g_VideoInitialize.pKeyPress(LOWORD(wParam), GetAsyncKeyState(VK_SHIFT) != 0, GetAsyncKeyState(VK_CONTROL) != 0);
break; break;