mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 20:04:31 +01:00
Sysreg (0xBC100000) gets the ME's reset bit (0x4C bit 2), the soft interrupt (0x44, which interrupts the other CPU: the ME's controller from the main CPU, PSP_MECODEC_INTR from the ME), the hardware mutex (0x48, each CPU sets its own bit only while the other's is clear) and the clock and config registers it writes. The ME's interrupt controller (0xBC300000, write-1-to-clear, mask at 8) answers the ME only. All of it is the ME's state and stays unhandled without an ME. On the ME: interrupts to EBase with EPC and EXL, halt sleeping until an unmasked interrupt, and Count, which doesn't run: it stays 0 across 10ms with ERL set after reset and with Status cleared, and reads back what was written. Reset keeps the GPRs and sets Status ERL/BEV/SR, which homebrew relies on: mcidclan's samples run C on the stack Sony's ME code left. The values are from a kernel probe on a PSP-1000 (sp 0x801FFFE0, COP0 22 = 1, Status 0x20500404, mfic 0, which doesn't gate interrupts). The main CPU runs base interrupt handlers the way interruptman calls them (a0 intno, a1 arg, a2 interrupted pc; -2 disables), and interrupt 31 has a stand-in for me_wrapper's handler, which homebrew releases first. While the ME is emulated, any main CPU code may access hardware registers: homebrew calls its own code in kernel mode through a kcall module. This is a stopgap (g_kernelModeAnywhere, marked HACK): kernel mode should be part of the CPU's state, switched on while a kernel module's export runs. The memcpy/memmove replacements copy through MMIO when an end is a register address, for code copied to the boot page. mcidclan's me-soft-interrupt sample now runs, counting each interrupt in both directions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
59 lines
2.4 KiB
C++
59 lines
2.4 KiB
C++
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
// Official git repository and contact information can be found at
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
#pragma once
|
|
|
|
#include "Common/CommonTypes.h"
|
|
#include "Core/MIPS/MIPS.h"
|
|
|
|
int MIPS_InterpretSingleStep(MIPSState *mips);
|
|
|
|
namespace MIPSInt
|
|
{
|
|
void Int_Syscall(MIPSState *mips, MIPSOpcode op);
|
|
|
|
void Int_mxc1(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Cop0(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Eret(MIPSState *mips, MIPSOpcode op);
|
|
void Int_RelBranch(MIPSState *mips, MIPSOpcode op);
|
|
void Int_RelBranchRI(MIPSState *mips, MIPSOpcode op);
|
|
void Int_IType(MIPSState *mips, MIPSOpcode op);
|
|
void Int_ITypeMem(MIPSState *mips, MIPSOpcode op);
|
|
void Int_RType2(MIPSState *mips, MIPSOpcode op);
|
|
void Int_RType3(MIPSState *mips, MIPSOpcode op);
|
|
void Int_ShiftType(MIPSState *mips, MIPSOpcode op);
|
|
void Int_MulDivType(MIPSState *mips, MIPSOpcode op);
|
|
void Int_JumpType(MIPSState *mips, MIPSOpcode op);
|
|
void Int_JumpRegType(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Allegrex2(MIPSState *mips, MIPSOpcode op);
|
|
void Int_FPULS(MIPSState *mips, MIPSOpcode op);
|
|
void Int_FPU3op(MIPSState *mips, MIPSOpcode op);
|
|
void Int_FPU2op(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Allegrex(MIPSState *mips, MIPSOpcode op);
|
|
void Int_FPUComp(MIPSState *mips, MIPSOpcode op);
|
|
void Int_FPUBranch(MIPSState *mips, MIPSOpcode op);
|
|
void Int_CallReplacement(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Special2(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Halt(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Special3(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Interrupt(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Cache(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Sync(MIPSState *mips, MIPSOpcode op);
|
|
void Int_Break(MIPSState *mips, MIPSOpcode op);
|
|
void Int_StoreSync(MIPSState *mips, MIPSOpcode op);
|
|
}
|