cycle counting fixed

This commit is contained in:
Simone Coco
2022-10-05 12:09:31 +02:00
parent 80c8718fef
commit 4757cbb8ef
4 changed files with 4 additions and 3 deletions

View File

@@ -7,7 +7,6 @@ void App::Run() {
const u8* state = SDL_GetKeyboardState(nullptr);
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);
while (!core.done) {
core.UpdateController(state);
core.Run(window, window.volumeL, window.volumeR);
SDL_Event event;
@@ -54,6 +53,8 @@ void App::Run() {
}
} break;
}
core.UpdateController(state);
}
}
}

View File

@@ -32,7 +32,6 @@ CartInfo Core::LoadROM(const std::string& rom_) {
void Core::Run(Window& window, float volumeL, float volumeR) {
MMIO& mmio = mem.mmio;
Controller& controller = mmio.si.controller;
int cycles = 0;
for(int field = 0; field < mmio.vi.numFields; field++) {
int frameCycles = 0;
if(!pause && romLoaded) {

View File

@@ -18,6 +18,7 @@ struct Core {
VI& GetVI() { return mem.mmio.vi; }
u32 breakpoint = 0;
int cycles = 0;
bool pause = true;
bool romLoaded = false;

View File

@@ -95,7 +95,7 @@ inline void cop2(RSP& rsp, u32 instr) {
case 0x04: rsp.mtc2(instr); break;
case 0x06: rsp.ctc2(instr); break;
case 0x10: case 0x1C: case 0x1E:
case 0x1F: case 0x14: break;
case 0x1F: case 0x14: rsp.vzero(instr); break;
default: util::panic("Unhandled RSP COP2 sub ({:05b})\n", mask_sub);
}
break;