Disassemble graphics microcode

This commit is contained in:
Ryan Dwyer 2022-12-04 10:03:59 +10:00
parent 4994fcccee
commit ac256277d2
5 changed files with 1556 additions and 40 deletions

View File

@ -747,11 +747,6 @@ $(B_DIR)/rsp/%.text.bin $(B_DIR)/rsp/%.data.bin: src/rsp/%.s
@mkdir -p $(dir $@)
armips -strequ CODE_FILE $(B_DIR)/rsp/$*.text.bin -strequ DATA_FILE $(B_DIR)/rsp/$*.data.bin $<
# For RSP ucodes which haven't been diassembled yet, copy from extracted
$(B_DIR)/rsp/%.bin: $(E_DIR)/rsp/%.bin
@mkdir -p $(dir $@)
cp $< $@
$(B_DIR)/rsp/%.o: $(B_DIR)/rsp/%.bin
TOOLCHAIN=$(TOOLCHAIN) ROMID=$(ROMID) tools/mkrawobject $< $@

View File

@ -69,6 +69,16 @@
} \
END_SEG(name)
#define RSP_TEXT_SEGMENT(name) \
name##TextStart = .; \
build/ROMID/rsp/name.text.o (.data); \
name##TextEnd = .;
#define RSP_DATA_SEGMENT(name) \
name##DataStart = .; \
build/ROMID/rsp/name.data.o (.data); \
name##DataEnd = .;
OUTPUT_ARCH (mips)
SECTIONS
@ -183,29 +193,20 @@ SECTIONS
BEGIN_SEG(data)
{
build/ROMID/rsp/rspboot.text.o (.data);
build/ROMID/rsp/gsp.text.o (.data);
build/ROMID/rsp/asp.text.o (.data);
RSP_TEXT_SEGMENT(rspboot)
RSP_TEXT_SEGMENT(gsp)
RSP_TEXT_SEGMENT(asp)
LIBFILES(.data)
GAMEFILES(.data)
build/ROMID/rsp/gsp.data.o (.data);
build/ROMID/rsp/asp.data.o (.data);
. = ALIGN(0x10);
RSP_DATA_SEGMENT(gsp)
RSP_DATA_SEGMENT(asp)
}
END_SEG(data)
rspbootTextStart = _dataSegmentStart;
rspbootTextEnd = rspbootTextStart + 0xd0;
gspTextStart = rspbootTextEnd;
gspTextEnd = gspTextStart + 0x1420;
aspTextStart = gspTextEnd;
aspTextEnd = aspTextStart + 0x1930;
gspDataStart = _dataSegmentEnd - 0x800 - 0xb50;
gspDataEnd = gspDataStart + 0x800;
aspDataStart = gspDataEnd;
aspDataEnd = aspDataStart + 0xb50;
/***************************************************************************
* bss
* -------------------------------------------------------------------------

View File

@ -7458,7 +7458,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
rwdata->gdl = tmp = gfxAllocate(5 * sizeof(Gfx));
gSPSetLights1(tmp++, var80062530);
gSPBranchList(tmp++, rodata->primary);
gSPBranchList(tmp++, rodata->opagdl);
}
node = modelGetPart(model->definition, MODELPART_LOGO_0004);
@ -7475,7 +7475,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
if (g_PdLogoAmbientLightFrac > 0.0f) {
gSPSetLights1(tmp++, var80062560);
gSPBranchList(tmp++, rodata->primary);
gSPBranchList(tmp++, rodata->opagdl);
} else {
gSPEndDisplayList(tmp++);
}
@ -7495,7 +7495,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
if (g_PdLogoAmbientLightFrac > 0.0f) {
gSPSetLights1(tmp++, var80062560);
gSPBranchList(tmp++, rodata->primary);
gSPBranchList(tmp++, rodata->opagdl);
} else {
gSPEndDisplayList(tmp++);
}
@ -7515,7 +7515,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
if (g_PdLogoAmbientLightFrac > 0.0f) {
gSPSetLights1(tmp++, var80062560);
gSPBranchList(tmp++, rodata->primary);
gSPBranchList(tmp++, rodata->opagdl);
} else {
gSPEndDisplayList(tmp++);
}

1534
src/rsp/gsp.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,6 @@ class Extractor:
self.extract_mpconfigs()
self.extract_mpstrings()
self.extract_preamble()
self.extract_rsp()
self.extract_textureconfig()
self.extract_textures()
@ -249,19 +248,6 @@ class Extractor:
def extract_preamble(self):
self.write_extracted('preamble.bin', self.rom[0x1000:0x1050])
def extract_rsp_segment(self, name, pos, length):
if pos < 0:
pos = len(self.data) + pos
end = pos + length
content = self.data[pos:end]
self.write_extracted('rsp/' + name, content)
def extract_rsp(self):
self.extract_rsp_segment('gsp.text.bin', 0xd0, 0x1420)
self.extract_rsp_segment('gsp.data.bin', -0x1350, 0x800)
def extract_textures(self):
base = self.val('textures')
datalen = 0x294960 if self.romid == 'jpn-final' else 0x291d60