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

UI cleanup #261

Merged
merged 2 commits into from
Aug 8, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions build/Data/Json/DebugUIJdi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"info": {
"description": "Debug UI Jey-Dai specs.",
"helpGroup": "Debug UI Commands"
},

"can": {

"d": {
"help": "Set memory address to view in debugger",
"args": 1,
"hints": "<address>",
"usage": [
"Syntax: d <address>\n",
"Example: d 0x80003000\n"
]
},

"u": {
"help": "Set memory address for viewing disassembled Gekko code",
"args": 1,
"hints": "<address>",
"usage": [
"Syntax: u <address>\n",
"Example: u 0x80003000\n"
]
}

}

}
28 changes: 28 additions & 0 deletions src/debugui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2817,3 +2817,31 @@ namespace Debug
}

}


namespace Debug
{
Json::Value* CmdShowMemory(std::vector<std::string>& args)
{
if (gekkoDebug)
{
gekkoDebug->SetMemoryCursor(strtoul(args[1].c_str(), nullptr, 0));
}
return nullptr;
}

Json::Value* CmdShowDisassembly(std::vector<std::string>& args)
{
if (gekkoDebug)
{
gekkoDebug->SetDisasmCursor(strtoul(args[1].c_str(), nullptr, 0));
}
return nullptr;
}

void DebugUIReflector()
{
JdiAddCmd("d", CmdShowMemory);
JdiAddCmd("u", CmdShowDisassembly);
}
}
7 changes: 7 additions & 0 deletions src/debugui.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ Gekko and DSP disassemblers are in the emulator core, in the corresponding compo

#pragma once

#define DEBUG_UI_JDI_JSON "./Data/Json/DebugUIJdi.json"

namespace Debug
{
void DebugUIReflector();
}

namespace Debug
{

Expand Down
14 changes: 3 additions & 11 deletions src/exi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

SRAM : little piece of battery-backed data. 64 bytes or so.
RTC : 32-bit counter of seconds, since current millenium
AD16 : debugging 32-bit register
AD16 : This is most likely a debugging device called `Barnacle`.

memcard should be in another module (see MC.cpp)
broad band adapter should be in another module (see BBA.cpp)
Expand Down Expand Up @@ -62,17 +62,8 @@ using namespace Debug;
// SI state (registers and other data)
EIControl exi;

// bootrom copyright message (at offset 0). PAL only, NTSC has garbage.
// can be used by apps to detect PAL/NTSC cube.
static char palver[0x100] = "(C) 1999-2001 Nintendo. All rights reserved."
"(C) 1999 ArtX Inc. All rights reserved."
"PAL Revision 1.0 ";
// ^^^
static char ntscver[0x100] = "ABRACADABRA";

// forward refs on EXI transfers
void UnknownTransfer(); // ???
void MXTransfer(); // bootrom, RTC and SRAM
void ADTransfer(); // AD16

// EXI transfer bindings
Expand Down Expand Up @@ -150,7 +141,8 @@ void UnknownTransfer()
}
}

// AD chip? transfer (EXI device 2:0)
// AD16 device transfer (EXI device 2:0)
// This is most likely a debugging device called `Barnacle`.
void ADTransfer()
{
// read or write ?
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.1"
#define EMU_VERSION L"1.2"

void EMUGetHwConfig(HWConfig* config);

Expand Down
42 changes: 0 additions & 42 deletions src/res/pureikyubu.rc
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,6 @@ BEGIN
COMBOBOX IDC_MEMCARD_SIZES,7,7,127,16,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END

IDD_SETTINGS_EMU DIALOGEX 0, 0, 230, 256
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Nothing to configure.",IDC_STATIC,12,12,199,14,SS_CENTERIMAGE
PUSHBUTTON "Reset ALL\nsettings",IDC_WINDALL,150,216,48,24,BS_MULTILINE | NOT WS_TABSTOP
CONTROL "",IDC_ENSURE_WINDALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,216,12,10
END

IDD_SETTINGS_GUI DIALOGEX 0, 0, 230, 254
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
Expand Down Expand Up @@ -161,13 +152,6 @@ BEGIN
LTEXT "DSP IROM file:",IDC_STATIC,12,138,96,10
END

IDD_SETTINGS_HLE DIALOGEX 0, 0, 230, 256
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Nothing to configure.",IDC_STATIC,12,12,199,14,SS_CENTERIMAGE
END

IDD_DIALOG_PAD DIALOGEX 0, 0, 360, 255
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Configure Controller"
Expand Down Expand Up @@ -265,14 +249,6 @@ BEGIN
BEGIN
END

IDD_SETTINGS_EMU, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 223
TOPMARGIN, 7
BOTTOMMARGIN, 249
END

IDD_SETTINGS_GUI, DIALOG
BEGIN
LEFTMARGIN, 7
Expand All @@ -289,14 +265,6 @@ BEGIN
BOTTOMMARGIN, 249
END

IDD_SETTINGS_HLE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 223
TOPMARGIN, 7
BOTTOMMARGIN, 249
END

IDD_DIALOG_PAD, DIALOG
BEGIN
LEFTMARGIN, 7
Expand Down Expand Up @@ -459,11 +427,6 @@ END
// AFX_DIALOG_LAYOUT
//

IDD_SETTINGS_HLE AFX_DIALOG_LAYOUT
BEGIN
0
END

IDD_DIALOG_PAD AFX_DIALOG_LAYOUT
BEGIN
0
Expand All @@ -474,11 +437,6 @@ BEGIN
0
END

IDD_SETTINGS_EMU AFX_DIALOG_LAYOUT
BEGIN
0
END

IDD_SETTINGS_HW AFX_DIALOG_LAYOUT
BEGIN
0
Expand Down