From 83b5d6a1a3d2211b824599d73d12d3f3807b2acc Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 19 Dec 2016 14:16:59 -0800 Subject: WIP Jaguar GPU/DSP emulation --- jagcpu.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'jagcpu.c') diff --git a/jagcpu.c b/jagcpu.c index c2a78a4..9d6f6c8 100644 --- a/jagcpu.c +++ b/jagcpu.c @@ -159,6 +159,24 @@ uint8_t is_store(uint16_t opcode, uint8_t is_gpu) || (is_gpu && opcode == GPU_STOREP); } +uint8_t is_single_source(uint16_t opcode, uint8_t is_gpu) +{ + return opcode == JAG_NEG + || opcode == JAG_NOT + || opcode == JAG_ABS + || opcode == GPU_SAT16 //no is_gpu check needed as DSP_SAT16S is also single source + || (is_gpu && ( + opcode == GPU_SAT8 + || opcode == GPU_SAT24 + || opcode == GPU_PACK + || opcode == GPU_UNPACK + )) + || (!is_gpu && ( + opcode == DSP_SAT32S + || opcode == DSP_MIRROR + )); +} + char * jag_cc_names[] = { "t", "ne", @@ -198,6 +216,11 @@ char * jag_cc(uint16_t inst) return jag_cc_names[ccnum]; } +uint8_t jag_is_alwyas_falsse(uint16_t cond) +{ + return (cond & 3) == 3 || (cond && 0xC) == 0xC; +} + uint32_t jag_jr_dest(uint16_t inst, uint32_t address) { uint32_t rel = jag_reg1(inst); -- cgit v1.2.3