diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c index 31a3f12f1b2..1782eb4912e 100644 --- a/src/emu/cpu/e132xs/e132xs.c +++ b/src/emu/cpu/e132xs/e132xs.c @@ -227,130 +227,7 @@ /* 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 @@ -359,10 +236,10 @@ static void check_interrupts(hyperstone_state *cpustate); #define EXTRA_U (decode)->extra.u #define EXTRA_S (decode)->extra.s -#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 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 SRC_IS_PC (!(decode)->src_is_local && (decode)->src == PC_REGISTER) #define DST_IS_PC (!(decode)->dst_is_local && (decode)->dst == PC_REGISTER) @@ -372,72 +249,204 @@ static void check_interrupts(hyperstone_state *cpustate); #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, legacy_cpu_device ) +static ADDRESS_MAP_START( e116_4k_iram_map, AS_PROGRAM, 16, hyperstone_device ) AM_RANGE(0xc0000000, 0xc0000fff) AM_RAM AM_MIRROR(0x1ffff000) ADDRESS_MAP_END - - -static ADDRESS_MAP_START( e132_4k_iram_map, AS_PROGRAM, 32, legacy_cpu_device ) +static ADDRESS_MAP_START( e132_4k_iram_map, AS_PROGRAM, 32, hyperstone_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, legacy_cpu_device ) - +static ADDRESS_MAP_START( e116_8k_iram_map, AS_PROGRAM, 16, hyperstone_device ) AM_RANGE(0xc0000000, 0xc0001fff) AM_RAM AM_MIRROR(0x1fffe000) ADDRESS_MAP_END - - -static ADDRESS_MAP_START( e132_8k_iram_map, AS_PROGRAM, 32, legacy_cpu_device ) +static ADDRESS_MAP_START( e132_8k_iram_map, AS_PROGRAM, 32, hyperstone_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( e116_16k_iram_map, AS_PROGRAM, 16, legacy_cpu_device ) +static ADDRESS_MAP_START( e132_16k_iram_map, AS_PROGRAM, 32, hyperstone_device ) AM_RANGE(0xc0000000, 0xc0003fff) AM_RAM AM_MIRROR(0x1fffc000) ADDRESS_MAP_END +//------------------------------------------------- +// hyperstone_device - constructor +//------------------------------------------------- -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 - - -INLINE hyperstone_state *get_safe_token(device_t *device) +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)) +{ +} + + +//------------------------------------------------- +// 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)) { - 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(device)->token(); } /* Return the entry point for a determinated trap */ -static UINT32 get_trap_addr(hyperstone_state *cpustate, UINT8 trapno) +UINT32 hyperstone_device::get_trap_addr(UINT8 trapno) { UINT32 addr; - if( cpustate->trap_entry == 0xffffff00 ) /* @ MEM3 */ + if( m_trap_entry == 0xffffff00 ) /* @ MEM3 */ { addr = trapno * 4; } @@ -445,48 +454,48 @@ static UINT32 get_trap_addr(hyperstone_state *cpustate, UINT8 trapno) { addr = (63 - trapno) * 4; } - addr |= cpustate->trap_entry; + addr |= m_trap_entry; return addr; } /* Return the entry point for a determinated emulated code (the one for "extend" opcode is reserved) */ -static UINT32 get_emu_code_addr(hyperstone_state *cpustate, UINT8 num) /* num is OP */ +UINT32 hyperstone_device::get_emu_code_addr(UINT8 num) /* num is OP */ { UINT32 addr; - if( cpustate->trap_entry == 0xffffff00 ) /* @ MEM3 */ + if( m_trap_entry == 0xffffff00 ) /* @ MEM3 */ { - addr = (cpustate->trap_entry - 0x100) | ((num & 0xf) << 4); + addr = (m_trap_entry - 0x100) | ((num & 0xf) << 4); } else { - addr = cpustate->trap_entry | (0x10c | ((0xcf - num) << 4)); + addr = m_trap_entry | (0x10c | ((0xcf - num) << 4)); } return addr; } -static void hyperstone_set_trap_entry(hyperstone_state *cpustate, int which) +void hyperstone_device::hyperstone_set_trap_entry(int which) { switch( which ) { case E132XS_ENTRY_MEM0: - cpustate->trap_entry = 0x00000000; + m_trap_entry = 0x00000000; break; case E132XS_ENTRY_MEM1: - cpustate->trap_entry = 0x40000000; + m_trap_entry = 0x40000000; break; case E132XS_ENTRY_MEM2: - cpustate->trap_entry = 0x80000000; + m_trap_entry = 0x80000000; break; case E132XS_ENTRY_MEM3: - cpustate->trap_entry = 0xffffff00; + m_trap_entry = 0xffffff00; break; case E132XS_ENTRY_IRAM: - cpustate->trap_entry = 0xc0000000; + m_trap_entry = 0xc0000000; break; default: @@ -495,23 +504,23 @@ static void hyperstone_set_trap_entry(hyperstone_state *cpustate, int which) } } -#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 +#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 // 03 - 15 General Purpose Registers // 16 - 17 Reserved -#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 +#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 // 28 - 31 Reserved /* SR flags */ @@ -571,92 +580,88 @@ static void hyperstone_set_trap_entry(hyperstone_state *cpustate, int which) //the user program can only changes the above 2 flags - - -static UINT32 compute_tr(hyperstone_state *cpustate) +UINT32 hyperstone_device::compute_tr() { - 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); + 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); } -static void update_timer_prescale(hyperstone_state *cpustate) +void hyperstone_device::update_timer_prescale() { - UINT32 prevtr = compute_tr(cpustate); + UINT32 prevtr = compute_tr(); TPR &= ~0x80000000; - 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(); + 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(); } -static void adjust_timer_interrupt(hyperstone_state *cpustate) +void hyperstone_device::adjust_timer_interrupt() { - 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); + 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); if (cycles_until_next_clock == 0) - cycles_until_next_clock = (UINT64)(1 << cpustate->clock_scale); + cycles_until_next_clock = (UINT64)(1 << m_clock_scale); /* special case: if we have a change pending, set a timer to fire then */ if (TPR & 0x80000000) { - 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); + 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); } /* else if the timer interrupt is enabled, configure it to fire at the appropriate time */ else if (!(FCR & 0x00800000)) { - UINT32 curtr = cpustate->tr_base_value + (clocks_since_base / cpustate->tr_clocks_per_tick); + UINT32 curtr = m_tr_base_value + (clocks_since_base / m_tr_clocks_per_tick); UINT32 delta = TCR - curtr; if (delta > 0x80000000) { - if (!cpustate->timer_int_pending) - cpustate->timer->adjust(attotime::zero); + if (!m_timer_int_pending) + m_timer->adjust(attotime::zero); } else { - 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)); + 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)); } } /* otherwise, disable the timer */ else - cpustate->timer->adjust(attotime::never); + m_timer->adjust(attotime::never); } -static TIMER_CALLBACK( e132xs_timer_callback ) +TIMER_CALLBACK_MEMBER( hyperstone_device::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(cpustate); + update_timer_prescale(); /* see if the timer is right for firing */ - if (!((compute_tr(cpustate) - TCR) & 0x80000000)) - cpustate->timer_int_pending = 1; + if (!((compute_tr() - TCR) & 0x80000000)) + m_timer_int_pending = 1; /* adjust ourselves for the next time */ else - adjust_timer_interrupt(cpustate); + adjust_timer_interrupt(); } -static UINT32 get_global_register(hyperstone_state *cpustate, UINT8 code) +UINT32 hyperstone_device::get_global_register(UINT8 code) { /* if( code >= 16 ) @@ -693,14 +698,21 @@ static UINT32 get_global_register(hyperstone_state *cpustate, UINT8 code) if (code == TR_REGISTER) { /* it is common to poll this in a loop */ - if (cpustate->icount > cpustate->tr_clocks_per_tick / 2) - cpustate->icount -= cpustate->tr_clocks_per_tick / 2; - return compute_tr(cpustate); + if (m_icount > m_tr_clocks_per_tick / 2) + m_icount -= m_tr_clocks_per_tick / 2; + return compute_tr(); } - return cpustate->global_regs[code]; + return m_global_regs[code]; } -INLINE void set_global_register(hyperstone_state *cpustate, UINT8 code, UINT32 val) +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) { //TODO: add correct FER set instruction @@ -712,14 +724,14 @@ INLINE void set_global_register(hyperstone_state *cpustate, UINT8 code, UINT32 v { SET_LOW_SR(val); // only a RET instruction can change the full content of SR SR &= ~0x40; //reserved bit 6 always zero - if (cpustate->intblock < 1) - cpustate->intblock = 1; + if (m_intblock < 1) + m_intblock = 1; } else { - UINT32 oldval = cpustate->global_regs[code]; + UINT32 oldval = m_global_regs[code]; if( code != ISR_REGISTER ) - cpustate->global_regs[code] = val; + m_global_regs[code] = val; else DEBUG_PRINTF(("Written to ISR register. PC = %08X\n", PC)); @@ -765,54 +777,47 @@ INLINE void set_global_register(hyperstone_state *cpustate, UINT8 code, UINT32 v break; */ case TR_REGISTER: - cpustate->tr_base_value = val; - cpustate->tr_base_cycles = cpustate->device->total_cycles(); - adjust_timer_interrupt(cpustate); + m_tr_base_value = val; + m_tr_base_cycles = total_cycles(); + adjust_timer_interrupt(); break; case TPR_REGISTER: if (!(val & 0x80000000)) /* change immediately */ - update_timer_prescale(cpustate); - adjust_timer_interrupt(cpustate); + update_timer_prescale(); + adjust_timer_interrupt(); break; case TCR_REGISTER: if (oldval != val) { - adjust_timer_interrupt(cpustate); - if (cpustate->intblock < 1) - cpustate->intblock = 1; + adjust_timer_interrupt(); + if (m_intblock < 1) + m_intblock = 1; } break; case FCR_REGISTER: if ((oldval ^ val) & 0x00800000) - adjust_timer_interrupt(cpustate); - if (cpustate->intblock < 1) - cpustate->intblock = 1; + adjust_timer_interrupt(); + if (m_intblock < 1) + m_intblock = 1; break; case MCR_REGISTER: // bits 14..12 EntryTableMap - hyperstone_set_trap_entry(cpustate, (val & 0x7000) >> 12); + hyperstone_set_trap_entry((val & 0x7000) >> 12); break; } } } } -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 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) #define S_BIT ((OP & 0x100) >> 8) #define N_BIT S_BIT @@ -842,9 +847,9 @@ do \ UINT8 code = (decode)->src; \ (decode)->src_is_local = 1; \ code = ((decode)->src + GET_FP) % 64; /* registers offset by frame pointer */\ - SREG = cpustate->local_regs[code]; \ + SREG = m_local_regs[code]; \ code = ((decode)->src + 1 + GET_FP) % 64; \ - SREGF = cpustate->local_regs[code]; \ + SREGF = m_local_regs[code]; \ } \ else \ { \ @@ -852,17 +857,17 @@ do \ \ if (!hflag) \ { \ - SREG = get_global_register(cpustate, (decode)->src); \ + SREG = get_global_register((decode)->src); \ \ /* bound safe */ \ if ((decode)->src != 15) \ - SREGF = get_global_register(cpustate, (decode)->src + 1); \ + SREGF = get_global_register((decode)->src + 1); \ } \ else \ { \ (decode)->src += 16; \ \ - SREG = get_global_register(cpustate, (decode)->src); \ + SREG = get_global_register((decode)->src); \ if ((WRITE_ONLY_REGMASK >> (decode)->src) & 1) \ SREG = 0; /* write-only registers */ \ else if ((decode)->src == ISR_REGISTER) \ @@ -870,7 +875,7 @@ do \ \ /* bound safe */ \ if ((decode)->src != 31) \ - SREGF = get_global_register(cpustate, (decode)->src + 1); \ + SREGF = get_global_register((decode)->src + 1); \ } \ } \ } while (0) @@ -883,9 +888,9 @@ do \ UINT8 code = (decode)->dst; \ (decode)->dst_is_local = 1; \ code = ((decode)->dst + GET_FP) % 64; /* registers offset by frame pointer */\ - DREG = cpustate->local_regs[code]; \ + DREG = m_local_regs[code]; \ code = ((decode)->dst + 1 + GET_FP) % 64; \ - DREGF = cpustate->local_regs[code]; \ + DREGF = m_local_regs[code]; \ } \ else \ { \ @@ -893,23 +898,23 @@ do \ \ if (!hflag) \ { \ - DREG = get_global_register(cpustate, (decode)->dst); \ + DREG = get_global_register((decode)->dst); \ \ /* bound safe */ \ if ((decode)->dst != 15) \ - DREGF = get_global_register(cpustate, (decode)->dst + 1); \ + DREGF = get_global_register((decode)->dst + 1); \ } \ else \ { \ (decode)->dst += 16; \ \ - DREG = get_global_register(cpustate, (decode)->dst); \ + DREG = get_global_register((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(cpustate, (decode)->dst + 1); \ + DREGF = get_global_register((decode)->dst + 1); \ } \ } \ } while (0) @@ -974,10 +979,10 @@ do \ do \ { \ /* if PC is used in a delay instruction, the delayed PC should be used */ \ - if( cpustate->delay.delay_cmd == DELAY_EXECUTE ) \ + if( m_delay.delay_cmd == DELAY_EXECUTE ) \ { \ - PC = cpustate->delay.delay_pc; \ - cpustate->delay.delay_cmd = NO_DELAY; \ + PC = m_delay.delay_pc; \ + m_delay.delay_cmd = NO_DELAY; \ } \ } while (0) @@ -994,20 +999,20 @@ do \ break; \ \ case 1: \ - cpustate->instruction_length = 3; \ - EXTRA_U = (READ_OP(cpustate, PC) << 16) | READ_OP(cpustate, PC + 2);\ + m_instruction_length = 3; \ + EXTRA_U = (READ_OP(PC) << 16) | READ_OP(PC + 2); \ PC += 4; \ break; \ \ case 2: \ - cpustate->instruction_length = 2; \ - EXTRA_U = READ_OP(cpustate, PC); \ + m_instruction_length = 2; \ + EXTRA_U = READ_OP(PC); \ PC += 2; \ break; \ \ case 3: \ - cpustate->instruction_length = 2; \ - EXTRA_U = 0xffff0000 | READ_OP(cpustate, PC); \ + m_instruction_length = 2; \ + EXTRA_U = 0xffff0000 | READ_OP(PC); \ PC += 2; \ break; \ } \ @@ -1016,17 +1021,17 @@ do \ #define decode_const(decode) \ do \ { \ - UINT16 imm_1 = READ_OP(cpustate, PC); \ + UINT16 imm_1 = READ_OP(PC); \ \ PC += 2; \ - cpustate->instruction_length = 2; \ + m_instruction_length = 2; \ \ if( E_BIT(imm_1) ) \ { \ - UINT16 imm_2 = READ_OP(cpustate, PC); \ + UINT16 imm_2 = READ_OP(PC); \ \ PC += 2; \ - cpustate->instruction_length = 3; \ + m_instruction_length = 3; \ \ EXTRA_S = imm_2; \ EXTRA_S |= ((imm_1 & 0x3fff) << 16); \ @@ -1052,10 +1057,10 @@ do \ { \ if( OP & 0x80 ) \ { \ - UINT16 next = READ_OP(cpustate, PC); \ + UINT16 next = READ_OP(PC); \ \ PC += 2; \ - cpustate->instruction_length = 2; \ + m_instruction_length = 2; \ \ EXTRA_S = (OP & 0x7f) << 16; \ EXTRA_S |= (next & 0xfffe); \ @@ -1075,19 +1080,19 @@ do \ #define decode_dis(decode) \ do \ { \ - UINT16 next_1 = READ_OP(cpustate, PC); \ + UINT16 next_1 = READ_OP(PC); \ \ PC += 2; \ - cpustate->instruction_length = 2; \ + m_instruction_length = 2; \ \ (decode)->sub_type = DD(next_1); \ \ if( E_BIT(next_1) ) \ { \ - UINT16 next_2 = READ_OP(cpustate, PC); \ + UINT16 next_2 = READ_OP(PC); \ \ PC += 2; \ - cpustate->instruction_length = 3; \ + m_instruction_length = 3; \ \ EXTRA_S = next_2; \ EXTRA_S |= ((next_1 & 0xfff) << 16); \ @@ -1111,17 +1116,17 @@ do \ #define decode_lim(decode) \ do \ { \ - UINT32 next = READ_OP(cpustate, PC); \ + UINT32 next = READ_OP(PC); \ PC += 2; \ - cpustate->instruction_length = 2; \ + m_instruction_length = 2; \ \ (decode)->sub_type = X_CODE(next); \ \ if( E_BIT(next) ) \ { \ - EXTRA_U = ((next & 0xfff) << 16) | READ_OP(cpustate, PC); \ + EXTRA_U = ((next & 0xfff) << 16) | READ_OP(PC); \ PC += 2; \ - cpustate->instruction_length = 3; \ + m_instruction_length = 3; \ } \ else \ { \ @@ -1218,8 +1223,8 @@ do \ #define LLextdecode(decode) \ do \ { \ - cpustate->instruction_length = 2; \ - EXTRA_U = READ_OP(cpustate, PC); \ + m_instruction_length = 2; \ + EXTRA_U = READ_OP(PC); \ PC += 2; \ check_delay_PC(); \ decode_LL(decode); \ @@ -1259,31 +1264,31 @@ do \ } while (0) -INLINE void execute_br(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::execute_br(struct hyperstone_device::regs_decode *decode) { PPC = PC; PC += EXTRA_S; SET_M(0); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void execute_dbr(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::execute_dbr(struct hyperstone_device::regs_decode *decode) { - cpustate->delay.delay_cmd = DELAY_EXECUTE; - cpustate->delay.delay_pc = PC + EXTRA_S; + m_delay.delay_cmd = DELAY_EXECUTE; + m_delay.delay_pc = PC + EXTRA_S; - cpustate->intblock = 3; + m_intblock = 3; } -static void execute_trap(hyperstone_state *cpustate, UINT32 addr) +void hyperstone_device::execute_trap(UINT32 addr) { UINT8 reg; UINT32 oldSR; reg = GET_FP + GET_FL; - SET_ILC(cpustate->instruction_length & 3); + SET_ILC(m_instruction_length & 3); oldSR = SR; @@ -1301,17 +1306,17 @@ static void execute_trap(hyperstone_state *cpustate, UINT32 addr) PPC = PC; PC = addr; - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -static void execute_int(hyperstone_state *cpustate, UINT32 addr) +void hyperstone_device::execute_int(UINT32 addr) { UINT8 reg; UINT32 oldSR; reg = GET_FP + GET_FL; - SET_ILC(cpustate->instruction_length & 3); + SET_ILC(m_instruction_length & 3); oldSR = SR; @@ -1330,17 +1335,17 @@ static void execute_int(hyperstone_state *cpustate, UINT32 addr) PPC = PC; PC = addr; - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } /* TODO: mask Parity Error and Extended Overflow exceptions */ -static void execute_exception(hyperstone_state *cpustate, UINT32 addr) +void hyperstone_device::execute_exception(UINT32 addr) { UINT8 reg; UINT32 oldSR; reg = GET_FP + GET_FL; - SET_ILC(cpustate->instruction_length & 3); + SET_ILC(m_instruction_length & 3); oldSR = SR; @@ -1359,10 +1364,10 @@ static void execute_exception(hyperstone_state *cpustate, UINT32 addr) PC = addr; DEBUG_PRINTF(("EXCEPTION! PPC = %08X PC = %08X\n",PPC-2,PC-2)); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -static void execute_software(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::execute_software(struct hyperstone_device::regs_decode *decode) { UINT8 reg; UINT32 oldSR; @@ -1371,7 +1376,7 @@ static void execute_software(hyperstone_state *cpustate, struct regs_decode *dec SET_ILC(1); - addr = get_emu_code_addr(cpustate, (OP & 0xff00) >> 8); + addr = get_emu_code_addr((OP & 0xff00) >> 8); reg = GET_FP + GET_FL; //since it's sure the register is in the register part of the stack, @@ -1419,252 +1424,352 @@ static void execute_software(hyperstone_state *cpustate, struct regs_decode *dec #define IO2_LINE_STATE ((ISR >> 5) & 1) #define IO3_LINE_STATE ((ISR >> 6) & 1) -static void check_interrupts(hyperstone_state *cpustate) +void hyperstone_device::check_interrupts() { /* Interrupt-Lock flag isn't set */ - if (GET_L || cpustate->intblock > 0) + if (GET_L || m_intblock > 0) return; /* quick exit if nothing */ - if (!cpustate->timer_int_pending && (ISR & 0x7f) == 0) + if (!m_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(cpustate, get_trap_addr(cpustate, TRAPNO_IO3)); - (*cpustate->irq_callback)(cpustate->device, IRQ_IO3); + execute_int(get_trap_addr(TRAPNO_IO3)); + standard_irq_callback(IRQ_IO3); return; } /* timer int might be priority 6 if FCR bits 20-21 == 3; FCR bit 23 inhibits interrupt */ - if (cpustate->timer_int_pending && (FCR & 0x00b00000) == 0x00300000) + if (m_timer_int_pending && (FCR & 0x00b00000) == 0x00300000) { - cpustate->timer_int_pending = 0; - execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_TIMER)); + m_timer_int_pending = 0; + execute_int(get_trap_addr(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(cpustate, get_trap_addr(cpustate, TRAPNO_INT1)); - (*cpustate->irq_callback)(cpustate->device, IRQ_INT1); + execute_int(get_trap_addr(TRAPNO_INT1)); + standard_irq_callback(IRQ_INT1); return; } /* timer int might be priority 8 if FCR bits 20-21 == 2; FCR bit 23 inhibits interrupt */ - if (cpustate->timer_int_pending && (FCR & 0x00b00000) == 0x00200000) + if (m_timer_int_pending && (FCR & 0x00b00000) == 0x00200000) { - cpustate->timer_int_pending = 0; - execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_TIMER)); + m_timer_int_pending = 0; + execute_int(get_trap_addr(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(cpustate, get_trap_addr(cpustate, TRAPNO_INT2)); - (*cpustate->irq_callback)(cpustate->device, IRQ_INT2); + execute_int(get_trap_addr(TRAPNO_INT2)); + standard_irq_callback(IRQ_INT2); return; } /* timer int might be priority 10 if FCR bits 20-21 == 1; FCR bit 23 inhibits interrupt */ - if (cpustate->timer_int_pending && (FCR & 0x00b00000) == 0x00100000) + if (m_timer_int_pending && (FCR & 0x00b00000) == 0x00100000) { - cpustate->timer_int_pending = 0; - execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_TIMER)); + m_timer_int_pending = 0; + execute_int(get_trap_addr(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(cpustate, get_trap_addr(cpustate, TRAPNO_INT3)); - (*cpustate->irq_callback)(cpustate->device, IRQ_INT3); + execute_int(get_trap_addr(TRAPNO_INT3)); + standard_irq_callback(IRQ_INT3); return; } /* timer int might be priority 12 if FCR bits 20-21 == 0; FCR bit 23 inhibits interrupt */ - if (cpustate->timer_int_pending && (FCR & 0x00b00000) == 0x00000000) + if (m_timer_int_pending && (FCR & 0x00b00000) == 0x00000000) { - cpustate->timer_int_pending = 0; - execute_int(cpustate, get_trap_addr(cpustate, TRAPNO_TIMER)); + m_timer_int_pending = 0; + execute_int(get_trap_addr(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(cpustate, get_trap_addr(cpustate, TRAPNO_INT4)); - (*cpustate->irq_callback)(cpustate->device, IRQ_INT4); + execute_int(get_trap_addr(TRAPNO_INT4)); + standard_irq_callback(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(cpustate, get_trap_addr(cpustate, TRAPNO_IO1)); - (*cpustate->irq_callback)(cpustate->device, IRQ_IO1); + execute_int(get_trap_addr(TRAPNO_IO1)); + standard_irq_callback(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(cpustate, get_trap_addr(cpustate, TRAPNO_IO2)); - (*cpustate->irq_callback)(cpustate->device, IRQ_IO2); + execute_int(get_trap_addr(TRAPNO_IO2)); + standard_irq_callback(IRQ_IO2); return; } } -static void set_irq_line(hyperstone_state *cpustate, int irqline, int state) +void hyperstone_device::device_start() { - if (state) - ISR |= 1 << irqline; - else - ISR &= ~(1 << irqline); + // Handled entirely by init() and derived classes } -static void hyperstone_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) +void hyperstone_device::init(int scale_mask) { - hyperstone_state *cpustate = get_safe_token(device); + m_program = &space(AS_PROGRAM); + m_direct = &m_program->direct(); + m_io = &space(AS_IO); - 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)); + m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hyperstone_device::timer_callback), this)); + m_clock_scale_mask = scale_mask; - 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; + // 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)); + + // set our instruction counter + m_icountptr = &m_icount; } -static void e116_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) +void e116t_device::device_start() { - hyperstone_state *cpustate = get_safe_token(device); - hyperstone_init(device, irqcallback, scale_mask); - cpustate->opcodexor = 0; + init(0); + m_opcodexor = 0; } -static CPU_INIT( e116t ) +void e116xt_device::device_start() { - e116_init(device, irqcallback, 0); + init(3); + m_opcodexor = 0; } -static CPU_INIT( e116xt ) +void e116xs_device::device_start() { - e116_init(device, irqcallback, 3); + init(7); + m_opcodexor = 0; } -static CPU_INIT( e116xs ) +void e116xsr_device::device_start() { - e116_init(device, irqcallback, 7); + init(7); + m_opcodexor = 0; } -static CPU_INIT( e116xsr ) +void gms30c2116_device::device_start() { - e116_init(device, irqcallback, 7); + init(0); + m_opcodexor = 0; } -static CPU_INIT( gms30c2116 ) +void gms30c2216_device::device_start() { - e116_init(device, irqcallback, 0); + init(0); + m_opcodexor = 0; } -static CPU_INIT( gms30c2216 ) +void e132n_device::device_start() { - e116_init(device, irqcallback, 0); + init(0); + m_opcodexor = WORD_XOR_BE(0); } -static void e132_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) +void e132t_device::device_start() { - hyperstone_state *cpustate = get_safe_token(device); - hyperstone_init(device, irqcallback, scale_mask); - cpustate->opcodexor = WORD_XOR_BE(0); + init(0); + m_opcodexor = WORD_XOR_BE(0); } -static CPU_INIT( e132n ) +void e132xn_device::device_start() { - e132_init(device, irqcallback, 0); + init(3); + m_opcodexor = WORD_XOR_BE(0); } -static CPU_INIT( e132t ) +void e132xt_device::device_start() { - e132_init(device, irqcallback, 0); + init(3); + m_opcodexor = WORD_XOR_BE(0); } -static CPU_INIT( e132xn ) +void e132xs_device::device_start() { - e132_init(device, irqcallback, 3); + init(7); + m_opcodexor = WORD_XOR_BE(0); } -static CPU_INIT( e132xt ) +void e132xsr_device::device_start() { - e132_init(device, irqcallback, 3); + init(7); + m_opcodexor = WORD_XOR_BE(0); } -static CPU_INIT( e132xs ) +void gms30c2132_device::device_start() { - e132_init(device, irqcallback, 7); + init(0); + m_opcodexor = WORD_XOR_BE(0); } -static CPU_INIT( e132xsr ) +void gms30c2232_device::device_start() { - e132_init(device, irqcallback, 7); + init(0); + m_opcodexor = WORD_XOR_BE(0); } -static CPU_INIT( gms30c2132 ) +void hyperstone_device::device_reset() { - e132_init(device, irqcallback, 0); -} - -static CPU_INIT( gms30c2232 ) -{ - e132_init(device, irqcallback, 0); -} - -static CPU_RESET( hyperstone ) -{ - hyperstone_state *cpustate = get_safe_token(device); - //TODO: Add different reset initializations for BCR, MCR, FCR, TPR - emu_timer *save_timer; - device_irq_acknowledge_callback save_irqcallback; - UINT32 save_opcodexor; + m_program = &space(AS_PROGRAM); + m_direct = &m_program->direct(); + m_io = &space(AS_IO); - 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; + m_tr_clocks_per_tick = 2; - cpustate->tr_clocks_per_tick = 2; + hyperstone_set_trap_entry(E132XS_ENTRY_MEM3); /* default entry point @ MEM3 */ - hyperstone_set_trap_entry(cpustate, E132XS_ENTRY_MEM3); /* default entry point @ MEM3 */ + set_global_register(BCR_REGISTER, ~0); + set_global_register(MCR_REGISTER, ~0); + set_global_register(FCR_REGISTER, ~0); + set_global_register(TPR_REGISTER, 0xc000000); - 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); + PC = get_trap_addr(TRAPNO_RESET); SET_FP(0); SET_FL(2); @@ -1677,49 +1782,130 @@ static CPU_RESET( hyperstone ) SET_L_REG(0, (PC & 0xfffffffe) | GET_S); SET_L_REG(1, SR); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -static CPU_EXIT( hyperstone ) +void hyperstone_device::device_stop() { // nothing to do } -static CPU_DISASSEMBLE( hyperstone ) + +//------------------------------------------------- +// 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 { - hyperstone_state *cpustate = get_safe_token(device); + 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 +{ + 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 ); return dasm_hyperstone( buffer, pc, oprom, GET_H, GET_FP ); } /* Opcodes */ -INLINE void hyperstone_chk(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_chk(struct hyperstone_device::regs_decode *decode) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); + UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); if( SRC_IS_SR ) { if( DREG == 0 ) - execute_exception(cpustate, addr); + execute_exception(addr); } else { if( SRC_IS_PC ) { if( DREG >= SREG ) - execute_exception(cpustate, addr); + execute_exception(addr); } else { if( DREG > SREG ) - execute_exception(cpustate, addr); + execute_exception(addr); } } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_movd(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *decode) { if( DST_IS_PC ) // Rd denotes PC { @@ -1740,15 +1926,15 @@ INLINE void hyperstone_movd(hyperstone_state *cpustate, struct regs_decode *deco SET_PC(SREG); SR = (SREGF & 0xffe00000) | ((SREG & 0x01) << 18 ) | (SREGF & 0x3ffff); - if (cpustate->intblock < 1) - cpustate->intblock = 1; + if (m_intblock < 1) + m_intblock = 1; - cpustate->instruction_length = 0; // undefined + m_instruction_length = 0; // undefined if( (!old_s && GET_S) || (!GET_S && !old_l && GET_L)) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_PRIVILEGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); + execute_exception(addr); } difference = GET_FP - ((SP & 0x1fc) >> 2); @@ -1764,7 +1950,7 @@ INLINE void hyperstone_movd(hyperstone_state *cpustate, struct regs_decode *deco do { SP -= 4; - SET_ABS_L_REG(((SP & 0xfc) >> 2), READ_W(cpustate, SP)); + SET_ABS_L_REG(((SP & 0xfc) >> 2), READ_W(SP)); difference++; } while(difference != 0); @@ -1772,7 +1958,7 @@ INLINE void hyperstone_movd(hyperstone_state *cpustate, struct regs_decode *deco } //TODO: no 1! - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } else if( SRC_IS_SR ) // Rd doesn't denote PC and Rs denotes SR { @@ -1781,7 +1967,7 @@ INLINE void hyperstone_movd(hyperstone_state *cpustate, struct regs_decode *deco SET_Z(1); SET_N(0); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } else // Rd doesn't denote PC and Rs doesn't denote SR { @@ -1794,11 +1980,11 @@ INLINE void hyperstone_movd(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( tmp == 0 ? 1 : 0 ); SET_N( SIGN_BIT(SREG) ); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } } -INLINE void hyperstone_divu(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_divu(struct hyperstone_device::regs_decode *decode) { if( SAME_SRC_DST || SAME_SRC_DSTF ) { @@ -1823,8 +2009,8 @@ INLINE void hyperstone_divu(hyperstone_state *cpustate, struct regs_decode *deco //N -> undefined UINT32 addr; SET_V(1); - addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } else { @@ -1844,10 +2030,10 @@ INLINE void hyperstone_divu(hyperstone_state *cpustate, struct regs_decode *deco } } - cpustate->icount -= 36 << cpustate->clock_scale; + m_icount -= 36 << m_clock_scale; } -INLINE void hyperstone_divs(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_divs(struct hyperstone_device::regs_decode *decode) { if( SAME_SRC_DST || SAME_SRC_DSTF ) { @@ -1872,8 +2058,8 @@ INLINE void hyperstone_divs(hyperstone_state *cpustate, struct regs_decode *deco //N -> undefined UINT32 addr; SET_V(1); - addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } else { @@ -1893,10 +2079,10 @@ INLINE void hyperstone_divs(hyperstone_state *cpustate, struct regs_decode *deco } } - cpustate->icount -= 36 << cpustate->clock_scale; + m_icount -= 36 << m_clock_scale; } -INLINE void hyperstone_xm(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_xm(struct hyperstone_device::regs_decode *decode) { if( SRC_IS_SR || DST_IS_SR || DST_IS_PC ) { @@ -1912,13 +2098,13 @@ INLINE void hyperstone_xm(hyperstone_state *cpustate, struct regs_decode *decode case 3: if( !SRC_IS_PC && (SREG > EXTRA_U) ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } else if( SRC_IS_PC && (SREG >= EXTRA_U) ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } else { @@ -1940,20 +2126,20 @@ INLINE void hyperstone_xm(hyperstone_state *cpustate, struct regs_decode *decode SET_DREG(SREG); } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_mask(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_mask(struct hyperstone_device::regs_decode *decode) { DREG = SREG & EXTRA_U; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_sum(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_sum(struct hyperstone_device::regs_decode *decode) { UINT64 tmp; @@ -1974,10 +2160,10 @@ INLINE void hyperstone_sum(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_sums(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_sums(struct hyperstone_device::regs_decode *decode) { INT32 res; INT64 tmp; @@ -1999,16 +2185,16 @@ INLINE void hyperstone_sums(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( res == 0 ? 1 : 0 ); SET_N( SIGN_BIT(res) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; if( GET_V && !SRC_IS_SR ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } } -INLINE void hyperstone_cmp(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_cmp(struct hyperstone_device::regs_decode *decode) { UINT64 tmp; @@ -2033,15 +2219,15 @@ INLINE void hyperstone_cmp(hyperstone_state *cpustate, struct regs_decode *decod else SET_C(0); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_mov(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_mov(struct hyperstone_device::regs_decode *decode) { if( !GET_S && decode->dst >= 16 ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_PRIVILEGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); + execute_exception(addr); } SET_DREG(SREG); @@ -2052,11 +2238,11 @@ INLINE void hyperstone_mov(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( SREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(SREG) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_add(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_add(struct hyperstone_device::regs_decode *decode) { UINT64 tmp; @@ -2076,10 +2262,10 @@ INLINE void hyperstone_add(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_adds(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_adds(struct hyperstone_device::regs_decode *decode) { INT32 res; INT64 tmp; @@ -2101,53 +2287,53 @@ INLINE void hyperstone_adds(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( res == 0 ? 1 : 0 ); SET_N( SIGN_BIT(res) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; if( GET_V ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } } -INLINE void hyperstone_cmpb(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_cmpb(struct hyperstone_device::regs_decode *decode) { SET_Z( (DREG & SREG) == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_andn(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_andn(struct hyperstone_device::regs_decode *decode) { DREG = DREG & ~SREG; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_or(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_or(struct hyperstone_device::regs_decode *decode) { DREG = DREG | SREG; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_xor(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_xor(struct hyperstone_device::regs_decode *decode) { DREG = DREG ^ SREG; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_subc(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_subc(struct hyperstone_device::regs_decode *decode) { UINT64 tmp; @@ -2180,18 +2366,18 @@ INLINE void hyperstone_subc(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( GET_Z & (DREG == 0 ? 1 : 0) ); SET_N( SIGN_BIT(DREG) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_not(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_not(struct hyperstone_device::regs_decode *decode) { SET_DREG(~SREG); SET_Z( ~SREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_sub(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_sub(struct hyperstone_device::regs_decode *decode) { UINT64 tmp; @@ -2211,10 +2397,10 @@ INLINE void hyperstone_sub(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_subs(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_subs(struct hyperstone_device::regs_decode *decode) { INT32 res; INT64 tmp; @@ -2237,16 +2423,16 @@ INLINE void hyperstone_subs(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( res == 0 ? 1 : 0 ); SET_N( SIGN_BIT(res) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; if( GET_V ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } } -INLINE void hyperstone_addc(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_addc(struct hyperstone_device::regs_decode *decode) { UINT64 tmp; @@ -2284,20 +2470,20 @@ INLINE void hyperstone_addc(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( GET_Z & (DREG == 0 ? 1 : 0) ); SET_N( SIGN_BIT(DREG) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_and(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_and(struct hyperstone_device::regs_decode *decode) { DREG = DREG & SREG; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_neg(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_neg(struct hyperstone_device::regs_decode *decode) { UINT64 tmp; @@ -2315,10 +2501,10 @@ INLINE void hyperstone_neg(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_negs(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_negs(struct hyperstone_device::regs_decode *decode) { INT32 res; INT64 tmp; @@ -2341,16 +2527,16 @@ INLINE void hyperstone_negs(hyperstone_state *cpustate, struct regs_decode *deco SET_N( SIGN_BIT(res) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; if( GET_V && !SRC_IS_SR ) //trap doesn't occur when source is SR { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } } -INLINE void hyperstone_cmpi(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_cmpi(struct hyperstone_device::regs_decode *decode) { UINT64 tmp; @@ -2372,15 +2558,15 @@ INLINE void hyperstone_cmpi(hyperstone_state *cpustate, struct regs_decode *deco else SET_C(0); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_movi(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_movi(struct hyperstone_device::regs_decode *decode) { if( !GET_S && decode->dst >= 16 ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_PRIVILEGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); + execute_exception(addr); } SET_DREG(EXTRA_U); @@ -2395,10 +2581,10 @@ INLINE void hyperstone_movi(hyperstone_state *cpustate, struct regs_decode *deco SET_V(0); // or V undefined ? #endif - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_addi(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_addi(struct hyperstone_device::regs_decode *decode) { UINT32 imm; UINT64 tmp; @@ -2422,10 +2608,10 @@ INLINE void hyperstone_addi(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( DREG == 0 ? 1 : 0 ); SET_N( SIGN_BIT(DREG) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_addsi(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_addsi(struct hyperstone_device::regs_decode *decode) { INT32 imm, res; INT64 tmp; @@ -2449,16 +2635,16 @@ INLINE void hyperstone_addsi(hyperstone_state *cpustate, struct regs_decode *dec SET_Z( res == 0 ? 1 : 0 ); SET_N( SIGN_BIT(res) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; if( GET_V ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_RANGE_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + execute_exception(addr); } } -INLINE void hyperstone_cmpbi(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_cmpbi(struct hyperstone_device::regs_decode *decode) { UINT32 imm; @@ -2484,10 +2670,10 @@ INLINE void hyperstone_cmpbi(hyperstone_state *cpustate, struct regs_decode *dec SET_Z(0); } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_andni(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_andni(struct hyperstone_device::regs_decode *decode) { UINT32 imm; @@ -2501,30 +2687,30 @@ INLINE void hyperstone_andni(hyperstone_state *cpustate, struct regs_decode *dec SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_ori(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_ori(struct hyperstone_device::regs_decode *decode) { DREG = DREG | EXTRA_U; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_xori(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_xori(struct hyperstone_device::regs_decode *decode) { DREG = DREG ^ EXTRA_U; SET_DREG(DREG); SET_Z( DREG == 0 ? 1 : 0 ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_shrdi(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_shrdi(struct hyperstone_device::regs_decode *decode) { UINT32 low_order, high_order; UINT64 val; @@ -2549,10 +2735,10 @@ INLINE void hyperstone_shrdi(hyperstone_state *cpustate, struct regs_decode *dec SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(high_order) ); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_shrd(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_shrd(struct hyperstone_device::regs_decode *decode) { UINT32 low_order, high_order; UINT64 val; @@ -2587,10 +2773,10 @@ INLINE void hyperstone_shrd(hyperstone_state *cpustate, struct regs_decode *deco SET_N( SIGN_BIT(high_order) ); } - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_shr(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_shr(struct hyperstone_device::regs_decode *decode) { UINT32 ret; UINT8 n; @@ -2609,10 +2795,10 @@ INLINE void hyperstone_shr(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( ret == 0 ? 1 : 0 ); SET_N( SIGN_BIT(ret) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_sardi(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_sardi(struct hyperstone_device::regs_decode *decode) { UINT32 low_order, high_order; UINT64 val; @@ -2649,10 +2835,10 @@ INLINE void hyperstone_sardi(hyperstone_state *cpustate, struct regs_decode *dec SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(high_order) ); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_sard(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_sard(struct hyperstone_device::regs_decode *decode) { UINT32 low_order, high_order; UINT64 val; @@ -2699,10 +2885,10 @@ INLINE void hyperstone_sard(hyperstone_state *cpustate, struct regs_decode *deco SET_N( SIGN_BIT(high_order) ); } - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_sar(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_sar(struct hyperstone_device::regs_decode *decode) { UINT32 ret; UINT8 n, sign_bit; @@ -2731,10 +2917,10 @@ INLINE void hyperstone_sar(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( ret == 0 ? 1 : 0 ); SET_N( SIGN_BIT(ret) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_shldi(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_shldi(struct hyperstone_device::regs_decode *decode) { UINT32 low_order, high_order, tmp; UINT64 val, mask; @@ -2764,10 +2950,10 @@ INLINE void hyperstone_shldi(hyperstone_state *cpustate, struct regs_decode *dec SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(high_order) ); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_shld(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_shld(struct hyperstone_device::regs_decode *decode) { UINT32 low_order, high_order, tmp, n; UINT64 val, mask; @@ -2808,10 +2994,10 @@ INLINE void hyperstone_shld(hyperstone_state *cpustate, struct regs_decode *deco SET_N( SIGN_BIT(high_order) ); } - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_shl(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_shl(struct hyperstone_device::regs_decode *decode) { UINT32 base, ret, n; UINT64 mask; @@ -2832,15 +3018,15 @@ INLINE void hyperstone_shl(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( ret == 0 ? 1 : 0 ); SET_N( SIGN_BIT(ret) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -static void reserved(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::reserved(struct hyperstone_device::regs_decode *decode) { DEBUG_PRINTF(("Executed Reserved opcode. PC = %08X OP = %04X\n", PC, OP)); } -INLINE void hyperstone_testlz(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_testlz(struct hyperstone_device::regs_decode *decode) { UINT8 zeros = 0; UINT32 mask; @@ -2858,10 +3044,10 @@ INLINE void hyperstone_testlz(hyperstone_state *cpustate, struct regs_decode *de SET_DREG(zeros); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_rol(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_rol(struct hyperstone_device::regs_decode *decode) { UINT32 val, base; UINT8 n; @@ -2894,11 +3080,11 @@ INLINE void hyperstone_rol(hyperstone_state *cpustate, struct regs_decode *decod SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(val) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } //TODO: add trap error -INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode *decode) { UINT32 load; @@ -2908,7 +3094,7 @@ INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *dec { case 0: // LDBS.A - load = READ_B(cpustate, EXTRA_S); + load = READ_B(EXTRA_S); load |= (load & 0x80) ? 0xffffff00 : 0; SET_SREG(load); @@ -2916,14 +3102,14 @@ INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *dec case 1: // LDBU.A - load = READ_B(cpustate, EXTRA_S); + load = READ_B(EXTRA_S); SET_SREG(load); break; case 2: - load = READ_HW(cpustate, EXTRA_S & ~1); + load = READ_HW(EXTRA_S & ~1); if( EXTRA_S & 1 ) // LDHS.A { @@ -2944,32 +3130,32 @@ INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *dec if( (EXTRA_S & 3) == 3 ) // LDD.IOA { - load = IO_READ_W(cpustate, EXTRA_S & ~3); + load = IO_READ_W(EXTRA_S & ~3); SET_SREG(load); - load = IO_READ_W(cpustate, (EXTRA_S & ~3) + 4); + load = IO_READ_W((EXTRA_S & ~3) + 4); SET_SREGF(load); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else if( (EXTRA_S & 3) == 2 ) // LDW.IOA { - load = IO_READ_W(cpustate, EXTRA_S & ~3); + load = IO_READ_W(EXTRA_S & ~3); SET_SREG(load); } else if( (EXTRA_S & 3) == 1 ) // LDD.A { - load = READ_W(cpustate, EXTRA_S & ~1); + load = READ_W(EXTRA_S & ~1); SET_SREG(load); - load = READ_W(cpustate, (EXTRA_S & ~1) + 4); + load = READ_W((EXTRA_S & ~1) + 4); SET_SREGF(load); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else // LDW.A { - load = READ_W(cpustate, EXTRA_S & ~1); + load = READ_W(EXTRA_S & ~1); SET_SREG(load); } @@ -2982,7 +3168,7 @@ INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *dec { case 0: // LDBS.D - load = READ_B(cpustate, DREG + EXTRA_S); + load = READ_B(DREG + EXTRA_S); load |= (load & 0x80) ? 0xffffff00 : 0; SET_SREG(load); @@ -2990,14 +3176,14 @@ INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *dec case 1: // LDBU.D - load = READ_B(cpustate, DREG + EXTRA_S); + load = READ_B(DREG + EXTRA_S); SET_SREG(load); break; case 2: - load = READ_HW(cpustate, DREG + (EXTRA_S & ~1)); + load = READ_HW(DREG + (EXTRA_S & ~1)); if( EXTRA_S & 1 ) // LDHS.D { @@ -3018,32 +3204,32 @@ INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *dec if( (EXTRA_S & 3) == 3 ) // LDD.IOD { - load = IO_READ_W(cpustate, DREG + (EXTRA_S & ~3)); + load = IO_READ_W(DREG + (EXTRA_S & ~3)); SET_SREG(load); - load = IO_READ_W(cpustate, DREG + (EXTRA_S & ~3) + 4); + load = IO_READ_W(DREG + (EXTRA_S & ~3) + 4); SET_SREGF(load); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else if( (EXTRA_S & 3) == 2 ) // LDW.IOD { - load = IO_READ_W(cpustate, DREG + (EXTRA_S & ~3)); + load = IO_READ_W(DREG + (EXTRA_S & ~3)); SET_SREG(load); } else if( (EXTRA_S & 3) == 1 ) // LDD.D { - load = READ_W(cpustate, DREG + (EXTRA_S & ~1)); + load = READ_W(DREG + (EXTRA_S & ~1)); SET_SREG(load); - load = READ_W(cpustate, DREG + (EXTRA_S & ~1) + 4); + load = READ_W(DREG + (EXTRA_S & ~1) + 4); SET_SREGF(load); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else // LDW.D { - load = READ_W(cpustate, DREG + (EXTRA_S & ~1)); + load = READ_W(DREG + (EXTRA_S & ~1)); SET_SREG(load); } @@ -3051,10 +3237,10 @@ INLINE void hyperstone_ldxx1(hyperstone_state *cpustate, struct regs_decode *dec } } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_ldxx2(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode *decode) { UINT32 load; @@ -3071,7 +3257,7 @@ INLINE void hyperstone_ldxx2(hyperstone_state *cpustate, struct regs_decode *dec if(SAME_SRC_DST) DEBUG_PRINTF(("LDBS.N denoted same regs @ %08X",PPC)); - load = READ_B(cpustate, DREG); + load = READ_B(DREG); load |= (load & 0x80) ? 0xffffff00 : 0; SET_SREG(load); @@ -3085,7 +3271,7 @@ INLINE void hyperstone_ldxx2(hyperstone_state *cpustate, struct regs_decode *dec if(SAME_SRC_DST) DEBUG_PRINTF(("LDBU.N denoted same regs @ %08X",PPC)); - load = READ_B(cpustate, DREG); + load = READ_B(DREG); SET_SREG(load); if(!SAME_SRC_DST) @@ -3095,7 +3281,7 @@ INLINE void hyperstone_ldxx2(hyperstone_state *cpustate, struct regs_decode *dec case 2: - load = READ_HW(cpustate, DREG); + load = READ_HW(DREG); if( EXTRA_S & 1 ) // LDHS.N { @@ -3126,14 +3312,14 @@ INLINE void hyperstone_ldxx2(hyperstone_state *cpustate, struct regs_decode *dec DEBUG_PRINTF(("LDW.S denoted same regs @ %08X",PPC)); if(DREG < SP) - SET_SREG(READ_W(cpustate, DREG)); + SET_SREG(READ_W(DREG)); else SET_SREG(GET_ABS_L_REG((DREG & 0xfc) >> 2)); if(!SAME_SRC_DST) SET_DREG(DREG + (EXTRA_S & ~3)); - cpustate->icount -= cpustate->clock_cycles_2; // extra cycles + m_icount -= m_clock_cycles_2; // extra cycles } else if( (EXTRA_S & 3) == 2 ) // Reserved { @@ -3144,23 +3330,23 @@ INLINE void hyperstone_ldxx2(hyperstone_state *cpustate, struct regs_decode *dec if(SAME_SRC_DST || SAME_SRCF_DST) DEBUG_PRINTF(("LDD.N denoted same regs @ %08X",PPC)); - load = READ_W(cpustate, DREG); + load = READ_W(DREG); SET_SREG(load); - load = READ_W(cpustate, DREG + 4); + load = READ_W(DREG + 4); SET_SREGF(load); if(!SAME_SRC_DST && !SAME_SRCF_DST) SET_DREG(DREG + (EXTRA_S & ~1)); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else // LDW.N { if(SAME_SRC_DST) DEBUG_PRINTF(("LDW.N denoted same regs @ %08X",PPC)); - load = READ_W(cpustate, DREG); + load = READ_W(DREG); SET_SREG(load); if(!SAME_SRC_DST) @@ -3171,11 +3357,11 @@ INLINE void hyperstone_ldxx2(hyperstone_state *cpustate, struct regs_decode *dec } } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } //TODO: add trap error -INLINE void hyperstone_stxx1(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_stxx1(struct hyperstone_device::regs_decode *decode) { if( SRC_IS_SR ) SREG = SREGF = 0; @@ -3187,19 +3373,19 @@ INLINE void hyperstone_stxx1(hyperstone_state *cpustate, struct regs_decode *dec case 0: // STBS.A /* TODO: missing trap on range error */ - WRITE_B(cpustate, EXTRA_S, SREG & 0xff); + WRITE_B(EXTRA_S, SREG & 0xff); break; case 1: // STBU.A - WRITE_B(cpustate, EXTRA_S, SREG & 0xff); + WRITE_B(EXTRA_S, SREG & 0xff); break; case 2: - WRITE_HW(cpustate, EXTRA_S & ~1, SREG & 0xffff); + WRITE_HW(EXTRA_S & ~1, SREG & 0xffff); /* if( EXTRA_S & 1 ) // STHS.A @@ -3218,25 +3404,25 @@ INLINE void hyperstone_stxx1(hyperstone_state *cpustate, struct regs_decode *dec if( (EXTRA_S & 3) == 3 ) // STD.IOA { - IO_WRITE_W(cpustate, EXTRA_S & ~3, SREG); - IO_WRITE_W(cpustate, (EXTRA_S & ~3) + 4, SREGF); + IO_WRITE_W(EXTRA_S & ~3, SREG); + IO_WRITE_W((EXTRA_S & ~3) + 4, SREGF); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else if( (EXTRA_S & 3) == 2 ) // STW.IOA { - IO_WRITE_W(cpustate, EXTRA_S & ~3, SREG); + IO_WRITE_W(EXTRA_S & ~3, SREG); } else if( (EXTRA_S & 3) == 1 ) // STD.A { - WRITE_W(cpustate, EXTRA_S & ~1, SREG); - WRITE_W(cpustate, (EXTRA_S & ~1) + 4, SREGF); + WRITE_W(EXTRA_S & ~1, SREG); + WRITE_W((EXTRA_S & ~1) + 4, SREGF); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else // STW.A { - WRITE_W(cpustate, EXTRA_S & ~1, SREG); + WRITE_W(EXTRA_S & ~1, SREG); } break; @@ -3249,19 +3435,19 @@ INLINE void hyperstone_stxx1(hyperstone_state *cpustate, struct regs_decode *dec case 0: // STBS.D /* TODO: missing trap on range error */ - WRITE_B(cpustate, DREG + EXTRA_S, SREG & 0xff); + WRITE_B(DREG + EXTRA_S, SREG & 0xff); break; case 1: // STBU.D - WRITE_B(cpustate, DREG + EXTRA_S, SREG & 0xff); + WRITE_B(DREG + EXTRA_S, SREG & 0xff); break; case 2: - WRITE_HW(cpustate, DREG + (EXTRA_S & ~1), SREG & 0xffff); + WRITE_HW(DREG + (EXTRA_S & ~1), SREG & 0xffff); /* if( EXTRA_S & 1 ) // STHS.D @@ -3280,35 +3466,35 @@ INLINE void hyperstone_stxx1(hyperstone_state *cpustate, struct regs_decode *dec if( (EXTRA_S & 3) == 3 ) // STD.IOD { - IO_WRITE_W(cpustate, DREG + (EXTRA_S & ~3), SREG); - IO_WRITE_W(cpustate, DREG + (EXTRA_S & ~3) + 4, SREGF); + IO_WRITE_W(DREG + (EXTRA_S & ~3), SREG); + IO_WRITE_W(DREG + (EXTRA_S & ~3) + 4, SREGF); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else if( (EXTRA_S & 3) == 2 ) // STW.IOD { - IO_WRITE_W(cpustate, DREG + (EXTRA_S & ~3), SREG); + IO_WRITE_W(DREG + (EXTRA_S & ~3), SREG); } else if( (EXTRA_S & 3) == 1 ) // STD.D { - WRITE_W(cpustate, DREG + (EXTRA_S & ~1), SREG); - WRITE_W(cpustate, DREG + (EXTRA_S & ~1) + 4, SREGF); + WRITE_W(DREG + (EXTRA_S & ~1), SREG); + WRITE_W(DREG + (EXTRA_S & ~1) + 4, SREGF); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else // STW.D { - WRITE_W(cpustate, DREG + (EXTRA_S & ~1), SREG); + WRITE_W(DREG + (EXTRA_S & ~1), SREG); } break; } } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_stxx2(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_stxx2(struct hyperstone_device::regs_decode *decode) { if( SRC_IS_SR ) SREG = SREGF = 0; @@ -3324,21 +3510,21 @@ INLINE void hyperstone_stxx2(hyperstone_state *cpustate, struct regs_decode *dec case 0: // STBS.N /* TODO: missing trap on range error */ - WRITE_B(cpustate, DREG, SREG & 0xff); + WRITE_B(DREG, SREG & 0xff); SET_DREG(DREG + EXTRA_S); break; case 1: // STBU.N - WRITE_B(cpustate, DREG, SREG & 0xff); + WRITE_B(DREG, SREG & 0xff); SET_DREG(DREG + EXTRA_S); break; case 2: - WRITE_HW(cpustate, DREG, SREG & 0xffff); + WRITE_HW(DREG, SREG & 0xffff); SET_DREG(DREG + (EXTRA_S & ~1)); /* @@ -3359,7 +3545,7 @@ INLINE void hyperstone_stxx2(hyperstone_state *cpustate, struct regs_decode *dec if( (EXTRA_S & 3) == 3 ) // STW.S { if(DREG < SP) - WRITE_W(cpustate, DREG, SREG); + WRITE_W(DREG, SREG); else { if(((DREG & 0xfc) >> 2) == ((decode->src + GET_FP) % 64) && S_BIT == LOCAL) @@ -3370,7 +3556,7 @@ INLINE void hyperstone_stxx2(hyperstone_state *cpustate, struct regs_decode *dec SET_DREG(DREG + (EXTRA_S & ~3)); - cpustate->icount -= cpustate->clock_cycles_2; // extra cycles + m_icount -= m_clock_cycles_2; // extra cycles } else if( (EXTRA_S & 3) == 2 ) // Reserved @@ -3379,19 +3565,19 @@ INLINE void hyperstone_stxx2(hyperstone_state *cpustate, struct regs_decode *dec } else if( (EXTRA_S & 3) == 1 ) // STD.N { - WRITE_W(cpustate, DREG, SREG); + WRITE_W(DREG, SREG); SET_DREG(DREG + (EXTRA_S & ~1)); if( SAME_SRCF_DST ) - WRITE_W(cpustate, DREG + 4, SREGF + (EXTRA_S & ~1)); // because DREG == SREGF and DREG has been incremented + WRITE_W(DREG + 4, SREGF + (EXTRA_S & ~1)); // because DREG == SREGF and DREG has been incremented else - WRITE_W(cpustate, DREG + 4, SREGF); + WRITE_W(DREG + 4, SREGF); - cpustate->icount -= cpustate->clock_cycles_1; // extra cycle + m_icount -= m_clock_cycles_1; // extra cycle } else // STW.N { - WRITE_W(cpustate, DREG, SREG); + WRITE_W(DREG, SREG); SET_DREG(DREG + (EXTRA_S & ~1)); } @@ -3399,10 +3585,10 @@ INLINE void hyperstone_stxx2(hyperstone_state *cpustate, struct regs_decode *dec } } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_shri(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_shri(struct hyperstone_device::regs_decode *decode) { UINT32 val; @@ -3419,10 +3605,10 @@ INLINE void hyperstone_shri(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(val) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_sari(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_sari(struct hyperstone_device::regs_decode *decode) { UINT32 val; UINT8 sign_bit; @@ -3450,10 +3636,10 @@ INLINE void hyperstone_sari(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( val == 0 ? 1 : 0 ); SET_N( SIGN_BIT(val) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_shli(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_shli(struct hyperstone_device::regs_decode *decode) { UINT32 val, val2; UINT64 mask; @@ -3473,10 +3659,10 @@ INLINE void hyperstone_shli(hyperstone_state *cpustate, struct regs_decode *deco SET_Z( val2 == 0 ? 1 : 0 ); SET_N( SIGN_BIT(val2) ); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_mulu(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_mulu(struct hyperstone_device::regs_decode *decode) { UINT32 low_order, high_order; UINT64 double_word; @@ -3501,12 +3687,12 @@ INLINE void hyperstone_mulu(hyperstone_state *cpustate, struct regs_decode *deco } if(SREG <= 0xffff && DREG <= 0xffff) - cpustate->icount -= cpustate->clock_cycles_4; + m_icount -= m_clock_cycles_4; else - cpustate->icount -= cpustate->clock_cycles_6; + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_muls(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_muls(struct hyperstone_device::regs_decode *decode) { UINT32 low_order, high_order; INT64 double_word; @@ -3530,12 +3716,12 @@ INLINE void hyperstone_muls(hyperstone_state *cpustate, struct regs_decode *deco } if((SREG >= 0xffff8000 && SREG <= 0x7fff) && (DREG >= 0xffff8000 && DREG <= 0x7fff)) - cpustate->icount -= cpustate->clock_cycles_4; + m_icount -= m_clock_cycles_4; else - cpustate->icount -= cpustate->clock_cycles_6; + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_set(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_set(struct hyperstone_device::regs_decode *decode) { int n = N_VALUE; @@ -3548,7 +3734,7 @@ INLINE void hyperstone_set(hyperstone_state *cpustate, struct regs_decode *decod //TODO: add fetch opcode when there's the pipeline //TODO: no 1! - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } else { @@ -3877,11 +4063,11 @@ INLINE void hyperstone_set(hyperstone_state *cpustate, struct regs_decode *decod break; } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } } -INLINE void hyperstone_mul(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_mul(struct hyperstone_device::regs_decode *decode) { UINT32 single_word; @@ -3901,96 +4087,96 @@ INLINE void hyperstone_mul(hyperstone_state *cpustate, struct regs_decode *decod } if((SREG >= 0xffff8000 && SREG <= 0x7fff) && (DREG >= 0xffff8000 && DREG <= 0x7fff)) - cpustate->icount -= 3 << cpustate->clock_scale; + m_icount -= 3 << m_clock_scale; else - cpustate->icount -= 5 << cpustate->clock_scale; + m_icount -= 5 << m_clock_scale; } -INLINE void hyperstone_fadd(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fadd(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_faddd(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_faddd(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fsub(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fsub(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fsubd(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fsubd(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fmul(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fmul(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fmuld(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fmuld(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fdiv(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fdiv(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fdivd(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fdivd(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fcmp(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fcmp(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fcmpd(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fcmpd(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fcmpu(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fcmpu(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fcmpud(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fcmpud(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fcvt(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fcvt(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_fcvtd(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_fcvtd(struct hyperstone_device::regs_decode *decode) { - execute_software(cpustate, decode); - cpustate->icount -= cpustate->clock_cycles_6; + execute_software(decode); + m_icount -= m_clock_cycles_6; } -INLINE void hyperstone_extend(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode *decode) { //TODO: add locks, overflow error and other things UINT32 vals, vald; @@ -4188,45 +4374,45 @@ INLINE void hyperstone_extend(hyperstone_state *cpustate, struct regs_decode *de break; } - cpustate->icount -= cpustate->clock_cycles_1; //TODO: with the latency it can change + m_icount -= m_clock_cycles_1; //TODO: with the latency it can change } -INLINE void hyperstone_do(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_do(struct hyperstone_device::regs_decode *decode) { fatalerror("Executed hyperstone_do instruction. PC = %08X\n", PPC); } -INLINE void hyperstone_ldwr(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_ldwr(struct hyperstone_device::regs_decode *decode) { - SET_SREG(READ_W(cpustate, DREG)); + SET_SREG(READ_W(DREG)); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_lddr(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_lddr(struct hyperstone_device::regs_decode *decode) { - SET_SREG(READ_W(cpustate, DREG)); - SET_SREGF(READ_W(cpustate, DREG + 4)); + SET_SREG(READ_W(DREG)); + SET_SREGF(READ_W(DREG + 4)); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_ldwp(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_ldwp(struct hyperstone_device::regs_decode *decode) { - SET_SREG(READ_W(cpustate, DREG)); + SET_SREG(READ_W(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); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_lddp(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_lddp(struct hyperstone_device::regs_decode *decode) { - SET_SREG(READ_W(cpustate, DREG)); - SET_SREGF(READ_W(cpustate, DREG + 4)); + SET_SREG(READ_W(DREG)); + SET_SREGF(READ_W(DREG + 4)); // post increment the destination register if it's different from the source one // and from the "next source" one @@ -4239,159 +4425,159 @@ INLINE void hyperstone_lddp(hyperstone_state *cpustate, struct regs_decode *deco DEBUG_PRINTF(("LDD.P denoted same regs @ %08X",PPC)); } - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_stwr(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_stwr(struct hyperstone_device::regs_decode *decode) { if( SRC_IS_SR ) SREG = 0; - WRITE_W(cpustate, DREG, SREG); + WRITE_W(DREG, SREG); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_stdr(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_stdr(struct hyperstone_device::regs_decode *decode) { if( SRC_IS_SR ) SREG = SREGF = 0; - WRITE_W(cpustate, DREG, SREG); - WRITE_W(cpustate, DREG + 4, SREGF); + WRITE_W(DREG, SREG); + WRITE_W(DREG + 4, SREGF); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_stwp(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_stwp(struct hyperstone_device::regs_decode *decode) { if( SRC_IS_SR ) SREG = 0; - WRITE_W(cpustate, DREG, SREG); + WRITE_W(DREG, SREG); SET_DREG(DREG + 4); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_stdp(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_stdp(struct hyperstone_device::regs_decode *decode) { if( SRC_IS_SR ) SREG = SREGF = 0; - WRITE_W(cpustate, DREG, SREG); + WRITE_W(DREG, SREG); SET_DREG(DREG + 8); if( SAME_SRCF_DST ) - WRITE_W(cpustate, DREG + 4, SREGF + 8); // because DREG == SREGF and DREG has been incremented + WRITE_W(DREG + 4, SREGF + 8); // because DREG == SREGF and DREG has been incremented else - WRITE_W(cpustate, DREG + 4, SREGF); + WRITE_W(DREG + 4, SREGF); - cpustate->icount -= cpustate->clock_cycles_2; + m_icount -= m_clock_cycles_2; } -INLINE void hyperstone_dbv(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_dbv(struct hyperstone_device::regs_decode *decode) { if( GET_V ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbnv(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_dbnv(struct hyperstone_device::regs_decode *decode) { if( !GET_V ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbe(hyperstone_state *cpustate, struct regs_decode *decode) //or DBZ +void hyperstone_device::hyperstone_dbe(struct hyperstone_device::regs_decode *decode) //or DBZ { if( GET_Z ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbne(hyperstone_state *cpustate, struct regs_decode *decode) //or DBNZ +void hyperstone_device::hyperstone_dbne(struct hyperstone_device::regs_decode *decode) //or DBNZ { if( !GET_Z ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbc(hyperstone_state *cpustate, struct regs_decode *decode) //or DBST +void hyperstone_device::hyperstone_dbc(struct hyperstone_device::regs_decode *decode) //or DBST { if( GET_C ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbnc(hyperstone_state *cpustate, struct regs_decode *decode) //or DBHE +void hyperstone_device::hyperstone_dbnc(struct hyperstone_device::regs_decode *decode) //or DBHE { if( !GET_C ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbse(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_dbse(struct hyperstone_device::regs_decode *decode) { if( GET_C || GET_Z ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbht(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_dbht(struct hyperstone_device::regs_decode *decode) { if( !GET_C && !GET_Z ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbn(hyperstone_state *cpustate, struct regs_decode *decode) //or DBLT +void hyperstone_device::hyperstone_dbn(struct hyperstone_device::regs_decode *decode) //or DBLT { if( GET_N ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbnn(hyperstone_state *cpustate, struct regs_decode *decode) //or DBGE +void hyperstone_device::hyperstone_dbnn(struct hyperstone_device::regs_decode *decode) //or DBGE { if( !GET_N ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dble(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_dble(struct hyperstone_device::regs_decode *decode) { if( GET_N || GET_Z ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbgt(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_dbgt(struct hyperstone_device::regs_decode *decode) { if( !GET_N && !GET_Z ) - execute_dbr(cpustate, decode); + execute_dbr(decode); - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_dbr(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_dbr(struct hyperstone_device::regs_decode *decode) { - execute_dbr(cpustate, decode); + execute_dbr(decode); } -INLINE void hyperstone_frame(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_frame(struct hyperstone_device::regs_decode *decode) { INT8 difference; // really it's 7 bits UINT8 realfp = GET_FP - SRC_CODE; @@ -4416,7 +4602,7 @@ INLINE void hyperstone_frame(hyperstone_state *cpustate, struct regs_decode *dec do { - WRITE_W(cpustate, SP, GET_ABS_L_REG((SP & 0xfc) >> 2)); + WRITE_W(SP, GET_ABS_L_REG((SP & 0xfc) >> 2)); SP += 4; difference++; @@ -4424,16 +4610,16 @@ INLINE void hyperstone_frame(hyperstone_state *cpustate, struct regs_decode *dec if( tmp_flag ) { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_FRAME_ERROR); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_FRAME_ERROR); + execute_exception(addr); } } //TODO: no 1! - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_call(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_call(struct hyperstone_device::regs_decode *decode) { if( SRC_IS_SR ) SREG = 0; @@ -4443,7 +4629,7 @@ INLINE void hyperstone_call(hyperstone_state *cpustate, struct regs_decode *deco EXTRA_S = (EXTRA_S & ~1) + SREG; - SET_ILC(cpustate->instruction_length & 3); + SET_ILC(m_instruction_length & 3); SET_DREG((PC & 0xfffffffe) | GET_S); SET_DREGF(SR); @@ -4456,993 +4642,306 @@ INLINE void hyperstone_call(hyperstone_state *cpustate, struct regs_decode *deco PPC = PC; PC = EXTRA_S; // const value - cpustate->intblock = 2; + m_intblock = 2; //TODO: add interrupt locks, errors, .... //TODO: no 1! - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bv(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_bv(struct hyperstone_device::regs_decode *decode) { if( GET_V ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bnv(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_bnv(struct hyperstone_device::regs_decode *decode) { if( !GET_V ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_be(hyperstone_state *cpustate, struct regs_decode *decode) //or BZ +void hyperstone_device::hyperstone_be(struct hyperstone_device::regs_decode *decode) //or BZ { if( GET_Z ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bne(hyperstone_state *cpustate, struct regs_decode *decode) //or BNZ +void hyperstone_device::hyperstone_bne(struct hyperstone_device::regs_decode *decode) //or BNZ { if( !GET_Z ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bc(hyperstone_state *cpustate, struct regs_decode *decode) //or BST +void hyperstone_device::hyperstone_bc(struct hyperstone_device::regs_decode *decode) //or BST { if( GET_C ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bnc(hyperstone_state *cpustate, struct regs_decode *decode) //or BHE +void hyperstone_device::hyperstone_bnc(struct hyperstone_device::regs_decode *decode) //or BHE { if( !GET_C ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bse(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_bse(struct hyperstone_device::regs_decode *decode) { if( GET_C || GET_Z ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bht(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_bht(struct hyperstone_device::regs_decode *decode) { if( !GET_C && !GET_Z ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bn(hyperstone_state *cpustate, struct regs_decode *decode) //or BLT +void hyperstone_device::hyperstone_bn(struct hyperstone_device::regs_decode *decode) //or BLT { if( GET_N ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bnn(hyperstone_state *cpustate, struct regs_decode *decode) //or BGE +void hyperstone_device::hyperstone_bnn(struct hyperstone_device::regs_decode *decode) //or BGE { if( !GET_N ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_ble(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_ble(struct hyperstone_device::regs_decode *decode) { if( GET_N || GET_Z ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_bgt(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_bgt(struct hyperstone_device::regs_decode *decode) { if( !GET_N && !GET_Z ) - execute_br(cpustate, decode); + execute_br(decode); else - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } -INLINE void hyperstone_br(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_br(struct hyperstone_device::regs_decode *decode) { - execute_br(cpustate, decode); + execute_br(decode); } -INLINE void hyperstone_trap(hyperstone_state *cpustate, struct regs_decode *decode) +void hyperstone_device::hyperstone_trap(struct hyperstone_device::regs_decode *decode) { UINT8 code, trapno; UINT32 addr; trapno = (OP & 0xfc) >> 2; - addr = get_trap_addr(cpustate, trapno); + addr = get_trap_addr(trapno); code = ((OP & 0x300) >> 6) | (OP & 0x03); switch( code ) { case TRAPLE: if( GET_N || GET_Z ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPGT: if( !GET_N && !GET_Z ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPLT: if( GET_N ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPGE: if( !GET_N ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPSE: if( GET_C || GET_Z ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPHT: if( !GET_C && !GET_Z ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPST: if( GET_C ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPHE: if( !GET_C ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPE: if( GET_Z ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPNE: if( !GET_Z ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAPV: if( GET_V ) - execute_trap(cpustate, addr); + execute_trap(addr); break; case TRAP: - execute_trap(cpustate, addr); + execute_trap(addr); break; } - cpustate->icount -= cpustate->clock_cycles_1; + m_icount -= m_clock_cycles_1; } #include "e132xsop.c" +//************************************************************************** +// CORE EXECUTION LOOP +//************************************************************************** -static CPU_EXECUTE( hyperstone ) +//------------------------------------------------- +// execute_min_cycles - return minimum number of +// cycles it takes for one instruction to execute +//------------------------------------------------- + +UINT32 hyperstone_device::execute_min_cycles() const { - hyperstone_state *cpustate = get_safe_token(device); + return 1; +} - if (cpustate->intblock < 0) - cpustate->intblock = 0; - check_interrupts(cpustate); + +//------------------------------------------------- +// execute_max_cycles - return maximum number of +// cycles it takes for one instruction to execute +//------------------------------------------------- + +UINT32 hyperstone_device::execute_max_cycles() const +{ + return 36; +} + + +//------------------------------------------------- +// execute_input_lines - return the number of +// input/interrupt lines +//------------------------------------------------- + +UINT32 hyperstone_device::execute_input_lines() const +{ + return 8; +} + + +void hyperstone_device::execute_set_input(int inputnum, int state) +{ + if (state) + ISR |= 1 << inputnum; + else + ISR &= ~(1 << inputnum); +} + + +//------------------------------------------------- +// execute_run - execute a timeslice's worth of +// opcodes +//------------------------------------------------- + +void hyperstone_device::execute_run() +{ + if (m_intblock < 0) + m_intblock = 0; + + check_interrupts(); do { UINT32 oldh = SR & 0x00000020; PPC = PC; /* copy PC to previous PC */ - debugger_instruction_hook(device, PC); + debugger_instruction_hook(this, PC); - OP = READ_OP(cpustate, PC); + OP = READ_OP(PC); PC += 2; - cpustate->instruction_length = 1; + m_instruction_length = 1; /* execute opcode */ - (*hyperstone_op[(OP & 0xff00) >> 8])(cpustate); + (this->*m_opcode[(OP & 0xff00) >> 8])(); /* clear the H state if it was previously set */ SR ^= oldh; - SET_ILC(cpustate->instruction_length & 3); + SET_ILC(m_instruction_length & 3); - if( GET_T && GET_P && cpustate->delay.delay_cmd == NO_DELAY ) /* Not in a Delayed Branch instructions */ + if( GET_T && GET_P && m_delay.delay_cmd == NO_DELAY ) /* Not in a Delayed Branch instructions */ { - UINT32 addr = get_trap_addr(cpustate, TRAPNO_TRACE_EXCEPTION); - execute_exception(cpustate, addr); + UINT32 addr = get_trap_addr(TRAPNO_TRACE_EXCEPTION); + execute_exception(addr); } - if (--cpustate->intblock == 0) - check_interrupts(cpustate); + if (--m_intblock == 0) + check_interrupts(); - } while( cpustate->icount > 0 ); + } while( m_icount > 0 ); } - -/************************************************************************** - * Generic set_info - **************************************************************************/ - -static CPU_SET_INFO( hyperstone ) -{ - 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; - } -} - - -CPU_GET_INFO( e116t ) -{ - 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; - - 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(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 ) -{ - 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; - - /* --- 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 ) -{ - 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) - { - - 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(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 ) -{ - 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(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) - { - - 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(e132xt); break; - - /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XT"); break; - - default: - CPU_GET_INFO_CALL(hyperstone); - } -} - -CPU_GET_INFO( e132xs ) -{ - 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(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); - } -} - -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); +const device_type E116T = &device_creator; +const device_type E116XT = &device_creator; +const device_type E116XS = &device_creator; +const device_type E116XSR = &device_creator; +const device_type E132N = &device_creator; +const device_type E132T = &device_creator; +const device_type E132XN = &device_creator; +const device_type E132XT = &device_creator; +const device_type E132XS = &device_creator; +const device_type E132XSR = &device_creator; +const device_type GMS30C2116 = &device_creator; +const device_type GMS30C2132 = &device_creator; +const device_type GMS30C2216 = &device_creator; +const device_type GMS30C2232 = &device_creator; diff --git a/src/emu/cpu/e132xs/e132xs.h b/src/emu/cpu/e132xs/e132xs.h index 04123db53a0..ccc4303cc7e 100644 --- a/src/emu/cpu/e132xs/e132xs.h +++ b/src/emu/cpu/e132xs/e132xs.h @@ -22,51 +22,10 @@ /* Functions */ -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); +/*************************************************************************** + COMPILE-TIME DEFINITIONS +***************************************************************************/ - -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 @@ -132,7 +91,7 @@ extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, u #define TRAPNO_RESET 62 // reserved if not mapped @ MEM3 #define TRAPNO_ERROR_ENTRY 63 // for instruction code of all ones -/* Traps code */ +/* Trap codes */ #define TRAPLE 4 #define TRAPGT 5 #define TRAPLT 6 @@ -153,4 +112,586 @@ extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, u #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 6b45d15edb3..585af997675 100644 --- a/src/emu/cpu/e132xs/e132xsop.c +++ b/src/emu/cpu/e132xs/e132xsop.c @@ -18,1908 +18,1907 @@ decode->same_srcf_dst = 0; \ -static void hyperstone_op00(hyperstone_state *cpustate) +void hyperstone_device::op00() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_chk(cpustate, decode); + hyperstone_chk(decode); } -static void hyperstone_op01(hyperstone_state *cpustate) +void hyperstone_device::op01() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_chk(cpustate, decode); + hyperstone_chk(decode); } -static void hyperstone_op02(hyperstone_state *cpustate) +void hyperstone_device::op02() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_chk(cpustate, decode); + hyperstone_chk(decode); } -static void hyperstone_op03(hyperstone_state *cpustate) +void hyperstone_device::op03() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_chk(cpustate, decode); + hyperstone_chk(decode); } -static void hyperstone_op04(hyperstone_state *cpustate) +void hyperstone_device::op04() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_movd(cpustate, decode); + hyperstone_movd(decode); } -static void hyperstone_op05(hyperstone_state *cpustate) +void hyperstone_device::op05() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_movd(cpustate, decode); + hyperstone_movd(decode); } -static void hyperstone_op06(hyperstone_state *cpustate) +void hyperstone_device::op06() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_movd(cpustate, decode); + hyperstone_movd(decode); } -static void hyperstone_op07(hyperstone_state *cpustate) +void hyperstone_device::op07() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_movd(cpustate, decode); + hyperstone_movd(decode); } -static void hyperstone_op08(hyperstone_state *cpustate) +void hyperstone_device::op08() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_divu(cpustate, decode); + hyperstone_divu(decode); } -static void hyperstone_op09(hyperstone_state *cpustate) +void hyperstone_device::op09() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_divu(cpustate, decode); + hyperstone_divu(decode); } -static void hyperstone_op0a(hyperstone_state *cpustate) +void hyperstone_device::op0a() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_divu(cpustate, decode); + hyperstone_divu(decode); } -static void hyperstone_op0b(hyperstone_state *cpustate) +void hyperstone_device::op0b() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_divu(cpustate, decode); + hyperstone_divu(decode); } -static void hyperstone_op0c(hyperstone_state *cpustate) +void hyperstone_device::op0c() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_divs(cpustate, decode); + hyperstone_divs(decode); } -static void hyperstone_op0d(hyperstone_state *cpustate) +void hyperstone_device::op0d() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_divs(cpustate, decode); + hyperstone_divs(decode); } -static void hyperstone_op0e(hyperstone_state *cpustate) +void hyperstone_device::op0e() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_divs(cpustate, decode); + hyperstone_divs(decode); } -static void hyperstone_op0f(hyperstone_state *cpustate) +void hyperstone_device::op0f() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_divs(cpustate, decode); + hyperstone_divs(decode); } -static void hyperstone_op10(hyperstone_state *cpustate) +void hyperstone_device::op10() { LOCAL_DECODE_INIT; RRlimdecode(decode, 0, 0); - hyperstone_xm(cpustate, decode); + hyperstone_xm(decode); } -static void hyperstone_op11(hyperstone_state *cpustate) +void hyperstone_device::op11() { LOCAL_DECODE_INIT; RRlimdecode(decode, 0, 1); - hyperstone_xm(cpustate, decode); + hyperstone_xm(decode); } -static void hyperstone_op12(hyperstone_state *cpustate) +void hyperstone_device::op12() { LOCAL_DECODE_INIT; RRlimdecode(decode, 1, 0); - hyperstone_xm(cpustate, decode); + hyperstone_xm(decode); } -static void hyperstone_op13(hyperstone_state *cpustate) +void hyperstone_device::op13() { LOCAL_DECODE_INIT; RRlimdecode(decode, 1, 1); - hyperstone_xm(cpustate, decode); + hyperstone_xm(decode); } -static void hyperstone_op14(hyperstone_state *cpustate) +void hyperstone_device::op14() { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 0); - hyperstone_mask(cpustate, decode); + hyperstone_mask(decode); } -static void hyperstone_op15(hyperstone_state *cpustate) +void hyperstone_device::op15() { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 1); - hyperstone_mask(cpustate, decode); + hyperstone_mask(decode); } -static void hyperstone_op16(hyperstone_state *cpustate) +void hyperstone_device::op16() { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 0); - hyperstone_mask(cpustate, decode); + hyperstone_mask(decode); } -static void hyperstone_op17(hyperstone_state *cpustate) +void hyperstone_device::op17() { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 1); - hyperstone_mask(cpustate, decode); + hyperstone_mask(decode); } -static void hyperstone_op18(hyperstone_state *cpustate) +void hyperstone_device::op18() { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 0); - hyperstone_sum(cpustate, decode); + hyperstone_sum(decode); } -static void hyperstone_op19(hyperstone_state *cpustate) +void hyperstone_device::op19() { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 1); - hyperstone_sum(cpustate, decode); + hyperstone_sum(decode); } -static void hyperstone_op1a(hyperstone_state *cpustate) +void hyperstone_device::op1a() { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 0); - hyperstone_sum(cpustate, decode); + hyperstone_sum(decode); } -static void hyperstone_op1b(hyperstone_state *cpustate) +void hyperstone_device::op1b() { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 1); - hyperstone_sum(cpustate, decode); + hyperstone_sum(decode); } -static void hyperstone_op1c(hyperstone_state *cpustate) +void hyperstone_device::op1c() { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 0); - hyperstone_sums(cpustate, decode); + hyperstone_sums(decode); } -static void hyperstone_op1d(hyperstone_state *cpustate) +void hyperstone_device::op1d() { LOCAL_DECODE_INIT; RRconstdecode(decode, 0, 1); - hyperstone_sums(cpustate, decode); + hyperstone_sums(decode); } -static void hyperstone_op1e(hyperstone_state *cpustate) +void hyperstone_device::op1e() { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 0); - hyperstone_sums(cpustate, decode); + hyperstone_sums(decode); } -static void hyperstone_op1f(hyperstone_state *cpustate) +void hyperstone_device::op1f() { LOCAL_DECODE_INIT; RRconstdecode(decode, 1, 1); - hyperstone_sums(cpustate, decode); + hyperstone_sums(decode); } -static void hyperstone_op20(hyperstone_state *cpustate) +void hyperstone_device::op20() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_cmp(cpustate, decode); + hyperstone_cmp(decode); } -static void hyperstone_op21(hyperstone_state *cpustate) +void hyperstone_device::op21() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_cmp(cpustate, decode); + hyperstone_cmp(decode); } -static void hyperstone_op22(hyperstone_state *cpustate) +void hyperstone_device::op22() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_cmp(cpustate, decode); + hyperstone_cmp(decode); } -static void hyperstone_op23(hyperstone_state *cpustate) +void hyperstone_device::op23() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_cmp(cpustate, decode); + hyperstone_cmp(decode); } -static void hyperstone_op24(hyperstone_state *cpustate) +void hyperstone_device::op24() { LOCAL_DECODE_INIT; RRdecodewithHflag(decode, 0, 0); - hyperstone_mov(cpustate, decode); + hyperstone_mov(decode); } -static void hyperstone_op25(hyperstone_state *cpustate) +void hyperstone_device::op25() { LOCAL_DECODE_INIT; RRdecodewithHflag(decode, 0, 1); - hyperstone_mov(cpustate, decode); + hyperstone_mov(decode); } -static void hyperstone_op26(hyperstone_state *cpustate) +void hyperstone_device::op26() { LOCAL_DECODE_INIT; RRdecodewithHflag(decode, 1, 0); - hyperstone_mov(cpustate, decode); + hyperstone_mov(decode); } -static void hyperstone_op27(hyperstone_state *cpustate) +void hyperstone_device::op27() { LOCAL_DECODE_INIT; RRdecodewithHflag(decode, 1, 1); - hyperstone_mov(cpustate, decode); + hyperstone_mov(decode); } -static void hyperstone_op28(hyperstone_state *cpustate) +void hyperstone_device::op28() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_add(cpustate, decode); + hyperstone_add(decode); } -static void hyperstone_op29(hyperstone_state *cpustate) +void hyperstone_device::op29() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_add(cpustate, decode); + hyperstone_add(decode); } -static void hyperstone_op2a(hyperstone_state *cpustate) +void hyperstone_device::op2a() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_add(cpustate, decode); + hyperstone_add(decode); } -static void hyperstone_op2b(hyperstone_state *cpustate) +void hyperstone_device::op2b() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_add(cpustate, decode); + hyperstone_add(decode); } -static void hyperstone_op2c(hyperstone_state *cpustate) +void hyperstone_device::op2c() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_adds(cpustate, decode); + hyperstone_adds(decode); } -static void hyperstone_op2d(hyperstone_state *cpustate) +void hyperstone_device::op2d() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_adds(cpustate, decode); + hyperstone_adds(decode); } -static void hyperstone_op2e(hyperstone_state *cpustate) +void hyperstone_device::op2e() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_adds(cpustate, decode); + hyperstone_adds(decode); } -static void hyperstone_op2f(hyperstone_state *cpustate) +void hyperstone_device::op2f() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_adds(cpustate, decode); + hyperstone_adds(decode); } -static void hyperstone_op30(hyperstone_state *cpustate) +void hyperstone_device::op30() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_cmpb(cpustate, decode); + hyperstone_cmpb(decode); } -static void hyperstone_op31(hyperstone_state *cpustate) +void hyperstone_device::op31() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_cmpb(cpustate, decode); + hyperstone_cmpb(decode); } -static void hyperstone_op32(hyperstone_state *cpustate) +void hyperstone_device::op32() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_cmpb(cpustate, decode); + hyperstone_cmpb(decode); } -static void hyperstone_op33(hyperstone_state *cpustate) +void hyperstone_device::op33() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_cmpb(cpustate, decode); + hyperstone_cmpb(decode); } -static void hyperstone_op34(hyperstone_state *cpustate) +void hyperstone_device::op34() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_andn(cpustate, decode); + hyperstone_andn(decode); } -static void hyperstone_op35(hyperstone_state *cpustate) +void hyperstone_device::op35() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_andn(cpustate, decode); + hyperstone_andn(decode); } -static void hyperstone_op36(hyperstone_state *cpustate) +void hyperstone_device::op36() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_andn(cpustate, decode); + hyperstone_andn(decode); } -static void hyperstone_op37(hyperstone_state *cpustate) +void hyperstone_device::op37() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_andn(cpustate, decode); + hyperstone_andn(decode); } -static void hyperstone_op38(hyperstone_state *cpustate) +void hyperstone_device::op38() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_or(cpustate, decode); + hyperstone_or(decode); } -static void hyperstone_op39(hyperstone_state *cpustate) +void hyperstone_device::op39() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_or(cpustate, decode); + hyperstone_or(decode); } -static void hyperstone_op3a(hyperstone_state *cpustate) +void hyperstone_device::op3a() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_or(cpustate, decode); + hyperstone_or(decode); } -static void hyperstone_op3b(hyperstone_state *cpustate) +void hyperstone_device::op3b() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_or(cpustate, decode); + hyperstone_or(decode); } -static void hyperstone_op3c(hyperstone_state *cpustate) +void hyperstone_device::op3c() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_xor(cpustate, decode); + hyperstone_xor(decode); } -static void hyperstone_op3d(hyperstone_state *cpustate) +void hyperstone_device::op3d() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_xor(cpustate, decode); + hyperstone_xor(decode); } -static void hyperstone_op3e(hyperstone_state *cpustate) +void hyperstone_device::op3e() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_xor(cpustate, decode); + hyperstone_xor(decode); } -static void hyperstone_op3f(hyperstone_state *cpustate) +void hyperstone_device::op3f() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_xor(cpustate, decode); + hyperstone_xor(decode); } -static void hyperstone_op40(hyperstone_state *cpustate) +void hyperstone_device::op40() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_subc(cpustate, decode); + hyperstone_subc(decode); } -static void hyperstone_op41(hyperstone_state *cpustate) +void hyperstone_device::op41() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_subc(cpustate, decode); + hyperstone_subc(decode); } -static void hyperstone_op42(hyperstone_state *cpustate) +void hyperstone_device::op42() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_subc(cpustate, decode); + hyperstone_subc(decode); } -static void hyperstone_op43(hyperstone_state *cpustate) +void hyperstone_device::op43() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_subc(cpustate, decode); + hyperstone_subc(decode); } -static void hyperstone_op44(hyperstone_state *cpustate) +void hyperstone_device::op44() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_not(cpustate, decode); + hyperstone_not(decode); } -static void hyperstone_op45(hyperstone_state *cpustate) +void hyperstone_device::op45() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_not(cpustate, decode); + hyperstone_not(decode); } -static void hyperstone_op46(hyperstone_state *cpustate) +void hyperstone_device::op46() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_not(cpustate, decode); + hyperstone_not(decode); } -static void hyperstone_op47(hyperstone_state *cpustate) +void hyperstone_device::op47() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_not(cpustate, decode); + hyperstone_not(decode); } -static void hyperstone_op48(hyperstone_state *cpustate) +void hyperstone_device::op48() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_sub(cpustate, decode); + hyperstone_sub(decode); } -static void hyperstone_op49(hyperstone_state *cpustate) +void hyperstone_device::op49() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_sub(cpustate, decode); + hyperstone_sub(decode); } -static void hyperstone_op4a(hyperstone_state *cpustate) +void hyperstone_device::op4a() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_sub(cpustate, decode); + hyperstone_sub(decode); } -static void hyperstone_op4b(hyperstone_state *cpustate) +void hyperstone_device::op4b() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_sub(cpustate, decode); + hyperstone_sub(decode); } -static void hyperstone_op4c(hyperstone_state *cpustate) +void hyperstone_device::op4c() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_subs(cpustate, decode); + hyperstone_subs(decode); } -static void hyperstone_op4d(hyperstone_state *cpustate) +void hyperstone_device::op4d() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_subs(cpustate, decode); + hyperstone_subs(decode); } -static void hyperstone_op4e(hyperstone_state *cpustate) +void hyperstone_device::op4e() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_subs(cpustate, decode); + hyperstone_subs(decode); } -static void hyperstone_op4f(hyperstone_state *cpustate) +void hyperstone_device::op4f() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_subs(cpustate, decode); + hyperstone_subs(decode); } -static void hyperstone_op50(hyperstone_state *cpustate) +void hyperstone_device::op50() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_addc(cpustate, decode); + hyperstone_addc(decode); } -static void hyperstone_op51(hyperstone_state *cpustate) +void hyperstone_device::op51() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_addc(cpustate, decode); + hyperstone_addc(decode); } -static void hyperstone_op52(hyperstone_state *cpustate) +void hyperstone_device::op52() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_addc(cpustate, decode); + hyperstone_addc(decode); } -static void hyperstone_op53(hyperstone_state *cpustate) +void hyperstone_device::op53() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_addc(cpustate, decode); + hyperstone_addc(decode); } -static void hyperstone_op54(hyperstone_state *cpustate) +void hyperstone_device::op54() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_and(cpustate, decode); + hyperstone_and(decode); } -static void hyperstone_op55(hyperstone_state *cpustate) +void hyperstone_device::op55() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_and(cpustate, decode); + hyperstone_and(decode); } -static void hyperstone_op56(hyperstone_state *cpustate) +void hyperstone_device::op56() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_and(cpustate, decode); + hyperstone_and(decode); } -static void hyperstone_op57(hyperstone_state *cpustate) +void hyperstone_device::op57() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_and(cpustate, decode); + hyperstone_and(decode); } -static void hyperstone_op58(hyperstone_state *cpustate) +void hyperstone_device::op58() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_neg(cpustate, decode); + hyperstone_neg(decode); } -static void hyperstone_op59(hyperstone_state *cpustate) +void hyperstone_device::op59() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_neg(cpustate, decode); + hyperstone_neg(decode); } -static void hyperstone_op5a(hyperstone_state *cpustate) +void hyperstone_device::op5a() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_neg(cpustate, decode); + hyperstone_neg(decode); } -static void hyperstone_op5b(hyperstone_state *cpustate) +void hyperstone_device::op5b() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_neg(cpustate, decode); + hyperstone_neg(decode); } -static void hyperstone_op5c(hyperstone_state *cpustate) +void hyperstone_device::op5c() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_negs(cpustate, decode); + hyperstone_negs(decode); } -static void hyperstone_op5d(hyperstone_state *cpustate) +void hyperstone_device::op5d() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_negs(cpustate, decode); + hyperstone_negs(decode); } -static void hyperstone_op5e(hyperstone_state *cpustate) +void hyperstone_device::op5e() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_negs(cpustate, decode); + hyperstone_negs(decode); } -static void hyperstone_op5f(hyperstone_state *cpustate) +void hyperstone_device::op5f() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_negs(cpustate, decode); + hyperstone_negs(decode); } -static void hyperstone_op60(hyperstone_state *cpustate) +void hyperstone_device::op60() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_cmpi(cpustate, decode); + hyperstone_cmpi(decode); } -static void hyperstone_op61(hyperstone_state *cpustate) +void hyperstone_device::op61() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_cmpi(cpustate, decode); + hyperstone_cmpi(decode); } -static void hyperstone_op62(hyperstone_state *cpustate) +void hyperstone_device::op62() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_cmpi(cpustate, decode); + hyperstone_cmpi(decode); } -static void hyperstone_op63(hyperstone_state *cpustate) +void hyperstone_device::op63() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_cmpi(cpustate, decode); + hyperstone_cmpi(decode); } -static void hyperstone_op64(hyperstone_state *cpustate) +void hyperstone_device::op64() { LOCAL_DECODE_INIT; RimmdecodewithHflag(decode, 0, 0); - hyperstone_movi(cpustate, decode); + hyperstone_movi(decode); } -static void hyperstone_op65(hyperstone_state *cpustate) +void hyperstone_device::op65() { LOCAL_DECODE_INIT; RimmdecodewithHflag(decode, 0, 1); - hyperstone_movi(cpustate, decode); + hyperstone_movi(decode); } -static void hyperstone_op66(hyperstone_state *cpustate) +void hyperstone_device::op66() { LOCAL_DECODE_INIT; RimmdecodewithHflag(decode, 1, 0); - hyperstone_movi(cpustate, decode); + hyperstone_movi(decode); } -static void hyperstone_op67(hyperstone_state *cpustate) +void hyperstone_device::op67() { LOCAL_DECODE_INIT; RimmdecodewithHflag(decode, 1, 1); - hyperstone_movi(cpustate, decode); + hyperstone_movi(decode); } -static void hyperstone_op68(hyperstone_state *cpustate) +void hyperstone_device::op68() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_addi(cpustate, decode); + hyperstone_addi(decode); } -static void hyperstone_op69(hyperstone_state *cpustate) +void hyperstone_device::op69() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_addi(cpustate, decode); + hyperstone_addi(decode); } -static void hyperstone_op6a(hyperstone_state *cpustate) +void hyperstone_device::op6a() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_addi(cpustate, decode); + hyperstone_addi(decode); } -static void hyperstone_op6b(hyperstone_state *cpustate) +void hyperstone_device::op6b() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_addi(cpustate, decode); + hyperstone_addi(decode); } -static void hyperstone_op6c(hyperstone_state *cpustate) +void hyperstone_device::op6c() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_addsi(cpustate, decode); + hyperstone_addsi(decode); } -static void hyperstone_op6d(hyperstone_state *cpustate) +void hyperstone_device::op6d() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_addsi(cpustate, decode); + hyperstone_addsi(decode); } -static void hyperstone_op6e(hyperstone_state *cpustate) +void hyperstone_device::op6e() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_addsi(cpustate, decode); + hyperstone_addsi(decode); } -static void hyperstone_op6f(hyperstone_state *cpustate) +void hyperstone_device::op6f() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_addsi(cpustate, decode); + hyperstone_addsi(decode); } -static void hyperstone_op70(hyperstone_state *cpustate) +void hyperstone_device::op70() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_cmpbi(cpustate, decode); + hyperstone_cmpbi(decode); } -static void hyperstone_op71(hyperstone_state *cpustate) +void hyperstone_device::op71() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_cmpbi(cpustate, decode); + hyperstone_cmpbi(decode); } -static void hyperstone_op72(hyperstone_state *cpustate) +void hyperstone_device::op72() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_cmpbi(cpustate, decode); + hyperstone_cmpbi(decode); } -static void hyperstone_op73(hyperstone_state *cpustate) +void hyperstone_device::op73() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_cmpbi(cpustate, decode); + hyperstone_cmpbi(decode); } -static void hyperstone_op74(hyperstone_state *cpustate) +void hyperstone_device::op74() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_andni(cpustate, decode); + hyperstone_andni(decode); } -static void hyperstone_op75(hyperstone_state *cpustate) +void hyperstone_device::op75() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_andni(cpustate, decode); + hyperstone_andni(decode); } -static void hyperstone_op76(hyperstone_state *cpustate) +void hyperstone_device::op76() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_andni(cpustate, decode); + hyperstone_andni(decode); } -static void hyperstone_op77(hyperstone_state *cpustate) +void hyperstone_device::op77() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_andni(cpustate, decode); + hyperstone_andni(decode); } -static void hyperstone_op78(hyperstone_state *cpustate) +void hyperstone_device::op78() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_ori(cpustate, decode); + hyperstone_ori(decode); } -static void hyperstone_op79(hyperstone_state *cpustate) +void hyperstone_device::op79() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_ori(cpustate, decode); + hyperstone_ori(decode); } -static void hyperstone_op7a(hyperstone_state *cpustate) +void hyperstone_device::op7a() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_ori(cpustate, decode); + hyperstone_ori(decode); } -static void hyperstone_op7b(hyperstone_state *cpustate) +void hyperstone_device::op7b() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_ori(cpustate, decode); + hyperstone_ori(decode); } -static void hyperstone_op7c(hyperstone_state *cpustate) +void hyperstone_device::op7c() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 0); - hyperstone_xori(cpustate, decode); + hyperstone_xori(decode); } -static void hyperstone_op7d(hyperstone_state *cpustate) +void hyperstone_device::op7d() { LOCAL_DECODE_INIT; Rimmdecode(decode, 0, 1); - hyperstone_xori(cpustate, decode); + hyperstone_xori(decode); } -static void hyperstone_op7e(hyperstone_state *cpustate) +void hyperstone_device::op7e() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 0); - hyperstone_xori(cpustate, decode); + hyperstone_xori(decode); } -static void hyperstone_op7f(hyperstone_state *cpustate) +void hyperstone_device::op7f() { LOCAL_DECODE_INIT; Rimmdecode(decode, 1, 1); - hyperstone_xori(cpustate, decode); + hyperstone_xori(decode); } -static void hyperstone_op80(hyperstone_state *cpustate) +void hyperstone_device::op80() { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_shrdi(cpustate, decode); + hyperstone_shrdi(decode); } -static void hyperstone_op81(hyperstone_state *cpustate) +void hyperstone_device::op81() { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_shrdi(cpustate, decode); + hyperstone_shrdi(decode); } -static void hyperstone_op82(hyperstone_state *cpustate) +void hyperstone_device::op82() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_shrd(cpustate, decode); + hyperstone_shrd(decode); } -static void hyperstone_op83(hyperstone_state *cpustate) +void hyperstone_device::op83() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_shr(cpustate, decode); + hyperstone_shr(decode); } -static void hyperstone_op84(hyperstone_state *cpustate) +void hyperstone_device::op84() { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_sardi(cpustate, decode); + hyperstone_sardi(decode); } -static void hyperstone_op85(hyperstone_state *cpustate) +void hyperstone_device::op85() { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_sardi(cpustate, decode); + hyperstone_sardi(decode); } -static void hyperstone_op86(hyperstone_state *cpustate) +void hyperstone_device::op86() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_sard(cpustate, decode); + hyperstone_sard(decode); } -static void hyperstone_op87(hyperstone_state *cpustate) +void hyperstone_device::op87() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_sar(cpustate, decode); + hyperstone_sar(decode); } -static void hyperstone_op88(hyperstone_state *cpustate) +void hyperstone_device::op88() { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_shldi(cpustate, decode); + hyperstone_shldi(decode); } -static void hyperstone_op89(hyperstone_state *cpustate) +void hyperstone_device::op89() { LOCAL_DECODE_INIT; Lndecode(decode); - hyperstone_shldi(cpustate, decode); + hyperstone_shldi(decode); } -static void hyperstone_op8a(hyperstone_state *cpustate) +void hyperstone_device::op8a() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_shld(cpustate, decode); + hyperstone_shld(decode); } -static void hyperstone_op8b(hyperstone_state *cpustate) +void hyperstone_device::op8b() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_shl(cpustate, decode); + hyperstone_shl(decode); } -static void hyperstone_op8c(hyperstone_state *cpustate) +void hyperstone_device::op8c() { LOCAL_DECODE_INIT; no_decode(decode); - reserved(cpustate, decode); + reserved(decode); } -static void hyperstone_op8d(hyperstone_state *cpustate) +void hyperstone_device::op8d() { LOCAL_DECODE_INIT; no_decode(decode); - reserved(cpustate, decode); + reserved(decode); } -static void hyperstone_op8e(hyperstone_state *cpustate) +void hyperstone_device::op8e() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_testlz(cpustate, decode); + hyperstone_testlz(decode); } -static void hyperstone_op8f(hyperstone_state *cpustate) +void hyperstone_device::op8f() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_rol(cpustate, decode); + hyperstone_rol(decode); } -static void hyperstone_op90(hyperstone_state *cpustate) +void hyperstone_device::op90() { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 0); - hyperstone_ldxx1(cpustate, decode); + hyperstone_ldxx1(decode); } -static void hyperstone_op91(hyperstone_state *cpustate) +void hyperstone_device::op91() { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 1); - hyperstone_ldxx1(cpustate, decode); + hyperstone_ldxx1(decode); } -static void hyperstone_op92(hyperstone_state *cpustate) +void hyperstone_device::op92() { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 0); - hyperstone_ldxx1(cpustate, decode); + hyperstone_ldxx1(decode); } -static void hyperstone_op93(hyperstone_state *cpustate) +void hyperstone_device::op93() { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 1); - hyperstone_ldxx1(cpustate, decode); + hyperstone_ldxx1(decode); } -static void hyperstone_op94(hyperstone_state *cpustate) +void hyperstone_device::op94() { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 0); - hyperstone_ldxx2(cpustate, decode); + hyperstone_ldxx2(decode); } -static void hyperstone_op95(hyperstone_state *cpustate) +void hyperstone_device::op95() { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 1); - hyperstone_ldxx2(cpustate, decode); + hyperstone_ldxx2(decode); } -static void hyperstone_op96(hyperstone_state *cpustate) +void hyperstone_device::op96() { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 0); - hyperstone_ldxx2(cpustate, decode); + hyperstone_ldxx2(decode); } -static void hyperstone_op97(hyperstone_state *cpustate) +void hyperstone_device::op97() { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 1); - hyperstone_ldxx2(cpustate, decode); + hyperstone_ldxx2(decode); } -static void hyperstone_op98(hyperstone_state *cpustate) +void hyperstone_device::op98() { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 0); - hyperstone_stxx1(cpustate, decode); + hyperstone_stxx1(decode); } -static void hyperstone_op99(hyperstone_state *cpustate) +void hyperstone_device::op99() { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 1); - hyperstone_stxx1(cpustate, decode); + hyperstone_stxx1(decode); } -static void hyperstone_op9a(hyperstone_state *cpustate) +void hyperstone_device::op9a() { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 0); - hyperstone_stxx1(cpustate, decode); + hyperstone_stxx1(decode); } -static void hyperstone_op9b(hyperstone_state *cpustate) +void hyperstone_device::op9b() { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 1); - hyperstone_stxx1(cpustate, decode); + hyperstone_stxx1(decode); } -static void hyperstone_op9c(hyperstone_state *cpustate) +void hyperstone_device::op9c() { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 0); - hyperstone_stxx2(cpustate, decode); + hyperstone_stxx2(decode); } -static void hyperstone_op9d(hyperstone_state *cpustate) +void hyperstone_device::op9d() { LOCAL_DECODE_INIT; RRdisdecode(decode, 0, 1); - hyperstone_stxx2(cpustate, decode); + hyperstone_stxx2(decode); } -static void hyperstone_op9e(hyperstone_state *cpustate) +void hyperstone_device::op9e() { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 0); - hyperstone_stxx2(cpustate, decode); + hyperstone_stxx2(decode); } -static void hyperstone_op9f(hyperstone_state *cpustate) +void hyperstone_device::op9f() { LOCAL_DECODE_INIT; RRdisdecode(decode, 1, 1); - hyperstone_stxx2(cpustate, decode); + hyperstone_stxx2(decode); } -static void hyperstone_opa0(hyperstone_state *cpustate) +void hyperstone_device::opa0() { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_shri(cpustate, decode); + hyperstone_shri(decode); } -static void hyperstone_opa1(hyperstone_state *cpustate) +void hyperstone_device::opa1() { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_shri(cpustate, decode); + hyperstone_shri(decode); } -static void hyperstone_opa2(hyperstone_state *cpustate) +void hyperstone_device::opa2() { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_shri(cpustate, decode); + hyperstone_shri(decode); } -static void hyperstone_opa3(hyperstone_state *cpustate) +void hyperstone_device::opa3() { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_shri(cpustate, decode); + hyperstone_shri(decode); } -static void hyperstone_opa4(hyperstone_state *cpustate) +void hyperstone_device::opa4() { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_sari(cpustate, decode); + hyperstone_sari(decode); } -static void hyperstone_opa5(hyperstone_state *cpustate) +void hyperstone_device::opa5() { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_sari(cpustate, decode); + hyperstone_sari(decode); } -static void hyperstone_opa6(hyperstone_state *cpustate) +void hyperstone_device::opa6() { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_sari(cpustate, decode); + hyperstone_sari(decode); } -static void hyperstone_opa7(hyperstone_state *cpustate) +void hyperstone_device::opa7() { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_sari(cpustate, decode); + hyperstone_sari(decode); } -static void hyperstone_opa8(hyperstone_state *cpustate) +void hyperstone_device::opa8() { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_shli(cpustate, decode); + hyperstone_shli(decode); } -static void hyperstone_opa9(hyperstone_state *cpustate) +void hyperstone_device::opa9() { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_shli(cpustate, decode); + hyperstone_shli(decode); } -static void hyperstone_opaa(hyperstone_state *cpustate) +void hyperstone_device::opaa() { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_shli(cpustate, decode); + hyperstone_shli(decode); } -static void hyperstone_opab(hyperstone_state *cpustate) +void hyperstone_device::opab() { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_shli(cpustate, decode); + hyperstone_shli(decode); } -static void hyperstone_opac(hyperstone_state *cpustate) +void hyperstone_device::opac() { LOCAL_DECODE_INIT; no_decode(decode); - reserved(cpustate, decode); + reserved(decode); } -static void hyperstone_opad(hyperstone_state *cpustate) +void hyperstone_device::opad() { LOCAL_DECODE_INIT; no_decode(decode); - reserved(cpustate, decode); + reserved(decode); } -static void hyperstone_opae(hyperstone_state *cpustate) +void hyperstone_device::opae() { LOCAL_DECODE_INIT; no_decode(decode); - reserved(cpustate, decode); + reserved(decode); } -static void hyperstone_opaf(hyperstone_state *cpustate) +void hyperstone_device::opaf() { LOCAL_DECODE_INIT; no_decode(decode); - reserved(cpustate, decode); + reserved(decode); } -static void hyperstone_opb0(hyperstone_state *cpustate) +void hyperstone_device::opb0() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_mulu(cpustate, decode); + hyperstone_mulu(decode); } -static void hyperstone_opb1(hyperstone_state *cpustate) +void hyperstone_device::opb1() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_mulu(cpustate, decode); + hyperstone_mulu(decode); } -static void hyperstone_opb2(hyperstone_state *cpustate) +void hyperstone_device::opb2() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_mulu(cpustate, decode); + hyperstone_mulu(decode); } -static void hyperstone_opb3(hyperstone_state *cpustate) +void hyperstone_device::opb3() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_mulu(cpustate, decode); + hyperstone_mulu(decode); } -static void hyperstone_opb4(hyperstone_state *cpustate) +void hyperstone_device::opb4() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_muls(cpustate, decode); + hyperstone_muls(decode); } -static void hyperstone_opb5(hyperstone_state *cpustate) +void hyperstone_device::opb5() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_muls(cpustate, decode); + hyperstone_muls(decode); } -static void hyperstone_opb6(hyperstone_state *cpustate) +void hyperstone_device::opb6() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_muls(cpustate, decode); + hyperstone_muls(decode); } -static void hyperstone_opb7(hyperstone_state *cpustate) +void hyperstone_device::opb7() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_muls(cpustate, decode); + hyperstone_muls(decode); } -static void hyperstone_opb8(hyperstone_state *cpustate) +void hyperstone_device::opb8() { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_set(cpustate, decode); + hyperstone_set(decode); } -static void hyperstone_opb9(hyperstone_state *cpustate) +void hyperstone_device::opb9() { LOCAL_DECODE_INIT; Rndecode(decode, 0); - hyperstone_set(cpustate, decode); + hyperstone_set(decode); } -static void hyperstone_opba(hyperstone_state *cpustate) +void hyperstone_device::opba() { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_set(cpustate, decode); + hyperstone_set(decode); } -static void hyperstone_opbb(hyperstone_state *cpustate) +void hyperstone_device::opbb() { LOCAL_DECODE_INIT; Rndecode(decode, 1); - hyperstone_set(cpustate, decode); + hyperstone_set(decode); } -static void hyperstone_opbc(hyperstone_state *cpustate) +void hyperstone_device::opbc() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 0); - hyperstone_mul(cpustate, decode); + hyperstone_mul(decode); } -static void hyperstone_opbd(hyperstone_state *cpustate) +void hyperstone_device::opbd() { LOCAL_DECODE_INIT; RRdecode(decode, 0, 1); - hyperstone_mul(cpustate, decode); + hyperstone_mul(decode); } -static void hyperstone_opbe(hyperstone_state *cpustate) +void hyperstone_device::opbe() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 0); - hyperstone_mul(cpustate, decode); + hyperstone_mul(decode); } -static void hyperstone_opbf(hyperstone_state *cpustate) +void hyperstone_device::opbf() { LOCAL_DECODE_INIT; RRdecode(decode, 1, 1); - hyperstone_mul(cpustate, decode); + hyperstone_mul(decode); } -static void hyperstone_opc0(hyperstone_state *cpustate) +void hyperstone_device::opc0() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fadd(cpustate, decode); + hyperstone_fadd(decode); } -static void hyperstone_opc1(hyperstone_state *cpustate) +void hyperstone_device::opc1() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_faddd(cpustate, decode); + hyperstone_faddd(decode); } -static void hyperstone_opc2(hyperstone_state *cpustate) +void hyperstone_device::opc2() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fsub(cpustate, decode); + hyperstone_fsub(decode); } -static void hyperstone_opc3(hyperstone_state *cpustate) +void hyperstone_device::opc3() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fsubd(cpustate, decode); + hyperstone_fsubd(decode); } -static void hyperstone_opc4(hyperstone_state *cpustate) +void hyperstone_device::opc4() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fmul(cpustate, decode); + hyperstone_fmul(decode); } -static void hyperstone_opc5(hyperstone_state *cpustate) +void hyperstone_device::opc5() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fmuld(cpustate, decode); + hyperstone_fmuld(decode); } -static void hyperstone_opc6(hyperstone_state *cpustate) +void hyperstone_device::opc6() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fdiv(cpustate, decode); + hyperstone_fdiv(decode); } -static void hyperstone_opc7(hyperstone_state *cpustate) +void hyperstone_device::opc7() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fdivd(cpustate, decode); + hyperstone_fdivd(decode); } -static void hyperstone_opc8(hyperstone_state *cpustate) +void hyperstone_device::opc8() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcmp(cpustate, decode); + hyperstone_fcmp(decode); } -static void hyperstone_opc9(hyperstone_state *cpustate) +void hyperstone_device::opc9() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcmpd(cpustate, decode); + hyperstone_fcmpd(decode); } -static void hyperstone_opca(hyperstone_state *cpustate) +void hyperstone_device::opca() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcmpu(cpustate, decode); + hyperstone_fcmpu(decode); } -static void hyperstone_opcb(hyperstone_state *cpustate) +void hyperstone_device::opcb() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcmpud(cpustate, decode); + hyperstone_fcmpud(decode); } -static void hyperstone_opcc(hyperstone_state *cpustate) +void hyperstone_device::opcc() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcvt(cpustate, decode); + hyperstone_fcvt(decode); } -static void hyperstone_opcd(hyperstone_state *cpustate) +void hyperstone_device::opcd() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_fcvtd(cpustate, decode); + hyperstone_fcvtd(decode); } -static void hyperstone_opce(hyperstone_state *cpustate) +void hyperstone_device::opce() { LOCAL_DECODE_INIT; LLextdecode(decode); - hyperstone_extend(cpustate, decode); + hyperstone_extend(decode); } -static void hyperstone_opcf(hyperstone_state *cpustate) +void hyperstone_device::opcf() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_do(cpustate, decode); + hyperstone_do(decode); } -static void hyperstone_opd0(hyperstone_state *cpustate) +void hyperstone_device::opd0() { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_ldwr(cpustate, decode); + hyperstone_ldwr(decode); } -static void hyperstone_opd1(hyperstone_state *cpustate) +void hyperstone_device::opd1() { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_ldwr(cpustate, decode); + hyperstone_ldwr(decode); } -static void hyperstone_opd2(hyperstone_state *cpustate) +void hyperstone_device::opd2() { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_lddr(cpustate, decode); + hyperstone_lddr(decode); } -static void hyperstone_opd3(hyperstone_state *cpustate) +void hyperstone_device::opd3() { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_lddr(cpustate, decode); + hyperstone_lddr(decode); } -static void hyperstone_opd4(hyperstone_state *cpustate) +void hyperstone_device::opd4() { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_ldwp(cpustate, decode); + hyperstone_ldwp(decode); } -static void hyperstone_opd5(hyperstone_state *cpustate) +void hyperstone_device::opd5() { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_ldwp(cpustate, decode); + hyperstone_ldwp(decode); } -static void hyperstone_opd6(hyperstone_state *cpustate) +void hyperstone_device::opd6() { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_lddp(cpustate, decode); + hyperstone_lddp(decode); } -static void hyperstone_opd7(hyperstone_state *cpustate) +void hyperstone_device::opd7() { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_lddp(cpustate, decode); + hyperstone_lddp(decode); } -static void hyperstone_opd8(hyperstone_state *cpustate) +void hyperstone_device::opd8() { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_stwr(cpustate, decode); + hyperstone_stwr(decode); } -static void hyperstone_opd9(hyperstone_state *cpustate) +void hyperstone_device::opd9() { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_stwr(cpustate, decode); + hyperstone_stwr(decode); } -static void hyperstone_opda(hyperstone_state *cpustate) +void hyperstone_device::opda() { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_stdr(cpustate, decode); + hyperstone_stdr(decode); } -static void hyperstone_opdb(hyperstone_state *cpustate) +void hyperstone_device::opdb() { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_stdr(cpustate, decode); + hyperstone_stdr(decode); } -static void hyperstone_opdc(hyperstone_state *cpustate) +void hyperstone_device::opdc() { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_stwp(cpustate, decode); + hyperstone_stwp(decode); } -static void hyperstone_opdd(hyperstone_state *cpustate) +void hyperstone_device::opdd() { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_stwp(cpustate, decode); + hyperstone_stwp(decode); } -static void hyperstone_opde(hyperstone_state *cpustate) +void hyperstone_device::opde() { LOCAL_DECODE_INIT; LRdecode(decode, 0); - hyperstone_stdp(cpustate, decode); + hyperstone_stdp(decode); } -static void hyperstone_opdf(hyperstone_state *cpustate) +void hyperstone_device::opdf() { LOCAL_DECODE_INIT; LRdecode(decode, 1); - hyperstone_stdp(cpustate, decode); + hyperstone_stdp(decode); } -static void hyperstone_ope0(hyperstone_state *cpustate) +void hyperstone_device::ope0() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbv(cpustate, decode); + hyperstone_dbv(decode); } -static void hyperstone_ope1(hyperstone_state *cpustate) +void hyperstone_device::ope1() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbnv(cpustate, decode); + hyperstone_dbnv(decode); } -static void hyperstone_ope2(hyperstone_state *cpustate) +void hyperstone_device::ope2() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbe(cpustate, decode); + hyperstone_dbe(decode); } -static void hyperstone_ope3(hyperstone_state *cpustate) +void hyperstone_device::ope3() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbne(cpustate, decode); + hyperstone_dbne(decode); } -static void hyperstone_ope4(hyperstone_state *cpustate) +void hyperstone_device::ope4() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbc(cpustate, decode); + hyperstone_dbc(decode); } -static void hyperstone_ope5(hyperstone_state *cpustate) +void hyperstone_device::ope5() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbnc(cpustate, decode); + hyperstone_dbnc(decode); } -static void hyperstone_ope6(hyperstone_state *cpustate) +void hyperstone_device::ope6() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbse(cpustate, decode); + hyperstone_dbse(decode); } -static void hyperstone_ope7(hyperstone_state *cpustate) +void hyperstone_device::ope7() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbht(cpustate, decode); + hyperstone_dbht(decode); } -static void hyperstone_ope8(hyperstone_state *cpustate) +void hyperstone_device::ope8() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbn(cpustate, decode); + hyperstone_dbn(decode); } -static void hyperstone_ope9(hyperstone_state *cpustate) +void hyperstone_device::ope9() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbnn(cpustate, decode); + hyperstone_dbnn(decode); } -static void hyperstone_opea(hyperstone_state *cpustate) +void hyperstone_device::opea() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dble(cpustate, decode); + hyperstone_dble(decode); } -static void hyperstone_opeb(hyperstone_state *cpustate) +void hyperstone_device::opeb() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbgt(cpustate, decode); + hyperstone_dbgt(decode); } -static void hyperstone_opec(hyperstone_state *cpustate) +void hyperstone_device::opec() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_dbr(cpustate, decode); + hyperstone_dbr(decode); } -static void hyperstone_oped(hyperstone_state *cpustate) +void hyperstone_device::oped() { LOCAL_DECODE_INIT; LLdecode(decode); - hyperstone_frame(cpustate, decode); + hyperstone_frame(decode); } -static void hyperstone_opee(hyperstone_state *cpustate) +void hyperstone_device::opee() { LOCAL_DECODE_INIT; LRconstdecode(decode, 0); - hyperstone_call(cpustate, decode); + hyperstone_call(decode); } -static void hyperstone_opef(hyperstone_state *cpustate) +void hyperstone_device::opef() { LOCAL_DECODE_INIT; LRconstdecode(decode, 1); - hyperstone_call(cpustate, decode); + hyperstone_call(decode); } -static void hyperstone_opf0(hyperstone_state *cpustate) +void hyperstone_device::opf0() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bv(cpustate, decode); + hyperstone_bv(decode); } -static void hyperstone_opf1(hyperstone_state *cpustate) +void hyperstone_device::opf1() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bnv(cpustate, decode); + hyperstone_bnv(decode); } -static void hyperstone_opf2(hyperstone_state *cpustate) +void hyperstone_device::opf2() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_be(cpustate, decode); + hyperstone_be(decode); } -static void hyperstone_opf3(hyperstone_state *cpustate) +void hyperstone_device::opf3() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bne(cpustate, decode); + hyperstone_bne(decode); } -static void hyperstone_opf4(hyperstone_state *cpustate) +void hyperstone_device::opf4() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bc(cpustate, decode); + hyperstone_bc(decode); } -static void hyperstone_opf5(hyperstone_state *cpustate) +void hyperstone_device::opf5() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bnc(cpustate, decode); + hyperstone_bnc(decode); } -static void hyperstone_opf6(hyperstone_state *cpustate) +void hyperstone_device::opf6() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bse(cpustate, decode); + hyperstone_bse(decode); } -static void hyperstone_opf7(hyperstone_state *cpustate) +void hyperstone_device::opf7() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bht(cpustate, decode); + hyperstone_bht(decode); } -static void hyperstone_opf8(hyperstone_state *cpustate) +void hyperstone_device::opf8() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bn(cpustate, decode); + hyperstone_bn(decode); } -static void hyperstone_opf9(hyperstone_state *cpustate) +void hyperstone_device::opf9() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bnn(cpustate, decode); + hyperstone_bnn(decode); } -static void hyperstone_opfa(hyperstone_state *cpustate) +void hyperstone_device::opfa() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_ble(cpustate, decode); + hyperstone_ble(decode); } -static void hyperstone_opfb(hyperstone_state *cpustate) +void hyperstone_device::opfb() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_bgt(cpustate, decode); + hyperstone_bgt(decode); } -static void hyperstone_opfc(hyperstone_state *cpustate) +void hyperstone_device::opfc() { LOCAL_DECODE_INIT; PCreldecode(decode); - hyperstone_br(cpustate, decode); + hyperstone_br(decode); } -static void hyperstone_opfd(hyperstone_state *cpustate) +void hyperstone_device::opfd() { LOCAL_DECODE_INIT; PCadrdecode(decode); - hyperstone_trap(cpustate, decode); + hyperstone_trap(decode); } -static void hyperstone_opfe(hyperstone_state *cpustate) +void hyperstone_device::opfe() { LOCAL_DECODE_INIT; PCadrdecode(decode); - hyperstone_trap(cpustate, decode); + hyperstone_trap(decode); } -static void hyperstone_opff(hyperstone_state *cpustate) +void hyperstone_device::opff() { LOCAL_DECODE_INIT; PCadrdecode(decode); - hyperstone_trap(cpustate, decode); + hyperstone_trap(decode); } - -static void (*const hyperstone_op[0x100])(hyperstone_state *cpustate) = +const hyperstone_device::ophandler hyperstone_device::s_opcodetable[256] = { - 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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 + &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 };