mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 21:37:42 -07:00
Compare commits
9 Commits
5447495ec5
...
659073867e
Author | SHA1 | Date | |
---|---|---|---|
|
659073867e | ||
|
7c1d2a64f4 | ||
|
b2f6fab6f4 | ||
|
95e0b2e525 | ||
|
07008d3024 | ||
|
28d6ab36f0 | ||
|
c6a2436a69 | ||
|
d17900fdf7 | ||
|
e5ebc7679e |
@ -266,6 +266,22 @@ void A_MRC(ARM* cpu)
|
|||||||
|
|
||||||
void A_SVC(ARM* cpu)
|
void A_SVC(ARM* cpu)
|
||||||
{
|
{
|
||||||
|
// Print from game. Execute `svc 0xFC` with the null-terminated string address in `r0`.
|
||||||
|
if ((cpu->CurInstr & 0xFF) == 0xFC && cpu->NDS.GetDebugPrint())
|
||||||
|
{
|
||||||
|
u32 addr = cpu->R[0];
|
||||||
|
std::string output;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
u32 c;
|
||||||
|
cpu->DataRead8(addr++, &c);
|
||||||
|
if (!c) break;
|
||||||
|
output += c;
|
||||||
|
}
|
||||||
|
Platform::Log(LogLevel::Info, "%s", output.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
u32 oldcpsr = cpu->CPSR;
|
u32 oldcpsr = cpu->CPSR;
|
||||||
cpu->CPSR &= ~0xBF;
|
cpu->CPSR &= ~0xBF;
|
||||||
cpu->CPSR |= 0x93;
|
cpu->CPSR |= 0x93;
|
||||||
@ -278,6 +294,22 @@ void A_SVC(ARM* cpu)
|
|||||||
|
|
||||||
void T_SVC(ARM* cpu)
|
void T_SVC(ARM* cpu)
|
||||||
{
|
{
|
||||||
|
// Print from game. Execute `svc 0xFC` with the null-terminated string address in `r0`.
|
||||||
|
if ((cpu->CurInstr & 0xFF) == 0xFC && cpu->NDS.GetDebugPrint())
|
||||||
|
{
|
||||||
|
u32 addr = cpu->R[0];
|
||||||
|
std::string output;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
u32 c;
|
||||||
|
cpu->DataRead8(addr++, &c);
|
||||||
|
if (!c) break;
|
||||||
|
output += c;
|
||||||
|
}
|
||||||
|
Platform::Log(LogLevel::Info, "%s", output.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
u32 oldcpsr = cpu->CPSR;
|
u32 oldcpsr = cpu->CPSR;
|
||||||
cpu->CPSR &= ~0xBF;
|
cpu->CPSR &= ~0xBF;
|
||||||
cpu->CPSR |= 0x93;
|
cpu->CPSR |= 0x93;
|
||||||
|
@ -127,6 +127,8 @@ if (ENABLE_JIT)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(core INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
set(MELONDS_VERSION_SUFFIX "$ENV{MELONDS_VERSION_SUFFIX}" CACHE STRING "Suffix to add to displayed melonDS version")
|
set(MELONDS_VERSION_SUFFIX "$ENV{MELONDS_VERSION_SUFFIX}" CACHE STRING "Suffix to add to displayed melonDS version")
|
||||||
option(MELONDS_EMBED_BUILD_INFO "Embed detailed build info into the binary" OFF)
|
option(MELONDS_EMBED_BUILD_INFO "Embed detailed build info into the binary" OFF)
|
||||||
set(MELONDS_GIT_BRANCH "$ENV{MELONDS_GIT_BRANCH}" CACHE STRING "The Git branch used for this build")
|
set(MELONDS_GIT_BRANCH "$ENV{MELONDS_GIT_BRANCH}" CACHE STRING "The Git branch used for this build")
|
||||||
@ -178,6 +180,7 @@ endif()
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(core PRIVATE ole32 comctl32 wsock32 ws2_32)
|
target_link_libraries(core PRIVATE ole32 comctl32 wsock32 ws2_32)
|
||||||
|
target_compile_definitions(core PUBLIC WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||||
elseif(NOT APPLE AND NOT HAIKU)
|
elseif(NOT APPLE AND NOT HAIKU)
|
||||||
check_library_exists(rt shm_open "" NEED_LIBRT)
|
check_library_exists(rt shm_open "" NEED_LIBRT)
|
||||||
if (NEED_LIBRT)
|
if (NEED_LIBRT)
|
||||||
|
@ -752,6 +752,11 @@ void NDS::SetGBASave(const u8* savedata, u32 savelen)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NDS::SetDebugPrint(bool enabled) noexcept
|
||||||
|
{
|
||||||
|
DebugPrint = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
void NDS::LoadGBAAddon(int type)
|
void NDS::LoadGBAAddon(int type)
|
||||||
{
|
{
|
||||||
GBACartSlot.LoadAddon(UserData, type);
|
GBACartSlot.LoadAddon(UserData, type);
|
||||||
|
@ -275,6 +275,7 @@ protected:
|
|||||||
std::array<u8, ARM7BIOSSize> ARM7BIOS;
|
std::array<u8, ARM7BIOSSize> ARM7BIOS;
|
||||||
bool ARM9BIOSNative;
|
bool ARM9BIOSNative;
|
||||||
bool ARM7BIOSNative;
|
bool ARM7BIOSNative;
|
||||||
|
bool DebugPrint;
|
||||||
public: // TODO: Encapsulate the rest of these members
|
public: // TODO: Encapsulate the rest of these members
|
||||||
u16 ARM7BIOSProt;
|
u16 ARM7BIOSProt;
|
||||||
|
|
||||||
@ -384,6 +385,9 @@ public: // TODO: Encapsulate the rest of these members
|
|||||||
u32 GetGBASaveLength() const { return GBACartSlot.GetSaveMemoryLength(); }
|
u32 GetGBASaveLength() const { return GBACartSlot.GetSaveMemoryLength(); }
|
||||||
void SetGBASave(const u8* savedata, u32 savelen);
|
void SetGBASave(const u8* savedata, u32 savelen);
|
||||||
|
|
||||||
|
bool GetDebugPrint() const { return DebugPrint; }
|
||||||
|
void SetDebugPrint(bool enabled) noexcept;
|
||||||
|
|
||||||
void LoadGBAAddon(int type);
|
void LoadGBAAddon(int type);
|
||||||
std::unique_ptr<GBACart::CartCommon> EjectGBACart() { return GBACartSlot.EjectCart(); }
|
std::unique_ptr<GBACart::CartCommon> EjectGBACart() { return GBACartSlot.EjectCart(); }
|
||||||
|
|
||||||
|
@ -91,8 +91,7 @@ add_compile_definitions(ARCHIVE_SUPPORT_ENABLED)
|
|||||||
add_executable(melonDS ${SOURCES_QT_SDL})
|
add_executable(melonDS ${SOURCES_QT_SDL})
|
||||||
|
|
||||||
add_subdirectory("../../net"
|
add_subdirectory("../../net"
|
||||||
"${CMAKE_BINARY_DIR}/net"
|
${CMAKE_BINARY_DIR}/net)
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(melonDS PRIVATE net-utils)
|
target_link_libraries(melonDS PRIVATE net-utils)
|
||||||
|
|
||||||
@ -171,10 +170,10 @@ if (BUILD_STATIC)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
target_include_directories(melonDS PUBLIC
|
||||||
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..")
|
"${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||||
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../../net")
|
|
||||||
if (USE_QT6)
|
if (USE_QT6)
|
||||||
target_include_directories(melonDS PUBLIC ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
|
target_include_directories(melonDS PUBLIC ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
|
||||||
else()
|
else()
|
||||||
|
@ -308,6 +308,8 @@ LegacyEntry LegacyFile[] =
|
|||||||
|
|
||||||
{"DSiFullBIOSBoot", 1, "DSi.FullBIOSBoot", true},
|
{"DSiFullBIOSBoot", 1, "DSi.FullBIOSBoot", true},
|
||||||
|
|
||||||
|
{"DebugPrintEnabled", 1, "DS.DebugPrintEnabled", true},
|
||||||
|
|
||||||
#ifdef GDBSTUB_ENABLED
|
#ifdef GDBSTUB_ENABLED
|
||||||
{"GdbEnabled", 1, "Gdb.Enabled", false},
|
{"GdbEnabled", 1, "Gdb.Enabled", false},
|
||||||
{"GdbPortARM7", 0, "Gdb.ARM7.Port", true},
|
{"GdbPortARM7", 0, "Gdb.ARM7.Port", true},
|
||||||
|
@ -1384,6 +1384,7 @@ bool EmuInstance::updateConsole(UpdateConsoleNDSArgs&& _ndsargs, UpdateConsoleGB
|
|||||||
dsi->EjectGBACart();
|
dsi->EjectGBACart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
nds->SetDebugPrint(globalCfg.GetBool("DS.DebugPrintEnabled"));
|
||||||
renderLock.unlock();
|
renderLock.unlock();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -61,6 +61,8 @@ EmuSettingsDialog::EmuSettingsDialog(QWidget* parent) : QDialog(parent), ui(new
|
|||||||
|
|
||||||
lastBIOSFolder = cfg.GetQString("LastBIOSFolder");
|
lastBIOSFolder = cfg.GetQString("LastBIOSFolder");
|
||||||
|
|
||||||
|
ui->cbDebugPrintEnabled->setChecked(cfg.GetBool("DS.DebugPrintEnabled"));
|
||||||
|
|
||||||
ui->chkExternalBIOS->setChecked(cfg.GetBool("Emu.ExternalBIOSEnable"));
|
ui->chkExternalBIOS->setChecked(cfg.GetBool("Emu.ExternalBIOSEnable"));
|
||||||
ui->txtBIOS9Path->setText(cfg.GetQString("DS.BIOS9Path"));
|
ui->txtBIOS9Path->setText(cfg.GetQString("DS.BIOS9Path"));
|
||||||
ui->txtBIOS7Path->setText(cfg.GetQString("DS.BIOS7Path"));
|
ui->txtBIOS7Path->setText(cfg.GetQString("DS.BIOS7Path"));
|
||||||
@ -108,6 +110,8 @@ EmuSettingsDialog::EmuSettingsDialog(QWidget* parent) : QDialog(parent), ui(new
|
|||||||
ui->cbGdbBOSA9->setDisabled(true);
|
ui->cbGdbBOSA9->setDisabled(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ui->cbDebugPrintEnabled->setChecked(cfg.GetBool("DS.DebugPrintEnabled"));
|
||||||
|
|
||||||
on_chkEnableJIT_toggled();
|
on_chkEnableJIT_toggled();
|
||||||
on_cbGdbEnabled_toggled();
|
on_cbGdbEnabled_toggled();
|
||||||
on_chkExternalBIOS_toggled();
|
on_chkExternalBIOS_toggled();
|
||||||
@ -272,6 +276,8 @@ void EmuSettingsDialog::done(int r)
|
|||||||
cfg.SetBool("DLDI.FolderSync", ui->cbDLDIFolder->isChecked());
|
cfg.SetBool("DLDI.FolderSync", ui->cbDLDIFolder->isChecked());
|
||||||
cfg.SetQString("DLDI.FolderPath", ui->txtDLDIFolder->text());
|
cfg.SetQString("DLDI.FolderPath", ui->txtDLDIFolder->text());
|
||||||
|
|
||||||
|
cfg.SetBool("DS.DebugPrintEnabled", ui->cbDebugPrintEnabled->isChecked());
|
||||||
|
|
||||||
cfg.SetQString("DSi.BIOS9Path", ui->txtDSiBIOS9Path->text());
|
cfg.SetQString("DSi.BIOS9Path", ui->txtDSiBIOS9Path->text());
|
||||||
cfg.SetQString("DSi.BIOS7Path", ui->txtDSiBIOS7Path->text());
|
cfg.SetQString("DSi.BIOS7Path", ui->txtDSiBIOS7Path->text());
|
||||||
cfg.SetQString("DSi.FirmwarePath", ui->txtDSiFirmwarePath->text());
|
cfg.SetQString("DSi.FirmwarePath", ui->txtDSiFirmwarePath->text());
|
||||||
|
@ -573,14 +573,14 @@
|
|||||||
<string>Devtools</string>
|
<string>Devtools</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="1" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_16">
|
<widget class="QLabel" name="label_16">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM9 port</string>
|
<string>ARM9 port</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="6" column="0">
|
||||||
<spacer name="verticalSpacer_4">
|
<spacer name="verticalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -593,7 +593,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_17">
|
<widget class="QLabel" name="label_17">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM7 port</string>
|
<string>ARM7 port</string>
|
||||||
@ -607,28 +607,42 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" colspan="7">
|
<item row="0" column="2" colspan="3">
|
||||||
<widget class="QLabel" name="label_18">
|
<widget class="QCheckBox" name="cbDebugPrintEnabled">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Note: melonDS must be restarted in order for these changes to have effect</string>
|
<string>Enable debug print</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="7">
|
<item row="1" column="0" colspan="7">
|
||||||
<widget class="QLabel" name="label_19">
|
<widget class="QLabel" name="label_18">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Note: GDB stub cannot be used together with the JIT recompiler</string>
|
<string>Note: GDB stub cannot be used together with the JIT recompiler</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="6">
|
<item row="2" column="0" colspan="7">
|
||||||
|
<widget class="QLabel" name="label_19">
|
||||||
|
<property name="text">
|
||||||
|
<string>Note: Debug print outputs to terminal on SVC 0xFC</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" colspan="7">
|
||||||
|
<widget class="QLabel" name="label_20">
|
||||||
|
<property name="text">
|
||||||
|
<string>Note: melonDS must be restarted in order for these changes to have effect</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="6">
|
||||||
<widget class="QCheckBox" name="cbGdbBOSA9">
|
<widget class="QCheckBox" name="cbGdbBOSA9">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Break on startup</string>
|
<string>Break on startup</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" colspan="5">
|
<item row="3" column="1" colspan="5">
|
||||||
<widget class="QSpinBox" name="intGdbPortA9">
|
<widget class="QSpinBox" name="intGdbPortA9">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1000</number>
|
<number>1000</number>
|
||||||
@ -641,7 +655,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1" colspan="5">
|
<item row="4" column="1" colspan="5">
|
||||||
<widget class="QSpinBox" name="intGdbPortA7">
|
<widget class="QSpinBox" name="intGdbPortA7">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1000</number>
|
<number>1000</number>
|
||||||
@ -654,7 +668,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="6">
|
<item row="4" column="6">
|
||||||
<widget class="QCheckBox" name="cbGdbBOSA7">
|
<widget class="QCheckBox" name="cbGdbBOSA7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Break on startup</string>
|
<string>Break on startup</string>
|
||||||
|
@ -11,9 +11,9 @@ add_library(net-utils STATIC
|
|||||||
MPInterface.cpp
|
MPInterface.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(net-utils PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
target_include_directories(net-utils PUBLIC
|
||||||
target_include_directories(net-utils PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||||
|
|
||||||
option(USE_SYSTEM_LIBSLIRP "Use system libslirp instead of the bundled version" OFF)
|
option(USE_SYSTEM_LIBSLIRP "Use system libslirp instead of the bundled version" OFF)
|
||||||
if (USE_SYSTEM_LIBSLIRP)
|
if (USE_SYSTEM_LIBSLIRP)
|
||||||
|
Loading…
Reference in New Issue
Block a user