diff options
author | 2012-12-27 22:54:24 +0000 | |
---|---|---|
committer | 2012-12-27 22:54:24 +0000 | |
commit | 0d4df20bc9678049e9e7aa88722ac426abbcc39e (patch) | |
tree | 145bea9dde50e0eceff12f58d11dad35a09be702 /src/emu/cpu/e132xs | |
parent | 964a715fb7c729fb99a6bb758f465cb39cb6c675 (diff) |
- e132xs.c: Reverting modernization. (nw)
Diffstat (limited to 'src/emu/cpu/e132xs')
-rw-r--r-- | src/emu/cpu/e132xs/e132xs.c | 2661 | ||||
-rw-r--r-- | src/emu/cpu/e132xs/e132xs.h | 631 | ||||
-rw-r--r-- | src/emu/cpu/e132xs/e132xsop.c | 1191 |
3 files changed, 2222 insertions, 2261 deletions
diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c index 1782eb4912e..31a3f12f1b2 100644 --- a/src/emu/cpu/e132xs/e132xs.c +++ b/src/emu/cpu/e132xs/e132xs.c @@ -227,7 +227,130 @@ /* Registers */ +enum +{ + E132XS_PC = 1, + E132XS_SR, + E132XS_FER, + E132XS_G3, + E132XS_G4, + E132XS_G5, + E132XS_G6, + E132XS_G7, + E132XS_G8, + E132XS_G9, + E132XS_G10, + E132XS_G11, + E132XS_G12, + E132XS_G13, + E132XS_G14, + E132XS_G15, + E132XS_G16, + E132XS_G17, + E132XS_SP, + E132XS_UB, + E132XS_BCR, + E132XS_TPR, + E132XS_TCR, + E132XS_TR, + E132XS_WCR, + E132XS_ISR, + E132XS_FCR, + E132XS_MCR, + E132XS_G28, + E132XS_G29, + E132XS_G30, + E132XS_G31, + E132XS_CL0, E132XS_CL1, E132XS_CL2, E132XS_CL3, + E132XS_CL4, E132XS_CL5, E132XS_CL6, E132XS_CL7, + E132XS_CL8, E132XS_CL9, E132XS_CL10,E132XS_CL11, + E132XS_CL12,E132XS_CL13,E132XS_CL14,E132XS_CL15, + E132XS_L0, E132XS_L1, E132XS_L2, E132XS_L3, + E132XS_L4, E132XS_L5, E132XS_L6, E132XS_L7, + E132XS_L8, E132XS_L9, E132XS_L10, E132XS_L11, + E132XS_L12, E132XS_L13, E132XS_L14, E132XS_L15, + E132XS_L16, E132XS_L17, E132XS_L18, E132XS_L19, + E132XS_L20, E132XS_L21, E132XS_L22, E132XS_L23, + E132XS_L24, E132XS_L25, E132XS_L26, E132XS_L27, + E132XS_L28, E132XS_L29, E132XS_L30, E132XS_L31, + E132XS_L32, E132XS_L33, E132XS_L34, E132XS_L35, + E132XS_L36, E132XS_L37, E132XS_L38, E132XS_L39, + E132XS_L40, E132XS_L41, E132XS_L42, E132XS_L43, + E132XS_L44, E132XS_L45, E132XS_L46, E132XS_L47, + E132XS_L48, E132XS_L49, E132XS_L50, E132XS_L51, + E132XS_L52, E132XS_L53, E132XS_L54, E132XS_L55, + E132XS_L56, E132XS_L57, E132XS_L58, E132XS_L59, + E132XS_L60, E132XS_L61, E132XS_L62, E132XS_L63 +}; + + +/* Delay information */ +struct delay_info +{ + INT32 delay_cmd; + UINT32 delay_pc; +}; + /* Internal registers */ +struct hyperstone_state +{ + UINT32 global_regs[32]; + UINT32 local_regs[64]; + + /* internal stuff */ + UINT32 ppc; // previous pc + UINT16 op; // opcode + UINT32 trap_entry; // entry point to get trap address + + UINT8 clock_scale_mask; + UINT8 clock_scale; + UINT8 clock_cycles_1; + UINT8 clock_cycles_2; + UINT8 clock_cycles_4; + UINT8 clock_cycles_6; + + UINT64 tr_base_cycles; + UINT32 tr_base_value; + UINT32 tr_clocks_per_tick; + UINT8 timer_int_pending; + emu_timer *timer; + + delay_info delay; + + device_irq_acknowledge_callback irq_callback; + legacy_cpu_device *device; + address_space *program; + direct_read_data *direct; + address_space *io; + UINT32 opcodexor; + + INT32 instruction_length; + INT32 intblock; + + int icount; +}; + +struct regs_decode +{ + UINT8 src, dst; // destination and source register code + UINT32 src_value; // current source register value + UINT32 next_src_value; // current next source register value + UINT32 dst_value; // current destination register value + UINT32 next_dst_value; // current next destination register value + UINT8 sub_type; // sub type opcode (for DD and X_CODE bits) + union + { + UINT32 u; + INT32 s; + } extra; // extra value such as immediate value, const, pcrel, ... + UINT8 src_is_local; + UINT8 dst_is_local; + UINT8 same_src_dst; + UINT8 same_src_dstf; + UINT8 same_srcf_dst; +}; + +static void check_interrupts(hyperstone_state *cpustate); #define SREG (decode)->src_value #define SREGF (decode)->next_src_value @@ -236,10 +359,10 @@ #define EXTRA_U (decode)->extra.u #define EXTRA_S (decode)->extra.s -#define SET_SREG( _data_ ) ((decode)->src_is_local ? set_local_register((decode)->src, (UINT32)_data_) : set_global_register((decode)->src, (UINT32)_data_)) -#define SET_SREGF( _data_ ) ((decode)->src_is_local ? set_local_register((decode)->src + 1, (UINT32)_data_) : set_global_register((decode)->src + 1, (UINT32)_data_)) -#define SET_DREG( _data_ ) ((decode)->dst_is_local ? set_local_register((decode)->dst, (UINT32)_data_) : set_global_register((decode)->dst, (UINT32)_data_)) -#define SET_DREGF( _data_ ) ((decode)->dst_is_local ? set_local_register((decode)->dst + 1, (UINT32)_data_) : set_global_register((decode)->dst + 1, (UINT32)_data_)) +#define SET_SREG( _data_ ) ((decode)->src_is_local ? set_local_register(cpustate, (decode)->src, (UINT32)_data_) : set_global_register(cpustate, (decode)->src, (UINT32)_data_)) +#define SET_SREGF( _data_ ) ((decode)->src_is_local ? set_local_register(cpustate, (decode)->src + 1, (UINT32)_data_) : set_global_register(cpustate, (decode)->src + 1, (UINT32)_data_)) +#define SET_DREG( _data_ ) ((decode)->dst_is_local ? set_local_register(cpustate, (decode)->dst, (UINT32)_data_) : set_global_register(cpustate, (decode)->dst, (UINT32)_data_)) +#define SET_DREGF( _data_ ) ((decode)->dst_is_local ? set_local_register(cpustate, (decode)->dst + 1, (UINT32)_data_) : set_global_register(cpustate, (decode)->dst + 1, (UINT32)_data_)) #define SRC_IS_PC (!(decode)->src_is_local && (decode)->src == PC_REGISTER) #define DST_IS_PC (!(decode)->dst_is_local && (decode)->dst == PC_REGISTER) @@ -249,204 +372,72 @@ #define SAME_SRC_DSTF (decode)->same_src_dstf #define SAME_SRCF_DST (decode)->same_srcf_dst -//************************************************************************** -// INTERNAL ADDRESS MAP -//************************************************************************** - // 4Kb IRAM (On-Chip Memory) -static ADDRESS_MAP_START( e116_4k_iram_map, AS_PROGRAM, 16, hyperstone_device ) +static ADDRESS_MAP_START( e116_4k_iram_map, AS_PROGRAM, 16, legacy_cpu_device ) AM_RANGE(0xc0000000, 0xc0000fff) AM_RAM AM_MIRROR(0x1ffff000) ADDRESS_MAP_END -static ADDRESS_MAP_START( e132_4k_iram_map, AS_PROGRAM, 32, hyperstone_device ) + + +static ADDRESS_MAP_START( e132_4k_iram_map, AS_PROGRAM, 32, legacy_cpu_device ) AM_RANGE(0xc0000000, 0xc0000fff) AM_RAM AM_MIRROR(0x1ffff000) ADDRESS_MAP_END // 8Kb IRAM (On-Chip Memory) -static ADDRESS_MAP_START( e116_8k_iram_map, AS_PROGRAM, 16, hyperstone_device ) +static ADDRESS_MAP_START( e116_8k_iram_map, AS_PROGRAM, 16, legacy_cpu_device ) + AM_RANGE(0xc0000000, 0xc0001fff) AM_RAM AM_MIRROR(0x1fffe000) ADDRESS_MAP_END -static ADDRESS_MAP_START( e132_8k_iram_map, AS_PROGRAM, 32, hyperstone_device ) + + +static ADDRESS_MAP_START( e132_8k_iram_map, AS_PROGRAM, 32, legacy_cpu_device ) AM_RANGE(0xc0000000, 0xc0001fff) AM_RAM AM_MIRROR(0x1fffe000) ADDRESS_MAP_END // 16Kb IRAM (On-Chip Memory) -static ADDRESS_MAP_START( e116_16k_iram_map, AS_PROGRAM, 16, hyperstone_device ) - AM_RANGE(0xc0000000, 0xc0003fff) AM_RAM AM_MIRROR(0x1fffc000) -ADDRESS_MAP_END -static ADDRESS_MAP_START( e132_16k_iram_map, AS_PROGRAM, 32, hyperstone_device ) +static ADDRESS_MAP_START( e116_16k_iram_map, AS_PROGRAM, 16, legacy_cpu_device ) AM_RANGE(0xc0000000, 0xc0003fff) AM_RAM AM_MIRROR(0x1fffc000) ADDRESS_MAP_END -//------------------------------------------------- -// hyperstone_device - constructor -//------------------------------------------------- - -hyperstone_device::hyperstone_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 io_data_width, address_map_constructor internal_map) - : cpu_device(mconfig, type, name, tag, owner, clock), - m_program_config("program", ENDIANNESS_BIG, prg_data_width, 32), - m_io_config("io", ENDIANNESS_BIG, io_data_width, 15), - m_icount(0) -{ - // build the opcode table - for (int op = 0; op < 256; op++) - m_opcode[op] = s_opcodetable[op]; -} - - -//------------------------------------------------- -// e116t_device - constructor -//------------------------------------------------- - -e116t_device::e116t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-16T", tag, owner, clock, E116T, 16, 16, ADDRESS_MAP_NAME(e116_4k_iram_map)) -{ -} - - -//------------------------------------------------- -// e116xt_device - constructor -//------------------------------------------------- - -e116xt_device::e116xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-16XT", tag, owner, clock, E116XT, 16, 16, ADDRESS_MAP_NAME(e116_8k_iram_map)) -{ -} - - -//------------------------------------------------- -// e116xs_device - constructor -//------------------------------------------------- - -e116xs_device::e116xs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-16XS", tag, owner, clock, E116XS, 16, 16, ADDRESS_MAP_NAME(e116_16k_iram_map)) -{ -} - - -//------------------------------------------------- -// e116xsr_device - constructor -//------------------------------------------------- - -e116xsr_device::e116xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-16XSR", tag, owner, clock, E116XT, 16, 16, ADDRESS_MAP_NAME(e116_16k_iram_map)) -{ -} - - -//------------------------------------------------- -// e132n_device - constructor -//------------------------------------------------- - -e132n_device::e132n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-32N", tag, owner, clock, E132N, 32, 32, ADDRESS_MAP_NAME(e132_4k_iram_map)) -{ -} - - -//------------------------------------------------- -// e132t_device - constructor -//------------------------------------------------- - -e132t_device::e132t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-32T", tag, owner, clock, E132T, 32, 32, ADDRESS_MAP_NAME(e132_4k_iram_map)) -{ -} - - -//------------------------------------------------- -// e132xn_device - constructor -//------------------------------------------------- - -e132xn_device::e132xn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-32XN", tag, owner, clock, E132XN, 32, 32, ADDRESS_MAP_NAME(e132_8k_iram_map)) -{ -} - - -//------------------------------------------------- -// e132xt_device - constructor -//------------------------------------------------- - -e132xt_device::e132xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-32XT", tag, owner, clock, E132XT, 32, 32, ADDRESS_MAP_NAME(e132_8k_iram_map)) -{ -} - - -//------------------------------------------------- -// e132xs_device - constructor -//------------------------------------------------- - -e132xs_device::e132xs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-32XS", tag, owner, clock, E132XS, 32, 32, ADDRESS_MAP_NAME(e132_16k_iram_map)) -{ -} - - -//------------------------------------------------- -// e132xsr_device - constructor -//------------------------------------------------- - -e132xsr_device::e132xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "E1-32XSR", tag, owner, clock, E132XSR, 32, 32, ADDRESS_MAP_NAME(e132_16k_iram_map)) -{ -} - - -//------------------------------------------------- -// gms30c2116_device - constructor -//------------------------------------------------- - -gms30c2116_device::gms30c2116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "GMS30C2116", tag, owner, clock, GMS30C2116, 16, 16, ADDRESS_MAP_NAME(e116_4k_iram_map)) -{ -} - - -//------------------------------------------------- -// gms30c2132_device - constructor -//------------------------------------------------- - -gms30c2132_device::gms30c2132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "GMS30C2132", tag, owner, clock, GMS30C2132, 32, 32, ADDRESS_MAP_NAME(e132_4k_iram_map)) -{ -} - - -//------------------------------------------------- -// gms30c2216_device - constructor -//------------------------------------------------- - -gms30c2216_device::gms30c2216_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "GMS30C2216", tag, owner, clock, GMS30C2216, 16, 16, ADDRESS_MAP_NAME(e116_8k_iram_map)) -{ -} +static ADDRESS_MAP_START( e132_16k_iram_map, AS_PROGRAM, 32, legacy_cpu_device ) + AM_RANGE(0xc0000000, 0xc0003fff) AM_RAM AM_MIRROR(0x1fffc000) +ADDRESS_MAP_END -//------------------------------------------------- -// gms30c2232_device - constructor -//------------------------------------------------- -gms30c2232_device::gms30c2232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hyperstone_device(mconfig, "GMS30C2232", tag, owner, clock, GMS30C2232, 32, 32, ADDRESS_MAP_NAME(e132_8k_iram_map)) +INLINE hyperstone_state *get_safe_token(device_t *device) { + assert(device != NULL); + assert(device->type() == E116T || + device->type() == E116XT || + device->type() == E116XS || + device->type() == E116XSR || + device->type() == E132N || + device->type() == E132T || + device->type() == E132XN || + device->type() == E132XT || + device->type() == E132XS || + device->type() == E132XSR || + device->type() == GMS30C2116 || + device->type() == GMS30C2132 || + device->type() == GMS30C2216 || + device->type() == GMS30C2232); + return (hyperstone_state *)downcast<legacy_cpu_device *>(device)->token(); } /* Return the entry point for a determinated trap */ -UINT32 hyperstone_device::get_trap_addr(UINT8 trapno) +static UINT32 get_trap_addr(hyperstone_state *cpustate, UINT8 trapno) { UINT32 addr; - if( m_trap_entry == 0xffffff00 ) /* @ MEM3 */ + if( cpustate->trap_entry == 0xffffff00 ) /* @ MEM3 */ { addr = trapno * 4; } @@ -454,48 +445,48 @@ UINT32 hyperstone_device::get_trap_addr(UINT8 trapno) { addr = (63 - trapno) * 4; } - addr |= m_trap_entry; + addr |= cpustate->trap_entry; return addr; } /* Return the entry point for a determinated emulated code (the one for "extend" opcode is reserved) */ -UINT32 hyperstone_device::get_emu_code_addr(UINT8 num) /* num is OP */ +static UINT32 get_emu_code_addr(hyperstone_state *cpustate, UINT8 num) /* num is OP */ { UINT32 addr; - if( m_trap_entry == 0xffffff00 ) /* @ MEM3 */ + if( cpustate->trap_entry == 0xffffff00 ) /* @ MEM3 */ { - addr = (m_trap_entry - 0x100) | ((num & 0xf) << 4); + addr = (cpustate->trap_entry - 0x100) | ((num & 0xf) << 4); } else { - addr = m_trap_entry | (0x10c | ((0xcf - num) << 4)); + addr = cpustate->trap_entry | (0x10c | ((0xcf - num) << 4)); } return addr; } -void hyperstone_device::hyperstone_set_trap_entry(int which) +static void hyperstone_set_trap_entry(hyperstone_state *cpustate, int which) { switch( which ) { case E132XS_ENTRY_MEM0: - m_trap_entry = 0x00000000; + cpustate->trap_entry = 0x00000000; break; case E132XS_ENTRY_MEM1: - m_trap_entry = 0x40000000; + cpustate->trap_entry = 0x40000000; break; case E132XS_ENTRY_MEM2: - m_trap_entry = 0x80000000; + cpustate->trap_entry = 0x80000000; break; case E132XS_ENTRY_MEM3: - m_trap_entry = 0xffffff00; + cpustate->trap_entry = 0xffffff00; break; case E132XS_ENTRY_IRAM: - m_trap_entry = 0xc0000000; + cpustate->trap_entry = 0xc0000000; break; default: @@ -504,23 +495,23 @@ void hyperstone_device::hyperstone_set_trap_entry(int which) } } -#define OP m_op -#define PPC m_ppc //previous pc -#define PC m_global_regs[0] //Program Counter -#define SR m_global_regs[1] //Status Register -#define FER m_global_regs[2] //Floating-Point Exception Register +#define OP cpustate->op +#define PPC cpustate->ppc //previous pc +#define PC cpustate->global_regs[0] //Program Counter +#define SR cpustate->global_regs[1] //Status Register +#define FER cpustate->global_regs[2] //Floating-Point Exception Register // 03 - 15 General Purpose Registers // 16 - 17 Reserved -#define SP m_global_regs[18] //Stack Pointer -#define UB m_global_regs[19] //Upper Stack Bound -#define BCR m_global_regs[20] //Bus Control Register -#define TPR m_global_regs[21] //Timer Prescaler Register -#define TCR m_global_regs[22] //Timer Compare Register -#define TR compute_tr() //Timer Register -#define WCR m_global_regs[24] //Watchdog Compare Register -#define ISR m_global_regs[25] //Input Status Register -#define FCR m_global_regs[26] //Function Control Register -#define MCR m_global_regs[27] //Memory Control Register +#define SP cpustate->global_regs[18] //Stack Pointer +#define UB cpustate->global_regs[19] //Upper Stack Bound +#define BCR cpustate->global_regs[20] //Bus Control Register +#define TPR cpustate->global_regs[21] //Timer Prescaler Register +#define TCR cpustate->global_regs[22] //Timer Compare Register +#define TR compute_tr(cpustate) //Timer Register +#define WCR cpustate->global_regs[24] //Watchdog Compare Register +#define ISR cpustate->global_regs[25] //Input Status Register +#define FCR cpustate->global_regs[26] //Function Control Register +#define MCR cpustate->global_regs[27] //Memory Control Register // 28 - 31 Reserved /* SR flags */ @@ -580,88 +571,92 @@ void hyperstone_device::hyperstone_set_trap_entry(int which) //the user program can only changes the above 2 flags -UINT32 hyperstone_device::compute_tr() + + +static UINT32 compute_tr(hyperstone_state *cpustate) { - UINT64 cycles_since_base = total_cycles() - m_tr_base_cycles; - UINT64 clocks_since_base = cycles_since_base >> m_clock_scale; - return m_tr_base_value + (clocks_since_base / m_tr_clocks_per_tick); + UINT64 cycles_since_base = cpustate->device->total_cycles() - cpustate->tr_base_cycles; + UINT64 clocks_since_base = cycles_since_base >> cpustate->clock_scale; + return cpustate->tr_base_value + (clocks_since_base / cpustate->tr_clocks_per_tick); } -void hyperstone_device::update_timer_prescale() +static void update_timer_prescale(hyperstone_state *cpustate) { - UINT32 prevtr = compute_tr(); + UINT32 prevtr = compute_tr(cpustate); TPR &= ~0x80000000; - m_clock_scale = (TPR >> 26) & m_clock_scale_mask; - m_clock_cycles_1 = 1 << m_clock_scale; - m_clock_cycles_2 = 2 << m_clock_scale; - m_clock_cycles_4 = 4 << m_clock_scale; - m_clock_cycles_6 = 6 << m_clock_scale; - m_tr_clocks_per_tick = ((TPR >> 16) & 0xff) + 2; - m_tr_base_value = prevtr; - m_tr_base_cycles = total_cycles(); + cpustate->clock_scale = (TPR >> 26) & cpustate->clock_scale_mask; + cpustate->clock_cycles_1 = 1 << cpustate->clock_scale; + cpustate->clock_cycles_2 = 2 << cpustate->clock_scale; + cpustate->clock_cycles_4 = 4 << cpustate->clock_scale; + cpustate->clock_cycles_6 = 6 << cpustate->clock_scale; + cpustate->tr_clocks_per_tick = ((TPR >> 16) & 0xff) + 2; + cpustate->tr_base_value = prevtr; + cpustate->tr_base_cycles = cpustate->device->total_cycles(); } -void hyperstone_device::adjust_timer_interrupt() +static void adjust_timer_interrupt(hyperstone_state *cpustate) { - UINT64 cycles_since_base = total_cycles() - m_tr_base_cycles; - UINT64 clocks_since_base = cycles_since_base >> m_clock_scale; - UINT64 cycles_until_next_clock = cycles_since_base - (clocks_since_base << m_clock_scale); + UINT64 cycles_since_base = cpustate->device->total_cycles() - cpustate->tr_base_cycles; + UINT64 clocks_since_base = cycles_since_base >> cpustate->clock_scale; + UINT64 cycles_until_next_clock = cycles_since_base - (clocks_since_base << cpustate->clock_scale); if (cycles_until_next_clock == 0) - cycles_until_next_clock = (UINT64)(1 << m_clock_scale); + cycles_until_next_clock = (UINT64)(1 << cpustate->clock_scale); /* special case: if we have a change pending, set a timer to fire then */ if (TPR & 0x80000000) { - UINT64 clocks_until_int = m_tr_clocks_per_tick - (clocks_since_base % m_tr_clocks_per_tick); - UINT64 cycles_until_int = (clocks_until_int << m_clock_scale) + cycles_until_next_clock; - m_timer->adjust(cycles_to_attotime(cycles_until_int + 1), 1); + UINT64 clocks_until_int = cpustate->tr_clocks_per_tick - (clocks_since_base % cpustate->tr_clocks_per_tick); + UINT64 cycles_until_int = (clocks_until_int << cpustate->clock_scale) + cycles_until_next_clock; + cpustate->timer->adjust(cpustate->device->cycles_to_attotime(cycles_until_int + 1), 1); } /* else if the timer interrupt is enabled, configure it to fire at the appropriate time */ else if (!(FCR & 0x00800000)) { - UINT32 curtr = m_tr_base_value + (clocks_since_base / m_tr_clocks_per_tick); + UINT32 curtr = cpustate->tr_base_value + (clocks_since_base / cpustate->tr_clocks_per_tick); UINT32 delta = TCR - curtr; if (delta > 0x80000000) { - if (!m_timer_int_pending) - m_timer->adjust(attotime::zero); + if (!cpustate->timer_int_pending) + cpustate->timer->adjust(attotime::zero); } else { - UINT64 clocks_until_int = mulu_32x32(delta, m_tr_clocks_per_tick); - UINT64 cycles_until_int = (clocks_until_int << m_clock_scale) + cycles_until_next_clock; - m_timer->adjust(cycles_to_attotime(cycles_until_int)); + UINT64 clocks_until_int = mulu_32x32(delta, cpustate->tr_clocks_per_tick); + UINT64 cycles_until_int = (clocks_until_int << cpustate->clock_scale) + cycles_until_next_clock; + cpustate->timer->adjust(cpustate->device->cycles_to_attotime(cycles_until_int)); } } /* otherwise, disable the timer */ else - m_timer->adjust(attotime::never); + cpustate->timer->adjust(attotime::never); } -TIMER_CALLBACK_MEMBER( hyperstone_device::timer_callback ) +static TIMER_CALLBACK( e132xs_timer_callback ) { + legacy_cpu_device *device = (legacy_cpu_device *)ptr; + hyperstone_state *cpustate = get_safe_token(device); int update = param; /* update the values if necessary */ if (update) - update_timer_prescale(); + update_timer_prescale(cpustate); /* see if the timer is right for firing */ - if (!((compute_tr() - TCR) & 0x80000000)) - m_timer_int_pending = 1; + if (!((compute_tr(cpustate) - TCR) & 0x80000000)) + cpustate->timer_int_pending = 1; /* adjust ourselves for the next time */ else - adjust_timer_interrupt(); + adjust_timer_interrupt(cpustate); } -UINT32 hyperstone_device::get_global_register(UINT8 code) +static UINT32 get_global_register(hyperstone_state *cpustate, UINT8 code) { /* if( code >= 16 ) @@ -698,21 +693,14 @@ UINT32 hyperstone_device::get_global_register(UINT8 code) if (code == TR_REGISTER) { /* it is common to poll this in a loop */ - if (m_icount > m_tr_clocks_per_tick / 2) - m_icount -= m_tr_clocks_per_tick / 2; - return compute_tr(); + if (cpustate->icount > cpustate->tr_clocks_per_tick / 2) + cpustate->icount -= cpustate->tr_clocks_per_tick / 2; + return compute_tr(cpustate); } - return m_global_regs[code]; + return cpustate->global_regs[code]; } -void hyperstone_device::set_local_register(UINT8 code, UINT32 val) -{ - UINT8 new_code = (code + GET_FP) % 64; - - m_local_regs[new_code] = val; -} - -void hyperstone_device::set_global_register(UINT8 code, UINT32 val) +INLINE void set_global_register(hyperstone_state *cpustate, UINT8 code, UINT32 val) { //TODO: add correct FER set instruction @@ -724,14 +712,14 @@ void hyperstone_device::set_global_register(UINT8 code, UINT32 val) { SET_LOW_SR(val); // only a RET instruction can change the full content of SR SR &= ~0x40; //reserved bit 6 always zero - if (m_intblock < 1) - m_intblock = 1; + if (cpustate->intblock < 1) + cpustate->intblock = 1; } else { - UINT32 oldval = m_global_regs[code]; + UINT32 oldval = cpustate->global_regs[code]; if( code != ISR_REGISTER ) - m_global_regs[code] = val; + cpustate->global_regs[code] = val; else DEBUG_PRINTF(("Written to ISR register. PC = %08X\n", PC)); @@ -777,47 +765,54 @@ void hyperstone_device::set_global_register(UINT8 code, UINT32 val) break; */ case TR_REGISTER: - m_tr_base_value = val; - m_tr_base_cycles = total_cycles(); - adjust_timer_interrupt(); + cpustate->tr_base_value = val; + cpustate->tr_base_cycles = cpustate->device->total_cycles(); + adjust_timer_interrupt(cpustate); break; case TPR_REGISTER: if (!(val & 0x80000000)) /* change immediately */ - update_timer_prescale(); - adjust_timer_interrupt(); + update_timer_prescale(cpustate); + adjust_timer_interrupt(cpustate); break; case TCR_REGISTER: if (oldval != val) { - adjust_timer_interrupt(); - if (m_intblock < 1) - m_intblock = 1; + adjust_timer_interrupt(cpustate); + if (cpustate->intblock < 1) + cpustate->intblock = 1; } break; case FCR_REGISTER: if ((oldval ^ val) & 0x00800000) - adjust_timer_interrupt(); - if (m_intblock < 1) - m_intblock = 1; + adjust_timer_interrupt(cpustate); + if (cpustate->intblock < 1) + cpustate->intblock = 1; break; case MCR_REGISTER: // bits 14..12 EntryTableMap - hyperstone_set_trap_entry((val & 0x7000) >> 12); + hyperstone_set_trap_entry(cpustate, (val & 0x7000) >> 12); break; } } } } -#define GET_ABS_L_REG(code) m_local_regs[code] -#define SET_L_REG(code, val) set_local_register(code, val) -#define SET_ABS_L_REG(code, val) m_local_regs[code] = val -#define GET_G_REG(code) get_global_register(code) -#define SET_G_REG(code, val) set_global_register(code, val) +INLINE void set_local_register(hyperstone_state *cpustate, UINT8 code, UINT32 val) +{ + UINT8 new_code = (code + GET_FP) % 64; + + cpustate->local_regs[new_code] = val; +} + +#define GET_ABS_L_REG(code) cpustate->local_regs[code] +#define SET_L_REG(code, val) set_local_register(cpustate, code, val) +#define SET_ABS_L_REG(code, val) cpustate->local_regs[code] = val +#define GET_G_REG(code) get_global_register(cpustate, code) +#define SET_G_REG(code, val) set_global_register(cpustate, code, val) #define S_BIT ((OP & 0x100) >> 8) #define N_BIT S_BIT @@ -847,9 +842,9 @@ do \ UINT8 code = (decode)->src; \ (decode)->src_is_local = 1; \ code = ((decode)->src + GET_FP) % 64; /* registers offset by frame pointer */\ - SREG = m_local_regs[code]; \ + SREG = cpustate->local_regs[code]; \ code = ((decode)->src + 1 + GET_FP) % 64; \ - SREGF = m_local_regs[code]; \ + SREGF = cpustate->local_regs[code]; \ } \ else \ { \ @@ -857,17 +852,17 @@ do \ \ if (!hflag) \ { \ - SREG = get_global_register((decode)->src); \ + SREG = get_global_register(cpustate, (decode)->src); \ \ /* bound safe */ \ if ((decode)->src != 15) \ - SREGF = get_global_register((decode)->src + 1); \ + SREGF = get_global_register(cpustate, (decode)->src + 1); \ } \ else \ { \ (decode)->src += 16; \ \ - SREG = get_global_register((decode)->src); \ + SREG = get_global_register(cpustate, (decode)->src); \ if ((WRITE_ONLY_REGMASK >> (decode)->src) & 1) \ SREG = 0; /* write-only registers */ \ else if ((decode)->src == ISR_REGISTER) \ @@ -875,7 +870,7 @@ do \ \ /* bound safe */ \ if ((decode)->src != 31) \ - SREGF = get_global_register((decode)->src + 1); \ + SREGF = get_global_register(cpustate, (decode)->src + 1); \ } \ } \ } while (0) @@ -888,9 +883,9 @@ do \ UINT8 code = (decode)->dst; \ (decode)->dst_is_local = 1; \ code = ((decode)->dst + GET_FP) % 64; /* registers offset by frame pointer */\ - DREG = m_local_regs[code]; \ + DREG = cpustate->local_regs[code]; \ code = ((decode)->dst + 1 + GET_FP) % 64; \ - DREGF = m_local_regs[code]; \ + DREGF = cpustate->local_regs[code]; \ } \ else \ { \ @@ -898,23 +893,23 @@ do \ \ if (!hflag) \ { \ - DREG = get_global_register((decode)->dst); \ + DREG = get_global_register(cpustate, (decode)->dst); \ \ /* bound safe */ \ if ((decode)->dst != 15) \ - DREGF = get_global_register((decode)->dst + 1); \ + DREGF = get_global_register(cpustate, (decode)->dst + 1); \ } \ else \ { \ (decode)->dst += 16; \ \ - DREG = get_global_register((decode)->dst); \ + DREG = get_global_register(cpustate, (decode)->dst); \ if( (decode)->dst == ISR_REGISTER ) \ DEBUG_PRINTF(("read dst ISR. PC = %08X\n",PPC)); \ \ /* bound safe */ \ if ((decode)->dst != 31) \ - DREGF = get_global_register((decode)->dst + 1); \ + DREGF = get_global_register(cpustate, (decode)->dst + 1); \ } \ } \ } while (0) @@ -979,10 +974,10 @@ do \ do \ { \ /* if PC is used in a delay instruction, the delayed PC should be used */ \ - if( m_delay.delay_cmd == DELAY_EXECUTE ) \ + if( cpustate->delay.delay_cmd == DELAY_EXECUTE ) \ { \ - PC = m_delay.delay_pc; \ - m_delay.delay_cmd = NO_DELAY; \ + PC = cpustate->delay.delay_pc; \ + cpustate->delay.delay_cmd = NO_DELAY; \ } \ } while (0) @@ -999,20 +994,20 @@ do \ break; \ \ case 1: \ - m_instruction_length = 3; \ - EXTRA_U = (READ_OP(PC) << 16) | READ_OP(PC + 2); \ + cpustate->instruction_length = 3; \ + EXTRA_U = (READ_OP(cpustate, PC) << 16) | READ_OP(cpustate, PC + 2);\ PC += 4; \ break; \ \ case 2: \ - m_instruction_length = 2; \ - EXTRA_U = READ_OP(PC); \ + cpustate->instruction_length = 2; \ + EXTRA_U = READ_OP(cpustate, PC); \ PC += 2; \ break; \ \ case 3: \ - m_instruction_length = 2; \ - EXTRA_U = 0xffff0000 | READ_OP(PC); \ + cpustate->instruction_length = 2; \ + EXTRA_U = 0xffff0000 | READ_OP(cpustate, PC); \ PC += 2; \ break; \ } \ @@ -1021,17 +1016,17 @@ do \ #define decode_const(decode) \ do \ { \ - UINT16 imm_1 = READ_OP(PC); \ + UINT16 imm_1 = READ_OP(cpustate, PC); \ \ PC += 2; \ - m_instruction_length = 2; \ + cpustate->instruction_length = 2; \ \ if( E_BIT(imm_1) ) \ { \ - UINT16 imm_2 = READ_OP(PC); \ + UINT16 imm_2 = READ_OP(cpustate, PC); \ \ PC += 2; \ - m_instruction_length = 3; \ + cpustate->instruction_length = 3; \ \ EXTRA_S = imm_2; \ EXTRA_S |= ((imm_1 & 0x3fff) << 16); \ @@ -1057,10 +1052,10 @@ do \ { \ if( OP & 0x80 ) \ { \ - UINT16 next = READ_OP(PC); \ + UINT16 next = READ_OP(cpustate, PC); \ \ PC += 2; \ - m_instruction_length = 2; \ + cpustate->instruction_length = 2; \ \ EXTRA_S = (OP & 0x7f) << 16; \ EXTRA_S |= (next & 0xfffe); \ @@ -1080,19 +1075,19 @@ do \ #define decode_dis(decode) \ do \ { \ - UINT16 next_1 = READ_OP(PC); \ + UINT16 next_1 = READ_OP(cpustate, PC); \ \ PC += 2; \ - m_instruction_length = 2; \ + cpustate->instruction_length = 2; \ \ (decode)->sub_type = DD(next_1); \ \ if( E_BIT(next_1) ) \ { \ - UINT16 next_2 = READ_OP(PC); \ + UINT16 next_2 = READ_OP(cpustate, PC); \ \ PC += 2; \ - m_instruction_length = 3; \ + cpustate->instruction_length = 3; \ \ EXTRA_S = next_2; \ EXTRA_S |= ((next_1 & 0xfff) << 16); \ @@ -1116,17 +1111,17 @@ do \ #define decode_lim(decode) \ do \ { \ - UINT32 next = READ_OP(PC); \ + UINT32 next = READ_OP(cpustate, PC); \ PC += 2; \ - m_instruction_length = 2; \ + cpustate->instruction_length = 2; \ \ (decode)->sub_type = X_CODE(next); \ \ if( E_BIT(next) ) \ { \ - EXTRA_U = ((next & 0xfff) << 16) | READ_OP(PC); \ + EXTRA_U = ((next & 0xfff) << 16) | READ_OP(cpustate, PC); \ PC += 2; \ - m_instruction_length = 3; \ + cpustate->instruction_length = 3; \ } \ else \ { \ @@ -1223,8 +1218,8 @@ do \ #define LLextdecode(decode) \ do \ { \ - m_instruction_length = 2; \ - EXTRA_U = READ_OP(PC); \ + cpustate->instruction_length = 2; \ + EXTRA_U = READ_OP(cpustate, PC); \ PC += 2; \ check_delay_PC(); \ decode_LL(decode); \ @@ -1264,31 +1259,31 @@ do \ } while (0) -void hyperstone_device::execute_br(struct hyperstone_device::regs_decode *decode) +INLINE void execute_br(hyperstone_state *cpustate, struct regs_decode *decode) { PPC = PC; PC += EXTRA_S; SET_M(0); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::execute_dbr(struct hyperstone_device::regs_decode *decode) +INLINE void execute_dbr(hyperstone_state *cpustate, struct regs_decode *decode) { - m_delay.delay_cmd = DELAY_EXECUTE; - m_delay.delay_pc = PC + EXTRA_S; + cpustate->delay.delay_cmd = DELAY_EXECUTE; + cpustate->delay.delay_pc = PC + EXTRA_S; - m_intblock = 3; + cpustate->intblock = 3; } -void hyperstone_device::execute_trap(UINT32 addr) +static void execute_trap(hyperstone_state *cpustate, UINT32 addr) { UINT8 reg; UINT32 oldSR; reg = GET_FP + GET_FL; - SET_ILC(m_instruction_length & 3); + SET_ILC(cpustate->instruction_length & 3); oldSR = SR; @@ -1306,17 +1301,17 @@ void hyperstone_device::execute_trap(UINT32 addr) PPC = PC; PC = addr; - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::execute_int(UINT32 addr) +static void execute_int(hyperstone_state *cpustate, UINT32 addr) { UINT8 reg; UINT32 oldSR; reg = GET_FP + GET_FL; - SET_ILC(m_instruction_length & 3); + SET_ILC(cpustate->instruction_length & 3); oldSR = SR; @@ -1335,17 +1330,17 @@ void hyperstone_device::execute_int(UINT32 addr) PPC = PC; PC = addr; - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } /* TODO: mask Parity Error and Extended Overflow exceptions */ -void hyperstone_device::execute_exception(UINT32 addr) +static void execute_exception(hyperstone_state *cpustate, UINT32 addr) { UINT8 reg; UINT32 oldSR; reg = GET_FP + GET_FL; - SET_ILC(m_instruction_length & 3); + SET_ILC(cpustate->instruction_length & 3); oldSR = SR; @@ -1364,10 +1359,10 @@ void hyperstone_device::execute_exception(UINT32 addr) PC = addr; DEBUG_PRINTF(("EXCEPTION! PPC = %08X PC = %08X\n",PPC-2,PC-2)); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::execute_software(struct hyperstone_device::regs_decode *decode) +static void execute_software(hyperstone_state *cpustate, struct regs_decode *decode) { UINT8 reg; UINT32 oldSR; @@ -1376,7 +1371,7 @@ void hyperstone_device::execute_software(struct hyperstone_device::regs_decode * SET_ILC(1); - addr = get_emu_code_addr((OP & 0xff00) >> 8); + addr = get_emu_code_addr(cpustate, (OP & 0xff00) >> 8); reg = GET_FP + GET_FL; //since it's sure the register is in the register part of the stack, @@ -1424,352 +1419,252 @@ void hyperstone_device::execute_software(struct hyperstone_device::regs_decode * #define IO2_LINE_STATE ((ISR >> 5) & 1) #define IO3_LINE_STATE ((ISR >> 6) & 1) -void hyperstone_device::check_interrupts() +static void check_interrupts(hyperstone_state *cpustate) { /* Interrupt-Lock flag isn't set */ - if (GET_L || m_intblock > 0) + if (GET_L || cpustate->intblock > 0) return; /* quick exit if nothing */ - if (!m_timer_int_pending && (ISR & 0x7f) == 0) + if (!cpustate->timer_int_pending && (ISR & 0x7f) == 0) return; /* IO3 is priority 5; state is in bit 6 of ISR; FCR bit 10 enables input and FCR bit 8 inhibits interrupt */ if (IO3_LINE_STATE && (FCR & 0x00000500) == 0x00000400) { - execute_int(get_trap_addr(TRAPNO_IO3)); - standard_irq_callback(IRQ_IO3); + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_IO3)); + (*cpustate->irq_callback)(cpustate->device, IRQ_IO3); return; } /* timer int might be priority 6 if FCR bits 20-21 == 3; FCR bit 23 inhibits interrupt */ - if (m_timer_int_pending && (FCR & 0x00b00000) == 0x00300000) + if (cpustate->timer_int_pending && (FCR & 0x00b00000) == 0x00300000) { - m_timer_int_pending = 0; - execute_int(get_trap_addr(TRAPNO_TIMER)); + cpustate->timer_int_pending = 0; + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_TIMER)); return; } /* INT1 is priority 7; state is in bit 0 of ISR; FCR bit 28 inhibits interrupt */ if (INT1_LINE_STATE && (FCR & 0x10000000) == 0x00000000) { - execute_int(get_trap_addr(TRAPNO_INT1)); - standard_irq_callback(IRQ_INT1); + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_INT1)); + (*cpustate->irq_callback)(cpustate->device, IRQ_INT1); return; } /* timer int might be priority 8 if FCR bits 20-21 == 2; FCR bit 23 inhibits interrupt */ - if (m_timer_int_pending && (FCR & 0x00b00000) == 0x00200000) + if (cpustate->timer_int_pending && (FCR & 0x00b00000) == 0x00200000) { - m_timer_int_pending = 0; - execute_int(get_trap_addr(TRAPNO_TIMER)); + cpustate->timer_int_pending = 0; + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_TIMER)); return; } /* INT2 is priority 9; state is in bit 1 of ISR; FCR bit 29 inhibits interrupt */ if (INT2_LINE_STATE && (FCR & 0x20000000) == 0x00000000) { - execute_int(get_trap_addr(TRAPNO_INT2)); - standard_irq_callback(IRQ_INT2); + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_INT2)); + (*cpustate->irq_callback)(cpustate->device, IRQ_INT2); return; } /* timer int might be priority 10 if FCR bits 20-21 == 1; FCR bit 23 inhibits interrupt */ - if (m_timer_int_pending && (FCR & 0x00b00000) == 0x00100000) + if (cpustate->timer_int_pending && (FCR & 0x00b00000) == 0x00100000) { - m_timer_int_pending = 0; - execute_int(get_trap_addr(TRAPNO_TIMER)); + cpustate->timer_int_pending = 0; + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_TIMER)); return; } /* INT3 is priority 11; state is in bit 2 of ISR; FCR bit 30 inhibits interrupt */ if (INT3_LINE_STATE && (FCR & 0x40000000) == 0x00000000) { - execute_int(get_trap_addr(TRAPNO_INT3)); - standard_irq_callback(IRQ_INT3); + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_INT3)); + (*cpustate->irq_callback)(cpustate->device, IRQ_INT3); return; } /* timer int might be priority 12 if FCR bits 20-21 == 0; FCR bit 23 inhibits interrupt */ - if (m_timer_int_pending && (FCR & 0x00b00000) == 0x00000000) + if (cpustate->timer_int_pending && (FCR & 0x00b00000) == 0x00000000) { - m_timer_int_pending = 0; - execute_int(get_trap_addr(TRAPNO_TIMER)); + cpustate->timer_int_pending = 0; + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_TIMER)); return; } /* INT4 is priority 13; state is in bit 3 of ISR; FCR bit 31 inhibits interrupt */ if (INT4_LINE_STATE && (FCR & 0x80000000) == 0x00000000) { - execute_int(get_trap_addr(TRAPNO_INT4)); - standard_irq_callback(IRQ_INT4); + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_INT4)); + (*cpustate->irq_callback)(cpustate->device, IRQ_INT4); return; } /* IO1 is priority 14; state is in bit 4 of ISR; FCR bit 2 enables input and FCR bit 0 inhibits interrupt */ if (IO1_LINE_STATE && (FCR & 0x00000005) == 0x00000004) { - execute_int(get_trap_addr(TRAPNO_IO1)); - standard_irq_callback(IRQ_IO1); + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_IO1)); + (*cpustate->irq_callback)(cpustate->device, IRQ_IO1); return; } /* IO2 is priority 15; state is in bit 5 of ISR; FCR bit 6 enables input and FCR bit 4 inhibits interrupt */ if (IO2_LINE_STATE && (FCR & 0x00000050) == 0x00000040) { - execute_int(get_trap_addr(TRAPNO_IO2)); - standard_irq_callback(IRQ_IO2); + execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_IO2)); + (*cpustate->irq_callback)(cpustate->device, IRQ_IO2); return; } } -void hyperstone_device::device_start() -{ - // Handled entirely by init() and derived classes -} - -void hyperstone_device::init(int scale_mask) -{ - m_program = &space(AS_PROGRAM); - m_direct = &m_program->direct(); - m_io = &space(AS_IO); - - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hyperstone_device::timer_callback), this)); - m_clock_scale_mask = scale_mask; - - // register our state for the debugger - astring tempstr; - state_add(STATE_GENPC, "GENPC", m_global_regs[0]).noshow(); - state_add(STATE_GENFLAGS, "GENFLAGS", m_global_regs[1]).callimport().callexport().formatstr("%40s").noshow(); - state_add(E132XS_PC, "PC :%08X", m_global_regs[0]).mask(0xffffffff); - state_add(E132XS_SR, "SR :%08X", m_global_regs[1]).mask(0xffffffff); - state_add(E132XS_FER, "FER :%08X", m_global_regs[2]).mask(0xffffffff); - state_add(E132XS_G3, "G3 :%08X", m_global_regs[3]).mask(0xffffffff); - state_add(E132XS_G4, "G4 :%08X", m_global_regs[4]).mask(0xffffffff); - state_add(E132XS_G5, "G5 :%08X", m_global_regs[5]).mask(0xffffffff); - state_add(E132XS_G6, "G6 :%08X", m_global_regs[6]).mask(0xffffffff); - state_add(E132XS_G7, "G7 :%08X", m_global_regs[7]).mask(0xffffffff); - state_add(E132XS_G8, "G8 :%08X", m_global_regs[8]).mask(0xffffffff); - state_add(E132XS_G9, "G9 :%08X", m_global_regs[9]).mask(0xffffffff); - state_add(E132XS_G10, "G10 :%08X", m_global_regs[10]).mask(0xffffffff); - state_add(E132XS_G11, "G11 :%08X", m_global_regs[11]).mask(0xffffffff); - state_add(E132XS_G12, "G12 :%08X", m_global_regs[12]).mask(0xffffffff); - state_add(E132XS_G13, "G13 :%08X", m_global_regs[13]).mask(0xffffffff); - state_add(E132XS_G14, "G14 :%08X", m_global_regs[14]).mask(0xffffffff); - state_add(E132XS_G15, "G15 :%08X", m_global_regs[15]).mask(0xffffffff); - state_add(E132XS_G16, "G16 :%08X", m_global_regs[16]).mask(0xffffffff); - state_add(E132XS_G17, "G17 :%08X", m_global_regs[17]).mask(0xffffffff); - state_add(E132XS_SP, "SP :%08X", m_global_regs[18]).mask(0xffffffff); - state_add(E132XS_UB, "UB :%08X", m_global_regs[19]).mask(0xffffffff); - state_add(E132XS_BCR, "BCR :%08X", m_global_regs[20]).mask(0xffffffff); - state_add(E132XS_TPR, "TPR :%08X", m_global_regs[21]).mask(0xffffffff); - state_add(E132XS_TCR, "TCR :%08X", m_global_regs[22]).mask(0xffffffff); - state_add(E132XS_TR, "TR :%08X", m_global_regs[23]).mask(0xffffffff); - state_add(E132XS_WCR, "WCR :%08X", m_global_regs[24]).mask(0xffffffff); - state_add(E132XS_ISR, "ISR :%08X", m_global_regs[25]).mask(0xffffffff); - state_add(E132XS_FCR, "FCR :%08X", m_global_regs[26]).mask(0xffffffff); - state_add(E132XS_MCR, "MCR :%08X", m_global_regs[27]).mask(0xffffffff); - state_add(E132XS_G28, "G28 :%08X", m_global_regs[28]).mask(0xffffffff); - state_add(E132XS_G29, "G29 :%08X", m_global_regs[29]).mask(0xffffffff); - state_add(E132XS_G30, "G30 :%08X", m_global_regs[30]).mask(0xffffffff); - state_add(E132XS_G31, "G31 :%08X", m_global_regs[31]).mask(0xffffffff); - state_add(E132XS_CL0, "CL0 :%08X", m_local_regs[(0 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL1, "CL1 :%08X", m_local_regs[(1 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL2, "CL2 :%08X", m_local_regs[(2 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL3, "CL3 :%08X", m_local_regs[(3 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL4, "CL4 :%08X", m_local_regs[(4 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL5, "CL5 :%08X", m_local_regs[(5 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL6, "CL6 :%08X", m_local_regs[(6 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL7, "CL7 :%08X", m_local_regs[(7 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL8, "CL8 :%08X", m_local_regs[(8 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL9, "CL9 :%08X", m_local_regs[(9 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL10, "CL10:%08X", m_local_regs[(10 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL11, "CL11:%08X", m_local_regs[(11 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL12, "CL12:%08X", m_local_regs[(12 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL13, "CL13:%08X", m_local_regs[(13 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL14, "CL14:%08X", m_local_regs[(14 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_CL15, "CL15:%08X", m_local_regs[(15 + GET_FP) % 64]).mask(0xffffffff); - state_add(E132XS_L0, "L0 :%08X", m_local_regs[0]).mask(0xffffffff); - state_add(E132XS_L1, "L1 :%08X", m_local_regs[1]).mask(0xffffffff); - state_add(E132XS_L2, "L2 :%08X", m_local_regs[2]).mask(0xffffffff); - state_add(E132XS_L3, "L3 :%08X", m_local_regs[3]).mask(0xffffffff); - state_add(E132XS_L4, "L4 :%08X", m_local_regs[4]).mask(0xffffffff); - state_add(E132XS_L5, "L5 :%08X", m_local_regs[5]).mask(0xffffffff); - state_add(E132XS_L6, "L6 :%08X", m_local_regs[6]).mask(0xffffffff); - state_add(E132XS_L7, "L7 :%08X", m_local_regs[7]).mask(0xffffffff); - state_add(E132XS_L8, "L8 :%08X", m_local_regs[8]).mask(0xffffffff); - state_add(E132XS_L9, "L9 :%08X", m_local_regs[9]).mask(0xffffffff); - state_add(E132XS_L10, "L10 :%08X", m_local_regs[10]).mask(0xffffffff); - state_add(E132XS_L11, "L11 :%08X", m_local_regs[11]).mask(0xffffffff); - state_add(E132XS_L12, "L12 :%08X", m_local_regs[12]).mask(0xffffffff); - state_add(E132XS_L13, "L13 :%08X", m_local_regs[13]).mask(0xffffffff); - state_add(E132XS_L14, "L14 :%08X", m_local_regs[14]).mask(0xffffffff); - state_add(E132XS_L15, "L15 :%08X", m_local_regs[15]).mask(0xffffffff); - state_add(E132XS_L16, "L16 :%08X", m_local_regs[16]).mask(0xffffffff); - state_add(E132XS_L17, "L17 :%08X", m_local_regs[17]).mask(0xffffffff); - state_add(E132XS_L18, "L18 :%08X", m_local_regs[18]).mask(0xffffffff); - state_add(E132XS_L19, "L19 :%08X", m_local_regs[19]).mask(0xffffffff); - state_add(E132XS_L20, "L20 :%08X", m_local_regs[20]).mask(0xffffffff); - state_add(E132XS_L21, "L21 :%08X", m_local_regs[21]).mask(0xffffffff); - state_add(E132XS_L22, "L22 :%08X", m_local_regs[22]).mask(0xffffffff); - state_add(E132XS_L23, "L23 :%08X", m_local_regs[23]).mask(0xffffffff); - state_add(E132XS_L24, "L24 :%08X", m_local_regs[24]).mask(0xffffffff); - state_add(E132XS_L25, "L25 :%08X", m_local_regs[25]).mask(0xffffffff); - state_add(E132XS_L26, "L26 :%08X", m_local_regs[26]).mask(0xffffffff); - state_add(E132XS_L27, "L27 :%08X", m_local_regs[27]).mask(0xffffffff); - state_add(E132XS_L28, "L28 :%08X", m_local_regs[28]).mask(0xffffffff); - state_add(E132XS_L29, "L29 :%08X", m_local_regs[29]).mask(0xffffffff); - state_add(E132XS_L30, "L30 :%08X", m_local_regs[30]).mask(0xffffffff); - state_add(E132XS_L31, "L31 :%08X", m_local_regs[31]).mask(0xffffffff); - state_add(E132XS_L32, "L32 :%08X", m_local_regs[32]).mask(0xffffffff); - state_add(E132XS_L33, "L33 :%08X", m_local_regs[33]).mask(0xffffffff); - state_add(E132XS_L34, "L34 :%08X", m_local_regs[34]).mask(0xffffffff); - state_add(E132XS_L35, "L35 :%08X", m_local_regs[35]).mask(0xffffffff); - state_add(E132XS_L36, "L36 :%08X", m_local_regs[36]).mask(0xffffffff); - state_add(E132XS_L37, "L37 :%08X", m_local_regs[37]).mask(0xffffffff); - state_add(E132XS_L38, "L38 :%08X", m_local_regs[38]).mask(0xffffffff); - state_add(E132XS_L39, "L39 :%08X", m_local_regs[39]).mask(0xffffffff); - state_add(E132XS_L40, "L40 :%08X", m_local_regs[40]).mask(0xffffffff); - state_add(E132XS_L41, "L41 :%08X", m_local_regs[41]).mask(0xffffffff); - state_add(E132XS_L42, "L42 :%08X", m_local_regs[42]).mask(0xffffffff); - state_add(E132XS_L43, "L43 :%08X", m_local_regs[43]).mask(0xffffffff); - state_add(E132XS_L44, "L44 :%08X", m_local_regs[44]).mask(0xffffffff); - state_add(E132XS_L45, "L45 :%08X", m_local_regs[45]).mask(0xffffffff); - state_add(E132XS_L46, "L46 :%08X", m_local_regs[46]).mask(0xffffffff); - state_add(E132XS_L47, "L47 :%08X", m_local_regs[47]).mask(0xffffffff); - state_add(E132XS_L48, "L48 :%08X", m_local_regs[48]).mask(0xffffffff); - state_add(E132XS_L49, "L49 :%08X", m_local_regs[49]).mask(0xffffffff); - state_add(E132XS_L50, "L50 :%08X", m_local_regs[50]).mask(0xffffffff); - state_add(E132XS_L51, "L51 :%08X", m_local_regs[51]).mask(0xffffffff); - state_add(E132XS_L52, "L52 :%08X", m_local_regs[52]).mask(0xffffffff); - state_add(E132XS_L53, "L53 :%08X", m_local_regs[53]).mask(0xffffffff); - state_add(E132XS_L54, "L54 :%08X", m_local_regs[54]).mask(0xffffffff); - state_add(E132XS_L55, "L55 :%08X", m_local_regs[55]).mask(0xffffffff); - state_add(E132XS_L56, "L56 :%08X", m_local_regs[56]).mask(0xffffffff); - state_add(E132XS_L57, "L57 :%08X", m_local_regs[57]).mask(0xffffffff); - state_add(E132XS_L58, "L58 :%08X", m_local_regs[58]).mask(0xffffffff); - state_add(E132XS_L59, "L59 :%08X", m_local_regs[59]).mask(0xffffffff); - state_add(E132XS_L60, "L60 :%08X", m_local_regs[60]).mask(0xffffffff); - state_add(E132XS_L61, "L61 :%08X", m_local_regs[61]).mask(0xffffffff); - state_add(E132XS_L62, "L62 :%08X", m_local_regs[62]).mask(0xffffffff); - state_add(E132XS_L63, "L63 :%08X", m_local_regs[63]).mask(0xffffffff); - - save_item(NAME(m_global_regs)); - save_item(NAME(m_local_regs)); - save_item(NAME(m_ppc)); - save_item(NAME(m_trap_entry)); - save_item(NAME(m_delay.delay_pc)); - save_item(NAME(m_instruction_length)); - save_item(NAME(m_intblock)); - save_item(NAME(m_delay.delay_cmd)); - save_item(NAME(m_tr_clocks_per_tick)); +static void set_irq_line(hyperstone_state *cpustate, int irqline, int state) +{ + if (state) + ISR |= 1 << irqline; + else + ISR &= ~(1 << irqline); +} + +static void hyperstone_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) +{ + hyperstone_state *cpustate = get_safe_token(device); + + device->save_item(NAME(cpustate->global_regs)); + device->save_item(NAME(cpustate->local_regs)); + device->save_item(NAME(cpustate->ppc)); + device->save_item(NAME(cpustate->trap_entry)); + device->save_item(NAME(cpustate->delay.delay_pc)); + device->save_item(NAME(cpustate->instruction_length)); + device->save_item(NAME(cpustate->intblock)); + device->save_item(NAME(cpustate->delay.delay_cmd)); + device->save_item(NAME(cpustate->tr_clocks_per_tick)); + + cpustate->irq_callback = irqcallback; + cpustate->device = device; + cpustate->program = &device->space(AS_PROGRAM); + cpustate->direct = &cpustate->program->direct(); + cpustate->io = &device->space(AS_IO); + cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(e132xs_timer_callback), (void *)device); + cpustate->clock_scale_mask = scale_mask; +} + +static void e116_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) +{ + hyperstone_state *cpustate = get_safe_token(device); + hyperstone_init(device, irqcallback, scale_mask); + cpustate->opcodexor = 0; +} - // set our instruction counter - m_icountptr = &m_icount; +static CPU_INIT( e116t ) +{ + e116_init(device, irqcallback, 0); } -void e116t_device::device_start() +static CPU_INIT( e116xt ) { - init(0); - m_opcodexor = 0; + e116_init(device, irqcallback, 3); } -void e116xt_device::device_start() +static CPU_INIT( e116xs ) { - init(3); - m_opcodexor = 0; + e116_init(device, irqcallback, 7); } -void e116xs_device::device_start() +static CPU_INIT( e116xsr ) { - init(7); - m_opcodexor = 0; + e116_init(device, irqcallback, 7); } -void e116xsr_device::device_start() +static CPU_INIT( gms30c2116 ) { - init(7); - m_opcodexor = 0; + e116_init(device, irqcallback, 0); } -void gms30c2116_device::device_start() +static CPU_INIT( gms30c2216 ) { - init(0); - m_opcodexor = 0; + e116_init(device, irqcallback, 0); } -void gms30c2216_device::device_start() +static void e132_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) { - init(0); - m_opcodexor = 0; + hyperstone_state *cpustate = get_safe_token(device); + hyperstone_init(device, irqcallback, scale_mask); + cpustate->opcodexor = WORD_XOR_BE(0); } -void e132n_device::device_start() +static CPU_INIT( e132n ) { - init(0); - m_opcodexor = WORD_XOR_BE(0); + e132_init(device, irqcallback, 0); } -void e132t_device::device_start() +static CPU_INIT( e132t ) { - init(0); - m_opcodexor = WORD_XOR_BE(0); + e132_init(device, irqcallback, 0); } -void e132xn_device::device_start() +static CPU_INIT( e132xn ) { - init(3); - m_opcodexor = WORD_XOR_BE(0); + e132_init(device, irqcallback, 3); } -void e132xt_device::device_start() +static CPU_INIT( e132xt ) { - init(3); - m_opcodexor = WORD_XOR_BE(0); + e132_init(device, irqcallback, 3); } -void e132xs_device::device_start() +static CPU_INIT( e132xs ) { - init(7); - m_opcodexor = WORD_XOR_BE(0); + e132_init(device, irqcallback, 7); } -void e132xsr_device::device_start() +static CPU_INIT( e132xsr ) { - init(7); - m_opcodexor = WORD_XOR_BE(0); + e132_init(device, irqcallback, 7); } -void gms30c2132_device::device_start() +static CPU_INIT( gms30c2132 ) { - init(0); - m_opcodexor = WORD_XOR_BE(0); + e132_init(device, irqcallback, 0); } -void gms30c2232_device::device_start() +static CPU_INIT( gms30c2232 ) { - init(0); - m_opcodexor = WORD_XOR_BE(0); + e132_init(device, irqcallback, 0); } -void hyperstone_device::device_reset() +static CPU_RESET( hyperstone ) { + hyperstone_state *cpustate = get_safe_token(device); + //TODO: Add different reset initializations for BCR, MCR, FCR, TPR - m_program = &space(AS_PROGRAM); - m_direct = &m_program->direct(); - m_io = &space(AS_IO); + emu_timer *save_timer; + device_irq_acknowledge_callback save_irqcallback; + UINT32 save_opcodexor; - m_tr_clocks_per_tick = 2; + save_timer = cpustate->timer; + save_irqcallback = cpustate->irq_callback; + save_opcodexor = cpustate->opcodexor; + memset(cpustate, 0, sizeof(*cpustate)); + cpustate->irq_callback = save_irqcallback; + cpustate->opcodexor = save_opcodexor; + cpustate->device = device; + cpustate->program = &device->space(AS_PROGRAM); + cpustate->direct = &cpustate->program->direct(); + cpustate->io = &device->space(AS_IO); + cpustate->timer = save_timer; - hyperstone_set_trap_entry(E132XS_ENTRY_MEM3); /* default entry point @ MEM3 */ + cpustate->tr_clocks_per_tick = 2; - set_global_register(BCR_REGISTER, ~0); - set_global_register(MCR_REGISTER, ~0); - set_global_register(FCR_REGISTER, ~0); - set_global_register(TPR_REGISTER, 0xc000000); + hyperstone_set_trap_entry(cpustate, E132XS_ENTRY_MEM3); /* default entry point @ MEM3 */ - PC = get_trap_addr(TRAPNO_RESET); + set_global_register(cpustate, BCR_REGISTER, ~0); + set_global_register(cpustate, MCR_REGISTER, ~0); + set_global_register(cpustate, FCR_REGISTER, ~0); + set_global_register(cpustate, TPR_REGISTER, 0xc000000); + + PC = get_trap_addr(cpustate, TRAPNO_RESET); SET_FP(0); SET_FL(2); @@ -1782,130 +1677,49 @@ void hyperstone_device::device_reset() SET_L_REG(0, (PC & 0xfffffffe) | GET_S); SET_L_REG(1, SR); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::device_stop() +static CPU_EXIT( hyperstone ) { // nothing to do } - -//------------------------------------------------- -// memory_space_config - return the configuration -// of the specified address space, or NULL if -// the space doesn't exist -//------------------------------------------------- - -const address_space_config *hyperstone_device::memory_space_config(address_spacenum spacenum) const -{ - if (spacenum == AS_PROGRAM) - { - return &m_program_config; - } - else if (spacenum == AS_IO) - { - return &m_io_config; - } - return NULL; -} - - -//------------------------------------------------- -// state_string_export - export state as a string -// for the debugger -//------------------------------------------------- - -void hyperstone_device::state_string_export(const device_state_entry &entry, astring &string) -{ - switch (entry.index()) - { - case STATE_GENFLAGS: - string.printf("%c%c%c%c%c%c%c%c%c%c%c%c FTE:%X FRM:%X ILC:%d FL:%d FP:%d", - GET_S ? 'S':'.', - GET_P ? 'P':'.', - GET_T ? 'T':'.', - GET_L ? 'L':'.', - GET_I ? 'I':'.', - m_global_regs[1] & 0x00040 ? '?':'.', - GET_H ? 'H':'.', - GET_M ? 'M':'.', - GET_V ? 'V':'.', - GET_N ? 'N':'.', - GET_Z ? 'Z':'.', - GET_C ? 'C':'.', - GET_FTE, - GET_FRM, - GET_ILC, - GET_FL, - GET_FP); - break; - } -} - - -//------------------------------------------------- -// disasm_min_opcode_bytes - return the length -// of the shortest instruction, in bytes -//------------------------------------------------- - -UINT32 hyperstone_device::disasm_min_opcode_bytes() const -{ - return 2; -} - - -//------------------------------------------------- -// disasm_max_opcode_bytes - return the length -// of the longest instruction, in bytes -//------------------------------------------------- - -UINT32 hyperstone_device::disasm_max_opcode_bytes() const +static CPU_DISASSEMBLE( hyperstone ) { - return 6; -} - - -//------------------------------------------------- -// disasm_disassemble - call the disassembly -// helper function -//------------------------------------------------- - -offs_t hyperstone_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) -{ - extern CPU_DISASSEMBLE( hyperstone ); + hyperstone_state *cpustate = get_safe_token(device); return dasm_hyperstone( buffer, pc, oprom, GET_H, GET_FP ); } /* Opcodes */ -void hyperstone_device::hyperstone_chk(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_chk(hyperstone_state *cpustate, struct regs_decode *decode) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); if( SRC_IS_SR ) { if( DREG == 0 ) - execute_exception(addr); + execute_exception(cpustate, addr); } else { if( SRC_IS_PC ) { if( DREG >= SREG ) - execute_exception(addr); + execute_exception(cpustate, addr); } else { if( DREG > SREG ) - execute_exception(addr); + execute_exception(cpustate, addr); } } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_movd(hyperstone_state *cpustate, struct regs_decode *decode) { if( DST_IS_PC ) // Rd denotes PC { @@ -1926,15 +1740,15 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d SET_PC(SREG); SR = (SREGF & 0xffe00000) | ((SREG & 0x01) << 18 ) | (SREGF & 0x3ffff); - if (m_intblock < 1) - m_intblock = 1; + if (cpustate->intblock < 1) + cpustate->intblock = 1; - m_instruction_length = 0; // undefined + cpustate->instruction_length = 0; // undefined if( (!old_s && GET_S) || (!GET_S && !old_l && GET_L)) { - UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_PRIVILEGE_ERROR); + execute_exception(cpustate, addr); } difference = GET_FP - ((SP & 0x1fc) >> 2); @@ -1950,7 +1764,7 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d do { SP -= 4; - SET_ABS_L_REG(((SP & 0xfc) >> 2), READ_W(SP)); + SET_ABS_L_REG(((SP & 0xfc) >> 2), READ_W(cpustate, SP)); difference++; } while(difference != 0); @@ -1958,7 +1772,7 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d } //TODO: no 1! - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } else if( SRC_IS_SR ) // Rd doesn't denote PC and Rs denotes SR { @@ -1967,7 +1781,7 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d SET_Z(1); SET_N(0); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } else // Rd doesn't denote PC and Rs doesn't denote SR { @@ -1980,11 +1794,11 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d SET_Z( tmp == 0 ? 1 : 0 ); SET_N( SIGN_BIT(SREG) ); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } } -void hyperstone_device::hyperstone_divu(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_divu(hyperstone_state *cpustate, struct regs_decode *decode) { if( SAME_SRC_DST || SAME_SRC_DSTF ) { @@ -2009,8 +1823,8 @@ void hyperstone_device::hyperstone_divu(struct hyperstone_device::regs_decode *d //N -> undefined UINT32 addr; SET_V(1); - addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } else { @@ -2030,10 +1844,10 @@ void hyperstone_device::hyperstone_divu(struct hyperstone_device::regs_decode *d } } - m_icount -= 36 << m_clock_scale; + cpustate->icount -= 36 << cpustate->clock_scale; } -void hyperstone_device::hyperstone_divs(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_divs(hyperstone_state *cpustate, struct regs_decode *decode) { if( SAME_SRC_DST || SAME_SRC_DSTF ) { @@ -2058,8 +1872,8 @@ void hyperstone_device::hyperstone_divs(struct hyperstone_device::regs_decode *d //N -> undefined UINT32 addr; SET_V(1); - addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } else { @@ -2079,10 +1893,10 @@ void hyperstone_device::hyperstone_divs(struct hyperstone_device::regs_decode *d } } - m_icount -= 36 << m_clock_scale; + cpustate->icount -= 36 << cpustate->clock_scale; } -void hyperstone_device::hyperstone_xm(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_xm(hyperstone_state *cpustate, struct regs_decode *decode) { if( SRC_IS_SR || DST_IS_SR || DST_IS_PC ) { @@ -2098,13 +1912,13 @@ void hyperstone_device::hyperstone_xm(struct hyperstone_device::regs_decode *dec case 3: if( !SRC_IS_PC && (SREG > EXTRA_U) ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } else if( SRC_IS_PC && (SREG >= EXTRA_U) ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } else { @@ -2126,20 +1940,20 @@ void hyperstone_device::hyperstone_xm(struct hyperstone_device::regs_decode *dec SET_DREG(SREG); } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_mask(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_mask(hyperstone_state *cpustate, struct regs_decode *decode) { DREG = SREG & EXTRA_U; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_sum(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_sum(hyperstone_state *cpustate, struct regs_decode *decode) { UINT64 tmp; @@ -2160,10 +1974,10 @@ void hyperstone_device::hyperstone_sum(struct hyperstone_device::regs_decode *de SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_sums(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_sums(hyperstone_state *cpustate, struct regs_decode *decode) { INT32 res; INT64 tmp; @@ -2185,16 +1999,16 @@ void hyperstone_device::hyperstone_sums(struct hyperstone_device::regs_decode *d SET_Z( res == 0 ? 1 : 0 ); SET_N( SIGN_BIT(res) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; if( GET_V && !SRC_IS_SR ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } } -void hyperstone_device::hyperstone_cmp(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_cmp(hyperstone_state *cpustate, struct regs_decode *decode) { UINT64 tmp; @@ -2219,15 +2033,15 @@ void hyperstone_device::hyperstone_cmp(struct hyperstone_device::regs_decode *de else SET_C(0); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_mov(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_mov(hyperstone_state *cpustate, struct regs_decode *decode) { if( !GET_S && decode->dst >= 16 ) { - UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_PRIVILEGE_ERROR); + execute_exception(cpustate, addr); } SET_DREG(SREG); @@ -2238,11 +2052,11 @@ void hyperstone_device::hyperstone_mov(struct hyperstone_device::regs_decode *de SET_Z( SREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(SREG) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_add(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_add(hyperstone_state *cpustate, struct regs_decode *decode) { UINT64 tmp; @@ -2262,10 +2076,10 @@ void hyperstone_device::hyperstone_add(struct hyperstone_device::regs_decode *de SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_adds(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_adds(hyperstone_state *cpustate, struct regs_decode *decode) { INT32 res; INT64 tmp; @@ -2287,53 +2101,53 @@ void hyperstone_device::hyperstone_adds(struct hyperstone_device::regs_decode *d SET_Z( res == 0 ? 1 : 0 ); SET_N( SIGN_BIT(res) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; if( GET_V ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } } -void hyperstone_device::hyperstone_cmpb(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_cmpb(hyperstone_state *cpustate, struct regs_decode *decode) { SET_Z( (DREG & SREG) == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_andn(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_andn(hyperstone_state *cpustate, struct regs_decode *decode) { DREG = DREG & ~SREG; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_or(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_or(hyperstone_state *cpustate, struct regs_decode *decode) { DREG = DREG | SREG; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_xor(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_xor(hyperstone_state *cpustate, struct regs_decode *decode) { DREG = DREG ^ SREG; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_subc(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_subc(hyperstone_state *cpustate, struct regs_decode *decode) { UINT64 tmp; @@ -2366,18 +2180,18 @@ void hyperstone_device::hyperstone_subc(struct hyperstone_device::regs_decode *d SET_Z( GET_Z & (DREG == 0 ? 1 : 0) ); SET_N( SIGN_BIT(DREG) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_not(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_not(hyperstone_state *cpustate, struct regs_decode *decode) { SET_DREG(~SREG); SET_Z( ~SREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_sub(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_sub(hyperstone_state *cpustate, struct regs_decode *decode) { UINT64 tmp; @@ -2397,10 +2211,10 @@ void hyperstone_device::hyperstone_sub(struct hyperstone_device::regs_decode *de SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_subs(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_subs(hyperstone_state *cpustate, struct regs_decode *decode) { INT32 res; INT64 tmp; @@ -2423,16 +2237,16 @@ void hyperstone_device::hyperstone_subs(struct hyperstone_device::regs_decode *d SET_Z( res == 0 ? 1 : 0 ); SET_N( SIGN_BIT(res) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; if( GET_V ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } } -void hyperstone_device::hyperstone_addc(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_addc(hyperstone_state *cpustate, struct regs_decode *decode) { UINT64 tmp; @@ -2470,20 +2284,20 @@ void hyperstone_device::hyperstone_addc(struct hyperstone_device::regs_decode *d SET_Z( GET_Z & (DREG == 0 ? 1 : 0) ); SET_N( SIGN_BIT(DREG) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_and(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_and(hyperstone_state *cpustate, struct regs_decode *decode) { DREG = DREG & SREG; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_neg(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_neg(hyperstone_state *cpustate, struct regs_decode *decode) { UINT64 tmp; @@ -2501,10 +2315,10 @@ void hyperstone_device::hyperstone_neg(struct hyperstone_device::regs_decode *de SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_negs(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_negs(hyperstone_state *cpustate, struct regs_decode *decode) { INT32 res; INT64 tmp; @@ -2527,16 +2341,16 @@ void hyperstone_device::hyperstone_negs(struct hyperstone_device::regs_decode *d SET_N( SIGN_BIT(res) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; if( GET_V && !SRC_IS_SR ) //trap doesn't occur when source is SR { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } } -void hyperstone_device::hyperstone_cmpi(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_cmpi(hyperstone_state *cpustate, struct regs_decode *decode) { UINT64 tmp; @@ -2558,15 +2372,15 @@ void hyperstone_device::hyperstone_cmpi(struct hyperstone_device::regs_decode *d else SET_C(0); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_movi(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_movi(hyperstone_state *cpustate, struct regs_decode *decode) { if( !GET_S && decode->dst >= 16 ) { - UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_PRIVILEGE_ERROR); + execute_exception(cpustate, addr); } SET_DREG(EXTRA_U); @@ -2581,10 +2395,10 @@ void hyperstone_device::hyperstone_movi(struct hyperstone_device::regs_decode *d SET_V(0); // or V undefined ? #endif - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_addi(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_addi(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 imm; UINT64 tmp; @@ -2608,10 +2422,10 @@ void hyperstone_device::hyperstone_addi(struct hyperstone_device::regs_decode *d SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_addsi(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_addsi(hyperstone_state *cpustate, struct regs_decode *decode) { INT32 imm, res; INT64 tmp; @@ -2635,16 +2449,16 @@ void hyperstone_device::hyperstone_addsi(struct hyperstone_device::regs_decode * SET_Z( res == 0 ? 1 : 0 ); SET_N( SIGN_BIT(res) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; if( GET_V ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + execute_exception(cpustate, addr); } } -void hyperstone_device::hyperstone_cmpbi(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_cmpbi(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 imm; @@ -2670,10 +2484,10 @@ void hyperstone_device::hyperstone_cmpbi(struct hyperstone_device::regs_decode * SET_Z(0); } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_andni(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_andni(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 imm; @@ -2687,30 +2501,30 @@ void hyperstone_device::hyperstone_andni(struct hyperstone_device::regs_decode * SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_ori(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_ori(hyperstone_state *cpustate, struct regs_decode *decode) { DREG = DREG | EXTRA_U; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_xori(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_xori(hyperstone_state *cpustate, struct regs_decode *decode) { DREG = DREG ^ EXTRA_U; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_shrdi(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_shrdi(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 low_order, high_order; UINT64 val; @@ -2735,10 +2549,10 @@ void hyperstone_device::hyperstone_shrdi(struct hyperstone_device::regs_decode * SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(high_order) ); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_shrd(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_shrd(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 low_order, high_order; UINT64 val; @@ -2773,10 +2587,10 @@ void hyperstone_device::hyperstone_shrd(struct hyperstone_device::regs_decode *d SET_N( SIGN_BIT(high_order) ); } - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_shr(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_shr(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 ret; UINT8 n; @@ -2795,10 +2609,10 @@ void hyperstone_device::hyperstone_shr(struct hyperstone_device::regs_decode *de SET_Z( ret == 0 ? 1 : 0 ); SET_N( SIGN_BIT(ret) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_sardi(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_sardi(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 low_order, high_order; UINT64 val; @@ -2835,10 +2649,10 @@ void hyperstone_device::hyperstone_sardi(struct hyperstone_device::regs_decode * SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(high_order) ); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_sard(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_sard(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 low_order, high_order; UINT64 val; @@ -2885,10 +2699,10 @@ void hyperstone_device::hyperstone_sard(struct hyperstone_device::regs_decode *d SET_N( SIGN_BIT(high_order) ); } - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_sar(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_sar(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 ret; UINT8 n, sign_bit; @@ -2917,10 +2731,10 @@ void hyperstone_device::hyperstone_sar(struct hyperstone_device::regs_decode *de SET_Z( ret == 0 ? 1 : 0 ); SET_N( SIGN_BIT(ret) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_shldi(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_shldi(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 low_order, high_order, tmp; UINT64 val, mask; @@ -2950,10 +2764,10 @@ void hyperstone_device::hyperstone_shldi(struct hyperstone_device::regs_decode * SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(high_order) ); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_shld(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_shld(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 low_order, high_order, tmp, n; UINT64 val, mask; @@ -2994,10 +2808,10 @@ void hyperstone_device::hyperstone_shld(struct hyperstone_device::regs_decode *d SET_N( SIGN_BIT(high_order) ); } - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_shl(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_shl(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 base, ret, n; UINT64 mask; @@ -3018,15 +2832,15 @@ void hyperstone_device::hyperstone_shl(struct hyperstone_device::regs_decode *de SET_Z( ret == 0 ? 1 : 0 ); SET_N( SIGN_BIT(ret) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::reserved(struct hyperstone_device::regs_decode *decode) +static void reserved(hyperstone_state *cpustate, struct regs_decode *decode) { DEBUG_PRINTF(("Executed Reserved opcode. PC = %08X OP = %04X\n", PC, OP)); } -void hyperstone_device::hyperstone_testlz(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_testlz(hyperstone_state *cpustate, struct regs_decode *decode) { UINT8 zeros = 0; UINT32 mask; @@ -3044,10 +2858,10 @@ void hyperstone_device::hyperstone_testlz(struct hyperstone_device::regs_decode SET_DREG(zeros); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_rol(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_rol(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 val, base; UINT8 n; @@ -3080,11 +2894,11 @@ void hyperstone_device::hyperstone_rol(struct hyperstone_device::regs_decode *de SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(val) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } //TODO: add trap error -void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 load; @@ -3094,7 +2908,7 @@ void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode * { case 0: // LDBS.A - load = READ_B(EXTRA_S); + load = READ_B(cpustate, EXTRA_S); load |= (load & 0x80) ? 0xffffff00 : 0; SET_SREG(load); @@ -3102,14 +2916,14 @@ void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode * case 1: // LDBU.A - load = READ_B(EXTRA_S); + load = READ_B(cpustate, EXTRA_S); SET_SREG(load); break; case 2: - load = READ_HW(EXTRA_S & ~1); + load = READ_HW(cpustate, EXTRA_S & ~1); if( EXTRA_S & 1 ) // LDHS.A { @@ -3130,32 +2944,32 @@ void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode * if( (EXTRA_S & 3) == 3 ) // LDD.IOA { - load = IO_READ_W(EXTRA_S & ~3); + load = IO_READ_W(cpustate, EXTRA_S & ~3); SET_SREG(load); - load = IO_READ_W((EXTRA_S & ~3) + 4); + load = IO_READ_W(cpustate, (EXTRA_S & ~3) + 4); SET_SREGF(load); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else if( (EXTRA_S & 3) == 2 ) // LDW.IOA { - load = IO_READ_W(EXTRA_S & ~3); + load = IO_READ_W(cpustate, EXTRA_S & ~3); SET_SREG(load); } else if( (EXTRA_S & 3) == 1 ) // LDD.A { - load = READ_W(EXTRA_S & ~1); + load = READ_W(cpustate, EXTRA_S & ~1); SET_SREG(load); - load = READ_W((EXTRA_S & ~1) + 4); + load = READ_W(cpustate, (EXTRA_S & ~1) + 4); SET_SREGF(load); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else // LDW.A { - load = READ_W(EXTRA_S & ~1); + load = READ_W(cpustate, EXTRA_S & ~1); SET_SREG(load); } @@ -3168,7 +2982,7 @@ void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode * { case 0: // LDBS.D - load = READ_B(DREG + EXTRA_S); + load = READ_B(cpustate, DREG + EXTRA_S); load |= (load & 0x80) ? 0xffffff00 : 0; SET_SREG(load); @@ -3176,14 +2990,14 @@ void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode * case 1: // LDBU.D - load = READ_B(DREG + EXTRA_S); + load = READ_B(cpustate, DREG + EXTRA_S); SET_SREG(load); break; case 2: - load = READ_HW(DREG + (EXTRA_S & ~1)); + load = READ_HW(cpustate, DREG + (EXTRA_S & ~1)); if( EXTRA_S & 1 ) // LDHS.D { @@ -3204,32 +3018,32 @@ void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode * if( (EXTRA_S & 3) == 3 ) // LDD.IOD { - load = IO_READ_W(DREG + (EXTRA_S & ~3)); + load = IO_READ_W(cpustate, DREG + (EXTRA_S & ~3)); SET_SREG(load); - load = IO_READ_W(DREG + (EXTRA_S & ~3) + 4); + load = IO_READ_W(cpustate, DREG + (EXTRA_S & ~3) + 4); SET_SREGF(load); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else if( (EXTRA_S & 3) == 2 ) // LDW.IOD { - load = IO_READ_W(DREG + (EXTRA_S & ~3)); + load = IO_READ_W(cpustate, DREG + (EXTRA_S & ~3)); SET_SREG(load); } else if( (EXTRA_S & 3) == 1 ) // LDD.D { - load = READ_W(DREG + (EXTRA_S & ~1)); + load = READ_W(cpustate, DREG + (EXTRA_S & ~1)); SET_SREG(load); - load = READ_W(DREG + (EXTRA_S & ~1) + 4); + load = READ_W(cpustate, DREG + (EXTRA_S & ~1) + 4); SET_SREGF(load); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else // LDW.D { - load = READ_W(DREG + (EXTRA_S & ~1)); + load = READ_W(cpustate, DREG + (EXTRA_S & ~1)); SET_SREG(load); } @@ -3237,10 +3051,10 @@ void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode * } } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_ldxx2(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 load; @@ -3257,7 +3071,7 @@ void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode * if(SAME_SRC_DST) DEBUG_PRINTF(("LDBS.N denoted same regs @ %08X",PPC)); - load = READ_B(DREG); + load = READ_B(cpustate, DREG); load |= (load & 0x80) ? 0xffffff00 : 0; SET_SREG(load); @@ -3271,7 +3085,7 @@ void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode * if(SAME_SRC_DST) DEBUG_PRINTF(("LDBU.N denoted same regs @ %08X",PPC)); - load = READ_B(DREG); + load = READ_B(cpustate, DREG); SET_SREG(load); if(!SAME_SRC_DST) @@ -3281,7 +3095,7 @@ void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode * case 2: - load = READ_HW(DREG); + load = READ_HW(cpustate, DREG); if( EXTRA_S & 1 ) // LDHS.N { @@ -3312,14 +3126,14 @@ void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode * DEBUG_PRINTF(("LDW.S denoted same regs @ %08X",PPC)); if(DREG < SP) - SET_SREG(READ_W(DREG)); + SET_SREG(READ_W(cpustate, DREG)); else SET_SREG(GET_ABS_L_REG((DREG & 0xfc) >> 2)); if(!SAME_SRC_DST) SET_DREG(DREG + (EXTRA_S & ~3)); - m_icount -= m_clock_cycles_2; // extra cycles + cpustate->icount -= cpustate->clock_cycles_2; // extra cycles } else if( (EXTRA_S & 3) == 2 ) // Reserved { @@ -3330,23 +3144,23 @@ void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode * if(SAME_SRC_DST || SAME_SRCF_DST) DEBUG_PRINTF(("LDD.N denoted same regs @ %08X",PPC)); - load = READ_W(DREG); + load = READ_W(cpustate, DREG); SET_SREG(load); - load = READ_W(DREG + 4); + load = READ_W(cpustate, DREG + 4); SET_SREGF(load); if(!SAME_SRC_DST && !SAME_SRCF_DST) SET_DREG(DREG + (EXTRA_S & ~1)); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else // LDW.N { if(SAME_SRC_DST) DEBUG_PRINTF(("LDW.N denoted same regs @ %08X",PPC)); - load = READ_W(DREG); + load = READ_W(cpustate, DREG); SET_SREG(load); if(!SAME_SRC_DST) @@ -3357,11 +3171,11 @@ void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode * } } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } //TODO: add trap error -void hyperstone_device::hyperstone_stxx1(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_stxx1(hyperstone_state *cpustate, struct regs_decode *decode) { if( SRC_IS_SR ) SREG = SREGF = 0; @@ -3373,19 +3187,19 @@ void hyperstone_device::hyperstone_stxx1(struct hyperstone_device::regs_decode * case 0: // STBS.A /* TODO: missing trap on range error */ - WRITE_B(EXTRA_S, SREG & 0xff); + WRITE_B(cpustate, EXTRA_S, SREG & 0xff); break; case 1: // STBU.A - WRITE_B(EXTRA_S, SREG & 0xff); + WRITE_B(cpustate, EXTRA_S, SREG & 0xff); break; case 2: - WRITE_HW(EXTRA_S & ~1, SREG & 0xffff); + WRITE_HW(cpustate, EXTRA_S & ~1, SREG & 0xffff); /* if( EXTRA_S & 1 ) // STHS.A @@ -3404,25 +3218,25 @@ void hyperstone_device::hyperstone_stxx1(struct hyperstone_device::regs_decode * if( (EXTRA_S & 3) == 3 ) // STD.IOA { - IO_WRITE_W(EXTRA_S & ~3, SREG); - IO_WRITE_W((EXTRA_S & ~3) + 4, SREGF); + IO_WRITE_W(cpustate, EXTRA_S & ~3, SREG); + IO_WRITE_W(cpustate, (EXTRA_S & ~3) + 4, SREGF); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else if( (EXTRA_S & 3) == 2 ) // STW.IOA { - IO_WRITE_W(EXTRA_S & ~3, SREG); + IO_WRITE_W(cpustate, EXTRA_S & ~3, SREG); } else if( (EXTRA_S & 3) == 1 ) // STD.A { - WRITE_W(EXTRA_S & ~1, SREG); - WRITE_W((EXTRA_S & ~1) + 4, SREGF); + WRITE_W(cpustate, EXTRA_S & ~1, SREG); + WRITE_W(cpustate, (EXTRA_S & ~1) + 4, SREGF); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else // STW.A { - WRITE_W(EXTRA_S & ~1, SREG); + WRITE_W(cpustate, EXTRA_S & ~1, SREG); } break; @@ -3435,19 +3249,19 @@ void hyperstone_device::hyperstone_stxx1(struct hyperstone_device::regs_decode * case 0: // STBS.D /* TODO: missing trap on range error */ - WRITE_B(DREG + EXTRA_S, SREG & 0xff); + WRITE_B(cpustate, DREG + EXTRA_S, SREG & 0xff); break; case 1: // STBU.D - WRITE_B(DREG + EXTRA_S, SREG & 0xff); + WRITE_B(cpustate, DREG + EXTRA_S, SREG & 0xff); break; case 2: - WRITE_HW(DREG + (EXTRA_S & ~1), SREG & 0xffff); + WRITE_HW(cpustate, DREG + (EXTRA_S & ~1), SREG & 0xffff); /* if( EXTRA_S & 1 ) // STHS.D @@ -3466,35 +3280,35 @@ void hyperstone_device::hyperstone_stxx1(struct hyperstone_device::regs_decode * if( (EXTRA_S & 3) == 3 ) // STD.IOD { - IO_WRITE_W(DREG + (EXTRA_S & ~3), SREG); - IO_WRITE_W(DREG + (EXTRA_S & ~3) + 4, SREGF); + IO_WRITE_W(cpustate, DREG + (EXTRA_S & ~3), SREG); + IO_WRITE_W(cpustate, DREG + (EXTRA_S & ~3) + 4, SREGF); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else if( (EXTRA_S & 3) == 2 ) // STW.IOD { - IO_WRITE_W(DREG + (EXTRA_S & ~3), SREG); + IO_WRITE_W(cpustate, DREG + (EXTRA_S & ~3), SREG); } else if( (EXTRA_S & 3) == 1 ) // STD.D { - WRITE_W(DREG + (EXTRA_S & ~1), SREG); - WRITE_W(DREG + (EXTRA_S & ~1) + 4, SREGF); + WRITE_W(cpustate, DREG + (EXTRA_S & ~1), SREG); + WRITE_W(cpustate, DREG + (EXTRA_S & ~1) + 4, SREGF); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else // STW.D { - WRITE_W(DREG + (EXTRA_S & ~1), SREG); + WRITE_W(cpustate, DREG + (EXTRA_S & ~1), SREG); } break; } } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_stxx2(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_stxx2(hyperstone_state *cpustate, struct regs_decode *decode) { if( SRC_IS_SR ) SREG = SREGF = 0; @@ -3510,21 +3324,21 @@ void hyperstone_device::hyperstone_stxx2(struct hyperstone_device::regs_decode * case 0: // STBS.N /* TODO: missing trap on range error */ - WRITE_B(DREG, SREG & 0xff); + WRITE_B(cpustate, DREG, SREG & 0xff); SET_DREG(DREG + EXTRA_S); break; case 1: // STBU.N - WRITE_B(DREG, SREG & 0xff); + WRITE_B(cpustate, DREG, SREG & 0xff); SET_DREG(DREG + EXTRA_S); break; case 2: - WRITE_HW(DREG, SREG & 0xffff); + WRITE_HW(cpustate, DREG, SREG & 0xffff); SET_DREG(DREG + (EXTRA_S & ~1)); /* @@ -3545,7 +3359,7 @@ void hyperstone_device::hyperstone_stxx2(struct hyperstone_device::regs_decode * if( (EXTRA_S & 3) == 3 ) // STW.S { if(DREG < SP) - WRITE_W(DREG, SREG); + WRITE_W(cpustate, DREG, SREG); else { if(((DREG & 0xfc) >> 2) == ((decode->src + GET_FP) % 64) && S_BIT == LOCAL) @@ -3556,7 +3370,7 @@ void hyperstone_device::hyperstone_stxx2(struct hyperstone_device::regs_decode * SET_DREG(DREG + (EXTRA_S & ~3)); - m_icount -= m_clock_cycles_2; // extra cycles + cpustate->icount -= cpustate->clock_cycles_2; // extra cycles } else if( (EXTRA_S & 3) == 2 ) // Reserved @@ -3565,19 +3379,19 @@ void hyperstone_device::hyperstone_stxx2(struct hyperstone_device::regs_decode * } else if( (EXTRA_S & 3) == 1 ) // STD.N { - WRITE_W(DREG, SREG); + WRITE_W(cpustate, DREG, SREG); SET_DREG(DREG + (EXTRA_S & ~1)); if( SAME_SRCF_DST ) - WRITE_W(DREG + 4, SREGF + (EXTRA_S & ~1)); // because DREG == SREGF and DREG has been incremented + WRITE_W(cpustate, DREG + 4, SREGF + (EXTRA_S & ~1)); // because DREG == SREGF and DREG has been incremented else - WRITE_W(DREG + 4, SREGF); + WRITE_W(cpustate, DREG + 4, SREGF); - m_icount -= m_clock_cycles_1; // extra cycle + cpustate->icount -= cpustate->clock_cycles_1; // extra cycle } else // STW.N { - WRITE_W(DREG, SREG); + WRITE_W(cpustate, DREG, SREG); SET_DREG(DREG + (EXTRA_S & ~1)); } @@ -3585,10 +3399,10 @@ void hyperstone_device::hyperstone_stxx2(struct hyperstone_device::regs_decode * } } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_shri(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_shri(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 val; @@ -3605,10 +3419,10 @@ void hyperstone_device::hyperstone_shri(struct hyperstone_device::regs_decode *d SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(val) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_sari(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_sari(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 val; UINT8 sign_bit; @@ -3636,10 +3450,10 @@ void hyperstone_device::hyperstone_sari(struct hyperstone_device::regs_decode *d SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(val) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_shli(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_shli(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 val, val2; UINT64 mask; @@ -3659,10 +3473,10 @@ void hyperstone_device::hyperstone_shli(struct hyperstone_device::regs_decode *d SET_Z( val2 == 0 ? 1 : 0 ); SET_N( SIGN_BIT(val2) ); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_mulu(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_mulu(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 low_order, high_order; UINT64 double_word; @@ -3687,12 +3501,12 @@ void hyperstone_device::hyperstone_mulu(struct hyperstone_device::regs_decode *d } if(SREG <= 0xffff && DREG <= 0xffff) - m_icount -= m_clock_cycles_4; + cpustate->icount -= cpustate->clock_cycles_4; else - m_icount -= m_clock_cycles_6; + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_muls(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_muls(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 low_order, high_order; INT64 double_word; @@ -3716,12 +3530,12 @@ void hyperstone_device::hyperstone_muls(struct hyperstone_device::regs_decode *d } if((SREG >= 0xffff8000 && SREG <= 0x7fff) && (DREG >= 0xffff8000 && DREG <= 0x7fff)) - m_icount -= m_clock_cycles_4; + cpustate->icount -= cpustate->clock_cycles_4; else - m_icount -= m_clock_cycles_6; + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_set(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_set(hyperstone_state *cpustate, struct regs_decode *decode) { int n = N_VALUE; @@ -3734,7 +3548,7 @@ void hyperstone_device::hyperstone_set(struct hyperstone_device::regs_decode *de //TODO: add fetch opcode when there's the pipeline //TODO: no 1! - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } else { @@ -4063,11 +3877,11 @@ void hyperstone_device::hyperstone_set(struct hyperstone_device::regs_decode *de break; } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } } -void hyperstone_device::hyperstone_mul(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_mul(hyperstone_state *cpustate, struct regs_decode *decode) { UINT32 single_word; @@ -4087,96 +3901,96 @@ void hyperstone_device::hyperstone_mul(struct hyperstone_device::regs_decode *de } if((SREG >= 0xffff8000 && SREG <= 0x7fff) && (DREG >= 0xffff8000 && DREG <= 0x7fff)) - m_icount -= 3 << m_clock_scale; + cpustate->icount -= 3 << cpustate->clock_scale; else - m_icount -= 5 << m_clock_scale; + cpustate->icount -= 5 << cpustate->clock_scale; } -void hyperstone_device::hyperstone_fadd(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fadd(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_faddd(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_faddd(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fsub(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fsub(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fsubd(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fsubd(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fmul(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fmul(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fmuld(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fmuld(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fdiv(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fdiv(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fdivd(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fdivd(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fcmp(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fcmp(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fcmpd(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fcmpd(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fcmpu(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fcmpu(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fcmpud(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fcmpud(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fcvt(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fcvt(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_fcvtd(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_fcvtd(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_software(decode); - m_icount -= m_clock_cycles_6; + execute_software(cpustate, decode); + cpustate->icount -= cpustate->clock_cycles_6; } -void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_extend(hyperstone_state *cpustate, struct regs_decode *decode) { //TODO: add locks, overflow error and other things UINT32 vals, vald; @@ -4374,45 +4188,45 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode break; } - m_icount -= m_clock_cycles_1; //TODO: with the latency it can change + cpustate->icount -= cpustate->clock_cycles_1; //TODO: with the latency it can change } -void hyperstone_device::hyperstone_do(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_do(hyperstone_state *cpustate, struct regs_decode *decode) { fatalerror("Executed hyperstone_do instruction. PC = %08X\n", PPC); } -void hyperstone_device::hyperstone_ldwr(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_ldwr(hyperstone_state *cpustate, struct regs_decode *decode) { - SET_SREG(READ_W(DREG)); + SET_SREG(READ_W(cpustate, DREG)); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_lddr(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_lddr(hyperstone_state *cpustate, struct regs_decode *decode) { - SET_SREG(READ_W(DREG)); - SET_SREGF(READ_W(DREG + 4)); + SET_SREG(READ_W(cpustate, DREG)); + SET_SREGF(READ_W(cpustate, DREG + 4)); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_ldwp(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_ldwp(hyperstone_state *cpustate, struct regs_decode *decode) { - SET_SREG(READ_W(DREG)); + SET_SREG(READ_W(cpustate, DREG)); // post increment the destination register if it's different from the source one // (needed by Hidden Catch) if(!(decode->src == decode->dst && S_BIT == LOCAL)) SET_DREG(DREG + 4); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_lddp(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_lddp(hyperstone_state *cpustate, struct regs_decode *decode) { - SET_SREG(READ_W(DREG)); - SET_SREGF(READ_W(DREG + 4)); + SET_SREG(READ_W(cpustate, DREG)); + SET_SREGF(READ_W(cpustate, DREG + 4)); // post increment the destination register if it's different from the source one // and from the "next source" one @@ -4425,159 +4239,159 @@ void hyperstone_device::hyperstone_lddp(struct hyperstone_device::regs_decode *d DEBUG_PRINTF(("LDD.P denoted same regs @ %08X",PPC)); } - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_stwr(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_stwr(hyperstone_state *cpustate, struct regs_decode *decode) { if( SRC_IS_SR ) SREG = 0; - WRITE_W(DREG, SREG); + WRITE_W(cpustate, DREG, SREG); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_stdr(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_stdr(hyperstone_state *cpustate, struct regs_decode *decode) { if( SRC_IS_SR ) SREG = SREGF = 0; - WRITE_W(DREG, SREG); - WRITE_W(DREG + 4, SREGF); + WRITE_W(cpustate, DREG, SREG); + WRITE_W(cpustate, DREG + 4, SREGF); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_stwp(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_stwp(hyperstone_state *cpustate, struct regs_decode *decode) { if( SRC_IS_SR ) SREG = 0; - WRITE_W(DREG, SREG); + WRITE_W(cpustate, DREG, SREG); SET_DREG(DREG + 4); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_stdp(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_stdp(hyperstone_state *cpustate, struct regs_decode *decode) { if( SRC_IS_SR ) SREG = SREGF = 0; - WRITE_W(DREG, SREG); + WRITE_W(cpustate, DREG, SREG); SET_DREG(DREG + 8); if( SAME_SRCF_DST ) - WRITE_W(DREG + 4, SREGF + 8); // because DREG == SREGF and DREG has been incremented + WRITE_W(cpustate, DREG + 4, SREGF + 8); // because DREG == SREGF and DREG has been incremented else - WRITE_W(DREG + 4, SREGF); + WRITE_W(cpustate, DREG + 4, SREGF); - m_icount -= m_clock_cycles_2; + cpustate->icount -= cpustate->clock_cycles_2; } -void hyperstone_device::hyperstone_dbv(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_dbv(hyperstone_state *cpustate, struct regs_decode *decode) { if( GET_V ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbnv(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_dbnv(hyperstone_state *cpustate, struct regs_decode *decode) { if( !GET_V ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbe(struct hyperstone_device::regs_decode *decode) //or DBZ +INLINE void hyperstone_dbe(hyperstone_state *cpustate, struct regs_decode *decode) //or DBZ { if( GET_Z ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbne(struct hyperstone_device::regs_decode *decode) //or DBNZ +INLINE void hyperstone_dbne(hyperstone_state *cpustate, struct regs_decode *decode) //or DBNZ { if( !GET_Z ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbc(struct hyperstone_device::regs_decode *decode) //or DBST +INLINE void hyperstone_dbc(hyperstone_state *cpustate, struct regs_decode *decode) //or DBST { if( GET_C ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbnc(struct hyperstone_device::regs_decode *decode) //or DBHE +INLINE void hyperstone_dbnc(hyperstone_state *cpustate, struct regs_decode *decode) //or DBHE { if( !GET_C ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbse(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_dbse(hyperstone_state *cpustate, struct regs_decode *decode) { if( GET_C || GET_Z ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbht(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_dbht(hyperstone_state *cpustate, struct regs_decode *decode) { if( !GET_C && !GET_Z ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbn(struct hyperstone_device::regs_decode *decode) //or DBLT +INLINE void hyperstone_dbn(hyperstone_state *cpustate, struct regs_decode *decode) //or DBLT { if( GET_N ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbnn(struct hyperstone_device::regs_decode *decode) //or DBGE +INLINE void hyperstone_dbnn(hyperstone_state *cpustate, struct regs_decode *decode) //or DBGE { if( !GET_N ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dble(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_dble(hyperstone_state *cpustate, struct regs_decode *decode) { if( GET_N || GET_Z ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbgt(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_dbgt(hyperstone_state *cpustate, struct regs_decode *decode) { if( !GET_N && !GET_Z ) - execute_dbr(decode); + execute_dbr(cpustate, decode); - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_dbr(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_dbr(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_dbr(decode); + execute_dbr(cpustate, decode); } -void hyperstone_device::hyperstone_frame(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_frame(hyperstone_state *cpustate, struct regs_decode *decode) { INT8 difference; // really it's 7 bits UINT8 realfp = GET_FP - SRC_CODE; @@ -4602,7 +4416,7 @@ void hyperstone_device::hyperstone_frame(struct hyperstone_device::regs_decode * do { - WRITE_W(SP, GET_ABS_L_REG((SP & 0xfc) >> 2)); + WRITE_W(cpustate, SP, GET_ABS_L_REG((SP & 0xfc) >> 2)); SP += 4; difference++; @@ -4610,16 +4424,16 @@ void hyperstone_device::hyperstone_frame(struct hyperstone_device::regs_decode * if( tmp_flag ) { - UINT32 addr = get_trap_addr(TRAPNO_FRAME_ERROR); - execute_exception(addr); + UINT32 addr = get_trap_addr(cpustate, TRAPNO_FRAME_ERROR); + execute_exception(cpustate, addr); } } //TODO: no 1! - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_call(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_call(hyperstone_state *cpustate, struct regs_decode *decode) { if( SRC_IS_SR ) SREG = 0; @@ -4629,7 +4443,7 @@ void hyperstone_device::hyperstone_call(struct hyperstone_device::regs_decode *d EXTRA_S = (EXTRA_S & ~1) + SREG; - SET_ILC(m_instruction_length & 3); + SET_ILC(cpustate->instruction_length & 3); SET_DREG((PC & 0xfffffffe) | GET_S); SET_DREGF(SR); @@ -4642,306 +4456,993 @@ void hyperstone_device::hyperstone_call(struct hyperstone_device::regs_decode *d PPC = PC; PC = EXTRA_S; // const value - m_intblock = 2; + cpustate->intblock = 2; //TODO: add interrupt locks, errors, .... //TODO: no 1! - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bv(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_bv(hyperstone_state *cpustate, struct regs_decode *decode) { if( GET_V ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bnv(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_bnv(hyperstone_state *cpustate, struct regs_decode *decode) { if( !GET_V ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_be(struct hyperstone_device::regs_decode *decode) //or BZ +INLINE void hyperstone_be(hyperstone_state *cpustate, struct regs_decode *decode) //or BZ { if( GET_Z ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bne(struct hyperstone_device::regs_decode *decode) //or BNZ +INLINE void hyperstone_bne(hyperstone_state *cpustate, struct regs_decode *decode) //or BNZ { if( !GET_Z ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bc(struct hyperstone_device::regs_decode *decode) //or BST +INLINE void hyperstone_bc(hyperstone_state *cpustate, struct regs_decode *decode) //or BST { if( GET_C ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bnc(struct hyperstone_device::regs_decode *decode) //or BHE +INLINE void hyperstone_bnc(hyperstone_state *cpustate, struct regs_decode *decode) //or BHE { if( !GET_C ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bse(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_bse(hyperstone_state *cpustate, struct regs_decode *decode) { if( GET_C || GET_Z ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bht(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_bht(hyperstone_state *cpustate, struct regs_decode *decode) { if( !GET_C && !GET_Z ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bn(struct hyperstone_device::regs_decode *decode) //or BLT +INLINE void hyperstone_bn(hyperstone_state *cpustate, struct regs_decode *decode) //or BLT { if( GET_N ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bnn(struct hyperstone_device::regs_decode *decode) //or BGE +INLINE void hyperstone_bnn(hyperstone_state *cpustate, struct regs_decode *decode) //or BGE { if( !GET_N ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_ble(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_ble(hyperstone_state *cpustate, struct regs_decode *decode) { if( GET_N || GET_Z ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_bgt(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_bgt(hyperstone_state *cpustate, struct regs_decode *decode) { if( !GET_N && !GET_Z ) - execute_br(decode); + execute_br(cpustate, decode); else - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } -void hyperstone_device::hyperstone_br(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_br(hyperstone_state *cpustate, struct regs_decode *decode) { - execute_br(decode); + execute_br(cpustate, decode); } -void hyperstone_device::hyperstone_trap(struct hyperstone_device::regs_decode *decode) +INLINE void hyperstone_trap(hyperstone_state *cpustate, struct regs_decode *decode) { UINT8 code, trapno; UINT32 addr; trapno = (OP & 0xfc) >> 2; - addr = get_trap_addr(trapno); + addr = get_trap_addr(cpustate, trapno); code = ((OP & 0x300) >> 6) | (OP & 0x03); switch( code ) { case TRAPLE: if( GET_N || GET_Z ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPGT: if( !GET_N && !GET_Z ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPLT: if( GET_N ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPGE: if( !GET_N ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPSE: if( GET_C || GET_Z ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPHT: if( !GET_C && !GET_Z ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPST: if( GET_C ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPHE: if( !GET_C ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPE: if( GET_Z ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPNE: if( !GET_Z ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAPV: if( GET_V ) - execute_trap(addr); + execute_trap(cpustate, addr); break; case TRAP: - execute_trap(addr); + execute_trap(cpustate, addr); break; } - m_icount -= m_clock_cycles_1; + cpustate->icount -= cpustate->clock_cycles_1; } #include "e132xsop.c" -//************************************************************************** -// CORE EXECUTION LOOP -//************************************************************************** -//------------------------------------------------- -// execute_min_cycles - return minimum number of -// cycles it takes for one instruction to execute -//------------------------------------------------- +static CPU_EXECUTE( hyperstone ) +{ + hyperstone_state *cpustate = get_safe_token(device); + + if (cpustate->intblock < 0) + cpustate->intblock = 0; + check_interrupts(cpustate); + + do + { + UINT32 oldh = SR & 0x00000020; -UINT32 hyperstone_device::execute_min_cycles() const + PPC = PC; /* copy PC to previous PC */ + debugger_instruction_hook(device, PC); + + OP = READ_OP(cpustate, PC); + PC += 2; + + cpustate->instruction_length = 1; + + /* execute opcode */ + (*hyperstone_op[(OP & 0xff00) >> 8])(cpustate); + + /* clear the H state if it was previously set */ + SR ^= oldh; + + SET_ILC(cpustate->instruction_length & 3); + + if( GET_T && GET_P && cpustate->delay.delay_cmd == NO_DELAY ) /* Not in a Delayed Branch instructions */ + { + UINT32 addr = get_trap_addr(cpustate, TRAPNO_TRACE_EXCEPTION); + execute_exception(cpustate, addr); + } + + if (--cpustate->intblock == 0) + check_interrupts(cpustate); + + } while( cpustate->icount > 0 ); +} + + +/************************************************************************** + * Generic set_info + **************************************************************************/ + +static CPU_SET_INFO( hyperstone ) { - return 1; + hyperstone_state *cpustate = get_safe_token(device); + switch (state) + { + /* --- the following bits of info are set as 64-bit signed integers --- */ + + case CPUINFO_INT_PC: + case CPUINFO_INT_REGISTER + E132XS_PC: PC = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_SR: SR = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_FER: FER = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_G3: set_global_register(cpustate, 3, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G4: set_global_register(cpustate, 4, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G5: set_global_register(cpustate, 5, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G6: set_global_register(cpustate, 6, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G7: set_global_register(cpustate, 7, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G8: set_global_register(cpustate, 8, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G9: set_global_register(cpustate, 9, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G10: set_global_register(cpustate, 10, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G11: set_global_register(cpustate, 11, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G12: set_global_register(cpustate, 12, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G13: set_global_register(cpustate, 13, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G14: set_global_register(cpustate, 14, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G15: set_global_register(cpustate, 15, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G16: set_global_register(cpustate, 16, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G17: set_global_register(cpustate, 17, info->i); break; + case CPUINFO_INT_SP: + case CPUINFO_INT_REGISTER + E132XS_SP: SP = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_UB: UB = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_BCR: BCR = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_TPR: TPR = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_TCR: TCR = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_TR: set_global_register(cpustate, TR_REGISTER, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_WCR: WCR = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_ISR: ISR = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_FCR: FCR = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_MCR: MCR = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_G28: set_global_register(cpustate, 28, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G29: set_global_register(cpustate, 29, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G30: set_global_register(cpustate, 30, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_G31: set_global_register(cpustate, 31, info->i); break; + case CPUINFO_INT_REGISTER + E132XS_CL0: cpustate->local_regs[(0 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL1: cpustate->local_regs[(1 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL2: cpustate->local_regs[(2 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL3: cpustate->local_regs[(3 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL4: cpustate->local_regs[(4 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL5: cpustate->local_regs[(5 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL6: cpustate->local_regs[(6 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL7: cpustate->local_regs[(7 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL8: cpustate->local_regs[(8 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL9: cpustate->local_regs[(9 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL10: cpustate->local_regs[(10 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL11: cpustate->local_regs[(11 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL12: cpustate->local_regs[(12 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL13: cpustate->local_regs[(13 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL14: cpustate->local_regs[(14 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_CL15: cpustate->local_regs[(15 + GET_FP) % 64] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L0: cpustate->local_regs[0] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L1: cpustate->local_regs[1] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L2: cpustate->local_regs[2] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L3: cpustate->local_regs[3] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L4: cpustate->local_regs[4] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L5: cpustate->local_regs[5] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L6: cpustate->local_regs[6] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L7: cpustate->local_regs[7] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L8: cpustate->local_regs[8] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L9: cpustate->local_regs[9] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L10: cpustate->local_regs[10] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L11: cpustate->local_regs[11] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L12: cpustate->local_regs[12] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L13: cpustate->local_regs[13] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L14: cpustate->local_regs[14] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L15: cpustate->local_regs[15] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L16: cpustate->local_regs[16] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L17: cpustate->local_regs[17] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L18: cpustate->local_regs[18] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L19: cpustate->local_regs[19] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L20: cpustate->local_regs[20] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L21: cpustate->local_regs[21] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L22: cpustate->local_regs[22] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L23: cpustate->local_regs[23] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L24: cpustate->local_regs[24] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L25: cpustate->local_regs[25] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L26: cpustate->local_regs[26] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L27: cpustate->local_regs[27] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L28: cpustate->local_regs[28] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L29: cpustate->local_regs[29] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L30: cpustate->local_regs[30] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L31: cpustate->local_regs[31] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L32: cpustate->local_regs[32] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L33: cpustate->local_regs[33] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L34: cpustate->local_regs[34] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L35: cpustate->local_regs[35] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L36: cpustate->local_regs[36] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L37: cpustate->local_regs[37] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L38: cpustate->local_regs[38] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L39: cpustate->local_regs[39] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L40: cpustate->local_regs[40] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L41: cpustate->local_regs[41] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L42: cpustate->local_regs[42] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L43: cpustate->local_regs[43] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L44: cpustate->local_regs[44] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L45: cpustate->local_regs[45] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L46: cpustate->local_regs[46] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L47: cpustate->local_regs[47] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L48: cpustate->local_regs[48] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L49: cpustate->local_regs[49] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L50: cpustate->local_regs[50] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L51: cpustate->local_regs[51] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L52: cpustate->local_regs[52] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L53: cpustate->local_regs[53] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L54: cpustate->local_regs[54] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L55: cpustate->local_regs[55] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L56: cpustate->local_regs[56] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L57: cpustate->local_regs[57] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L58: cpustate->local_regs[58] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L59: cpustate->local_regs[59] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L60: cpustate->local_regs[60] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L61: cpustate->local_regs[61] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L62: cpustate->local_regs[62] = info->i; break; + case CPUINFO_INT_REGISTER + E132XS_L63: cpustate->local_regs[63] = info->i; break; + + case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(cpustate, 0, info->i); break; + case CPUINFO_INT_INPUT_STATE + 1: set_irq_line(cpustate, 1, info->i); break; + case CPUINFO_INT_INPUT_STATE + 2: set_irq_line(cpustate, 2, info->i); break; + case CPUINFO_INT_INPUT_STATE + 3: set_irq_line(cpustate, 3, info->i); break; + case CPUINFO_INT_INPUT_STATE + 4: set_irq_line(cpustate, 4, info->i); break; + case CPUINFO_INT_INPUT_STATE + 5: set_irq_line(cpustate, 5, info->i); break; + case CPUINFO_INT_INPUT_STATE + 6: set_irq_line(cpustate, 6, info->i); break; + case CPUINFO_INT_INPUT_STATE + 7: set_irq_line(cpustate, 7, info->i); break; + } } +/************************************************************************** + * Generic get_info + **************************************************************************/ + +static CPU_GET_INFO( hyperstone ) +{ + hyperstone_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; + switch (state) + { + /* --- the following bits of info are returned as 64-bit signed integers --- */ + case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(hyperstone_state); break; + case CPUINFO_INT_INPUT_LINES: info->i = 8; break; + case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; + case CPUINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break; + case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; + case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; + case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break; + case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 6; break; + case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; + case CPUINFO_INT_MAX_CYCLES: info->i = 36; break; + + case CPUINFO_INT_ADDRBUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_ADDRBUS_SHIFT + AS_PROGRAM: info->i = 0; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_DATA: info->i = 0; break; + case CPUINFO_INT_ADDRBUS_WIDTH + AS_DATA: info->i = 0; break; + case CPUINFO_INT_ADDRBUS_SHIFT + AS_DATA: info->i = 0; break; + case CPUINFO_INT_ADDRBUS_WIDTH + AS_IO: info->i = 15; break; + case CPUINFO_INT_ADDRBUS_SHIFT + AS_IO: info->i = 0; break; + + case CPUINFO_INT_INPUT_STATE + 0: /* not implemented */ break; + + case CPUINFO_INT_PREVIOUSPC: info->i = PPC; break; + + case CPUINFO_INT_PC: + case CPUINFO_INT_REGISTER + E132XS_PC: info->i = PC; break; + case CPUINFO_INT_REGISTER + E132XS_SR: info->i = SR; break; + case CPUINFO_INT_REGISTER + E132XS_FER: info->i = FER; break; + case CPUINFO_INT_REGISTER + E132XS_G3: info->i = get_global_register(cpustate, 3); break; + case CPUINFO_INT_REGISTER + E132XS_G4: info->i = get_global_register(cpustate, 4); break; + case CPUINFO_INT_REGISTER + E132XS_G5: info->i = get_global_register(cpustate, 5); break; + case CPUINFO_INT_REGISTER + E132XS_G6: info->i = get_global_register(cpustate, 6); break; + case CPUINFO_INT_REGISTER + E132XS_G7: info->i = get_global_register(cpustate, 7); break; + case CPUINFO_INT_REGISTER + E132XS_G8: info->i = get_global_register(cpustate, 8); break; + case CPUINFO_INT_REGISTER + E132XS_G9: info->i = get_global_register(cpustate, 9); break; + case CPUINFO_INT_REGISTER + E132XS_G10: info->i = get_global_register(cpustate, 10); break; + case CPUINFO_INT_REGISTER + E132XS_G11: info->i = get_global_register(cpustate, 11); break; + case CPUINFO_INT_REGISTER + E132XS_G12: info->i = get_global_register(cpustate, 12); break; + case CPUINFO_INT_REGISTER + E132XS_G13: info->i = get_global_register(cpustate, 13); break; + case CPUINFO_INT_REGISTER + E132XS_G14: info->i = get_global_register(cpustate, 14); break; + case CPUINFO_INT_REGISTER + E132XS_G15: info->i = get_global_register(cpustate, 15); break; + case CPUINFO_INT_REGISTER + E132XS_G16: info->i = get_global_register(cpustate, 16); break; + case CPUINFO_INT_REGISTER + E132XS_G17: info->i = get_global_register(cpustate, 17); break; + case CPUINFO_INT_SP: + case CPUINFO_INT_REGISTER + E132XS_SP: info->i = SP; break; + case CPUINFO_INT_REGISTER + E132XS_UB: info->i = UB; break; + case CPUINFO_INT_REGISTER + E132XS_BCR: info->i = BCR; break; + case CPUINFO_INT_REGISTER + E132XS_TPR: info->i = TPR; break; + case CPUINFO_INT_REGISTER + E132XS_TCR: info->i = TCR; break; + case CPUINFO_INT_REGISTER + E132XS_TR: info->i = TR; break; + case CPUINFO_INT_REGISTER + E132XS_WCR: info->i = WCR; break; + case CPUINFO_INT_REGISTER + E132XS_ISR: info->i = ISR; break; + case CPUINFO_INT_REGISTER + E132XS_FCR: info->i = FCR; break; + case CPUINFO_INT_REGISTER + E132XS_MCR: info->i = MCR; break; + case CPUINFO_INT_REGISTER + E132XS_G28: info->i = get_global_register(cpustate, 28); break; + case CPUINFO_INT_REGISTER + E132XS_G29: info->i = get_global_register(cpustate, 29); break; + case CPUINFO_INT_REGISTER + E132XS_G30: info->i = get_global_register(cpustate, 30); break; + case CPUINFO_INT_REGISTER + E132XS_G31: info->i = get_global_register(cpustate, 31); break; + case CPUINFO_INT_REGISTER + E132XS_CL0: info->i = cpustate->local_regs[(0 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL1: info->i = cpustate->local_regs[(1 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL2: info->i = cpustate->local_regs[(2 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL3: info->i = cpustate->local_regs[(3 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL4: info->i = cpustate->local_regs[(4 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL5: info->i = cpustate->local_regs[(5 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL6: info->i = cpustate->local_regs[(6 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL7: info->i = cpustate->local_regs[(7 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL8: info->i = cpustate->local_regs[(8 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL9: info->i = cpustate->local_regs[(9 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL10: info->i = cpustate->local_regs[(10 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL11: info->i = cpustate->local_regs[(11 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL12: info->i = cpustate->local_regs[(12 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL13: info->i = cpustate->local_regs[(13 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL14: info->i = cpustate->local_regs[(14 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_CL15: info->i = cpustate->local_regs[(15 + GET_FP) % 64]; break; + case CPUINFO_INT_REGISTER + E132XS_L0: info->i = cpustate->local_regs[0]; break; + case CPUINFO_INT_REGISTER + E132XS_L1: info->i = cpustate->local_regs[1]; break; + case CPUINFO_INT_REGISTER + E132XS_L2: info->i = cpustate->local_regs[2]; break; + case CPUINFO_INT_REGISTER + E132XS_L3: info->i = cpustate->local_regs[3]; break; + case CPUINFO_INT_REGISTER + E132XS_L4: info->i = cpustate->local_regs[4]; break; + case CPUINFO_INT_REGISTER + E132XS_L5: info->i = cpustate->local_regs[5]; break; + case CPUINFO_INT_REGISTER + E132XS_L6: info->i = cpustate->local_regs[6]; break; + case CPUINFO_INT_REGISTER + E132XS_L7: info->i = cpustate->local_regs[7]; break; + case CPUINFO_INT_REGISTER + E132XS_L8: info->i = cpustate->local_regs[8]; break; + case CPUINFO_INT_REGISTER + E132XS_L9: info->i = cpustate->local_regs[9]; break; + case CPUINFO_INT_REGISTER + E132XS_L10: info->i = cpustate->local_regs[10]; break; + case CPUINFO_INT_REGISTER + E132XS_L11: info->i = cpustate->local_regs[11]; break; + case CPUINFO_INT_REGISTER + E132XS_L12: info->i = cpustate->local_regs[12]; break; + case CPUINFO_INT_REGISTER + E132XS_L13: info->i = cpustate->local_regs[13]; break; + case CPUINFO_INT_REGISTER + E132XS_L14: info->i = cpustate->local_regs[14]; break; + case CPUINFO_INT_REGISTER + E132XS_L15: info->i = cpustate->local_regs[15]; break; + case CPUINFO_INT_REGISTER + E132XS_L16: info->i = cpustate->local_regs[16]; break; + case CPUINFO_INT_REGISTER + E132XS_L17: info->i = cpustate->local_regs[17]; break; + case CPUINFO_INT_REGISTER + E132XS_L18: info->i = cpustate->local_regs[18]; break; + case CPUINFO_INT_REGISTER + E132XS_L19: info->i = cpustate->local_regs[19]; break; + case CPUINFO_INT_REGISTER + E132XS_L20: info->i = cpustate->local_regs[20]; break; + case CPUINFO_INT_REGISTER + E132XS_L21: info->i = cpustate->local_regs[21]; break; + case CPUINFO_INT_REGISTER + E132XS_L22: info->i = cpustate->local_regs[22]; break; + case CPUINFO_INT_REGISTER + E132XS_L23: info->i = cpustate->local_regs[23]; break; + case CPUINFO_INT_REGISTER + E132XS_L24: info->i = cpustate->local_regs[24]; break; + case CPUINFO_INT_REGISTER + E132XS_L25: info->i = cpustate->local_regs[25]; break; + case CPUINFO_INT_REGISTER + E132XS_L26: info->i = cpustate->local_regs[26]; break; + case CPUINFO_INT_REGISTER + E132XS_L27: info->i = cpustate->local_regs[27]; break; + case CPUINFO_INT_REGISTER + E132XS_L28: info->i = cpustate->local_regs[28]; break; + case CPUINFO_INT_REGISTER + E132XS_L29: info->i = cpustate->local_regs[29]; break; + case CPUINFO_INT_REGISTER + E132XS_L30: info->i = cpustate->local_regs[30]; break; + case CPUINFO_INT_REGISTER + E132XS_L31: info->i = cpustate->local_regs[31]; break; + case CPUINFO_INT_REGISTER + E132XS_L32: info->i = cpustate->local_regs[32]; break; + case CPUINFO_INT_REGISTER + E132XS_L33: info->i = cpustate->local_regs[33]; break; + case CPUINFO_INT_REGISTER + E132XS_L34: info->i = cpustate->local_regs[34]; break; + case CPUINFO_INT_REGISTER + E132XS_L35: info->i = cpustate->local_regs[35]; break; + case CPUINFO_INT_REGISTER + E132XS_L36: info->i = cpustate->local_regs[36]; break; + case CPUINFO_INT_REGISTER + E132XS_L37: info->i = cpustate->local_regs[37]; break; + case CPUINFO_INT_REGISTER + E132XS_L38: info->i = cpustate->local_regs[38]; break; + case CPUINFO_INT_REGISTER + E132XS_L39: info->i = cpustate->local_regs[39]; break; + case CPUINFO_INT_REGISTER + E132XS_L40: info->i = cpustate->local_regs[40]; break; + case CPUINFO_INT_REGISTER + E132XS_L41: info->i = cpustate->local_regs[41]; break; + case CPUINFO_INT_REGISTER + E132XS_L42: info->i = cpustate->local_regs[42]; break; + case CPUINFO_INT_REGISTER + E132XS_L43: info->i = cpustate->local_regs[43]; break; + case CPUINFO_INT_REGISTER + E132XS_L44: info->i = cpustate->local_regs[44]; break; + case CPUINFO_INT_REGISTER + E132XS_L45: info->i = cpustate->local_regs[45]; break; + case CPUINFO_INT_REGISTER + E132XS_L46: info->i = cpustate->local_regs[46]; break; + case CPUINFO_INT_REGISTER + E132XS_L47: info->i = cpustate->local_regs[47]; break; + case CPUINFO_INT_REGISTER + E132XS_L48: info->i = cpustate->local_regs[48]; break; + case CPUINFO_INT_REGISTER + E132XS_L49: info->i = cpustate->local_regs[49]; break; + case CPUINFO_INT_REGISTER + E132XS_L50: info->i = cpustate->local_regs[50]; break; + case CPUINFO_INT_REGISTER + E132XS_L51: info->i = cpustate->local_regs[51]; break; + case CPUINFO_INT_REGISTER + E132XS_L52: info->i = cpustate->local_regs[52]; break; + case CPUINFO_INT_REGISTER + E132XS_L53: info->i = cpustate->local_regs[53]; break; + case CPUINFO_INT_REGISTER + E132XS_L54: info->i = cpustate->local_regs[54]; break; + case CPUINFO_INT_REGISTER + E132XS_L55: info->i = cpustate->local_regs[55]; break; + case CPUINFO_INT_REGISTER + E132XS_L56: info->i = cpustate->local_regs[56]; break; + case CPUINFO_INT_REGISTER + E132XS_L57: info->i = cpustate->local_regs[57]; break; + case CPUINFO_INT_REGISTER + E132XS_L58: info->i = cpustate->local_regs[58]; break; + case CPUINFO_INT_REGISTER + E132XS_L59: info->i = cpustate->local_regs[59]; break; + case CPUINFO_INT_REGISTER + E132XS_L60: info->i = cpustate->local_regs[60]; break; + case CPUINFO_INT_REGISTER + E132XS_L61: info->i = cpustate->local_regs[61]; break; + case CPUINFO_INT_REGISTER + E132XS_L62: info->i = cpustate->local_regs[62]; break; + case CPUINFO_INT_REGISTER + E132XS_L63: info->i = cpustate->local_regs[63]; break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(hyperstone); break; + case CPUINFO_FCT_INIT: info->init = NULL; break; + case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(hyperstone); break; + case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(hyperstone); break; + case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(hyperstone); break; + case CPUINFO_FCT_BURN: info->burn = NULL; break; + case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(hyperstone); break; + case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_DATA: info->internal_map16 = NULL; break; + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_IO: info->internal_map16 = NULL; break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_FAMILY: strcpy(info->s, "Hyperstone CPU"); break; + case CPUINFO_STR_VERSION: strcpy(info->s, "0.9"); break; + case CPUINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; + case CPUINFO_STR_CREDITS: strcpy(info->s, "Copyright Pierpaolo Prazzoli and Ryan Holtz"); break; + + case CPUINFO_STR_FLAGS: + sprintf(info->s, "%c%c%c%c%c%c%c%c%c%c%c%c FTE:%X FRM:%X ILC:%d FL:%d FP:%d", + GET_S ? 'S':'.', + GET_P ? 'P':'.', + GET_T ? 'T':'.', + GET_L ? 'L':'.', + GET_I ? 'I':'.', + cpustate->global_regs[1] & 0x00040 ? '?':'.', + GET_H ? 'H':'.', + GET_M ? 'M':'.', + GET_V ? 'V':'.', + GET_N ? 'N':'.', + GET_Z ? 'Z':'.', + GET_C ? 'C':'.', + GET_FTE, + GET_FRM, + GET_ILC, + GET_FL, + GET_FP); + break; + + case CPUINFO_STR_REGISTER + E132XS_PC: sprintf(info->s, "PC :%08X", cpustate->global_regs[0]); break; + case CPUINFO_STR_REGISTER + E132XS_SR: sprintf(info->s, "SR :%08X", cpustate->global_regs[1]); break; + case CPUINFO_STR_REGISTER + E132XS_FER: sprintf(info->s, "FER :%08X", cpustate->global_regs[2]); break; + case CPUINFO_STR_REGISTER + E132XS_G3: sprintf(info->s, "G3 :%08X", cpustate->global_regs[3]); break; + case CPUINFO_STR_REGISTER + E132XS_G4: sprintf(info->s, "G4 :%08X", cpustate->global_regs[4]); break; + case CPUINFO_STR_REGISTER + E132XS_G5: sprintf(info->s, "G5 :%08X", cpustate->global_regs[5]); break; + case CPUINFO_STR_REGISTER + E132XS_G6: sprintf(info->s, "G6 :%08X", cpustate->global_regs[6]); break; + case CPUINFO_STR_REGISTER + E132XS_G7: sprintf(info->s, "G7 :%08X", cpustate->global_regs[7]); break; + case CPUINFO_STR_REGISTER + E132XS_G8: sprintf(info->s, "G8 :%08X", cpustate->global_regs[8]); break; + case CPUINFO_STR_REGISTER + E132XS_G9: sprintf(info->s, "G9 :%08X", cpustate->global_regs[9]); break; + case CPUINFO_STR_REGISTER + E132XS_G10: sprintf(info->s, "G10 :%08X", cpustate->global_regs[10]); break; + case CPUINFO_STR_REGISTER + E132XS_G11: sprintf(info->s, "G11 :%08X", cpustate->global_regs[11]); break; + case CPUINFO_STR_REGISTER + E132XS_G12: sprintf(info->s, "G12 :%08X", cpustate->global_regs[12]); break; + case CPUINFO_STR_REGISTER + E132XS_G13: sprintf(info->s, "G13 :%08X", cpustate->global_regs[13]); break; + case CPUINFO_STR_REGISTER + E132XS_G14: sprintf(info->s, "G14 :%08X", cpustate->global_regs[14]); break; + case CPUINFO_STR_REGISTER + E132XS_G15: sprintf(info->s, "G15 :%08X", cpustate->global_regs[15]); break; + case CPUINFO_STR_REGISTER + E132XS_G16: sprintf(info->s, "G16 :%08X", cpustate->global_regs[16]); break; + case CPUINFO_STR_REGISTER + E132XS_G17: sprintf(info->s, "G17 :%08X", cpustate->global_regs[17]); break; + case CPUINFO_STR_REGISTER + E132XS_SP: sprintf(info->s, "SP :%08X", cpustate->global_regs[18]); break; + case CPUINFO_STR_REGISTER + E132XS_UB: sprintf(info->s, "UB :%08X", cpustate->global_regs[19]); break; + case CPUINFO_STR_REGISTER + E132XS_BCR: sprintf(info->s, "BCR :%08X", cpustate->global_regs[20]); break; + case CPUINFO_STR_REGISTER + E132XS_TPR: sprintf(info->s, "TPR :%08X", cpustate->global_regs[21]); break; + case CPUINFO_STR_REGISTER + E132XS_TCR: sprintf(info->s, "TCR :%08X", cpustate->global_regs[22]); break; + case CPUINFO_STR_REGISTER + E132XS_TR: sprintf(info->s, "TR :%08X", cpustate->global_regs[23]); break; + case CPUINFO_STR_REGISTER + E132XS_WCR: sprintf(info->s, "WCR :%08X", cpustate->global_regs[24]); break; + case CPUINFO_STR_REGISTER + E132XS_ISR: sprintf(info->s, "ISR :%08X", cpustate->global_regs[25]); break; + case CPUINFO_STR_REGISTER + E132XS_FCR: sprintf(info->s, "FCR :%08X", cpustate->global_regs[26]); break; + case CPUINFO_STR_REGISTER + E132XS_MCR: sprintf(info->s, "MCR :%08X", cpustate->global_regs[27]); break; + case CPUINFO_STR_REGISTER + E132XS_G28: sprintf(info->s, "G28 :%08X", cpustate->global_regs[28]); break; + case CPUINFO_STR_REGISTER + E132XS_G29: sprintf(info->s, "G29 :%08X", cpustate->global_regs[29]); break; + case CPUINFO_STR_REGISTER + E132XS_G30: sprintf(info->s, "G30 :%08X", cpustate->global_regs[30]); break; + case CPUINFO_STR_REGISTER + E132XS_G31: sprintf(info->s, "G31 :%08X", cpustate->global_regs[31]); break; + case CPUINFO_STR_REGISTER + E132XS_CL0: sprintf(info->s, "CL0 :%08X", cpustate->local_regs[(0 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL1: sprintf(info->s, "CL1 :%08X", cpustate->local_regs[(1 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL2: sprintf(info->s, "CL2 :%08X", cpustate->local_regs[(2 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL3: sprintf(info->s, "CL3 :%08X", cpustate->local_regs[(3 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL4: sprintf(info->s, "CL4 :%08X", cpustate->local_regs[(4 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL5: sprintf(info->s, "CL5 :%08X", cpustate->local_regs[(5 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL6: sprintf(info->s, "CL6 :%08X", cpustate->local_regs[(6 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL7: sprintf(info->s, "CL7 :%08X", cpustate->local_regs[(7 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL8: sprintf(info->s, "CL8 :%08X", cpustate->local_regs[(8 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL9: sprintf(info->s, "CL9 :%08X", cpustate->local_regs[(9 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL10: sprintf(info->s, "CL10:%08X", cpustate->local_regs[(10 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL11: sprintf(info->s, "CL11:%08X", cpustate->local_regs[(11 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL12: sprintf(info->s, "CL12:%08X", cpustate->local_regs[(12 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL13: sprintf(info->s, "CL13:%08X", cpustate->local_regs[(13 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL14: sprintf(info->s, "CL14:%08X", cpustate->local_regs[(14 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_CL15: sprintf(info->s, "CL15:%08X", cpustate->local_regs[(15 + GET_FP) % 64]); break; + case CPUINFO_STR_REGISTER + E132XS_L0: sprintf(info->s, "L0 :%08X", cpustate->local_regs[0]); break; + case CPUINFO_STR_REGISTER + E132XS_L1: sprintf(info->s, "L1 :%08X", cpustate->local_regs[1]); break; + case CPUINFO_STR_REGISTER + E132XS_L2: sprintf(info->s, "L2 :%08X", cpustate->local_regs[2]); break; + case CPUINFO_STR_REGISTER + E132XS_L3: sprintf(info->s, "L3 :%08X", cpustate->local_regs[3]); break; + case CPUINFO_STR_REGISTER + E132XS_L4: sprintf(info->s, "L4 :%08X", cpustate->local_regs[4]); break; + case CPUINFO_STR_REGISTER + E132XS_L5: sprintf(info->s, "L5 :%08X", cpustate->local_regs[5]); break; + case CPUINFO_STR_REGISTER + E132XS_L6: sprintf(info->s, "L6 :%08X", cpustate->local_regs[6]); break; + case CPUINFO_STR_REGISTER + E132XS_L7: sprintf(info->s, "L7 :%08X", cpustate->local_regs[7]); break; + case CPUINFO_STR_REGISTER + E132XS_L8: sprintf(info->s, "L8 :%08X", cpustate->local_regs[8]); break; + case CPUINFO_STR_REGISTER + E132XS_L9: sprintf(info->s, "L9 :%08X", cpustate->local_regs[9]); break; + case CPUINFO_STR_REGISTER + E132XS_L10: sprintf(info->s, "L10 :%08X", cpustate->local_regs[10]); break; + case CPUINFO_STR_REGISTER + E132XS_L11: sprintf(info->s, "L11 :%08X", cpustate->local_regs[11]); break; + case CPUINFO_STR_REGISTER + E132XS_L12: sprintf(info->s, "L12 :%08X", cpustate->local_regs[12]); break; + case CPUINFO_STR_REGISTER + E132XS_L13: sprintf(info->s, "L13 :%08X", cpustate->local_regs[13]); break; + case CPUINFO_STR_REGISTER + E132XS_L14: sprintf(info->s, "L14 :%08X", cpustate->local_regs[14]); break; + case CPUINFO_STR_REGISTER + E132XS_L15: sprintf(info->s, "L15 :%08X", cpustate->local_regs[15]); break; + case CPUINFO_STR_REGISTER + E132XS_L16: sprintf(info->s, "L16 :%08X", cpustate->local_regs[16]); break; + case CPUINFO_STR_REGISTER + E132XS_L17: sprintf(info->s, "L17 :%08X", cpustate->local_regs[17]); break; + case CPUINFO_STR_REGISTER + E132XS_L18: sprintf(info->s, "L18 :%08X", cpustate->local_regs[18]); break; + case CPUINFO_STR_REGISTER + E132XS_L19: sprintf(info->s, "L19 :%08X", cpustate->local_regs[19]); break; + case CPUINFO_STR_REGISTER + E132XS_L20: sprintf(info->s, "L20 :%08X", cpustate->local_regs[20]); break; + case CPUINFO_STR_REGISTER + E132XS_L21: sprintf(info->s, "L21 :%08X", cpustate->local_regs[21]); break; + case CPUINFO_STR_REGISTER + E132XS_L22: sprintf(info->s, "L22 :%08X", cpustate->local_regs[22]); break; + case CPUINFO_STR_REGISTER + E132XS_L23: sprintf(info->s, "L23 :%08X", cpustate->local_regs[23]); break; + case CPUINFO_STR_REGISTER + E132XS_L24: sprintf(info->s, "L24 :%08X", cpustate->local_regs[24]); break; + case CPUINFO_STR_REGISTER + E132XS_L25: sprintf(info->s, "L25 :%08X", cpustate->local_regs[25]); break; + case CPUINFO_STR_REGISTER + E132XS_L26: sprintf(info->s, "L26 :%08X", cpustate->local_regs[26]); break; + case CPUINFO_STR_REGISTER + E132XS_L27: sprintf(info->s, "L27 :%08X", cpustate->local_regs[27]); break; + case CPUINFO_STR_REGISTER + E132XS_L28: sprintf(info->s, "L28 :%08X", cpustate->local_regs[28]); break; + case CPUINFO_STR_REGISTER + E132XS_L29: sprintf(info->s, "L29 :%08X", cpustate->local_regs[29]); break; + case CPUINFO_STR_REGISTER + E132XS_L30: sprintf(info->s, "L30 :%08X", cpustate->local_regs[30]); break; + case CPUINFO_STR_REGISTER + E132XS_L31: sprintf(info->s, "L31 :%08X", cpustate->local_regs[31]); break; + case CPUINFO_STR_REGISTER + E132XS_L32: sprintf(info->s, "L32 :%08X", cpustate->local_regs[32]); break; + case CPUINFO_STR_REGISTER + E132XS_L33: sprintf(info->s, "L33 :%08X", cpustate->local_regs[33]); break; + case CPUINFO_STR_REGISTER + E132XS_L34: sprintf(info->s, "L34 :%08X", cpustate->local_regs[34]); break; + case CPUINFO_STR_REGISTER + E132XS_L35: sprintf(info->s, "L35 :%08X", cpustate->local_regs[35]); break; + case CPUINFO_STR_REGISTER + E132XS_L36: sprintf(info->s, "L36 :%08X", cpustate->local_regs[36]); break; + case CPUINFO_STR_REGISTER + E132XS_L37: sprintf(info->s, "L37 :%08X", cpustate->local_regs[37]); break; + case CPUINFO_STR_REGISTER + E132XS_L38: sprintf(info->s, "L38 :%08X", cpustate->local_regs[38]); break; + case CPUINFO_STR_REGISTER + E132XS_L39: sprintf(info->s, "L39 :%08X", cpustate->local_regs[39]); break; + case CPUINFO_STR_REGISTER + E132XS_L40: sprintf(info->s, "L40 :%08X", cpustate->local_regs[40]); break; + case CPUINFO_STR_REGISTER + E132XS_L41: sprintf(info->s, "L41 :%08X", cpustate->local_regs[41]); break; + case CPUINFO_STR_REGISTER + E132XS_L42: sprintf(info->s, "L42 :%08X", cpustate->local_regs[42]); break; + case CPUINFO_STR_REGISTER + E132XS_L43: sprintf(info->s, "L43 :%08X", cpustate->local_regs[43]); break; + case CPUINFO_STR_REGISTER + E132XS_L44: sprintf(info->s, "L44 :%08X", cpustate->local_regs[44]); break; + case CPUINFO_STR_REGISTER + E132XS_L45: sprintf(info->s, "L45 :%08X", cpustate->local_regs[45]); break; + case CPUINFO_STR_REGISTER + E132XS_L46: sprintf(info->s, "L46 :%08X", cpustate->local_regs[46]); break; + case CPUINFO_STR_REGISTER + E132XS_L47: sprintf(info->s, "L47 :%08X", cpustate->local_regs[47]); break; + case CPUINFO_STR_REGISTER + E132XS_L48: sprintf(info->s, "L48 :%08X", cpustate->local_regs[48]); break; + case CPUINFO_STR_REGISTER + E132XS_L49: sprintf(info->s, "L49 :%08X", cpustate->local_regs[49]); break; + case CPUINFO_STR_REGISTER + E132XS_L50: sprintf(info->s, "L50 :%08X", cpustate->local_regs[50]); break; + case CPUINFO_STR_REGISTER + E132XS_L51: sprintf(info->s, "L51 :%08X", cpustate->local_regs[51]); break; + case CPUINFO_STR_REGISTER + E132XS_L52: sprintf(info->s, "L52 :%08X", cpustate->local_regs[52]); break; + case CPUINFO_STR_REGISTER + E132XS_L53: sprintf(info->s, "L53 :%08X", cpustate->local_regs[53]); break; + case CPUINFO_STR_REGISTER + E132XS_L54: sprintf(info->s, "L54 :%08X", cpustate->local_regs[54]); break; + case CPUINFO_STR_REGISTER + E132XS_L55: sprintf(info->s, "L55 :%08X", cpustate->local_regs[55]); break; + case CPUINFO_STR_REGISTER + E132XS_L56: sprintf(info->s, "L56 :%08X", cpustate->local_regs[56]); break; + case CPUINFO_STR_REGISTER + E132XS_L57: sprintf(info->s, "L57 :%08X", cpustate->local_regs[57]); break; + case CPUINFO_STR_REGISTER + E132XS_L58: sprintf(info->s, "L58 :%08X", cpustate->local_regs[58]); break; + case CPUINFO_STR_REGISTER + E132XS_L59: sprintf(info->s, "L59 :%08X", cpustate->local_regs[59]); break; + case CPUINFO_STR_REGISTER + E132XS_L60: sprintf(info->s, "L60 :%08X", cpustate->local_regs[60]); break; + case CPUINFO_STR_REGISTER + E132XS_L61: sprintf(info->s, "L61 :%08X", cpustate->local_regs[61]); break; + case CPUINFO_STR_REGISTER + E132XS_L62: sprintf(info->s, "L62 :%08X", cpustate->local_regs[62]); break; + case CPUINFO_STR_REGISTER + E132XS_L63: sprintf(info->s, "L63 :%08X", cpustate->local_regs[63]); break; + } +} -//------------------------------------------------- -// execute_max_cycles - return maximum number of -// cycles it takes for one instruction to execute -//------------------------------------------------- -UINT32 hyperstone_device::execute_max_cycles() const +CPU_GET_INFO( e116t ) { - return 36; + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(e116_4k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e116t); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-16T"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } } +CPU_GET_INFO( e116xt ) +{ + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; -//------------------------------------------------- -// execute_input_lines - return the number of -// input/interrupt lines -//------------------------------------------------- + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(e116_8k_iram_map); break; -UINT32 hyperstone_device::execute_input_lines() const + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e116xt); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XT"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( e116xs ) { - return 8; + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(e116_16k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e116xs); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XS"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } } +CPU_GET_INFO( e116xsr ) +{ + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(e116_16k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e116xsr); break; -void hyperstone_device::execute_set_input(int inputnum, int state) + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XSR"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( e132n ) { - if (state) - ISR |= 1 << inputnum; - else - ISR &= ~(1 << inputnum); + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 32; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(e132_4k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e132n); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-32N"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } } +CPU_GET_INFO( e132t ) +{ + switch (state) + { -//------------------------------------------------- -// execute_run - execute a timeslice's worth of -// opcodes -//------------------------------------------------- + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 32; break; -void hyperstone_device::execute_run() + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(e132_4k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e132t); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-32T"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( e132xn ) { - if (m_intblock < 0) - m_intblock = 0; + switch (state) + { - check_interrupts(); + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 32; break; - do + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(e132_8k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e132xn); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XN"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( e132xt ) +{ + switch (state) { - UINT32 oldh = SR & 0x00000020; - PPC = PC; /* copy PC to previous PC */ - debugger_instruction_hook(this, PC); + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 32; break; - OP = READ_OP(PC); - PC += 2; + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(e132_8k_iram_map); break; - m_instruction_length = 1; + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e132xt); break; - /* execute opcode */ - (this->*m_opcode[(OP & 0xff00) >> 8])(); + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XT"); break; - /* clear the H state if it was previously set */ - SR ^= oldh; + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( e132xs ) +{ + switch (state) + { - SET_ILC(m_instruction_length & 3); + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 32; break; - if( GET_T && GET_P && m_delay.delay_cmd == NO_DELAY ) /* Not in a Delayed Branch instructions */ - { - UINT32 addr = get_trap_addr(TRAPNO_TRACE_EXCEPTION); - execute_exception(addr); - } + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(e132_16k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e132xs); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XS"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( e132xsr ) +{ + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 32; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(e132_16k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(e132xsr); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XSR"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( gms30c2116 ) +{ + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(e116_4k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(gms30c2116); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2116"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( gms30c2132 ) +{ + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 32; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(e132_4k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(gms30c2132); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2132"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( gms30c2216 ) +{ + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 16; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 16; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(e116_8k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(gms30c2216); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2216"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} + +CPU_GET_INFO( gms30c2232 ) +{ + switch (state) + { + + case CPUINFO_INT_DATABUS_WIDTH + AS_PROGRAM: info->i = 32; break; + case CPUINFO_INT_DATABUS_WIDTH + AS_IO: info->i = 32; break; + + case CPUINFO_PTR_INTERNAL_MEMORY_MAP + AS_PROGRAM: info->internal_map32 = ADDRESS_MAP_NAME(e132_8k_iram_map); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(gms30c2232); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2232"); break; + + default: + CPU_GET_INFO_CALL(hyperstone); + } +} - if (--m_intblock == 0) - check_interrupts(); - - } while( m_icount > 0 ); -} - -const device_type E116T = &device_creator<e116t_device>; -const device_type E116XT = &device_creator<e116xt_device>; -const device_type E116XS = &device_creator<e116xs_device>; -const device_type E116XSR = &device_creator<e116xsr_device>; -const device_type E132N = &device_creator<e132n_device>; -const device_type E132T = &device_creator<e132t_device>; -const device_type E132XN = &device_creator<e132xn_device>; -const device_type E132XT = &device_creator<e132xt_device>; -const device_type E132XS = &device_creator<e132xs_device>; -const device_type E132XSR = &device_creator<e132xsr_device>; -const device_type GMS30C2116 = &device_creator<gms30c2116_device>; -const device_type GMS30C2132 = &device_creator<gms30c2132_device>; -const device_type GMS30C2216 = &device_creator<gms30c2216_device>; -const device_type GMS30C2232 = &device_creator<gms30c2232_device>; +DEFINE_LEGACY_CPU_DEVICE(E116T, e116t); +DEFINE_LEGACY_CPU_DEVICE(E116XT, e116xt); +DEFINE_LEGACY_CPU_DEVICE(E116XS, e116xs); +DEFINE_LEGACY_CPU_DEVICE(E116XSR, e116xsr); +DEFINE_LEGACY_CPU_DEVICE(E132N, e132n); +DEFINE_LEGACY_CPU_DEVICE(E132T, e132t); +DEFINE_LEGACY_CPU_DEVICE(E132XN, e132xn); +DEFINE_LEGACY_CPU_DEVICE(E132XT, e132xt); +DEFINE_LEGACY_CPU_DEVICE(E132XS, e132xs); +DEFINE_LEGACY_CPU_DEVICE(E132XSR, e132xsr); +DEFINE_LEGACY_CPU_DEVICE(GMS30C2116, gms30c2116); +DEFINE_LEGACY_CPU_DEVICE(GMS30C2132, gms30c2132); +DEFINE_LEGACY_CPU_DEVICE(GMS30C2216, gms30c2216); +DEFINE_LEGACY_CPU_DEVICE(GMS30C2232, gms30c2232); diff --git a/src/emu/cpu/e132xs/e132xs.h b/src/emu/cpu/e132xs/e132xs.h index ccc4303cc7e..04123db53a0 100644 --- a/src/emu/cpu/e132xs/e132xs.h +++ b/src/emu/cpu/e132xs/e132xs.h @@ -22,10 +22,51 @@ /* Functions */ -/*************************************************************************** - COMPILE-TIME DEFINITIONS -***************************************************************************/ +DECLARE_LEGACY_CPU_DEVICE(E116T, e116t); +DECLARE_LEGACY_CPU_DEVICE(E116XT, e116xt); +DECLARE_LEGACY_CPU_DEVICE(E116XS, e116xs); +DECLARE_LEGACY_CPU_DEVICE(E116XSR, e116xsr); +DECLARE_LEGACY_CPU_DEVICE(E132N, e132n); +DECLARE_LEGACY_CPU_DEVICE(E132T, e132t); +DECLARE_LEGACY_CPU_DEVICE(E132XN, e132xn); +DECLARE_LEGACY_CPU_DEVICE(E132XT, e132xt); +DECLARE_LEGACY_CPU_DEVICE(E132XS, e132xs); +DECLARE_LEGACY_CPU_DEVICE(E132XSR, e132xsr); +DECLARE_LEGACY_CPU_DEVICE(GMS30C2116, gms30c2116); +DECLARE_LEGACY_CPU_DEVICE(GMS30C2132, gms30c2132); +DECLARE_LEGACY_CPU_DEVICE(GMS30C2216, gms30c2216); +DECLARE_LEGACY_CPU_DEVICE(GMS30C2232, gms30c2232); + +extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned h_flag, int private_fp); + +/* Memory access */ +/* read byte */ +#define READ_B(H,addr) (H)->program->read_byte((addr)) +/* read half-word */ +#define READ_HW(H,addr) (H)->program->read_word((addr) & ~1) +/* read word */ +#define READ_W(H,addr) (H)->program->read_dword((addr) & ~3) + +/* write byte */ +#define WRITE_B(H,addr, data) (H)->program->write_byte(addr, data) +/* write half-word */ +#define WRITE_HW(H,addr, data) (H)->program->write_word((addr) & ~1, data) +/* write word */ +#define WRITE_W(H,addr, data) (H)->program->write_dword((addr) & ~3, data) + + +/* I/O access */ +/* read word */ +#define IO_READ_W(H,addr) (H)->io->read_dword(((addr) >> 11) & 0x7ffc) +/* write word */ +#define IO_WRITE_W(H,addr, data) (H)->io->write_dword(((addr) >> 11) & 0x7ffc, data) + + +#define READ_OP(H,addr) (H)->direct->read_decrypted_word((addr), (H)->opcodexor) + + +/* Registers Number */ #define PC_REGISTER 0 #define SR_REGISTER 1 #define BCR_REGISTER 20 @@ -91,7 +132,7 @@ #define TRAPNO_RESET 62 // reserved if not mapped @ MEM3 #define TRAPNO_ERROR_ENTRY 63 // for instruction code of all ones -/* Trap codes */ +/* Traps code */ #define TRAPLE 4 #define TRAPGT 5 #define TRAPLT 6 @@ -112,586 +153,4 @@ #define E132XS_ENTRY_IRAM 3 #define E132XS_ENTRY_MEM3 7 -/*************************************************************************** - REGISTER ENUMERATION -***************************************************************************/ - -enum -{ - E132XS_PC = 1, - E132XS_SR, - E132XS_FER, - E132XS_G3, - E132XS_G4, - E132XS_G5, - E132XS_G6, - E132XS_G7, - E132XS_G8, - E132XS_G9, - E132XS_G10, - E132XS_G11, - E132XS_G12, - E132XS_G13, - E132XS_G14, - E132XS_G15, - E132XS_G16, - E132XS_G17, - E132XS_SP, - E132XS_UB, - E132XS_BCR, - E132XS_TPR, - E132XS_TCR, - E132XS_TR, - E132XS_WCR, - E132XS_ISR, - E132XS_FCR, - E132XS_MCR, - E132XS_G28, - E132XS_G29, - E132XS_G30, - E132XS_G31, - E132XS_CL0, E132XS_CL1, E132XS_CL2, E132XS_CL3, - E132XS_CL4, E132XS_CL5, E132XS_CL6, E132XS_CL7, - E132XS_CL8, E132XS_CL9, E132XS_CL10,E132XS_CL11, - E132XS_CL12,E132XS_CL13,E132XS_CL14,E132XS_CL15, - E132XS_L0, E132XS_L1, E132XS_L2, E132XS_L3, - E132XS_L4, E132XS_L5, E132XS_L6, E132XS_L7, - E132XS_L8, E132XS_L9, E132XS_L10, E132XS_L11, - E132XS_L12, E132XS_L13, E132XS_L14, E132XS_L15, - E132XS_L16, E132XS_L17, E132XS_L18, E132XS_L19, - E132XS_L20, E132XS_L21, E132XS_L22, E132XS_L23, - E132XS_L24, E132XS_L25, E132XS_L26, E132XS_L27, - E132XS_L28, E132XS_L29, E132XS_L30, E132XS_L31, - E132XS_L32, E132XS_L33, E132XS_L34, E132XS_L35, - E132XS_L36, E132XS_L37, E132XS_L38, E132XS_L39, - E132XS_L40, E132XS_L41, E132XS_L42, E132XS_L43, - E132XS_L44, E132XS_L45, E132XS_L46, E132XS_L47, - E132XS_L48, E132XS_L49, E132XS_L50, E132XS_L51, - E132XS_L52, E132XS_L53, E132XS_L54, E132XS_L55, - E132XS_L56, E132XS_L57, E132XS_L58, E132XS_L59, - E132XS_L60, E132XS_L61, E132XS_L62, E132XS_L63 -}; - -extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned h_flag, int private_fp); - -/* Memory access */ -/* read byte */ -#define READ_B(addr) m_program->read_byte((addr)) -/* read half-word */ -#define READ_HW(addr) m_program->read_word((addr) & ~1) -/* read word */ -#define READ_W(addr) m_program->read_dword((addr) & ~3) - -/* write byte */ -#define WRITE_B(addr, data) m_program->write_byte(addr, data) -/* write half-word */ -#define WRITE_HW(addr, data) m_program->write_word((addr) & ~1, data) -/* write word */ -#define WRITE_W(addr, data) m_program->write_dword((addr) & ~3, data) - - -/* I/O access */ -/* read word */ -#define IO_READ_W(addr) m_io->read_dword(((addr) >> 11) & 0x7ffc) -/* write word */ -#define IO_WRITE_W(addr, data) m_io->write_dword(((addr) >> 11) & 0x7ffc, data) - - -#define READ_OP(addr) m_direct->read_decrypted_word((addr), m_opcodexor) - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> hyperstone_device - -// Used by core CPU interface -class hyperstone_device : public cpu_device -{ -public: - // construction/destruction - hyperstone_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 io_data_width, address_map_constructor internal_map); - - // public interfaces - -protected: - void init(int scale_mask); - - // device-level overrides - virtual void device_start(); - virtual void device_reset(); - virtual void device_stop(); - - void make_ops(); - - // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const; - virtual UINT32 execute_max_cycles() const; - virtual UINT32 execute_input_lines() const; - virtual void execute_run(); - virtual void execute_set_input(int inputnum, int state); - - // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; - - // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const; - virtual UINT32 disasm_max_opcode_bytes() const; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); - - // device_state_interface overrides - virtual void state_string_export(const device_state_entry &entry, astring &string); - - // address spaces - const address_space_config m_program_config; - const address_space_config m_io_config; - address_space *m_program; - direct_read_data *m_direct; - address_space *m_io; - - /* Delay information */ - struct delay_info - { - INT32 delay_cmd; - UINT32 delay_pc; - }; - - // CPU registers - UINT32 m_global_regs[32]; - UINT32 m_local_regs[64]; - - /* internal stuff */ - UINT32 m_ppc; // previous pc - UINT16 m_op; // opcode - UINT32 m_trap_entry; // entry point to get trap address - - UINT8 m_clock_scale_mask; - UINT8 m_clock_scale; - UINT8 m_clock_cycles_1; - UINT8 m_clock_cycles_2; - UINT8 m_clock_cycles_4; - UINT8 m_clock_cycles_6; - - UINT64 m_tr_base_cycles; - UINT32 m_tr_base_value; - UINT32 m_tr_clocks_per_tick; - UINT8 m_timer_int_pending; - emu_timer *m_timer; - - delay_info m_delay; - - UINT32 m_opcodexor; - - INT32 m_instruction_length; - INT32 m_intblock; - - // other internal state - int m_icount; - - typedef void (hyperstone_device::*ophandler)(); - - ophandler m_opcode[256]; - - static const ophandler s_opcodetable[256]; - -private: - struct regs_decode - { - UINT8 src, dst; // destination and source register code - UINT32 src_value; // current source register value - UINT32 next_src_value; // current next source register value - UINT32 dst_value; // current destination register value - UINT32 next_dst_value; // current next destination register value - UINT8 sub_type; // sub type opcode (for DD and X_CODE bits) - union - { - UINT32 u; - INT32 s; - } extra; // extra value such as immediate value, const, pcrel, ... - UINT8 src_is_local; - UINT8 dst_is_local; - UINT8 same_src_dst; - UINT8 same_src_dstf; - UINT8 same_srcf_dst; - }; - - // internal functions - void check_interrupts(); - - void set_global_register(UINT8 code, UINT32 val); - void set_local_register(UINT8 code, UINT32 val); - - UINT32 get_global_register(UINT8 code); - - UINT32 get_trap_addr(UINT8 trapno); - UINT32 get_emu_code_addr(UINT8 num); - void hyperstone_set_trap_entry(int which); - UINT32 compute_tr(); - void update_timer_prescale(); - void adjust_timer_interrupt(); - - TIMER_CALLBACK_MEMBER(timer_callback); - - void execute_br(struct regs_decode *decode); - void execute_dbr(struct regs_decode *decode); - void execute_trap(UINT32 addr); - void execute_int(UINT32 addr); - void execute_exception(UINT32 addr); - void execute_software(struct regs_decode *decode); - - void hyperstone_chk(struct regs_decode *decode); - void hyperstone_movd(struct regs_decode *decode); - void hyperstone_divu(struct regs_decode *decode); - void hyperstone_divs(struct regs_decode *decode); - void hyperstone_xm(struct regs_decode *decode); - void hyperstone_mask(struct regs_decode *decode); - void hyperstone_sum(struct regs_decode *decode); - void hyperstone_sums(struct regs_decode *decode); - void hyperstone_cmp(struct regs_decode *decode); - void hyperstone_mov(struct regs_decode *decode); - void hyperstone_add(struct regs_decode *decode); - void hyperstone_adds(struct regs_decode *decode); - void hyperstone_cmpb(struct regs_decode *decode); - void hyperstone_andn(struct regs_decode *decode); - void hyperstone_or(struct regs_decode *decode); - void hyperstone_xor(struct regs_decode *decode); - void hyperstone_subc(struct regs_decode *decode); - void hyperstone_not(struct regs_decode *decode); - void hyperstone_sub(struct regs_decode *decode); - void hyperstone_subs(struct regs_decode *decode); - void hyperstone_addc(struct regs_decode *decode); - void hyperstone_and(struct regs_decode *decode); - void hyperstone_neg(struct regs_decode *decode); - void hyperstone_negs(struct regs_decode *decode); - void hyperstone_cmpi(struct regs_decode *decode); - void hyperstone_movi(struct regs_decode *decode); - void hyperstone_addi(struct regs_decode *decode); - void hyperstone_addsi(struct regs_decode *decode); - void hyperstone_cmpbi(struct regs_decode *decode); - void hyperstone_andni(struct regs_decode *decode); - void hyperstone_ori(struct regs_decode *decode); - void hyperstone_xori(struct regs_decode *decode); - void hyperstone_shrdi(struct regs_decode *decode); - void hyperstone_shrd(struct regs_decode *decode); - void hyperstone_shr(struct regs_decode *decode); - void hyperstone_shri(struct regs_decode *decode); - void hyperstone_sardi(struct regs_decode *decode); - void hyperstone_sard(struct regs_decode *decode); - void hyperstone_sar(struct regs_decode *decode); - void hyperstone_sari(struct regs_decode *decode); - void hyperstone_shldi(struct regs_decode *decode); - void hyperstone_shld(struct regs_decode *decode); - void hyperstone_shl(struct regs_decode *decode); - void hyperstone_shli(struct regs_decode *decode); - void hyperstone_testlz(struct regs_decode *decode); - void hyperstone_rol(struct regs_decode *decode); - void hyperstone_ldxx1(struct regs_decode *decode); - void hyperstone_ldxx2(struct regs_decode *decode); - void hyperstone_stxx1(struct regs_decode *decode); - void hyperstone_stxx2(struct regs_decode *decode); - void hyperstone_mulu(struct regs_decode *decode); - void hyperstone_muls(struct regs_decode *decode); - void hyperstone_mul(struct regs_decode *decode); - void hyperstone_set(struct regs_decode *decode); - - void hyperstone_fadd(struct regs_decode *decode); - void hyperstone_faddd(struct regs_decode *decode); - void hyperstone_fsub(struct regs_decode *decode); - void hyperstone_fsubd(struct regs_decode *decode); - void hyperstone_fmul(struct regs_decode *decode); - void hyperstone_fmuld(struct regs_decode *decode); - void hyperstone_fdiv(struct regs_decode *decode); - void hyperstone_fdivd(struct regs_decode *decode); - - void hyperstone_fcmp(struct regs_decode *decode); - void hyperstone_fcmpd(struct regs_decode *decode); - void hyperstone_fcmpu(struct regs_decode *decode); - void hyperstone_fcmpud(struct regs_decode *decode); - - void hyperstone_fcvt(struct regs_decode *decode); - void hyperstone_fcvtd(struct regs_decode *decode); - - void hyperstone_extend(struct regs_decode *decode); - - void hyperstone_ldwr(struct regs_decode *decode); - void hyperstone_lddr(struct regs_decode *decode); - void hyperstone_ldwp(struct regs_decode *decode); - void hyperstone_lddp(struct regs_decode *decode); - - void hyperstone_stwr(struct regs_decode *decode); - void hyperstone_stdr(struct regs_decode *decode); - void hyperstone_stwp(struct regs_decode *decode); - void hyperstone_stdp(struct regs_decode *decode); - - void hyperstone_dbv(struct regs_decode *decode); - void hyperstone_dbnv(struct regs_decode *decode); - void hyperstone_dbe(struct regs_decode *decode); - void hyperstone_dbne(struct regs_decode *decode); - void hyperstone_dbc(struct regs_decode *decode); - void hyperstone_dbnc(struct regs_decode *decode); - void hyperstone_dbse(struct regs_decode *decode); - void hyperstone_dbht(struct regs_decode *decode); - void hyperstone_dbn(struct regs_decode *decode); - void hyperstone_dbnn(struct regs_decode *decode); - void hyperstone_dble(struct regs_decode *decode); - void hyperstone_dbgt(struct regs_decode *decode); - void hyperstone_dbr(struct regs_decode *decode); - - void hyperstone_frame(struct regs_decode *decode); - void hyperstone_call(struct regs_decode *decode); - - void hyperstone_bv(struct regs_decode *decode); - void hyperstone_bnv(struct regs_decode *decode); - void hyperstone_be(struct regs_decode *decode); - void hyperstone_bne(struct regs_decode *decode); - void hyperstone_bc(struct regs_decode *decode); - void hyperstone_bnc(struct regs_decode *decode); - void hyperstone_bse(struct regs_decode *decode); - void hyperstone_bht(struct regs_decode *decode); - void hyperstone_bn(struct regs_decode *decode); - void hyperstone_bnn(struct regs_decode *decode); - void hyperstone_ble(struct regs_decode *decode); - void hyperstone_bgt(struct regs_decode *decode); - void hyperstone_br(struct regs_decode *decode); - - void hyperstone_trap(struct regs_decode *decode); - void hyperstone_do(struct regs_decode *decode); - - void reserved(struct regs_decode *decode); - - void op00(); void op01(); void op02(); void op03(); void op04(); void op05(); void op06(); void op07(); - void op08(); void op09(); void op0a(); void op0b(); void op0c(); void op0d(); void op0e(); void op0f(); - void op10(); void op11(); void op12(); void op13(); void op14(); void op15(); void op16(); void op17(); - void op18(); void op19(); void op1a(); void op1b(); void op1c(); void op1d(); void op1e(); void op1f(); - void op20(); void op21(); void op22(); void op23(); void op24(); void op25(); void op26(); void op27(); - void op28(); void op29(); void op2a(); void op2b(); void op2c(); void op2d(); void op2e(); void op2f(); - void op30(); void op31(); void op32(); void op33(); void op34(); void op35(); void op36(); void op37(); - void op38(); void op39(); void op3a(); void op3b(); void op3c(); void op3d(); void op3e(); void op3f(); - void op40(); void op41(); void op42(); void op43(); void op44(); void op45(); void op46(); void op47(); - void op48(); void op49(); void op4a(); void op4b(); void op4c(); void op4d(); void op4e(); void op4f(); - void op50(); void op51(); void op52(); void op53(); void op54(); void op55(); void op56(); void op57(); - void op58(); void op59(); void op5a(); void op5b(); void op5c(); void op5d(); void op5e(); void op5f(); - void op60(); void op61(); void op62(); void op63(); void op64(); void op65(); void op66(); void op67(); - void op68(); void op69(); void op6a(); void op6b(); void op6c(); void op6d(); void op6e(); void op6f(); - void op70(); void op71(); void op72(); void op73(); void op74(); void op75(); void op76(); void op77(); - void op78(); void op79(); void op7a(); void op7b(); void op7c(); void op7d(); void op7e(); void op7f(); - void op80(); void op81(); void op82(); void op83(); void op84(); void op85(); void op86(); void op87(); - void op88(); void op89(); void op8a(); void op8b(); void op8c(); void op8d(); void op8e(); void op8f(); - void op90(); void op91(); void op92(); void op93(); void op94(); void op95(); void op96(); void op97(); - void op98(); void op99(); void op9a(); void op9b(); void op9c(); void op9d(); void op9e(); void op9f(); - void opa0(); void opa1(); void opa2(); void opa3(); void opa4(); void opa5(); void opa6(); void opa7(); - void opa8(); void opa9(); void opaa(); void opab(); void opac(); void opad(); void opae(); void opaf(); - void opb0(); void opb1(); void opb2(); void opb3(); void opb4(); void opb5(); void opb6(); void opb7(); - void opb8(); void opb9(); void opba(); void opbb(); void opbc(); void opbd(); void opbe(); void opbf(); - void opc0(); void opc1(); void opc2(); void opc3(); void opc4(); void opc5(); void opc6(); void opc7(); - void opc8(); void opc9(); void opca(); void opcb(); void opcc(); void opcd(); void opce(); void opcf(); - void opd0(); void opd1(); void opd2(); void opd3(); void opd4(); void opd5(); void opd6(); void opd7(); - void opd8(); void opd9(); void opda(); void opdb(); void opdc(); void opdd(); void opde(); void opdf(); - void ope0(); void ope1(); void ope2(); void ope3(); void ope4(); void ope5(); void ope6(); void ope7(); - void ope8(); void ope9(); void opea(); void opeb(); void opec(); void oped(); void opee(); void opef(); - void opf0(); void opf1(); void opf2(); void opf3(); void opf4(); void opf5(); void opf6(); void opf7(); - void opf8(); void opf9(); void opfa(); void opfb(); void opfc(); void opfd(); void opfe(); void opff(); - - void set_irq_line(int irqline, int state); -}; - -// device type definition -extern const device_type E116T; -extern const device_type E116XT; -extern const device_type E116XS; -extern const device_type E116XSR; -extern const device_type E132N; -extern const device_type E132T; -extern const device_type E132XN; -extern const device_type E132XT; -extern const device_type E132XS; -extern const device_type E132XSR; -extern const device_type GMS30C2116; -extern const device_type GMS30C2132; -extern const device_type GMS30C2216; -extern const device_type GMS30C2232; - - -// ======================> e116t_device - -class e116t_device : public hyperstone_device -{ -public: - // construction/destruction - e116t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e116xt_device - -class e116xt_device : public hyperstone_device -{ -public: - // construction/destruction - e116xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e116xs_device - -class e116xs_device : public hyperstone_device -{ -public: - // construction/destruction - e116xs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e116xsr_device - -class e116xsr_device : public hyperstone_device -{ -public: - // construction/destruction - e116xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e132n_device - -class e132n_device : public hyperstone_device -{ -public: - // construction/destruction - e132n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e132t_device - -class e132t_device : public hyperstone_device -{ -public: - // construction/destruction - e132t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e132xn_device - -class e132xn_device : public hyperstone_device -{ -public: - // construction/destruction - e132xn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e132xt_device - -class e132xt_device : public hyperstone_device -{ -public: - // construction/destruction - e132xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e132xs_device - -class e132xs_device : public hyperstone_device -{ -public: - // construction/destruction - e132xs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> e132xsr_device - -class e132xsr_device : public hyperstone_device -{ -public: - // construction/destruction - e132xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> gms30c2116_device - -class gms30c2116_device : public hyperstone_device -{ -public: - // construction/destruction - gms30c2116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> gms30c2132_device - -class gms30c2132_device : public hyperstone_device -{ -public: - // construction/destruction - gms30c2132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> gms30c2216_device - -class gms30c2216_device : public hyperstone_device -{ -public: - // construction/destruction - gms30c2216_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - - -// ======================> gms30c2232_device - -class gms30c2232_device : public hyperstone_device -{ -public: - // construction/destruction - gms30c2232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual void device_start(); -}; - #endif /* __E132XS_H__ */ diff --git a/src/emu/cpu/e132xs/e132xsop.c b/src/emu/cpu/e132xs/e132xsop.c index 585af997675..6b45d15edb3 100644 --- a/src/emu/cpu/e132xs/e132xsop.c +++ b/src/emu/cpu/e132xs/e132xsop.c @@ -18,1907 +18,1908 @@ decode->same_srcf_dst = 0; \ -void hyperstone_device::op00() +static void hyperstone_op00(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_chk(decode); + hyperstone_chk(cpustate, decode); } -void hyperstone_device::op01() +static void hyperstone_op01(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_chk(decode); + hyperstone_chk(cpustate, decode); } -void hyperstone_device::op02() +static void hyperstone_op02(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_chk(decode); + hyperstone_chk(cpustate, decode); } -void hyperstone_device::op03() +static void hyperstone_op03(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_chk(decode); + hyperstone_chk(cpustate, decode); } -void hyperstone_device::op04() +static void hyperstone_op04(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_movd(decode); + hyperstone_movd(cpustate, decode); } -void hyperstone_device::op05() +static void hyperstone_op05(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_movd(decode); + hyperstone_movd(cpustate, decode); } -void hyperstone_device::op06() +static void hyperstone_op06(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_movd(decode); + hyperstone_movd(cpustate, decode); } -void hyperstone_device::op07() +static void hyperstone_op07(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_movd(decode); + hyperstone_movd(cpustate, decode); } -void hyperstone_device::op08() +static void hyperstone_op08(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_divu(decode); + hyperstone_divu(cpustate, decode); } -void hyperstone_device::op09() +static void hyperstone_op09(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_divu(decode); + hyperstone_divu(cpustate, decode); } -void hyperstone_device::op0a() +static void hyperstone_op0a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_divu(decode); + hyperstone_divu(cpustate, decode); } -void hyperstone_device::op0b() +static void hyperstone_op0b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_divu(decode); + hyperstone_divu(cpustate, decode); } -void hyperstone_device::op0c() +static void hyperstone_op0c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_divs(decode); + hyperstone_divs(cpustate, decode); } -void hyperstone_device::op0d() +static void hyperstone_op0d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_divs(decode); + hyperstone_divs(cpustate, decode); } -void hyperstone_device::op0e() +static void hyperstone_op0e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_divs(decode); + hyperstone_divs(cpustate, decode); } -void hyperstone_device::op0f() +static void hyperstone_op0f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_divs(decode); + hyperstone_divs(cpustate, decode); } -void hyperstone_device::op10() +static void hyperstone_op10(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRlimdecode(decode, 0, 0); - hyperstone_xm(decode); + hyperstone_xm(cpustate, decode); } -void hyperstone_device::op11() +static void hyperstone_op11(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRlimdecode(decode, 0, 1); - hyperstone_xm(decode); + hyperstone_xm(cpustate, decode); } -void hyperstone_device::op12() +static void hyperstone_op12(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRlimdecode(decode, 1, 0); - hyperstone_xm(decode); + hyperstone_xm(cpustate, decode); } -void hyperstone_device::op13() +static void hyperstone_op13(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRlimdecode(decode, 1, 1); - hyperstone_xm(decode); + hyperstone_xm(cpustate, decode); } -void hyperstone_device::op14() +static void hyperstone_op14(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 0); - hyperstone_mask(decode); + hyperstone_mask(cpustate, decode); } -void hyperstone_device::op15() +static void hyperstone_op15(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 1); - hyperstone_mask(decode); + hyperstone_mask(cpustate, decode); } -void hyperstone_device::op16() +static void hyperstone_op16(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 0); - hyperstone_mask(decode); + hyperstone_mask(cpustate, decode); } -void hyperstone_device::op17() +static void hyperstone_op17(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 1); - hyperstone_mask(decode); + hyperstone_mask(cpustate, decode); } -void hyperstone_device::op18() +static void hyperstone_op18(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 0); - hyperstone_sum(decode); + hyperstone_sum(cpustate, decode); } -void hyperstone_device::op19() +static void hyperstone_op19(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 1); - hyperstone_sum(decode); + hyperstone_sum(cpustate, decode); } -void hyperstone_device::op1a() +static void hyperstone_op1a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 0); - hyperstone_sum(decode); + hyperstone_sum(cpustate, decode); } -void hyperstone_device::op1b() +static void hyperstone_op1b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 1); - hyperstone_sum(decode); + hyperstone_sum(cpustate, decode); } -void hyperstone_device::op1c() +static void hyperstone_op1c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 0); - hyperstone_sums(decode); + hyperstone_sums(cpustate, decode); } -void hyperstone_device::op1d() +static void hyperstone_op1d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 1); - hyperstone_sums(decode); + hyperstone_sums(cpustate, decode); } -void hyperstone_device::op1e() +static void hyperstone_op1e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 0); - hyperstone_sums(decode); + hyperstone_sums(cpustate, decode); } -void hyperstone_device::op1f() +static void hyperstone_op1f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 1); - hyperstone_sums(decode); + hyperstone_sums(cpustate, decode); } -void hyperstone_device::op20() +static void hyperstone_op20(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_cmp(decode); + hyperstone_cmp(cpustate, decode); } -void hyperstone_device::op21() +static void hyperstone_op21(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_cmp(decode); + hyperstone_cmp(cpustate, decode); } -void hyperstone_device::op22() +static void hyperstone_op22(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_cmp(decode); + hyperstone_cmp(cpustate, decode); } -void hyperstone_device::op23() +static void hyperstone_op23(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_cmp(decode); + hyperstone_cmp(cpustate, decode); } -void hyperstone_device::op24() +static void hyperstone_op24(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecodewithHflag(decode, 0, 0); - hyperstone_mov(decode); + hyperstone_mov(cpustate, decode); } -void hyperstone_device::op25() +static void hyperstone_op25(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecodewithHflag(decode, 0, 1); - hyperstone_mov(decode); + hyperstone_mov(cpustate, decode); } -void hyperstone_device::op26() +static void hyperstone_op26(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecodewithHflag(decode, 1, 0); - hyperstone_mov(decode); + hyperstone_mov(cpustate, decode); } -void hyperstone_device::op27() +static void hyperstone_op27(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecodewithHflag(decode, 1, 1); - hyperstone_mov(decode); + hyperstone_mov(cpustate, decode); } -void hyperstone_device::op28() +static void hyperstone_op28(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_add(decode); + hyperstone_add(cpustate, decode); } -void hyperstone_device::op29() +static void hyperstone_op29(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_add(decode); + hyperstone_add(cpustate, decode); } -void hyperstone_device::op2a() +static void hyperstone_op2a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_add(decode); + hyperstone_add(cpustate, decode); } -void hyperstone_device::op2b() +static void hyperstone_op2b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_add(decode); + hyperstone_add(cpustate, decode); } -void hyperstone_device::op2c() +static void hyperstone_op2c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_adds(decode); + hyperstone_adds(cpustate, decode); } -void hyperstone_device::op2d() +static void hyperstone_op2d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_adds(decode); + hyperstone_adds(cpustate, decode); } -void hyperstone_device::op2e() +static void hyperstone_op2e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_adds(decode); + hyperstone_adds(cpustate, decode); } -void hyperstone_device::op2f() +static void hyperstone_op2f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_adds(decode); + hyperstone_adds(cpustate, decode); } -void hyperstone_device::op30() +static void hyperstone_op30(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_cmpb(decode); + hyperstone_cmpb(cpustate, decode); } -void hyperstone_device::op31() +static void hyperstone_op31(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_cmpb(decode); + hyperstone_cmpb(cpustate, decode); } -void hyperstone_device::op32() +static void hyperstone_op32(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_cmpb(decode); + hyperstone_cmpb(cpustate, decode); } -void hyperstone_device::op33() +static void hyperstone_op33(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_cmpb(decode); + hyperstone_cmpb(cpustate, decode); } -void hyperstone_device::op34() +static void hyperstone_op34(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_andn(decode); + hyperstone_andn(cpustate, decode); } -void hyperstone_device::op35() +static void hyperstone_op35(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_andn(decode); + hyperstone_andn(cpustate, decode); } -void hyperstone_device::op36() +static void hyperstone_op36(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_andn(decode); + hyperstone_andn(cpustate, decode); } -void hyperstone_device::op37() +static void hyperstone_op37(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_andn(decode); + hyperstone_andn(cpustate, decode); } -void hyperstone_device::op38() +static void hyperstone_op38(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_or(decode); + hyperstone_or(cpustate, decode); } -void hyperstone_device::op39() +static void hyperstone_op39(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_or(decode); + hyperstone_or(cpustate, decode); } -void hyperstone_device::op3a() +static void hyperstone_op3a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_or(decode); + hyperstone_or(cpustate, decode); } -void hyperstone_device::op3b() +static void hyperstone_op3b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_or(decode); + hyperstone_or(cpustate, decode); } -void hyperstone_device::op3c() +static void hyperstone_op3c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_xor(decode); + hyperstone_xor(cpustate, decode); } -void hyperstone_device::op3d() +static void hyperstone_op3d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_xor(decode); + hyperstone_xor(cpustate, decode); } -void hyperstone_device::op3e() +static void hyperstone_op3e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_xor(decode); + hyperstone_xor(cpustate, decode); } -void hyperstone_device::op3f() +static void hyperstone_op3f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_xor(decode); + hyperstone_xor(cpustate, decode); } -void hyperstone_device::op40() +static void hyperstone_op40(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_subc(decode); + hyperstone_subc(cpustate, decode); } -void hyperstone_device::op41() +static void hyperstone_op41(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_subc(decode); + hyperstone_subc(cpustate, decode); } -void hyperstone_device::op42() +static void hyperstone_op42(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_subc(decode); + hyperstone_subc(cpustate, decode); } -void hyperstone_device::op43() +static void hyperstone_op43(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_subc(decode); + hyperstone_subc(cpustate, decode); } -void hyperstone_device::op44() +static void hyperstone_op44(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_not(decode); + hyperstone_not(cpustate, decode); } -void hyperstone_device::op45() +static void hyperstone_op45(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_not(decode); + hyperstone_not(cpustate, decode); } -void hyperstone_device::op46() +static void hyperstone_op46(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_not(decode); + hyperstone_not(cpustate, decode); } -void hyperstone_device::op47() +static void hyperstone_op47(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_not(decode); + hyperstone_not(cpustate, decode); } -void hyperstone_device::op48() +static void hyperstone_op48(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_sub(decode); + hyperstone_sub(cpustate, decode); } -void hyperstone_device::op49() +static void hyperstone_op49(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_sub(decode); + hyperstone_sub(cpustate, decode); } -void hyperstone_device::op4a() +static void hyperstone_op4a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_sub(decode); + hyperstone_sub(cpustate, decode); } -void hyperstone_device::op4b() +static void hyperstone_op4b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_sub(decode); + hyperstone_sub(cpustate, decode); } -void hyperstone_device::op4c() +static void hyperstone_op4c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_subs(decode); + hyperstone_subs(cpustate, decode); } -void hyperstone_device::op4d() +static void hyperstone_op4d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_subs(decode); + hyperstone_subs(cpustate, decode); } -void hyperstone_device::op4e() +static void hyperstone_op4e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_subs(decode); + hyperstone_subs(cpustate, decode); } -void hyperstone_device::op4f() +static void hyperstone_op4f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_subs(decode); + hyperstone_subs(cpustate, decode); } -void hyperstone_device::op50() +static void hyperstone_op50(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_addc(decode); + hyperstone_addc(cpustate, decode); } -void hyperstone_device::op51() +static void hyperstone_op51(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_addc(decode); + hyperstone_addc(cpustate, decode); } -void hyperstone_device::op52() +static void hyperstone_op52(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_addc(decode); + hyperstone_addc(cpustate, decode); } -void hyperstone_device::op53() +static void hyperstone_op53(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_addc(decode); + hyperstone_addc(cpustate, decode); } -void hyperstone_device::op54() +static void hyperstone_op54(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_and(decode); + hyperstone_and(cpustate, decode); } -void hyperstone_device::op55() +static void hyperstone_op55(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_and(decode); + hyperstone_and(cpustate, decode); } -void hyperstone_device::op56() +static void hyperstone_op56(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_and(decode); + hyperstone_and(cpustate, decode); } -void hyperstone_device::op57() +static void hyperstone_op57(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_and(decode); + hyperstone_and(cpustate, decode); } -void hyperstone_device::op58() +static void hyperstone_op58(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_neg(decode); + hyperstone_neg(cpustate, decode); } -void hyperstone_device::op59() +static void hyperstone_op59(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_neg(decode); + hyperstone_neg(cpustate, decode); } -void hyperstone_device::op5a() +static void hyperstone_op5a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_neg(decode); + hyperstone_neg(cpustate, decode); } -void hyperstone_device::op5b() +static void hyperstone_op5b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_neg(decode); + hyperstone_neg(cpustate, decode); } -void hyperstone_device::op5c() +static void hyperstone_op5c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_negs(decode); + hyperstone_negs(cpustate, decode); } -void hyperstone_device::op5d() +static void hyperstone_op5d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_negs(decode); + hyperstone_negs(cpustate, decode); } -void hyperstone_device::op5e() +static void hyperstone_op5e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_negs(decode); + hyperstone_negs(cpustate, decode); } -void hyperstone_device::op5f() +static void hyperstone_op5f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_negs(decode); + hyperstone_negs(cpustate, decode); } -void hyperstone_device::op60() +static void hyperstone_op60(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_cmpi(decode); + hyperstone_cmpi(cpustate, decode); } -void hyperstone_device::op61() +static void hyperstone_op61(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_cmpi(decode); + hyperstone_cmpi(cpustate, decode); } -void hyperstone_device::op62() +static void hyperstone_op62(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_cmpi(decode); + hyperstone_cmpi(cpustate, decode); } -void hyperstone_device::op63() +static void hyperstone_op63(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_cmpi(decode); + hyperstone_cmpi(cpustate, decode); } -void hyperstone_device::op64() +static void hyperstone_op64(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RimmdecodewithHflag(decode, 0, 0); - hyperstone_movi(decode); + hyperstone_movi(cpustate, decode); } -void hyperstone_device::op65() +static void hyperstone_op65(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RimmdecodewithHflag(decode, 0, 1); - hyperstone_movi(decode); + hyperstone_movi(cpustate, decode); } -void hyperstone_device::op66() +static void hyperstone_op66(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RimmdecodewithHflag(decode, 1, 0); - hyperstone_movi(decode); + hyperstone_movi(cpustate, decode); } -void hyperstone_device::op67() +static void hyperstone_op67(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RimmdecodewithHflag(decode, 1, 1); - hyperstone_movi(decode); + hyperstone_movi(cpustate, decode); } -void hyperstone_device::op68() +static void hyperstone_op68(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_addi(decode); + hyperstone_addi(cpustate, decode); } -void hyperstone_device::op69() +static void hyperstone_op69(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_addi(decode); + hyperstone_addi(cpustate, decode); } -void hyperstone_device::op6a() +static void hyperstone_op6a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_addi(decode); + hyperstone_addi(cpustate, decode); } -void hyperstone_device::op6b() +static void hyperstone_op6b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_addi(decode); + hyperstone_addi(cpustate, decode); } -void hyperstone_device::op6c() +static void hyperstone_op6c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_addsi(decode); + hyperstone_addsi(cpustate, decode); } -void hyperstone_device::op6d() +static void hyperstone_op6d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_addsi(decode); + hyperstone_addsi(cpustate, decode); } -void hyperstone_device::op6e() +static void hyperstone_op6e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_addsi(decode); + hyperstone_addsi(cpustate, decode); } -void hyperstone_device::op6f() +static void hyperstone_op6f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_addsi(decode); + hyperstone_addsi(cpustate, decode); } -void hyperstone_device::op70() +static void hyperstone_op70(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_cmpbi(decode); + hyperstone_cmpbi(cpustate, decode); } -void hyperstone_device::op71() +static void hyperstone_op71(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_cmpbi(decode); + hyperstone_cmpbi(cpustate, decode); } -void hyperstone_device::op72() +static void hyperstone_op72(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_cmpbi(decode); + hyperstone_cmpbi(cpustate, decode); } -void hyperstone_device::op73() +static void hyperstone_op73(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_cmpbi(decode); + hyperstone_cmpbi(cpustate, decode); } -void hyperstone_device::op74() +static void hyperstone_op74(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_andni(decode); + hyperstone_andni(cpustate, decode); } -void hyperstone_device::op75() +static void hyperstone_op75(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_andni(decode); + hyperstone_andni(cpustate, decode); } -void hyperstone_device::op76() +static void hyperstone_op76(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_andni(decode); + hyperstone_andni(cpustate, decode); } -void hyperstone_device::op77() +static void hyperstone_op77(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_andni(decode); + hyperstone_andni(cpustate, decode); } -void hyperstone_device::op78() +static void hyperstone_op78(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_ori(decode); + hyperstone_ori(cpustate, decode); } -void hyperstone_device::op79() +static void hyperstone_op79(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_ori(decode); + hyperstone_ori(cpustate, decode); } -void hyperstone_device::op7a() +static void hyperstone_op7a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_ori(decode); + hyperstone_ori(cpustate, decode); } -void hyperstone_device::op7b() +static void hyperstone_op7b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_ori(decode); + hyperstone_ori(cpustate, decode); } -void hyperstone_device::op7c() +static void hyperstone_op7c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_xori(decode); + hyperstone_xori(cpustate, decode); } -void hyperstone_device::op7d() +static void hyperstone_op7d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_xori(decode); + hyperstone_xori(cpustate, decode); } -void hyperstone_device::op7e() +static void hyperstone_op7e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_xori(decode); + hyperstone_xori(cpustate, decode); } -void hyperstone_device::op7f() +static void hyperstone_op7f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_xori(decode); + hyperstone_xori(cpustate, decode); } -void hyperstone_device::op80() +static void hyperstone_op80(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_shrdi(decode); + hyperstone_shrdi(cpustate, decode); } -void hyperstone_device::op81() +static void hyperstone_op81(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_shrdi(decode); + hyperstone_shrdi(cpustate, decode); } -void hyperstone_device::op82() +static void hyperstone_op82(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_shrd(decode); + hyperstone_shrd(cpustate, decode); } -void hyperstone_device::op83() +static void hyperstone_op83(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_shr(decode); + hyperstone_shr(cpustate, decode); } -void hyperstone_device::op84() +static void hyperstone_op84(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_sardi(decode); + hyperstone_sardi(cpustate, decode); } -void hyperstone_device::op85() +static void hyperstone_op85(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_sardi(decode); + hyperstone_sardi(cpustate, decode); } -void hyperstone_device::op86() +static void hyperstone_op86(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_sard(decode); + hyperstone_sard(cpustate, decode); } -void hyperstone_device::op87() +static void hyperstone_op87(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_sar(decode); + hyperstone_sar(cpustate, decode); } -void hyperstone_device::op88() +static void hyperstone_op88(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_shldi(decode); + hyperstone_shldi(cpustate, decode); } -void hyperstone_device::op89() +static void hyperstone_op89(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_shldi(decode); + hyperstone_shldi(cpustate, decode); } -void hyperstone_device::op8a() +static void hyperstone_op8a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_shld(decode); + hyperstone_shld(cpustate, decode); } -void hyperstone_device::op8b() +static void hyperstone_op8b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_shl(decode); + hyperstone_shl(cpustate, decode); } -void hyperstone_device::op8c() +static void hyperstone_op8c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; no_decode(decode); - reserved(decode); + reserved(cpustate, decode); } -void hyperstone_device::op8d() +static void hyperstone_op8d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; no_decode(decode); - reserved(decode); + reserved(cpustate, decode); } -void hyperstone_device::op8e() +static void hyperstone_op8e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_testlz(decode); + hyperstone_testlz(cpustate, decode); } -void hyperstone_device::op8f() +static void hyperstone_op8f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_rol(decode); + hyperstone_rol(cpustate, decode); } -void hyperstone_device::op90() +static void hyperstone_op90(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 0); - hyperstone_ldxx1(decode); + hyperstone_ldxx1(cpustate, decode); } -void hyperstone_device::op91() +static void hyperstone_op91(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 1); - hyperstone_ldxx1(decode); + hyperstone_ldxx1(cpustate, decode); } -void hyperstone_device::op92() +static void hyperstone_op92(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 0); - hyperstone_ldxx1(decode); + hyperstone_ldxx1(cpustate, decode); } -void hyperstone_device::op93() +static void hyperstone_op93(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 1); - hyperstone_ldxx1(decode); + hyperstone_ldxx1(cpustate, decode); } -void hyperstone_device::op94() +static void hyperstone_op94(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 0); - hyperstone_ldxx2(decode); + hyperstone_ldxx2(cpustate, decode); } -void hyperstone_device::op95() +static void hyperstone_op95(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 1); - hyperstone_ldxx2(decode); + hyperstone_ldxx2(cpustate, decode); } -void hyperstone_device::op96() +static void hyperstone_op96(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 0); - hyperstone_ldxx2(decode); + hyperstone_ldxx2(cpustate, decode); } -void hyperstone_device::op97() +static void hyperstone_op97(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 1); - hyperstone_ldxx2(decode); + hyperstone_ldxx2(cpustate, decode); } -void hyperstone_device::op98() +static void hyperstone_op98(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 0); - hyperstone_stxx1(decode); + hyperstone_stxx1(cpustate, decode); } -void hyperstone_device::op99() +static void hyperstone_op99(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 1); - hyperstone_stxx1(decode); + hyperstone_stxx1(cpustate, decode); } -void hyperstone_device::op9a() +static void hyperstone_op9a(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 0); - hyperstone_stxx1(decode); + hyperstone_stxx1(cpustate, decode); } -void hyperstone_device::op9b() +static void hyperstone_op9b(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 1); - hyperstone_stxx1(decode); + hyperstone_stxx1(cpustate, decode); } -void hyperstone_device::op9c() +static void hyperstone_op9c(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 0); - hyperstone_stxx2(decode); + hyperstone_stxx2(cpustate, decode); } -void hyperstone_device::op9d() +static void hyperstone_op9d(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 1); - hyperstone_stxx2(decode); + hyperstone_stxx2(cpustate, decode); } -void hyperstone_device::op9e() +static void hyperstone_op9e(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 0); - hyperstone_stxx2(decode); + hyperstone_stxx2(cpustate, decode); } -void hyperstone_device::op9f() +static void hyperstone_op9f(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 1); - hyperstone_stxx2(decode); + hyperstone_stxx2(cpustate, decode); } -void hyperstone_device::opa0() +static void hyperstone_opa0(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_shri(decode); + hyperstone_shri(cpustate, decode); } -void hyperstone_device::opa1() +static void hyperstone_opa1(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_shri(decode); + hyperstone_shri(cpustate, decode); } -void hyperstone_device::opa2() +static void hyperstone_opa2(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_shri(decode); + hyperstone_shri(cpustate, decode); } -void hyperstone_device::opa3() +static void hyperstone_opa3(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_shri(decode); + hyperstone_shri(cpustate, decode); } -void hyperstone_device::opa4() +static void hyperstone_opa4(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_sari(decode); + hyperstone_sari(cpustate, decode); } -void hyperstone_device::opa5() +static void hyperstone_opa5(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_sari(decode); + hyperstone_sari(cpustate, decode); } -void hyperstone_device::opa6() +static void hyperstone_opa6(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_sari(decode); + hyperstone_sari(cpustate, decode); } -void hyperstone_device::opa7() +static void hyperstone_opa7(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_sari(decode); + hyperstone_sari(cpustate, decode); } -void hyperstone_device::opa8() +static void hyperstone_opa8(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_shli(decode); + hyperstone_shli(cpustate, decode); } -void hyperstone_device::opa9() +static void hyperstone_opa9(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_shli(decode); + hyperstone_shli(cpustate, decode); } -void hyperstone_device::opaa() +static void hyperstone_opaa(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_shli(decode); + hyperstone_shli(cpustate, decode); } -void hyperstone_device::opab() +static void hyperstone_opab(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_shli(decode); + hyperstone_shli(cpustate, decode); } -void hyperstone_device::opac() +static void hyperstone_opac(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; no_decode(decode); - reserved(decode); + reserved(cpustate, decode); } -void hyperstone_device::opad() +static void hyperstone_opad(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; no_decode(decode); - reserved(decode); + reserved(cpustate, decode); } -void hyperstone_device::opae() +static void hyperstone_opae(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; no_decode(decode); - reserved(decode); + reserved(cpustate, decode); } -void hyperstone_device::opaf() +static void hyperstone_opaf(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; no_decode(decode); - reserved(decode); + reserved(cpustate, decode); } -void hyperstone_device::opb0() +static void hyperstone_opb0(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_mulu(decode); + hyperstone_mulu(cpustate, decode); } -void hyperstone_device::opb1() +static void hyperstone_opb1(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_mulu(decode); + hyperstone_mulu(cpustate, decode); } -void hyperstone_device::opb2() +static void hyperstone_opb2(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_mulu(decode); + hyperstone_mulu(cpustate, decode); } -void hyperstone_device::opb3() +static void hyperstone_opb3(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_mulu(decode); + hyperstone_mulu(cpustate, decode); } -void hyperstone_device::opb4() +static void hyperstone_opb4(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_muls(decode); + hyperstone_muls(cpustate, decode); } -void hyperstone_device::opb5() +static void hyperstone_opb5(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_muls(decode); + hyperstone_muls(cpustate, decode); } -void hyperstone_device::opb6() +static void hyperstone_opb6(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_muls(decode); + hyperstone_muls(cpustate, decode); } -void hyperstone_device::opb7() +static void hyperstone_opb7(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_muls(decode); + hyperstone_muls(cpustate, decode); } -void hyperstone_device::opb8() +static void hyperstone_opb8(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_set(decode); + hyperstone_set(cpustate, decode); } -void hyperstone_device::opb9() +static void hyperstone_opb9(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_set(decode); + hyperstone_set(cpustate, decode); } -void hyperstone_device::opba() +static void hyperstone_opba(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_set(decode); + hyperstone_set(cpustate, decode); } -void hyperstone_device::opbb() +static void hyperstone_opbb(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_set(decode); + hyperstone_set(cpustate, decode); } -void hyperstone_device::opbc() +static void hyperstone_opbc(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_mul(decode); + hyperstone_mul(cpustate, decode); } -void hyperstone_device::opbd() +static void hyperstone_opbd(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_mul(decode); + hyperstone_mul(cpustate, decode); } -void hyperstone_device::opbe() +static void hyperstone_opbe(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_mul(decode); + hyperstone_mul(cpustate, decode); } -void hyperstone_device::opbf() +static void hyperstone_opbf(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_mul(decode); + hyperstone_mul(cpustate, decode); } -void hyperstone_device::opc0() +static void hyperstone_opc0(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fadd(decode); + hyperstone_fadd(cpustate, decode); } -void hyperstone_device::opc1() +static void hyperstone_opc1(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_faddd(decode); + hyperstone_faddd(cpustate, decode); } -void hyperstone_device::opc2() +static void hyperstone_opc2(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fsub(decode); + hyperstone_fsub(cpustate, decode); } -void hyperstone_device::opc3() +static void hyperstone_opc3(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fsubd(decode); + hyperstone_fsubd(cpustate, decode); } -void hyperstone_device::opc4() +static void hyperstone_opc4(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fmul(decode); + hyperstone_fmul(cpustate, decode); } -void hyperstone_device::opc5() +static void hyperstone_opc5(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fmuld(decode); + hyperstone_fmuld(cpustate, decode); } -void hyperstone_device::opc6() +static void hyperstone_opc6(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fdiv(decode); + hyperstone_fdiv(cpustate, decode); } -void hyperstone_device::opc7() +static void hyperstone_opc7(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fdivd(decode); + hyperstone_fdivd(cpustate, decode); } -void hyperstone_device::opc8() +static void hyperstone_opc8(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcmp(decode); + hyperstone_fcmp(cpustate, decode); } -void hyperstone_device::opc9() +static void hyperstone_opc9(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcmpd(decode); + hyperstone_fcmpd(cpustate, decode); } -void hyperstone_device::opca() +static void hyperstone_opca(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcmpu(decode); + hyperstone_fcmpu(cpustate, decode); } -void hyperstone_device::opcb() +static void hyperstone_opcb(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcmpud(decode); + hyperstone_fcmpud(cpustate, decode); } -void hyperstone_device::opcc() +static void hyperstone_opcc(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcvt(decode); + hyperstone_fcvt(cpustate, decode); } -void hyperstone_device::opcd() +static void hyperstone_opcd(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcvtd(decode); + hyperstone_fcvtd(cpustate, decode); } -void hyperstone_device::opce() +static void hyperstone_opce(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLextdecode(decode); - hyperstone_extend(decode); + hyperstone_extend(cpustate, decode); } -void hyperstone_device::opcf() +static void hyperstone_opcf(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_do(decode); + hyperstone_do(cpustate, decode); } -void hyperstone_device::opd0() +static void hyperstone_opd0(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_ldwr(decode); + hyperstone_ldwr(cpustate, decode); } -void hyperstone_device::opd1() +static void hyperstone_opd1(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_ldwr(decode); + hyperstone_ldwr(cpustate, decode); } -void hyperstone_device::opd2() +static void hyperstone_opd2(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_lddr(decode); + hyperstone_lddr(cpustate, decode); } -void hyperstone_device::opd3() +static void hyperstone_opd3(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_lddr(decode); + hyperstone_lddr(cpustate, decode); } -void hyperstone_device::opd4() +static void hyperstone_opd4(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_ldwp(decode); + hyperstone_ldwp(cpustate, decode); } -void hyperstone_device::opd5() +static void hyperstone_opd5(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_ldwp(decode); + hyperstone_ldwp(cpustate, decode); } -void hyperstone_device::opd6() +static void hyperstone_opd6(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_lddp(decode); + hyperstone_lddp(cpustate, decode); } -void hyperstone_device::opd7() +static void hyperstone_opd7(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_lddp(decode); + hyperstone_lddp(cpustate, decode); } -void hyperstone_device::opd8() +static void hyperstone_opd8(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_stwr(decode); + hyperstone_stwr(cpustate, decode); } -void hyperstone_device::opd9() +static void hyperstone_opd9(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_stwr(decode); + hyperstone_stwr(cpustate, decode); } -void hyperstone_device::opda() +static void hyperstone_opda(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_stdr(decode); + hyperstone_stdr(cpustate, decode); } -void hyperstone_device::opdb() +static void hyperstone_opdb(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_stdr(decode); + hyperstone_stdr(cpustate, decode); } -void hyperstone_device::opdc() +static void hyperstone_opdc(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_stwp(decode); + hyperstone_stwp(cpustate, decode); } -void hyperstone_device::opdd() +static void hyperstone_opdd(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_stwp(decode); + hyperstone_stwp(cpustate, decode); } -void hyperstone_device::opde() +static void hyperstone_opde(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_stdp(decode); + hyperstone_stdp(cpustate, decode); } -void hyperstone_device::opdf() +static void hyperstone_opdf(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_stdp(decode); + hyperstone_stdp(cpustate, decode); } -void hyperstone_device::ope0() +static void hyperstone_ope0(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbv(decode); + hyperstone_dbv(cpustate, decode); } -void hyperstone_device::ope1() +static void hyperstone_ope1(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbnv(decode); + hyperstone_dbnv(cpustate, decode); } -void hyperstone_device::ope2() +static void hyperstone_ope2(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbe(decode); + hyperstone_dbe(cpustate, decode); } -void hyperstone_device::ope3() +static void hyperstone_ope3(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbne(decode); + hyperstone_dbne(cpustate, decode); } -void hyperstone_device::ope4() +static void hyperstone_ope4(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbc(decode); + hyperstone_dbc(cpustate, decode); } -void hyperstone_device::ope5() +static void hyperstone_ope5(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbnc(decode); + hyperstone_dbnc(cpustate, decode); } -void hyperstone_device::ope6() +static void hyperstone_ope6(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbse(decode); + hyperstone_dbse(cpustate, decode); } -void hyperstone_device::ope7() +static void hyperstone_ope7(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbht(decode); + hyperstone_dbht(cpustate, decode); } -void hyperstone_device::ope8() +static void hyperstone_ope8(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbn(decode); + hyperstone_dbn(cpustate, decode); } -void hyperstone_device::ope9() +static void hyperstone_ope9(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbnn(decode); + hyperstone_dbnn(cpustate, decode); } -void hyperstone_device::opea() +static void hyperstone_opea(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dble(decode); + hyperstone_dble(cpustate, decode); } -void hyperstone_device::opeb() +static void hyperstone_opeb(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbgt(decode); + hyperstone_dbgt(cpustate, decode); } -void hyperstone_device::opec() +static void hyperstone_opec(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbr(decode); + hyperstone_dbr(cpustate, decode); } -void hyperstone_device::oped() +static void hyperstone_oped(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_frame(decode); + hyperstone_frame(cpustate, decode); } -void hyperstone_device::opee() +static void hyperstone_opee(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRconstdecode(decode, 0); - hyperstone_call(decode); + hyperstone_call(cpustate, decode); } -void hyperstone_device::opef() +static void hyperstone_opef(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; LRconstdecode(decode, 1); - hyperstone_call(decode); + hyperstone_call(cpustate, decode); } -void hyperstone_device::opf0() +static void hyperstone_opf0(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bv(decode); + hyperstone_bv(cpustate, decode); } -void hyperstone_device::opf1() +static void hyperstone_opf1(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bnv(decode); + hyperstone_bnv(cpustate, decode); } -void hyperstone_device::opf2() +static void hyperstone_opf2(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_be(decode); + hyperstone_be(cpustate, decode); } -void hyperstone_device::opf3() +static void hyperstone_opf3(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bne(decode); + hyperstone_bne(cpustate, decode); } -void hyperstone_device::opf4() +static void hyperstone_opf4(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bc(decode); + hyperstone_bc(cpustate, decode); } -void hyperstone_device::opf5() +static void hyperstone_opf5(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bnc(decode); + hyperstone_bnc(cpustate, decode); } -void hyperstone_device::opf6() +static void hyperstone_opf6(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bse(decode); + hyperstone_bse(cpustate, decode); } -void hyperstone_device::opf7() +static void hyperstone_opf7(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bht(decode); + hyperstone_bht(cpustate, decode); } -void hyperstone_device::opf8() +static void hyperstone_opf8(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bn(decode); + hyperstone_bn(cpustate, decode); } -void hyperstone_device::opf9() +static void hyperstone_opf9(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bnn(decode); + hyperstone_bnn(cpustate, decode); } -void hyperstone_device::opfa() +static void hyperstone_opfa(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_ble(decode); + hyperstone_ble(cpustate, decode); } -void hyperstone_device::opfb() +static void hyperstone_opfb(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bgt(decode); + hyperstone_bgt(cpustate, decode); } -void hyperstone_device::opfc() +static void hyperstone_opfc(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_br(decode); + hyperstone_br(cpustate, decode); } -void hyperstone_device::opfd() +static void hyperstone_opfd(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCadrdecode(decode); - hyperstone_trap(decode); + hyperstone_trap(cpustate, decode); } -void hyperstone_device::opfe() +static void hyperstone_opfe(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCadrdecode(decode); - hyperstone_trap(decode); + hyperstone_trap(cpustate, decode); } -void hyperstone_device::opff() +static void hyperstone_opff(hyperstone_state *cpustate) { LOCAL_DECODE_INIT; PCadrdecode(decode); - hyperstone_trap(decode); -} - -const hyperstone_device::ophandler hyperstone_device::s_opcodetable[256] = -{ - &hyperstone_device::op00, &hyperstone_device::op01, &hyperstone_device::op02, &hyperstone_device::op03, - &hyperstone_device::op04, &hyperstone_device::op05, &hyperstone_device::op06, &hyperstone_device::op07, - &hyperstone_device::op08, &hyperstone_device::op09, &hyperstone_device::op0a, &hyperstone_device::op0b, - &hyperstone_device::op0c, &hyperstone_device::op0d, &hyperstone_device::op0e, &hyperstone_device::op0f, - - &hyperstone_device::op10, &hyperstone_device::op11, &hyperstone_device::op12, &hyperstone_device::op13, - &hyperstone_device::op14, &hyperstone_device::op15, &hyperstone_device::op16, &hyperstone_device::op17, - &hyperstone_device::op18, &hyperstone_device::op19, &hyperstone_device::op1a, &hyperstone_device::op1b, - &hyperstone_device::op1c, &hyperstone_device::op1d, &hyperstone_device::op1e, &hyperstone_device::op1f, - - &hyperstone_device::op20, &hyperstone_device::op21, &hyperstone_device::op22, &hyperstone_device::op23, - &hyperstone_device::op24, &hyperstone_device::op25, &hyperstone_device::op26, &hyperstone_device::op27, - &hyperstone_device::op28, &hyperstone_device::op29, &hyperstone_device::op2a, &hyperstone_device::op2b, - &hyperstone_device::op2c, &hyperstone_device::op2d, &hyperstone_device::op2e, &hyperstone_device::op2f, - - &hyperstone_device::op30, &hyperstone_device::op31, &hyperstone_device::op32, &hyperstone_device::op33, - &hyperstone_device::op34, &hyperstone_device::op35, &hyperstone_device::op36, &hyperstone_device::op37, - &hyperstone_device::op38, &hyperstone_device::op39, &hyperstone_device::op3a, &hyperstone_device::op3b, - &hyperstone_device::op3c, &hyperstone_device::op3d, &hyperstone_device::op3e, &hyperstone_device::op3f, - - &hyperstone_device::op40, &hyperstone_device::op41, &hyperstone_device::op42, &hyperstone_device::op43, - &hyperstone_device::op44, &hyperstone_device::op45, &hyperstone_device::op46, &hyperstone_device::op47, - &hyperstone_device::op48, &hyperstone_device::op49, &hyperstone_device::op4a, &hyperstone_device::op4b, - &hyperstone_device::op4c, &hyperstone_device::op4d, &hyperstone_device::op4e, &hyperstone_device::op4f, - - &hyperstone_device::op50, &hyperstone_device::op51, &hyperstone_device::op52, &hyperstone_device::op53, - &hyperstone_device::op54, &hyperstone_device::op55, &hyperstone_device::op56, &hyperstone_device::op57, - &hyperstone_device::op58, &hyperstone_device::op59, &hyperstone_device::op5a, &hyperstone_device::op5b, - &hyperstone_device::op5c, &hyperstone_device::op5d, &hyperstone_device::op5e, &hyperstone_device::op5f, - - &hyperstone_device::op60, &hyperstone_device::op61, &hyperstone_device::op62, &hyperstone_device::op63, - &hyperstone_device::op64, &hyperstone_device::op65, &hyperstone_device::op66, &hyperstone_device::op67, - &hyperstone_device::op68, &hyperstone_device::op69, &hyperstone_device::op6a, &hyperstone_device::op6b, - &hyperstone_device::op6c, &hyperstone_device::op6d, &hyperstone_device::op6e, &hyperstone_device::op6f, - - &hyperstone_device::op70, &hyperstone_device::op71, &hyperstone_device::op72, &hyperstone_device::op73, - &hyperstone_device::op74, &hyperstone_device::op75, &hyperstone_device::op76, &hyperstone_device::op77, - &hyperstone_device::op78, &hyperstone_device::op79, &hyperstone_device::op7a, &hyperstone_device::op7b, - &hyperstone_device::op7c, &hyperstone_device::op7d, &hyperstone_device::op7e, &hyperstone_device::op7f, - - &hyperstone_device::op80, &hyperstone_device::op81, &hyperstone_device::op82, &hyperstone_device::op83, - &hyperstone_device::op84, &hyperstone_device::op85, &hyperstone_device::op86, &hyperstone_device::op87, - &hyperstone_device::op88, &hyperstone_device::op89, &hyperstone_device::op8a, &hyperstone_device::op8b, - &hyperstone_device::op8c, &hyperstone_device::op8d, &hyperstone_device::op8e, &hyperstone_device::op8f, - - &hyperstone_device::op90, &hyperstone_device::op91, &hyperstone_device::op92, &hyperstone_device::op93, - &hyperstone_device::op94, &hyperstone_device::op95, &hyperstone_device::op96, &hyperstone_device::op97, - &hyperstone_device::op98, &hyperstone_device::op99, &hyperstone_device::op9a, &hyperstone_device::op9b, - &hyperstone_device::op9c, &hyperstone_device::op9d, &hyperstone_device::op9e, &hyperstone_device::op9f, - - &hyperstone_device::opa0, &hyperstone_device::opa1, &hyperstone_device::opa2, &hyperstone_device::opa3, - &hyperstone_device::opa4, &hyperstone_device::opa5, &hyperstone_device::opa6, &hyperstone_device::opa7, - &hyperstone_device::opa8, &hyperstone_device::opa9, &hyperstone_device::opaa, &hyperstone_device::opab, - &hyperstone_device::opac, &hyperstone_device::opad, &hyperstone_device::opae, &hyperstone_device::opaf, - - &hyperstone_device::opb0, &hyperstone_device::opb1, &hyperstone_device::opb2, &hyperstone_device::opb3, - &hyperstone_device::opb4, &hyperstone_device::opb5, &hyperstone_device::opb6, &hyperstone_device::opb7, - &hyperstone_device::opb8, &hyperstone_device::opb9, &hyperstone_device::opba, &hyperstone_device::opbb, - &hyperstone_device::opbc, &hyperstone_device::opbd, &hyperstone_device::opbe, &hyperstone_device::opbf, - - &hyperstone_device::opc0, &hyperstone_device::opc1, &hyperstone_device::opc2, &hyperstone_device::opc3, - &hyperstone_device::opc4, &hyperstone_device::opc5, &hyperstone_device::opc6, &hyperstone_device::opc7, - &hyperstone_device::opc8, &hyperstone_device::opc9, &hyperstone_device::opca, &hyperstone_device::opcb, - &hyperstone_device::opcc, &hyperstone_device::opcd, &hyperstone_device::opce, &hyperstone_device::opcf, - - &hyperstone_device::opd0, &hyperstone_device::opd1, &hyperstone_device::opd2, &hyperstone_device::opd3, - &hyperstone_device::opd4, &hyperstone_device::opd5, &hyperstone_device::opd6, &hyperstone_device::opd7, - &hyperstone_device::opd8, &hyperstone_device::opd9, &hyperstone_device::opda, &hyperstone_device::opdb, - &hyperstone_device::opdc, &hyperstone_device::opdd, &hyperstone_device::opde, &hyperstone_device::opdf, - - &hyperstone_device::ope0, &hyperstone_device::ope1, &hyperstone_device::ope2, &hyperstone_device::ope3, - &hyperstone_device::ope4, &hyperstone_device::ope5, &hyperstone_device::ope6, &hyperstone_device::ope7, - &hyperstone_device::ope8, &hyperstone_device::ope9, &hyperstone_device::opea, &hyperstone_device::opeb, - &hyperstone_device::opec, &hyperstone_device::oped, &hyperstone_device::opee, &hyperstone_device::opef, - - &hyperstone_device::opf0, &hyperstone_device::opf1, &hyperstone_device::opf2, &hyperstone_device::opf3, - &hyperstone_device::opf4, &hyperstone_device::opf5, &hyperstone_device::opf6, &hyperstone_device::opf7, - &hyperstone_device::opf8, &hyperstone_device::opf9, &hyperstone_device::opfa, &hyperstone_device::opfb, - &hyperstone_device::opfc, &hyperstone_device::opfd, &hyperstone_device::opfe, &hyperstone_device::opff + hyperstone_trap(cpustate, decode); +} + + +static void (*const hyperstone_op[0x100])(hyperstone_state *cpustate) = +{ + hyperstone_op00, hyperstone_op01, hyperstone_op02, hyperstone_op03, + hyperstone_op04, hyperstone_op05, hyperstone_op06, hyperstone_op07, + hyperstone_op08, hyperstone_op09, hyperstone_op0a, hyperstone_op0b, + hyperstone_op0c, hyperstone_op0d, hyperstone_op0e, hyperstone_op0f, + + hyperstone_op10, hyperstone_op11, hyperstone_op12, hyperstone_op13, + hyperstone_op14, hyperstone_op15, hyperstone_op16, hyperstone_op17, + hyperstone_op18, hyperstone_op19, hyperstone_op1a, hyperstone_op1b, + hyperstone_op1c, hyperstone_op1d, hyperstone_op1e, hyperstone_op1f, + + hyperstone_op20, hyperstone_op21, hyperstone_op22, hyperstone_op23, + hyperstone_op24, hyperstone_op25, hyperstone_op26, hyperstone_op27, + hyperstone_op28, hyperstone_op29, hyperstone_op2a, hyperstone_op2b, + hyperstone_op2c, hyperstone_op2d, hyperstone_op2e, hyperstone_op2f, + + hyperstone_op30, hyperstone_op31, hyperstone_op32, hyperstone_op33, + hyperstone_op34, hyperstone_op35, hyperstone_op36, hyperstone_op37, + hyperstone_op38, hyperstone_op39, hyperstone_op3a, hyperstone_op3b, + hyperstone_op3c, hyperstone_op3d, hyperstone_op3e, hyperstone_op3f, + + hyperstone_op40, hyperstone_op41, hyperstone_op42, hyperstone_op43, + hyperstone_op44, hyperstone_op45, hyperstone_op46, hyperstone_op47, + hyperstone_op48, hyperstone_op49, hyperstone_op4a, hyperstone_op4b, + hyperstone_op4c, hyperstone_op4d, hyperstone_op4e, hyperstone_op4f, + + hyperstone_op50, hyperstone_op51, hyperstone_op52, hyperstone_op53, + hyperstone_op54, hyperstone_op55, hyperstone_op56, hyperstone_op57, + hyperstone_op58, hyperstone_op59, hyperstone_op5a, hyperstone_op5b, + hyperstone_op5c, hyperstone_op5d, hyperstone_op5e, hyperstone_op5f, + + hyperstone_op60, hyperstone_op61, hyperstone_op62, hyperstone_op63, + hyperstone_op64, hyperstone_op65, hyperstone_op66, hyperstone_op67, + hyperstone_op68, hyperstone_op69, hyperstone_op6a, hyperstone_op6b, + hyperstone_op6c, hyperstone_op6d, hyperstone_op6e, hyperstone_op6f, + + hyperstone_op70, hyperstone_op71, hyperstone_op72, hyperstone_op73, + hyperstone_op74, hyperstone_op75, hyperstone_op76, hyperstone_op77, + hyperstone_op78, hyperstone_op79, hyperstone_op7a, hyperstone_op7b, + hyperstone_op7c, hyperstone_op7d, hyperstone_op7e, hyperstone_op7f, + + hyperstone_op80, hyperstone_op81, hyperstone_op82, hyperstone_op83, + hyperstone_op84, hyperstone_op85, hyperstone_op86, hyperstone_op87, + hyperstone_op88, hyperstone_op89, hyperstone_op8a, hyperstone_op8b, + hyperstone_op8c, hyperstone_op8d, hyperstone_op8e, hyperstone_op8f, + + hyperstone_op90, hyperstone_op91, hyperstone_op92, hyperstone_op93, + hyperstone_op94, hyperstone_op95, hyperstone_op96, hyperstone_op97, + hyperstone_op98, hyperstone_op99, hyperstone_op9a, hyperstone_op9b, + hyperstone_op9c, hyperstone_op9d, hyperstone_op9e, hyperstone_op9f, + + hyperstone_opa0, hyperstone_opa1, hyperstone_opa2, hyperstone_opa3, + hyperstone_opa4, hyperstone_opa5, hyperstone_opa6, hyperstone_opa7, + hyperstone_opa8, hyperstone_opa9, hyperstone_opaa, hyperstone_opab, + hyperstone_opac, hyperstone_opad, hyperstone_opae, hyperstone_opaf, + + hyperstone_opb0, hyperstone_opb1, hyperstone_opb2, hyperstone_opb3, + hyperstone_opb4, hyperstone_opb5, hyperstone_opb6, hyperstone_opb7, + hyperstone_opb8, hyperstone_opb9, hyperstone_opba, hyperstone_opbb, + hyperstone_opbc, hyperstone_opbd, hyperstone_opbe, hyperstone_opbf, + + hyperstone_opc0, hyperstone_opc1, hyperstone_opc2, hyperstone_opc3, + hyperstone_opc4, hyperstone_opc5, hyperstone_opc6, hyperstone_opc7, + hyperstone_opc8, hyperstone_opc9, hyperstone_opca, hyperstone_opcb, + hyperstone_opcc, hyperstone_opcd, hyperstone_opce, hyperstone_opcf, + + hyperstone_opd0, hyperstone_opd1, hyperstone_opd2, hyperstone_opd3, + hyperstone_opd4, hyperstone_opd5, hyperstone_opd6, hyperstone_opd7, + hyperstone_opd8, hyperstone_opd9, hyperstone_opda, hyperstone_opdb, + hyperstone_opdc, hyperstone_opdd, hyperstone_opde, hyperstone_opdf, + + hyperstone_ope0, hyperstone_ope1, hyperstone_ope2, hyperstone_ope3, + hyperstone_ope4, hyperstone_ope5, hyperstone_ope6, hyperstone_ope7, + hyperstone_ope8, hyperstone_ope9, hyperstone_opea, hyperstone_opeb, + hyperstone_opec, hyperstone_oped, hyperstone_opee, hyperstone_opef, + + hyperstone_opf0, hyperstone_opf1, hyperstone_opf2, hyperstone_opf3, + hyperstone_opf4, hyperstone_opf5, hyperstone_opf6, hyperstone_opf7, + hyperstone_opf8, hyperstone_opf9, hyperstone_opfa, hyperstone_opfb, + hyperstone_opfc, hyperstone_opfd, hyperstone_opfe, hyperstone_opff }; |