[CPU] Use reserved form of sc for imports.

This commit is contained in:
gibbed
2020-02-11 06:05:21 -06:00
committed by Rick Gibbed
parent e2346ee539
commit cc47704a6b
2 changed files with 16 additions and 7 deletions

View File

@@ -423,8 +423,15 @@ int InstrEmit_mcrf(PPCHIRBuilder& f, const InstrData& i) {
// System linkage (A-24)
int InstrEmit_sc(PPCHIRBuilder& f, const InstrData& i) {
f.CallExtern(f.function());
return 0;
// Game code should only ever use LEV=0.
// LEV=2 is to signify 'call import' from Xenia.
// TODO(gibbed): syscalls!
if (i.SC.LEV == 2) {
f.CallExtern(f.function());
return 0;
}
XEINSTRNOTIMPLEMENTED();
return 1;
}
// Trap (A-25)