summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms32010
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-03-28 05:25:15 +1100
committer Vas Crabb <vas@vastheman.com>2018-03-28 05:25:15 +1100
commit010155a3c51aa80dcf736b52ec89ffd890f795ef (patch)
treea732be4076a467e5dc25f088f9296544f364f858 /src/devices/cpu/tms32010
parent703564beccc92a6b6b33ab9562732a4e7ceaae8d (diff)
Reshuffle some stuff:
* Move around the debugger hooks to get a small but measurable performance increase * Remove emucore from external tools * Improve performance of DSP16 interpreter a little by generating six variants of execution loop
Diffstat (limited to 'src/devices/cpu/tms32010')
-rw-r--r--src/devices/cpu/tms32010/32010dsm.cpp16
-rw-r--r--src/devices/cpu/tms32010/tms32010.cpp4
2 files changed, 11 insertions, 9 deletions
diff --git a/src/devices/cpu/tms32010/32010dsm.cpp b/src/devices/cpu/tms32010/32010dsm.cpp
index a1dfade63b4..4601498ce64 100644
--- a/src/devices/cpu/tms32010/32010dsm.cpp
+++ b/src/devices/cpu/tms32010/32010dsm.cpp
@@ -26,7 +26,10 @@
#include "emu.h"
#include "32010dsm.h"
+
#include <ctype.h>
+#include <stdexcept>
+
const char *const tms32010_disassembler::arith[4] = { "*" , "*-" , "*+" , "??" } ;
const char *const tms32010_disassembler::nextar[4] = { ",AR0" , ",AR1" , "" , "" } ;
@@ -174,16 +177,15 @@ tms32010_disassembler::tms32010_disassembler()
case 'r':
case 's':
case 'w':
- bit --;
+ bit--;
break;
- default: fatalerror("Invalid instruction encoding '%s %s'\n",
- ops[0],ops[1]);
+ default:
+ throw std::logic_error(util::string_format("Invalid instruction encoding '%s %s'\n", ops[0],ops[1]));
}
}
if (bit != -1 )
{
- fatalerror("not enough bits in encoding '%s %s' %d\n",
- ops[0],ops[1],bit);
+ throw std::logic_error(util::string_format("not enough bits in encoding '%s %s' %d\n", ops[0],ops[1],bit));
}
while (isspace((uint8_t)*p)) p++;
Op.emplace_back(mask, bits, *p, ops[0], ops[1]);
@@ -258,7 +260,7 @@ offs_t tms32010_disassembler::disassemble(std::ostream &stream, offs_t pc, const
case 'w': w <<=1; w |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
case ' ': break;
case '1': case '0': bit--; break;
- case '\0': fatalerror("premature end of parse string, opcode %x, bit = %d\n",code,bit);
+ case '\0': throw std::logic_error(util::string_format("premature end of parse string, opcode %x, bit = %d\n",code,bit));
}
cp++;
}
@@ -290,7 +292,7 @@ offs_t tms32010_disassembler::disassemble(std::ostream &stream, offs_t pc, const
case 'S': sprintf(num,",%d",s); break;
case 'W': sprintf(num,"%04Xh",w); break;
default:
- fatalerror("illegal escape character in format '%s'\n",Op[op].fmt);
+ throw std::logic_error(util::string_format("illegal escape character in format '%s'\n",Op[op].fmt));
}
stream << num;
}
diff --git a/src/devices/cpu/tms32010/tms32010.cpp b/src/devices/cpu/tms32010/tms32010.cpp
index c5e15660a6f..8b336a9d401 100644
--- a/src/devices/cpu/tms32010/tms32010.cpp
+++ b/src/devices/cpu/tms32010/tms32010.cpp
@@ -871,7 +871,7 @@ void tms32010_device::device_start()
state_add(STATE_GENSP, "GENSP", m_STACK[3]).formatstr("%04X").noshow();
state_add(STATE_GENFLAGS, "GENFLAGS", m_STR).formatstr("%16s").noshow();
- m_icountptr = &m_icount;
+ set_icountptr(m_icount);
}
@@ -965,7 +965,7 @@ void tms32010_device::execute_run()
m_PREVPC = m_PC;
- debugger_instruction_hook(this, m_PC);
+ debugger_instruction_hook(m_PC);
m_opcode.d = M_RDOP(m_PC);
m_PC++;