Xbox: Fix log output on Xemu

This commit is contained in:
UnknownShadow200 2025-09-09 20:28:35 +10:00
parent f7dbe57966
commit 39c266af1b
9 changed files with 50 additions and 10 deletions

15
misc/3ds/PORT_INFO.md Normal file
View File

@ -0,0 +1,15 @@
To see debug log messages in Citra:
1) Make sure log level set to "Debug.Emulated:Debug"
---
Commands used to generate the .bin files:
`bannertool makebanner -i banner.png -a audio.wav -o banner.bin`
`bannertool makesmdh -s ClassiCube -l ClassiCube -p UnknownShadow200 -i icon.png -o icon.bin`
----
Debug log messages output to debug service, so may be possible to see from console via remote gdb

3
misc/gba/PORT_INFO.md Normal file
View File

@ -0,0 +1,3 @@
To see debug log messages in mGBA:
1) In the UI, make sure in Tools > Logging, that Debugger is enabled

5
misc/gc/PORT_INFO.md Normal file
View File

@ -0,0 +1,5 @@
To see debug log messages in Dolphin:
1) In the UI, make sure 'Show log configuration' checkbox is checked in View menu
2) Make sure "OSReport EXI (OSREPORT)" log type is enabled
3) In the UI, make sure 'Show log' checkbox is checked in View menu

5
misc/wii/PORT_INFO.md Normal file
View File

@ -0,0 +1,5 @@
To see debug log messages in Dolphin:
1) In the UI, make sure 'Show log configuration' checkbox is checked in View menu
2) Make sure "OSReport EXI (OSREPORT)" log type is enabled
3) In the UI, make sure 'Show log' checkbox is checked in View menu

7
misc/xbox/PORT_INFO.md Normal file
View File

@ -0,0 +1,7 @@
To see debug log messages in Xemu:
1) Launch Xemu as `xemu -device lpc47m157 -serial stdio`
----
To launch directly, `-dvd_path cc-xbox.iso`

View File

@ -53,7 +53,6 @@ unsigned int __stacksize__ = 256 * 1024;
*------------------------------------------------------Logging/Time-------------------------------------------------------*
*#########################################################################################################################*/
void Platform_Log(const char* msg, int len) {
// output to debug service (visible in Citra with log level set to "Debug.Emulated:Debug", or on console via remote gdb)
svcOutputDebugString(msg, len);
}

View File

@ -30,6 +30,17 @@ typedef void (*GL_SetupVBRangeFunc)(int startVertex);
static GL_SetupVBFunc gfx_setupVBFunc;
static GL_SetupVBRangeFunc gfx_setupVBRangeFunc;
static void CheckSupport(void) {
static const cc_string bgraExt = String_FromConst("GL_EXT_bgra");
cc_string extensions = String_FromReadonly((const char*)_glGetString(GL_EXTENSIONS));
const GLubyte* ver = _glGetString(GL_VERSION);
/* Version string is always: x.y. (and whatever afterwards) */
int major = ver[0] - '0', minor = ver[2] - '0';
/* Some old IRIX cards don't support BGRA */
convert_rgba = major == 1 && minor <= 1 && !String_CaselessContains(&extensions, &bgraExt);
}
void Gfx_Create(void) {
GLContext_Create();
GL_InitCommon();
@ -37,6 +48,7 @@ void Gfx_Create(void) {
MakeIndices(gl_indices, GFX_MAX_INDICES, NULL);
Gfx_RestoreState();
GLContext_SetVSync(gfx_vsync);
CheckSupport();
}

View File

@ -48,10 +48,6 @@ cc_bool Platform_ReadonlyFilesystem;
/*########################################################################################################################*
*------------------------------------------------------Logging/Time-------------------------------------------------------*
*#########################################################################################################################*/
// To see these log messages:
// 1) In the UI, make sure 'Show log configuration' checkbox is checked in View menu
// 2) Make sure "OSReport EXI (OSREPORT)" log type is enabled
// 3) In the UI, make sure 'Show log' checkbox is checked in View menu
static void LogOverEXI(char* msg, int len) {
u32 cmd = 0x80000000 | (0x800400 << 6); // write flag, UART base address

View File

@ -34,13 +34,11 @@ cc_bool Platform_ReadonlyFilesystem;
*------------------------------------------------------Logging/Time-------------------------------------------------------*
*#########################################################################################################################*/
void Platform_Log(const char* msg, int len) {
char tmp[2048 + 1];
char tmp[2048 + 2];
len = min(len, 2048);
Mem_Copy(tmp, msg, len); tmp[len] = '\0';
Mem_Copy(tmp, msg, len); tmp[len] = '\n'; tmp[len + 1] = '\0';
// log to on-screen display
debugPrint("%s\n", tmp);
// log to cxbx-reloaded console
// log to cxbx-reloaded console or Xemu serial output
OutputDebugStringA(tmp);
}