diff jagcpu.c @ 1115:c1e78a101912

WIP Jaguar GPU/DSP emulation
author Michael Pavone <pavone@retrodev.com>
date Mon, 19 Dec 2016 14:16:59 -0800
parents 1ab30d427db8
children
line wrap: on
line diff
--- a/jagcpu.c	Mon Dec 19 14:16:43 2016 -0800
+++ b/jagcpu.c	Mon Dec 19 14:16:59 2016 -0800
@@ -159,6 +159,24 @@
 		|| (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 @@
 	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);