summaryrefslogblamecommitdiffstatshomepage
path: root/src/mame/includes/apple2gs.h
blob: 76252a8459d8506945692b9cead705511c3441b4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                            







                                                                              

                                
 

                         


                            
                              
                             
                           
 
                                  


                             

                                          
                                                             



                                      


                                            
 


                                          











                                            

  
                  
 




                                
  
 
                        





                               
  

 
               



                           
  
 







                                

                                 

                                                                      



                                          
                                                                                        

                                                   
                                          
                                    
                                    



                                                   
                                                   
                                           
                   
 
                                                 
                                                
                                                    
                                             




                                                    
                                                  
 














                                             



                                    



                                
                                         
                                 
                                           
                                  
                          
                               










                                        

                                   
              
                              

                                
                                                   
                       

                                 
                        

                                    
 







                                             
 

                                    
 
                                          
 


                                                   


                                        
                                       

                                              
                                                                                                                


                                                      


                                               
                                                   
 
                                    
                         
                                                        
                                                                                         
 



                                                            









                                               
                             









                                                                    
                              



                                                      
                               
                                                
                                


                                                                                   
                                     
 





                                                  



                                                   





                                                    
                                                   

                                                     
 

                                                
                                            
                                           
  
 
                                  
// license:BSD-3-Clause
// copyright-holders:Nathan Woods,R. Belmont
/*****************************************************************************
 *
 * includes/apple2gs.h
 *
 * Apple IIgs
 *
 ****************************************************************************/

#ifndef MAME_INCLUDES_APPLE2GS_H
#define MAME_INCLUDES_APPLE2GS_H

#define RUN_ADB_MICRO (0)

#include "includes/apple2.h"
#include "sound/es5503.h"
#include "machine/nvram.h"
#include "cpu/g65816/g65816.h"
#include "cpu/m6502/m5074x.h"
#include "machine/z80scc.h"

#define ADBMICRO_TAG    "adbmicro"
#define SCC_TAG     "scc"
#define RS232A_TAG  "printer"
#define RS232B_TAG  "modem"

// IIgs clocks as marked on the schematics
#define APPLE2GS_28M  (XTAL(28'636'363)) // IIGS master clock
#define APPLE2GS_14M  (APPLE2GS_28M/2)
#define APPLE2GS_7M   (APPLE2GS_28M/4)

// screen dimensions
#define BORDER_LEFT (32)
#define BORDER_RIGHT    (32)
#define BORDER_TOP  (16)    // (plus bottom)

// these are numbered as seen from the MCU
enum glu_reg_names
{
	GLU_KEY_DATA = 0,   // MCU W
	GLU_COMMAND,        // MCU R
	GLU_MOUSEX,         // MCU W
	GLU_MOUSEY,         // MCU W
	GLU_KG_STATUS,      // MCU R
	GLU_ANY_KEY_DOWN,   // MCU W
	GLU_KEYMOD,         // MCU W
	GLU_DATA,           // MCU W

	GLU_C000,       // 816 R
	GLU_C010,       // 816 RW
	GLU_SYSSTAT     // 816 R/(limited) W
};

enum glu_kg_status
{
	KGS_ANY_KEY_DOWN = 0x01,
	KGS_KEYSTROBE    = 0x10,
	KGS_DATA_FULL    = 0x20,
	KGS_COMMAND_FULL = 0x40,
	KGS_MOUSEX_FULL  = 0x80
};

enum apple2gs_clock_mode
{
	CLOCKMODE_IDLE,
	CLOCKMODE_TIME,
	CLOCKMODE_INTERNALREGS,
	CLOCKMODE_BRAM1,
	CLOCKMODE_BRAM2
};


enum adbstate_t
{
	ADBSTATE_IDLE,
	ADBSTATE_INCOMMAND,
	ADBSTATE_INRESPONSE
};

#define IRQ_KBD_SRQ         0x01
#define IRQ_ADB_DATA        0x02
#define IRQ_ADB_MOUSE       0x04
#define IRQ_VGC_SCANLINE    0x08
#define IRQ_VGC_SECOND      0x10
#define IRQ_INTEN_QSECOND   0x20
#define IRQ_INTEN_VBL       0x40
#define IRQ_DOC             0x80
#define IRQ_SLOT            0x100

void apple2gs_add_irq(running_machine &machine, uint16_t irq_mask);
void apple2gs_remove_irq(running_machine &machine, uint16_t irq_mask);

class apple2gs_state : public apple2_state
{
public:
	apple2gs_state(const machine_config &mconfig, device_type type, const char *tag)
		: apple2_state(mconfig, type, tag),
		m_maincpu(*this, "maincpu"),
		m_es5503(*this, "es5503"),
		m_fdc(*this, "fdc"),
		m_scc(*this, "scc"),
		#if RUN_ADB_MICRO
		m_adbmicro(*this, ADBMICRO_TAG),
		#endif
		m_adb_mousex(*this, "adb_mouse_x"),
		m_adb_mousey(*this, "adb_mouse_y"),
		m_palette(*this, "palette")
		{ }

	required_device<g65816_device> m_maincpu;
	required_device<es5503_device> m_es5503;
	required_device<applefdc_base_device> m_fdc;
	required_device<z80scc_device> m_scc;
	#if RUN_ADB_MICRO
	optional_device<m5074x_device> m_adbmicro;
	#endif

	required_ioport  m_adb_mousex, m_adb_mousey;
	required_device<palette_device> m_palette;

	std::unique_ptr<uint8_t[]> m_slowmem;
	uint8_t m_newvideo;
	uint16_t m_bordercolor;
	uint8_t m_vgcint;
	uint8_t m_langsel;
	uint8_t m_sltromsel;
	uint8_t m_cyareg;
	uint8_t m_inten;
	uint8_t m_intflag;
	uint8_t m_shadow;
	uint16_t m_pending_irqs;
	uint8_t m_mouse_x;
	uint8_t m_mouse_y;
	int8_t m_mouse_dx;
	int8_t m_mouse_dy;
	device_t *m_cur_slot6_image;
	emu_timer *m_scanline_timer;
	emu_timer *m_clock_timer;
	emu_timer *m_qsecond_timer;
	uint8_t m_clock_data;
	uint8_t m_clock_control;
	uint8_t m_clock_read;
	uint8_t m_clock_reg1;
	apple2gs_clock_mode m_clock_mode;
	uint32_t m_clock_curtime;
	seconds_t m_clock_curtime_interval;
	uint8_t m_clock_bram[256];
	#if !RUN_ADB_MICRO
	adbstate_t m_adb_state;
	uint8_t m_adb_command;
	uint8_t m_adb_mode;
	uint8_t m_adb_kmstatus;
	uint8_t m_adb_latent_result;
	int32_t m_adb_command_length;
	int32_t m_adb_command_pos;
	uint8_t m_adb_command_bytes[8];
	uint8_t m_adb_response_bytes[8];
	uint8_t m_adb_response_length;
	int32_t m_adb_response_pos;
	uint8_t m_adb_memory[0x100];
	int m_adb_address_keyboard;
	int m_adb_address_mouse;
	#endif
	uint8_t m_sndglu_ctrl;
	int m_sndglu_addr;
	int m_sndglu_dummy_read;
	std::unique_ptr<bitmap_ind16> m_legacy_gfx;
	bool m_is_rom3;
	uint8_t m_echo_bank;
	uint64_t m_last_adb_time;
	int m_adb_dtime;
	uint32_t m_a2_palette[16];
	uint32_t m_shr_palette[256];

	READ8_MEMBER( apple2gs_c0xx_r );
	WRITE8_MEMBER( apple2gs_c0xx_w );
	WRITE8_MEMBER( apple2gs_main0400_w );
	WRITE8_MEMBER( apple2gs_aux0400_w );
	WRITE8_MEMBER( apple2gs_main2000_w );
	WRITE8_MEMBER( apple2gs_aux2000_w );
	WRITE8_MEMBER( apple2gs_main4000_w );
	WRITE8_MEMBER( apple2gs_aux4000_w );

	uint8_t adb_read_datareg();
	uint8_t adb_read_kmstatus();

	void apple2gs_refresh_delegates();

	write8_delegate write_delegates_2gs0400[2];
	write8_delegate write_delegates_2gs2000[2];
	write8_delegate write_delegates_2gs4000[2];
	DECLARE_MACHINE_START(apple2gs);
	DECLARE_MACHINE_RESET(apple2gs);
	DECLARE_VIDEO_START(apple2gs);
	DECLARE_PALETTE_INIT(apple2gs);
	DECLARE_MACHINE_START(apple2gsr1);
	DECLARE_MACHINE_START(apple2gscommon);
	uint32_t screen_update_apple2gs(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	TIMER_CALLBACK_MEMBER(apple2gs_clock_tick);
	TIMER_CALLBACK_MEMBER(apple2gs_qsecond_tick);
	TIMER_CALLBACK_MEMBER(apple2gs_scanline_tick);
	DECLARE_WRITE_LINE_MEMBER(a2bus_irq_w);
	DECLARE_WRITE_LINE_MEMBER(a2bus_nmi_w);
	DECLARE_WRITE_LINE_MEMBER(a2bus_inh_w);
	DECLARE_READ8_MEMBER(apple2gs_read_vector);

	// ADB MCU and ADB GLU stuff
	#if RUN_ADB_MICRO
	uint8_t m_glu_regs[8], m_glu_bus, m_glu_sysstat;
	bool m_glu_mcu_read_kgs, m_glu_816_read_dstat, m_glu_mouse_read_stat, m_adb_line;

	uint8_t keyglu_mcu_read(uint8_t offset);
	void keyglu_mcu_write(uint8_t offset, uint8_t data);
	uint8_t keyglu_816_read(uint8_t offset);
	void keyglu_816_write(uint8_t offset, uint8_t data);

	DECLARE_READ8_MEMBER(adbmicro_p0_in);
	DECLARE_READ8_MEMBER(adbmicro_p1_in);
	DECLARE_READ8_MEMBER(adbmicro_p2_in);
	DECLARE_READ8_MEMBER(adbmicro_p3_in);
	DECLARE_WRITE8_MEMBER(adbmicro_p0_out);
	DECLARE_WRITE8_MEMBER(adbmicro_p1_out);
	DECLARE_WRITE8_MEMBER(adbmicro_p2_out);
	DECLARE_WRITE8_MEMBER(adbmicro_p3_out);
	#endif
	void process_clock();
	const char *apple2gs_irq_name(uint16_t irq_mask);
	void apple2gs_add_irq(uint16_t irq_mask);
	void apple2gs_remove_irq(uint16_t irq_mask);
	uint8_t adb_read_memory(uint32_t address);
	void adb_write_memory(uint32_t address, uint8_t data);
	void adb_set_mode(uint8_t mode);
	void adb_set_config(uint8_t b1, uint8_t b2, uint8_t b3);
	void adb_post_response(const uint8_t *bytes, size_t length);
	void adb_post_response_1(uint8_t b);
	void adb_post_response_2(uint8_t b1, uint8_t b2);
	void adb_do_command();
	void adb_write_datareg(uint8_t data);
	void adb_write_kmstatus(uint8_t data);
	uint8_t adb_read_mousedata();
	int8_t seven_bit_diff(uint8_t v1, uint8_t v2);
	void adb_check_mouse();
	void apple2gs_set_scanint(uint8_t data);
	int apple2gs_get_vpos();
	uint8_t *apple2gs_getslotmem(offs_t address);
	uint8_t apple2gs_xxCxxx_r(address_space &space, offs_t address);
	void apple2gs_xxCxxx_w(address_space &space, offs_t address, uint8_t data);
	void apple2gs_setup_memory();

	DECLARE_READ8_MEMBER( gssnd_r );
	DECLARE_WRITE8_MEMBER( gssnd_w );
	DECLARE_READ8_MEMBER( apple2gs_00Cxxx_r );
	DECLARE_READ8_MEMBER( apple2gs_01Cxxx_r );
	DECLARE_READ8_MEMBER( apple2gs_E0Cxxx_r );
	DECLARE_READ8_MEMBER( apple2gs_E1Cxxx_r );
	DECLARE_WRITE8_MEMBER( apple2gs_00Cxxx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_01Cxxx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_E0Cxxx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_E1Cxxx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_Exxxxx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_E004xx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_E02xxx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_E104xx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_E12xxx_w );
	DECLARE_WRITE8_MEMBER( apple2gs_slowmem_w );
	DECLARE_READ8_MEMBER(apple2gs_bank_echo_r);
	DECLARE_WRITE_LINE_MEMBER( apple2gs_doc_irq);
	DECLARE_READ8_MEMBER(apple2gs_adc_read);

	void apple2gs(machine_config &config);
	void apple2gsr1(machine_config &config);
	void apple2gs_map(address_map &map);
	void vectors_map(address_map &map);
};

#endif // MAME_INCLUDES_APPLE2GS_H
'hunk'>@@ -834,19 +769,19 @@ static void set_global_register(UINT8 code, UINT32 val)
break;
/*
case ISR_REGISTER:
- mame_printf_debug("written %08X to read-only ISR register\n",val);
+ DEBUG_PRINTF(("written %08X to read-only ISR register\n",val));
break;
- case 22:
-// mame_printf_debug("written %08X to TCR register\n",val);
+ case TCR_REGISTER:
+// DEBUG_PRINTF(("written %08X to TCR register\n",val));
break;
case 23:
-// mame_printf_debug("written %08X to TR register\n",val);
+// DEBUG_PRINTF(("written %08X to TR register\n",val));
break;
case 24:
-// mame_printf_debug("written %08X to WCR register\n",val);
+// DEBUG_PRINTF(("written %08X to WCR register\n",val));
break;
case 16:
@@ -855,57 +790,50 @@ static void set_global_register(UINT8 code, UINT32 val)
case 29:
case 30:
case 31:
- mame_printf_debug("written %08X to _Reserved_ Global Register %d\n",val,code);
+ DEBUG_PRINTF(("written %08X to _Reserved_ Global Register %d\n",val,code));
break;
case BCR_REGISTER:
break;
*/
- case TPR_REGISTER:
+ case TR_REGISTER:
+ hyperstone.tr_base_value = val;
+ hyperstone.tr_base_cycles = activecpu_gettotalcycles64();
+ adjust_timer_interrupt();
+ break;
- hyperstone.n = (val & 0xff0000) >> 16;
+ case TPR_REGISTER:
+ if (!(val & 0x80000000)) /* change immediately */
+ update_timer_prescale();
+ adjust_timer_interrupt();
+ break;
- if(!(val & 0x80000000)) /* change immediately */
- {
- hyperstone.delay_timer = 0;
- hyperstone.timer_clocks = hyperstone.n + 2;
- }
- else
- {
- hyperstone.delay_timer = 1;
+ case TCR_REGISTER:
+ if (oldval != val)
+ {
+ adjust_timer_interrupt();
+ if (hyperstone.intblock < 1)
+ hyperstone.intblock = 1;
}
+ break;
- break;
-/*
case FCR_REGISTER:
- switch((val & 0x3000)>>12)
- {
- case 0:
- mame_printf_debug("IO3 interrupt mode\n");
- break;
- case 1:
- mame_printf_debug("IO3 timing mode\n");
- break;
- case 2:
- mame_printf_debug("watchdog mode\n");
- break;
- case 3:
- // IO3 standard mode
- break;
- }
+ if ((oldval ^ val) & 0x00800000)
+ adjust_timer_interrupt();
+ if (hyperstone.intblock < 1)
+ hyperstone.intblock = 1;
break;
-*/
+
case MCR_REGISTER:
// bits 14..12 EntryTableMap
hyperstone_set_trap_entry((val & 0x7000) >> 12);
-
break;
}
}
}
}
-static void set_local_register(UINT8 code, UINT32 val)
+INLINE void set_local_register(UINT8 code, UINT32 val)
{
UINT8 new_code = (code + GET_FP) % 64;
@@ -928,526 +856,454 @@ static void set_local_register(UINT8 code, UINT32 val)
#define LOCAL 1
-static void decode_source(int local, int hflag)
-{
- if(local)
- {
- UINT8 code = current_regs.src;
- current_regs.set_src_register = set_local_register;
- code = (current_regs.src + GET_FP) % 64; // registers offset by frame pointer
- SREG = hyperstone.local_regs[code];
- code = (current_regs.src + 1 + GET_FP) % 64;
- SREGF = hyperstone.local_regs[code];
- }
- else
- {
- current_regs.set_src_register = set_global_register;
-
- if(hflag)
- current_regs.src += hflag * 16;
-
- SREG = hyperstone.global_regs[current_regs.src];
-
- /* bound safe */
- if(current_regs.src != 15 && current_regs.src != 31)
- SREGF = hyperstone.global_regs[current_regs.src + 1];
-
- if(current_regs.src == PC_REGISTER)
- SRC_IS_PC = 1;
- else if(current_regs.src == SR_REGISTER)
- SRC_IS_SR = 1;
- else if( current_regs.src == BCR_REGISTER || current_regs.src == TPR_REGISTER ||
- current_regs.src == FCR_REGISTER || current_regs.src == MCR_REGISTER )
- {
- SREG = 0; // write-only registers
- }
- else if( current_regs.src == ISR_REGISTER )
- mame_printf_debug("read src ISR. PC = %08X\n",PPC);
- }
-}
-
-static void decode_dest(int local, int hflag)
-{
- if(local)
- {
- UINT8 code = current_regs.dst;
- current_regs.set_dst_register = set_local_register;
- code = (current_regs.dst + GET_FP) % 64; // registers offset by frame pointer
- DREG = hyperstone.local_regs[code];
- code = (current_regs.dst + 1 + GET_FP) % 64;
- DREGF = hyperstone.local_regs[code];
- }
- else
- {
- current_regs.set_dst_register = set_global_register;
-
- if(hflag)
- current_regs.dst += hflag * 16;
-
- DREG = hyperstone.global_regs[current_regs.dst];
-
- /* bound safe */
- if(current_regs.dst != 15 && current_regs.dst != 31)
- DREGF = hyperstone.global_regs[current_regs.dst + 1];
-
- if(current_regs.dst == PC_REGISTER)
- DST_IS_PC = 1;
- else if(current_regs.dst == SR_REGISTER)
- DST_IS_SR = 1;
- else if( current_regs.src == ISR_REGISTER )
- mame_printf_debug("read dst ISR. PC = %08X\n",PPC);
- }
-}
-
-INLINE void decode_RR(void)
-{
- current_regs.src = SRC_CODE;
- current_regs.dst = DST_CODE;
- decode_source(S_BIT, 0);
- decode_dest(D_BIT, 0);
-
- if( SRC_CODE == DST_CODE && S_BIT == D_BIT )
- SAME_SRC_DST = 1;
-
- if( S_BIT == LOCAL && D_BIT == LOCAL )
- {
- if( SRC_CODE == ((DST_CODE + 1) % 64) )
- SAME_SRC_DSTF = 1;
-
- if( ((SRC_CODE + 1) % 64) == DST_CODE )
- SAME_SRCF_DST = 1;
- }
- else if( S_BIT == 0 && D_BIT == 0 )
- {
- if( SRC_CODE == (DST_CODE + 1) )
- SAME_SRC_DSTF = 1;
-
- if( (SRC_CODE + 1) == DST_CODE )
- SAME_SRCF_DST = 1;
- }
-}
-
-INLINE void decode_LL(void)
-{
- current_regs.src = SRC_CODE;
- current_regs.dst = DST_CODE;
- decode_source(LOCAL, 0);
- decode_dest(LOCAL, 0);
-
- if( SRC_CODE == DST_CODE )
- SAME_SRC_DST = 1;
-
- if( SRC_CODE == ((DST_CODE + 1) % 64) )
- SAME_SRC_DSTF = 1;
-}
-
-INLINE void decode_LR(void)
-{
- current_regs.src = SRC_CODE;
- current_regs.dst = DST_CODE;
- decode_source(S_BIT, 0);
- decode_dest(LOCAL, 0);
-
- if( ((SRC_CODE + 1) % 64) == DST_CODE && S_BIT == LOCAL )
- SAME_SRCF_DST = 1;
-}
-
-INLINE void check_delay_PC(void)
-{
- // if PC is used in a delay instruction, the delayed PC should be used
- if( hyperstone.delay.delay_cmd == DELAY_EXECUTE )
- {
- PC = hyperstone.delay.delay_pc;
- hyperstone.delay.delay_cmd = NO_DELAY;
- }
-}
-
-INLINE void decode_immediate(void)
-{
- switch( N_VALUE )
- {
- case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
- case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16:
- EXTRA_U = N_VALUE;
- break;
-
- case 17:
- hyperstone.instruction_length = 3;
- EXTRA_U = (READ_OP(PC) << 16) | READ_OP(PC + 2);
- PC += 4;
- break;
-
- case 18:
- hyperstone.instruction_length = 2;
- EXTRA_U = READ_OP(PC);
- PC += 2;
- break;
-
- case 19:
- hyperstone.instruction_length = 2;
- EXTRA_U = 0xffff0000 | READ_OP(PC);
- PC += 2;
- break;
-
- case 20:
- EXTRA_U = 32; // bit 5 = 1, others = 0
- break;
-
- case 21:
- EXTRA_U = 64; // bit 6 = 1, others = 0
- break;
-
- case 22:
- EXTRA_U = 128; // bit 7 = 1, others = 0
- break;
-
- case 23:
- EXTRA_U = 0x80000000; // bit 31 = 1, others = 0 (2 at the power of 31)
- break;
-
- case 24:
- EXTRA_U = -8;
- break;
-
- case 25:
- EXTRA_U = -7;
- break;
-
- case 26:
- EXTRA_U = -6;
- break;
-
- case 27:
- EXTRA_U = -5;
- break;
-
- case 28:
- EXTRA_U = -4;
- break;
-
- case 29:
- EXTRA_U = -3;
- break;
-
- case 30:
- EXTRA_U = -2;
- break;
-
- case 31:
- EXTRA_U = -1;
- break;
- }
-}
-
-INLINE void decode_const(void)
-{
- UINT16 imm_1 = READ_OP(PC);
-
- PC += 2;
- hyperstone.instruction_length = 2;
-
- if( E_BIT(imm_1) )
- {
- UINT16 imm_2 = READ_OP(PC);
-
- PC += 2;
- hyperstone.instruction_length = 3;
-
- EXTRA_S = imm_2;
- EXTRA_S |= ((imm_1 & 0x3fff) << 16);
-
- if( S_BIT_CONST(imm_1) )
- {
- EXTRA_S |= 0xc0000000;
- }
- }
- else
- {
- EXTRA_S = imm_1 & 0x3fff;
-
- if( S_BIT_CONST(imm_1) )
- {
- EXTRA_S |= 0xffffc000;
- }
- }
-}
-
-INLINE void decode_pcrel(void)
-{
- if( OP & 0x80 )
- {
- UINT16 next = READ_OP(PC);
-
- PC += 2;
- hyperstone.instruction_length = 2;
-
- EXTRA_S = (OP & 0x7f) << 16;
- EXTRA_S |= (next & 0xfffe);
-
- if( next & 1 )
- EXTRA_S |= 0xff800000;
- }
- else
- {
- EXTRA_S = OP & 0x7e;
-
- if( OP & 1 )
- EXTRA_S |= 0xffffff80;
- }
-}
-
-INLINE void decode_dis(void)
-{
- UINT16 next_1 = READ_OP(PC);
-
- PC += 2;
- hyperstone.instruction_length = 2;
-
- current_regs.sub_type = DD(next_1);
-
- if( E_BIT(next_1) )
- {
- UINT16 next_2 = READ_OP(PC);
-
- PC += 2;
- hyperstone.instruction_length = 3;
-
- EXTRA_S = next_2;
- EXTRA_S |= ((next_1 & 0xfff) << 16);
-
- if( S_BIT_CONST(next_1) )
- {
- EXTRA_S |= 0xf0000000;
- }
- }
- else
- {
- EXTRA_S = next_1 & 0xfff;
-
- if( S_BIT_CONST(next_1) )
- {
- EXTRA_S |= 0xfffff000;
- }
- }
-}
-
-INLINE void decode_lim(void)
-{
- UINT32 next = READ_OP(PC);
- PC += 2;
- hyperstone.instruction_length = 2;
-
- current_regs.sub_type = X_CODE(next);
-
- if( E_BIT(next) )
- {
- EXTRA_U = ((next & 0xfff) << 16) | READ_OP(PC);
- PC += 2;
- hyperstone.instruction_length = 3;
- }
- else
- {
- EXTRA_U = next & 0xfff;
- }
-}
-
-/* used in the jumptable */
-INLINE void RRdecode(void)
-{
- check_delay_PC();
- decode_RR();
-}
-
-INLINE void RRlimdecode(void)
-{
- decode_lim();
- check_delay_PC();
- decode_RR();
-}
-
-INLINE void RRconstdecode(void)
-{
- decode_const();
- check_delay_PC();
- decode_RR();
-}
-
-INLINE void RRdisdecode(void)
-{
- decode_dis();
- check_delay_PC();
- decode_RR();
-}
-
-INLINE void RRdecodewithHflag(void)
-{
- check_delay_PC();
- current_regs.src = SRC_CODE;
- current_regs.dst = DST_CODE;
- decode_source(S_BIT, GET_H);
- decode_dest(D_BIT, GET_H);
-
- if(GET_H)
- if(S_BIT == 0 && D_BIT == 0)
- popmessage("MOV with hflag and 2 GRegs! PC = %08X\n",PPC);
-}
-
-INLINE void Rimmdecode(void)
-{
- decode_immediate();
- check_delay_PC();
- current_regs.dst = DST_CODE;
- decode_dest(D_BIT, 0);
-}
-
-INLINE void Rndecode(void)
-{
- check_delay_PC();
- current_regs.dst = DST_CODE;
- decode_dest(D_BIT, 0);
-}
-
-INLINE void RimmdecodewithHflag(void)
-{
- decode_immediate();
- check_delay_PC();
- current_regs.dst = DST_CODE;
- decode_dest(D_BIT, GET_H);
-}
-
-INLINE void Lndecode(void)
-{
- check_delay_PC();
- current_regs.dst = DST_CODE;
- decode_dest(LOCAL, 0);
-}
-
-INLINE void LLdecode(void)
-{
- check_delay_PC();
- decode_LL();
-}
-
-INLINE void LLextdecode(void)
-{
- hyperstone.instruction_length = 2;
- EXTRA_U = READ_OP(PC);
- PC += 2;
- check_delay_PC();
- decode_LL();
-}
-
-INLINE void LRdecode(void)
-{
- check_delay_PC();
- decode_LR();
-}
-
-INLINE void LRconstdecode(void)
-{
- decode_const();
- check_delay_PC();
- decode_LR();
-}
-
-INLINE void PCreldecode(void)
-{
- decode_pcrel();
- check_delay_PC();
-}
-
-INLINE void PCadrdecode(void)
-{
- check_delay_PC();
-}
-
-INLINE void no_decode(void)
+static const INT32 immediate_values[32] =
{
-
-}
-
-
-/* Decode helper table */
-static void (*hyperstone_decode[0x100])(void) = {
-/*00*/ RRdecode, RRdecode, RRdecode, RRdecode, /* CHK - CHKZ - NOP */
-/*04*/ RRdecode, RRdecode, RRdecode, RRdecode, /* MOVD - RET */
-/*08*/ RRdecode, RRdecode, RRdecode, RRdecode, /* DIVU */
-/*0c*/ RRdecode, RRdecode, RRdecode, RRdecode, /* DIVS */
-/*10*/ RRlimdecode, RRlimdecode, RRlimdecode, RRlimdecode, /* XMx - XXx */
-/*14*/ RRconstdecode, RRconstdecode, RRconstdecode, RRconstdecode, /* MASK */
-/*18*/ RRconstdecode, RRconstdecode, RRconstdecode, RRconstdecode, /* SUM */
-/*1c*/ RRconstdecode, RRconstdecode, RRconstdecode, RRconstdecode, /* SUMS */
-/*20*/ RRdecode, RRdecode, RRdecode, RRdecode, /* CMP */
-/*24*/ RRdecodewithHflag, RRdecodewithHflag, RRdecodewithHflag, RRdecodewithHflag, /* MOV */
-/*28*/ RRdecode, RRdecode, RRdecode, RRdecode, /* ADD */
-/*2c*/ RRdecode, RRdecode, RRdecode, RRdecode, /* ADDS */
-/*30*/ RRdecode, RRdecode, RRdecode, RRdecode, /* CMPB */
-/*34*/ RRdecode, RRdecode, RRdecode, RRdecode, /* ANDN */
-/*38*/ RRdecode, RRdecode, RRdecode, RRdecode, /* OR */
-/*3c*/ RRdecode, RRdecode, RRdecode, RRdecode, /* XOR */
-/*40*/ RRdecode, RRdecode, RRdecode, RRdecode, /* SUBC */
-/*44*/ RRdecode, RRdecode, RRdecode, RRdecode, /* NOT */
-/*48*/ RRdecode, RRdecode, RRdecode, RRdecode, /* SUB */
-/*4c*/ RRdecode, RRdecode, RRdecode, RRdecode, /* SUBS */
-/*50*/ RRdecode, RRdecode, RRdecode, RRdecode, /* ADDC */
-/*54*/ RRdecode, RRdecode, RRdecode, RRdecode, /* AND */
-/*58*/ RRdecode, RRdecode, RRdecode, RRdecode, /* NEG */
-/*5c*/ RRdecode, RRdecode, RRdecode, RRdecode, /* NEGS */
-/*60*/ Rimmdecode, Rimmdecode, Rimmdecode, Rimmdecode, /* CMPI */
-/*64*/ RimmdecodewithHflag, RimmdecodewithHflag, RimmdecodewithHflag, RimmdecodewithHflag, /* MOVI */
-/*68*/ Rimmdecode, Rimmdecode, Rimmdecode, Rimmdecode, /* ADDI */
-/*6c*/ Rimmdecode, Rimmdecode, Rimmdecode, Rimmdecode, /* ADDSI */
-/*70*/ Rimmdecode, Rimmdecode, Rimmdecode, Rimmdecode, /* CMPBI */
-/*74*/ Rimmdecode, Rimmdecode, Rimmdecode, Rimmdecode, /* ANDNI */
-/*78*/ Rimmdecode, Rimmdecode, Rimmdecode, Rimmdecode, /* ORI */
-/*7c*/ Rimmdecode, Rimmdecode, Rimmdecode, Rimmdecode, /* XORI */
-/*80*/ Lndecode, Lndecode, LLdecode, LLdecode, /* SHRDI, SHRD, SHR */
-/*84*/ Lndecode, Lndecode, LLdecode, LLdecode, /* SARDI, SARD, SAR */
-/*88*/ Lndecode, Lndecode, LLdecode, LLdecode, /* SHLDI, SHLD, SHL */
-/*8c*/ no_decode, no_decode, LLdecode, LLdecode, /* RESERVED, TESTLZ, ROL */
-/*90*/ RRdisdecode, RRdisdecode, RRdisdecode, RRdisdecode, /* LDxx.D/A/IOD/IOA */
-/*94*/ RRdisdecode, RRdisdecode, RRdisdecode, RRdisdecode, /* LDxx.N/S */
-/*98*/ RRdisdecode, RRdisdecode, RRdisdecode, RRdisdecode, /* STxx.D/A/IOD/IOA */
-/*9c*/ RRdisdecode, RRdisdecode, RRdisdecode, RRdisdecode, /* STxx.N/S */
-/*a0*/ Rndecode, Rndecode, Rndecode, Rndecode, /* SHRI */
-/*a4*/ Rndecode, Rndecode, Rndecode, Rndecode, /* SARI */
-/*a8*/ Rndecode, Rndecode, Rndecode, Rndecode, /* SHLI */
-/*ac*/ no_decode, no_decode, no_decode, no_decode, /* RESERVED */
-/*b0*/ RRdecode, RRdecode, RRdecode, RRdecode, /* MULU */
-/*b4*/ RRdecode, RRdecode, RRdecode, RRdecode, /* MULS */
-/*b8*/ Rndecode, Rndecode, Rndecode, Rndecode, /* SETxx - SETADR - FETCH */
-/*bc*/ RRdecode, RRdecode, RRdecode, RRdecode, /* MUL */
-/*c0*/ LLdecode, LLdecode, LLdecode, LLdecode, /* FADD, FADDD, FSUB, FSUBD */
-/*c4*/ LLdecode, LLdecode, LLdecode, LLdecode, /* FMUL, FMULD, FDIV, FDIVD */
-/*c8*/ LLdecode, LLdecode, LLdecode, LLdecode, /* FCMP, FCMPD, FCMPU, FCMPUD */
-/*cc*/ LLdecode, LLdecode, LLextdecode, LLdecode, /* FCVT, FCVTD, EXTEND, DO */
-/*d0*/ LRdecode, LRdecode, LRdecode, LRdecode, /* LDW.R, LDD.R */
-/*d4*/ LRdecode, LRdecode, LRdecode, LRdecode, /* LDW.P, LDD.P */
-/*d8*/ LRdecode, LRdecode, LRdecode, LRdecode, /* STW.R, STD.R */
-/*dc*/ LRdecode, LRdecode, LRdecode, LRdecode, /* STW.P, STD.P */
-/*e0*/ PCreldecode, PCreldecode, PCreldecode, PCreldecode, /* DBV, DBNV, DBE, DBNE */
-/*e4*/ PCreldecode, PCreldecode, PCreldecode, PCreldecode, /* DBC, DBNC, DBSE, DBHT */
-/*e8*/ PCreldecode, PCreldecode, PCreldecode, PCreldecode, /* DBN, DBNN, DBLE, DBGT */
-/*ec*/ PCreldecode, LLdecode, LRconstdecode, LRconstdecode, /* DBR, FRAME, CALL */
-/*f0*/ PCreldecode, PCreldecode, PCreldecode, PCreldecode, /* BV, BNV, BE, BNE */
-/*f4*/ PCreldecode, PCreldecode, PCreldecode, PCreldecode, /* BC, BNC, BSE, BHT */
-/*f8*/ PCreldecode, PCreldecode, PCreldecode, PCreldecode, /* BN, BNN, BLE, BGT */
-/*fc*/ PCreldecode, PCadrdecode, PCadrdecode, PCadrdecode /* BR, TRAPxx - TRAP */
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 0, 0, 0, 32, 64, 128, 0x80000000,
+ -8, -7, -6, -5, -4, -3, -2, -1
};
-INLINE void execute_br(void)
+#define WRITE_ONLY_REGMASK ((1 << BCR_REGISTER) | (1 << TPR_REGISTER) | (1 << FCR_REGISTER) | (1 << MCR_REGISTER))
+
+#define decode_source(decode, local, hflag) \
+do \
+{ \
+ if(local) \
+ { \
+ UINT8 code = (decode)->src; \
+ (decode)->src_is_local = 1; \
+ code = ((decode)->src + GET_FP) % 64; /* registers offset by frame pointer */\
+ SREG = hyperstone.local_regs[code]; \
+ code = ((decode)->src + 1 + GET_FP) % 64; \
+ SREGF = hyperstone.local_regs[code]; \
+ } \
+ else \
+ { \
+ (decode)->src_is_local = 0; \
+ \
+ if (!hflag) \
+ { \
+ SREG = get_global_register((decode)->src); \
+ \
+ /* bound safe */ \
+ if ((decode)->src != 15) \
+ SREGF = get_global_register((decode)->src + 1); \
+ } \
+ else \
+ { \
+ (decode)->src += 16; \
+ \
+ SREG = get_global_register((decode)->src); \
+ if ((WRITE_ONLY_REGMASK >> (decode)->src) & 1) \
+ SREG = 0; /* write-only registers */ \
+ else if ((decode)->src == ISR_REGISTER) \
+ DEBUG_PRINTF(("read src ISR. PC = %08X\n",PPC)); \
+ \
+ /* bound safe */ \
+ if ((decode)->src != 31) \
+ SREGF = get_global_register((decode)->src + 1); \
+ } \
+ } \
+} while (0)
+
+#define decode_dest(decode, local, hflag) \
+do \
+{ \
+ if(local) \
+ { \
+ UINT8 code = (decode)->dst; \
+ (decode)->dst_is_local = 1; \
+ code = ((decode)->dst + GET_FP) % 64; /* registers offset by frame pointer */\
+ DREG = hyperstone.local_regs[code]; \
+ code = ((decode)->dst + 1 + GET_FP) % 64; \
+ DREGF = hyperstone.local_regs[code]; \
+ } \
+ else \
+ { \
+ (decode)->dst_is_local = 0; \
+ \
+ if (!hflag) \
+ { \
+ DREG = get_global_register((decode)->dst); \
+ \
+ /* bound safe */ \
+ if ((decode)->dst != 15) \
+ DREGF = get_global_register((decode)->dst + 1); \
+ } \
+ else \
+ { \
+ (decode)->dst += 16; \
+ \
+ 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((decode)->dst + 1); \
+ } \
+ } \
+} while (0)
+
+#define decode_RR(decode, dlocal, slocal) \
+do \
+{ \
+ (decode)->src = SRC_CODE; \
+ (decode)->dst = DST_CODE; \
+ decode_source(decode, slocal, 0); \
+ decode_dest(decode, dlocal, 0); \
+ \
+ if( (slocal) == (dlocal) && SRC_CODE == DST_CODE ) \
+ SAME_SRC_DST = 1; \
+ \
+ if( (slocal) == LOCAL && (dlocal) == LOCAL ) \
+ { \
+ if( SRC_CODE == ((DST_CODE + 1) % 64) ) \
+ SAME_SRC_DSTF = 1; \
+ \
+ if( ((SRC_CODE + 1) % 64) == DST_CODE ) \
+ SAME_SRCF_DST = 1; \
+ } \
+ else if( (slocal) == 0 && (dlocal) == 0 ) \
+ { \
+ if( SRC_CODE == (DST_CODE + 1) ) \
+ SAME_SRC_DSTF = 1; \
+ \
+ if( (SRC_CODE + 1) == DST_CODE ) \
+ SAME_SRCF_DST = 1; \
+ } \
+} while (0)
+
+#define decode_LL(decode) \
+do \
+{ \
+ (decode)->src = SRC_CODE; \
+ (decode)->dst = DST_CODE; \
+ decode_source(decode, LOCAL, 0); \
+ decode_dest(decode, LOCAL, 0); \
+ \
+ if( SRC_CODE == DST_CODE ) \
+ SAME_SRC_DST = 1; \
+ \
+ if( SRC_CODE == ((DST_CODE + 1) % 64) ) \
+ SAME_SRC_DSTF = 1; \
+} while (0)
+
+#define decode_LR(decode, slocal) \
+do \
+{ \
+ (decode)->src = SRC_CODE; \
+ (decode)->dst = DST_CODE; \
+ decode_source(decode, slocal, 0); \
+ decode_dest(decode, LOCAL, 0); \
+ \
+ if( ((SRC_CODE + 1) % 64) == DST_CODE && slocal == LOCAL ) \
+ SAME_SRCF_DST = 1; \
+} while (0)
+
+#define check_delay_PC() \
+do \
+{ \
+ /* if PC is used in a delay instruction, the delayed PC should be used */ \
+ if( hyperstone.delay.delay_cmd == DELAY_EXECUTE ) \
+ { \
+ PC = hyperstone.delay.delay_pc; \
+ hyperstone.delay.delay_cmd = NO_DELAY; \
+ } \
+} while (0)
+
+#define decode_immediate(decode, nbit) \
+do \
+{ \
+ if (!nbit) \
+ EXTRA_U = immediate_values[OP & 0x0f]; \
+ else \
+ switch( OP & 0x0f ) \
+ { \
+ default: \
+ EXTRA_U = immediate_values[0x10 + (OP & 0x0f)]; \
+ break; \
+ \
+ case 1: \
+ hyperstone.instruction_length = 3; \
+ EXTRA_U = (READ_OP(PC) << 16) | READ_OP(PC + 2); \
+ PC += 4; \
+ break; \
+ \
+ case 2: \
+ hyperstone.instruction_length = 2; \
+ EXTRA_U = READ_OP(PC); \
+ PC += 2; \
+ break; \
+ \
+ case 3: \
+ hyperstone.instruction_length = 2; \
+ EXTRA_U = 0xffff0000 | READ_OP(PC); \
+ PC += 2; \
+ break; \
+ } \
+} while (0)
+
+#define decode_const(decode) \
+do \
+{ \
+ UINT16 imm_1 = READ_OP(PC); \
+ \
+ PC += 2; \
+ hyperstone.instruction_length = 2; \
+ \
+ if( E_BIT(imm_1) ) \
+ { \
+ UINT16 imm_2 = READ_OP(PC); \
+ \
+ PC += 2; \
+ hyperstone.instruction_length = 3; \
+ \
+ EXTRA_S = imm_2; \
+ EXTRA_S |= ((imm_1 & 0x3fff) << 16); \
+ \
+ if( S_BIT_CONST(imm_1) ) \
+ { \
+ EXTRA_S |= 0xc0000000; \
+ } \
+ } \
+ else \
+ { \
+ EXTRA_S = imm_1 & 0x3fff; \
+ \
+ if( S_BIT_CONST(imm_1) ) \
+ { \
+ EXTRA_S |= 0xffffc000; \
+ } \
+ } \
+} while (0)
+
+#define decode_pcrel(decode) \
+do \
+{ \
+ if( OP & 0x80 ) \
+ { \
+ UINT16 next = READ_OP(PC); \
+ \
+ PC += 2; \
+ hyperstone.instruction_length = 2; \
+ \
+ EXTRA_S = (OP & 0x7f) << 16; \
+ EXTRA_S |= (next & 0xfffe); \
+ \
+ if( next & 1 ) \
+ EXTRA_S |= 0xff800000; \
+ } \
+ else \
+ { \
+ EXTRA_S = OP & 0x7e; \
+ \
+ if( OP & 1 ) \
+ EXTRA_S |= 0xffffff80; \
+ } \
+} while (0)
+
+#define decode_dis(decode) \
+do \
+{ \
+ UINT16 next_1 = READ_OP(PC); \
+ \
+ PC += 2; \
+ hyperstone.instruction_length = 2; \
+ \
+ (decode)->sub_type = DD(next_1); \
+ \
+ if( E_BIT(next_1) ) \
+ { \
+ UINT16 next_2 = READ_OP(PC); \
+ \
+ PC += 2; \
+ hyperstone.instruction_length = 3; \
+ \
+ EXTRA_S = next_2; \
+ EXTRA_S |= ((next_1 & 0xfff) << 16); \
+ \
+ if( S_BIT_CONST(next_1) ) \
+ { \
+ EXTRA_S |= 0xf0000000; \
+ } \
+ } \
+ else \
+ { \
+ EXTRA_S = next_1 & 0xfff; \
+ \
+ if( S_BIT_CONST(next_1) ) \
+ { \
+ EXTRA_S |= 0xfffff000; \
+ } \
+ } \
+} while (0)
+
+#define decode_lim(decode) \
+do \
+{ \
+ UINT32 next = READ_OP(PC); \
+ PC += 2; \
+ hyperstone.instruction_length = 2; \
+ \
+ (decode)->sub_type = X_CODE(next); \
+ \
+ if( E_BIT(next) ) \
+ { \
+ EXTRA_U = ((next & 0xfff) << 16) | READ_OP(PC); \
+ PC += 2; \
+ hyperstone.instruction_length = 3; \
+ } \
+ else \
+ { \
+ EXTRA_U = next & 0xfff; \
+ } \
+} while (0)
+
+#define RRdecode(decode, dlocal, slocal) \
+do \
+{ \
+ check_delay_PC(); \
+ decode_RR(decode, dlocal, slocal); \
+} while (0)
+
+#define RRlimdecode(decode, dlocal, slocal) \
+do \
+{ \
+ decode_lim(decode); \
+ check_delay_PC(); \
+ decode_RR(decode, dlocal, slocal); \
+} while (0)
+
+#define RRconstdecode(decode, dlocal, slocal) \
+do \
+{ \
+ decode_const(decode); \
+ check_delay_PC(); \
+ decode_RR(decode, dlocal, slocal); \
+} while (0)
+
+#define RRdisdecode(decode, dlocal, slocal) \
+do \
+{ \
+ decode_dis(decode); \
+ check_delay_PC(); \
+ decode_RR(decode, dlocal, slocal); \
+} while (0)
+
+#define RRdecodewithHflag(decode, dlocal, slocal) \
+do \
+{ \
+ check_delay_PC(); \
+ (decode)->src = SRC_CODE; \
+ (decode)->dst = DST_CODE; \
+ decode_source(decode, slocal, GET_H); \
+ decode_dest(decode, dlocal, GET_H); \
+ \
+ if(GET_H) \
+ if(slocal == 0 && dlocal == 0) \
+ DEBUG_PRINTF(("MOV with hflag and 2 GRegs! PC = %08X\n",PPC)); \
+} while (0)
+
+#define Rimmdecode(decode, dlocal, nbit) \
+do \
+{ \
+ decode_immediate(decode, nbit); \
+ check_delay_PC(); \
+ (decode)->dst = DST_CODE; \
+ decode_dest(decode, dlocal, 0); \
+} while (0)
+
+#define Rndecode(decode, dlocal) \
+do \
+{ \
+ check_delay_PC(); \
+ (decode)->dst = DST_CODE; \
+ decode_dest(decode, dlocal, 0); \
+} while (0)
+
+#define RimmdecodewithHflag(decode, dlocal, nbit) \
+do \
+{ \
+ decode_immediate(decode, nbit); \
+ check_delay_PC(); \
+ (decode)->dst = DST_CODE; \
+ decode_dest(decode, dlocal, GET_H); \
+} while (0)
+
+#define Lndecode(decode) \
+do \
+{ \
+ check_delay_PC(); \
+ (decode)->dst = DST_CODE; \
+ decode_dest(decode, LOCAL, 0); \
+} while (0)
+
+#define LLdecode(decode) \
+do \
+{ \
+ check_delay_PC(); \
+ decode_LL(decode); \
+} while (0)
+
+#define LLextdecode(decode) \
+do \
+{ \
+ hyperstone.instruction_length = 2; \
+ EXTRA_U = READ_OP(PC); \
+ PC += 2; \
+ check_delay_PC(); \
+ decode_LL(decode); \
+} while (0)
+
+#define LRdecode(decode, slocal) \
+do \
+{ \
+ check_delay_PC(); \
+ decode_LR(decode, slocal); \
+} while (0)
+
+#define LRconstdecode(decode, slocal) \
+do \
+{ \
+ decode_const(decode); \
+ check_delay_PC(); \
+ decode_LR(decode, slocal); \
+} while (0)
+
+#define PCreldecode(decode) \
+do \
+{ \
+ decode_pcrel(decode); \
+ check_delay_PC(); \
+} while (0)
+
+#define PCadrdecode(decode) \
+do \
+{ \
+ check_delay_PC(); \
+} while (0)
+
+#define no_decode(decode) \
+do \
+{ \
+} while (0)
+
+
+INLINE void execute_br(struct regs_decode *decode)
{
PPC = PC;
PC += EXTRA_S;
change_pc(PC);
SET_M(0);
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-INLINE void execute_dbr(void)
+INLINE void execute_dbr(struct regs_decode *decode)
{
- hyperstone.delay.delay_cmd = DELAY_TAKEN;
+ hyperstone.delay.delay_cmd = DELAY_EXECUTE;
hyperstone.delay.delay_pc = PC + EXTRA_S;
hyperstone.intblock = 3;
@@ -1479,7 +1335,7 @@ static void execute_trap(UINT32 addr)
PC = addr;
change_pc(PC);
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
@@ -1509,7 +1365,7 @@ static void execute_int(UINT32 addr)
PC = addr;
change_pc(PC);
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
/* TODO: mask Parity Error and Extended Overflow exceptions */
@@ -1538,11 +1394,11 @@ static void execute_exception(UINT32 addr)
PC = addr;
change_pc(PC);
- mame_printf_debug("EXCEPTION! PPC = %08X PC = %08X\n",PPC-2,PC-2);
- hyperstone_ICount -= 2;
+ DEBUG_PRINTF(("EXCEPTION! PPC = %08X PC = %08X\n",PPC-2,PC-2));
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void execute_software(void)
+static void execute_software(struct regs_decode *decode)
{
UINT8 reg;
UINT32 oldSR;
@@ -1557,7 +1413,7 @@ static void execute_software(void)
//since it's sure the register is in the register part of the stack,
//set the stack address to a value above the highest address
//that can be set by a following frame instruction
- stack_of_dst = (SP & ~0xff) + 64*4 + (((GET_FP + current_regs.dst) % 64) * 4); //converted to 32bits offset
+ stack_of_dst = (SP & ~0xff) + 64*4 + (((GET_FP + decode->dst) % 64) * 4); //converted to 32bits offset
oldSR = SR;
@@ -1591,81 +1447,141 @@ static void execute_software(void)
6 - IO3 (trap 54)
7 - TIMER (trap 55)
*/
-static void set_irq_line(int irqline, int state)
+
+#define INT1_LINE_STATE ((ISR >> 0) & 1)
+#define INT2_LINE_STATE ((ISR >> 1) & 1)
+#define INT3_LINE_STATE ((ISR >> 2) & 1)
+#define INT4_LINE_STATE ((ISR >> 3) & 1)
+#define IO1_LINE_STATE ((ISR >> 4) & 1)
+#define IO2_LINE_STATE ((ISR >> 5) & 1)
+#define IO3_LINE_STATE ((ISR >> 6) & 1)
+
+static void check_interrupts(void)
{
/* Interrupt-Lock flag isn't set */
+ if (GET_L || hyperstone.intblock > 0)
+ return;
- if(hyperstone.intblock)
+ /* quick exit if nothing */
+ if (!hyperstone.timer_int_pending && (ISR & 0x7f) == 0)
return;
- if( !GET_L && state )
+ /* 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)
{
- int execint=0;
- switch(irqline)
- {
- case 0: if( (FCR&(1<<6)) && (!(FCR&(1<<4))) ) execint=1; // IO2
- break;
- case 1: if( (FCR&(1<<2)) && (!(FCR&(1<<0))) ) execint=1; // IO1
- break;
- case 2: if( !(FCR&(1<<31)) ) execint=1; // int 4
- break;
- case 3: if( !(FCR&(1<<30)) ) execint=1; // int 3
- break;
- case 4: if( !(FCR&(1<<29)) ) execint=1; // int 2
- break;
- case 5: if( !(FCR&(1<<28)) ) execint=1; // int 1
- break;
- case 6: if( (FCR&(1<<10)) && (!(FCR&(1<<8))) ) execint=1; // IO3
- break;
- case 7: if( !(FCR&(1<<23)) ) execint=1; // timer
- break;
- }
-/*
- if( (FCR&(1<<6)) && (!(FCR&(1<<4))) ) mame_printf_debug("IO2 en\n"); // IO2
+ execute_int(get_trap_addr(IO3));
+ (*hyperstone.irq_callback)(IRQ_IO3);
+ return;
+ }
+
+ /* timer int might be priority 6 if FCR bits 20-21 == 3; FCR bit 23 inhibits interrupt */
+ if (hyperstone.timer_int_pending && (FCR & 0x00b00000) == 0x00300000)
+ {
+ hyperstone.timer_int_pending = 0;
+ execute_int(get_trap_addr(TIMER));
+ return;
+ }
+
+ /* INT1 is priority 7; state is in bit 0 of ISR; FCR bit 28 inhibits interrupt */
+ if (INT1_LINE_STATE && (FCR & 0x10000000) == 0x00000000)
+ {
+ execute_int(get_trap_addr(INT1));
+ (*hyperstone.irq_callback)(IRQ_INT1);
+ return;
+ }
- if( (FCR&(1<<2)) && (!(FCR&(1<<0))) ) mame_printf_debug("IO1 en\n"); // IO1
+ /* timer int might be priority 8 if FCR bits 20-21 == 2; FCR bit 23 inhibits interrupt */
+ if (hyperstone.timer_int_pending && (FCR & 0x00b00000) == 0x00200000)
+ {
+ hyperstone.timer_int_pending = 0;
+ execute_int(get_trap_addr(TIMER));
+ return;
+ }
- if( !(FCR&(1<<31)) ) mame_printf_debug("int4 en\n"); // int 4
+ /* INT2 is priority 9; state is in bit 1 of ISR; FCR bit 29 inhibits interrupt */
+ if (INT2_LINE_STATE && (FCR & 0x20000000) == 0x00000000)
+ {
+ execute_int(get_trap_addr(INT2));
+ (*hyperstone.irq_callback)(IRQ_INT2);
+ return;
+ }
- if( !(FCR&(1<<30)) ) mame_printf_debug("int3 en\n"); // int 3
+ /* timer int might be priority 10 if FCR bits 20-21 == 1; FCR bit 23 inhibits interrupt */
+ if (hyperstone.timer_int_pending && (FCR & 0x00b00000) == 0x00100000)
+ {
+ hyperstone.timer_int_pending = 0;
+ execute_int(get_trap_addr(TIMER));
+ return;
+ }
- if( !(FCR&(1<<29)) ) mame_printf_debug("int2 en\n"); // int 2
+ /* INT3 is priority 11; state is in bit 2 of ISR; FCR bit 30 inhibits interrupt */
+ if (INT3_LINE_STATE && (FCR & 0x40000000) == 0x00000000)
+ {
+ execute_int(get_trap_addr(INT3));
+ (*hyperstone.irq_callback)(IRQ_INT3);
+ return;
+ }
- if( !(FCR&(1<<28)) ) mame_printf_debug("int1 en\n"); // int 1
+ /* timer int might be priority 12 if FCR bits 20-21 == 0; FCR bit 23 inhibits interrupt */
+ if (hyperstone.timer_int_pending && (FCR & 0x00b00000) == 0x00000000)
+ {
+ hyperstone.timer_int_pending = 0;
+ execute_int(get_trap_addr(TIMER));
+ return;
+ }
- if( (FCR&(1<<10)) && (!(FCR&(1<<8))) ) mame_printf_debug("IO3 en\n"); // IO3
+ /* INT4 is priority 13; state is in bit 3 of ISR; FCR bit 31 inhibits interrupt */
+ if (INT4_LINE_STATE && (FCR & 0x80000000) == 0x00000000)
+ {
+ execute_int(get_trap_addr(INT4));
+ (*hyperstone.irq_callback)(IRQ_INT4);
+ return;
+ }
- // if( !(FCR&(1<<23)) ) mame_printf_debug("timer irq!\n"); // timer
-*/
- if(execint)
- {
- execute_int(get_trap_addr(irqline + 48));
- (*hyperstone.irq_callback)(irqline);
- }
+ /* IO1 is priority 14; state is in bit 4 of ISR; FCR bit 2 enables input and FCR bit 0 inhibits interrupt */
+ if (IO1_LINE_STATE && (FCR & 0x00000005) == 0x00000004)
+ {
+ execute_int(get_trap_addr(IO1));
+ (*hyperstone.irq_callback)(IRQ_IO3);
+ return;
+ }
+
+ /* IO2 is priority 15; state is in bit 5 of ISR; FCR bit 6 enables input and FCR bit 4 inhibits interrupt */
+ if (IO2_LINE_STATE && (FCR & 0x00000050) == 0x00000040)
+ {
+ execute_int(get_trap_addr(IO2));
+ (*hyperstone.irq_callback)(IRQ_IO2);
+ return;
}
}
-static void hyperstone_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void set_irq_line(int irqline, int state)
+{
+ if (state)
+ ISR |= 1 << irqline;
+ else
+ ISR &= ~(1 << irqline);
+}
+
+static void hyperstone_init(int index, int clock, const void *config, int (*irqcallback)(int), int scale_mask)
{
state_save_register_item_array("E132XS", index, hyperstone.global_regs);
state_save_register_item_array("E132XS", index, hyperstone.local_regs);
state_save_register_item("E132XS", index, hyperstone.ppc);
state_save_register_item("E132XS", index, hyperstone.trap_entry);
state_save_register_item("E132XS", index, hyperstone.delay.delay_pc);
- state_save_register_item("E132XS", index, hyperstone.op);
- state_save_register_item("E132XS", index, hyperstone.n);
- state_save_register_item("E132XS", index, hyperstone.h_clear);
state_save_register_item("E132XS", index, hyperstone.instruction_length);
state_save_register_item("E132XS", index, hyperstone.intblock);
- state_save_register_item("E132XS", index, hyperstone.delay_timer);
state_save_register_item("E132XS", index, hyperstone.delay.delay_cmd);
- state_save_register_item("E132XS", index, hyperstone.timer_clocks);
+ state_save_register_item("E132XS", index, hyperstone.tr_clocks_per_tick);
hyperstone.irq_callback = irqcallback;
+ hyperstone.timer = timer_alloc(timer_callback);
+ hyperstone.clock_scale_mask = scale_mask;
}
#if (HAS_E116T || HAS_E116XT || HAS_E116XS || HAS_E116XSR || HAS_GMS30C2116 || HAS_GMS30C2216)
-static void e116_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void e116_init(int index, int clock, const void *config, int (*irqcallback)(int), int scale_mask)
{
hyp_cpu_read_byte = program_read_byte_16be;
hyp_cpu_read_half_word = program_read_word_16be;
@@ -1679,12 +1595,42 @@ static void e116_init(int index, int clock, const void *config, int (*irqcallbac
hyp_type_16bit = 1;
- hyperstone_init(index, clock, config, irqcallback);
+ hyperstone_init(index, clock, config, irqcallback, scale_mask);
+}
+
+static void e116t_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e116_init(index, clock, config, irqcallback, 0);
+}
+
+static void e116xt_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e116_init(index, clock, config, irqcallback, 3);
+}
+
+static void e116xs_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e116_init(index, clock, config, irqcallback, 7);
+}
+
+static void e116xsr_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e116_init(index, clock, config, irqcallback, 7);
+}
+
+static void gms30c2116_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e116_init(index, clock, config, irqcallback, 0);
+}
+
+static void gms30c2216_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e116_init(index, clock, config, irqcallback, 0);
}
#endif
#if (HAS_E132N || HAS_E132T || HAS_E132XN || HAS_E132XT || HAS_E132XS || HAS_E132XSR || HAS_GMS30C2132 || HAS_GMS30C2232)
-static void e132_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void e132_init(int index, int clock, const void *config, int (*irqcallback)(int), int scale_mask)
{
hyp_cpu_read_byte = program_read_byte_32be;
hyp_cpu_read_half_word = program_read_word_32be;
@@ -1698,7 +1644,47 @@ static void e132_init(int index, int clock, const void *config, int (*irqcallbac
hyp_type_16bit = 0;
- hyperstone_init(index, clock, config, irqcallback);
+ hyperstone_init(index, clock, config, irqcallback, scale_mask);
+}
+
+static void e132n_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e132_init(index, clock, config, irqcallback, 0);
+}
+
+static void e132t_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e132_init(index, clock, config, irqcallback, 0);
+}
+
+static void e132xn_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e132_init(index, clock, config, irqcallback, 3);
+}
+
+static void e132xt_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e132_init(index, clock, config, irqcallback, 3);
+}
+
+static void e132xs_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e132_init(index, clock, config, irqcallback, 7);
+}
+
+static void e132xsr_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e132_init(index, clock, config, irqcallback, 7);
+}
+
+static void gms30c2132_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e132_init(index, clock, config, irqcallback, 0);
+}
+
+static void gms30c2232_init(int index, int clock, const void *config, int (*irqcallback)(int))
+{
+ e132_init(index, clock, config, irqcallback, 0);
}
#endif
@@ -1706,14 +1692,16 @@ static void hyperstone_reset(void)
{
//TODO: Add different reset initializations for BCR, MCR, FCR, TPR
+ emu_timer *save_timer;
int (*save_irqcallback)(int);
+ save_timer = hyperstone.timer;
save_irqcallback = hyperstone.irq_callback;
memset(&hyperstone, 0, sizeof(hyperstone_regs));
hyperstone.irq_callback = save_irqcallback;
+ hyperstone.timer = save_timer;
- hyperstone.h_clear = 0;
- hyperstone.instruction_length = 0;
+ hyperstone.tr_clocks_per_tick = 2;
hyperstone_set_trap_entry(E132XS_ENTRY_MEM3); /* default entry point @ MEM3 */
@@ -1736,7 +1724,7 @@ static void hyperstone_reset(void)
SET_L_REG(0, (PC & 0xfffffffe) | GET_S);
SET_L_REG(1, SR);
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
static void hyperstone_exit(void)
@@ -1744,120 +1732,6 @@ static void hyperstone_exit(void)
// nothing to do
}
-/* Handle the timer, increasing its value after "timer_clocks" clocks and returning the new icount base that needs to be used for the next check */
-static int handle_timers(int current_icount, int previous_icount)
-{
- int diff = previous_icount - current_icount;
- int new_icount_base;
-
- if(diff >= hyperstone.timer_clocks)
- {
- TR++; // wrap around to 0 modulo 32 bits
-
- if( hyperstone.delay_timer )
- {
- hyperstone.delay_timer = 0;
- hyperstone.timer_clocks = hyperstone.n + 2;
- }
-
- new_icount_base = current_icount + (diff - hyperstone.timer_clocks);
- }
- else
- {
- new_icount_base = previous_icount;
- }
-
- if(!hyperstone.intblock)
- {
- if( !((TR - TCR) & 0x80000000) )
- {
- /* generate a timer interrupt */
- set_irq_line(7, PULSE_LINE);
- }
- }
-
- return new_icount_base;
-}
-
-static int hyperstone_execute(int cycles)
-{
- int old_icount = cycles;
- hyperstone_ICount = cycles;
-
- do
- {
- PPC = PC; /* copy PC to previous PC */
-
- CALL_MAME_DEBUG;
-
- OP = READ_OP(PC);
-
- PC += 2;
-
- if(GET_H)
- {
- hyperstone.h_clear = 1;
- }
-
- hyperstone.instruction_length = 1;
-
- /* clear 'current regs / flags' */
- current_regs.src = 0;
- current_regs.dst = 0;
- current_regs.src_value = 0;
- current_regs.next_src_value = 0;
- current_regs.dst_value = 0;
- current_regs.next_dst_value = 0;
- current_regs.sub_type = 0;
- current_regs.extra.u = 0;
- current_regs.extra.s = 0;
- current_regs.set_src_register = NULL;
- current_regs.set_dst_register = NULL;
- current_regs.src_is_pc = 0;
- current_regs.dst_is_pc = 0;
- current_regs.src_is_sr = 0;
- current_regs.dst_is_sr = 0;
- current_regs.same_src_dst = 0;
- current_regs.same_src_dstf = 0;
- current_regs.same_srcf_dst = 0;
-
- /* decode current opcode details into current regs */
- hyperstone_decode[(OP & 0xff00) >> 8]();
-
- /* execute opcode */
- hyperstone_op[(OP & 0xff00) >> 8]();
-
- SET_ILC(hyperstone.instruction_length & 3);
-
- old_icount = handle_timers(hyperstone_ICount, old_icount);
-
- if(hyperstone.h_clear)
- {
- SET_H(0);
- hyperstone.h_clear = 0;
- }
-
- if( GET_T && GET_P && hyperstone.delay.delay_cmd == NO_DELAY ) /* Not in a Delayed Branch instructions */
- {
- UINT32 addr = get_trap_addr(TRACE_EXCEPTION);
- execute_exception(addr);
- }
-
- if( hyperstone.delay.delay_cmd == DELAY_TAKEN )
- {
- hyperstone.delay.delay_cmd = DELAY_EXECUTE;
- }
-
- if(hyperstone.intblock > 0)
- {
- hyperstone.intblock--;
- }
-
- } while( hyperstone_ICount > 0 );
-
- return cycles - hyperstone_ICount;
-}
-
static void hyperstone_get_context(void *regs)
{
/* copy the context */
@@ -1881,7 +1755,7 @@ static offs_t hyperstone_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
/* Opcodes */
-static void hyperstone_chk(void)
+INLINE void hyperstone_chk(struct regs_decode *decode)
{
UINT32 addr = get_trap_addr(RANGE_ERROR);
@@ -1904,10 +1778,10 @@ static void hyperstone_chk(void)
}
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_movd(void)
+INLINE void hyperstone_movd(struct regs_decode *decode)
{
if( DST_IS_PC ) // Rd denotes PC
{
@@ -1918,7 +1792,7 @@ static void hyperstone_movd(void)
if( SRC_IS_PC || SRC_IS_SR )
{
- logerror("Denoted PC or SR in RET instruction. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR in RET instruction. PC = %08X\n", PC));
}
else
{
@@ -1929,6 +1803,8 @@ static void hyperstone_movd(void)
PC = SET_PC(SREG);
change_pc(PC);
SR = (SREGF & 0xffe00000) | ((SREG & 0x01) << 18 ) | (SREGF & 0x3ffff);
+ if (hyperstone.intblock < 1)
+ hyperstone.intblock = 1;
hyperstone.instruction_length = 0; // undefined
@@ -1959,7 +1835,7 @@ static void hyperstone_movd(void)
}
//TODO: no 1!
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
else if( SRC_IS_SR ) // Rd doesn't denote PC and Rs denotes SR
{
@@ -1968,7 +1844,7 @@ static void hyperstone_movd(void)
SET_Z(1);
SET_N(0);
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
else // Rd doesn't denote PC and Rs doesn't denote SR
{
@@ -1981,21 +1857,21 @@ static void hyperstone_movd(void)
SET_Z( tmp == 0 ? 1 : 0 );
SET_N( SIGN_BIT(SREG) );
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
}
-static void hyperstone_divu(void)
+INLINE void hyperstone_divu(struct regs_decode *decode)
{
if( SAME_SRC_DST || SAME_SRC_DSTF )
{
- logerror("Denoted the same register code in hyperstone_divu instruction. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted the same register code in hyperstone_divu instruction. PC = %08X\n", PC));
}
else
{
if( SRC_IS_PC || SRC_IS_SR )
{
- logerror("Denoted PC or SR as source register in hyperstone_divu instruction. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR as source register in hyperstone_divu instruction. PC = %08X\n", PC));
}
else
{
@@ -2031,20 +1907,20 @@ static void hyperstone_divu(void)
}
}
- hyperstone_ICount -= 36;
+ hyperstone_ICount -= 36 << hyperstone.clock_scale;
}
-static void hyperstone_divs(void)
+INLINE void hyperstone_divs(struct regs_decode *decode)
{
if( SAME_SRC_DST || SAME_SRC_DSTF )
{
- logerror("Denoted the same register code in hyperstone_divs instruction. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted the same register code in hyperstone_divs instruction. PC = %08X\n", PC));
}
else
{
if( SRC_IS_PC || SRC_IS_SR )
{
- logerror("Denoted PC or SR as source register in hyperstone_divs instruction. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR as source register in hyperstone_divs instruction. PC = %08X\n", PC));
}
else
{
@@ -2080,18 +1956,18 @@ static void hyperstone_divs(void)
}
}
- hyperstone_ICount -= 36;
+ hyperstone_ICount -= 36 << hyperstone.clock_scale;
}
-static void hyperstone_xm(void)
+INLINE void hyperstone_xm(struct regs_decode *decode)
{
if( SRC_IS_SR || DST_IS_SR || DST_IS_PC )
{
- logerror("Denoted PC or SR in hyperstone_xm. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR in hyperstone_xm. PC = %08X\n", PC));
}
else
{
- switch( current_regs.sub_type ) // x_code
+ switch( decode->sub_type ) // x_code
{
case 0:
case 1:
@@ -2109,7 +1985,7 @@ static void hyperstone_xm(void)
}
else
{
- SREG <<= current_regs.sub_type;
+ SREG <<= decode->sub_type;
}
break;
@@ -2118,8 +1994,8 @@ static void hyperstone_xm(void)
case 5:
case 6:
case 7:
- current_regs.sub_type -= 4;
- SREG <<= current_regs.sub_type;
+ decode->sub_type -= 4;
+ SREG <<= decode->sub_type;
break;
}
@@ -2127,20 +2003,20 @@ static void hyperstone_xm(void)
SET_DREG(SREG);
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_mask(void)
+INLINE void hyperstone_mask(struct regs_decode *decode)
{
DREG = SREG & EXTRA_U;
SET_DREG(DREG);
SET_Z( DREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_sum(void)
+INLINE void hyperstone_sum(struct regs_decode *decode)
{
UINT64 tmp;
@@ -2161,10 +2037,10 @@ static void hyperstone_sum(void)
SET_Z( DREG == 0 ? 1 : 0 );
SET_N( SIGN_BIT(DREG) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_sums(void)
+INLINE void hyperstone_sums(struct regs_decode *decode)
{
INT32 res;
INT64 tmp;
@@ -2186,7 +2062,7 @@ static void hyperstone_sums(void)
SET_Z( res == 0 ? 1 : 0 );
SET_N( SIGN_BIT(res) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
if( GET_V && !SRC_IS_SR )
{
@@ -2195,7 +2071,7 @@ static void hyperstone_sums(void)
}
}
-static void hyperstone_cmp(void)
+INLINE void hyperstone_cmp(struct regs_decode *decode)
{
UINT64 tmp;
@@ -2220,12 +2096,12 @@ static void hyperstone_cmp(void)
else
SET_C(0);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_mov(void)
+INLINE void hyperstone_mov(struct regs_decode *decode)
{
- if( !GET_S && current_regs.dst >= 16 )
+ if( !GET_S && decode->dst >= 16 )
{
UINT32 addr = get_trap_addr(PRIVILEGE_ERROR);
execute_exception(addr);
@@ -2239,11 +2115,11 @@ static void hyperstone_mov(void)
SET_Z( SREG == 0 ? 1 : 0 );
SET_N( SIGN_BIT(SREG) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_add(void)
+INLINE void hyperstone_add(struct regs_decode *decode)
{
UINT64 tmp;
@@ -2263,10 +2139,10 @@ static void hyperstone_add(void)
SET_Z( DREG == 0 ? 1 : 0 );
SET_N( SIGN_BIT(DREG) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_adds(void)
+INLINE void hyperstone_adds(struct regs_decode *decode)
{
INT32 res;
INT64 tmp;
@@ -2288,7 +2164,7 @@ static void hyperstone_adds(void)
SET_Z( res == 0 ? 1 : 0 );
SET_N( SIGN_BIT(res) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
if( GET_V )
{
@@ -2297,44 +2173,44 @@ static void hyperstone_adds(void)
}
}
-static void hyperstone_cmpb(void)
+INLINE void hyperstone_cmpb(struct regs_decode *decode)
{
SET_Z( (DREG & SREG) == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_andn(void)
+INLINE void hyperstone_andn(struct regs_decode *decode)
{
DREG = DREG & ~SREG;
SET_DREG(DREG);
SET_Z( DREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_or(void)
+INLINE void hyperstone_or(struct regs_decode *decode)
{
DREG = DREG | SREG;
SET_DREG(DREG);
SET_Z( DREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_xor(void)
+INLINE void hyperstone_xor(struct regs_decode *decode)
{
DREG = DREG ^ SREG;
SET_DREG(DREG);
SET_Z( DREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_subc(void)
+INLINE void hyperstone_subc(struct regs_decode *decode)
{
UINT64 tmp;
@@ -2367,18 +2243,18 @@ static void hyperstone_subc(void)
SET_Z( GET_Z & (DREG == 0 ? 1 : 0) );
SET_N( SIGN_BIT(DREG) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_not(void)
+INLINE void hyperstone_not(struct regs_decode *decode)
{
SET_DREG(~SREG);
SET_Z( ~SREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_sub(void)
+INLINE void hyperstone_sub(struct regs_decode *decode)
{
UINT64 tmp;
@@ -2398,10 +2274,10 @@ static void hyperstone_sub(void)
SET_Z( DREG == 0 ? 1 : 0 );
SET_N( SIGN_BIT(DREG) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_subs(void)
+INLINE void hyperstone_subs(struct regs_decode *decode)
{
INT32 res;
INT64 tmp;
@@ -2424,7 +2300,7 @@ static void hyperstone_subs(void)
SET_Z( res == 0 ? 1 : 0 );
SET_N( SIGN_BIT(res) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
if( GET_V )
{
@@ -2433,7 +2309,7 @@ static void hyperstone_subs(void)
}
}
-static void hyperstone_addc(void)
+INLINE void hyperstone_addc(struct regs_decode *decode)
{
UINT64 tmp;
@@ -2471,20 +2347,20 @@ static void hyperstone_addc(void)
SET_Z( GET_Z & (DREG == 0 ? 1 : 0) );
SET_N( SIGN_BIT(DREG) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_and(void)
+INLINE void hyperstone_and(struct regs_decode *decode)
{
DREG = DREG & SREG;
SET_DREG(DREG);
SET_Z( DREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_neg(void)
+INLINE void hyperstone_neg(struct regs_decode *decode)
{
UINT64 tmp;
@@ -2502,10 +2378,10 @@ static void hyperstone_neg(void)
SET_Z( DREG == 0 ? 1 : 0 );
SET_N( SIGN_BIT(DREG) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_negs(void)
+INLINE void hyperstone_negs(struct regs_decode *decode)
{
INT32 res;
INT64 tmp;
@@ -2528,7 +2404,7 @@ static void hyperstone_negs(void)
SET_N( SIGN_BIT(res) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
if( GET_V && !SRC_IS_SR ) //trap doesn't occur when source is SR
{
@@ -2537,7 +2413,7 @@ static void hyperstone_negs(void)
}
}
-static void hyperstone_cmpi(void)
+INLINE void hyperstone_cmpi(struct regs_decode *decode)
{
UINT64 tmp;
@@ -2559,12 +2435,12 @@ static void hyperstone_cmpi(void)
else
SET_C(0);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_movi(void)
+INLINE void hyperstone_movi(struct regs_decode *decode)
{
- if( !GET_S && current_regs.dst >= 16 )
+ if( !GET_S && decode->dst >= 16 )
{
UINT32 addr = get_trap_addr(PRIVILEGE_ERROR);
execute_exception(addr);
@@ -2582,10 +2458,10 @@ static void hyperstone_movi(void)
SET_V(0); // or V undefined ?
#endif
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_addi(void)
+INLINE void hyperstone_addi(struct regs_decode *decode)
{
UINT32 imm;
UINT64 tmp;
@@ -2609,10 +2485,10 @@ static void hyperstone_addi(void)
SET_Z( DREG == 0 ? 1 : 0 );
SET_N( SIGN_BIT(DREG) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_addsi(void)
+INLINE void hyperstone_addsi(struct regs_decode *decode)
{
INT32 imm, res;
INT64 tmp;
@@ -2636,7 +2512,7 @@ static void hyperstone_addsi(void)
SET_Z( res == 0 ? 1 : 0 );
SET_N( SIGN_BIT(res) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
if( GET_V )
{
@@ -2645,7 +2521,7 @@ static void hyperstone_addsi(void)
}
}
-static void hyperstone_cmpbi(void)
+INLINE void hyperstone_cmpbi(struct regs_decode *decode)
{
UINT32 imm;
@@ -2671,10 +2547,10 @@ static void hyperstone_cmpbi(void)
SET_Z(0);
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_andni(void)
+INLINE void hyperstone_andni(struct regs_decode *decode)
{
UINT32 imm;
@@ -2688,30 +2564,30 @@ static void hyperstone_andni(void)
SET_DREG(DREG);
SET_Z( DREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_ori(void)
+INLINE void hyperstone_ori(struct regs_decode *decode)
{
DREG = DREG | EXTRA_U;
SET_DREG(DREG);
SET_Z( DREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_xori(void)
+INLINE void hyperstone_xori(struct regs_decode *decode)
{
DREG = DREG ^ EXTRA_U;
SET_DREG(DREG);
SET_Z( DREG == 0 ? 1 : 0 );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_shrdi(void)
+INLINE void hyperstone_shrdi(struct regs_decode *decode)
{
UINT32 low_order, high_order;
UINT64 val;
@@ -2736,10 +2612,10 @@ static void hyperstone_shrdi(void)
SET_Z( val == 0 ? 1 : 0 );
SET_N( SIGN_BIT(high_order) );
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_shrd(void)
+INLINE void hyperstone_shrd(struct regs_decode *decode)
{
UINT32 low_order, high_order;
UINT64 val;
@@ -2748,7 +2624,7 @@ static void hyperstone_shrd(void)
// result undefined if Ls denotes the same register as Ld or Ldf
if( SAME_SRC_DST || SAME_SRC_DSTF )
{
- logerror("Denoted same registers in hyperstone_shrd. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted same registers in hyperstone_shrd. PC = %08X\n", PC));
}
else
{
@@ -2774,10 +2650,10 @@ static void hyperstone_shrd(void)
SET_N( SIGN_BIT(high_order) );
}
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_shr(void)
+INLINE void hyperstone_shr(struct regs_decode *decode)
{
UINT32 ret;
UINT8 n;
@@ -2796,10 +2672,10 @@ static void hyperstone_shr(void)
SET_Z( ret == 0 ? 1 : 0 );
SET_N( SIGN_BIT(ret) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_sardi(void)
+INLINE void hyperstone_sardi(struct regs_decode *decode)
{
UINT32 low_order, high_order;
UINT64 val;
@@ -2836,10 +2712,10 @@ static void hyperstone_sardi(void)
SET_Z( val == 0 ? 1 : 0 );
SET_N( SIGN_BIT(high_order) );
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_sard(void)
+INLINE void hyperstone_sard(struct regs_decode *decode)
{
UINT32 low_order, high_order;
UINT64 val;
@@ -2850,7 +2726,7 @@ static void hyperstone_sard(void)
// result undefined if Ls denotes the same register as Ld or Ldf
if( SAME_SRC_DST || SAME_SRC_DSTF )
{
- logerror("Denoted same registers in hyperstone_sard. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted same registers in hyperstone_sard. PC = %08X\n", PC));
}
else
{
@@ -2886,10 +2762,10 @@ static void hyperstone_sard(void)
SET_N( SIGN_BIT(high_order) );
}
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_sar(void)
+INLINE void hyperstone_sar(struct regs_decode *decode)
{
UINT32 ret;
UINT8 n, sign_bit;
@@ -2918,10 +2794,10 @@ static void hyperstone_sar(void)
SET_Z( ret == 0 ? 1 : 0 );
SET_N( SIGN_BIT(ret) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_shldi(void)
+INLINE void hyperstone_shldi(struct regs_decode *decode)
{
UINT32 low_order, high_order, tmp;
UINT64 val, mask;
@@ -2951,10 +2827,10 @@ static void hyperstone_shldi(void)
SET_Z( val == 0 ? 1 : 0 );
SET_N( SIGN_BIT(high_order) );
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_shld(void)
+INLINE void hyperstone_shld(struct regs_decode *decode)
{
UINT32 low_order, high_order, tmp, n;
UINT64 val, mask;
@@ -2964,7 +2840,7 @@ static void hyperstone_shld(void)
// result undefined if Ls denotes the same register as Ld or Ldf
if( SAME_SRC_DST || SAME_SRC_DSTF )
{
- logerror("Denoted same registers in hyperstone_shld. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted same registers in hyperstone_shld. PC = %08X\n", PC));
}
else
{
@@ -2995,10 +2871,10 @@ static void hyperstone_shld(void)
SET_N( SIGN_BIT(high_order) );
}
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_shl(void)
+INLINE void hyperstone_shl(struct regs_decode *decode)
{
UINT32 base, ret, n;
UINT64 mask;
@@ -3019,15 +2895,15 @@ static void hyperstone_shl(void)
SET_Z( ret == 0 ? 1 : 0 );
SET_N( SIGN_BIT(ret) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void reserved(void)
+static void reserved(struct regs_decode *decode)
{
- logerror("Executed Reserved opcode. PC = %08X OP = %04X\n", PC, OP);
+ DEBUG_PRINTF(("Executed Reserved opcode. PC = %08X OP = %04X\n", PC, OP));
}
-static void hyperstone_testlz(void)
+INLINE void hyperstone_testlz(struct regs_decode *decode)
{
UINT8 zeros = 0;
UINT32 mask;
@@ -3045,10 +2921,10 @@ static void hyperstone_testlz(void)
SET_DREG(zeros);
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_rol(void)
+INLINE void hyperstone_rol(struct regs_decode *decode)
{
UINT32 val, base;
UINT8 n;
@@ -3081,17 +2957,17 @@ static void hyperstone_rol(void)
SET_Z( val == 0 ? 1 : 0 );
SET_N( SIGN_BIT(val) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
//TODO: add trap error
-static void hyperstone_ldxx1(void)
+INLINE void hyperstone_ldxx1(struct regs_decode *decode)
{
UINT32 load;
if( DST_IS_SR )
{
- switch( current_regs.sub_type )
+ switch( decode->sub_type )
{
case 0: // LDBS.A
@@ -3137,7 +3013,7 @@ static void hyperstone_ldxx1(void)
load = IO_READ_W((EXTRA_S & ~3) + 4);
SET_SREGF(load);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else if( (EXTRA_S & 3) == 2 ) // LDW.IOA
{
@@ -3152,7 +3028,7 @@ static void hyperstone_ldxx1(void)
load = READ_W((EXTRA_S & ~1) + 4);
SET_SREGF(load);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else // LDW.A
{
@@ -3165,7 +3041,7 @@ static void hyperstone_ldxx1(void)
}
else
{
- switch( current_regs.sub_type )
+ switch( decode->sub_type )
{
case 0: // LDBS.D
@@ -3211,7 +3087,7 @@ static void hyperstone_ldxx1(void)
load = IO_READ_W(DREG + (EXTRA_S & ~3) + 4);
SET_SREGF(load);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else if( (EXTRA_S & 3) == 2 ) // LDW.IOD
{
@@ -3226,7 +3102,7 @@ static void hyperstone_ldxx1(void)
load = READ_W(DREG + (EXTRA_S & ~1) + 4);
SET_SREGF(load);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else // LDW.D
{
@@ -3238,25 +3114,25 @@ static void hyperstone_ldxx1(void)
}
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_ldxx2(void)
+INLINE void hyperstone_ldxx2(struct regs_decode *decode)
{
UINT32 load;
if( DST_IS_PC || DST_IS_SR )
{
- logerror("Denoted PC or SR in hyperstone_ldxx2. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR in hyperstone_ldxx2. PC = %08X\n", PC));
}
else
{
- switch( current_regs.sub_type )
+ switch( decode->sub_type )
{
case 0: // LDBS.N
if(SAME_SRC_DST)
- popmessage("LDBS.N denoted same regs @ %08X",PPC);
+ DEBUG_PRINTF(("LDBS.N denoted same regs @ %08X",PPC));
load = READ_B(DREG);
load |= (load & 0x80) ? 0xffffff00 : 0;
@@ -3270,7 +3146,7 @@ static void hyperstone_ldxx2(void)
case 1: // LDBU.N
if(SAME_SRC_DST)
- popmessage("LDBU.N denoted same regs @ %08X",PPC);
+ DEBUG_PRINTF(("LDBU.N denoted same regs @ %08X",PPC));
load = READ_B(DREG);
SET_SREG(load);
@@ -3289,7 +3165,7 @@ static void hyperstone_ldxx2(void)
load |= (load & 0x8000) ? 0xffff0000 : 0;
if(SAME_SRC_DST)
- popmessage("LDHS.N denoted same regs @ %08X",PPC);
+ DEBUG_PRINTF(("LDHS.N denoted same regs @ %08X",PPC));
}
/*
else // LDHU.N
@@ -3310,7 +3186,7 @@ static void hyperstone_ldxx2(void)
if( (EXTRA_S & 3) == 3 ) // LDW.S
{
if(SAME_SRC_DST)
- popmessage("LDW.S denoted same regs @ %08X",PPC);
+ DEBUG_PRINTF(("LDW.S denoted same regs @ %08X",PPC));
if(DREG < SP)
SET_SREG(READ_W(DREG));
@@ -3320,16 +3196,16 @@ static void hyperstone_ldxx2(void)
if(!SAME_SRC_DST)
SET_DREG(DREG + (EXTRA_S & ~3));
- hyperstone_ICount -= 2; // extra cycles
+ hyperstone_ICount -= hyperstone.clock_cycles_2; // extra cycles
}
else if( (EXTRA_S & 3) == 2 ) // Reserved
{
- logerror("Executed Reserved instruction in hyperstone_ldxx2. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Executed Reserved instruction in hyperstone_ldxx2. PC = %08X\n", PC));
}
else if( (EXTRA_S & 3) == 1 ) // LDD.N
{
if(SAME_SRC_DST || SAME_SRCF_DST)
- popmessage("LDD.N denoted same regs @ %08X",PPC);
+ DEBUG_PRINTF(("LDD.N denoted same regs @ %08X",PPC));
load = READ_W(DREG);
SET_SREG(load);
@@ -3340,12 +3216,12 @@ static void hyperstone_ldxx2(void)
if(!SAME_SRC_DST && !SAME_SRCF_DST)
SET_DREG(DREG + (EXTRA_S & ~1));
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else // LDW.N
{
if(SAME_SRC_DST)
- popmessage("LDW.N denoted same regs @ %08X",PPC);
+ DEBUG_PRINTF(("LDW.N denoted same regs @ %08X",PPC));
load = READ_W(DREG);
SET_SREG(load);
@@ -3358,18 +3234,18 @@ static void hyperstone_ldxx2(void)
}
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
//TODO: add trap error
-static void hyperstone_stxx1(void)
+INLINE void hyperstone_stxx1(struct regs_decode *decode)
{
if( SRC_IS_SR )
SREG = SREGF = 0;
if( DST_IS_SR )
{
- switch( current_regs.sub_type )
+ switch( decode->sub_type )
{
case 0: // STBS.A
@@ -3408,7 +3284,7 @@ static void hyperstone_stxx1(void)
IO_WRITE_W(EXTRA_S & ~3, SREG);
IO_WRITE_W((EXTRA_S & ~3) + 4, SREGF);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else if( (EXTRA_S & 3) == 2 ) // STW.IOA
{
@@ -3419,7 +3295,7 @@ static void hyperstone_stxx1(void)
WRITE_W(EXTRA_S & ~1, SREG);
WRITE_W((EXTRA_S & ~1) + 4, SREGF);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else // STW.A
{
@@ -3431,7 +3307,7 @@ static void hyperstone_stxx1(void)
}
else
{
- switch( current_regs.sub_type )
+ switch( decode->sub_type )
{
case 0: // STBS.D
@@ -3470,7 +3346,7 @@ static void hyperstone_stxx1(void)
IO_WRITE_W(DREG + (EXTRA_S & ~3), SREG);
IO_WRITE_W(DREG + (EXTRA_S & ~3) + 4, SREGF);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else if( (EXTRA_S & 3) == 2 ) // STW.IOD
{
@@ -3481,7 +3357,7 @@ static void hyperstone_stxx1(void)
WRITE_W(DREG + (EXTRA_S & ~1), SREG);
WRITE_W(DREG + (EXTRA_S & ~1) + 4, SREGF);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else // STW.D
{
@@ -3492,21 +3368,21 @@ static void hyperstone_stxx1(void)
}
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_stxx2(void)
+INLINE void hyperstone_stxx2(struct regs_decode *decode)
{
if( SRC_IS_SR )
SREG = SREGF = 0;
if( DST_IS_PC || DST_IS_SR )
{
- logerror("Denoted PC or SR in hyperstone_stxx2. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR in hyperstone_stxx2. PC = %08X\n", PC));
}
else
{
- switch( current_regs.sub_type )
+ switch( decode->sub_type )
{
case 0: // STBS.N
@@ -3549,20 +3425,20 @@ static void hyperstone_stxx2(void)
WRITE_W(DREG, SREG);
else
{
- if(((DREG & 0xfc) >> 2) == ((current_regs.src + GET_FP) % 64) && S_BIT == LOCAL)
- popmessage("STW.S denoted the same local register @ %08X\n",PPC);
+ if(((DREG & 0xfc) >> 2) == ((decode->src + GET_FP) % 64) && S_BIT == LOCAL)
+ DEBUG_PRINTF(("STW.S denoted the same local register @ %08X\n",PPC));
SET_ABS_L_REG((DREG & 0xfc) >> 2,SREG);
}
SET_DREG(DREG + (EXTRA_S & ~3));
- hyperstone_ICount -= 2; // extra cycles
+ hyperstone_ICount -= hyperstone.clock_cycles_2; // extra cycles
}
else if( (EXTRA_S & 3) == 2 ) // Reserved
{
- logerror("Executed Reserved instruction in hyperstone_stxx2. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Executed Reserved instruction in hyperstone_stxx2. PC = %08X\n", PC));
}
else if( (EXTRA_S & 3) == 1 ) // STD.N
{
@@ -3574,7 +3450,7 @@ static void hyperstone_stxx2(void)
else
WRITE_W(DREG + 4, SREGF);
- hyperstone_ICount -= 1; // extra cycle
+ hyperstone_ICount -= hyperstone.clock_cycles_1; // extra cycle
}
else // STW.N
{
@@ -3586,10 +3462,10 @@ static void hyperstone_stxx2(void)
}
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_shri(void)
+INLINE void hyperstone_shri(struct regs_decode *decode)
{
UINT32 val;
@@ -3606,10 +3482,10 @@ static void hyperstone_shri(void)
SET_Z( val == 0 ? 1 : 0 );
SET_N( SIGN_BIT(val) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_sari(void)
+INLINE void hyperstone_sari(struct regs_decode *decode)
{
UINT32 val;
UINT8 sign_bit;
@@ -3637,10 +3513,10 @@ static void hyperstone_sari(void)
SET_Z( val == 0 ? 1 : 0 );
SET_N( SIGN_BIT(val) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_shli(void)
+INLINE void hyperstone_shli(struct regs_decode *decode)
{
UINT32 val, val2;
UINT64 mask;
@@ -3660,10 +3536,10 @@ static void hyperstone_shli(void)
SET_Z( val2 == 0 ? 1 : 0 );
SET_N( SIGN_BIT(val2) );
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_mulu(void)
+INLINE void hyperstone_mulu(struct regs_decode *decode)
{
UINT32 low_order, high_order;
UINT64 double_word;
@@ -3671,7 +3547,7 @@ static void hyperstone_mulu(void)
// PC or SR aren't denoted, else result is undefined
if( SRC_IS_PC || SRC_IS_SR || DST_IS_PC || DST_IS_SR )
{
- logerror("Denoted PC or SR in hyperstone_mulu instruction. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR in hyperstone_mulu instruction. PC = %08X\n", PC));
}
else
{
@@ -3688,12 +3564,12 @@ static void hyperstone_mulu(void)
}
if(SREG <= 0xffff && DREG <= 0xffff)
- hyperstone_ICount -= 4;
+ hyperstone_ICount -= hyperstone.clock_cycles_4;
else
- hyperstone_ICount -= 6;
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_muls(void)
+INLINE void hyperstone_muls(struct regs_decode *decode)
{
UINT32 low_order, high_order;
INT64 double_word;
@@ -3701,7 +3577,7 @@ static void hyperstone_muls(void)
// PC or SR aren't denoted, else result is undefined
if( SRC_IS_PC || SRC_IS_SR || DST_IS_PC || DST_IS_SR )
{
- logerror("Denoted PC or SR in hyperstone_muls instruction. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR in hyperstone_muls instruction. PC = %08X\n", PC));
}
else
{
@@ -3717,25 +3593,25 @@ static void hyperstone_muls(void)
}
if((SREG >= 0xffff8000 && SREG <= 0x7fff) && (DREG >= 0xffff8000 && DREG <= 0x7fff))
- hyperstone_ICount -= 4;
+ hyperstone_ICount -= hyperstone.clock_cycles_4;
else
- hyperstone_ICount -= 6;
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_set(void)
+INLINE void hyperstone_set(struct regs_decode *decode)
{
int n = N_VALUE;
if( DST_IS_PC )
{
- logerror("Denoted PC in hyperstone_set. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC in hyperstone_set. PC = %08X\n", PC));
}
else if( DST_IS_SR )
{
//TODO: add fetch opcode when there's the pipeline
//TODO: no 1!
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
else
{
@@ -3759,7 +3635,7 @@ static void hyperstone_set(void)
case 16:
case 17:
case 19:
- logerror("Used reserved N value (%d) in hyperstone_set. PC = %08X\n", n, PC);
+ DEBUG_PRINTF(("Used reserved N value (%d) in hyperstone_set. PC = %08X\n", n, PC));
break;
// SETxx
@@ -4064,18 +3940,18 @@ static void hyperstone_set(void)
break;
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
}
-static void hyperstone_mul(void)
+INLINE void hyperstone_mul(struct regs_decode *decode)
{
UINT32 single_word;
// PC or SR aren't denoted, else result is undefined
if( SRC_IS_PC || SRC_IS_SR || DST_IS_PC || DST_IS_SR )
{
- logerror("Denoted PC or SR in hyperstone_mul instruction. PC = %08X\n", PC);
+ DEBUG_PRINTF(("Denoted PC or SR in hyperstone_mul instruction. PC = %08X\n", PC));
}
else
{
@@ -4088,96 +3964,96 @@ static void hyperstone_mul(void)
}
if((SREG >= 0xffff8000 && SREG <= 0x7fff) && (DREG >= 0xffff8000 && DREG <= 0x7fff))
- hyperstone_ICount -= 3;
+ hyperstone_ICount -= 3 << hyperstone.clock_scale;
else
- hyperstone_ICount -= 5;
+ hyperstone_ICount -= 5 << hyperstone.clock_scale;
}
-static void hyperstone_fadd(void)
+INLINE void hyperstone_fadd(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_faddd(void)
+INLINE void hyperstone_faddd(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fsub(void)
+INLINE void hyperstone_fsub(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fsubd(void)
+INLINE void hyperstone_fsubd(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fmul(void)
+INLINE void hyperstone_fmul(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fmuld(void)
+INLINE void hyperstone_fmuld(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fdiv(void)
+INLINE void hyperstone_fdiv(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fdivd(void)
+INLINE void hyperstone_fdivd(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fcmp(void)
+INLINE void hyperstone_fcmp(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fcmpd(void)
+INLINE void hyperstone_fcmpd(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fcmpu(void)
+INLINE void hyperstone_fcmpu(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fcmpud(void)
+INLINE void hyperstone_fcmpud(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fcvt(void)
+INLINE void hyperstone_fcvt(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_fcvtd(void)
+INLINE void hyperstone_fcvtd(struct regs_decode *decode)
{
- execute_software();
- hyperstone_ICount -= 6;
+ execute_software(decode);
+ hyperstone_ICount -= hyperstone.clock_cycles_6;
}
-static void hyperstone_extend(void)
+INLINE void hyperstone_extend(struct regs_decode *decode)
{
//TODO: add locks, overflow error and other things
UINT32 vals, vald;
@@ -4371,75 +4247,75 @@ static void hyperstone_extend(void)
break;
}
default:
- logerror("Executed Illegal extended opcode (%X). PC = %08X\n", EXTRA_U, PC);
+ DEBUG_PRINTF(("Executed Illegal extended opcode (%X). PC = %08X\n", EXTRA_U, PC));
break;
}
- hyperstone_ICount -= 1; //TODO: with the latency it can change
+ hyperstone_ICount -= hyperstone.clock_cycles_1; //TODO: with the latency it can change
}
-static void hyperstone_do(void)
+INLINE void hyperstone_do(struct regs_decode *decode)
{
fatalerror("Executed hyperstone_do instruction. PC = %08X", PPC);
}
-static void hyperstone_ldwr(void)
+INLINE void hyperstone_ldwr(struct regs_decode *decode)
{
SET_SREG(READ_W(DREG));
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_lddr(void)
+INLINE void hyperstone_lddr(struct regs_decode *decode)
{
SET_SREG(READ_W(DREG));
SET_SREGF(READ_W(DREG + 4));
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_ldwp(void)
+INLINE void hyperstone_ldwp(struct regs_decode *decode)
{
SET_SREG(READ_W(DREG));
// post increment the destination register if it's different from the source one
// (needed by Hidden Catch)
- if(!(current_regs.src == current_regs.dst && S_BIT == LOCAL))
+ if(!(decode->src == decode->dst && S_BIT == LOCAL))
SET_DREG(DREG + 4);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_lddp(void)
+INLINE void hyperstone_lddp(struct regs_decode *decode)
{
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
- if(!(current_regs.src == current_regs.dst && S_BIT == LOCAL) && !SAME_SRCF_DST )
+ if(!(decode->src == decode->dst && S_BIT == LOCAL) && !SAME_SRCF_DST )
{
SET_DREG(DREG + 8);
}
else
{
- popmessage("LDD.P denoted same regs @ %08X",PPC);
+ DEBUG_PRINTF(("LDD.P denoted same regs @ %08X",PPC));
}
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_stwr(void)
+INLINE void hyperstone_stwr(struct regs_decode *decode)
{
if( SRC_IS_SR )
SREG = 0;
WRITE_W(DREG, SREG);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_stdr(void)
+INLINE void hyperstone_stdr(struct regs_decode *decode)
{
if( SRC_IS_SR )
SREG = SREGF = 0;
@@ -4447,10 +4323,10 @@ static void hyperstone_stdr(void)
WRITE_W(DREG, SREG);
WRITE_W(DREG + 4, SREGF);
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_stwp(void)
+INLINE void hyperstone_stwp(struct regs_decode *decode)
{
if( SRC_IS_SR )
SREG = 0;
@@ -4458,10 +4334,10 @@ static void hyperstone_stwp(void)
WRITE_W(DREG, SREG);
SET_DREG(DREG + 4);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_stdp(void)
+INLINE void hyperstone_stdp(struct regs_decode *decode)
{
if( SRC_IS_SR )
SREG = SREGF = 0;
@@ -4474,111 +4350,111 @@ static void hyperstone_stdp(void)
else
WRITE_W(DREG + 4, SREGF);
- hyperstone_ICount -= 2;
+ hyperstone_ICount -= hyperstone.clock_cycles_2;
}
-static void hyperstone_dbv(void)
+INLINE void hyperstone_dbv(struct regs_decode *decode)
{
if( GET_V )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbnv(void)
+INLINE void hyperstone_dbnv(struct regs_decode *decode)
{
if( !GET_V )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbe(void) //or DBZ
+INLINE void hyperstone_dbe(struct regs_decode *decode) //or DBZ
{
if( GET_Z )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbne(void) //or DBNZ
+INLINE void hyperstone_dbne(struct regs_decode *decode) //or DBNZ
{
if( !GET_Z )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbc(void) //or DBST
+INLINE void hyperstone_dbc(struct regs_decode *decode) //or DBST
{
if( GET_C )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbnc(void) //or DBHE
+INLINE void hyperstone_dbnc(struct regs_decode *decode) //or DBHE
{
if( !GET_C )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbse(void)
+INLINE void hyperstone_dbse(struct regs_decode *decode)
{
if( GET_C || GET_Z )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbht(void)
+INLINE void hyperstone_dbht(struct regs_decode *decode)
{
if( !GET_C && !GET_Z )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbn(void) //or DBLT
+INLINE void hyperstone_dbn(struct regs_decode *decode) //or DBLT
{
if( GET_N )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbnn(void) //or DBGE
+INLINE void hyperstone_dbnn(struct regs_decode *decode) //or DBGE
{
if( !GET_N )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dble(void)
+INLINE void hyperstone_dble(struct regs_decode *decode)
{
if( GET_N || GET_Z )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbgt(void)
+INLINE void hyperstone_dbgt(struct regs_decode *decode)
{
if( !GET_N && !GET_Z )
- execute_dbr();
+ execute_dbr(decode);
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_dbr(void)
+INLINE void hyperstone_dbr(struct regs_decode *decode)
{
- execute_dbr();
+ execute_dbr(decode);
}
-static void hyperstone_frame(void)
+INLINE void hyperstone_frame(struct regs_decode *decode)
{
INT8 difference; // really it's 7 bits
UINT8 realfp = GET_FP - SRC_CODE;
@@ -4617,16 +4493,16 @@ static void hyperstone_frame(void)
}
//TODO: no 1!
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_call(void)
+INLINE void hyperstone_call(struct regs_decode *decode)
{
if( SRC_IS_SR )
SREG = 0;
if( !DST_CODE )
- current_regs.dst = 16;
+ decode->dst = 16;
EXTRA_S = (EXTRA_S & ~1) + SREG;
@@ -4635,7 +4511,7 @@ static void hyperstone_call(void)
SET_DREG((PC & 0xfffffffe) | GET_S);
SET_DREGF(SR);
- SET_FP(GET_FP + current_regs.dst);
+ SET_FP(GET_FP + decode->dst);
SET_FL(6); //default value for call
SET_M(0);
@@ -4649,111 +4525,111 @@ static void hyperstone_call(void)
//TODO: add interrupt locks, errors, ....
//TODO: no 1!
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bv(void)
+INLINE void hyperstone_bv(struct regs_decode *decode)
{
if( GET_V )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bnv(void)
+INLINE void hyperstone_bnv(struct regs_decode *decode)
{
if( !GET_V )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_be(void) //or BZ
+INLINE void hyperstone_be(struct regs_decode *decode) //or BZ
{
if( GET_Z )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bne(void) //or BNZ
+INLINE void hyperstone_bne(struct regs_decode *decode) //or BNZ
{
if( !GET_Z )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bc(void) //or BST
+INLINE void hyperstone_bc(struct regs_decode *decode) //or BST
{
if( GET_C )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bnc(void) //or BHE
+INLINE void hyperstone_bnc(struct regs_decode *decode) //or BHE
{
if( !GET_C )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bse(void)
+INLINE void hyperstone_bse(struct regs_decode *decode)
{
if( GET_C || GET_Z )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bht(void)
+INLINE void hyperstone_bht(struct regs_decode *decode)
{
if( !GET_C && !GET_Z )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bn(void) //or BLT
+INLINE void hyperstone_bn(struct regs_decode *decode) //or BLT
{
if( GET_N )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bnn(void) //or BGE
+INLINE void hyperstone_bnn(struct regs_decode *decode) //or BGE
{
if( !GET_N )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_ble(void)
+INLINE void hyperstone_ble(struct regs_decode *decode)
{
if( GET_N || GET_Z )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_bgt(void)
+INLINE void hyperstone_bgt(struct regs_decode *decode)
{
if( !GET_N && !GET_Z )
- execute_br();
+ execute_br(decode);
else
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
}
-static void hyperstone_br(void)
+INLINE void hyperstone_br(struct regs_decode *decode)
{
- execute_br();
+ execute_br(decode);
}
-static void hyperstone_trap(void)
+INLINE void hyperstone_trap(struct regs_decode *decode)
{
UINT8 code, trapno;
UINT32 addr;
@@ -4837,7 +4713,54 @@ static void hyperstone_trap(void)
break;
}
- hyperstone_ICount -= 1;
+ hyperstone_ICount -= hyperstone.clock_cycles_1;
+}
+
+
+#include "e132xsop.c"
+
+
+static int hyperstone_execute(int cycles)
+{
+ hyperstone_ICount = cycles;
+
+ if (hyperstone.intblock < 0)
+ hyperstone.intblock = 0;
+ check_interrupts();
+
+ do
+ {
+ UINT32 oldh = SR & 0x00000020;
+ UINT16 opcode;
+
+ PPC = PC; /* copy PC to previous PC */
+ CALL_MAME_DEBUG;
+
+ opcode = READ_OP(PC);
+ PC += 2;
+
+ hyperstone.instruction_length = 1;
+
+ /* execute opcode */
+ (*hyperstone_op[(opcode & 0xff00) >> 8])(opcode);
+
+ /* clear the H state if it was previously set */
+ SR ^= oldh;
+
+ SET_ILC(hyperstone.instruction_length & 3);
+
+ if( GET_T && GET_P && hyperstone.delay.delay_cmd == NO_DELAY ) /* Not in a Delayed Branch instructions */
+ {
+ UINT32 addr = get_trap_addr(TRACE_EXCEPTION);
+ execute_exception(addr);
+ }
+
+ if (--hyperstone.intblock == 0)
+ check_interrupts();
+
+ } while( hyperstone_ICount > 0 );
+
+ return cycles - hyperstone_ICount;
}
@@ -4855,36 +4778,36 @@ static void hyperstone_set_info(UINT32 state, cpuinfo *info)
case CPUINFO_INT_REGISTER + E132XS_PC: PC = info->i; change_pc(PC); 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: hyperstone.global_regs[3] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G4: hyperstone.global_regs[4] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G5: hyperstone.global_regs[5] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G6: hyperstone.global_regs[6] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G7: hyperstone.global_regs[7] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G8: hyperstone.global_regs[8] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G9: hyperstone.global_regs[9] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G10: hyperstone.global_regs[10] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G11: hyperstone.global_regs[11] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G12: hyperstone.global_regs[12] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G13: hyperstone.global_regs[13] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G14: hyperstone.global_regs[14] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G15: hyperstone.global_regs[15] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G16: hyperstone.global_regs[16] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G17: hyperstone.global_regs[17] = info->i; break;
+ case CPUINFO_INT_REGISTER + E132XS_G3: set_global_register(3, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G4: set_global_register(4, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G5: set_global_register(5, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G6: set_global_register(6, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G7: set_global_register(7, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G8: set_global_register(8, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G9: set_global_register(9, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G10: set_global_register(10, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G11: set_global_register(11, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G12: set_global_register(12, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G13: set_global_register(13, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G14: set_global_register(14, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G15: set_global_register(15, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G16: set_global_register(16, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G17: set_global_register(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: TR = info->i; break;
+ case CPUINFO_INT_REGISTER + E132XS_TR: set_global_register(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: hyperstone.global_regs[28] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G29: hyperstone.global_regs[29] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G30: hyperstone.global_regs[30] = info->i; break;
- case CPUINFO_INT_REGISTER + E132XS_G31: hyperstone.global_regs[31] = info->i; break;
+ case CPUINFO_INT_REGISTER + E132XS_G28: set_global_register(28, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G29: set_global_register(29, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G30: set_global_register(30, info->i); break;
+ case CPUINFO_INT_REGISTER + E132XS_G31: set_global_register(31, info->i); break;
case CPUINFO_INT_REGISTER + E132XS_CL0: hyperstone.local_regs[(0 + GET_FP) % 64] = info->i; break;
case CPUINFO_INT_REGISTER + E132XS_CL1: hyperstone.local_regs[(1 + GET_FP) % 64] = info->i; break;
case CPUINFO_INT_REGISTER + E132XS_CL2: hyperstone.local_regs[(2 + GET_FP) % 64] = info->i; break;
@@ -4981,7 +4904,7 @@ static void hyperstone_set_info(UINT32 state, cpuinfo *info)
* Generic get_info
**************************************************************************/
-void hyperstone_get_info(UINT32 state, cpuinfo *info)
+static void hyperstone_get_info(UINT32 state, cpuinfo *info)
{
switch (state)
{
@@ -5012,21 +4935,21 @@ void hyperstone_get_info(UINT32 state, cpuinfo *info)
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 = hyperstone.global_regs[3]; break;
- case CPUINFO_INT_REGISTER + E132XS_G4: info->i = hyperstone.global_regs[4]; break;
- case CPUINFO_INT_REGISTER + E132XS_G5: info->i = hyperstone.global_regs[5]; break;
- case CPUINFO_INT_REGISTER + E132XS_G6: info->i = hyperstone.global_regs[6]; break;
- case CPUINFO_INT_REGISTER + E132XS_G7: info->i = hyperstone.global_regs[7]; break;
- case CPUINFO_INT_REGISTER + E132XS_G8: info->i = hyperstone.global_regs[8]; break;
- case CPUINFO_INT_REGISTER + E132XS_G9: info->i = hyperstone.global_regs[9]; break;
- case CPUINFO_INT_REGISTER + E132XS_G10: info->i = hyperstone.global_regs[10]; break;
- case CPUINFO_INT_REGISTER + E132XS_G11: info->i = hyperstone.global_regs[11]; break;
- case CPUINFO_INT_REGISTER + E132XS_G12: info->i = hyperstone.global_regs[12]; break;
- case CPUINFO_INT_REGISTER + E132XS_G13: info->i = hyperstone.global_regs[13]; break;
- case CPUINFO_INT_REGISTER + E132XS_G14: info->i = hyperstone.global_regs[14]; break;
- case CPUINFO_INT_REGISTER + E132XS_G15: info->i = hyperstone.global_regs[15]; break;
- case CPUINFO_INT_REGISTER + E132XS_G16: info->i = hyperstone.global_regs[16]; break;
- case CPUINFO_INT_REGISTER + E132XS_G17: info->i = hyperstone.global_regs[17]; break;
+ case CPUINFO_INT_REGISTER + E132XS_G3: info->i = get_global_register(3); break;
+ case CPUINFO_INT_REGISTER + E132XS_G4: info->i = get_global_register(4); break;
+ case CPUINFO_INT_REGISTER + E132XS_G5: info->i = get_global_register(5); break;
+ case CPUINFO_INT_REGISTER + E132XS_G6: info->i = get_global_register(6); break;
+ case CPUINFO_INT_REGISTER + E132XS_G7: info->i = get_global_register(7); break;
+ case CPUINFO_INT_REGISTER + E132XS_G8: info->i = get_global_register(8); break;
+ case CPUINFO_INT_REGISTER + E132XS_G9: info->i = get_global_register(9); break;
+ case CPUINFO_INT_REGISTER + E132XS_G10: info->i = get_global_register(10); break;
+ case CPUINFO_INT_REGISTER + E132XS_G11: info->i = get_global_register(11); break;
+ case CPUINFO_INT_REGISTER + E132XS_G12: info->i = get_global_register(12); break;
+ case CPUINFO_INT_REGISTER + E132XS_G13: info->i = get_global_register(13); break;
+ case CPUINFO_INT_REGISTER + E132XS_G14: info->i = get_global_register(14); break;
+ case CPUINFO_INT_REGISTER + E132XS_G15: info->i = get_global_register(15); break;
+ case CPUINFO_INT_REGISTER + E132XS_G16: info->i = get_global_register(16); break;
+ case CPUINFO_INT_REGISTER + E132XS_G17: info->i = get_global_register(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;
@@ -5038,10 +4961,10 @@ void hyperstone_get_info(UINT32 state, cpuinfo *info)
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 = hyperstone.global_regs[28]; break;
- case CPUINFO_INT_REGISTER + E132XS_G29: info->i = hyperstone.global_regs[29]; break;
- case CPUINFO_INT_REGISTER + E132XS_G30: info->i = hyperstone.global_regs[30]; break;
- case CPUINFO_INT_REGISTER + E132XS_G31: info->i = hyperstone.global_regs[31]; break;
+ case CPUINFO_INT_REGISTER + E132XS_G28: info->i = get_global_register(28); break;
+ case CPUINFO_INT_REGISTER + E132XS_G29: info->i = get_global_register(29); break;
+ case CPUINFO_INT_REGISTER + E132XS_G30: info->i = get_global_register(30); break;
+ case CPUINFO_INT_REGISTER + E132XS_G31: info->i = get_global_register(31); break;
case CPUINFO_INT_REGISTER + E132XS_CL0: info->i = hyperstone.local_regs[(0 + GET_FP) % 64]; break;
case CPUINFO_INT_REGISTER + E132XS_CL1: info->i = hyperstone.local_regs[(1 + GET_FP) % 64]; break;
case CPUINFO_INT_REGISTER + E132XS_CL2: info->i = hyperstone.local_regs[(2 + GET_FP) % 64]; break;
@@ -5127,7 +5050,7 @@ void hyperstone_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_SET_INFO: info->setinfo = hyperstone_set_info; break;
case CPUINFO_PTR_GET_CONTEXT: info->getcontext = hyperstone_get_context; break;
case CPUINFO_PTR_SET_CONTEXT: info->setcontext = hyperstone_set_context; break;
- case CPUINFO_PTR_INIT: info->init = hyperstone_init; break;
+ case CPUINFO_PTR_INIT: info->init = NULL; break;
case CPUINFO_PTR_RESET: info->reset = hyperstone_reset; break;
case CPUINFO_PTR_EXIT: info->exit = hyperstone_exit; break;
case CPUINFO_PTR_EXECUTE: info->execute = hyperstone_execute; break;
@@ -5295,7 +5218,7 @@ void e116t_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e116_4k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e116_init; break;
+ case CPUINFO_PTR_INIT: info->init = e116t_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-16T"); break;
@@ -5318,7 +5241,7 @@ void e116xt_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e116_8k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e116_init; break;
+ case CPUINFO_PTR_INIT: info->init = e116xt_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XT"); break;
@@ -5341,7 +5264,7 @@ void e116xs_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e116_16k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e116_init; break;
+ case CPUINFO_PTR_INIT: info->init = e116xs_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XS"); break;
@@ -5364,7 +5287,7 @@ void e116xsr_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e116_16k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e116_init; break;
+ case CPUINFO_PTR_INIT: info->init = e116xsr_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-16XSR"); break;
@@ -5387,7 +5310,7 @@ void e132n_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e132_4k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e132_init; break;
+ case CPUINFO_PTR_INIT: info->init = e132n_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-32N"); break;
@@ -5410,7 +5333,7 @@ void e132t_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e132_4k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e132_init; break;
+ case CPUINFO_PTR_INIT: info->init = e132t_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-32T"); break;
@@ -5433,7 +5356,7 @@ void e132xn_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e132_8k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e132_init; break;
+ case CPUINFO_PTR_INIT: info->init = e132xn_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XN"); break;
@@ -5456,7 +5379,7 @@ void e132xt_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e132_8k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e132_init; break;
+ case CPUINFO_PTR_INIT: info->init = e132xt_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XT"); break;
@@ -5479,7 +5402,7 @@ void e132xs_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e132_16k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e132_init; break;
+ case CPUINFO_PTR_INIT: info->init = e132xs_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XS"); break;
@@ -5502,7 +5425,7 @@ void e132xsr_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e132_16k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e132_init; break;
+ case CPUINFO_PTR_INIT: info->init = e132xsr_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "E1-32XSR"); break;
@@ -5525,7 +5448,7 @@ void gms30c2116_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e116_4k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e116_init; break;
+ case CPUINFO_PTR_INIT: info->init = gms30c2116_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2116"); break;
@@ -5548,7 +5471,7 @@ void gms30c2132_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e132_4k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e132_init; break;
+ case CPUINFO_PTR_INIT: info->init = gms30c2132_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2132"); break;
@@ -5571,7 +5494,7 @@ void gms30c2216_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e116_8k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e116_init; break;
+ case CPUINFO_PTR_INIT: info->init = gms30c2216_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2216"); break;
@@ -5594,7 +5517,7 @@ void gms30c2232_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_e132_8k_iram_map; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
- case CPUINFO_PTR_INIT: info->init = e132_init; break;
+ case CPUINFO_PTR_INIT: info->init = gms30c2232_init; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "GMS30C2232"); break;
diff --git a/src/emu/cpu/e132xs/e132xs.h b/src/emu/cpu/e132xs/e132xs.h
index ed9a899a504..6494bcbed68 100644
--- a/src/emu/cpu/e132xs/e132xs.h
+++ b/src/emu/cpu/e132xs/e132xs.h
@@ -3,6 +3,22 @@
#include "cpuintrf.h"
+/*
+ A note about clock multipliers and dividers:
+
+ E1-16[T] and E1-32[T] accept a straight clock
+
+ E1-16X[T|N] and E1-32X[T|N] accept a clock and multiply it
+ internally by 4; in the emulator, you MUST specify 4 * XTAL
+ to achieve the correct speed
+
+ E1-16XS[R] and E1-32XS[R] accept a clock and multiply it
+ internally by 8; in the emulator, you MUST specify 8 * XTAL
+ to achieve the correct speed
+*/
+
+
+
/* Functions */
#if (HAS_E116T)
@@ -98,6 +114,8 @@ extern int hyp_type_16bit;
#define SR_REGISTER 1
#define BCR_REGISTER 20
#define TPR_REGISTER 21
+#define TCR_REGISTER 22
+#define TR_REGISTER 23
#define ISR_REGISTER 25
#define FCR_REGISTER 26
#define MCR_REGISTER 27
@@ -127,7 +145,15 @@ extern int hyp_type_16bit;
/* Delay values */
#define NO_DELAY 0
#define DELAY_EXECUTE 1
-#define DELAY_TAKEN 2
+
+/* IRQ numbers */
+#define IRQ_INT1 0
+#define IRQ_INT2 1
+#define IRQ_INT3 2
+#define IRQ_INT4 3
+#define IRQ_IO1 4
+#define IRQ_IO2 5
+#define IRQ_IO3 6
/* Trap numbers */
#define IO2 48
diff --git a/src/emu/cpu/e132xs/e132xsop.c b/src/emu/cpu/e132xs/e132xsop.c
new file mode 100644
index 00000000000..5c610189632
--- /dev/null
+++ b/src/emu/cpu/e132xs/e132xsop.c
@@ -0,0 +1,1926 @@
+#define LOCAL_DECODE_INIT \
+ struct regs_decode decode_state; \
+ struct regs_decode *decode = &decode_state; \
+\
+ /* clear 'current regs / flags' */ \
+ decode->src = 0; \
+ decode->dst = 0; \
+ decode->src_value = 0; \
+ decode->next_src_value = 0; \
+ decode->dst_value = 0; \
+ decode->next_dst_value = 0; \
+ decode->sub_type = 0; \
+ decode->extra.u = 0; \
+ decode->src_is_local = 0; \
+ decode->dst_is_local = 0; \
+ decode->same_src_dst = 0; \
+ decode->same_src_dstf = 0; \
+ decode->same_srcf_dst = 0; \
+ decode->op = opcode; \
+
+
+static void hyperstone_op00(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_chk(decode);
+}
+
+static void hyperstone_op01(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_chk(decode);
+}
+
+static void hyperstone_op02(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_chk(decode);
+}
+
+static void hyperstone_op03(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_chk(decode);
+}
+
+static void hyperstone_op04(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_movd(decode);
+}
+
+static void hyperstone_op05(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_movd(decode);
+}
+
+static void hyperstone_op06(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_movd(decode);
+}
+
+static void hyperstone_op07(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_movd(decode);
+}
+
+static void hyperstone_op08(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_divu(decode);
+}
+
+static void hyperstone_op09(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_divu(decode);
+}
+
+static void hyperstone_op0a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_divu(decode);
+}
+
+static void hyperstone_op0b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_divu(decode);
+}
+
+static void hyperstone_op0c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_divs(decode);
+}
+
+static void hyperstone_op0d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_divs(decode);
+}
+
+static void hyperstone_op0e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_divs(decode);
+}
+
+static void hyperstone_op0f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_divs(decode);
+}
+
+
+
+static void hyperstone_op10(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRlimdecode(decode, 0, 0);
+ hyperstone_xm(decode);
+}
+
+static void hyperstone_op11(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRlimdecode(decode, 0, 1);
+ hyperstone_xm(decode);
+}
+
+static void hyperstone_op12(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRlimdecode(decode, 1, 0);
+ hyperstone_xm(decode);
+}
+
+static void hyperstone_op13(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRlimdecode(decode, 1, 1);
+ hyperstone_xm(decode);
+}
+
+static void hyperstone_op14(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 0, 0);
+ hyperstone_mask(decode);
+}
+
+static void hyperstone_op15(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 0, 1);
+ hyperstone_mask(decode);
+}
+
+static void hyperstone_op16(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 1, 0);
+ hyperstone_mask(decode);
+}
+
+static void hyperstone_op17(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 1, 1);
+ hyperstone_mask(decode);
+}
+
+static void hyperstone_op18(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 0, 0);
+ hyperstone_sum(decode);
+}
+
+static void hyperstone_op19(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 0, 1);
+ hyperstone_sum(decode);
+}
+
+static void hyperstone_op1a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 1, 0);
+ hyperstone_sum(decode);
+}
+
+static void hyperstone_op1b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 1, 1);
+ hyperstone_sum(decode);
+}
+
+static void hyperstone_op1c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 0, 0);
+ hyperstone_sums(decode);
+}
+
+static void hyperstone_op1d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 0, 1);
+ hyperstone_sums(decode);
+}
+
+static void hyperstone_op1e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 1, 0);
+ hyperstone_sums(decode);
+}
+
+static void hyperstone_op1f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRconstdecode(decode, 1, 1);
+ hyperstone_sums(decode);
+}
+
+
+
+static void hyperstone_op20(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_cmp(decode);
+}
+
+static void hyperstone_op21(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_cmp(decode);
+}
+
+static void hyperstone_op22(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_cmp(decode);
+}
+
+static void hyperstone_op23(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_cmp(decode);
+}
+
+static void hyperstone_op24(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecodewithHflag(decode, 0, 0);
+ hyperstone_mov(decode);
+}
+
+static void hyperstone_op25(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecodewithHflag(decode, 0, 1);
+ hyperstone_mov(decode);
+}
+
+static void hyperstone_op26(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecodewithHflag(decode, 1, 0);
+ hyperstone_mov(decode);
+}
+
+static void hyperstone_op27(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecodewithHflag(decode, 1, 1);
+ hyperstone_mov(decode);
+}
+
+static void hyperstone_op28(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_add(decode);
+}
+
+static void hyperstone_op29(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_add(decode);
+}
+
+static void hyperstone_op2a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_add(decode);
+}
+
+static void hyperstone_op2b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_add(decode);
+}
+
+static void hyperstone_op2c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_adds(decode);
+}
+
+static void hyperstone_op2d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_adds(decode);
+}
+
+static void hyperstone_op2e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_adds(decode);
+}
+
+static void hyperstone_op2f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_adds(decode);
+}
+
+
+
+static void hyperstone_op30(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_cmpb(decode);
+}
+
+static void hyperstone_op31(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_cmpb(decode);
+}
+
+static void hyperstone_op32(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_cmpb(decode);
+}
+
+static void hyperstone_op33(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_cmpb(decode);
+}
+
+static void hyperstone_op34(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_andn(decode);
+}
+
+static void hyperstone_op35(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_andn(decode);
+}
+
+static void hyperstone_op36(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_andn(decode);
+}
+
+static void hyperstone_op37(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_andn(decode);
+}
+
+static void hyperstone_op38(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_or(decode);
+}
+
+static void hyperstone_op39(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_or(decode);
+}
+
+static void hyperstone_op3a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_or(decode);
+}
+
+static void hyperstone_op3b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_or(decode);
+}
+
+static void hyperstone_op3c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_xor(decode);
+}
+
+static void hyperstone_op3d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_xor(decode);
+}
+
+static void hyperstone_op3e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_xor(decode);
+}
+
+static void hyperstone_op3f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_xor(decode);
+}
+
+
+
+static void hyperstone_op40(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_subc(decode);
+}
+
+static void hyperstone_op41(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_subc(decode);
+}
+
+static void hyperstone_op42(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_subc(decode);
+}
+
+static void hyperstone_op43(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_subc(decode);
+}
+
+static void hyperstone_op44(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_not(decode);
+}
+
+static void hyperstone_op45(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_not(decode);
+}
+
+static void hyperstone_op46(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_not(decode);
+}
+
+static void hyperstone_op47(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_not(decode);
+}
+
+static void hyperstone_op48(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_sub(decode);
+}
+
+static void hyperstone_op49(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_sub(decode);
+}
+
+static void hyperstone_op4a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_sub(decode);
+}
+
+static void hyperstone_op4b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_sub(decode);
+}
+
+static void hyperstone_op4c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_subs(decode);
+}
+
+static void hyperstone_op4d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_subs(decode);
+}
+
+static void hyperstone_op4e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_subs(decode);
+}
+
+static void hyperstone_op4f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_subs(decode);
+}
+
+
+
+static void hyperstone_op50(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_addc(decode);
+}
+
+static void hyperstone_op51(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_addc(decode);
+}
+
+static void hyperstone_op52(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_addc(decode);
+}
+
+static void hyperstone_op53(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_addc(decode);
+}
+
+static void hyperstone_op54(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_and(decode);
+}
+
+static void hyperstone_op55(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_and(decode);
+}
+
+static void hyperstone_op56(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_and(decode);
+}
+
+static void hyperstone_op57(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_and(decode);
+}
+
+static void hyperstone_op58(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_neg(decode);
+}
+
+static void hyperstone_op59(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_neg(decode);
+}
+
+static void hyperstone_op5a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_neg(decode);
+}
+
+static void hyperstone_op5b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_neg(decode);
+}
+
+static void hyperstone_op5c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_negs(decode);
+}
+
+static void hyperstone_op5d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_negs(decode);
+}
+
+static void hyperstone_op5e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_negs(decode);
+}
+
+static void hyperstone_op5f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_negs(decode);
+}
+
+
+
+static void hyperstone_op60(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 0);
+ hyperstone_cmpi(decode);
+}
+
+static void hyperstone_op61(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 1);
+ hyperstone_cmpi(decode);
+}
+
+static void hyperstone_op62(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 0);
+ hyperstone_cmpi(decode);
+}
+
+static void hyperstone_op63(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 1);
+ hyperstone_cmpi(decode);
+}
+
+static void hyperstone_op64(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RimmdecodewithHflag(decode, 0, 0);
+ hyperstone_movi(decode);
+}
+
+static void hyperstone_op65(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RimmdecodewithHflag(decode, 0, 1);
+ hyperstone_movi(decode);
+}
+
+static void hyperstone_op66(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RimmdecodewithHflag(decode, 1, 0);
+ hyperstone_movi(decode);
+}
+
+static void hyperstone_op67(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RimmdecodewithHflag(decode, 1, 1);
+ hyperstone_movi(decode);
+}
+
+static void hyperstone_op68(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 0);
+ hyperstone_addi(decode);
+}
+
+static void hyperstone_op69(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 1);
+ hyperstone_addi(decode);
+}
+
+static void hyperstone_op6a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 0);
+ hyperstone_addi(decode);
+}
+
+static void hyperstone_op6b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 1);
+ hyperstone_addi(decode);
+}
+
+static void hyperstone_op6c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 0);
+ hyperstone_addsi(decode);
+}
+
+static void hyperstone_op6d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 1);
+ hyperstone_addsi(decode);
+}
+
+static void hyperstone_op6e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 0);
+ hyperstone_addsi(decode);
+}
+
+static void hyperstone_op6f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 1);
+ hyperstone_addsi(decode);
+}
+
+
+
+static void hyperstone_op70(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 0);
+ hyperstone_cmpbi(decode);
+}
+
+static void hyperstone_op71(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 1);
+ hyperstone_cmpbi(decode);
+}
+
+static void hyperstone_op72(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 0);
+ hyperstone_cmpbi(decode);
+}
+
+static void hyperstone_op73(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 1);
+ hyperstone_cmpbi(decode);
+}
+
+static void hyperstone_op74(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 0);
+ hyperstone_andni(decode);
+}
+
+static void hyperstone_op75(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 1);
+ hyperstone_andni(decode);
+}
+
+static void hyperstone_op76(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 0);
+ hyperstone_andni(decode);
+}
+
+static void hyperstone_op77(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 1);
+ hyperstone_andni(decode);
+}
+
+static void hyperstone_op78(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 0);
+ hyperstone_ori(decode);
+}
+
+static void hyperstone_op79(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 1);
+ hyperstone_ori(decode);
+}
+
+static void hyperstone_op7a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 0);
+ hyperstone_ori(decode);
+}
+
+static void hyperstone_op7b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 1);
+ hyperstone_ori(decode);
+}
+
+static void hyperstone_op7c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 0);
+ hyperstone_xori(decode);
+}
+
+static void hyperstone_op7d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 0, 1);
+ hyperstone_xori(decode);
+}
+
+static void hyperstone_op7e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 0);
+ hyperstone_xori(decode);
+}
+
+static void hyperstone_op7f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rimmdecode(decode, 1, 1);
+ hyperstone_xori(decode);
+}
+
+
+
+static void hyperstone_op80(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Lndecode(decode);
+ hyperstone_shrdi(decode);
+}
+
+static void hyperstone_op81(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Lndecode(decode);
+ hyperstone_shrdi(decode);
+}
+
+static void hyperstone_op82(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_shrd(decode);
+}
+
+static void hyperstone_op83(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_shr(decode);
+}
+
+static void hyperstone_op84(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Lndecode(decode);
+ hyperstone_sardi(decode);
+}
+
+static void hyperstone_op85(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Lndecode(decode);
+ hyperstone_sardi(decode);
+}
+
+static void hyperstone_op86(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_sard(decode);
+}
+
+static void hyperstone_op87(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_sar(decode);
+}
+
+static void hyperstone_op88(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Lndecode(decode);
+ hyperstone_shldi(decode);
+}
+
+static void hyperstone_op89(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Lndecode(decode);
+ hyperstone_shldi(decode);
+}
+
+static void hyperstone_op8a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_shld(decode);
+}
+
+static void hyperstone_op8b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_shl(decode);
+}
+
+static void hyperstone_op8c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ no_decode(decode);
+ reserved(decode);
+}
+
+static void hyperstone_op8d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ no_decode(decode);
+ reserved(decode);
+}
+
+static void hyperstone_op8e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_testlz(decode);
+}
+
+static void hyperstone_op8f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_rol(decode);
+}
+
+
+
+static void hyperstone_op90(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 0, 0);
+ hyperstone_ldxx1(decode);
+}
+
+static void hyperstone_op91(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 0, 1);
+ hyperstone_ldxx1(decode);
+}
+
+static void hyperstone_op92(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 1, 0);
+ hyperstone_ldxx1(decode);
+}
+
+static void hyperstone_op93(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 1, 1);
+ hyperstone_ldxx1(decode);
+}
+
+static void hyperstone_op94(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 0, 0);
+ hyperstone_ldxx2(decode);
+}
+
+static void hyperstone_op95(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 0, 1);
+ hyperstone_ldxx2(decode);
+}
+
+static void hyperstone_op96(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 1, 0);
+ hyperstone_ldxx2(decode);
+}
+
+static void hyperstone_op97(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 1, 1);
+ hyperstone_ldxx2(decode);
+}
+
+static void hyperstone_op98(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 0, 0);
+ hyperstone_stxx1(decode);
+}
+
+static void hyperstone_op99(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 0, 1);
+ hyperstone_stxx1(decode);
+}
+
+static void hyperstone_op9a(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 1, 0);
+ hyperstone_stxx1(decode);
+}
+
+static void hyperstone_op9b(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 1, 1);
+ hyperstone_stxx1(decode);
+}
+
+static void hyperstone_op9c(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 0, 0);
+ hyperstone_stxx2(decode);
+}
+
+static void hyperstone_op9d(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 0, 1);
+ hyperstone_stxx2(decode);
+}
+
+static void hyperstone_op9e(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 1, 0);
+ hyperstone_stxx2(decode);
+}
+
+static void hyperstone_op9f(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdisdecode(decode, 1, 1);
+ hyperstone_stxx2(decode);
+}
+
+
+
+static void hyperstone_opa0(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 0);
+ hyperstone_shri(decode);
+}
+
+static void hyperstone_opa1(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 0);
+ hyperstone_shri(decode);
+}
+
+static void hyperstone_opa2(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 1);
+ hyperstone_shri(decode);
+}
+
+static void hyperstone_opa3(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 1);
+ hyperstone_shri(decode);
+}
+
+static void hyperstone_opa4(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 0);
+ hyperstone_sari(decode);
+}
+
+static void hyperstone_opa5(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 0);
+ hyperstone_sari(decode);
+}
+
+static void hyperstone_opa6(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 1);
+ hyperstone_sari(decode);
+}
+
+static void hyperstone_opa7(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 1);
+ hyperstone_sari(decode);
+}
+
+static void hyperstone_opa8(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 0);
+ hyperstone_shli(decode);
+}
+
+static void hyperstone_opa9(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 0);
+ hyperstone_shli(decode);
+}
+
+static void hyperstone_opaa(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 1);
+ hyperstone_shli(decode);
+}
+
+static void hyperstone_opab(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 1);
+ hyperstone_shli(decode);
+}
+
+static void hyperstone_opac(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ no_decode(decode);
+ reserved(decode);
+}
+
+static void hyperstone_opad(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ no_decode(decode);
+ reserved(decode);
+}
+
+static void hyperstone_opae(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ no_decode(decode);
+ reserved(decode);
+}
+
+static void hyperstone_opaf(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ no_decode(decode);
+ reserved(decode);
+}
+
+
+
+static void hyperstone_opb0(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_mulu(decode);
+}
+
+static void hyperstone_opb1(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_mulu(decode);
+}
+
+static void hyperstone_opb2(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_mulu(decode);
+}
+
+static void hyperstone_opb3(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_mulu(decode);
+}
+
+static void hyperstone_opb4(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_muls(decode);
+}
+
+static void hyperstone_opb5(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_muls(decode);
+}
+
+static void hyperstone_opb6(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_muls(decode);
+}
+
+static void hyperstone_opb7(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_muls(decode);
+}
+
+static void hyperstone_opb8(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 0);
+ hyperstone_set(decode);
+}
+
+static void hyperstone_opb9(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 0);
+ hyperstone_set(decode);
+}
+
+static void hyperstone_opba(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 1);
+ hyperstone_set(decode);
+}
+
+static void hyperstone_opbb(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ Rndecode(decode, 1);
+ hyperstone_set(decode);
+}
+
+static void hyperstone_opbc(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 0);
+ hyperstone_mul(decode);
+}
+
+static void hyperstone_opbd(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 0, 1);
+ hyperstone_mul(decode);
+}
+
+static void hyperstone_opbe(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 0);
+ hyperstone_mul(decode);
+}
+
+static void hyperstone_opbf(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ RRdecode(decode, 1, 1);
+ hyperstone_mul(decode);
+}
+
+
+
+static void hyperstone_opc0(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fadd(decode);
+}
+
+static void hyperstone_opc1(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_faddd(decode);
+}
+
+static void hyperstone_opc2(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fsub(decode);
+}
+
+static void hyperstone_opc3(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fsubd(decode);
+}
+
+static void hyperstone_opc4(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fmul(decode);
+}
+
+static void hyperstone_opc5(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fmuld(decode);
+}
+
+static void hyperstone_opc6(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fdiv(decode);
+}
+
+static void hyperstone_opc7(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fdivd(decode);
+}
+
+static void hyperstone_opc8(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fcmp(decode);
+}
+
+static void hyperstone_opc9(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fcmpd(decode);
+}
+
+static void hyperstone_opca(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fcmpu(decode);
+}
+
+static void hyperstone_opcb(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fcmpud(decode);
+}
+
+static void hyperstone_opcc(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fcvt(decode);
+}
+
+static void hyperstone_opcd(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_fcvtd(decode);
+}
+
+static void hyperstone_opce(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLextdecode(decode);
+ hyperstone_extend(decode);
+}
+
+static void hyperstone_opcf(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_do(decode);
+}
+
+
+
+static void hyperstone_opd0(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 0);
+ hyperstone_ldwr(decode);
+}
+
+static void hyperstone_opd1(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 1);
+ hyperstone_ldwr(decode);
+}
+
+static void hyperstone_opd2(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 0);
+ hyperstone_lddr(decode);
+}
+
+static void hyperstone_opd3(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 1);
+ hyperstone_lddr(decode);
+}
+
+static void hyperstone_opd4(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 0);
+ hyperstone_ldwp(decode);
+}
+
+static void hyperstone_opd5(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 1);
+ hyperstone_ldwp(decode);
+}
+
+static void hyperstone_opd6(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 0);
+ hyperstone_lddp(decode);
+}
+
+static void hyperstone_opd7(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 1);
+ hyperstone_lddp(decode);
+}
+
+static void hyperstone_opd8(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 0);
+ hyperstone_stwr(decode);
+}
+
+static void hyperstone_opd9(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 1);
+ hyperstone_stwr(decode);
+}
+
+static void hyperstone_opda(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 0);
+ hyperstone_stdr(decode);
+}
+
+static void hyperstone_opdb(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 1);
+ hyperstone_stdr(decode);
+}
+
+static void hyperstone_opdc(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 0);
+ hyperstone_stwp(decode);
+}
+
+static void hyperstone_opdd(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 1);
+ hyperstone_stwp(decode);
+}
+
+static void hyperstone_opde(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 0);
+ hyperstone_stdp(decode);
+}
+
+static void hyperstone_opdf(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRdecode(decode, 1);
+ hyperstone_stdp(decode);
+}
+
+
+
+static void hyperstone_ope0(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbv(decode);
+}
+
+static void hyperstone_ope1(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbnv(decode);
+}
+
+static void hyperstone_ope2(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbe(decode);
+}
+
+static void hyperstone_ope3(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbne(decode);
+}
+
+static void hyperstone_ope4(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbc(decode);
+}
+
+static void hyperstone_ope5(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbnc(decode);
+}
+
+static void hyperstone_ope6(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbse(decode);
+}
+
+static void hyperstone_ope7(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbht(decode);
+}
+
+static void hyperstone_ope8(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbn(decode);
+}
+
+static void hyperstone_ope9(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbnn(decode);
+}
+
+static void hyperstone_opea(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dble(decode);
+}
+
+static void hyperstone_opeb(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbgt(decode);
+}
+
+static void hyperstone_opec(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_dbr(decode);
+}
+
+static void hyperstone_oped(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LLdecode(decode);
+ hyperstone_frame(decode);
+}
+
+static void hyperstone_opee(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRconstdecode(decode, 0);
+ hyperstone_call(decode);
+}
+
+static void hyperstone_opef(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ LRconstdecode(decode, 1);
+ hyperstone_call(decode);
+}
+
+
+
+static void hyperstone_opf0(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bv(decode);
+}
+
+static void hyperstone_opf1(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bnv(decode);
+}
+
+static void hyperstone_opf2(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_be(decode);
+}
+
+static void hyperstone_opf3(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bne(decode);
+}
+
+static void hyperstone_opf4(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bc(decode);
+}
+
+static void hyperstone_opf5(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bnc(decode);
+}
+
+static void hyperstone_opf6(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bse(decode);
+}
+
+static void hyperstone_opf7(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bht(decode);
+}
+
+static void hyperstone_opf8(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bn(decode);
+}
+
+static void hyperstone_opf9(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bnn(decode);
+}
+
+static void hyperstone_opfa(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_ble(decode);
+}
+
+static void hyperstone_opfb(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_bgt(decode);
+}
+
+static void hyperstone_opfc(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCreldecode(decode);
+ hyperstone_br(decode);
+}
+
+static void hyperstone_opfd(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCadrdecode(decode);
+ hyperstone_trap(decode);
+}
+
+static void hyperstone_opfe(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCadrdecode(decode);
+ hyperstone_trap(decode);
+}
+
+static void hyperstone_opff(UINT16 opcode)
+{
+ LOCAL_DECODE_INIT;
+ PCadrdecode(decode);
+ hyperstone_trap(decode);
+}
+
+
+static void (*hyperstone_op[0x100])(UINT16 opcode) =
+{
+ hyperstone_op00, hyperstone_op01, hyperstone_op02, hyperstone_op03,
+ hyperstone_op04, hyperstone_op05, hyperstone_op06, hyperstone_op07,
+ hyperstone_op08, hyperstone_op09, hyperstone_op0a, hyperstone_op0b,
+ hyperstone_op0c, hyperstone_op0d, hyperstone_op0e, hyperstone_op0f,
+
+ hyperstone_op10, hyperstone_op11, hyperstone_op12, hyperstone_op13,
+ hyperstone_op14, hyperstone_op15, hyperstone_op16, hyperstone_op17,
+ hyperstone_op18, hyperstone_op19, hyperstone_op1a, hyperstone_op1b,
+ hyperstone_op1c, hyperstone_op1d, hyperstone_op1e, hyperstone_op1f,
+
+ hyperstone_op20, hyperstone_op21, hyperstone_op22, hyperstone_op23,
+ hyperstone_op24, hyperstone_op25, hyperstone_op26, hyperstone_op27,
+ hyperstone_op28, hyperstone_op29, hyperstone_op2a, hyperstone_op2b,
+ hyperstone_op2c, hyperstone_op2d, hyperstone_op2e, hyperstone_op2f,
+
+ hyperstone_op30, hyperstone_op31, hyperstone_op32, hyperstone_op33,
+ hyperstone_op34, hyperstone_op35, hyperstone_op36, hyperstone_op37,
+ hyperstone_op38, hyperstone_op39, hyperstone_op3a, hyperstone_op3b,
+ hyperstone_op3c, hyperstone_op3d, hyperstone_op3e, hyperstone_op3f,
+
+ hyperstone_op40, hyperstone_op41, hyperstone_op42, hyperstone_op43,
+ hyperstone_op44, hyperstone_op45, hyperstone_op46, hyperstone_op47,
+ hyperstone_op48, hyperstone_op49, hyperstone_op4a, hyperstone_op4b,
+ hyperstone_op4c, hyperstone_op4d, hyperstone_op4e, hyperstone_op4f,
+
+ hyperstone_op50, hyperstone_op51, hyperstone_op52, hyperstone_op53,
+ hyperstone_op54, hyperstone_op55, hyperstone_op56, hyperstone_op57,
+ hyperstone_op58, hyperstone_op59, hyperstone_op5a, hyperstone_op5b,
+ hyperstone_op5c, hyperstone_op5d, hyperstone_op5e, hyperstone_op5f,
+
+ hyperstone_op60, hyperstone_op61, hyperstone_op62, hyperstone_op63,
+ hyperstone_op64, hyperstone_op65, hyperstone_op66, hyperstone_op67,
+ hyperstone_op68, hyperstone_op69, hyperstone_op6a, hyperstone_op6b,
+ hyperstone_op6c, hyperstone_op6d, hyperstone_op6e, hyperstone_op6f,
+
+ hyperstone_op70, hyperstone_op71, hyperstone_op72, hyperstone_op73,
+ hyperstone_op74, hyperstone_op75, hyperstone_op76, hyperstone_op77,
+ hyperstone_op78, hyperstone_op79, hyperstone_op7a, hyperstone_op7b,
+ hyperstone_op7c, hyperstone_op7d, hyperstone_op7e, hyperstone_op7f,
+
+ hyperstone_op80, hyperstone_op81, hyperstone_op82, hyperstone_op83,
+ hyperstone_op84, hyperstone_op85, hyperstone_op86, hyperstone_op87,
+ hyperstone_op88, hyperstone_op89, hyperstone_op8a, hyperstone_op8b,
+ hyperstone_op8c, hyperstone_op8d, hyperstone_op8e, hyperstone_op8f,
+
+ hyperstone_op90, hyperstone_op91, hyperstone_op92, hyperstone_op93,
+ hyperstone_op94, hyperstone_op95, hyperstone_op96, hyperstone_op97,
+ hyperstone_op98, hyperstone_op99, hyperstone_op9a, hyperstone_op9b,
+ hyperstone_op9c, hyperstone_op9d, hyperstone_op9e, hyperstone_op9f,
+
+ hyperstone_opa0, hyperstone_opa1, hyperstone_opa2, hyperstone_opa3,
+ hyperstone_opa4, hyperstone_opa5, hyperstone_opa6, hyperstone_opa7,
+ hyperstone_opa8, hyperstone_opa9, hyperstone_opaa, hyperstone_opab,
+ hyperstone_opac, hyperstone_opad, hyperstone_opae, hyperstone_opaf,
+
+ hyperstone_opb0, hyperstone_opb1, hyperstone_opb2, hyperstone_opb3,
+ hyperstone_opb4, hyperstone_opb5, hyperstone_opb6, hyperstone_opb7,
+ hyperstone_opb8, hyperstone_opb9, hyperstone_opba, hyperstone_opbb,
+ hyperstone_opbc, hyperstone_opbd, hyperstone_opbe, hyperstone_opbf,
+
+ hyperstone_opc0, hyperstone_opc1, hyperstone_opc2, hyperstone_opc3,
+ hyperstone_opc4, hyperstone_opc5, hyperstone_opc6, hyperstone_opc7,
+ hyperstone_opc8, hyperstone_opc9, hyperstone_opca, hyperstone_opcb,
+ hyperstone_opcc, hyperstone_opcd, hyperstone_opce, hyperstone_opcf,
+
+ hyperstone_opd0, hyperstone_opd1, hyperstone_opd2, hyperstone_opd3,
+ hyperstone_opd4, hyperstone_opd5, hyperstone_opd6, hyperstone_opd7,
+ hyperstone_opd8, hyperstone_opd9, hyperstone_opda, hyperstone_opdb,
+ hyperstone_opdc, hyperstone_opdd, hyperstone_opde, hyperstone_opdf,
+
+ hyperstone_ope0, hyperstone_ope1, hyperstone_ope2, hyperstone_ope3,
+ hyperstone_ope4, hyperstone_ope5, hyperstone_ope6, hyperstone_ope7,
+ hyperstone_ope8, hyperstone_ope9, hyperstone_opea, hyperstone_opeb,
+ hyperstone_opec, hyperstone_oped, hyperstone_opee, hyperstone_opef,
+
+ hyperstone_opf0, hyperstone_opf1, hyperstone_opf2, hyperstone_opf3,
+ hyperstone_opf4, hyperstone_opf5, hyperstone_opf6, hyperstone_opf7,
+ hyperstone_opf8, hyperstone_opf9, hyperstone_opfa, hyperstone_opfb,
+ hyperstone_opfc, hyperstone_opfd, hyperstone_opfe, hyperstone_opff
+};
diff --git a/src/emu/cpu/f8/f8.c b/src/emu/cpu/f8/f8.c
index 6e3ea1ec9ef..11041805639 100644
--- a/src/emu/cpu/f8/f8.c
+++ b/src/emu/cpu/f8/f8.c
@@ -56,7 +56,7 @@ typedef struct {
int irq_request;
} f8_Regs;
-int f8_icount;
+static int f8_icount;
static f8_Regs f8;
@@ -1531,7 +1531,7 @@ static void f8_ns_isar_d(void)
f8.is = (f8.is & 0x38) | ((f8.is - 1) & 0x07);
}
-void f8_reset(void)
+static void f8_reset(void)
{
UINT8 data;
int i;
@@ -1570,7 +1570,7 @@ void f8_reset(void)
}
/* Execute cycles - returns number of cycles actually run */
-int f8_execute(int cycles)
+static int f8_execute(int cycles)
{
f8_icount = cycles;
diff --git a/src/emu/cpu/h83002/h8periph.c b/src/emu/cpu/h83002/h8periph.c
index d410759830a..603434a0ba0 100644
--- a/src/emu/cpu/h83002/h8periph.c
+++ b/src/emu/cpu/h83002/h8periph.c
@@ -339,12 +339,14 @@ void h8_itu_write8(UINT8 reg, UINT8 val)
}
}
+#ifdef UNUSED_FUNCTION
UINT8 h8_debugger_itu_read8(UINT8 reg)
{
UINT8 val;
val = 0;
return val;
}
+#endif
UINT8 h8_register_read8(UINT32 address)
diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c
index 97bc972fbf2..c6c98a95f15 100644
--- a/src/emu/cpu/hd6309/hd6309.c
+++ b/src/emu/cpu/hd6309/hd6309.c
@@ -556,7 +556,7 @@ static void hd6309_reset(void)
UpdateState();
}
-void hd6309_exit(void)
+static void hd6309_exit(void)
{
/* nothing to do ? */
}
diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c
index e1cc92645fa..1a54df77947 100644
--- a/src/emu/cpu/i386/i386.c
+++ b/src/emu/cpu/i386/i386.c
@@ -55,7 +55,7 @@ static void i386_load_protected_mode_segment( I386_SREG *seg )
seg->d = (seg->flags & 0x4000) ? 1 : 0;
}
-void i386_load_segment_descriptor( int segment )
+static void i386_load_segment_descriptor( int segment )
{
if (PROTECTED_MODE)
{
@@ -496,7 +496,7 @@ static void i386_postload(void)
CHANGE_PC(I.eip);
}
-void i386_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void i386_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
int i, j;
static const int regs8[8] = {AL,CL,DL,BL,AH,CH,DH,BH};
@@ -614,7 +614,7 @@ static void build_opcode_table(UINT32 features)
}
}
-void i386_reset(void)
+static void i386_reset(void)
{
int (*save_irqcallback)(int);
@@ -696,7 +696,7 @@ static void i386_set_a20_line(int state)
}
}
-int i386_execute(int num_cycles)
+static int i386_execute(int num_cycles)
{
I.cycles = num_cycles;
I.base_cycles = num_cycles;
@@ -1067,7 +1067,7 @@ void i386_get_info(UINT32 state, cpuinfo *info)
#if (HAS_I486)
-void i486_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void i486_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
i386_init(index, clock, config, irqcallback);
}
@@ -1173,7 +1173,7 @@ void i486_get_info(UINT32 state, cpuinfo *info)
#if (HAS_PENTIUM)
-void pentium_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void pentium_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
i386_init(index, clock, config, irqcallback);
}
@@ -1299,7 +1299,7 @@ void pentium_get_info(UINT32 state, cpuinfo *info)
#if (HAS_MEDIAGX)
-void mediagx_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void mediagx_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
i386_init(index, clock, config, irqcallback);
}
diff --git a/src/emu/cpu/i8039/i8039.c b/src/emu/cpu/i8039/i8039.c
index 3c1f8df449c..05c7be91ac7 100644
--- a/src/emu/cpu/i8039/i8039.c
+++ b/src/emu/cpu/i8039/i8039.c
@@ -96,7 +96,7 @@ typedef struct
} I8039_Regs;
static I8039_Regs R;
-int i8039_ICount;
+static int i8039_ICount;
static int inst_cycles;
static UINT8 Old_T1;
diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c
index 11ea984e54d..c3983cbefc8 100644
--- a/src/emu/cpu/i8085/i8085.c
+++ b/src/emu/cpu/i8085/i8085.c
@@ -1261,7 +1261,7 @@ static void Interrupt(void)
}
}
-int i8085_execute(int cycles)
+static int i8085_execute(int cycles)
{
i8085_ICount = cycles;
@@ -1536,7 +1536,7 @@ static void i8085_set_irq_line(int irqline, int state)
**************************************************************************/
#if (HAS_8080)
-void i8080_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void i8080_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
init_tables();
I.cputype = 0;
@@ -1558,7 +1558,7 @@ void i8080_init(int index, int clock, const void *config, int (*irqcallback)(int
state_save_register_item_array("i8080", index, I.irq_state);
}
-void i8080_set_irq_line(int irqline, int state)
+static void i8080_set_irq_line(int irqline, int state)
{
if (irqline == INPUT_LINE_NMI)
{
diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c
index f4baf825069..f24daa0163b 100644
--- a/src/emu/cpu/i86/i286.c
+++ b/src/emu/cpu/i86/i286.c
@@ -65,7 +65,7 @@ typedef struct
memory_interface mem;
} i80286_Regs;
-int i80286_ICount;
+static int i80286_ICount;
static i80286_Regs I;
static unsigned prefix_base; /* base address of the latest prefix segment */
diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c
index 840e5b6d89e..0c3918a3015 100644
--- a/src/emu/cpu/i86/i86.c
+++ b/src/emu/cpu/i86/i86.c
@@ -57,7 +57,7 @@ i8086_Regs;
/* cpu state */
/***************************************************************************/
-int i8086_ICount;
+static int i8086_ICount;
static i8086_Regs I;
static unsigned prefix_base; /* base address of the latest prefix segment */
diff --git a/src/emu/cpu/i8x41/i8x41.c b/src/emu/cpu/i8x41/i8x41.c
index e5642bbabca..dbdb5e739c6 100644
--- a/src/emu/cpu/i8x41/i8x41.c
+++ b/src/emu/cpu/i8x41/i8x41.c
@@ -111,7 +111,7 @@ typedef struct {
int (*irq_callback)(int irqline);
} I8X41;
-int i8x41_ICount;
+static int i8x41_ICount;
static I8X41 i8x41;
diff --git a/src/emu/cpu/konami/konami.c b/src/emu/cpu/konami/konami.c
index d02753ac695..b9568c4dea4 100644
--- a/src/emu/cpu/konami/konami.c
+++ b/src/emu/cpu/konami/konami.c
@@ -167,8 +167,8 @@ static PAIR ea; /* effective address */
}
/* public globals */
-int konami_ICount=50000;
-int konami_Flags; /* flags for speed optimization (obsolete!!) */
+static int konami_ICount=50000;
+//int konami_Flags; /* flags for speed optimization (obsolete!!) */
/* these are re-defined in konami.h TO RAM, ROM or functions in memory.c */
#define RM(Addr) KONAMI_RDMEM(Addr)
diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c
index 5ce1a75b2c7..1ddad9434c2 100644
--- a/src/emu/cpu/m37710/m37710.c
+++ b/src/emu/cpu/m37710/m37710.c
@@ -56,12 +56,13 @@
#define M37710_DEBUG (0) // enables verbose logging for peripherals, etc.
-extern void m37710_set_irq_line(int line, int state);
+static void m37710_set_irq_line(int line, int state);
/* Our CPU structure */
m37710i_cpu_struct m37710i_cpu = {0};
-int m37710_ICount = 0, m37710_fullCount = 0;
+int m37710_ICount = 0;
+static int m37710_fullCount = 0;
/* Temporary Variables */
uint m37710i_source;
@@ -882,7 +883,7 @@ void m37710i_update_irqs(void)
/* external functions */
-void m37710_reset(void)
+static void m37710_reset(void)
{
/* Start the CPU */
CPU_STOPPED = 0;
@@ -927,6 +928,7 @@ void m37710_exit(void)
/* nothing to do yet */
}
+#ifdef UNUSED_FUNCTION
/* return elapsed cycles in the current slice */
int m37710_getcycles(void)
{
@@ -940,9 +942,10 @@ void m37710_yield(void)
m37710_ICount = 0;
}
+#endif
/* Execute some instructions */
-int m37710_execute(int cycles)
+static int m37710_execute(int cycles)
{
m37710_fullCount = cycles;
@@ -959,45 +962,47 @@ static void m37710_get_context(void *dst_context)
}
/* Set the current CPU context */
-void m37710_set_context(void *src_context)
+static void m37710_set_context(void *src_context)
{
m37710i_cpu = *(m37710i_cpu_struct*)src_context;
m37710i_jumping(REG_PB | REG_PC);
}
/* Get the current Program Counter */
+#ifdef UNUSED_FUNCTION
unsigned m37710_get_pc(void)
{
return REG_PC;
}
+#endif
/* Set the Program Counter */
-void m37710_set_pc(unsigned val)
+static void m37710_set_pc(unsigned val)
{
REG_PC = MAKE_UINT_16(val);
m37710_jumping(REG_PB | REG_PC);
}
/* Get the current Stack Pointer */
-unsigned m37710_get_sp(void)
+static unsigned m37710_get_sp(void)
{
return REG_S;
}
/* Set the Stack Pointer */
-void m37710_set_sp(unsigned val)
+static void m37710_set_sp(unsigned val)
{
REG_S = MAKE_UINT_16(val);
}
/* Get a register */
-unsigned m37710_get_reg(int regnum)
+static unsigned m37710_get_reg(int regnum)
{
return FTABLE_GET_REG(regnum);
}
/* Set a register */
-void m37710_set_reg(int regnum, unsigned value)
+static void m37710_set_reg(int regnum, unsigned value)
{
FTABLE_SET_REG(regnum, value);
}
@@ -1013,16 +1018,18 @@ void m37710_state_save(void *file)
}
/* Set an interrupt line */
-void m37710_set_irq_line(int line, int state)
+static void m37710_set_irq_line(int line, int state)
{
FTABLE_SET_LINE(line, state);
}
/* Set the callback that is called when servicing an interrupt */
+#ifdef UNUSED_FUNCTION
void m37710_set_irq_callback(int (*callback)(int))
{
INT_ACK = callback;
}
+#endif
/* Disassemble an instruction */
#ifdef MAME_DEBUG
@@ -1043,7 +1050,7 @@ static void m37710_restore_state(void)
m37710i_jumping(REG_PB | REG_PC);
}
-void m37710_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void m37710_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
INT_ACK = irqcallback;
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index 5964e86212f..3adbc951a5b 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -1299,7 +1299,7 @@ static void m6802_init(int index, int clock, const void *config, int (*irqcallba
* M6803 almost (fully?) equal to the M6801
****************************************************************************/
#if (HAS_M6803)
-void m6803_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void m6803_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
// m6800.subtype = SUBTYPE_M6803;
m6800.insn = m6803_insn;
diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c
index d10378f3e95..08c48034c33 100644
--- a/src/emu/cpu/mips/mips3drc.c
+++ b/src/emu/cpu/mips/mips3drc.c
@@ -550,7 +550,7 @@ static void mips3_set_info(UINT32 state, cpuinfo *info)
}
-void mips3_get_info(UINT32 state, cpuinfo *info)
+static void mips3_get_info(UINT32 state, cpuinfo *info)
{
switch (state)
{
diff --git a/src/emu/cpu/nec/nec.c b/src/emu/cpu/nec/nec.c
index 3dfc82a160e..cecab37285f 100644
--- a/src/emu/cpu/nec/nec.c
+++ b/src/emu/cpu/nec/nec.c
@@ -1145,12 +1145,12 @@ static void configure_memory_16bit(void)
/* Wrappers for the different CPU types */
#if (HAS_V20||HAS_V25)
-void v20_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void v20_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
nec_init(index, clock, config, irqcallback, 0);
configure_memory_8bit();
}
-int v20_execute(int cycles)
+static int v20_execute(int cycles)
{
nec_ICount=cycles;
chip_type=V20;
@@ -1177,12 +1177,12 @@ int v20_execute(int cycles)
#endif
#if (HAS_V30||HAS_V35)
-void v30_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void v30_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
nec_init(index, clock, config, irqcallback, 1);
configure_memory_16bit();
}
-int v30_execute(int cycles) {
+static int v30_execute(int cycles) {
nec_ICount=cycles;
chip_type=V30;
@@ -1208,12 +1208,12 @@ int v30_execute(int cycles) {
#endif
#if (HAS_V33)
-void v33_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void v33_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
nec_init(index, clock, config, irqcallback, 2);
configure_memory_16bit();
}
-int v33_execute(int cycles)
+static int v33_execute(int cycles)
{
nec_ICount=cycles;
chip_type=V33;
@@ -1301,7 +1301,7 @@ static void nec_set_info(UINT32 state, cpuinfo *info)
* Generic get_info
**************************************************************************/
-void nec_get_info(UINT32 state, cpuinfo *info)
+static void nec_get_info(UINT32 state, cpuinfo *info)
{
int flags;
diff --git a/src/emu/cpu/pic16c5x/pic16c5x.c b/src/emu/cpu/pic16c5x/pic16c5x.c
index 7daee53b009..f8ee36e9967 100644
--- a/src/emu/cpu/pic16c5x/pic16c5x.c
+++ b/src/emu/cpu/pic16c5x/pic16c5x.c
@@ -1078,7 +1078,7 @@ ADDRESS_MAP_END
* PIC16C54 Reset
****************************************************************************/
-void pic16C54_reset(void)
+static void pic16C54_reset(void)
{
picmodel = 0x16C54;
picRAMmask = 0x1f;
@@ -1130,7 +1130,7 @@ ADDRESS_MAP_END
* PIC16C55 Reset
****************************************************************************/
-void pic16C55_reset(void)
+static void pic16C55_reset(void)
{
picmodel = 0x16C55;
picRAMmask = 0x1f;
@@ -1182,7 +1182,7 @@ ADDRESS_MAP_END
* PIC16C56 Reset
****************************************************************************/
-void pic16C56_reset(void)
+static void pic16C56_reset(void)
{
picmodel = 0x16C56;
picRAMmask = 0x1f;
@@ -1239,7 +1239,7 @@ ADDRESS_MAP_END
* PIC16C57 Reset
****************************************************************************/
-void pic16C57_reset(void)
+static void pic16C57_reset(void)
{
picmodel = 0x16C57;
picRAMmask = 0x7f;
@@ -1297,7 +1297,7 @@ ADDRESS_MAP_END
* PIC16C58 Reset
****************************************************************************/
-void pic16C58_reset(void)
+static void pic16C58_reset(void)
{
picmodel = 0x16C58;
picRAMmask = 0x7f;
diff --git a/src/emu/cpu/powerpc/ppc403.c b/src/emu/cpu/powerpc/ppc403.c
index d4370e9fdeb..9d1988de86d 100644
--- a/src/emu/cpu/powerpc/ppc403.c
+++ b/src/emu/cpu/powerpc/ppc403.c
@@ -566,7 +566,7 @@ static void ppc_wrteei(UINT32 op)
/**************************************************************************/
/* PPC403 Serial Port */
-UINT8 ppc403_spu_r(UINT32 a)
+static UINT8 ppc403_spu_r(UINT32 a)
{
switch(a & 0xf)
{
@@ -582,7 +582,7 @@ UINT8 ppc403_spu_r(UINT32 a)
}
}
-void ppc403_spu_w(UINT32 a, UINT8 d)
+static void ppc403_spu_w(UINT32 a, UINT8 d)
{
switch(a & 0xf)
{
diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c
index 4a44b7a7e9d..56780178758 100644
--- a/src/emu/cpu/powerpc/ppcdrc.c
+++ b/src/emu/cpu/powerpc/ppcdrc.c
@@ -33,8 +33,8 @@ static int ppcdrc602_execute(int cycles);
static void ppcdrc602_set_irq_line(int irqline, int state);
#endif
#if (HAS_PPC403)
-UINT8 ppc403_spu_r(UINT32 a);
-void ppc403_spu_w(UINT32 a, UINT8 d);
+static UINT8 ppc403_spu_r(UINT32 a);
+static void ppc403_spu_w(UINT32 a, UINT8 d);
static void ppcdrc403_init(int index, int clock, const void *_config, int (*irqcallback)(int));
static void ppcdrc403_exit(void);
static void ppcdrc403_reset(void);
@@ -1002,7 +1002,7 @@ static void code_log(const char *label, x86code *start, x86code *stop)
/* Initialization and shutdown */
-void ppc_init(void)
+static void ppc_init(void)
{
int i,j;
@@ -1939,7 +1939,7 @@ static void ppc_set_info(UINT32 state, cpuinfo *info)
}
}
-void ppc_get_info(UINT32 state, cpuinfo *info)
+static void ppc_get_info(UINT32 state, cpuinfo *info)
{
switch(state)
{
@@ -2077,7 +2077,7 @@ void ppc_get_info(UINT32 state, cpuinfo *info)
/* PowerPC 403 */
#if (HAS_PPC403)
-void ppc403_set_info(UINT32 state, cpuinfo *info)
+static void ppc403_set_info(UINT32 state, cpuinfo *info)
{
if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
{
@@ -2115,7 +2115,7 @@ void ppc403_get_info(UINT32 state, cpuinfo *info)
/* PowerPC 603 */
#if (HAS_PPC603)
-void ppc603_set_info(UINT32 state, cpuinfo *info)
+static void ppc603_set_info(UINT32 state, cpuinfo *info)
{
if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
{
@@ -2165,7 +2165,7 @@ void ppc603_get_info(UINT32 state, cpuinfo *info)
/* PowerPC 602 */
#if (HAS_PPC602)
-void ppc602_set_info(UINT32 state, cpuinfo *info)
+static void ppc602_set_info(UINT32 state, cpuinfo *info)
{
if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
{
diff --git a/src/emu/cpu/saturn/saturn.c b/src/emu/cpu/saturn/saturn.c
index e18ec06dc9b..6caceb0dda9 100644
--- a/src/emu/cpu/saturn/saturn.c
+++ b/src/emu/cpu/saturn/saturn.c
@@ -153,7 +153,7 @@ INLINE void saturn_take_irq(void)
saturn.pending_irq = 0;
}
-int saturn_execute(int cycles)
+static int saturn_execute(int cycles)
{
saturn_ICount = cycles;
@@ -195,6 +195,7 @@ int saturn_execute(int cycles)
return cycles - saturn_ICount;
}
+#ifdef UNUSED_FUNCTION
void saturn_set_nmi_line(int state)
{
if (saturn.nmi_state == state) return;
@@ -225,6 +226,7 @@ void saturn_set_irq_callback(int (*callback)(int))
{
saturn.irq_callback = callback;
}
+#endif
#if 0
static void saturn_state_save(void *file)
diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c
index e6d486cfd77..ef56912acaa 100644
--- a/src/emu/cpu/sh2/sh2.c
+++ b/src/emu/cpu/sh2/sh2.c
@@ -2845,7 +2845,7 @@ READ32_HANDLER( sh2_internal_r )
return sh2.m[offset];
}
-void sh2_set_frt_input(int cpunum, int state)
+static void sh2_set_frt_input(int cpunum, int state)
{
if(state == PULSE_LINE)
{
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index 75967883d3d..82daf0cc51c 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -3944,7 +3944,7 @@ READ32_HANDLER( sh4_internal_r )
return sh4.m[offset];
}
-void sh4_set_frt_input(int cpunum, int state)
+static void sh4_set_frt_input(int cpunum, int state)
{
if(state == PULSE_LINE)
{
@@ -3984,7 +3984,7 @@ void sh4_set_frt_input(int cpunum, int state)
cpuintrf_pop_context();
}
-void sh4_set_irln_input(int cpunum, int value)
+static void sh4_set_irln_input(int cpunum, int value)
{
if (sh4.irln == value)
return;
@@ -4221,7 +4221,7 @@ static void sh4_init(int index, int clock, const void *config, int (*irqcallback
}
-void sh4_dma_ddt(struct sh4_ddt_dma *s)
+static void sh4_dma_ddt(struct sh4_ddt_dma *s)
{
UINT32 chcr;
UINT32 *p32bits;
diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c
index fea1374e454..3570ea27eb8 100644
--- a/src/emu/cpu/sharc/sharc.c
+++ b/src/emu/cpu/sharc/sharc.c
@@ -845,7 +845,7 @@ static void sharc_set_info(UINT32 state, cpuinfo *info)
}
#if (HAS_ADSP21062)
-void adsp21062_set_info(UINT32 state, cpuinfo *info)
+static void adsp21062_set_info(UINT32 state, cpuinfo *info)
{
if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 2)
{
@@ -956,7 +956,7 @@ static ADDRESS_MAP_START( internal_pgm, ADDRESS_SPACE_PROGRAM, 64 )
AM_RANGE(0x20000, 0x7ffff) AM_RAM
ADDRESS_MAP_END
-void sharc_get_info(UINT32 state, cpuinfo *info)
+static void sharc_get_info(UINT32 state, cpuinfo *info)
{
switch(state)
{
diff --git a/src/emu/cpu/sharc/sharcdsm.c b/src/emu/cpu/sharc/sharcdsm.c
index a796d0dcd68..3845433f9e7 100644
--- a/src/emu/cpu/sharc/sharcdsm.c
+++ b/src/emu/cpu/sharc/sharcdsm.c
@@ -298,7 +298,7 @@ static void get_if_condition(int cond)
}
}
-void pm_dm_ureg(int g, int d, int i, int m, int ureg, int update)
+static void pm_dm_ureg(int g, int d, int i, int m, int ureg, int update)
{
if (update) // post-modify
{
@@ -353,7 +353,7 @@ void pm_dm_ureg(int g, int d, int i, int m, int ureg, int update)
}
}
-void pm_dm_imm_dreg(int g, int d, int i, int data, int dreg, int update)
+static void pm_dm_imm_dreg(int g, int d, int i, int data, int dreg, int update)
{
if (update) // post-modify
{
@@ -407,7 +407,7 @@ void pm_dm_imm_dreg(int g, int d, int i, int data, int dreg, int update)
}
}
-void pm_dm_dreg(int g, int d, int i, int m, int dreg)
+static void pm_dm_dreg(int g, int d, int i, int m, int dreg)
{
if (d)
{
@@ -433,7 +433,7 @@ void pm_dm_dreg(int g, int d, int i, int m, int dreg)
}
}
-void shiftop(int shift, int data, int rn, int rx)
+static void shiftop(int shift, int data, int rn, int rx)
{
INT8 data8 = data & 0xff;
int bit6 = data & 0x3f;
diff --git a/src/emu/cpu/t11/t11dasm.c b/src/emu/cpu/t11/t11dasm.c
index 0564b6bffcb..a3cd49ceb86 100644
--- a/src/emu/cpu/t11/t11dasm.c
+++ b/src/emu/cpu/t11/t11dasm.c
@@ -17,7 +17,7 @@ static offs_t pcbase;
#define PARAM_WORD(v) ((v) = rombase[pc - pcbase] | (rombase[pc + 1 - pcbase] << 8), pc += 2)
-unsigned MakeEA (char **ea, int lo, unsigned pc, int width)
+static unsigned MakeEA (char **ea, int lo, unsigned pc, int width)
{
char *buffer = cpuintrf_temp_str();
int reg, pm;
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index 7cce9e8fd89..3a1576eaa65 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -2302,7 +2302,7 @@ static READ8_HANDLER( t90_internal_registers_r )
return data;
}
-void t90_start_timer(int i)
+static void t90_start_timer(int i)
{
int prescaler;
attotime period;
@@ -2349,7 +2349,7 @@ void t90_start_timer(int i)
logerror("%04X: CPU Timer %d started at %lf Hz\n", activecpu_get_pc(), i, 1.0 / attotime_to_double(period));
}
-void t90_start_timer4(void)
+static void t90_start_timer4(void)
{
int prescaler;
attotime period;
@@ -2372,13 +2372,13 @@ void t90_start_timer4(void)
}
-void t90_stop_timer(int i)
+static void t90_stop_timer(int i)
{
timer_adjust(T90.timer[i], attotime_never, i, attotime_zero);
logerror("%04X: CPU Timer %d stopped\n", activecpu_get_pc(), i);
}
-void t90_stop_timer4(void)
+static void t90_stop_timer4(void)
{
t90_stop_timer(4);
}
diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c
index a4935a38c8d..3c9c3b971a7 100644
--- a/src/emu/cpu/tms32025/tms32025.c
+++ b/src/emu/cpu/tms32025/tms32025.c
@@ -130,8 +130,8 @@ Table 3-2. TMS32025/26 Memory Blocks
#endif
-UINT16 *tms32025_pgmmap[0x200];
-UINT16 *tms32025_datamap[0x200];
+static UINT16 *tms32025_pgmmap[0x200];
+static UINT16 *tms32025_datamap[0x200];
#define SET_PC(x) do { R.PC = (x); change_pc(R.PC<<1); } while (0)
diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c
index 3545bc9e7fb..6907cd1cc2f 100644
--- a/src/emu/cpu/tms32031/tms32031.c
+++ b/src/emu/cpu/tms32031/tms32031.c
@@ -416,7 +416,7 @@ static void tms32031_reset(void)
static UINT32 hits[0x200*4];
#endif
-void tms32031_exit(void)
+static void tms32031_exit(void)
{
#if (LOG_OPCODE_USAGE)
int i;
diff --git a/src/emu/cpu/tms32051/dis32051.c b/src/emu/cpu/tms32051/dis32051.c
index f78862048f6..7a0b577c37a 100644
--- a/src/emu/cpu/tms32051/dis32051.c
+++ b/src/emu/cpu/tms32051/dis32051.c
@@ -127,7 +127,7 @@ static char *GET_SHIFT(int shift)
return buffer;
}
-void dasm_group_be(UINT16 opcode)
+static void dasm_group_be(UINT16 opcode)
{
int subop = opcode & 0xff;
diff --git a/src/emu/cpu/tms32051/tms32051.c b/src/emu/cpu/tms32051/tms32051.c
index f1dbd246530..9bea362fb33 100644
--- a/src/emu/cpu/tms32051/tms32051.c
+++ b/src/emu/cpu/tms32051/tms32051.c
@@ -670,7 +670,7 @@ static void tms_get_info(UINT32 state, cpuinfo *info)
}
#if (HAS_TMS32051)
-void tms32051_set_info(UINT32 state, cpuinfo *info)
+static void tms32051_set_info(UINT32 state, cpuinfo *info)
{
if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
{
diff --git a/src/emu/cpu/tms34010/34010dsm.c b/src/emu/cpu/tms34010/34010dsm.c
index 129ae27517e..7bc2bf8922e 100644
--- a/src/emu/cpu/tms34010/34010dsm.c
+++ b/src/emu/cpu/tms34010/34010dsm.c
@@ -246,7 +246,7 @@ static void print_reg_list(UINT16 rev)
}
-unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020)
+static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020)
{
int flags = 0;
UINT8 bad = 0;
diff --git a/src/emu/cpu/upd7810/upd7810.c b/src/emu/cpu/upd7810/upd7810.c
index c726934a4b1..ea9ad902bec 100644
--- a/src/emu/cpu/upd7810/upd7810.c
+++ b/src/emu/cpu/upd7810/upd7810.c
@@ -1497,7 +1497,7 @@ static void upd7810_timers(int cycles)
}
}
-void upd7810_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void upd7810_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
upd7810.config = *(const UPD7810_CONFIG*) config;
upd7810.irq_callback = irqcallback;
diff --git a/src/emu/cpu/v30mz/v30mz.c b/src/emu/cpu/v30mz/v30mz.c
index 940e50d20b1..83ad5c867d7 100644
--- a/src/emu/cpu/v30mz/v30mz.c
+++ b/src/emu/cpu/v30mz/v30mz.c
@@ -949,8 +949,8 @@ static void nec_init(int index, int clock, const void *config, int (*irqcallback
I.irq_callback = irqcallback;
}
-void v30mz_init(int index, int clock, const void *config, int (*irqcallback)(int)) { nec_init(index, clock, config, irqcallback, 3); }
-int v30mz_execute(int cycles)
+static void v30mz_init(int index, int clock, const void *config, int (*irqcallback)(int)) { nec_init(index, clock, config, irqcallback, 3); }
+static int v30mz_execute(int cycles)
{
nec_ICount=cycles;
chip_type=V30MZ;
diff --git a/src/emu/cpu/v810/v810.c b/src/emu/cpu/v810/v810.c
index 277c8895536..4eabb624492 100644
--- a/src/emu/cpu/v810/v810.c
+++ b/src/emu/cpu/v810/v810.c
@@ -945,7 +945,7 @@ static UINT32 (*OpCodeTable[64])(void) =
/* 0x3f */ opOUTW // out.w reg2, disp16[reg1] 6b
};
-void v810_init(int index, int clock, const void *config, int (*irqcallback)(int))
+static void v810_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
v810.irq_line = CLEAR_LINE;
v810.nmi_line = CLEAR_LINE;
@@ -958,7 +958,7 @@ void v810_init(int index, int clock, const void *config, int (*irqcallback)(int)
}
-void v810_reset(void)
+static void v810_reset(void)
{
int i;
for(i=0;i<64;i++) v810.reg[i]=0;
@@ -967,7 +967,7 @@ void v810_reset(void)
ECR = 0x0000fff0;
}
-int v810_execute(int cycles)
+static int v810_execute(int cycles)
{
v810_ICount = cycles;
while(v810_ICount>=0)
@@ -981,13 +981,13 @@ int v810_execute(int cycles)
return cycles-v810_ICount;
}
-void v810_get_context(void *dst)
+static void v810_get_context(void *dst)
{
if(dst)
*(v810info *)dst = v810;
}
-void v810_set_context(void *src)
+static void v810_set_context(void *src)
{
if(src)
v810 = *(v810info *)src;
diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c
index e0c4cfdc127..b72dceaafbc 100644
--- a/src/emu/cpu/z180/z180.c
+++ b/src/emu/cpu/z180/z180.c
@@ -743,7 +743,7 @@ typedef struct {
#define Z180_IOCR_RMASK 0xff
#define Z180_IOCR_WMASK 0xff
-int z180_icount;
+static int z180_icount;
static Z180_Regs Z180;
static UINT32 EA;
@@ -2294,6 +2294,7 @@ static void z180_set_context (void *src)
z180_change_pc(_PCD);
}
+#ifdef UNUSED_FUNCTION
READ8_HANDLER( z180_internal_r )
{
return Z180.io[offset & 0x3f];
@@ -2305,6 +2306,7 @@ WRITE8_HANDLER( z180_internal_w )
info.i = data;
z180_set_info( CPUINFO_INT_REGISTER + Z180_CNTLA0 + (offset & 0x3f), &info );
}
+#endif
/****************************************************************************
* Set IRQ line state
diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c
index 1e1cfd2ee7a..d845083aacc 100644
--- a/src/emu/cpu/z8000/z8000.c
+++ b/src/emu/cpu/z8000/z8000.c
@@ -84,7 +84,7 @@ typedef struct {
int (*irq_callback)(int irqline);
} z8000_Regs;
-int z8000_ICount;
+static int z8000_ICount;
/* current CPU context */
static z8000_Regs Z;
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index d65b07c216e..803443c175d 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -77,7 +77,7 @@ static UINT64 tempvar[NUM_TEMP_VARIABLES];
FUNCTION PROTOTYPES
***************************************************************************/
-void debug_cpu_exit(running_machine *machine);
+static void debug_cpu_exit(running_machine *machine);
static void perform_trace(debug_cpu_info *info);
static void prepare_for_step_overout(void);
static void process_source_file(void);
@@ -288,7 +288,7 @@ void debug_cpu_init(running_machine *machine)
debug_cpu_exit - free all memory
-------------------------------------------------*/
-void debug_cpu_exit(running_machine *machine)
+static void debug_cpu_exit(running_machine *machine)
{
int cpunum, spacenum;
diff --git a/src/emu/driver.h b/src/emu/driver.h
index 5833b4a1455..797a6ca5895 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -283,14 +283,14 @@ struct _game_driver
#define MDRV_CPU_REPLACE(tag, _type, _clock) \
cpu = driver_find_cpu(machine, tag); \
- cpu->type = (CPU_##_type); \
- cpu->clock = (_clock); \
+ cpu->type = (CPU_##_type); \
+ cpu->clock = (_clock); \
/* CPU parameters */
#define MDRV_CPU_FLAGS(_flags) \
if (cpu) \
- cpu->flags = (_flags); \
+ cpu->flags = (_flags); \
#define MDRV_CPU_CONFIG(config) \
if (cpu) \
diff --git a/src/emu/emupal.c b/src/emu/emupal.c
index 78440c3aa0c..44ace94bba9 100644
--- a/src/emu/emupal.c
+++ b/src/emu/emupal.c
@@ -59,8 +59,8 @@ struct _palette_private
};
-/* typedef struct _colortable colortable; */
-struct _colortable
+/* typedef struct _colortable_t colortable_t; */
+struct _colortable_t
{
running_machine * machine; /* associated machine */
UINT32 entries; /* number of entries */
@@ -365,9 +365,9 @@ void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int d
with the given number of entries
-------------------------------------------------*/
-colortable *colortable_alloc(running_machine *machine, UINT32 palettesize)
+colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize)
{
- colortable *ctable;
+ colortable_t *ctable;
UINT32 index;
/* allocate the colortable */
@@ -400,7 +400,7 @@ colortable *colortable_alloc(running_machine *machine, UINT32 palettesize)
of a colortable entry
-------------------------------------------------*/
-void colortable_entry_set_value(colortable *ctable, UINT32 entry, UINT16 value)
+void colortable_entry_set_value(colortable_t *ctable, UINT32 entry, UINT16 value)
{
/* ensure values are within range */
assert(entry < ctable->entries);
@@ -420,7 +420,7 @@ void colortable_entry_set_value(colortable *ctable, UINT32 entry, UINT16 value)
of a colortable entry
-------------------------------------------------*/
-UINT16 colortable_entry_get_value(colortable *ctable, UINT32 entry)
+UINT16 colortable_entry_get_value(colortable_t *ctable, UINT32 entry)
{
assert(entry < ctable->entries);
return ctable->raw[entry];
@@ -432,7 +432,7 @@ UINT16 colortable_entry_get_value(colortable *ctable, UINT32 entry)
color of a colortable palette entry
-------------------------------------------------*/
-void colortable_palette_set_color(colortable *ctable, UINT32 entry, rgb_t color)
+void colortable_palette_set_color(colortable_t *ctable, UINT32 entry, rgb_t color)
{
/* ensure values are within range */
assert(entry < ctable->palentries);
@@ -460,7 +460,7 @@ void colortable_palette_set_color(colortable *ctable, UINT32 entry, rgb_t color)
of a colortable palette entry
-------------------------------------------------*/
-rgb_t colortable_palette_get_color(colortable *ctable, UINT32 entry)
+rgb_t colortable_palette_get_color(colortable_t *ctable, UINT32 entry)
{
assert(entry < ctable->palentries);
return ctable->palette[entry];
@@ -473,7 +473,7 @@ rgb_t colortable_palette_get_color(colortable *ctable, UINT32 entry)
color
-------------------------------------------------*/
-UINT32 colortable_get_transpen_mask(colortable *ctable, const gfx_element *gfx, int color, int transcolor)
+UINT32 colortable_get_transpen_mask(colortable_t *ctable, const gfx_element *gfx, int color, int transcolor)
{
UINT32 entry = gfx->color_base + (color % gfx->total_colors) * gfx->color_granularity;
UINT32 mask = 0;
@@ -503,7 +503,7 @@ UINT32 colortable_get_transpen_mask(colortable *ctable, const gfx_element *gfx,
(each group maps to a gfx color)
-------------------------------------------------*/
-void colortable_configure_tilemap_groups(colortable *ctable, tilemap *tmap, const gfx_element *gfx, int transcolor)
+void colortable_configure_tilemap_groups(colortable_t *ctable, tilemap *tmap, const gfx_element *gfx, int transcolor)
{
int color;
diff --git a/src/emu/emupal.h b/src/emu/emupal.h
index 8e6a58b7fa4..3523341466d 100644
--- a/src/emu/emupal.h
+++ b/src/emu/emupal.h
@@ -112,7 +112,7 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef struct _colortable colortable;
+typedef struct _colortable_t colortable_t;
@@ -154,25 +154,25 @@ void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int d
/* ----- colortable management ----- */
/* allocate a new colortable with the given number of entries */
-colortable *colortable_alloc(running_machine *machine, UINT32 palettesize);
+colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize);
/* set the value of a colortable entry */
-void colortable_entry_set_value(colortable *ctable, UINT32 entry, UINT16 value);
+void colortable_entry_set_value(colortable_t *ctable, UINT32 entry, UINT16 value);
/* return the value of a colortable entry */
-UINT16 colortable_entry_get_value(colortable *ctable, UINT32 entry);
+UINT16 colortable_entry_get_value(colortable_t *ctable, UINT32 entry);
/* change the color of a colortable palette entry */
-void colortable_palette_set_color(colortable *ctable, UINT32 entry, rgb_t color);
+void colortable_palette_set_color(colortable_t *ctable, UINT32 entry, rgb_t color);
/* return the color of a colortable palette entry */
-rgb_t colortable_palette_get_color(colortable *ctable, UINT32 entry);
+rgb_t colortable_palette_get_color(colortable_t *ctable, UINT32 entry);
/* return a 32-bit transparency mask for a given gfx element and color */
-UINT32 colortable_get_transpen_mask(colortable *ctable, const gfx_element *gfx, int color, int transcolor);
+UINT32 colortable_get_transpen_mask(colortable_t *ctable, const gfx_element *gfx, int color, int transcolor);
/* configure groups in a tilemap to represent transparency based on colortable entries (each group maps to a gfx color) */
-void colortable_configure_tilemap_groups(colortable *ctable, tilemap *tmap, const gfx_element *gfx, int transcolor);
+void colortable_configure_tilemap_groups(colortable_t *ctable, tilemap *tmap, const gfx_element *gfx, int transcolor);
diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c
index f8bbb01f2d9..e00a6e30bdb 100644
--- a/src/emu/machine/tmp68301.c
+++ b/src/emu/machine/tmp68301.c
@@ -61,7 +61,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
}
}
-void tmp68301_update_timer( int i )
+static void tmp68301_update_timer( int i )
{
UINT16 TCR = tmp68301_regs[(0x200 + i * 0x20)/2];
UINT16 MAX1 = tmp68301_regs[(0x204 + i * 0x20)/2];
diff --git a/src/emu/mame.c b/src/emu/mame.c
index bed4dd9ba96..bc50082303a 100644
--- a/src/emu/mame.c
+++ b/src/emu/mame.c
@@ -1073,6 +1073,7 @@ void mame_printf_debug(const char *format, ...)
appropriate callback
-------------------------------------------------*/
+#ifdef UNUSED_FUNCTION
void mame_printf_log(const char *format, ...)
{
va_list argptr;
@@ -1089,6 +1090,7 @@ void mame_printf_log(const char *format, ...)
(*output_cb[OUTPUT_CHANNEL_LOG])(output_cb_param[OUTPUT_CHANNEL_LOG], format, argptr);
va_end(argptr);
}
+#endif
diff --git a/src/emu/mame.h b/src/emu/mame.h
index 940c3fd4fb5..63a2edf9981 100644
--- a/src/emu/mame.h
+++ b/src/emu/mame.h
@@ -186,6 +186,7 @@ struct _running_machine
/* fix me - some games try to modify remapped_colortable directly */
/* search for "palette hack" to find instances */
const pen_t * pens; /* remapped palette pen numbers */
+ struct _colortable_t * colortable; /* global colortable for remapping */
const UINT16 * game_colortable; /* lookup table used to map gfx pen numbers to color numbers */
const pen_t * remapped_colortable;/* the above, already remapped through Machine->pens */
pen_t * shadow_table; /* table for looking up a shadowed pen */
diff --git a/src/emu/sndintrf.c b/src/emu/sndintrf.c
index 9d6c8bf6bcb..52f426c64a6 100644
--- a/src/emu/sndintrf.c
+++ b/src/emu/sndintrf.c
@@ -67,7 +67,7 @@ struct _sndintrf_data
EXTERNAL PROTOTYPES
***************************************************************************/
-void dummy_sound_get_info(void *token, UINT32 state, sndinfo *info);
+static void dummy_sound_get_info(void *token, UINT32 state, sndinfo *info);
void custom_get_info(void *token, UINT32 state, sndinfo *info);
void samples_get_info(void *token, UINT32 state, sndinfo *info);
void dac_get_info(void *token, UINT32 state, sndinfo *info);
@@ -945,7 +945,7 @@ static void dummy_sound_set_info(void *token, UINT32 state, sndinfo *info)
}
-void dummy_sound_get_info(void *token, UINT32 state, sndinfo *info)
+static void dummy_sound_get_info(void *token, UINT32 state, sndinfo *info)
{
switch (state)
{
diff --git a/src/emu/sound/3812intf.h b/src/emu/sound/3812intf.h
index d4ffce65ca4..f1692859ab3 100644
--- a/src/emu/sound/3812intf.h
+++ b/src/emu/sound/3812intf.h
@@ -25,20 +25,24 @@ struct Y8950interface
/* YM3812 */
READ8_HANDLER ( YM3812_status_port_0_r );
WRITE8_HANDLER( YM3812_control_port_0_w );
+READ8_HANDLER( YM3812_read_port_0_r );
WRITE8_HANDLER( YM3812_write_port_0_w );
READ8_HANDLER ( YM3812_status_port_1_r );
WRITE8_HANDLER( YM3812_control_port_1_w );
+READ8_HANDLER( YM3812_read_port_1_r );
WRITE8_HANDLER( YM3812_write_port_1_w );
/* YM3526 */
READ8_HANDLER ( YM3526_status_port_0_r );
WRITE8_HANDLER( YM3526_control_port_0_w );
+READ8_HANDLER( YM3526_read_port_0_r );
WRITE8_HANDLER( YM3526_write_port_0_w );
READ8_HANDLER ( YM3526_status_port_1_r );
WRITE8_HANDLER( YM3526_control_port_1_w );
+READ8_HANDLER( YM3526_read_port_1_r );
WRITE8_HANDLER( YM3526_write_port_1_w );
diff --git a/src/emu/sound/astrocde.c b/src/emu/sound/astrocde.c
index 88457451453..cd4e32861ce 100644
--- a/src/emu/sound/astrocde.c
+++ b/src/emu/sound/astrocde.c
@@ -287,7 +287,7 @@ static void *astrocade_start(int sndindex, int clock, const void *config)
*
*************************************/
-void astrocade_sound_w(UINT8 num, offs_t offset, UINT8 data)
+static void astrocade_sound_w(UINT8 num, offs_t offset, UINT8 data)
{
struct astrocade_info *chip = sndti_token(SOUND_ASTROCADE, num);
diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c
index d81cb4994b9..aee2e9c20bf 100644
--- a/src/emu/sound/ics2115.c
+++ b/src/emu/sound/ics2115.c
@@ -526,7 +526,7 @@ WRITE8_HANDLER( ics2115_w )
// if (ICS2115LOGERROR) logerror("ICS2115: wi %d, %02x (%04x)\n", offset, data, caller_get_pc());
}
-void ics2115_reset(void *_chip)
+static void ics2115_reset(void *_chip)
{
struct ics2115 *chip = _chip;
chip->irq_en = 0;
diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c
index 981e0668b8f..768882226fa 100644
--- a/src/emu/sound/iremga20.c
+++ b/src/emu/sound/iremga20.c
@@ -56,7 +56,7 @@ struct IremGA20_chip_def
struct IremGA20_channel_def channel[4];
};
-void IremGA20_update( void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length )
+static void IremGA20_update( void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length )
{
struct IremGA20_chip_def *chip = param;
UINT32 rate[4], pos[4], frac[4], end[4], vol[4], play[4];
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index 82179687dcb..6ab7691314a 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -94,7 +94,7 @@ INLINE int limit( int val, int max, int min ) {
#define MAXOUT 0x7fff
#define MINOUT -0x8000
-void K053260_update( void * param, stream_sample_t **inputs, stream_sample_t **buffer, int length ) {
+static void K053260_update( void * param, stream_sample_t **inputs, stream_sample_t **buffer, int length ) {
static long dpcmcnv[] = { 0,1,2,4,8,16,32,64, -128, -64, -32, -16, -8, -4, -2, -1};
int i, j, lvol[4], rvol[4], play[4], loop[4], ppcm_data[4], ppcm[4];
@@ -250,7 +250,7 @@ INLINE void check_bounds( struct K053260_chip_def *ic, int channel ) {
#endif
}
-void K053260_write( int chip, offs_t offset, UINT8 data )
+static void K053260_write( int chip, offs_t offset, UINT8 data )
{
int i, t;
int r = offset;
@@ -367,7 +367,7 @@ void K053260_write( int chip, offs_t offset, UINT8 data )
}
}
-UINT8 K053260_read( int chip, offs_t offset )
+static UINT8 K053260_read( int chip, offs_t offset )
{
struct K053260_chip_def *ic = sndti_token(SOUND_K053260, chip);
diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c
index b51947e14b0..0853d38acb2 100644
--- a/src/emu/sound/msm5232.c
+++ b/src/emu/sound/msm5232.c
@@ -665,7 +665,7 @@ INLINE void TG_group_advance(MSM5232 *chip, int groupidx)
#endif
-void MSM5232_update_one(void *param, stream_sample_t **inputs, stream_sample_t** buffer, int samples)
+static void MSM5232_update_one(void *param, stream_sample_t **inputs, stream_sample_t** buffer, int samples)
{
MSM5232 * chip = param;
stream_sample_t *buf1 = buffer[0];
diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c
index 21c5768abe5..1e5e431d15a 100644
--- a/src/emu/sound/nes_apu.c
+++ b/src/emu/sound/nes_apu.c
@@ -657,7 +657,7 @@ WRITE8_HANDLER( NESPSG_0_w ) {apu_write(0,offset,data);}
WRITE8_HANDLER( NESPSG_1_w ) {apu_write(1,offset,data);}
/* UPDATE APU SYSTEM */
-void NESPSG_update_sound(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length)
+static void NESPSG_update_sound(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length)
{
struct nesapu_info *info = param;
apu_update(info, buffer[0], length);
diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c
index fcb1b097aaf..4d01cbcdfc7 100644
--- a/src/emu/sound/pokey.c
+++ b/src/emu/sound/pokey.c
@@ -551,7 +551,7 @@ static TIMER_CALLBACK_PTR( pokey_pot_trigger_7 );
#endif
-void pokey_update(void *param, stream_sample_t **inputs, stream_sample_t **_buffer, int length)
+static void pokey_update(void *param, stream_sample_t **inputs, stream_sample_t **_buffer, int length)
{
struct POKEYregisters *chip = param;
stream_sample_t *buffer = _buffer[0];
@@ -1037,7 +1037,7 @@ READ8_HANDLER( quad_pokey_r )
}
-void pokey_register_w(int chip, int offs, int data)
+static void pokey_register_w(int chip, int offs, int data)
{
struct POKEYregisters *p = sndti_token(SOUND_POKEY, chip);
int ch_mask = 0, new_val;
@@ -1473,7 +1473,7 @@ void pokey4_serin_ready(int after)
timer_set_ptr(attotime_mul(p->clock_period, after), p, pokey_serin_ready);
}
-void pokey_break_w(int chip, int shift)
+static void pokey_break_w(int chip, int shift)
{
struct POKEYregisters *p = sndti_token(SOUND_POKEY, chip);
if( shift ) /* shift code ? */
@@ -1510,7 +1510,7 @@ void pokey4_break_w(int shift)
pokey_break_w(3, shift);
}
-void pokey_kbcode_w(int chip, int kbcode, int make)
+static void pokey_kbcode_w(int chip, int kbcode, int make)
{
struct POKEYregisters *p = sndti_token(SOUND_POKEY, chip);
/* make code ? */
diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c
index 1eabe0759b0..b95181ba827 100644
--- a/src/emu/sound/qsound.c
+++ b/src/emu/sound/qsound.c
@@ -91,8 +91,8 @@ struct qsound_info
};
/* Function prototypes */
-void qsound_update( void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length );
-void qsound_set_command(struct qsound_info *chip, int data, int value);
+static void qsound_update( void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length );
+static void qsound_set_command(struct qsound_info *chip, int data, int value);
static void *qsound_start(int sndindex, int clock, const void *config)
{
@@ -198,7 +198,7 @@ READ8_HANDLER( qsound_status_r )
return 0x80;
}
-void qsound_set_command(struct qsound_info *chip, int data, int value)
+static void qsound_set_command(struct qsound_info *chip, int data, int value)
{
int ch=0,reg=0;
if (data < 0x80)
@@ -313,7 +313,7 @@ void qsound_set_command(struct qsound_info *chip, int data, int value)
}
-void qsound_update( void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length )
+static void qsound_update( void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length )
{
struct qsound_info *chip = param;
int i,j;
diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c
index 051b12489aa..306b537db8d 100644
--- a/src/emu/sound/s14001a.c
+++ b/src/emu/sound/s14001a.c
@@ -289,7 +289,7 @@ static void PostPhoneme(S14001AChip *chip) /* figure out what the heck to do aft
#endif
}
-void s14001a_clock(S14001AChip *chip) /* called once per clock */
+static void s14001a_clock(S14001AChip *chip) /* called once per clock */
{
UINT8 CurDelta; // Current delta
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c
index 357d7c3bb84..78b788838c4 100644
--- a/src/emu/sound/scsp.c
+++ b/src/emu/sound/scsp.c
@@ -1370,11 +1370,13 @@ static void dma_scsp(struct _SCSP *SCSP)
cpunum_set_input_line(2,dma_transfer_end,HOLD_LINE);
}
+#ifdef UNUSED_FUNCTION
int SCSP_IRQCB(void *param)
{
CheckPendingIRQ(param);
return -1;
}
+#endif
static void SCSP_Update(void *param, stream_sample_t **inputs, stream_sample_t **buf, int samples)
{
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index bd0d1d68bf6..911e929e08b 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -447,7 +447,7 @@ void tms36xx_note_w(int chip, int octave, int note)
tms->tune_max = note + 1;
}
-void tms3617_enable(struct TMS36XX *tms, int enable)
+static void tms3617_enable(struct TMS36XX *tms, int enable)
{
int i, bits = 0;
diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c
index e9df9742413..e27edd8ca4e 100644
--- a/src/emu/sound/ymz280b.c
+++ b/src/emu/sound/ymz280b.c
@@ -707,6 +707,7 @@ static void *ymz280b_start(int sndindex, int clock, const void *config)
***********************************************************************************************/
+#ifdef UNUSED_FUNCTION
void YMZ280B_sh_stop(void)
{
#if MAKE_WAVS
@@ -721,6 +722,7 @@ void YMZ280B_sh_stop(void)
}
#endif
}
+#endif
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index f058e6dda59..b33f3e6eecd 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -531,7 +531,7 @@ int ui_menu_draw(const ui_menu_item *items, int numitems, int selected, const me
bottom
-------------------------------------------------*/
-void ui_menu_draw_text_box(const char *text)
+static void ui_menu_draw_text_box(const char *text)
{
const char *priortext = ui_getstring(UI_returntoprior);
float line_height = ui_get_line_height();
diff --git a/src/emu/uitext.c b/src/emu/uitext.c
index e3fa967cf69..62e4b9abe7b 100644
--- a/src/emu/uitext.c
+++ b/src/emu/uitext.c
@@ -18,7 +18,7 @@ extern const char *mess_default_text[];
#endif /* MESS */
-lang_struct lang;
+static lang_struct lang;
/* All entries in this table must match the enum ordering in "uitext.h" */
static const char *mame_default_text[] =
diff --git a/src/emu/validity.c b/src/emu/validity.c
index 6bfaf303c31..faa37b60768 100644
--- a/src/emu/validity.c
+++ b/src/emu/validity.c
@@ -216,15 +216,15 @@ static void build_quarks(void)
static int validate_inlines(void)
{
#undef rand
- UINT64 testu64a = rand() + (rand() << 15) + ((UINT64)rand() << 30) + ((UINT64)rand() << 45) + 1;
- INT64 testi64a = rand() + (rand() << 15) + ((INT64)rand() << 30) + ((INT64)rand() << 45) + 1;
+ volatile UINT64 testu64a = rand() ^ (rand() << 15) ^ ((UINT64)rand() << 30) ^ ((UINT64)rand() << 45);
+ volatile INT64 testi64a = rand() ^ (rand() << 15) ^ ((INT64)rand() << 30) ^ ((INT64)rand() << 45);
#ifdef PTR64
- INT64 testi64b = rand() + (rand() << 15) + ((INT64)rand() << 30) + ((INT64)rand() << 45) + 1;
+ volatile INT64 testi64b = rand() ^ (rand() << 15) ^ ((INT64)rand() << 30) ^ ((INT64)rand() << 45);
#endif
- UINT32 testu32a = rand() + (rand() << 15) + 1;
- UINT32 testu32b = rand() + (rand() << 15) + 1;
- INT32 testi32a = rand() + (rand() << 15) + 1;
- INT32 testi32b = rand() + (rand() << 15) + 1;
+ volatile UINT32 testu32a = rand() ^ (rand() << 15);
+ volatile UINT32 testu32b = rand() ^ (rand() << 15);
+ volatile INT32 testi32a = rand() ^ (rand() << 15);
+ volatile INT32 testi32b = rand() ^ (rand() << 15);
INT32 resulti32, expectedi32;
UINT32 resultu32, expectedu32;
INT64 resulti64, expectedi64;
@@ -233,6 +233,21 @@ static int validate_inlines(void)
UINT32 uremainder, expuremainder;
int error = FALSE;
+ /* use only non-zero, positive numbers */
+ if (testu64a == 0) testu64a++;
+ if (testi64a == 0) testi64a++;
+ else if (testi64a < 0) testi64a = -testi64a;
+#ifdef PTR64
+ if (testi64b == 0) testi64b++;
+ else if (testi64b < 0) testi64b = -testi64b;
+#endif
+ if (testu32a == 0) testu32a++;
+ if (testu32b == 0) testu32b++;
+ if (testi32a == 0) testi32a++;
+ else if (testi32a < 0) testi32a = -testi32a;
+ if (testi32b == 0) testi32b++;
+ else if (testi32b < 0) testi32b = -testi32b;
+
resulti64 = mul_32x32(testi32a, testi32b);
expectedi64 = (INT64)testi32a * (INT64)testi32b;
if (resulti64 != expectedi64)
diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c
index b36bd5c70fe..813ad8c31fe 100644
--- a/src/lib/util/chd.c
+++ b/src/lib/util/chd.c
@@ -835,6 +835,7 @@ core_file *chd_core_file(chd_file *chd)
filename
-------------------------------------------------*/
+#ifdef UNUSED_FUNCTION
void chd_multi_filename(const char *origname, char *finalname, int index)
{
char *extension;
@@ -856,6 +857,7 @@ void chd_multi_filename(const char *origname, char *finalname, int index)
findex[2] = 'h';
strcpy(extension, findex);
}
+#endif
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index 276dae9ddbb..7433977e0e9 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -240,29 +240,15 @@ static PALETTE_INIT( acefruit )
palette_set_color( machine, 6, MAKE_RGB(0xff, 0xff, 0xff) );
palette_set_color( machine, 7, MAKE_RGB(0x7f, 0x3f, 0x1f) );
- colortable[ 0 ] = 0;
- colortable[ 1 ] = 1;
- colortable[ 2 ] = 2;
- colortable[ 3 ] = 3;
- colortable[ 4 ] = 4;
- colortable[ 5 ] = 5;
- colortable[ 6 ] = 6;
- colortable[ 7 ] = 7;
-
/* tiles */
- palette_set_color( machine, 8, MAKE_RGB(0xff, 0xff, 0xff) );
- palette_set_color( machine, 9, MAKE_RGB(0x00, 0x00, 0xff) );
- palette_set_color( machine, 10, MAKE_RGB(0x00, 0xff, 0x00) );
- palette_set_color( machine, 11, MAKE_RGB(0xff, 0x00, 0x00) );
-
- colortable[ 8 ] = 0;
- colortable[ 9 ] = 8;
- colortable[ 10 ] = 0;
- colortable[ 11 ] = 9;
- colortable[ 12 ] = 0;
- colortable[ 13 ] = 10;
- colortable[ 14 ] = 0;
- colortable[ 15 ] = 11;
+ palette_set_color( machine, 8, MAKE_RGB(0x00, 0x00, 0x00) );
+ palette_set_color( machine, 9, MAKE_RGB(0xff, 0xff, 0xff) );
+ palette_set_color( machine, 10, MAKE_RGB(0x00, 0x00, 0x00) );
+ palette_set_color( machine, 11, MAKE_RGB(0x00, 0x00, 0xff) );
+ palette_set_color( machine, 12, MAKE_RGB(0x00, 0x00, 0x00) );
+ palette_set_color( machine, 13, MAKE_RGB(0x00, 0xff, 0x00) );
+ palette_set_color( machine, 14, MAKE_RGB(0x00, 0x00, 0x00) );
+ palette_set_color( machine, 15, MAKE_RGB(0xff, 0x00, 0x00) );
}
static ADDRESS_MAP_START( acefruit_map, ADDRESS_SPACE_PROGRAM, 8 )
@@ -573,8 +559,7 @@ static MACHINE_DRIVER_START( acefruit )
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_SIZE(512, 256)
MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 255)
- MDRV_PALETTE_LENGTH(12)
- MDRV_COLORTABLE_LENGTH(16)
+ MDRV_PALETTE_LENGTH(16)
MDRV_NVRAM_HANDLER(generic_0fill)
diff --git a/src/mame/drivers/atarifb.c b/src/mame/drivers/atarifb.c
index 99ccff9bb09..bdb7b0837b5 100644
--- a/src/mame/drivers/atarifb.c
+++ b/src/mame/drivers/atarifb.c
@@ -121,23 +121,25 @@ int atarifb_game;
*
*************************************/
-static const UINT16 colortable_source[] =
-{
- 0x02, 0x00, /* chars */
- 0x03, 0x02, /* sprites */
- 0x03, 0x00,
- 0x03, 0x01, /* sprite masks */
- 0x03, 0x00,
- 0x03, 0x02,
-};
-
static PALETTE_INIT( atarifb )
{
- palette_set_color(machine,0,MAKE_RGB(0x00,0x00,0x00)); /* black */
- palette_set_color(machine,1,MAKE_RGB(0x80,0x80,0x80)); /* grey */
- palette_set_color(machine,2,MAKE_RGB(0xff,0xff,0xff)); /* white */
- palette_set_color(machine,3,MAKE_RGB(0x40,0x40,0x40)); /* dark grey (?) - used in Soccer only */
- memcpy(colortable,colortable_source,sizeof(colortable_source));
+ /* chars */
+ palette_set_color(machine,0,MAKE_RGB(0xff,0xff,0xff)); /* white */
+ palette_set_color(machine,1,MAKE_RGB(0x00,0x00,0x00)); /* black */
+
+ /* sprites */
+ palette_set_color(machine,2,MAKE_RGB(0x40,0x40,0x40)); /* dark grey (?) - used in Soccer only */
+ palette_set_color(machine,3,MAKE_RGB(0xff,0xff,0xff)); /* white */
+ palette_set_color(machine,4,MAKE_RGB(0x40,0x40,0x40)); /* dark grey (?) - used in Soccer only */
+ palette_set_color(machine,5,MAKE_RGB(0x00,0x00,0x00)); /* black */
+
+ /* sprite masks */
+ palette_set_color(machine,6,MAKE_RGB(0x40,0x40,0x40)); /* dark grey (?) - used in Soccer only */
+ palette_set_color(machine,7,MAKE_RGB(0x80,0x80,0x80)); /* grey */
+ palette_set_color(machine,8,MAKE_RGB(0x40,0x40,0x40)); /* dark grey (?) - used in Soccer only */
+ palette_set_color(machine,9,MAKE_RGB(0x00,0x00,0x00)); /* black */
+ palette_set_color(machine,10,MAKE_RGB(0x40,0x40,0x40)); /* dark grey (?) - used in Soccer only */
+ palette_set_color(machine,11,MAKE_RGB(0xff,0xff,0xff)); /* white */
}
@@ -538,8 +540,7 @@ static MACHINE_DRIVER_START( atarifb )
MDRV_SCREEN_SIZE(38*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(0*8, 38*8-1, 1*8, 31*8-1)
MDRV_GFXDECODE(atarifb)
- MDRV_PALETTE_LENGTH(4)
- MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
+ MDRV_PALETTE_LENGTH(12)
MDRV_PALETTE_INIT(atarifb)
MDRV_VIDEO_START(generic)
diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c
index eca21a26d72..050b8044307 100644
--- a/src/mame/drivers/boxer.c
+++ b/src/mame/drivers/boxer.c
@@ -80,10 +80,8 @@ static PALETTE_INIT( boxer )
palette_set_color(machine,0, MAKE_RGB(0x00,0x00,0x00));
palette_set_color(machine,1, MAKE_RGB(0xff,0xff,0xff));
- colortable[0] = 0;
- colortable[1] = 1;
- colortable[2] = 1;
- colortable[3] = 0;
+ palette_set_color(machine,2, MAKE_RGB(0xff,0xff,0xff));
+ palette_set_color(machine,3, MAKE_RGB(0x00,0x00,0x00));
}
@@ -314,8 +312,7 @@ static MACHINE_DRIVER_START(boxer)
MDRV_SCREEN_SIZE(256, 262)
MDRV_SCREEN_VISIBLE_AREA(8, 247, 0, 239)
MDRV_GFXDECODE(boxer)
- MDRV_PALETTE_LENGTH(2)
- MDRV_COLORTABLE_LENGTH(4)
+ MDRV_PALETTE_LENGTH(4)
MDRV_PALETTE_INIT(boxer)
MDRV_VIDEO_UPDATE(boxer)
diff --git a/src/mame/drivers/bsktball.c b/src/mame/drivers/bsktball.c
index e8b5d3e75ec..6fd011d3006 100644
--- a/src/mame/drivers/bsktball.c
+++ b/src/mame/drivers/bsktball.c
@@ -32,101 +32,34 @@
*
*************************************/
-static UINT16 colortable_source[] =
-{
- /* Playfield */
- 0x01, 0x00, 0x00, 0x00,
- 0x01, 0x03, 0x03, 0x03,
-
- /* Motion */
- 0x01, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x01, 0x00,
- 0x01, 0x00, 0x02, 0x00,
- 0x01, 0x00, 0x03, 0x00,
-
- 0x01, 0x01, 0x00, 0x00,
- 0x01, 0x01, 0x01, 0x00,
- 0x01, 0x01, 0x02, 0x00,
- 0x01, 0x01, 0x03, 0x00,
-
- 0x01, 0x02, 0x00, 0x00,
- 0x01, 0x02, 0x01, 0x00,
- 0x01, 0x02, 0x02, 0x00,
- 0x01, 0x02, 0x03, 0x00,
-
- 0x01, 0x03, 0x00, 0x00,
- 0x01, 0x03, 0x01, 0x00,
- 0x01, 0x03, 0x02, 0x00,
- 0x01, 0x03, 0x03, 0x00,
-
- 0x01, 0x00, 0x00, 0x01,
- 0x01, 0x00, 0x01, 0x01,
- 0x01, 0x00, 0x02, 0x01,
- 0x01, 0x00, 0x03, 0x01,
-
- 0x01, 0x01, 0x00, 0x01,
- 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x02, 0x01,
- 0x01, 0x01, 0x03, 0x01,
-
- 0x01, 0x02, 0x00, 0x01,
- 0x01, 0x02, 0x01, 0x01,
- 0x01, 0x02, 0x02, 0x01,
- 0x01, 0x02, 0x03, 0x01,
-
- 0x01, 0x03, 0x00, 0x01,
- 0x01, 0x03, 0x01, 0x01,
- 0x01, 0x03, 0x02, 0x01,
- 0x01, 0x03, 0x03, 0x01,
-
- 0x01, 0x00, 0x00, 0x02,
- 0x01, 0x00, 0x01, 0x02,
- 0x01, 0x00, 0x02, 0x02,
- 0x01, 0x00, 0x03, 0x02,
-
- 0x01, 0x01, 0x00, 0x02,
- 0x01, 0x01, 0x01, 0x02,
- 0x01, 0x01, 0x02, 0x02,
- 0x01, 0x01, 0x03, 0x02,
-
- 0x01, 0x02, 0x00, 0x02,
- 0x01, 0x02, 0x01, 0x02,
- 0x01, 0x02, 0x02, 0x02,
- 0x01, 0x02, 0x03, 0x02,
-
- 0x01, 0x03, 0x00, 0x02,
- 0x01, 0x03, 0x01, 0x02,
- 0x01, 0x03, 0x02, 0x02,
- 0x01, 0x03, 0x03, 0x02,
-
- 0x01, 0x00, 0x00, 0x03,
- 0x01, 0x00, 0x01, 0x03,
- 0x01, 0x00, 0x02, 0x03,
- 0x01, 0x00, 0x03, 0x03,
-
- 0x01, 0x01, 0x00, 0x03,
- 0x01, 0x01, 0x01, 0x03,
- 0x01, 0x01, 0x02, 0x03,
- 0x01, 0x01, 0x03, 0x03,
-
- 0x01, 0x02, 0x00, 0x03,
- 0x01, 0x02, 0x01, 0x03,
- 0x01, 0x02, 0x02, 0x03,
- 0x01, 0x02, 0x03, 0x03,
-
- 0x01, 0x03, 0x00, 0x03,
- 0x01, 0x03, 0x01, 0x03,
- 0x01, 0x03, 0x02, 0x03,
- 0x01, 0x03, 0x03, 0x03,
-};
-
static PALETTE_INIT( bsktball )
{
- palette_set_color(machine,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
- palette_set_color(machine,1,MAKE_RGB(0x80,0x80,0x80)); /* LIGHT GREY */
- palette_set_color(machine,2,MAKE_RGB(0x50,0x50,0x50)); /* DARK GREY */
- palette_set_color(machine,3,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
- memcpy(colortable,colortable_source,sizeof(colortable_source));
+ int i;
+
+ machine->colortable = colortable_alloc(machine, 4);
+
+ colortable_palette_set_color(machine->colortable,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
+ colortable_palette_set_color(machine->colortable,1,MAKE_RGB(0x80,0x80,0x80)); /* LIGHT GREY */
+ colortable_palette_set_color(machine->colortable,2,MAKE_RGB(0x50,0x50,0x50)); /* DARK GREY */
+ colortable_palette_set_color(machine->colortable,3,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
+
+ /* playfield */
+ for (i = 0; i < 2; i++)
+ {
+ colortable_entry_set_value(machine->colortable, i*4 + 0, 1);
+ colortable_entry_set_value(machine->colortable, i*4 + 1, 3 * i);
+ colortable_entry_set_value(machine->colortable, i*4 + 2, 3 * i);
+ colortable_entry_set_value(machine->colortable, i*4 + 3, 3 * i);
+ }
+
+ /* motion */
+ for (i = 0; i < 4*4*4; i++)
+ {
+ colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 0, 1);
+ colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 1, (i >> 2) & 3);
+ colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 2, (i >> 0) & 3);
+ colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 3, (i >> 4) & 3);
+ }
}
@@ -288,8 +221,7 @@ static MACHINE_DRIVER_START( bsktball )
MDRV_SCREEN_SIZE(32*8, 28*8)
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
MDRV_GFXDECODE(bsktball)
- MDRV_PALETTE_LENGTH(4)
- MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
+ MDRV_PALETTE_LENGTH(2*4 + 4*4*4*4)
MDRV_PALETTE_INIT(bsktball)
MDRV_VIDEO_START(bsktball)
diff --git a/src/mame/drivers/canyon.c b/src/mame/drivers/canyon.c
index 830a4f50926..62d76ed33a2 100644
--- a/src/mame/drivers/canyon.c
+++ b/src/mame/drivers/canyon.c
@@ -47,14 +47,10 @@
static PALETTE_INIT( canyon )
{
- palette_set_color(machine, 0, MAKE_RGB(0x00, 0x00, 0x00)); /* BLACK */
- palette_set_color(machine, 1, MAKE_RGB(0xff, 0xff, 0xff)); /* WHITE */
+ palette_set_color(machine, 0, MAKE_RGB(0x80, 0x80, 0x80)); /* GREY */
+ palette_set_color(machine, 1, MAKE_RGB(0x00, 0x00, 0x00)); /* BLACK */
palette_set_color(machine, 2, MAKE_RGB(0x80, 0x80, 0x80)); /* GREY */
-
- colortable[0] = 2;
- colortable[1] = 0;
- colortable[2] = 2;
- colortable[3] = 1;
+ palette_set_color(machine, 3, MAKE_RGB(0xff, 0xff, 0xff)); /* WHITE */
}
@@ -253,8 +249,7 @@ static MACHINE_DRIVER_START( canyon )
MDRV_SCREEN_SIZE(256, 240)
MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
MDRV_GFXDECODE(canyon)
- MDRV_PALETTE_LENGTH(3)
- MDRV_COLORTABLE_LENGTH(4)
+ MDRV_PALETTE_LENGTH(4)
MDRV_PALETTE_INIT(canyon)
MDRV_VIDEO_START(canyon)
diff --git a/src/mame/drivers/cherrym.c b/src/mame/drivers/cherrym.c
index 95f6266ef0c..001639501ea 100644
--- a/src/mame/drivers/cherrym.c
+++ b/src/mame/drivers/cherrym.c
@@ -16,7 +16,6 @@ static tilemap *bg_tilemap;
static PALETTE_INIT( cm )
{
- #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
int i;
for ( i = 0; i < machine->drv->total_colors; i++ )
@@ -392,7 +391,6 @@ static MACHINE_DRIVER_START( cmv801 )
MDRV_GFXDECODE(cherrym)
MDRV_PALETTE_LENGTH(256)
- MDRV_COLORTABLE_LENGTH(256)
MDRV_PALETTE_INIT(cm)
MDRV_VIDEO_START(cm)
diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c
index 8c9daa21276..960af69ef61 100644
--- a/src/mame/drivers/cischeat.c
+++ b/src/mame/drivers/cischeat.c
@@ -523,7 +523,7 @@ READ16_HANDLER( scudhamm_motor_pos_r )
Within $20 vblanks the motor must reach the target. */
-WRITE16_HANDLER( scudhamm_motor_command_w )
+static WRITE16_HANDLER( scudhamm_motor_command_w )
{
COMBINE_DATA( &scudhamm_motor_command );
}
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index 51af59e7587..c8e8815faf1 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -354,26 +354,29 @@ GFXDECODE_END
static PALETTE_INIT( decocass )
{
int i;
+
+ machine->colortable = colortable_alloc(machine, 32);
+
/* set up 32 colors 1:1 pens */
for (i = 0; i < 32; i++)
- colortable[i] = i;
+ colortable_entry_set_value(machine->colortable, i, i);
/* setup straight/flipped colors for background tiles (D7 of color_center_bot ?) */
for (i = 0; i < 8; i++)
{
- colortable[32+i] = 3*8+i;
- colortable[40+i] = 3*8+((i << 1) & 0x04) + ((i >> 1) & 0x02) + (i & 0x01);
+ colortable_entry_set_value(machine->colortable, 32+i, 3*8+i);
+ colortable_entry_set_value(machine->colortable, 40+i, 3*8+((i << 1) & 0x04) + ((i >> 1) & 0x02) + (i & 0x01));
}
/* setup 4 colors for 1bpp object */
- colortable[48+0*2+0] = 0;
- colortable[48+0*2+1] = 25; /* testtape red from 4th palette section? */
- colortable[48+1*2+0] = 0;
- colortable[48+1*2+1] = 28; /* testtape blue from 4th palette section? */
- colortable[48+2*2+0] = 0;
- colortable[48+2*2+1] = 26; /* testtape green from 4th palette section? */
- colortable[48+3*2+0] = 0;
- colortable[48+3*2+1] = 23; /* ???? */
+ colortable_entry_set_value(machine->colortable, 48+0*2+0, 0);
+ colortable_entry_set_value(machine->colortable, 48+0*2+1, 25); /* testtape red from 4th palette section? */
+ colortable_entry_set_value(machine->colortable, 48+1*2+0, 0);
+ colortable_entry_set_value(machine->colortable, 48+1*2+1, 28); /* testtape blue from 4th palette section? */
+ colortable_entry_set_value(machine->colortable, 48+2*2+0, 0);
+ colortable_entry_set_value(machine->colortable, 48+2*2+1, 26); /* testtape green from 4th palette section? */
+ colortable_entry_set_value(machine->colortable, 48+3*2+0, 0);
+ colortable_entry_set_value(machine->colortable, 48+3*2+1, 23); /* ???? */
}
@@ -402,8 +405,7 @@ static MACHINE_DRIVER_START( decocass )
MDRV_SCREEN_SIZE(32*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
MDRV_GFXDECODE(decocass)
- MDRV_PALETTE_LENGTH(32)
- MDRV_COLORTABLE_LENGTH(32+2*8+2*4)
+ MDRV_PALETTE_LENGTH(32+2*8+2*4)
MDRV_PALETTE_INIT(decocass)
MDRV_VIDEO_START(decocass)
diff --git a/src/mame/drivers/dgpix.c b/src/mame/drivers/dgpix.c
index 2d1ffa56eca..206018571df 100644
--- a/src/mame/drivers/dgpix.c
+++ b/src/mame/drivers/dgpix.c
@@ -213,6 +213,13 @@ static WRITE32_HANDLER( coin_w )
coin_counter_w(1, data & 2);
}
+static READ32_HANDLER( vblank_r )
+{
+ /* burn a bunch of cycles because this is polled frequently during busy loops */
+ activecpu_adjust_icount(-100);
+ return input_port_0_dword_r(offset, 0);
+}
+
static ADDRESS_MAP_START( cpu_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x00000000, 0x007fffff) AM_RAM
AM_RANGE(0x40000000, 0x4003ffff) AM_READWRITE(vram_r, vram_w)
@@ -223,7 +230,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 32 )
AM_RANGE(0x0200, 0x0203) AM_READNOP // used to sync with the protecion PIC? tested bits 0 and 1
- AM_RANGE(0x0400, 0x0403) AM_READWRITE(input_port_0_dword_r, vbuffer_w)
+ AM_RANGE(0x0400, 0x0403) AM_READWRITE(vblank_r, vbuffer_w)
AM_RANGE(0x0a10, 0x0a13) AM_READ(input_port_1_dword_r)
AM_RANGE(0x0200, 0x0203) AM_WRITE(coin_w)
AM_RANGE(0x0c00, 0x0c03) AM_WRITENOP // writes only: 1, 0, 1 at startup
@@ -311,7 +318,7 @@ static VIDEO_UPDATE( dgpix )
}
static MACHINE_DRIVER_START( dgpix )
- MDRV_CPU_ADD(E132XT, 20000000)
+ MDRV_CPU_ADD(E132XT, 20000000*4) /* 4x internal multiplier */
MDRV_CPU_PROGRAM_MAP(cpu_map,0)
MDRV_CPU_IO_MAP(io_map,0)
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index c3a8e7f45b3..9bbed62b3d8 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -181,11 +181,9 @@ static PALETTE_INIT( dleuro )
for (i = 0; i < 8; i++)
{
- palette_set_color_rgb(machine, i, pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
- colortable[2 * i + 0] = 8;
- colortable[2 * i + 1] = i;
+ palette_set_color(machine, 2 * i + 0, MAKE_RGB(0, 0, 0));
+ palette_set_color_rgb(machine, 2 * i + 1, pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
}
- palette_set_color(machine, 8, MAKE_RGB(0, 0, 0));
}
@@ -858,8 +856,7 @@ static MACHINE_DRIVER_START( dleuro )
MDRV_SCREEN_VISIBLE_AREA(0, 199, 0, 239)
MDRV_GFXDECODE(dlair)
- MDRV_PALETTE_LENGTH(9)
- MDRV_COLORTABLE_LENGTH(16)
+ MDRV_PALETTE_LENGTH(16)
MDRV_PALETTE_INIT(dleuro)
MDRV_VIDEO_START(dleuro)
diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c
index 113b99ad394..dd7bc5f5ea0 100644
--- a/src/mame/drivers/eolith16.c
+++ b/src/mame/drivers/eolith16.c
@@ -163,7 +163,7 @@ static PALETTE_INIT( eolith16 )
static MACHINE_DRIVER_START( eolith16 )
- MDRV_CPU_ADD(E116T, 60000000) /* 60 MHz */
+ MDRV_CPU_ADD(E116T, 60000000) /* no internal multiplier */
MDRV_CPU_PROGRAM_MAP(eolith16_map,0)
MDRV_CPU_VBLANK_INT(eolith_speedup,262)
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index ea4d163c84d..067f01fddf8 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -744,8 +744,8 @@ static const gfx_layout charlayout_1bpp =
256,
1,
{ 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7 },
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
+ { STEP8(0,1) },
+ { STEP8(0,8) },
8*8
};
@@ -755,8 +755,8 @@ static const gfx_layout charlayout_2bpp =
256,
2,
{ 0, 256*8*8 },
- { 0, 1, 2, 3, 4, 5, 6, 7 },
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
+ { STEP8(0,1) },
+ { STEP8(0,8) },
8*8
};
@@ -766,21 +766,21 @@ static const gfx_layout spritelayout =
RGN_FRAC(1,1),
1,
{ 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7},
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8},
+ { STEP8(0,1), STEP8(16*8,1), },
+ { STEP16(0,8) },
8*32
};
static GFXDECODE_START( 1bpp )
- GFXDECODE_ENTRY( REGION_CPU1, 0x4800, charlayout_1bpp, 0, 4 ) /* the game dynamically modifies this */
- GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 8, 2 )
+ GFXDECODE_ENTRY( REGION_CPU1, 0x4800, charlayout_1bpp, 4, 4 ) /* the game dynamically modifies this */
+ GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 2 )
GFXDECODE_END
static GFXDECODE_START( 2bpp )
- GFXDECODE_ENTRY( REGION_CPU1, 0x6000, charlayout_2bpp, 0, 4 ) /* the game dynamically modifies this */
- GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 16, 2 )
+ GFXDECODE_ENTRY( REGION_CPU1, 0x6000, charlayout_2bpp, 4, 4 ) /* the game dynamically modifies this */
+ GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 2 )
GFXDECODE_END
@@ -836,10 +836,8 @@ static MACHINE_DRIVER_START( targ )
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_RAW_PARAMS(EXIDY_PIXEL_CLOCK, EXIDY_HTOTAL, EXIDY_HBEND, EXIDY_HBSTART, EXIDY_VTOTAL, EXIDY_VBEND, EXIDY_VBSTART)
MDRV_GFXDECODE(1bpp)
- MDRV_PALETTE_LENGTH(PALETTE_LEN)
- MDRV_COLORTABLE_LENGTH(COLORTABLE_LEN)
+ MDRV_PALETTE_LENGTH(2*2 + 4*2)
- MDRV_PALETTE_INIT(exidy)
MDRV_VIDEO_START(exidy)
MDRV_VIDEO_EOF(exidy)
MDRV_VIDEO_UPDATE(exidy)
@@ -913,6 +911,7 @@ static MACHINE_DRIVER_START( pepper2 )
/* video hardware */
MDRV_GFXDECODE(2bpp)
+ MDRV_PALETTE_LENGTH(2*2 + 4*4)
MACHINE_DRIVER_END
@@ -1341,10 +1340,8 @@ ROM_END
*
*************************************/
-static void exidy_common_init(UINT8 palette[], UINT16 colortable[], UINT8 cmask, UINT8 cinvert)
+static void exidy_common_init(UINT8 cmask, UINT8 cinvert)
{
- exidy_palette = palette;
- exidy_colortable = colortable;
exidy_collision_mask = cmask;
exidy_collision_invert = cinvert;
targ_spec_flag = 0;
@@ -1353,7 +1350,12 @@ static void exidy_common_init(UINT8 palette[], UINT16 colortable[], UINT8 cmask,
static DRIVER_INIT( sidetrac )
{
- exidy_common_init(sidetrac_palette, exidy_1bpp_colortable, 0x00, 0x00);
+ exidy_common_init(0x00, 0x00);
+
+ /* hard-coded palette controlled via 8x3 DIP switches on the board */
+ exidy_color_latch[2] = 0xf8;
+ exidy_color_latch[1] = 0xdc;
+ exidy_color_latch[0] = 0xb8;
/* ROM in place of character RAM */
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, MWA8_ROM);
@@ -1362,19 +1364,35 @@ static DRIVER_INIT( sidetrac )
static DRIVER_INIT( targ )
{
- exidy_common_init(targ_palette, exidy_1bpp_colortable, 0x00, 0x00);
+ exidy_common_init(0x00, 0x00);
+
+ /* hard-coded palette controlled via 8x3 DIP switches on the board */
+ exidy_color_latch[2] = 0x5c;
+ exidy_color_latch[1] = 0xee;
+ exidy_color_latch[0] = 0x6b;
+
targ_spec_flag = 1;
}
static DRIVER_INIT( spectar )
{
- exidy_common_init(spectar_palette, exidy_1bpp_colortable, 0x00, 0x00);
+ exidy_common_init(0x00, 0x00);
+
+ /* hard-coded palette controlled via 8x3 DIP switches on the board */
+ exidy_color_latch[2] = 0x58;
+ exidy_color_latch[1] = 0xee;
+ exidy_color_latch[0] = 0x09;
}
static DRIVER_INIT( rallys )
{
- exidy_common_init(spectar_palette, exidy_1bpp_colortable, 0x00, 0x00);
+ exidy_common_init(0x00, 0x00);
+
+ /* hard-coded palette controlled via 8x3 DIP switches on the board */
+ exidy_color_latch[2] = 0x58;
+ exidy_color_latch[1] = 0xee;
+ exidy_color_latch[0] = 0x09;
/* sprite locations are slightly different */
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5000, 0, 0, exidy_sprite1_xpos_w);
@@ -1385,7 +1403,12 @@ static DRIVER_INIT( rallys )
static DRIVER_INIT( phantoma )
{
- exidy_common_init(spectar_palette, exidy_1bpp_colortable, 0x00, 0x00);
+ exidy_common_init(0x00, 0x00);
+
+ /* hard-coded palette controlled via 8x3 DIP switches on the board */
+ exidy_color_latch[2] = 0x58;
+ exidy_color_latch[1] = 0xee;
+ exidy_color_latch[0] = 0x09;
/* sprite locations are slightly different */
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5000, 0, 0, exidy_sprite1_xpos_w);
@@ -1401,19 +1424,19 @@ static DRIVER_INIT( phantoma )
static DRIVER_INIT( mtrap )
{
- exidy_common_init(NULL, exidy_1bpp_colortable, 0x14, 0x00);
+ exidy_common_init(0x14, 0x00);
}
static DRIVER_INIT( venture )
{
- exidy_common_init(NULL, exidy_1bpp_colortable, 0x04, 0x04);
+ exidy_common_init(0x04, 0x04);
}
static DRIVER_INIT( teetert )
{
- exidy_common_init(NULL, exidy_1bpp_colortable, 0x0c, 0x0c);
+ exidy_common_init(0x0c, 0x0c);
/* special input handler for the dial */
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5101, 0x5101, 0, 0, teetert_input_r);
@@ -1422,7 +1445,7 @@ static DRIVER_INIT( teetert )
static DRIVER_INIT( pepper2 )
{
- exidy_common_init(NULL, exidy_2bpp_colortable, 0x14, 0x04);
+ exidy_common_init(0x14, 0x04);
/* two 6116 character RAMs */
exidy_characterram = memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_RAM);
@@ -1434,7 +1457,7 @@ static DRIVER_INIT( pepper2 )
static DRIVER_INIT( fax )
{
- exidy_common_init(NULL, exidy_2bpp_colortable, 0x04, 0x04);
+ exidy_common_init(0x04, 0x04);
/* reset the ROM bank */
fax_bank_select_w(0,0);
diff --git a/src/mame/drivers/f-32.c b/src/mame/drivers/f-32.c
index ba303d53bda..f8225404911 100644
--- a/src/mame/drivers/f-32.c
+++ b/src/mame/drivers/f-32.c
@@ -134,10 +134,10 @@ static INPUT_PORTS_START( mosaicf2 )
INPUT_PORTS_END
static MACHINE_DRIVER_START( mosaicf2 )
- MDRV_CPU_ADD_TAG("main", E132XT, 20000000) // E132XN actually! /* 20 MHz */
+ MDRV_CPU_ADD_TAG("main", E132XN, 20000000*4) /* 4x internal multiplier */
MDRV_CPU_PROGRAM_MAP(common_map,0)
MDRV_CPU_IO_MAP(mosaicf2_io,0)
- MDRV_CPU_VBLANK_INT(irq5_line_pulse, 1)
+ MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
MDRV_SCREEN_REFRESH_RATE(60)
MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c
index f2486c3f222..3f492acd6de 100644
--- a/src/mame/drivers/fgoal.c
+++ b/src/mame/drivers/fgoal.c
@@ -59,45 +59,22 @@ static PALETTE_INIT( fgoal )
{
int i;
- for (i = 0; i < 64; i++)
- {
- int r = (i >> 4) & 3;
- int g = (i >> 2) & 3;
- int b = (i >> 0) & 3;
-
- palette_set_color_rgb(machine,i,
- intensity(r),
- intensity(g),
- intensity(b));
- }
-
- palette_set_color(machine,0x40,MAKE_RGB(0x2e,0x80,0x2e));
- palette_set_color(machine,0x41,MAKE_RGB(0x2e,0x2e,0x2e));
-
/* for B/W screens PCB can be jumpered to use lower half of PROM */
for (i = 0; i < 128; i++)
{
- colortable[i] = color_prom[0x80 | i] & 63;
+ UINT8 color = color_prom[0x80 | i] & 63;
+ palette_set_color_rgb(machine, i, intensity(color >> 4), intensity(color >> 2), intensity(color >> 0));
+ }
+
+ for (i = 0; i < 8; i++)
+ {
+ palette_set_color(machine, 128 + 0*8 + i, MAKE_RGB(0x2e,0x80,0x2e));
+ palette_set_color(machine, 128 + 1*8 + i, MAKE_RGB(0x2e,0x2e,0x2e));
}
- colortable[0x80] = 0x40;
- colortable[0x81] = 0x40;
- colortable[0x82] = 0x40;
- colortable[0x83] = 0x40;
- colortable[0x84] = 0x40;
- colortable[0x85] = 0x40;
- colortable[0x86] = 0x40;
- colortable[0x87] = 0x40;
-
- colortable[0x88] = 0x41;
- colortable[0x89] = 0x41;
- colortable[0x8a] = 0x41;
- colortable[0x8b] = 0x41;
- colortable[0x8c] = 0x41;
- colortable[0x8d] = 0x41;
- colortable[0x8e] = 0x41;
- colortable[0x8f] = 0x41;
+ /* ball is a fixed color */
+ palette_set_color_rgb(machine, 128 + 16, intensity(0x38 >> 4), intensity(0x38 >> 2), intensity(0x38 >> 0));
}
@@ -398,8 +375,7 @@ static MACHINE_DRIVER_START( fgoal )
MDRV_SCREEN_SIZE(256, 263)
MDRV_SCREEN_VISIBLE_AREA(0, 255, 16, 255)
MDRV_GFXDECODE(fgoal)
- MDRV_PALETTE_LENGTH(64 + 2)
- MDRV_COLORTABLE_LENGTH(128 + 16)
+ MDRV_PALETTE_LENGTH(128 + 16 + 1)
MDRV_PALETTE_INIT(fgoal)
MDRV_VIDEO_START(fgoal)
diff --git a/src/mame/drivers/firetrk.c b/src/mame/drivers/firetrk.c
index bdc24ea0d51..9c755c33658 100644
--- a/src/mame/drivers/firetrk.c
+++ b/src/mame/drivers/firetrk.c
@@ -15,6 +15,9 @@ Atari Fire Truck + Super Bug + Monte Carlo driver
int firetrk_game;
+UINT32 firetrk_color1_mask;
+UINT32 firetrk_color2_mask;
+
static int last_service;
static int steer_dir[2];
static int steer_flag[2];
@@ -244,7 +247,7 @@ static MACHINE_RESET( firetrk )
static PALETTE_INIT( firetrk )
{
- static const UINT16 colortable_source[] =
+ static const UINT8 colortable_source[] =
{
0, 0, 1, 0,
2, 0, 3, 0,
@@ -254,13 +257,25 @@ static PALETTE_INIT( firetrk )
2, 0, 0, 3,
3, 0, 0, 3
};
+ static const rgb_t palette_source[] =
+ {
+ MAKE_RGB(0x00, 0x00, 0x00),
+ MAKE_RGB(0x5b, 0x5b, 0x5b),
+ MAKE_RGB(0xa4, 0xa4, 0xa4),
+ MAKE_RGB(0xff, 0xff, 0xff)
+ };
+ int i;
- palette_set_color(machine, 0, MAKE_RGB(0x00, 0x00, 0x00));
- palette_set_color(machine, 1, MAKE_RGB(0x5b, 0x5b, 0x5b));
- palette_set_color(machine, 2, MAKE_RGB(0xa4, 0xa4, 0xa4));
- palette_set_color(machine, 3, MAKE_RGB(0xff, 0xff, 0xff));
-
- memcpy(colortable, colortable_source, sizeof(colortable_source));
+ firetrk_color1_mask = firetrk_color2_mask = 0;
+ for (i = 0; i < ARRAY_LENGTH(colortable_source); i++)
+ {
+ UINT8 color = colortable_source[i];
+ if (color == 1)
+ firetrk_color1_mask |= 1 << i;
+ else if (color == 2)
+ firetrk_color2_mask |= 1 << i;
+ palette_set_color(machine, i, palette_source[color]);
+ }
}
@@ -272,7 +287,7 @@ static void prom_to_palette(running_machine *machine, int number, UINT8 val)
static PALETTE_INIT( montecar )
{
- static const UINT16 colortable_source[] =
+ static const UINT8 colortable_source[] =
{
0x00, 0x00, 0x00, 0x01,
0x00, 0x02, 0x00, 0x03,
@@ -280,12 +295,11 @@ static PALETTE_INIT( montecar )
0x03, 0x01, 0x03, 0x00,
0x00, 0x00, 0x02, 0x00,
0x02, 0x01, 0x02, 0x02,
- 0x00, 0x05, 0x06, 0x07,
- 0x00, 0x09, 0x0A, 0x0B,
- 0x00, 0x0D, 0x0E, 0x0F,
- 0x00, 0x11, 0x12, 0x13,
- 0x00, 0x15, 0x16, 0x17,
- 0x18, 0x19
+ 0x00, 0x10, 0x20, 0x30,
+ 0x00, 0x04, 0x08, 0x0C,
+ 0x00, 0x44, 0x48, 0x4C,
+ 0x00, 0x84, 0x88, 0x8C,
+ 0x00, 0xC4, 0xC8, 0xCC
};
/*
@@ -307,43 +321,21 @@ static PALETTE_INIT( montecar )
*/
const UINT8* p = memory_region(REGION_PROMS);
+ int i;
- int number = 0;
-
- prom_to_palette(machine, number++, p[0x100]);
- prom_to_palette(machine, number++, p[0x101]);
- prom_to_palette(machine, number++, p[0x102]);
- prom_to_palette(machine, number++, p[0x103]);
-
- prom_to_palette(machine, number++, p[0x100]);
- prom_to_palette(machine, number++, p[0x110]);
- prom_to_palette(machine, number++, p[0x120]);
- prom_to_palette(machine, number++, p[0x130]);
-
- prom_to_palette(machine, number++, p[0x100]);
- prom_to_palette(machine, number++, p[0x104]);
- prom_to_palette(machine, number++, p[0x108]);
- prom_to_palette(machine, number++, p[0x10C]);
-
- prom_to_palette(machine, number++, p[0x140]);
- prom_to_palette(machine, number++, p[0x144]);
- prom_to_palette(machine, number++, p[0x148]);
- prom_to_palette(machine, number++, p[0x14C]);
-
- prom_to_palette(machine, number++, p[0x180]);
- prom_to_palette(machine, number++, p[0x184]);
- prom_to_palette(machine, number++, p[0x188]);
- prom_to_palette(machine, number++, p[0x18C]);
-
- prom_to_palette(machine, number++, p[0x1C0]);
- prom_to_palette(machine, number++, p[0x1C4]);
- prom_to_palette(machine, number++, p[0x1C8]);
- prom_to_palette(machine, number++, p[0x1CC]);
-
- palette_set_color(machine, number++, MAKE_RGB(0x00, 0x00, 0x00));
- palette_set_color(machine, number++, MAKE_RGB(0xff, 0xff, 0xff));
+ firetrk_color1_mask = firetrk_color2_mask = 0;
+ for (i = 0; i < ARRAY_LENGTH(colortable_source); i++)
+ {
+ UINT8 color = colortable_source[i];
+ if (color == 1)
+ firetrk_color1_mask |= 1 << i;
+ else if (color == 2)
+ firetrk_color2_mask |= 1 << i;
+ prom_to_palette(machine, i, p[0x100 + colortable_source[i]]);
+ }
- memcpy(colortable, colortable_source, sizeof(colortable_source));
+ palette_set_color(machine, ARRAY_LENGTH(colortable_source) + 0, MAKE_RGB(0x00, 0x00, 0x00));
+ palette_set_color(machine, ARRAY_LENGTH(colortable_source) + 1, MAKE_RGB(0xff, 0xff, 0xff));
}
@@ -1074,8 +1066,7 @@ static MACHINE_DRIVER_START( firetrk )
MDRV_GFXDECODE(firetrk)
MDRV_PALETTE_INIT(firetrk)
- MDRV_PALETTE_LENGTH(4)
- MDRV_COLORTABLE_LENGTH(28)
+ MDRV_PALETTE_LENGTH(28)
MDRV_VIDEO_START(firetrk)
MDRV_VIDEO_EOF(firetrk)
@@ -1101,8 +1092,7 @@ static MACHINE_DRIVER_START( superbug )
MDRV_GFXDECODE(superbug)
MDRV_PALETTE_INIT(firetrk)
- MDRV_PALETTE_LENGTH(4)
- MDRV_COLORTABLE_LENGTH(28)
+ MDRV_PALETTE_LENGTH(28)
/* sound hardware */
MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
@@ -1122,8 +1112,7 @@ static MACHINE_DRIVER_START( montecar )
MDRV_GFXDECODE(montecar)
MDRV_PALETTE_INIT(montecar)
- MDRV_PALETTE_LENGTH(26)
- MDRV_COLORTABLE_LENGTH(46)
+ MDRV_PALETTE_LENGTH(46)
/* sound hardware */
MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c
index 29631fb192b..9ba34c5ade4 100644
--- a/src/mame/drivers/gstream.c
+++ b/src/mame/drivers/gstream.c
@@ -385,10 +385,10 @@ static VIDEO_UPDATE(gstream)
}
static MACHINE_DRIVER_START( gstream )
- MDRV_CPU_ADD_TAG("main", E132XT, 16000000) /* 16 Mhz? */
+ MDRV_CPU_ADD_TAG("main", E132XT, 16000000*4) /* 4x internal multiplier */
MDRV_CPU_PROGRAM_MAP(gstream_32bit_map,0)
MDRV_CPU_IO_MAP(gstream_io,0)
- MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
+ MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
MDRV_SCREEN_REFRESH_RATE(60)
MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c
index 5583be8f1ca..1590cf14b12 100644
--- a/src/mame/drivers/lazercmd.c
+++ b/src/mame/drivers/lazercmd.c
@@ -599,17 +599,15 @@ static GFXDECODE_START( lazercmd )
GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 2 )
GFXDECODE_END
-static UINT16 colortable_source[] =
-{
- 1, 0,
- 0, 1
-};
static PALETTE_INIT( lazercmd )
{
- palette_set_color(machine,0,MAKE_RGB(0x00,0x00,0x00)); /* black */
- palette_set_color(machine,1,MAKE_RGB(0xb0,0xb0,0xb0)); /* white */
- palette_set_color(machine,2,MAKE_RGB(0xff,0xff,0xff)); /* bright white */
- memcpy(colortable,colortable_source,sizeof(colortable_source));
+ palette_set_color(machine,0,MAKE_RGB(0xb0,0xb0,0xb0)); /* white */
+ palette_set_color(machine,1,MAKE_RGB(0x00,0x00,0x00)); /* black */
+
+ palette_set_color(machine,2,MAKE_RGB(0x00,0x00,0x00)); /* black */
+ palette_set_color(machine,3,MAKE_RGB(0xb0,0xb0,0xb0)); /* white */
+
+ palette_set_color(machine,4,MAKE_RGB(0xff,0xff,0xff)); /* bright white */
}
static MACHINE_DRIVER_START( lazercmd )
@@ -634,8 +632,7 @@ static MACHINE_DRIVER_START( lazercmd )
MDRV_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1,
0 * VERT_CHR, (VERT_RES - 1) * VERT_CHR - 1)
MDRV_GFXDECODE(lazercmd)
- MDRV_PALETTE_LENGTH(3)
- MDRV_COLORTABLE_LENGTH(2*2)
+ MDRV_PALETTE_LENGTH(5)
MDRV_PALETTE_INIT(lazercmd)
MDRV_VIDEO_UPDATE(lazercmd)
@@ -670,8 +667,7 @@ static MACHINE_DRIVER_START( medlanes )
MDRV_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1,
0 * VERT_CHR, VERT_RES * VERT_CHR - 1)
MDRV_GFXDECODE(lazercmd)
- MDRV_PALETTE_LENGTH(3)
- MDRV_COLORTABLE_LENGTH(2*2)
+ MDRV_PALETTE_LENGTH(5)
MDRV_PALETTE_INIT(lazercmd)
MDRV_VIDEO_UPDATE(lazercmd)
@@ -706,8 +702,7 @@ static MACHINE_DRIVER_START( bbonk )
MDRV_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1,
0 * VERT_CHR, (VERT_RES - 1) * VERT_CHR - 1)
MDRV_GFXDECODE(lazercmd)
- MDRV_PALETTE_LENGTH(3)
- MDRV_COLORTABLE_LENGTH(2*2)
+ MDRV_PALETTE_LENGTH(5)
MDRV_PALETTE_INIT(lazercmd)
MDRV_VIDEO_UPDATE(lazercmd)
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 6aaff8d392c..73288f2aaf2 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -475,10 +475,10 @@ GFXDECODE_END
static MACHINE_DRIVER_START( limenko )
- MDRV_CPU_ADD(E132XT, 80000000) //E132XN!
+ MDRV_CPU_ADD(E132XN, 20000000*4) /* 4x internal multiplier */
MDRV_CPU_PROGRAM_MAP(limenko_map,0)
MDRV_CPU_IO_MAP(limenko_io_map,0)
- MDRV_CPU_VBLANK_INT(irq5_line_hold, 1)
+ MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
MDRV_SCREEN_REFRESH_RATE(60)
MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
@@ -501,10 +501,10 @@ static MACHINE_DRIVER_START( limenko )
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( spotty )
- MDRV_CPU_ADD(GMS30C2232, 80000000) /* 20 MHz with 4x internal clock multiplier? */
+ MDRV_CPU_ADD(GMS30C2232, 20000000) /* 20 MHz, no internal multiplier */
MDRV_CPU_PROGRAM_MAP(spotty_map,0)
MDRV_CPU_IO_MAP(spotty_io_map,0)
- MDRV_CPU_VBLANK_INT(irq5_line_hold, 1)
+ MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
MDRV_CPU_ADD(I8051, 4000000) /* 4 MHz */
MDRV_CPU_PROGRAM_MAP(spotty_sound_prg_map, 0)
diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c
index a3a1e6c3f18..1e3842edbe2 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -391,31 +391,6 @@ static const gfx_layout saa5050_lolayout =
8 * 10
};
-static const rgb_t saa5050_palette[8] =
-{
- MAKE_RGB(0x00, 0x00, 0x00), /* black */
- MAKE_RGB(0xff, 0x00, 0x00), /* red */
- MAKE_RGB(0x00, 0xff, 0x00), /* green */
- MAKE_RGB(0xff, 0xff, 0x00), /* yellow */
- MAKE_RGB(0x00, 0x00, 0xff), /* blue */
- MAKE_RGB(0xff, 0x00, 0xff), /* magenta */
- MAKE_RGB(0x00, 0xff, 0xff), /* cyan */
- MAKE_RGB(0xff, 0xff, 0xff) /* white */
-};
-
-/* bgnd, fgnd */
-static unsigned short saa5050_colortable[64 * 2] =
-{
- 0,1, 0,1, 0,2, 0,3, 0,4, 0,5, 0,6, 0,7,
- 1,0, 1,1, 1,2, 1,3, 1,4, 1,5, 1,6, 1,7,
- 2,0, 2,1, 2,2, 2,3, 2,4, 2,5, 2,6, 2,7,
- 3,0, 3,1, 3,2, 3,3, 3,4, 3,5, 3,6, 3,7,
- 4,0, 4,1, 4,2, 4,3, 4,4, 4,5, 4,6, 4,7,
- 5,0, 5,1, 5,2, 5,3, 5,4, 5,5, 5,6, 5,7,
- 6,0, 6,1, 6,2, 6,3, 6,4, 6,5, 6,6, 6,7,
- 7,0, 7,1, 7,2, 7,3, 7,4, 7,5, 7,6, 7,7
-};
-
//add s2636 decodes here (i.e. from zac2650) and maybe re-arrange them
static GFXDECODE_START( malzak )
GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
@@ -429,8 +404,13 @@ GFXDECODE_END
static PALETTE_INIT( malzak )
{
- palette_set_colors(machine, 0, saa5050_palette, ARRAY_LENGTH(saa5050_palette));
- memcpy(colortable, saa5050_colortable, sizeof (saa5050_colortable));
+ int i;
+
+ for (i = 0; i < 8*8; i++)
+ {
+ palette_set_color_rgb(machine, i * 2 + 0, pal1bit(i >> 3), pal1bit(i >> 4), pal1bit(i >> 5));
+ palette_set_color_rgb(machine, i * 2 + 1, pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
+ }
}
@@ -478,9 +458,8 @@ static MACHINE_DRIVER_START( malzak )
MDRV_SCREEN_SIZE(240, 256) /* vert size is a guess */
MDRV_SCREEN_VISIBLE_AREA(0, 239, 0, 239)
MDRV_GFXDECODE(malzak)
- MDRV_PALETTE_LENGTH(16)
+ MDRV_PALETTE_LENGTH(128)
MDRV_PALETTE_INIT(malzak)
- MDRV_COLORTABLE_LENGTH(128)
// MDRV_MACHINE_RESET(malzak)
diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c
index 5fa3fddbd6f..05da1ee4bab 100644
--- a/src/mame/drivers/megadriv.c
+++ b/src/mame/drivers/megadriv.c
@@ -608,10 +608,9 @@ static UINT16 get_word_from_68k_mem(UINT32 source)
/* Note, In reality this transfer is NOT instant, the 68k isn't paused
as the 68k address bus isn't accessed */
-static void megadrive_do_insta_vram_copy(UINT32 source, UINT16 length);
/* Wani Wani World, James Pond 3, Pirates Gold! */
-void megadrive_do_insta_vram_copy(UINT32 source, UINT16 length)
+static void megadrive_do_insta_vram_copy(UINT32 source, UINT16 length)
{
int x;
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index da9a7065661..00124da73bf 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -1053,11 +1053,11 @@ ROM_START( mt_cols ) /* Columns */
MEGATECH_GAME36(REGION_USER1, REGION_USER2)
ROM_END
-/* Game 04 - Great Golf (SMS) - bad dump */
+/* Game 04 - Great Golf (SMS) */
#define MEGATECH_GAME04(GAME_REGION, INSTRUCTION_REGION) \
ROM_REGION( 0x300000, GAME_REGION, 0 ) \
- ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, BAD_DUMP CRC(942738ba) SHA1(e99d4e39c965fc123a39d75521a274687e917a57) ) \
+ ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, CRC(972c75ac) SHA1(2ae74c8563a3cefb27611d17bf3926865b6ebd45) ) \
MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
ROM_LOAD( "12368-04.ic2", 0x000000, 0x08000, CRC(62e5579b) SHA1(e1f531be5c40a1216d4192baeda9352384444410) ) \
diff --git a/src/mame/drivers/mexico86.c b/src/mame/drivers/mexico86.c
index 8184c056af3..dc7625d9456 100644
--- a/src/mame/drivers/mexico86.c
+++ b/src/mame/drivers/mexico86.c
@@ -383,7 +383,7 @@ static MACHINE_DRIVER_START( mexico86 )
MDRV_CPU_ADD_TAG("main",Z80, 24000000/4) /* 6 MHz, Uses clock divided 24MHz OSC */
MDRV_CPU_PROGRAM_MAP(readmem,writemem)
- MDRV_CPU_ADD(Z80, 8000000/2) /* 4 MHz, Uses 8Mhz OSC */
+ MDRV_CPU_ADD(Z80, 24000000/4) /* 6 MHz, Uses clock divided 24MHz OSC */
MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
@@ -391,7 +391,7 @@ static MACHINE_DRIVER_START( mexico86 )
MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
MDRV_CPU_VBLANK_INT(mexico86_m68705_interrupt,2)
- MDRV_CPU_ADD_TAG("sub", Z80, 24000000/4) /* 6 MHz, Uses clock divided 24MHz OSC */
+ MDRV_CPU_ADD_TAG("sub", Z80, 8000000/2) /* 4 MHz, Uses 8Mhz OSC */
MDRV_CPU_PROGRAM_MAP(sub_cpu_map,0)
MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
diff --git a/src/mame/drivers/mogura.c b/src/mame/drivers/mogura.c
index 8f703c27c5c..968f997add8 100644
--- a/src/mame/drivers/mogura.c
+++ b/src/mame/drivers/mogura.c
@@ -10,7 +10,6 @@ static tilemap *mogura_tilemap;
static PALETTE_INIT( mogura )
{
int i,j;
- #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
j = 0;
for (i = 0;i < 0x20;i++)
diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c
index 6bc9b0eab92..b09afe5099e 100644
--- a/src/mame/drivers/namcos86.c
+++ b/src/mame/drivers/namcos86.c
@@ -1088,8 +1088,7 @@ static MACHINE_DRIVER_START( hopmappy )
MDRV_SCREEN_SIZE(64*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(3 + 8*8, 3 + 44*8-1, 2*8, 30*8-1)
MDRV_GFXDECODE(namcos86)
- MDRV_PALETTE_LENGTH(512)
- MDRV_COLORTABLE_LENGTH(4096)
+ MDRV_PALETTE_LENGTH(4096)
MDRV_PALETTE_INIT(namcos86)
MDRV_VIDEO_START(namcos86)
@@ -1216,8 +1215,8 @@ ROM_START( skykiddx )
ROM_REGION( 0x1420, REGION_PROMS, 0 )
ROM_LOAD( "sk3-1.3r", 0x0000, 0x0200, CRC(9e81dedd) SHA1(9d2ddf51788d22ed65db9070684e586b2f64f99e) ) /* red & green components */
ROM_LOAD( "sk3-2.3s", 0x0200, 0x0200, CRC(cbfec4dd) SHA1(98adf5db270a853ab2a2e1cdd9edfd5657287a96) ) /* blue component */
- ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) ) /* tiles colortable */
- ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) ) /* sprites colortable */
+ ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) ) /* tiles color table */
+ ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) ) /* sprites color table */
ROM_LOAD( "sk3-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */
ROM_REGION( 0x10000, REGION_CPU3, 0 )
@@ -1252,8 +1251,8 @@ ROM_START( skykiddo )
ROM_REGION( 0x1420, REGION_PROMS, 0 )
ROM_LOAD( "sk3-1.3r", 0x0000, 0x0200, CRC(9e81dedd) SHA1(9d2ddf51788d22ed65db9070684e586b2f64f99e) ) /* red & green components */
ROM_LOAD( "sk3-2.3s", 0x0200, 0x0200, CRC(cbfec4dd) SHA1(98adf5db270a853ab2a2e1cdd9edfd5657287a96) ) /* blue component */
- ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) ) /* tiles colortable */
- ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) ) /* sprites colortable */
+ ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) ) /* tiles color table */
+ ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) ) /* sprites color table */
ROM_LOAD( "sk3-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */
ROM_REGION( 0x10000, REGION_CPU3, 0 )
@@ -1287,8 +1286,8 @@ ROM_START( hopmappy )
ROM_REGION( 0x1420, REGION_PROMS, 0 )
ROM_LOAD( "hm1-1.3r", 0x0000, 0x0200, CRC(cc801088) SHA1(d2c39ac1694d9b8c426e253702ecd096e68c6db9) ) /* red & green components */
ROM_LOAD( "hm1-2.3s", 0x0200, 0x0200, CRC(a1cb71c5) SHA1(d8c33c2e52d64ebf4a07d8a26453e7b872cae413) ) /* blue component */
- ROM_LOAD( "hm1-3.4v", 0x0400, 0x0800, CRC(e362d613) SHA1(16d87711c1ac4ac2b649a32a5627cbd62cc5031f) ) /* tiles colortable */
- ROM_LOAD( "hm1-4.5v", 0x0c00, 0x0800, CRC(678252b4) SHA1(9e2f7328532be3ac4b48bd5d52cd993108558452) ) /* sprites colortable */
+ ROM_LOAD( "hm1-3.4v", 0x0400, 0x0800, CRC(e362d613) SHA1(16d87711c1ac4ac2b649a32a5627cbd62cc5031f) ) /* tiles color table */
+ ROM_LOAD( "hm1-4.5v", 0x0c00, 0x0800, CRC(678252b4) SHA1(9e2f7328532be3ac4b48bd5d52cd993108558452) ) /* sprites color table */
ROM_LOAD( "hm1-5.6u", 0x1400, 0x0020, CRC(475bf500) SHA1(7e6a91e57d3709a5c70786c8e3ed545ee6026d03) ) /* tile address decoder (used at runtime) */
ROM_REGION( 0x10000, REGION_CPU3, 0 )
@@ -1328,8 +1327,8 @@ ROM_START( roishtar )
ROM_REGION( 0x1420, REGION_PROMS, 0 )
ROM_LOAD( "ri1-1.3r", 0x0000, 0x0200, CRC(29cd0400) SHA1(a9b0d09492710e72e34155cd6a7b7c1a34c56b20) ) /* red & green components */
ROM_LOAD( "ri1-2.3s", 0x0200, 0x0200, CRC(02fd278d) SHA1(db104fc7acf2739def902180981eb7ba10ec3dda) ) /* blue component */
- ROM_LOAD( "ri1-3.4v", 0x0400, 0x0800, CRC(cbd7e53f) SHA1(77ef70be4e8a21948d697649352a5e3527086cf2) ) /* tiles colortable */
- ROM_LOAD( "ri1-4.5v", 0x0c00, 0x0800, CRC(22921617) SHA1(7304cb5a86f524f912feb8b58801393cce5d3b09) ) /* sprites colortable */
+ ROM_LOAD( "ri1-3.4v", 0x0400, 0x0800, CRC(cbd7e53f) SHA1(77ef70be4e8a21948d697649352a5e3527086cf2) ) /* tiles color table */
+ ROM_LOAD( "ri1-4.5v", 0x0c00, 0x0800, CRC(22921617) SHA1(7304cb5a86f524f912feb8b58801393cce5d3b09) ) /* sprites color table */
ROM_LOAD( "ri1-5.6u", 0x1400, 0x0020, CRC(e2188075) SHA1(be079ace2070433d4d90c757aef3e415b4e21455) ) /* tile address decoder (used at runtime) */
ROM_REGION( 0x10000, REGION_CPU3, 0 )
@@ -1370,8 +1369,8 @@ ROM_START( genpeitd )
ROM_REGION( 0x1420, REGION_PROMS, 0 )
ROM_LOAD( "gt1-1.3r", 0x0000, 0x0200, CRC(2f0ddddb) SHA1(27fa45c0baf9a48002db11be9b3c0472ecfd986c) ) /* red & green components */
ROM_LOAD( "gt1-2.3s", 0x0200, 0x0200, CRC(87d27025) SHA1(a50f969d48a99c6d29141458fb3e34b23cf5e67c) ) /* blue component */
- ROM_LOAD( "gt1-3.4v", 0x0400, 0x0800, CRC(c178de99) SHA1(67289ef9e5068636023316560f9f1690a8384bfb) ) /* tiles colortable */
- ROM_LOAD( "gt1-4.5v", 0x0c00, 0x0800, CRC(9f48ef17) SHA1(78c813dd57326f3f5ab785005ef89ba96303adeb) ) /* sprites colortable */
+ ROM_LOAD( "gt1-3.4v", 0x0400, 0x0800, CRC(c178de99) SHA1(67289ef9e5068636023316560f9f1690a8384bfb) ) /* tiles color table */
+ ROM_LOAD( "gt1-4.5v", 0x0c00, 0x0800, CRC(9f48ef17) SHA1(78c813dd57326f3f5ab785005ef89ba96303adeb) ) /* sprites color table */
ROM_LOAD( "gt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */
ROM_REGION( 0x10000, REGION_CPU3, 0 )
@@ -1421,8 +1420,8 @@ ROM_START( rthunder )
ROM_REGION( 0x1420, REGION_PROMS, 0 )
ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) /* red & green components */
ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) /* blue component */
- ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles colortable */
- ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites colortable */
+ ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles color table */
+ ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites color table */
ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */
ROM_REGION( 0x10000, REGION_CPU3, 0 )
@@ -1472,8 +1471,8 @@ ROM_START( rthundro )
ROM_REGION( 0x1420, REGION_PROMS, 0 )
ROM_LOAD( "rt1-1.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) ) /* red & green components */
ROM_LOAD( "rt1-2.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) ) /* blue component */
- ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles colortable */
- ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites colortable */
+ ROM_LOAD( "rt1-3.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) ) /* tiles color table */
+ ROM_LOAD( "rt1-4.5v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) ) /* sprites color table */
ROM_LOAD( "rt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */
ROM_REGION( 0x10000, REGION_CPU3, 0 )
@@ -1523,8 +1522,8 @@ ROM_START( wndrmomo )
ROM_REGION( 0x1420, REGION_PROMS, 0 )
ROM_LOAD( "wm1-1.3r", 0x0000, 0x0200, CRC(1af8ade8) SHA1(1aa0d314c34abc4154092d4b588214afb0b21e22) ) /* red & green components */
ROM_LOAD( "wm1-2.3s", 0x0200, 0x0200, CRC(8694e213) SHA1(f00d692e587c3706e71b6eeef21e1ea87c9dd921) ) /* blue component */
- ROM_LOAD( "wm1-3.4v", 0x0400, 0x0800, CRC(2ffaf9a4) SHA1(2002df3cc38e05f3e127d05c244cb101d1f1d85f) ) /* tiles colortable */
- ROM_LOAD( "wm1-4.5v", 0x0c00, 0x0800, CRC(f4e83e0b) SHA1(b000d884c6e0373b0403bc9d63eb0452c1197491) ) /* sprites colortable */
+ ROM_LOAD( "wm1-3.4v", 0x0400, 0x0800, CRC(2ffaf9a4) SHA1(2002df3cc38e05f3e127d05c244cb101d1f1d85f) ) /* tiles color table */
+ ROM_LOAD( "wm1-4.5v", 0x0c00, 0x0800, CRC(f4e83e0b) SHA1(b000d884c6e0373b0403bc9d63eb0452c1197491) ) /* sprites color table */
ROM_LOAD( "wm1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) ) /* tile address decoder (used at runtime) */
ROM_REGION( 0x10000, REGION_CPU3, 0 )
diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c
index d49b0fb75af..5ec60396c0a 100644
--- a/src/mame/drivers/pasha2.c
+++ b/src/mame/drivers/pasha2.c
@@ -386,10 +386,10 @@ static VIDEO_UPDATE( pasha2 )
}
static MACHINE_DRIVER_START( pasha2 )
- MDRV_CPU_ADD(E116T /*E116XT*/, 20000000) /* 20 MHz */
+ MDRV_CPU_ADD(E116XT, 20000000*4) /* 4x internal multiplier */
MDRV_CPU_PROGRAM_MAP(pasha2_map,0)
MDRV_CPU_IO_MAP(pasha2_io,0)
- MDRV_CPU_VBLANK_INT(irq5_line_pulse, 1)
+ MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
MDRV_SCREEN_REFRESH_RATE(60)
MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index bd4ab103faf..0f5ead5de23 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -3533,34 +3533,66 @@ ROM_END
*/
ROM_START( scross )
ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* v60 code */
- ROM_LOAD32_WORD_x2( "epr15093.bin", 0x000000, 0x040000, CRC(2adc7a4b) SHA1(dca71f00d94898c0758394704d819e13482bf120) )
- ROM_LOAD32_WORD_x2( "epr15094.bin", 0x000002, 0x040000, CRC(bbb0ae73) SHA1(0d8837706405f301adf8fa85c8d4813d7600af98) )
- ROM_LOAD32_WORD( "epr15018.bin", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) )
- ROM_LOAD32_WORD( "epr15019.bin", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) )
+ ROM_LOAD32_WORD_x2( "epr-15093.bin", 0x000000, 0x040000, CRC(2adc7a4b) SHA1(dca71f00d94898c0758394704d819e13482bf120) )
+ ROM_LOAD32_WORD_x2( "epr-15094.bin", 0x000002, 0x040000, CRC(bbb0ae73) SHA1(0d8837706405f301adf8fa85c8d4813d7600af98) )
+ ROM_LOAD32_WORD( "epr-15018.bin", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) )
+ ROM_LOAD32_WORD( "epr-15019.bin", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) )
ROM_REGION( 0x180000, REGION_CPU2, 0 ) /* sound CPU */
- ROM_LOAD_x4( "epr15192.bin", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) )
+ ROM_LOAD_x4( "epr-15192.bin", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) )
ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
/* 1ST AND 2ND HALF IDENTICAL (all roms) */
- ROM_LOAD16_BYTE( "epr15020.bin", 0x000000, 0x200000, CRC(65afea2f) SHA1(ad573727398bfac8e94f321be84b60e5690bfba6) )
- ROM_LOAD16_BYTE( "epr15021.bin", 0x000001, 0x200000, CRC(27bc6969) SHA1(d6bb446becb2d36b73bca5055357a43b837afc0a) )
+ ROM_LOAD16_BYTE( "epr-15020.bin", 0x000000, 0x200000, CRC(65afea2f) SHA1(ad573727398bfac8e94f321be84b60e5690bfba6) )
+ ROM_LOAD16_BYTE( "epr-15021.bin", 0x000001, 0x200000, CRC(27bc6969) SHA1(d6bb446becb2d36b73bca5055357a43b837afc0a) )
ROM_REGION32_BE( 0x1000000, REGION_GFX2, 0 ) /* sprites */
/* 1ST AND 2ND HALF IDENTICAL (all roms) */
- ROMX_LOAD( "epr15022.bin", 0x000000, 0x200000, CRC(09ca9608) SHA1(cbd0138c1c7811d42b051fed6a7e3526cc4e457f) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "epr15024.bin", 0x000002, 0x200000, CRC(0dc920eb) SHA1(d24d637aa0dcd3bae779ef7e12663df81667dbf7) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "epr15026.bin", 0x000004, 0x200000, CRC(67637c37) SHA1(7c250e7e9dd5c07da4fa35bacdfcecd5e8fa4ec7) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "epr15028.bin", 0x000006, 0x200000, CRC(9929abdc) SHA1(34b6624ddd3a0aedec0a2b433643a37f745ec66d) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "epr15023.bin", 0x800000, 0x200000, CRC(0e42a2bb) SHA1(503214caf5fa9a2324b61e04f378fd1a790322df) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "epr15025.bin", 0x800002, 0x200000, CRC(0c677fc6) SHA1(fc2207008417072e7ee91f722797d827e150ce2d) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "epr15027.bin", 0x800004, 0x200000, CRC(d6d077f9) SHA1(928cefae9ae58239fbffb1dcee282c6ac1e661fe) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "epr15029.bin", 0x800006, 0x200000, CRC(707af749) SHA1(fae5325c983df3cf198878220ad88d47339ac512) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15022.bin", 0x000000, 0x200000, CRC(09ca9608) SHA1(cbd0138c1c7811d42b051fed6a7e3526cc4e457f) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15024.bin", 0x000002, 0x200000, CRC(0dc920eb) SHA1(d24d637aa0dcd3bae779ef7e12663df81667dbf7) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15026.bin", 0x000004, 0x200000, CRC(67637c37) SHA1(7c250e7e9dd5c07da4fa35bacdfcecd5e8fa4ec7) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15028.bin", 0x000006, 0x200000, CRC(9929abdc) SHA1(34b6624ddd3a0aedec0a2b433643a37f745ec66d) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15023.bin", 0x800000, 0x200000, CRC(0e42a2bb) SHA1(503214caf5fa9a2324b61e04f378fd1a790322df) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15025.bin", 0x800002, 0x200000, CRC(0c677fc6) SHA1(fc2207008417072e7ee91f722797d827e150ce2d) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15027.bin", 0x800004, 0x200000, CRC(d6d077f9) SHA1(928cefae9ae58239fbffb1dcee282c6ac1e661fe) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15029.bin", 0x800006, 0x200000, CRC(707af749) SHA1(fae5325c983df3cf198878220ad88d47339ac512) , ROM_SKIP(6)|ROM_GROUPWORD )
ROM_REGION( 0x400000, REGION_SOUND1, 0 ) /* Sega PCM sound data */
/* 1ST AND 2ND HALF IDENTICAL (all roms, are these OK?) */
- ROM_LOAD("epr15031.bin", 0x000000, 0x200000, CRC(663a7fd2) SHA1(b4393a687225b075db21960d19a6ddd7a9d7d086) )
- ROM_LOAD("epr15032.bin", 0x200000, 0x200000, CRC(cb709f3d) SHA1(3962c8b5907d1f8f611f58ddac693cc47364a79c) )
+ ROM_LOAD("epr-15031.bin", 0x000000, 0x200000, CRC(663a7fd2) SHA1(b4393a687225b075db21960d19a6ddd7a9d7d086) )
+ ROM_LOAD("epr-15032.bin", 0x200000, 0x200000, CRC(cb709f3d) SHA1(3962c8b5907d1f8f611f58ddac693cc47364a79c) )
+ROM_END
+
+ROM_START( scrossu )
+ ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* v60 code */
+ ROM_LOAD32_WORD_x2( "epr-15091.bin", 0x000000, 0x040000, CRC(2c572293) SHA1(6377a6eb6084f7332ce6eeaaf0c37200da792d0c) )
+ ROM_LOAD32_WORD_x2( "epr-15092.bin", 0x000002, 0x040000, CRC(6e3e175a) SHA1(feaca0720646e2a4b78b376e99dc86788adb98e7) )
+ ROM_LOAD32_WORD( "epr-15018.bin", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) )
+ ROM_LOAD32_WORD( "epr-15019.bin", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) )
+
+ ROM_REGION( 0x180000, REGION_CPU2, 0 ) /* sound CPU */
+ ROM_LOAD_x4( "epr-15192.bin", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) )
+
+ ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
+ /* 1ST AND 2ND HALF IDENTICAL (all roms) */
+ ROM_LOAD16_BYTE( "epr-15020.bin", 0x000000, 0x200000, CRC(65afea2f) SHA1(ad573727398bfac8e94f321be84b60e5690bfba6) )
+ ROM_LOAD16_BYTE( "epr-15021.bin", 0x000001, 0x200000, CRC(27bc6969) SHA1(d6bb446becb2d36b73bca5055357a43b837afc0a) )
+
+ ROM_REGION32_BE( 0x1000000, REGION_GFX2, 0 ) /* sprites */
+ /* 1ST AND 2ND HALF IDENTICAL (all roms) */
+ ROMX_LOAD( "epr-15022.bin", 0x000000, 0x200000, CRC(09ca9608) SHA1(cbd0138c1c7811d42b051fed6a7e3526cc4e457f) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15024.bin", 0x000002, 0x200000, CRC(0dc920eb) SHA1(d24d637aa0dcd3bae779ef7e12663df81667dbf7) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15026.bin", 0x000004, 0x200000, CRC(67637c37) SHA1(7c250e7e9dd5c07da4fa35bacdfcecd5e8fa4ec7) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15028.bin", 0x000006, 0x200000, CRC(9929abdc) SHA1(34b6624ddd3a0aedec0a2b433643a37f745ec66d) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15023.bin", 0x800000, 0x200000, CRC(0e42a2bb) SHA1(503214caf5fa9a2324b61e04f378fd1a790322df) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15025.bin", 0x800002, 0x200000, CRC(0c677fc6) SHA1(fc2207008417072e7ee91f722797d827e150ce2d) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15027.bin", 0x800004, 0x200000, CRC(d6d077f9) SHA1(928cefae9ae58239fbffb1dcee282c6ac1e661fe) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "epr-15029.bin", 0x800006, 0x200000, CRC(707af749) SHA1(fae5325c983df3cf198878220ad88d47339ac512) , ROM_SKIP(6)|ROM_GROUPWORD )
+
+ ROM_REGION( 0x400000, REGION_SOUND1, 0 ) /* Sega PCM sound data */
+ /* 1ST AND 2ND HALF IDENTICAL (all roms, are these OK?) */
+ ROM_LOAD("epr-15031.bin", 0x000000, 0x200000, CRC(663a7fd2) SHA1(b4393a687225b075db21960d19a6ddd7a9d7d086) )
+ ROM_LOAD("epr-15032.bin", 0x200000, 0x200000, CRC(cb709f3d) SHA1(3962c8b5907d1f8f611f58ddac693cc47364a79c) )
ROM_END
@@ -4045,5 +4077,6 @@ GAME( 1994, harddunj, harddunk, multi32, harddunk, harddunk, ROT0, "Sega",
GAME( 1992, orunners, 0, multi32, orunners, orunners, ROT0, "Sega", "OutRunners (World)", GAME_IMPERFECT_GRAPHICS )
GAME( 1992, orunneru, orunners, multi32, orunners, orunners, ROT0, "Sega", "OutRunners (US)", GAME_IMPERFECT_GRAPHICS )
GAME( 1992, scross, 0, multi32, scross, scross, ROT0, "Sega", "Stadium Cross (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, scrossu, scross, multi32, scross, scross, ROT0, "Sega", "Stadium Cross (US)", GAME_IMPERFECT_GRAPHICS )
GAME( 1992, titlef, 0, multi32, titlef, titlef, ROT0, "Sega", "Title Fight (World)", GAME_IMPERFECT_GRAPHICS )
GAME( 1992, titlefu, titlef, multi32, titlef, titlef, ROT0, "Sega", "Title Fight (US)", GAME_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c
index 3b0ceb0b53a..ba27ebf7c10 100644
--- a/src/mame/drivers/snk.c
+++ b/src/mame/drivers/snk.c
@@ -40,7 +40,7 @@ Oct. 5, 2003:
Stephh's notes (based on the games Z80 code and some tests) :
-1) 'ftsoccer'
+1) 'fsoccerb'
- The code to support the rotary jotsticks has been removed and/or patched
in this version (check the 'jmp' instruction at 0x00f1).
@@ -120,8 +120,8 @@ AT08XX03:
- revamped CPU handshaking, improved clipping and made changes public to
marvins.c, hal21.c and sgladiat.c
- fixed shadows in tnk3, athena, fitegolf, countryc,
- and ftsoccer
- - added highlights to tdfever and ftsoccer(needs masking at team selection)
+ and fsoccer
+ - added highlights to tdfever and fsoccer(needs masking at team selection)
- notes:
Mad Crasher and Gladiator(sgladiat.c) have different memory maps but
@@ -466,7 +466,7 @@ static READ8_HANDLER( cpuA_io_r ){
case 0x500: return snk_input_port_r( 9 ); // unused by tdfever
case 0x580: return snk_input_port_r( 10 ); // dsw
case 0x600: return snk_input_port_r( 11 ); // dsw
- case 0x080: return snk_input_port_r( 12 ); // player start (types C and D in 'ftsoccer')
+ case 0x080: return snk_input_port_r( 12 ); // player start (types C and D in 'fsoccer')
case 0x700: return(snk_cpuB_nmi_trigger_r(0));
@@ -1258,7 +1258,7 @@ static MACHINE_DRIVER_START( tdfever2 )
MACHINE_DRIVER_END
-static MACHINE_DRIVER_START( ftsoccer )
+static MACHINE_DRIVER_START( fsoccer )
/* basic machine hardware */
MDRV_CPU_ADD(Z80, 4000000)
@@ -1272,7 +1272,7 @@ static MACHINE_DRIVER_START( ftsoccer )
MDRV_CPU_ADD(Z80, 4000000)
/* audio CPU */
MDRV_CPU_PROGRAM_MAP(Y8950_sound_map, 0)
- MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
+ MDRV_CPU_VBLANK_INT(irq0_line_hold,2)
MDRV_SCREEN_REFRESH_RATE(60)
MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
@@ -2665,7 +2665,48 @@ ROM_END
/***********************************************************************/
-ROM_START( ftsoccer )
+ROM_START( fsoccer )
+ ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for cpuA code */
+ ROM_LOAD( "fs3_ver4.bin", 0x00000, 0x10000, CRC(94c3f918) SHA1(7c8343556d6c3897e72f8b41c6fbdc5c58e78b8c) )
+
+ ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for cpuB code */
+ ROM_LOAD( "fs1_ver4.bin", 0x00000, 0x10000, CRC(97830108) SHA1(dab241baf8d889c768e1fbe25f1e5059b3cbbab6) )
+
+ ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* 64k for sound code */
+ ROM_LOAD( "fs2.bin", 0x00000, 0x10000, CRC(9ee54ea1) SHA1(4e3bbacaa0e247eb8c4043f394e763817a4f9a28) )
+
+ ROM_REGION( 0x0c00, REGION_PROMS, 0 )
+ ROM_LOAD( "prom2.bin", 0x000, 0x400, CRC(bf4ac706) SHA1(b5015563d88dbd93ba2838f01b189812958f142b) ) /* red */
+ ROM_LOAD( "prom1.bin", 0x400, 0x400, CRC(1bac8010) SHA1(16854b1b6f3d1be48a247796d65aeb90547099b6) ) /* green */
+ ROM_LOAD( "prom3.bin", 0x800, 0x400, CRC(dbeddb14) SHA1(6053b587a3c8272aefe728a7198a15aa7fb9b2fa) ) /* blue */
+
+ ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE ) /* characters */
+ ROM_LOAD( "fs13.bin", 0x0000, 0x08000, CRC(0de7b7ad) SHA1(4fa54b2acf83f03d09d16fc054ad6623cafe0f4a) )
+
+ ROM_REGION( 0x50000, REGION_GFX2, ROMREGION_DISPOSE ) /* background tiles */
+ ROM_LOAD( "fs14.bin", 0x00000, 0x10000, CRC(38c38b40) SHA1(c4580add0946720441f5ef751d0d4a944cd92ad5) )
+ ROM_LOAD( "fs15.bin", 0x10000, 0x10000, CRC(a614834f) SHA1(d73930e4bd780915e1b0d7f3fe7cbeaad19c233f) )
+
+// ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE ) /* 16x16 sprites */
+
+ ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE ) /* 32x32 sprites */
+ ROM_LOAD( "fs5.bin", 0x10000, 0x10000, CRC(def2f1d8) SHA1(b72e4dec3306d8afe461ac812b2de67ee85f9dd9) )
+ ROM_LOAD( "fs6.bin", 0x00000, 0x10000, CRC(588d14b3) SHA1(c0489b061503677a38e4c5800ea8be17aabf4039) )
+
+ ROM_LOAD( "fs7.bin", 0x30000, 0x10000, CRC(d584964b) SHA1(7c806fc40dcce700ed0c268abbd2704938b65ff2) )
+ ROM_LOAD( "fs8.bin", 0x20000, 0x10000, CRC(11156a7d) SHA1(f298a54fa4c118bf8e7c7cccb6c95a4b97daf4d4) )
+
+ ROM_LOAD( "fs9.bin", 0x50000, 0x10000, CRC(d8112aa6) SHA1(575dd6dff2f00901603768f2c121eb0ea5afa444) )
+ ROM_LOAD( "fs10.bin", 0x40000, 0x10000, CRC(e42864d8) SHA1(fe18f58e5507676780fe181e2fb0e0e9d72e276e) )
+
+ ROM_LOAD( "fs11.bin", 0x70000, 0x10000, CRC(022f3e96) SHA1(57aa423b8f62015566bc3021300ac7e9682ed500) )
+ ROM_LOAD( "fs12.bin", 0x60000, 0x10000, CRC(b2442c30) SHA1(ba9331810659726389494ddc7c94c5a02ba80747) )
+
+ ROM_REGION( 0x10000, REGION_SOUND1, 0 )
+ ROM_LOAD( "fs4.bin", 0x00000, 0x10000, CRC(435c3716) SHA1(42053741f60594e7ae8516b3ba600f5badb3620f) )
+ROM_END
+
+ROM_START( fsoccerb )
ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for cpuA code */
ROM_LOAD( "ft-003.bin", 0x00000, 0x10000, CRC(649d4448) SHA1(876a4cf3ce3211ee19390deb17a661ec52b419d2) )
@@ -2673,7 +2714,7 @@ ROM_START( ftsoccer )
ROM_LOAD( "ft-001.bin", 0x00000, 0x10000, CRC(2f68e38b) SHA1(0cbf2de24a5a5ae2134eb6f1e1404691554192bc) )
ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* 64k for sound code */
- ROM_LOAD( "ft-002.bin", 0x00000, 0x10000, CRC(9ee54ea1) SHA1(4e3bbacaa0e247eb8c4043f394e763817a4f9a28) )
+ ROM_LOAD( "fs2.bin", 0x00000, 0x10000, CRC(9ee54ea1) SHA1(4e3bbacaa0e247eb8c4043f394e763817a4f9a28) )
ROM_REGION( 0x0c00, REGION_PROMS, 0 )
ROM_LOAD( "prom2.bin", 0x000, 0x400, CRC(bf4ac706) SHA1(b5015563d88dbd93ba2838f01b189812958f142b) ) /* red */
@@ -2681,29 +2722,29 @@ ROM_START( ftsoccer )
ROM_LOAD( "prom3.bin", 0x800, 0x400, CRC(dbeddb14) SHA1(6053b587a3c8272aefe728a7198a15aa7fb9b2fa) ) /* blue */
ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE ) /* characters */
- ROM_LOAD( "ft-013.bin", 0x0000, 0x08000, CRC(0de7b7ad) SHA1(4fa54b2acf83f03d09d16fc054ad6623cafe0f4a) )
+ ROM_LOAD( "fs13.bin", 0x0000, 0x08000, CRC(0de7b7ad) SHA1(4fa54b2acf83f03d09d16fc054ad6623cafe0f4a) )
ROM_REGION( 0x50000, REGION_GFX2, ROMREGION_DISPOSE ) /* background tiles */
- ROM_LOAD( "ft-014.bin", 0x00000, 0x10000, CRC(38c38b40) SHA1(c4580add0946720441f5ef751d0d4a944cd92ad5) )
- ROM_LOAD( "ft-015.bin", 0x10000, 0x10000, CRC(a614834f) SHA1(d73930e4bd780915e1b0d7f3fe7cbeaad19c233f) )
+ ROM_LOAD( "fs14.bin", 0x00000, 0x10000, CRC(38c38b40) SHA1(c4580add0946720441f5ef751d0d4a944cd92ad5) )
+ ROM_LOAD( "fs15.bin", 0x10000, 0x10000, CRC(a614834f) SHA1(d73930e4bd780915e1b0d7f3fe7cbeaad19c233f) )
// ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE ) /* 16x16 sprites */
ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE ) /* 32x32 sprites */
- ROM_LOAD( "ft-005.bin", 0x10000, 0x10000, CRC(def2f1d8) SHA1(b72e4dec3306d8afe461ac812b2de67ee85f9dd9) )
- ROM_LOAD( "ft-006.bin", 0x00000, 0x10000, CRC(588d14b3) SHA1(c0489b061503677a38e4c5800ea8be17aabf4039) )
+ ROM_LOAD( "fs5.bin", 0x10000, 0x10000, CRC(def2f1d8) SHA1(b72e4dec3306d8afe461ac812b2de67ee85f9dd9) )
+ ROM_LOAD( "fs6.bin", 0x00000, 0x10000, CRC(588d14b3) SHA1(c0489b061503677a38e4c5800ea8be17aabf4039) )
- ROM_LOAD( "ft-007.bin", 0x30000, 0x10000, CRC(d584964b) SHA1(7c806fc40dcce700ed0c268abbd2704938b65ff2) )
- ROM_LOAD( "ft-008.bin", 0x20000, 0x10000, CRC(11156a7d) SHA1(f298a54fa4c118bf8e7c7cccb6c95a4b97daf4d4) )
+ ROM_LOAD( "fs7.bin", 0x30000, 0x10000, CRC(d584964b) SHA1(7c806fc40dcce700ed0c268abbd2704938b65ff2) )
+ ROM_LOAD( "fs8.bin", 0x20000, 0x10000, CRC(11156a7d) SHA1(f298a54fa4c118bf8e7c7cccb6c95a4b97daf4d4) )
- ROM_LOAD( "ft-009.bin", 0x50000, 0x10000, CRC(d8112aa6) SHA1(575dd6dff2f00901603768f2c121eb0ea5afa444) )
- ROM_LOAD( "ft-010.bin", 0x40000, 0x10000, CRC(e42864d8) SHA1(fe18f58e5507676780fe181e2fb0e0e9d72e276e) )
+ ROM_LOAD( "fs9.bin", 0x50000, 0x10000, CRC(d8112aa6) SHA1(575dd6dff2f00901603768f2c121eb0ea5afa444) )
+ ROM_LOAD( "fs10.bin", 0x40000, 0x10000, CRC(e42864d8) SHA1(fe18f58e5507676780fe181e2fb0e0e9d72e276e) )
- ROM_LOAD( "ft-011.bin", 0x70000, 0x10000, CRC(022f3e96) SHA1(57aa423b8f62015566bc3021300ac7e9682ed500) )
- ROM_LOAD( "ft-012.bin", 0x60000, 0x10000, CRC(b2442c30) SHA1(ba9331810659726389494ddc7c94c5a02ba80747) )
+ ROM_LOAD( "fs11.bin", 0x70000, 0x10000, CRC(022f3e96) SHA1(57aa423b8f62015566bc3021300ac7e9682ed500) )
+ ROM_LOAD( "fs12.bin", 0x60000, 0x10000, CRC(b2442c30) SHA1(ba9331810659726389494ddc7c94c5a02ba80747) )
ROM_REGION( 0x10000, REGION_SOUND1, 0 )
- ROM_LOAD( "ft-004.bin", 0x00000, 0x10000, CRC(435c3716) SHA1(42053741f60594e7ae8516b3ba600f5badb3620f) )
+ ROM_LOAD( "fs4.bin", 0x00000, 0x10000, CRC(435c3716) SHA1(42053741f60594e7ae8516b3ba600f5badb3620f) )
ROM_END
/***********************************************************************/
@@ -3817,7 +3858,7 @@ static INPUT_PORTS_START( countryc )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
-static INPUT_PORTS_START( ftsoccer )
+static INPUT_PORTS_START( fsoccer )
PORT_START_TAG("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -4250,7 +4291,7 @@ static const SNK_INPUT_PORT_TYPE choppera_io[SNK_MAX_INPUT_PORTS] = {
/* c080 */ SNK_UNUSED
};
-static const SNK_INPUT_PORT_TYPE ftsoccer_io[SNK_MAX_INPUT_PORTS] = {
+static const SNK_INPUT_PORT_TYPE fsoccer_io[SNK_MAX_INPUT_PORTS] = {
/* c000 */ SNK_INP0,
/* c100 */ SNK_INP1, SNK_INP2, SNK_INP3, SNK_INP4, /* joy1..joy4 */
/* c300 */ SNK_INP5, SNK_INP6, SNK_INP7, SNK_INP8, /* aim1..aim4 */
@@ -4424,9 +4465,9 @@ static DRIVER_INIT( tdfever2 ){
snk_irq_delay = 1000;
}
-static DRIVER_INIT( ftsoccer ){
+static DRIVER_INIT( fsoccer ){
snk_sound_busy_bit = 0x08;
- snk_io = ftsoccer_io;
+ snk_io = fsoccer_io;
hard_flags = 0;
videoram = snk_rambase + 0x800;
snk_gamegroup = 7;
@@ -4476,7 +4517,7 @@ GAME( 1986, ikarijp, ikari, ikari, ikarijp, ikarijp, ROT270, "SNK", "Ik
GAME( 1986, ikarijpb, ikari, ikari, ikarijpb, ikarijpb, ROT270, "bootleg", "Ikari (Japan bootleg)", GAME_NO_COCKTAIL )
GAME( 1986, victroad, 0, victroad, victroad, victroad, ROT270, "SNK", "Victory Road", GAME_NO_COCKTAIL )
GAME( 1986, dogosoke, victroad, victroad, victroad, dogosoke, ROT270, "SNK", "Dogou Souken", GAME_NO_COCKTAIL )
-GAME( 1986, dogosokj, victroad, victroad, dogosokj, dogosoke, ROT270, "bootleg", "Dogou Souken (Joystick bootleg)", GAME_NO_COCKTAIL )
+GAME( 1986, dogosokj, victroad, victroad, dogosokj, dogosoke, ROT270, "bootleg", "Dogou Souken (Joystick hack bootleg)", GAME_NO_COCKTAIL )
GAME( 1987, gwar, 0, gwar, gwar, gwar, ROT270, "SNK", "Guerrilla War (US)", GAME_NO_COCKTAIL )
GAME( 1987, gwarj, gwar, gwar, gwar, gwar, ROT270, "SNK", "Guevara (Japan)", GAME_NO_COCKTAIL )
GAME( 1987, gwara, gwar, gwar, gwar, gwara, ROT270, "SNK", "Guerrilla War (Version 1)", GAME_NO_COCKTAIL )
@@ -4492,6 +4533,8 @@ GAME( 1988, choppera, chopper, chopper1, choppera, choppera, ROT270, "SNK", "Ch
GAME( 1988, chopperb, chopper, chopper1, legofair, chopper, ROT270, "SNK", "Chopper I (US set 3)", GAME_NO_COCKTAIL )
GAME( 1988, legofair, chopper, chopper1, legofair, chopper, ROT270, "SNK", "Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan)", GAME_NO_COCKTAIL )
GAME( 1987, tdfever, 0, tdfever, tdfever, tdfever, ROT270, "SNK", "TouchDown Fever", GAME_NO_COCKTAIL )
-GAME( 1987, tdfeverj, tdfever, tdfever, tdfeverj, tdfever, ROT270, "SNK", "TouchDown Fever (Japan)", GAME_NO_COCKTAIL )
+GAME( 1987, tdfeverj, tdfever, tdfever, tdfeverj, tdfever, ROT270, "SNK", "TouchDown Fever (Japan)", GAME_NO_COCKTAIL )
GAME( 1988, tdfever2, tdfever, tdfever2, tdfever, tdfever2, ROT270, "SNK", "TouchDown Fever 2", GAME_NO_COCKTAIL ) /* upgrade kit for Touchdown Fever */
-GAME( 1988, ftsoccer, 0, ftsoccer, ftsoccer, ftsoccer, ROT0, "SNK", "Fighting Soccer", GAME_NO_COCKTAIL )
+GAME( 1988, fsoccer, 0, fsoccer, fsoccer, fsoccer, ROT0, "SNK", "Fighting Soccer (version 4)", GAME_NO_COCKTAIL )
+GAME( 1988, fsoccerb, fsoccer, fsoccer, fsoccer, fsoccer, ROT0, "bootleg", "Fighting Soccer (joystick hack bootleg)", GAME_NO_COCKTAIL )
+
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c