summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/dsp16/dsp16ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu/dsp16/dsp16ops.c')
-rw-r--r--src/emu/cpu/dsp16/dsp16ops.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/src/emu/cpu/dsp16/dsp16ops.c b/src/emu/cpu/dsp16/dsp16ops.c
index 778d0b7b1af..4bd704bade9 100644
--- a/src/emu/cpu/dsp16/dsp16ops.c
+++ b/src/emu/cpu/dsp16/dsp16ops.c
@@ -49,24 +49,24 @@ bool dsp16_device::conditionTest(const UINT8& CON)
{
switch (CON)
{
- case 0x00: return (m_psw & 0x8000); // mi (negative result)
- case 0x01: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // pl (positive result)
- case 0x02: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // eq (result == 0)
- case 0x03: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // ne (result != 0)
- case 0x04: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // lvs (logical overflow set)
- case 0x05: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // lvc (logical overflow clear)
- case 0x06: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // mvs (math. overflow set)
- case 0x07: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // mvc (math. overflow clear)
- case 0x08: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // heads (random bit set)
- case 0x09: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // tails (random bit clear)
- case 0x0a: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // c0ge (counter0 >= 0)
- case 0x0b: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // c0lt (counter0 < 0)
- case 0x0c: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // c1ge (counter1 >= 0)
- case 0x0d: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // c1lt (counter1 < 0)
- case 0x0e: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // true (always)
- case 0x0f: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // false (never)
- case 0x10: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // gt (result > 0
- case 0x11: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // le (result <= 0)
+ case 0x00: return (m_psw & 0x8000); // mi (negative result)
+ case 0x01: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // pl (positive result)
+ case 0x02: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // eq (result == 0)
+ case 0x03: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // ne (result != 0)
+ case 0x04: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // lvs (logical overflow set)
+ case 0x05: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // lvc (logical overflow clear)
+ case 0x06: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // mvs (math. overflow set)
+ case 0x07: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // mvc (math. overflow clear)
+ case 0x08: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // heads (random bit set)
+ case 0x09: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // tails (random bit clear)
+ case 0x0a: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // c0ge (counter0 >= 0)
+ case 0x0b: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // c0lt (counter0 < 0)
+ case 0x0c: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // c1ge (counter1 >= 0)
+ case 0x0d: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // c1lt (counter1 < 0)
+ case 0x0e: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // true (always)
+ case 0x0f: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // false (never)
+ case 0x10: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // gt (result > 0
+ case 0x11: printf("UNIMPLEMENTED condition check @ PC 0x%04x\n", m_pc); return false; // le (result <= 0)
default: logerror("Unrecognized condition at PC=0x%04x\n", m_pc); break;
}
return false;
@@ -112,11 +112,11 @@ void* dsp16_device::registerFromRTable(const UINT8 &R)
case 0x10: return (void*)&m_x;
case 0x11: return (void*)&m_y;
case 0x12: return (void*)addressYL();
- case 0x13: return (void*)&m_auc; // zero extended
+ case 0x13: return (void*)&m_auc; // zero extended
case 0x14: return (void*)&m_psw;
- case 0x15: return (void*)&m_c0; // sign extended
- case 0x16: return (void*)&m_c1; // sign extended
- case 0x17: return (void*)&m_c2; // sign extended
+ case 0x15: return (void*)&m_c0; // sign extended
+ case 0x16: return (void*)&m_c1; // sign extended
+ case 0x17: return (void*)&m_c2; // sign extended
case 0x18: return (void*)&m_sioc;
case 0x19: return (void*)&m_srta;
case 0x1a: return (void*)&m_sdx;
@@ -137,20 +137,20 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8&
//UINT64* destinationReg = NULL;
//switch (D)
//{
- // case 0x00: destinationReg = &m_a0;
- // case 0x01: destinationReg = &m_a1;
- // default: break;
+ // case 0x00: destinationReg = &m_a0;
+ // case 0x01: destinationReg = &m_a1;
+ // default: break;
//}
// Which source is being used?
//UINT64* sourceReg = NULL;
//switch (S)
//{
- // case 0x00: sourceReg = &m_a0;
- // case 0x01: sourceReg = &m_a1;
- // default: break;
+ // case 0x00: sourceReg = &m_a0;
+ // case 0x01: sourceReg = &m_a1;
+ // default: break;
//}
-
+
switch (F1)
{
case 0x00: printf("UNIMPLEMENTED F1 operation @ PC 0x%04x\n", m_pc); break;
@@ -201,7 +201,7 @@ void dsp16_device::executeYFieldPost(const UINT8& Y)
case 0x03: opReg = &m_r3; break;
default: break;
}
-
+
const UINT8 lower = Y & 0x03;
switch (lower)
{
@@ -341,7 +341,7 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance
case 0x00: m_pt++; break;
case 0x01: m_pt += m_i; break;
}
- cycles = 2; // TODO: 1 if cached
+ cycles = 2; // TODO: 1 if cached
pcAdvance = 1;
break;
}
@@ -355,15 +355,15 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance
const UINT8 F1 = (op & 0x01e0) >> 5;
bool useA1 = (opcode == 0x1b);
if (Y != 0x00) printf("Unknown opcode @ PC=0x%04x", m_pc);
- m_y = (useA1) ? (m_a1 & 0xffffffff) : (m_a0 & 0xffffffff); // TODO: What happens to Ax when it goes 32 bit (pc=3f & pc=47)?
+ m_y = (useA1) ? (m_a1 & 0xffffffff) : (m_a0 & 0xffffffff); // TODO: What happens to Ax when it goes 32 bit (pc=3f & pc=47)?
executeF1Field(F1, D, S);
- writeRegister(&m_x, data_read(m_pt)); // TODO: EXM Pin & internal/external ROM? Research.
+ writeRegister(&m_x, data_read(m_pt)); // TODO: EXM Pin & internal/external ROM? Research.
switch (X)
{
case 0x00: m_pt++; break;
case 0x01: m_pt += m_i; break;
}
- cycles = 2; // TODO: 1 if cached
+ cycles = 2; // TODO: 1 if cached
pcAdvance = 1;
break;
}
@@ -425,30 +425,30 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance
const UINT8 S = (op & 0x0200) >> 9;
const UINT8 D = (op & 0x0400) >> 10;
const UINT8 F1 = (op & 0x01e0) >> 5;
- executeF1Field(F1, D, S);
- UINT16 temp = 0x0000;
- UINT16* rN = (UINT16*)registerFromYFieldUpper(Z);
- switch (X)
- {
- case 0x00:
- temp = m_y & 0x0000ffff;
- m_y &= 0xffff0000;
- m_y |= data_read(*rN);
- executeZFieldPartOne(Z, rN);
- data_write(*rN, temp);
- executeZFieldPartTwo(Z, rN);
- break;
- case 0x01:
- temp = (m_y & 0xffff0000) >> 16;
- m_y &= 0x0000ffff;
- m_y |= (data_read(*rN) << 16);
- executeZFieldPartOne(Z, rN);
- data_write(*rN, temp);
- executeZFieldPartTwo(Z, rN);
- break;
- }
- cycles = 2;
- pcAdvance = 1;
+ executeF1Field(F1, D, S);
+ UINT16 temp = 0x0000;
+ UINT16* rN = (UINT16*)registerFromYFieldUpper(Z);
+ switch (X)
+ {
+ case 0x00:
+ temp = m_y & 0x0000ffff;
+ m_y &= 0xffff0000;
+ m_y |= data_read(*rN);
+ executeZFieldPartOne(Z, rN);
+ data_write(*rN, temp);
+ executeZFieldPartTwo(Z, rN);
+ break;
+ case 0x01:
+ temp = (m_y & 0xffff0000) >> 16;
+ m_y &= 0x0000ffff;
+ m_y |= (data_read(*rN) << 16);
+ executeZFieldPartOne(Z, rN);
+ data_write(*rN, temp);
+ executeZFieldPartTwo(Z, rN);
+ break;
+ }
+ cycles = 2;
+ pcAdvance = 1;
break;
}
case 0x1d:
@@ -539,7 +539,7 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance
// if CON [goto/call/return] : (page 3-22)
const UINT8 CON = (op & 0x001f);
bool conditionFulfilled = conditionTest(CON);
- cycles = 3; // TODO: This may need to interact with the next opcode to make sure it doesn't exceed 3?
+ cycles = 3; // TODO: This may need to interact with the next opcode to make sure it doesn't exceed 3?
pcAdvance = 1;
if (!conditionFulfilled)
{
@@ -577,7 +577,7 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance
}
void* sourceReg = registerFromRTable(R);
*destinationReg &= U64(0x00000ffff);
- *destinationReg |= (*(UINT16*)sourceReg) << 16; // TODO: Fix for all registers
+ *destinationReg |= (*(UINT16*)sourceReg) << 16; // TODO: Fix for all registers
if (*(UINT16*)sourceReg & 0x8000)
*destinationReg |= U64(0xf00000000);
// TODO: Special function encoding
@@ -639,7 +639,7 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance
const INT8 M = (op & 0x00ff);
const UINT8 R = (op & 0x0e00) >> 9;
void* reg = registerFromRImmediateField(R);
- writeRegister(reg, (INT16)M); // Sign extend 8 bit int
+ writeRegister(reg, (INT16)M); // Sign extend 8 bit int
cycles = 1;
pcAdvance = 1;
break;
@@ -656,14 +656,14 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance
// Do
m_cacheStart = m_pc + 1;
m_cacheEnd = m_pc + NI + 1;
- m_cacheIterations = K-1; // -1 because we check the counter @ the end
+ m_cacheIterations = K-1; // -1 because we check the counter @ the end
cycles = 1;
pcAdvance = 1;
}
else
{
// Redo
- m_cacheIterations = K-1; // -1 because we check the counter @ the end
+ m_cacheIterations = K-1; // -1 because we check the counter @ the end
m_cacheRedoNextPC = m_pc + 1;
m_pc = m_cacheStart;
pcAdvance = 0;