diff options
Diffstat (limited to 'src/emu/cpu/dsp16')
-rw-r--r-- | src/emu/cpu/dsp16/dsp16.c | 86 | ||||
-rw-r--r-- | src/emu/cpu/dsp16/dsp16.h | 22 | ||||
-rw-r--r-- | src/emu/cpu/dsp16/dsp16dis.c | 6 | ||||
-rw-r--r-- | src/emu/cpu/dsp16/dsp16ops.c | 126 |
4 files changed, 120 insertions, 120 deletions
diff --git a/src/emu/cpu/dsp16/dsp16.c b/src/emu/cpu/dsp16/dsp16.c index d8a0ecf6190..f2ba79621a8 100644 --- a/src/emu/cpu/dsp16/dsp16.c +++ b/src/emu/cpu/dsp16/dsp16.c @@ -30,46 +30,46 @@ const device_type DSP16 = &device_creator<dsp16_device>; dsp16_device::dsp16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : cpu_device(mconfig, DSP16, "DSP16", tag, owner, clock), - m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1), - m_data_config("data", ENDIANNESS_LITTLE, 16, 16, -1), - m_i(0), - m_pc(0), - m_pt(0), - m_pr(0), - m_pi(0), - m_j(0), - m_k(0), - m_rb(0), - m_re(0), - m_r0(0), - m_r1(0), - m_r2(0), - m_r3(0), - m_x(0), - m_y(0), - m_p(0), - m_a0(0), - m_a1(0), - m_auc(0), - m_psw(0), - m_c0(0), - m_c1(0), - m_c2(0), - m_sioc(0), - m_srta(0), - m_sdx(0), - m_pioc(0), - m_pdx0(0), - m_pdx1(0), - m_ppc(0), - m_cacheStart(CACHE_INVALID), - m_cacheEnd(CACHE_INVALID), - m_cacheRedoNextPC(CACHE_INVALID), - m_cacheIterations(0), - m_program(NULL), - m_data(NULL), - m_direct(NULL), - m_icount(0) + m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1), + m_data_config("data", ENDIANNESS_LITTLE, 16, 16, -1), + m_i(0), + m_pc(0), + m_pt(0), + m_pr(0), + m_pi(0), + m_j(0), + m_k(0), + m_rb(0), + m_re(0), + m_r0(0), + m_r1(0), + m_r2(0), + m_r3(0), + m_x(0), + m_y(0), + m_p(0), + m_a0(0), + m_a1(0), + m_auc(0), + m_psw(0), + m_c0(0), + m_c1(0), + m_c2(0), + m_sioc(0), + m_srta(0), + m_sdx(0), + m_pioc(0), + m_pdx0(0), + m_pdx1(0), + m_ppc(0), + m_cacheStart(CACHE_INVALID), + m_cacheEnd(CACHE_INVALID), + m_cacheRedoNextPC(CACHE_INVALID), + m_cacheIterations(0), + m_program(NULL), + m_data(NULL), + m_direct(NULL), + m_icount(0) { // Allocate & setup } @@ -195,8 +195,8 @@ void dsp16_device::device_reset() const address_space_config *dsp16_device::memory_space_config(address_spacenum spacenum) const { return (spacenum == AS_PROGRAM) ? &m_program_config : - (spacenum == AS_DATA) ? &m_data_config : - NULL; + (spacenum == AS_DATA) ? &m_data_config : + NULL; } @@ -325,7 +325,7 @@ void dsp16_device::execute_run() do { // debugging - m_ppc = m_pc; // copy PC to previous PC + m_ppc = m_pc; // copy PC to previous PC debugger_instruction_hook(this, m_pc); // instruction fetch & execute diff --git a/src/emu/cpu/dsp16/dsp16.h b/src/emu/cpu/dsp16/dsp16.h index b87f775a8e7..274f6f72f57 100644 --- a/src/emu/cpu/dsp16/dsp16.h +++ b/src/emu/cpu/dsp16/dsp16.h @@ -55,7 +55,7 @@ protected: // CPU registers // ROM Address Arithmetic Unit (XAAU) - UINT16 m_i; // 12 bits + UINT16 m_i; // 12 bits UINT16 m_pc; UINT16 m_pt; UINT16 m_pr; @@ -73,9 +73,9 @@ protected: UINT16 m_x; UINT32 m_y; UINT32 m_p; - UINT64 m_a0; // 36 bits - UINT64 m_a1; // 36 bits - UINT8 m_auc; // 6 bits + UINT64 m_a0; // 36 bits + UINT64 m_a1; // 36 bits + UINT8 m_auc; // 6 bits UINT16 m_psw; UINT8 m_c0; UINT8 m_c1; @@ -85,8 +85,8 @@ protected: UINT16 m_srta; UINT16 m_sdx; UINT16 m_pioc; - UINT16 m_pdx0; // pdx0 & pdx1 refer to the same physical register (page 6-1) - UINT16 m_pdx1; // but we keep them seperate for logic's sake. + UINT16 m_pdx0; // pdx0 & pdx1 refer to the same physical register (page 6-1) + UINT16 m_pdx1; // but we keep them seperate for logic's sake. // internal stuff UINT16 m_ppc; @@ -143,12 +143,12 @@ extern const device_type DSP16; enum { - DSP16_I, // ROM Address Arithmetic Unit (XAAU) + DSP16_I, // ROM Address Arithmetic Unit (XAAU) DSP16_PC, DSP16_PT, DSP16_PR, DSP16_PI, - DSP16_J, // RAM Address Arithmetic Unit (YAAU) + DSP16_J, // RAM Address Arithmetic Unit (YAAU) DSP16_K, DSP16_RB, DSP16_RE, @@ -156,7 +156,7 @@ enum DSP16_R1, DSP16_R2, DSP16_R3, - DSP16_X, // Data Arithmetic Unit (DAU) + DSP16_X, // Data Arithmetic Unit (DAU) DSP16_Y, DSP16_P, DSP16_A0, @@ -170,8 +170,8 @@ enum DSP16_SRTA, DSP16_SDX, DSP16_PIOC, - DSP16_PDX0, - DSP16_PDX1 + DSP16_PDX0, + DSP16_PDX1 }; diff --git a/src/emu/cpu/dsp16/dsp16dis.c b/src/emu/cpu/dsp16/dsp16dis.c index 9b58d190306..8b648f7a6d3 100644 --- a/src/emu/cpu/dsp16/dsp16dis.c +++ b/src/emu/cpu/dsp16/dsp16dis.c @@ -234,8 +234,8 @@ bool disasmSIField(const UINT8& SI) { switch (SI) { - case 0x00: return 0; // Not a software interrupt - case 0x01: return 1; // Software Interrupt + case 0x00: return 0; // Not a software interrupt + case 0x01: return 1; // Software Interrupt } return false; } @@ -505,7 +505,7 @@ CPU_DISASSEMBLE( dsp16a ) const UINT8 R = (op & 0x03f0) >> 4; astring yString = disasmYField(Y); astring rString = disasmRField(R); - // TODO: page 3-31 "special function encoding" + // TODO: page 3-31 "special function encoding" sprintf(buffer, "%s = %s", yString.cstr(), rString.cstr()); break; } 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; |