pureikyubu/SRC/DSP
2020-11-08 23:11:47 +03:00
..
Scripts Updated projects 2020-09-03 13:21:34 +03:00
DSP.cpp Dsp DMEM watches 2020-09-03 00:20:44 +03:00
DSP.h DspParallelOps 2020-09-02 15:40:40 +03:00
DspAccel.cpp More portable code 2020-08-08 20:10:33 +03:00
DspAccel.h DSP refactoring 2020-08-01 16:01:21 +03:00
DspAdpcm.cpp More portable code 2020-08-08 20:10:33 +03:00
DspAdpcm.h DSP refactoring 2020-08-01 16:01:21 +03:00
DspAlu.cpp DspMultiplyOps 2020-09-02 17:52:34 +03:00
DspAlu.h DspParallelOps 2020-09-02 15:40:40 +03:00
DspAnalyzer.cpp Fixed pld 2020-09-02 22:21:21 +03:00
DspAnalyzer.h Some notes and thoughts 2020-11-08 23:11:47 +03:00
DspCommands.cpp Dsp DMEM watches 2020-09-03 00:20:44 +03:00
DspCommands.h Paths fixed for pissed linux 2020-08-09 21:36:10 +03:00
DspCore.cpp Small fixes 2020-10-06 12:53:29 +03:00
DspCore.h BuildFileTree for MountDVD 2020-09-11 01:17:18 +03:00
DspDisasm.cpp Small fixes, ready for interpreter 2020-09-01 15:52:56 +03:00
DspDisasm.h Group1, Group2 2020-09-01 02:11:47 +03:00
DspDma.cpp Group1, Group2 2020-09-01 02:11:47 +03:00
DspDma.h DSP refactoring 2020-08-01 16:01:21 +03:00
DspInterpreter.cpp BuildFileTree for MountDVD 2020-09-11 01:17:18 +03:00
DspInterpreter.h DspMultiplyOps 2020-09-02 17:52:34 +03:00
DspMailbox.cpp DSP refactoring 2020-08-01 16:01:21 +03:00
DspMultiplyOps.cpp DspMultiplyOps 2020-09-02 17:52:34 +03:00
DspParallelMemOps.cpp DspParallelOps 2020-09-02 15:40:40 +03:00
DspParallelOps.cpp lsf/asf fixed 2020-09-03 00:54:53 +03:00
DspRegularOps.cpp lsf/asf fixed 2020-09-03 00:54:53 +03:00
DspStack.cpp Small fixes 2020-09-01 22:31:45 +03:00
DspStack.h DSPcore stack implementation 2020-09-01 22:02:43 +03:00
pch.cpp DSP as standalone component 2020-03-30 11:21:16 +03:00
pch.h Updated projects 2020-09-03 13:21:34 +03:00
Readme.md Cleanup 2020-09-04 14:26:47 +03:00

GAMECUBE DSP

Low-level DSP emulation module.

DspCore

How does the DSP core work.

The Run method executes the Update method until it is stopped by the Suspend method or it encounters a breakpoint.

Suspend method stops DSP thread execution indifinitely.

The Step debugging method is used to unconditionally execute next DSP instruction (by interpreter).

The Update method checks the value of Gekko TBR. If its value has exceeded the limit for the execution of one DSP instruction (or segment in case of Jitc), interpreter/Jitc Execute method is called.

DspCore uses the interpreter and recompiler at the same time, of their own free will, depending on the situation.

DSP analyzer

This component analyzes the DSP instructions and is used by all interested systems (disassembler, interpreter and recompiler). That is, in fact, this is a universal decoder.

I decided to divide all the DSP instructions into groups (by higher 4 bits). Decoder implemented as simple if-else.

Parallel instructions are stored into two different groups in AnalyseInfo struct.

The simplest example of AnalyzeInfo consumption can be found in the disassembler.

The DSP instruction format is so tightly packed and has a lot of entropy, so I could make a mistake in decoding somewhere. All this then has to appear.

GameCube DSP interpreter

The development idea is as follows - to do at least something (critical mass of code), then do some reverse engineering of the microcodes and IROM and bring the emulation to an adequate state.

Interpreter architecture

The interpreter is not involved in instruction decoding. It receives ready-made information from the analyzer (AnalyzeInfo struct).

This is a new concept of emulation of processor systems, which I decided to try on the GameCube DSP.

Mailbox Sync

Specifics of Mailbox registers (registers consist of two halves) impose some features on their emulation.

When accessed, Dead Lock may occur when the processor hangs on the polling DSP Mailbox, and the DSP hangs on polling the CPU Mailbox. This happens due to the almost simultaneous writing to both Mailbox from two "ends".

DSP JDI

The debugging interface specification provided by this component can be found in Data/Json/DspJdi.json.