Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-friendly Debug::Halt #278

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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