mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-07 12:44:22 -05:00
Dolphin now uses the simulated memory size defined in `bi2.bin` to adjust the memory size in the emulated console automatically. If **Enable Emulated Memory Size Override** has been enabled by the user, the fixed memory size specified for **MEM1** and **MEM2** are still used as they were before. Most retail games do not define the simulated memory size (Wii or Triforce games), or define it to a value that matches the default 24 MiB (GameCube games), so, in the general case, there is no behavior change. One game that sets the simulated memory to a non-default value is the debug build of _Mario Kart: Double Dash!!_, where the value is set to 48 MiB. This enhancement is focused mainly to the modding community. Prior to these changes, modded games with extended memory requirements would fail to launch in Dolphin [with no indication of what the problem is] if the user failed to set the emulated memory override to the correct value. Now, modding tools can specify the simulated memory size in the `bi2.bin` file to produce extended games that _just work_ in Dolphin, without cumbersome instructions that can be overlooked by the user.
225 lines
5.5 KiB
C++
225 lines
5.5 KiB
C++
// Copyright 2020 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
class GeometryShaderManager;
|
|
class Interpreter;
|
|
class JitInterface;
|
|
class PerformanceMetrics;
|
|
class PixelShaderManager;
|
|
class SoundStream;
|
|
struct Sram;
|
|
class VertexShaderManager;
|
|
struct VideoEvents;
|
|
class XFStateManager;
|
|
|
|
namespace AudioInterface
|
|
{
|
|
class AudioInterfaceManager;
|
|
}
|
|
namespace CPU
|
|
{
|
|
class CPUManager;
|
|
}
|
|
namespace CommandProcessor
|
|
{
|
|
class CommandProcessorManager;
|
|
}
|
|
namespace CoreTiming
|
|
{
|
|
class CoreTimingManager;
|
|
}
|
|
namespace DSP
|
|
{
|
|
class DSPManager;
|
|
}
|
|
namespace DVD
|
|
{
|
|
class DVDInterface;
|
|
class DVDThread;
|
|
} // namespace DVD
|
|
namespace ExpansionInterface
|
|
{
|
|
class ExpansionInterfaceManager;
|
|
}
|
|
namespace Fifo
|
|
{
|
|
class FifoManager;
|
|
}
|
|
class FifoPlayer;
|
|
class FifoRecorder;
|
|
namespace GPFifo
|
|
{
|
|
class GPFifoManager;
|
|
}
|
|
namespace IOS::HLE
|
|
{
|
|
class EmulationKernel;
|
|
class USBScanner;
|
|
} // namespace IOS::HLE
|
|
namespace HSP
|
|
{
|
|
class HSPManager;
|
|
}
|
|
namespace IOS
|
|
{
|
|
class WiiIPC;
|
|
}
|
|
namespace IOS::HLE::USB
|
|
{
|
|
class SkylanderPortal;
|
|
class InfinityBase;
|
|
} // namespace IOS::HLE::USB
|
|
namespace Memory
|
|
{
|
|
class MemoryManager;
|
|
}
|
|
namespace MemoryInterface
|
|
{
|
|
class MemoryInterfaceManager;
|
|
}
|
|
namespace Movie
|
|
{
|
|
class MovieManager;
|
|
}
|
|
namespace PixelEngine
|
|
{
|
|
class PixelEngineManager;
|
|
}
|
|
namespace PowerPC
|
|
{
|
|
class MMU;
|
|
class PowerPCManager;
|
|
struct PowerPCState;
|
|
} // namespace PowerPC
|
|
class PPCSymbolDB;
|
|
namespace ProcessorInterface
|
|
{
|
|
class ProcessorInterfaceManager;
|
|
}
|
|
namespace SerialInterface
|
|
{
|
|
class SerialInterfaceManager;
|
|
}
|
|
namespace SystemTimers
|
|
{
|
|
class SystemTimersManager;
|
|
}
|
|
namespace VideoCommon
|
|
{
|
|
class CustomResourceManager;
|
|
} // namespace VideoCommon
|
|
namespace VideoInterface
|
|
{
|
|
class VideoInterfaceManager;
|
|
}
|
|
|
|
namespace Core
|
|
{
|
|
// Central class that encapsulates the running system.
|
|
class System
|
|
{
|
|
public:
|
|
~System();
|
|
|
|
System(const System&) = delete;
|
|
System& operator=(const System&) = delete;
|
|
|
|
System(System&&) = delete;
|
|
System& operator=(System&&) = delete;
|
|
|
|
// Intermediate instance accessor until global state is eliminated.
|
|
static System& GetInstance()
|
|
{
|
|
static System instance;
|
|
return instance;
|
|
}
|
|
|
|
void Initialize();
|
|
|
|
bool IsDualCoreMode() const { return m_separate_cpu_and_gpu_threads; }
|
|
bool IsMMUMode() const { return m_mmu_enabled; }
|
|
bool IsPauseOnPanicMode() const { return m_pause_on_panic_enabled; }
|
|
bool IsMIOS() const { return m_is_mios; }
|
|
bool IsTriforce() const { return m_is_triforce; }
|
|
bool IsWii() const { return m_is_wii; }
|
|
bool IsBranchWatchIgnoreApploader() { return m_branch_watch_ignore_apploader; }
|
|
u32 GetSimulatedMemorySize() const { return m_simulated_memory_size; }
|
|
|
|
void SetIsMIOS(bool is_mios) { m_is_mios = is_mios; }
|
|
void SetIsTriforce(bool is_triforce) { m_is_triforce = is_triforce; }
|
|
void SetIsWii(bool is_wii) { m_is_wii = is_wii; }
|
|
void SetIsBranchWatchIgnoreApploader(bool enable) { m_branch_watch_ignore_apploader = enable; }
|
|
|
|
SoundStream* GetSoundStream() const;
|
|
void SetSoundStream(std::unique_ptr<SoundStream> sound_stream);
|
|
bool IsSoundStreamRunning() const;
|
|
void SetSoundStreamRunning(bool running);
|
|
bool IsAudioDumpStarted() const;
|
|
void SetAudioDumpStarted(bool started);
|
|
|
|
IOS::HLE::EmulationKernel* GetIOS() const;
|
|
void SetIOS(std::unique_ptr<IOS::HLE::EmulationKernel> ios);
|
|
|
|
AudioInterface::AudioInterfaceManager& GetAudioInterface() const;
|
|
CPU::CPUManager& GetCPU() const;
|
|
CoreTiming::CoreTimingManager& GetCoreTiming() const;
|
|
CommandProcessor::CommandProcessorManager& GetCommandProcessor() const;
|
|
DSP::DSPManager& GetDSP() const;
|
|
DVD::DVDInterface& GetDVDInterface() const;
|
|
DVD::DVDThread& GetDVDThread() const;
|
|
ExpansionInterface::ExpansionInterfaceManager& GetExpansionInterface() const;
|
|
Fifo::FifoManager& GetFifo() const;
|
|
FifoPlayer& GetFifoPlayer() const;
|
|
FifoRecorder& GetFifoRecorder() const;
|
|
GeometryShaderManager& GetGeometryShaderManager() const;
|
|
GPFifo::GPFifoManager& GetGPFifo() const;
|
|
HSP::HSPManager& GetHSP() const;
|
|
Interpreter& GetInterpreter() const;
|
|
JitInterface& GetJitInterface() const;
|
|
IOS::HLE::USB::SkylanderPortal& GetSkylanderPortal() const;
|
|
IOS::HLE::USB::InfinityBase& GetInfinityBase() const;
|
|
IOS::WiiIPC& GetWiiIPC() const;
|
|
Memory::MemoryManager& GetMemory() const;
|
|
MemoryInterface::MemoryInterfaceManager& GetMemoryInterface() const;
|
|
PowerPC::MMU& GetMMU() const;
|
|
Movie::MovieManager& GetMovie() const;
|
|
PerformanceMetrics& GetPerfMetrics() const;
|
|
PixelEngine::PixelEngineManager& GetPixelEngine() const;
|
|
PixelShaderManager& GetPixelShaderManager() const;
|
|
PowerPC::PowerPCManager& GetPowerPC() const;
|
|
PowerPC::PowerPCState& GetPPCState() const;
|
|
PPCSymbolDB& GetPPCSymbolDB() const;
|
|
ProcessorInterface::ProcessorInterfaceManager& GetProcessorInterface() const;
|
|
SerialInterface::SerialInterfaceManager& GetSerialInterface() const;
|
|
Sram& GetSRAM() const;
|
|
SystemTimers::SystemTimersManager& GetSystemTimers() const;
|
|
IOS::HLE::USBScanner& GetUSBScanner() const;
|
|
VertexShaderManager& GetVertexShaderManager() const;
|
|
XFStateManager& GetXFStateManager() const;
|
|
VideoInterface::VideoInterfaceManager& GetVideoInterface() const;
|
|
VideoCommon::CustomResourceManager& GetCustomResourceManager() const;
|
|
VideoEvents& GetVideoEvents() const;
|
|
|
|
private:
|
|
System();
|
|
|
|
struct Impl;
|
|
std::unique_ptr<Impl> m_impl;
|
|
|
|
bool m_separate_cpu_and_gpu_threads = false;
|
|
bool m_mmu_enabled = false;
|
|
bool m_pause_on_panic_enabled = false;
|
|
bool m_is_mios = false;
|
|
bool m_is_triforce = false;
|
|
bool m_is_wii = false;
|
|
bool m_branch_watch_ignore_apploader = false;
|
|
u32 m_simulated_memory_size{0};
|
|
};
|
|
} // namespace Core
|