Creeper: Now handling sync on the EE

This commit is contained in:
Correia 2024-05-24 20:19:42 -03:00
parent 23e849fdf3
commit 8a4e384198
6 changed files with 24 additions and 23 deletions

View File

@ -6,6 +6,22 @@
#include <creeper/inst_operands.h>
#include <engine/ee_info.h>
#define RD_DW cpu->GPRs[ops.rd].dw[0]
#define RT_DW cpu->GPRs[ops.rt].dw[0]
#define RS_DW cpu->GPRs[ops.rs].dw[0]
#define RD_SW cpu->GPRs[ops.rd].sdw[0]
#define RT_SW cpu->GPRs[ops.rt].sdw[0]
#define RS_SW cpu->GPRs[ops.rs].sdw[0]
// #define RD_WORDS cpu->GPRs[ops.rd].words[0]
#define RT_WORDS cpu->GPRs[ops.rt].words[0]
#define RS_WORDS cpu->GPRs[ops.rs].words[0]
// #define RD_WORDS_S cpu->GPRs[ops.rd].swords[0]
#define RT_WORDS_S cpu->GPRs[ops.rt].swords[0]
#define RS_WORDS_S cpu->GPRs[ops.rs].swords[0]
namespace cosmic {
namespace vm { class EmuVm; }
namespace engine {
@ -23,6 +39,7 @@ namespace cosmic::creeper::ee {
Cop0 = 0x12,
Mac0 = 0x14,
Branch = 0x16,
Sync = 0x18
};
friend EffectivePipeline operator^(EffectivePipeline dest, EffectivePipeline src) {
return static_cast<EffectivePipeline>(static_cast<u16>(dest) ^ static_cast<u16>(src));

View File

@ -1,20 +0,0 @@
#pragma once
#include <creeper/ee/fast_macros.h>
#include <creeper/inst_operands.h>
#define RD_DW cpu->GPRs[ops.rd].dw[0]
#define RT_DW cpu->GPRs[ops.rt].dw[0]
#define RS_DW cpu->GPRs[ops.rs].dw[0]
#define RD_SW cpu->GPRs[ops.rd].sdw[0]
#define RT_SW cpu->GPRs[ops.rt].sdw[0]
#define RS_SW cpu->GPRs[ops.rs].sdw[0]
// #define RD_WORDS cpu->GPRs[ops.rd].words[0]
#define RT_WORDS cpu->GPRs[ops.rt].words[0]
#define RS_WORDS cpu->GPRs[ops.rs].words[0]
// #define RD_WORDS_S cpu->GPRs[ops.rd].swords[0]
#define RT_WORDS_S cpu->GPRs[ops.rt].swords[0]
#define RS_WORDS_S cpu->GPRs[ops.rs].swords[0]

View File

@ -1,5 +1,4 @@
#include <creeper/ee/cached_blocks.h>
#include <creeper/ee/fast_macros.h>
#include <engine/ee_core.h>
#include <console/backdoor.h>

View File

@ -1,5 +1,4 @@
#include <creeper/ee/cached_blocks.h>
#include <creeper/ee/fast_macros.h>
#include <engine/ee_core.h>
#include <console/backdoor.h>
#include <vm/emu_vm.h>
@ -44,8 +43,9 @@ namespace cosmic::creeper::ee {
// https://github.com/PSI-Rockin/DobieStation/blob/68dd073e751960fd01c839ac34ce6e056d70024a/src/core/ee/emotion.cpp#L591
// https://forums.pcsx2.net/Thread-Patch-Making-For-Dummies-SceMpegIsEnd
// jr $ra = 0x03e00008;
[[likely]] if (cpu->mipsRead<u32>(*cpu->eePc + 4) != 0x03e00008)
[[likely]] if (cpu->mipsRead<u32>(*cpu->eePc + 4) != 0x03e00008) {
return;
}
// We haven't implemented MPEG decoders for now, so we have to skip all possible scenes
const u32 next{cpu->mipsRead<u32>(*cpu->eePc)};
// lw reg, 0x40($a0) = 0x8c800040;

View File

@ -18,6 +18,7 @@ namespace cosmic::creeper::ee {
{SpecialMovN, {movn, "movn"}},
{SpecialSyscall, {iSyscall, "syscall"}},
{SpecialBreak, {iBreak, "break"}},
{SpecialSync, {nop, "sync"}},
{SpecialMult, {mult, "mult"}},
{SpecialMultu, {multu, "multu"}},
@ -41,6 +42,9 @@ namespace cosmic::creeper::ee {
case SpecialJr:
codes.pipe = OutOfOrder::EffectivePipeline::Branch;
break;
case SpecialSync:
codes.pipe = OutOfOrder::EffectivePipeline::Sync;
break;
case SpecialMult:
case SpecialMultu:
codes.pipe = OutOfOrder::EffectivePipeline::Mac0;

View File

@ -43,6 +43,7 @@ namespace cosmic::engine {
SpecialMovN = 0xb,
SpecialSyscall = 0xc,
SpecialBreak = 0xd,
SpecialSync = 0xf,
SpecialMult = 0x18,
SpecialMultu = 0x19,
SpecialDiv = 0x1a,