Diagnose unrecognized task types.

This commit is contained in:
Iconoclast 2018-03-17 12:56:52 -04:00
parent a9670d1e0e
commit d4027c2866
3 changed files with 23 additions and 19 deletions

View file

@ -76,27 +76,28 @@ EXPORT void CALL DllConfig(p_void hParent)
EXPORT u32 CALL DoRspCycles(u32 cycles)
{
static char task_debug[] = "unknown task type: 0x????????";
char* task_debug_type;
OSTask_type task_type;
register unsigned int i;
if (GET_RCP_REG(SP_STATUS_REG) & 0x00000003)
{
if (GET_RCP_REG(SP_STATUS_REG) & 0x00000003) {
message("SP_STATUS_HALT");
return 0x00000000;
}
task_debug_type = &task_debug[strlen("unknown task type: 0x")];
task_type = 0x00000000
#ifdef USE_CLIENT_ENDIAN
| *((pi32)(DMEM + 0x000FC0U))
memcpy(&task_type, DMEM + 0xFC0, 4);
#else
| (u32)DMEM[0xFC0] << 24
| (u32)DMEM[0xFC1] << 16
| (u32)DMEM[0xFC2] << 8
| (u32)DMEM[0xFC3] << 0
#endif
task_type = 0x00000000
| (u32)(DMEM[0xFC0 ^ 0] & 0xFFu) << 24
| (u32)(DMEM[0xFC1 ^ 0] & 0xFFu) << 16
| (u32)(DMEM[0xFC2 ^ 0] & 0xFFu) << 8
| (u32)(DMEM[0xFC3 ^ 0] & 0xFFu) << 0
;
#endif
switch (task_type) {
#ifdef EXTERN_COMMAND_LIST_GBI
case M_GFXTASK:
if (CFG_HLE_GFX == 0)
break;
@ -117,8 +118,6 @@ EXPORT u32 CALL DoRspCycles(u32 cycles)
}
GET_RCP_REG(DPC_STATUS_REG) &= ~0x00000002ul; /* DPC_STATUS_FREEZE */
return 0;
#endif
#ifdef EXTERN_COMMAND_LIST_ABI
case M_AUDTASK:
if (CFG_HLE_AUD == 0)
break;
@ -136,7 +135,6 @@ EXPORT u32 CALL DoRspCycles(u32 cycles)
GET_RSP_INFO(CheckInterrupts)();
}
return 0;
#endif
case M_VIDTASK:
message("M_VIDTASK");
break;
@ -153,6 +151,9 @@ EXPORT u32 CALL DoRspCycles(u32 cycles)
break;
GET_RSP_INFO(ShowCFB)(); /* forced FB refresh in case gfx plugin skip */
break;
default:
sprintf(task_debug_type, "%08lX", (unsigned long)task_type);
message(task_debug);
}
#ifdef WAIT_FOR_CPU_HOST

View file

@ -1,7 +1,7 @@
/******************************************************************************\
* Project: Module Subsystem Interface to SP Interpreter Core *
* Authors: Iconoclast *
* Release: 2016.11.05 *
* Release: 2018.03.17 *
* License: CC0 Public Domain Dedication *
* *
* To the extent possible under law, the author(s) have dedicated all copyright *
@ -26,7 +26,9 @@ typedef enum {
M_NJPEGTASK = 4,
M_NULTASK = 5,
M_HVQTASK = 6,
M_HVQMTASK = 7
M_HVQMTASK = 7,
NUM_KNOWN_TASK_TYPES
} OSTask_type;
#define CFG_FILE "rsp_conf.bin"

9
su.h
View file

@ -22,8 +22,6 @@
#include "my_types.h"
#include "rsp.h"
#define EXTERN_COMMAND_LIST_GBI
#define EXTERN_COMMAND_LIST_ABI
#define SEMAPHORE_LOCK_CORRECTIONS
#define WAIT_FOR_CPU_HOST
@ -79,7 +77,9 @@ extern unsigned long su_max_address;
typedef enum {
zero = 0,
at = 1,
#ifdef TRUE_MIPS_AND_NOT_JUST_THE_RSP_SUBSET
v0 = 2,
v1 = 3,
@ -117,7 +117,8 @@ typedef enum {
sp = 29,
fp = 30, /* new, official MIPS name for it: "frame pointer" */
ra = 31,
S8 = fp
S8 = fp /* older name for GPR $fp as of the R4000 ISA */
} GPR_specifier;
extern RSP_INFO RSP_INFO_NAME;
@ -133,7 +134,7 @@ extern u8 conf[32];
* based on the MIPS instruction set architecture but without most of the
* original register names (for example, no kernel-reserved registers)
*/
extern u32 SR[32];
extern u32 SR[];
#define FIT_IMEM(PC) ((PC) & 0xFFFu & 0xFFCu)