mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-10-04 11:24:58 -04:00
Feature/runtime review codegen fixes (#87)
* feat: small fixes on code gen * feat: added code gen test * feat: rename IOP * fix: fix special case on JR feat: added code generator test * feat: ps2 logs now need special macros * feat: a lot of regressions test feat: use test to fix bugs on runtime fix: fix incorrect instructions on code generator feat: added missing decode on r5900 decoder feat: added scissor on rasterizer * feat: better ghidra plugin analyzer fix: fix real bug on function finding on elf analyzer * feat: some logs on GS feat: added more syscalls stubs feat: added more ps2 stubs * feat: added missing stub
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "ps2recomp/types.h"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
using namespace ps2recomp;
|
||||
@@ -33,6 +34,16 @@ void register_elf_analyzer_tests()
|
||||
"_printf should be classified as library");
|
||||
t.IsTrue(analyzer.isLibrarySymbolNameForHeuristics("sceCdRead"),
|
||||
"sce-prefixed PS2 API should be classified as library");
|
||||
t.IsTrue(analyzer.isLibrarySymbolNameForHeuristics("SetSyscall"),
|
||||
"SetSyscall kernel wrapper should be classified as library/runtime");
|
||||
t.IsTrue(analyzer.isLibrarySymbolNameForHeuristics("SetTLBEntry"),
|
||||
"SetTLBEntry kernel wrapper should be classified as library/runtime");
|
||||
t.IsTrue(analyzer.isLibrarySymbolNameForHeuristics("InitTLB"),
|
||||
"InitTLB kernel wrapper should be classified as library/runtime");
|
||||
t.IsTrue(analyzer.isLibrarySymbolNameForHeuristics("AddIntcHandler2"),
|
||||
"AddIntcHandler2 kernel wrapper should be classified as library/runtime");
|
||||
t.IsTrue(analyzer.isLibrarySymbolNameForHeuristics("SetGsCrt"),
|
||||
"SetGsCrt kernel wrapper should be classified as library/runtime");
|
||||
|
||||
t.IsFalse(analyzer.isLibrarySymbolNameForHeuristics("bhEne13_Brain"),
|
||||
"named game function should not be classified as library");
|
||||
@@ -75,6 +86,21 @@ void register_elf_analyzer_tests()
|
||||
t.IsFalse(ElfAnalyzer::isSystemSymbolNameForHeuristics("sub_00100C00"),
|
||||
"unreliable names should not be considered system by this classifier"); });
|
||||
|
||||
tc.Run("system skip keeps forced entry names recompiled", [](TestCase &t)
|
||||
{
|
||||
std::unordered_set<std::string> forcedNames{"_start", "_init"};
|
||||
t.IsFalse(ElfAnalyzer::shouldSkipSystemSymbolForHeuristics("_start", forcedNames),
|
||||
"forced entry name _start should not be skipped");
|
||||
t.IsFalse(ElfAnalyzer::shouldSkipSystemSymbolForHeuristics("_init", forcedNames),
|
||||
"forced entry name _init should not be skipped");
|
||||
|
||||
t.IsTrue(ElfAnalyzer::shouldSkipSystemSymbolForHeuristics("__main", forcedNames),
|
||||
"system symbol not marked as forced should still be skipped");
|
||||
t.IsTrue(ElfAnalyzer::shouldSkipSystemSymbolForHeuristics("__divdi3", {}),
|
||||
"compiler helper __divdi3 should be skippable as system/runtime");
|
||||
t.IsFalse(ElfAnalyzer::shouldSkipSystemSymbolForHeuristics("ps2___divdi3", {}),
|
||||
"generated ps2_ wrapper names should not be treated as system"); });
|
||||
|
||||
tc.Run("entry-point mapping handles exact inside and fallback", [](TestCase &t)
|
||||
{
|
||||
Function f1;
|
||||
|
||||
Reference in New Issue
Block a user