From 9cda50c6774e0ec79fe90a0bc2a17506ad25703d Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Fri, 17 Oct 2014 11:49:22 +0700 Subject: [PATCH] Add RSP.romname --- N64.cpp | 2 ++ N64.h | 1 + RSP.cpp | 9 +++++++++ RSP.h | 1 + common/CommonAPIImpl_common.cpp | 1 + 5 files changed, 14 insertions(+) diff --git a/N64.cpp b/N64.cpp index c18600fb..7efa4f0b 100644 --- a/N64.cpp +++ b/N64.cpp @@ -1,9 +1,11 @@ #include "N64.h" +u8 *HEADER; u8 *DMEM; u8 *IMEM; u64 TMEM[512]; u8 *RDRAM; + u32 RDRAMSize; N64Regs REG; diff --git a/N64.h b/N64.h index 31e76790..1191d5a1 100644 --- a/N64.h +++ b/N64.h @@ -35,6 +35,7 @@ struct N64Regs }; extern N64Regs REG; +extern u8 *HEADER; extern u8 *DMEM; extern u8 *IMEM; extern u8 *RDRAM; diff --git a/RSP.cpp b/RSP.cpp index eac29800..b7a830c3 100644 --- a/RSP.cpp +++ b/RSP.cpp @@ -263,6 +263,15 @@ void RSP_Init() RSP.uc_start = RSP.uc_dstart = 0; RSP.bLLE = false; + // get the name of the ROM + for (int i = 0; i < 20; ++i) + RSP.romname[i] = HEADER[(32 + i) ^ 3]; + RSP.romname[20] = 0; + + // remove all trailing spaces + while (RSP.romname[strlen(RSP.romname) - 1] == ' ') + RSP.romname[strlen(RSP.romname) - 1] = 0; + memset(&gSP, 0, sizeof(gSPInfo)); gDP.loadTile = &gDP.tiles[7]; diff --git a/RSP.h b/RSP.h index 06ef3fb2..81c8a8b5 100644 --- a/RSP.h +++ b/RSP.h @@ -8,6 +8,7 @@ typedef struct u32 PC[18], PCi, busy, halt, close, DList, uc_start, uc_dstart, cmd, nextCmd; s32 count; bool bLLE; + char romname[21]; } RSPInfo; extern RSPInfo RSP; diff --git a/common/CommonAPIImpl_common.cpp b/common/CommonAPIImpl_common.cpp index f0c94155..3a5a4c63 100644 --- a/common/CommonAPIImpl_common.cpp +++ b/common/CommonAPIImpl_common.cpp @@ -140,6 +140,7 @@ void PluginAPI::UpdateScreen() } void PluginAPI::_initiateGFX(const GFX_INFO & _gfxInfo) const { + HEADER = _gfxInfo.HEADER; DMEM = _gfxInfo.DMEM; IMEM = _gfxInfo.IMEM; RDRAM = _gfxInfo.RDRAM;