comparison 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
comparison
equal deleted inserted replaced
1114:b45d1f64060e 1115:c1e78a101912
157 || opcode == JAG_STOREB 157 || opcode == JAG_STOREB
158 || opcode == JAG_STOREW 158 || opcode == JAG_STOREW
159 || (is_gpu && opcode == GPU_STOREP); 159 || (is_gpu && opcode == GPU_STOREP);
160 } 160 }
161 161
162 uint8_t is_single_source(uint16_t opcode, uint8_t is_gpu)
163 {
164 return opcode == JAG_NEG
165 || opcode == JAG_NOT
166 || opcode == JAG_ABS
167 || opcode == GPU_SAT16 //no is_gpu check needed as DSP_SAT16S is also single source
168 || (is_gpu && (
169 opcode == GPU_SAT8
170 || opcode == GPU_SAT24
171 || opcode == GPU_PACK
172 || opcode == GPU_UNPACK
173 ))
174 || (!is_gpu && (
175 opcode == DSP_SAT32S
176 || opcode == DSP_MIRROR
177 ));
178 }
179
162 char * jag_cc_names[] = { 180 char * jag_cc_names[] = {
163 "t", 181 "t",
164 "ne", 182 "ne",
165 "eq", 183 "eq",
166 "f", 184 "f",
194 uint16_t ccnum = jag_reg2(inst); 212 uint16_t ccnum = jag_reg2(inst);
195 if (ccnum >= sizeof(jag_cc_names)/sizeof(*jag_cc_names)) { 213 if (ccnum >= sizeof(jag_cc_names)/sizeof(*jag_cc_names)) {
196 return jag_cc_names[3]; 214 return jag_cc_names[3];
197 } 215 }
198 return jag_cc_names[ccnum]; 216 return jag_cc_names[ccnum];
217 }
218
219 uint8_t jag_is_alwyas_falsse(uint16_t cond)
220 {
221 return (cond & 3) == 3 || (cond && 0xC) == 0xC;
199 } 222 }
200 223
201 uint32_t jag_jr_dest(uint16_t inst, uint32_t address) 224 uint32_t jag_jr_dest(uint16_t inst, uint32_t address)
202 { 225 {
203 uint32_t rel = jag_reg1(inst); 226 uint32_t rel = jag_reg1(inst);