Reset system overhaul
This commit is contained in:
@@ -20,7 +20,6 @@ void Core::Stop() {
|
||||
void Core::LoadROM(const std::string& rom_) {
|
||||
rom = rom_;
|
||||
cpu.Reset();
|
||||
cpu.mem.Reset();
|
||||
pause = false;
|
||||
romLoaded = true;
|
||||
|
||||
@@ -29,9 +28,8 @@ void Core::LoadROM(const std::string& rom_) {
|
||||
cpu.mem.mmio.si.pif.InitDevices(cpu.mem.saveType);
|
||||
cpu.mem.mmio.si.pif.LoadMempak(rom_);
|
||||
cpu.mem.mmio.si.pif.LoadEeprom(cpu.mem.saveType, rom_);
|
||||
isPAL = cpu.mem.IsROMPAL();
|
||||
cpu.mem.mmio.vi.isPal = isPAL;
|
||||
cpu.mem.mmio.si.pif.ExecutePIF(cpu.mem, cpu.regs);
|
||||
cpu.mem.mmio.vi.isPal = cpu.mem.IsROMPAL();
|
||||
}
|
||||
|
||||
void Core::Run(float volumeL, float volumeR) {
|
||||
|
||||
@@ -22,7 +22,6 @@ struct Core {
|
||||
|
||||
bool pause = true;
|
||||
int cycles = 0;
|
||||
bool isPAL = false;
|
||||
bool romLoaded = false;
|
||||
bool done = false;
|
||||
std::string rom;
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
namespace n64 {
|
||||
void Interpreter::Reset() {
|
||||
regs.Reset();
|
||||
mem.Reset();
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,6 @@
|
||||
#include <core/registers/Registers.hpp>
|
||||
|
||||
namespace n64 {
|
||||
MMIO::MMIO () {
|
||||
Reset();
|
||||
}
|
||||
|
||||
void MMIO::Reset() {
|
||||
rsp.Reset();
|
||||
rdp.Reset();
|
||||
|
||||
@@ -13,8 +13,9 @@ struct Mem;
|
||||
struct Registers;
|
||||
|
||||
struct MMIO {
|
||||
MMIO();
|
||||
MMIO() = default;
|
||||
void Reset();
|
||||
|
||||
VI vi;
|
||||
MI mi;
|
||||
AI ai;
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
|
||||
namespace n64 {
|
||||
Mem::Mem() {
|
||||
rom.cart = (u8*)calloc(CART_SIZE, 1);
|
||||
sram = (u8*)calloc(SRAM_SIZE, 1);
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Mem::Reset() {
|
||||
memset(readPages, 0, PAGE_COUNT);
|
||||
memset(writePages, 0, PAGE_COUNT);
|
||||
|
||||
@@ -23,6 +17,11 @@ void Mem::Reset() {
|
||||
writePages[i] = pointer;
|
||||
}
|
||||
|
||||
rom.cart = (u8*)calloc(CART_SIZE, 1);
|
||||
sram = (u8*)calloc(SRAM_SIZE, 1);
|
||||
}
|
||||
|
||||
void Mem::Reset() {
|
||||
memset(rom.cart, 0, CART_SIZE);
|
||||
memset(sram, 0, SRAM_SIZE);
|
||||
mmio.Reset();
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
namespace n64 {
|
||||
RDP::RDP() {
|
||||
rdram = (u8*)calloc(RDRAM_SIZE, 1);
|
||||
Reset();
|
||||
memset(cmd_buf, 0, 0x100000);
|
||||
dpc.status.raw = 0x80;
|
||||
}
|
||||
|
||||
void RDP::Reset() {
|
||||
|
||||
Reference in New Issue
Block a user