Skip to content

Commit

Permalink
Merge pull request #278 from ogamespec/master
Browse files Browse the repository at this point in the history
User-friendly Debug::Halt
  • Loading branch information
ogamespec authored Aug 10, 2023
2 parents bbf412e + 6ff9d07 commit cc68053
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 2 additions & 4 deletions scripts/pureikyubu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,13 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -284,14 +283,13 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
10 changes: 10 additions & 0 deletions src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@ namespace Debug

Msgs.AddReport(Channel::Error, true, buf);

bool any_debugger_present = false;

if (Debug::gekkoDebug != nullptr) {
Debug::gekkoDebug->InvalidateAll();
any_debugger_present = true;
}

if (Debug::dspDebug != nullptr) {
Debug::dspDebug->InvalidateAll();
any_debugger_present = true;
}

if (!any_debugger_present) {
UI::Report(
Util::StringToWstring(
std::string("The emulation is crashed. Details can be viewed in the debugger (Ctrl+D)\n\n" + std::string(buf))).c_str());
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/gekko.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ namespace Gekko
}

if (break_on_DSI) {
Halt("Gekko DSI Exception at %08X\n", regs.pc);
Halt("Gekko DSI Exception at %08X.%s\n", regs.pc, regs.spr[Gekko::SPR::SDR1] != 0 ?
"\nThe sneaky game uses the vm library, to emulate virtual memory, which is not yet well implemented." : "");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A list of commands can be found in EmuJdi.json

#pragma once

#define EMU_VERSION L"1.3"
#define EMU_VERSION L"1.4"

void EMUGetHwConfig(HWConfig* config);

Expand Down

0 comments on commit cc68053

Please sign in to comment.