Refix ge interrupts, make headless printf log messages

This commit is contained in:
Henrik Rydgard 2012-11-09 13:40:09 +01:00
parent 12f09ed070
commit 0ff792fce5
3 changed files with 37 additions and 3 deletions

View File

@ -135,10 +135,14 @@ u32 sceGeSetCallback(u32 structAddr)
PspGeCallbackData ge_callback_data;
Memory::ReadStruct(structAddr, &ge_callback_data);
if (ge_callback_data.finish_func)
if (ge_callback_data.finish_func) {
sceKernelRegisterSubIntrHandler(PSP_GE_INTR, PSP_GE_SUBINTR_FINISH, ge_callback_data.finish_func, ge_callback_data.finish_arg);
if (ge_callback_data.signal_func)
sceKernelEnableSubIntr(PSP_GE_INTR, PSP_GE_SUBINTR_FINISH);
}
if (ge_callback_data.signal_func) {
sceKernelRegisterSubIntrHandler(PSP_GE_INTR, PSP_GE_SUBINTR_SIGNAL, ge_callback_data.signal_func, ge_callback_data.signal_arg);
sceKernelEnableSubIntr(PSP_GE_INTR, PSP_GE_SUBINTR_SIGNAL);
}
// TODO: This should return a callback ID
return 0;

View File

@ -64,6 +64,7 @@ void __KernelReturnFromInterrupt();
u32 sceKernelRegisterSubIntrHandler(u32 intrNumber, u32 subIntrNumber, u32 handler, u32 handlerArg);
u32 sceKernelReleaseSubIntrHandler(u32 intrNumber, u32 subIntrNumber);
u32 sceKernelEnableSubIntr(u32 intrNumber, u32 subIntrNumber);
void Register_Kernel_Library();
void Register_InterruptManager();

View File

@ -42,6 +42,33 @@ public:
virtual bool AttemptLoadSymbolMap() {return false;}
};
class PrintfLogger : public LogListener
{
public:
void Log(LogTypes::LOG_LEVELS level, const char *msg)
{
switch (level)
{
case LogTypes::LDEBUG:
printf("D %s", msg);
break;
case LogTypes::LINFO:
printf("I %s", msg);
break;
case LogTypes::LERROR:
printf("E %s", msg);
break;
case LogTypes::LWARNING:
printf("W %s", msg);
break;
case LogTypes::LNOTICE:
default:
printf("N %s", msg);
break;
}
}
};
void printUsage()
{
fprintf(stderr, "PPSSPP Headless\n");
@ -88,12 +115,14 @@ int main(int argc, const char* argv[])
LogManager::Init();
LogManager *logman = LogManager::GetInstance();
PrintfLogger *printfLogger = new PrintfLogger();
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
{
LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
logman->SetEnable(type, fullLog);
logman->SetLogLevel(type, LogTypes::LDEBUG);
// logman->AddListener(type, logger);
logman->AddListener(type, printfLogger);
}
CoreParameter coreParameter;