mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
Merge 95e0b2e525
into 7c1d2a64f4
This commit is contained in:
commit
659073867e
@ -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;
|
||||||
|
@ -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(); }
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user