mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Merge pull request #964 from lioncash/svc
dyncom: Pass SVC immediates directly.
This commit is contained in:
commit
043b2f882a
3 changed files with 6 additions and 6 deletions
|
@ -6248,7 +6248,8 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
|
||||||
SWI_INST:
|
SWI_INST:
|
||||||
{
|
{
|
||||||
if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
|
if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
|
||||||
SVC::CallSVC(Memory::Read32(cpu->Reg[15]));
|
swi_inst* const inst_cream = (swi_inst*)inst_base->component;
|
||||||
|
SVC::CallSVC(inst_cream->num & 0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
cpu->Reg[15] += GET_INST_SIZE(cpu);
|
cpu->Reg[15] += GET_INST_SIZE(cpu);
|
||||||
|
|
|
@ -833,8 +833,7 @@ static const FunctionDef SVC_Table[] = {
|
||||||
|
|
||||||
Common::Profiling::TimingCategory profiler_svc("SVC Calls");
|
Common::Profiling::TimingCategory profiler_svc("SVC Calls");
|
||||||
|
|
||||||
static const FunctionDef* GetSVCInfo(u32 opcode) {
|
static const FunctionDef* GetSVCInfo(u32 func_num) {
|
||||||
u32 func_num = opcode & 0xFFFFFF; // 8 bits
|
|
||||||
if (func_num >= ARRAY_SIZE(SVC_Table)) {
|
if (func_num >= ARRAY_SIZE(SVC_Table)) {
|
||||||
LOG_ERROR(Kernel_SVC, "unknown svc=0x%02X", func_num);
|
LOG_ERROR(Kernel_SVC, "unknown svc=0x%02X", func_num);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -842,10 +841,10 @@ static const FunctionDef* GetSVCInfo(u32 opcode) {
|
||||||
return &SVC_Table[func_num];
|
return &SVC_Table[func_num];
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallSVC(u32 opcode) {
|
void CallSVC(u32 immediate) {
|
||||||
Common::Profiling::ScopeTimer timer_svc(profiler_svc);
|
Common::Profiling::ScopeTimer timer_svc(profiler_svc);
|
||||||
|
|
||||||
const FunctionDef *info = GetSVCInfo(opcode);
|
const FunctionDef* info = GetSVCInfo(immediate);
|
||||||
if (info) {
|
if (info) {
|
||||||
if (info->func) {
|
if (info->func) {
|
||||||
info->func();
|
info->func();
|
||||||
|
|
|
@ -41,6 +41,6 @@ enum ArbitrationType {
|
||||||
|
|
||||||
namespace SVC {
|
namespace SVC {
|
||||||
|
|
||||||
void CallSVC(u32 opcode);
|
void CallSVC(u32 immediate);
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in a new issue