diff options
author | Ville Linde <villedevs@gmail.com> | 2015-08-18 20:39:22 +0300 |
---|---|---|
committer | Ville Linde <villedevs@gmail.com> | 2015-08-18 20:49:45 +0300 |
commit | 7834ef5485994cd2b682edd710ad209537083426 (patch) | |
tree | 55e77a45bec06f093133eca6dc759e0289b87d79 /src/emu/cpu | |
parent | 8a752c55b29bfb1bc738f2b2003bdf0d91310b0c (diff) |
New games marked as GAME_NOT_WORKING ------------------------------------ ROLLing eX.tre.me [Ville Linde, Guru]
Diffstat (limited to 'src/emu/cpu')
-rw-r--r-- | src/emu/cpu/tms32082/mp_ops.c | 67 | ||||
-rw-r--r-- | src/emu/cpu/tms32082/tms32082.c | 66 | ||||
-rw-r--r-- | src/emu/cpu/tms32082/tms32082.h | 7 |
3 files changed, 139 insertions, 1 deletions
diff --git a/src/emu/cpu/tms32082/mp_ops.c b/src/emu/cpu/tms32082/mp_ops.c index eb59ca228f1..c6e9321ce24 100644 --- a/src/emu/cpu/tms32082/mp_ops.c +++ b/src/emu/cpu/tms32082/mp_ops.c @@ -465,6 +465,17 @@ void tms32082_mp_device::execute_short_imm() break; } + case 0x12: // and.tf + { + int rd = OP_RD(); + int rs = OP_RS(); + UINT32 imm = OP_UIMM15(); + + if (rd) + m_reg[rd] = ~m_reg[rs] & imm; + break; + } + case 0x14: // and.ft { int rd = OP_RD(); @@ -681,6 +692,19 @@ void tms32082_mp_device::execute_short_imm() break; } + case 0x45: // jsr.a + { + int link = OP_LINK(); + int base = OP_BASE(); + INT32 offset = OP_SIMM15(); + + if (link) + m_reg[link] = m_fetchpc; + + m_fetchpc = m_reg[base] + offset; + break; + } + case 0x48: // bbz { int bitnum = OP_BITNUM() ^ 0x1f; @@ -888,6 +912,38 @@ void tms32082_mp_device::execute_reg_long_imm() break; } + case 0x1a: // shift.es + { + int r = (m_ir & (1 << 10)); + int inv = (m_ir & (1 << 11)); + int rot = m_reg[OP_ROTATE()]; + int end = OP_ENDMASK(); + UINT32 source = m_reg[OP_RS()]; + int rd = OP_RD(); + + UINT32 endmask = end ? SHIFT_MASK[end ? end : 32] : m_reg[OP_ROTATE()+1]; + if (inv) endmask = ~endmask; + + int shift = r ? 32-rot : rot; + UINT32 shiftmask = SHIFT_MASK[shift ? shift : 32]; + UINT32 compmask = endmask & shiftmask; + + UINT32 res = 0; + if (r) // right + { + res = ROTATE_R(source, rot) & compmask; + res = SIGN_EXTEND(res, rot); + } + else // left + { + res = ROTATE_L(source, rot) & compmask; + } + + if (rd) + m_reg[rd] = res; + break; + } + case 0x1c: // shift.iz { int r = (m_ir & (1 << 10)); @@ -965,6 +1021,17 @@ void tms32082_mp_device::execute_reg_long_imm() break; } + case 0x3a: + case 0x3b: // or.ft + { + int rd = OP_RD(); + int rs = OP_RS(); + + if (rd) + m_reg[rd] = m_reg[rs] | ~(has_imm ? imm32 : m_reg[OP_SRC1()]); + break; + } + case 0x40: case 0x41: case 0x48: diff --git a/src/emu/cpu/tms32082/tms32082.c b/src/emu/cpu/tms32082/tms32082.c index 56d97713b45..8b3d041ba4f 100644 --- a/src/emu/cpu/tms32082/tms32082.c +++ b/src/emu/cpu/tms32082/tms32082.c @@ -197,6 +197,9 @@ void tms32082_mp_device::device_start() state_add(MP_IE, "ie", m_ie).formatstr("%08X"); state_add(MP_INTPEN, "intpen", m_intpen).formatstr("%08X"); + state_add(MP_TCOUNT, "tcount", m_tcount).formatstr("%08X"); + state_add(MP_TSCALE, "tscale", m_tscale).formatstr("%08X"); + state_add(STATE_GENPC, "curpc", m_pc).noshow(); m_program = &space(AS_PROGRAM); @@ -283,6 +286,55 @@ void tms32082_mp_device::processor_command(UINT32 command) { // simulate PP behavior for now... m_program->write_dword(0x00000084, 3); + + UINT32 num = m_program->read_dword(0x90); + + printf("PP num %d\n", num); + + /* + UINT32 ra = 0x1000280; + + printf("FIFO push:\n"); + + for (int i=0; i < num; i++) + { + printf("Entry %d:\n", i); + for (int k=0; k < 6; k++) + { + for (int l=0; l < 4; l++) + { + UINT32 dd = m_program->read_dword(ra); + ra += 4; + + printf("%08X(%f) ", dd, u2f(dd)); + } + printf("\n"); + } + printf("\n"); + } + */ + + UINT32 ra = 0x1000280; + + int oldnum = m_program->read_dword(0x600ffffc); + UINT32 rb = 0x60000000 + (oldnum * 0x60); + + for (int i=0; i < num; i++) + { + for (int k=0; k < 24; k++) + { + UINT32 dd = m_program->read_dword(ra); + ra += 4; + + m_program->write_dword(rb, dd); + rb += 4; + } + } + m_program->write_dword(0x600ffffc, oldnum+num); + + m_program->write_dword(0x00000090, 0); + m_program->write_dword(0x00000094, num); + } } // PP1 @@ -315,6 +367,9 @@ UINT32 tms32082_mp_device::read_creg(int reg) case 0xa: // PPERROR return 0xe0000; + case 0xe: // TCOUNT + return m_tcount; + case 0x4000: // IN0P return m_in0p; @@ -358,6 +413,10 @@ void tms32082_mp_device::write_creg(int reg, UINT32 data) printf("IE = %08X\n", data); break; + case 0xe: // TCOUNT + m_tcount = data; + break; + case 0x4000: // IN0P m_in0p = data; break; @@ -453,6 +512,13 @@ void tms32082_mp_device::execute_run() m_ir = fetch(); execute(); + m_tcount--; + if (m_tcount < 0) + { + // TODO: timer interrupt + m_tcount = m_tscale; + } + m_icount--; }; diff --git a/src/emu/cpu/tms32082/tms32082.h b/src/emu/cpu/tms32082/tms32082.h index c08fffa3640..494f1580504 100644 --- a/src/emu/cpu/tms32082/tms32082.h +++ b/src/emu/cpu/tms32082/tms32082.h @@ -55,7 +55,9 @@ public: MP_IN1P, MP_OUTP, MP_IE, - MP_INTPEN + MP_INTPEN, + MP_TCOUNT, + MP_TSCALE }; enum @@ -127,6 +129,9 @@ protected: UINT32 m_epc; UINT32 m_eip; + UINT32 m_tcount; + UINT32 m_tscale; + UINT32 m_param_ram[0x800]; int m_icount; |