aboutsummaryrefslogtreecommitdiff
path: root/src/SPU.cpp
diff options
context:
space:
mode:
authorPoroCYon <3253268+PoroCYon@users.noreply.github.com>2023-10-22 15:35:31 +0200
committerGitHub <noreply@github.com>2023-10-22 15:35:31 +0200
commit3ab752b8ca7878246c3d7f8a338a8bc3b0de26dd (patch)
treeb4a8e319bbe4897af2669c01352f7f3787ade537 /src/SPU.cpp
parent3d58a338a16bc41b9106857645fabc0221de711d (diff)
GDB stub (#1583)
* gdbstub beginnings * gdbstub: finish gdb impl things, next up is integration with melonDS * holy fuck the gdbstub works * gdb breakpoints work, but there's a mysterious crash on continue * fix memory corruption that sometimes happened, and make resetting the console thru gdb work * remove some gdb debug printing * fix things in gdbstub * separate option for enabling gdbstub * add mode-dependent CPU registers * C++ize the GDBstub code * add gdbstub config in emu settings dialog * make sure gdb is disabled when jit is enabled * Remove unnecessary compiler flags, mark ARMJIT assembly code as no-execute-stack This hardens the binary a little bit against common exploitation methods * add option to wait for debugger attach on startup * only insert GNU stack notes on linux * disable gdbstub enable checkbox when jit is enabled * fix non-linux incompatibilities * enable gdbstub by default * fix issues with gdbstub settings disable stuff * format stuff * update gdb test code * Fix segfault when calling StubCallbacks->GetCPU() C++ overrides are hard. Please I'm just a lowly C programmer. * fix packet size not being sent correctly Thanks to @GlowingUmbreon on Github for troubleshooting this * fix select(2) calls (i should read docs more properly) * fix GDB command sequencing/parsing issue (hopefully) * [GDB] implement no-ack mode * fix sending ack on handshake * get lldb to work
Diffstat (limited to 'src/SPU.cpp')
-rw-r--r--src/SPU.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/SPU.cpp b/src/SPU.cpp
index e83a0c7..3939aef 100644
--- a/src/SPU.cpp
+++ b/src/SPU.cpp
@@ -856,9 +856,13 @@ void Mix(u32 dummy)
// OutputBufferFrame can never get full because it's
// transfered to OutputBuffer at the end of the frame
- OutputBackbuffer[OutputBackbufferWritePosition ] = leftoutput >> 1;
- OutputBackbuffer[OutputBackbufferWritePosition + 1] = rightoutput >> 1;
- OutputBackbufferWritePosition += 2;
+ // FIXME: apparently this does happen!!!
+ if (OutputBackbufferWritePosition * 2 < OutputBufferSize - 1)
+ {
+ OutputBackbuffer[OutputBackbufferWritePosition ] = leftoutput >> 1;
+ OutputBackbuffer[OutputBackbufferWritePosition + 1] = rightoutput >> 1;
+ OutputBackbufferWritePosition += 2;
+ }
NDS::ScheduleEvent(NDS::Event_SPU, true, 1024, Mix, 0);
}