Handle Disk "Header" for Plugins (not forged, may be unreliable)

This commit is contained in:
LuigiBlood 2019-01-26 14:31:24 +01:00
parent 48ce8fbee7
commit f312476b8b
4 changed files with 16 additions and 3 deletions

View File

@ -27,6 +27,7 @@ public:
void ClearDiskSettingID();
uint8_t * GetDiskAddress() { return m_DiskImage; }
uint8_t * GetDiskAddressBuffer() { return m_DiskImage + m_DiskBufAddress; }
uint8_t * GetDiskHeader() { return m_DiskImage + 0x43650; }
void SetDiskAddressBuffer(uint32_t address) { m_DiskBufAddress = address; }
stdstr GetRomName() const { return m_RomName; }
stdstr GetFileName() const { return m_FileName; }

View File

@ -11,6 +11,7 @@
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64RomClass.h>
#include <Project64-core/N64System/N64DiskClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/N64Class.h>
@ -134,7 +135,10 @@ bool CAudioPlugin::Initiate(CN64System * System, RenderWindow * Window)
CMipsMemoryVM & MMU = System->m_MMU_VM;
CRegisters & Reg = System->m_Reg;
Info.HEADER = g_Rom->GetRomAddress();
if ((g_Rom->CicChipID() == CIC_NUS_8303 || g_Rom->CicChipID() == CIC_NUS_DDUS) && g_Disk != NULL)
Info.HEADER = g_Disk->GetDiskHeader();
else
Info.HEADER = g_Rom->GetRomAddress();
Info.RDRAM = MMU.Rdram();
Info.DMEM = MMU.Dmem();
Info.IMEM = MMU.Imem();

View File

@ -11,6 +11,7 @@
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64RomClass.h>
#include <Project64-core/N64System/N64DiskClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/N64Class.h>
@ -228,7 +229,10 @@ bool CGfxPlugin::Initiate(CN64System * System, RenderWindow * Window)
CMipsMemoryVM & MMU = System->m_MMU_VM;
CRegisters & Reg = System->m_Reg;
Info.HEADER = g_Rom->GetRomAddress();
if ((g_Rom->CicChipID() == CIC_NUS_8303 || g_Rom->CicChipID() == CIC_NUS_DDUS) && g_Disk != NULL)
Info.HEADER = g_Disk->GetDiskHeader();
else
Info.HEADER = g_Rom->GetRomAddress();
Info.RDRAM = MMU.Rdram();
Info.DMEM = MMU.Dmem();
Info.IMEM = MMU.Imem();

View File

@ -13,6 +13,7 @@
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/N64DiskClass.h>
#include "RSPPlugin.h"
#include "GFXPlugin.h"
#include <Project64-core/Plugins/AudioPlugin.h>
@ -185,7 +186,10 @@ bool CRSP_Plugin::Initiate(CPlugins * Plugins, CN64System * System)
CMipsMemoryVM & MMU = System->m_MMU_VM;
CRegisters & Reg = System->m_Reg;
Info.HEADER = g_Rom->GetRomAddress();
if ((g_Rom->CicChipID() == CIC_NUS_8303 || g_Rom->CicChipID() == CIC_NUS_DDUS) && g_Disk != NULL)
Info.HEADER = g_Disk->GetDiskHeader();
else
Info.HEADER = g_Rom->GetRomAddress();
Info.RDRAM = MMU.Rdram();
Info.DMEM = MMU.Dmem();
Info.IMEM = MMU.Imem();