diff options
Diffstat (limited to 'src/emu/cpu')
-rw-r--r-- | src/emu/cpu/amis2000/amis2000.h | 2 | ||||
-rw-r--r-- | src/emu/cpu/e0c6200/e0c6200.c | 104 | ||||
-rw-r--r-- | src/emu/cpu/e0c6200/e0c6200.h | 73 | ||||
-rw-r--r-- | src/emu/cpu/e0c6200/e0c6200d.c | 18 | ||||
-rw-r--r-- | src/emu/cpu/e0c6200/e0c6200op.inc | 1 | ||||
-rw-r--r-- | src/emu/cpu/hmcs40/hmcs40.h | 2 | ||||
-rw-r--r-- | src/emu/cpu/tms0980/tms0980.h | 2 | ||||
-rw-r--r-- | src/emu/cpu/tms34010/tms34010.c | 7 | ||||
-rw-r--r-- | src/emu/cpu/tms34010/tms34010.h | 5 | ||||
-rw-r--r-- | src/emu/cpu/ucom4/ucom4.h | 2 |
10 files changed, 207 insertions, 9 deletions
diff --git a/src/emu/cpu/amis2000/amis2000.h b/src/emu/cpu/amis2000/amis2000.h index ba565205b21..d04127eec16 100644 --- a/src/emu/cpu/amis2000/amis2000.h +++ b/src/emu/cpu/amis2000/amis2000.h @@ -83,7 +83,7 @@ protected: virtual void execute_run(); // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config :((spacenum == AS_DATA) ? &m_data_config : NULL); } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 1; } diff --git a/src/emu/cpu/e0c6200/e0c6200.c b/src/emu/cpu/e0c6200/e0c6200.c new file mode 100644 index 00000000000..4674aa3d01e --- /dev/null +++ b/src/emu/cpu/e0c6200/e0c6200.c @@ -0,0 +1,104 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Seiko Epson E0C6200 CPU core and E0C62 MCU family + + References: + - 1998 MF297-06a E0C6200/E0C6200A Core CPU Manual + - 1998 MF1049-01a E0C6S46 Technical Manual + + TODO: + - niks + +*/ + +#include "e0c6200.h" +#include "debugger.h" + +#include "e0c6200op.inc" + + +const device_type EPSON_E0C6S46 = &device_creator<e0c6s46_device>; + + +// internal memory maps +static ADDRESS_MAP_START(program_1k, AS_PROGRAM, 16, e0c6200_cpu_device) + AM_RANGE(0x0000, 0x03ff) AM_ROM +ADDRESS_MAP_END + + +static ADDRESS_MAP_START(data_64x4, AS_DATA, 8, e0c6200_cpu_device) + AM_RANGE(0x00, 0x3f) AM_RAM +ADDRESS_MAP_END + + +// device definitions +e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : e0c6200_cpu_device(mconfig, EPSON_E0C6S46, "E0C6S46", tag, owner, clock, 10, ADDRESS_MAP_NAME(program_1k), 6, ADDRESS_MAP_NAME(data_64x4), "e0c6s46", __FILE__) +{ } + + +// disasm +void e0c6200_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + break; + + default: break; + } +} + +offs_t e0c6200_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(e0c6200); + return CPU_DISASSEMBLE_NAME(e0c6200)(this, buffer, pc, oprom, opram, options); +} + + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void e0c6200_cpu_device::device_start() +{ + m_program = &space(AS_PROGRAM); + m_data = &space(AS_DATA); + m_prgmask = (1 << m_prgwidth) - 1; + m_datamask = (1 << m_datawidth) - 1; + + // zerofill + + // register for savestates + + // register state for debugger + + m_icountptr = &m_icount; +} + + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void e0c6200_cpu_device::device_reset() +{ +} + + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void e0c6200_cpu_device::execute_run() +{ + while (m_icount > 0) + { + m_icount--; + } +} diff --git a/src/emu/cpu/e0c6200/e0c6200.h b/src/emu/cpu/e0c6200/e0c6200.h new file mode 100644 index 00000000000..c4bd04b2254 --- /dev/null +++ b/src/emu/cpu/e0c6200/e0c6200.h @@ -0,0 +1,73 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Seiko Epson E0C6200 CPU core and E0C62 MCU family + +*/ + +#ifndef _E06200_H_ +#define _E06200_H_ + +#include "emu.h" + + +class e0c6200_cpu_device : public cpu_device +{ +public: + // construction/destruction + e0c6200_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) + , m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, 0, program) + , m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data) + , m_prgwidth(prgwidth) + , m_datawidth(datawidth) + { } + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + // device_execute_interface overrides + virtual UINT32 execute_min_cycles() const { return 5; } + virtual UINT32 execute_max_cycles() const { return 12; } + virtual UINT32 execute_input_lines() const { return 1; } + virtual void execute_run(); + + // device_memory_interface overrides + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } + + // device_disasm_interface overrides + virtual UINT32 disasm_min_opcode_bytes() const { return 2; } + virtual UINT32 disasm_max_opcode_bytes() const { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); + + void state_string_export(const device_state_entry &entry, std::string &str); + + address_space_config m_program_config; + address_space_config m_data_config; + address_space *m_program; + address_space *m_data; + + int m_prgwidth; + int m_datawidth; + int m_prgmask; + int m_datamask; + + int m_icount; +}; + + +class e0c6s46_device : public e0c6200_cpu_device +{ +public: + e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + + +extern const device_type EPSON_E0C6S46; + + +#endif /* _E06200_H_ */ diff --git a/src/emu/cpu/e0c6200/e0c6200d.c b/src/emu/cpu/e0c6200/e0c6200d.c new file mode 100644 index 00000000000..def8eb9bee7 --- /dev/null +++ b/src/emu/cpu/e0c6200/e0c6200d.c @@ -0,0 +1,18 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Seiko Epson E0C6200 disassembler + +*/ + +#include "emu.h" +#include "debugger.h" +#include "e0c6200.h" + + + +CPU_DISASSEMBLE(e0c6200) +{ + return 2; +} diff --git a/src/emu/cpu/e0c6200/e0c6200op.inc b/src/emu/cpu/e0c6200/e0c6200op.inc new file mode 100644 index 00000000000..946fdf6a4d5 --- /dev/null +++ b/src/emu/cpu/e0c6200/e0c6200op.inc @@ -0,0 +1 @@ +// E0C6200 opcode handlers diff --git a/src/emu/cpu/hmcs40/hmcs40.h b/src/emu/cpu/hmcs40/hmcs40.h index b5967a4d640..9e722f595a6 100644 --- a/src/emu/cpu/hmcs40/hmcs40.h +++ b/src/emu/cpu/hmcs40/hmcs40.h @@ -153,7 +153,7 @@ protected: virtual void execute_run(); // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config :((spacenum == AS_DATA) ? &m_data_config : NULL); } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 2; } diff --git a/src/emu/cpu/tms0980/tms0980.h b/src/emu/cpu/tms0980/tms0980.h index a291c95de92..15caeedeedb 100644 --- a/src/emu/cpu/tms0980/tms0980.h +++ b/src/emu/cpu/tms0980/tms0980.h @@ -90,7 +90,7 @@ protected: virtual void execute_run(); // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config :((spacenum == AS_DATA) ? &m_data_config : NULL); } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 1; } diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 53882e3a59e..54084f631f8 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -35,7 +35,7 @@ tms340x0_device::tms340x0_device(const machine_config &mconfig, device_type type : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , device_video_interface(mconfig, *this) , m_program_config("program", ENDIANNESS_LITTLE, 16, 32, 3) - , m_reset_deferred(FALSE) + , m_halt_on_reset(FALSE) , m_pixclock(0) , m_pixperclock(0) , m_output_int_cb(*this) @@ -648,6 +648,8 @@ void tms340x0_device::device_reset() /* HALT the CPU if requested, and remember to re-read the starting PC */ /* the first time we are run */ + m_reset_deferred = m_halt_on_reset; + if (m_reset_deferred) { io_register_w(*m_program, REG_HSTCTLH, 0x8000, 0xffff); @@ -714,11 +716,10 @@ void tms340x0_device::execute_run() m_icount = 0; return; } - /* if the CPU's reset was deferred, do it now */ if (m_reset_deferred) { - m_reset_deferred = 0; + m_reset_deferred = FALSE; m_pc = RLONG(0xffffffe0); } diff --git a/src/emu/cpu/tms34010/tms34010.h b/src/emu/cpu/tms34010/tms34010.h index b9420def0ae..e46fbe29783 100644 --- a/src/emu/cpu/tms34010/tms34010.h +++ b/src/emu/cpu/tms34010/tms34010.h @@ -240,7 +240,7 @@ public: // construction/destruction tms340x0_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); - static void set_halt_on_reset(device_t &device, bool reset_deferred) { downcast<tms340x0_device &>(device).m_reset_deferred = reset_deferred; } + static void set_halt_on_reset(device_t &device, bool halt_on_reset) { downcast<tms340x0_device &>(device).m_halt_on_reset = halt_on_reset; } static void set_pixel_clock(device_t &device, UINT32 pixclock) { downcast<tms340x0_device &>(device).m_pixclock = pixclock; } static void set_pixels_per_clock(device_t &device, int pixperclock) { downcast<tms340x0_device &>(device).m_pixperclock = pixperclock; } static void set_scanline_ind16_callback(device_t &device, scanline_ind16_cb_delegate callback) { downcast<tms340x0_device &>(device).m_scanline_ind16_cb = callback; } @@ -327,7 +327,8 @@ protected: INT32 m_gfxcycles; UINT8 m_pixelshift; UINT8 m_is_34020; - bool m_reset_deferred; /* /HCS pin, which determines HALT state after reset */ + bool m_reset_deferred; + bool m_halt_on_reset; /* /HCS pin, which determines HALT state after reset */ UINT8 m_hblank_stable; UINT8 m_external_host_access; UINT8 m_executing; diff --git a/src/emu/cpu/ucom4/ucom4.h b/src/emu/cpu/ucom4/ucom4.h index 5c4cd18eac4..5e2bff9a62c 100644 --- a/src/emu/cpu/ucom4/ucom4.h +++ b/src/emu/cpu/ucom4/ucom4.h @@ -144,7 +144,7 @@ protected: virtual void execute_run(); // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config :((spacenum == AS_DATA) ? &m_data_config : NULL); } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 1; } |