summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/scmp/scmp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/scmp/scmp.cpp')
-rw-r--r--src/devices/cpu/scmp/scmp.cpp37
1 files changed, 12 insertions, 25 deletions
diff --git a/src/devices/cpu/scmp/scmp.cpp b/src/devices/cpu/scmp/scmp.cpp
index a9021737300..f37308da5a5 100644
--- a/src/devices/cpu/scmp/scmp.cpp
+++ b/src/devices/cpu/scmp/scmp.cpp
@@ -4,7 +4,8 @@
*
* scmp.c
*
- * National Semiconductor SC/MP CPU Disassembly
+ * National Semiconductor SC/MP CPU emulation
+ * (SC/MP = Simple-to-use, Cost-effective MicroProcessor)
*
*****************************************************************************/
@@ -12,13 +13,11 @@
#include "scmp.h"
#include "scmpdasm.h"
-#include "debugger.h"
-
//#define VERBOSE 1
#include "logmacro.h"
-DEFINE_DEVICE_TYPE(SCMP, scmp_device, "ins8050", "National Semiconductor INS 8050 SC/MP")
+DEFINE_DEVICE_TYPE(SCMP, scmp_device, "ins8050", "National Semiconductor ISP-8A/500D SC/MP")
DEFINE_DEVICE_TYPE(INS8060, ins8060_device, "ins8060", "National Semiconductor INS 8060 SC/MP II")
@@ -30,13 +29,13 @@ scmp_device::scmp_device(const machine_config &mconfig, const char *tag, device_
scmp_device::scmp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, type, tag, owner, clock)
- , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0)
+ , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0)
, m_AC(0), m_ER(0), m_SR(0), m_icount(0)
, m_flag_out_func(*this)
, m_sout_func(*this)
- , m_sin_func(*this)
- , m_sensea_func(*this)
- , m_senseb_func(*this)
+ , m_sin_func(*this, 0)
+ , m_sensea_func(*this, 0)
+ , m_senseb_func(*this, 0)
, m_halt_func(*this)
{
}
@@ -134,15 +133,10 @@ uint16_t scmp_device::GET_ADDR(uint8_t code)
uint16_t ptr = GET_PTR_REG(code & 0x03)->w.l;
uint8_t arg = ARG();
- if (arg == 0x80) {
+ if (arg == 0x80)
offset = m_ER;
- } else {
- if (arg & 0x80) {
- offset = (int8_t)arg;
- } else {
- offset = arg;
- }
- }
+ else
+ offset = (int8_t)arg;
addr = ADD12(ptr,offset);
@@ -276,7 +270,8 @@ void scmp_device::execute_one(int opcode)
// Transfer Instructions
case 0x90 : case 0x91 : case 0x92 : case 0x93 :// JMP
m_icount -= 11;
- m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)ARG());
+ tmp = ARG(); // PC must be updated before the destination address is calculated
+ m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)tmp);
break;
case 0x94 : case 0x95 : case 0x96 : case 0x97 :
// JP
@@ -505,14 +500,6 @@ void scmp_device::device_start()
space(AS_PROGRAM).cache(m_cache);
space(AS_PROGRAM).specific(m_program);
- /* resolve callbacks */
- m_flag_out_func.resolve_safe();
- m_sout_func.resolve_safe();
- m_sin_func.resolve_safe(0);
- m_sensea_func.resolve_safe(0);
- m_senseb_func.resolve_safe(0);
- m_halt_func.resolve_safe();
-
save_item(NAME(m_PC));
save_item(NAME(m_P1));
save_item(NAME(m_P2));