mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-28 01:15:04 -04:00
refactor: refactor VU1 (#191)
* feat: implement fix and changes based on dark cloud report fix: fix GS AFAIL for RGB/alpha/Z, ZMSK fix: fix VU1 flags mask and pipeline fix: small VU1 cache fix feat: __ct__, __sinit_ are not sillent stubs anymore * feat: fix song JP pulling * feat: sound update for lotR * feat: prevent guest execution to be very slow * fix: small gs size bug * feat: refactor VU fix: fix cliping and other issues on gs fix: fix wrong vu0 register on recompiler * fix fix ACC scheduler stall feat: remove unused test fix: .fix overflow e underflow on FMAC * feat: small setting for windows test
This commit is contained in:
@@ -670,37 +670,21 @@ namespace ps2recomp
|
||||
// VU0_VLDQ = 0x1F // VU0 Load/Store Quad with Decrement
|
||||
// };
|
||||
|
||||
// VU0 Control Register Numbers (used with CFC2/CTC2)
|
||||
// VU0 COP2 control register numbers used by CFC2/CTC2.
|
||||
// Registers 0..15 address VI0..VI15 directly.
|
||||
enum VU0ControlRegisters
|
||||
{
|
||||
VU0_CR_STATUS = 0, // Status/Control register
|
||||
VU0_CR_MAC = 1, // MAC flags register
|
||||
VU0_CR_CLIP = 5, // Clipping flags register
|
||||
VU0_CR_R = 3, // R register (Random number)
|
||||
VU0_CR_I = 4, // I register (Immediate)
|
||||
|
||||
// Add missing registers
|
||||
VU0_CR_VPU_STAT = 2, // VPU-STAT register
|
||||
VU0_CR_TPC = 6, // T (program counter) register
|
||||
VU0_CR_CMSAR0 = 7, // Call/return address 0
|
||||
VU0_CR_FBRST = 8, // VIF/VU reset register
|
||||
VU0_CR_VPU_STAT2 = 9, // VPU-STAT register 2
|
||||
VU0_CR_TPC2 = 10, // T (program counter) register 2
|
||||
VU0_CR_CMSAR1 = 11, // Call/return address 1
|
||||
VU0_CR_FBRST2 = 12, // VIF/VU reset register 2
|
||||
VU0_CR_VPU_STAT3 = 13, // VPU-STAT register 3
|
||||
VU0_CR_CMSAR2 = 14, // Call/return address 2
|
||||
VU0_CR_FBRST3 = 15, // VIF/VU reset register 3
|
||||
VU0_CR_VPU_STAT4 = 16, // VPU-STAT register 4
|
||||
VU0_CR_CMSAR3 = 17, // Call/return address 3
|
||||
VU0_CR_FBRST4 = 18, // VIF/VU reset register 4
|
||||
VU0_CR_ACC = 20, // Accumulator register
|
||||
VU0_CR_INFO = 21, // Information register
|
||||
VU0_CR_CLIP2 = 22, // Clipping flags register 2
|
||||
VU0_CR_P = 26, // P register
|
||||
VU0_CR_XITOP = 27, // XITOP register
|
||||
VU0_CR_ITOP = 28, // ITOP register
|
||||
VU0_CR_TOP = 29 // TOP register
|
||||
VU0_CR_STATUS = 16,
|
||||
VU0_CR_MAC = 17,
|
||||
VU0_CR_CLIP = 18,
|
||||
VU0_CR_R = 20,
|
||||
VU0_CR_I = 21,
|
||||
VU0_CR_Q = 22,
|
||||
VU0_CR_TPC = 26,
|
||||
VU0_CR_CMSAR0 = 27,
|
||||
VU0_CR_FBRST = 28,
|
||||
VU0_CR_VPU_STAT = 29,
|
||||
VU0_CR_CMSAR1 = 31
|
||||
};
|
||||
enum VU0OPSFunctions
|
||||
{
|
||||
|
||||
@@ -34,8 +34,10 @@ namespace ps2recomp
|
||||
bool recompile();
|
||||
void generateOutput();
|
||||
void printReport() const;
|
||||
const RecompilerReporter::Counters &reportCounters() const { return m_reporter.counters(); }
|
||||
|
||||
static StubTarget resolveStubTarget(const std::string& name);
|
||||
static bool IsCorrectnessCriticalFunctionName(const std::string &name);
|
||||
static size_t DiscoverAdditionalEntryPoints(
|
||||
std::vector<Function> &functions,
|
||||
std::unordered_map<uint32_t, std::vector<Instruction>> &decodedFunctions,
|
||||
@@ -65,6 +67,7 @@ namespace ps2recomp
|
||||
std::unordered_set<std::string> m_stubFunctions;
|
||||
std::unordered_set<uint32_t> m_stubFunctionStarts;
|
||||
std::unordered_map<uint32_t, std::string> m_stubHandlerBindingsByStart;
|
||||
std::unordered_set<uint32_t> m_correctnessCriticalFunctionStarts;
|
||||
std::map<uint32_t, std::string> m_generatedStubs;
|
||||
std::unordered_map<uint32_t, std::string> m_functionRenames;
|
||||
std::unordered_map<uint32_t, std::vector<uint32_t>> m_resumeEntryTargetsByOwner;
|
||||
@@ -74,6 +77,9 @@ namespace ps2recomp
|
||||
void discoverAdditionalEntryPoints();
|
||||
bool shouldSkipFunction(const Function &function) const;
|
||||
bool isStubFunction(const Function &function) const;
|
||||
bool isCorrectnessCriticalFunction(const Function &function) const;
|
||||
bool hasResolvedStubHandler(const Function &function) const;
|
||||
void collectCorrectnessCriticalFunctionStarts();
|
||||
bool generateFunctionHeader();
|
||||
bool generateStubHeader();
|
||||
bool writeToFile(const std::string &path, const std::string &content);
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace ps2recomp
|
||||
size_t unhandledInstructions = 0;
|
||||
size_t indirectFallbackPromotions = 0;
|
||||
size_t indirectFallbackEntries = 0;
|
||||
size_t correctnessCriticalGuestFallbacks = 0;
|
||||
size_t correctnessCriticalFailures = 0;
|
||||
};
|
||||
|
||||
void progress(const std::string &message);
|
||||
@@ -63,6 +65,8 @@ namespace ps2recomp
|
||||
void recordDecodeFailure();
|
||||
void recordAdditionalEntryPoints(size_t count);
|
||||
void recordGeneratedFunctions(size_t count);
|
||||
void recordCorrectnessCriticalGuestFallback();
|
||||
void recordCorrectnessCriticalFailure();
|
||||
void recordIndirectFallbackPromotion(const std::string &functionName,
|
||||
const std::vector<uint32_t> &jumpAddresses,
|
||||
size_t promotedEntryCount);
|
||||
|
||||
Reference in New Issue
Block a user