summaryrefslogblamecommitdiffstatshomepage
path: root/src/mame/includes/srmp2.h
blob: 011a28ef84744e1e53bca9dc42c8549bcc3ab1f3 (plain) (tree)
1
2
3
4
5
6
7
8
                       
                                           
                          
                          
 


                                                          


                     

  
                                        
 
       
                                                                                     
                                                    
                                            
                                              
                                       
 


                                                  
 

                         

                         

                              
                    

                 




                                             




                                                     

                                                 
 
                   
                                                  




                                                
                                            




                                               
 
                                              
                                     
                                    
                                     
                                    

                                        
 


                                                                                                               

                                                                 
                                                    



                                              





                                               
  
// license:BSD-3-Clause
// copyright-holders:Yochizo, Takahiro Nogi
#include "sound/msm5205.h"
#include "video/seta001.h"

struct iox_t
{
	int reset,ff_event,ff_1,protcheck[4],protlatch[4];
	uint8_t data;
	uint8_t mux;
	uint8_t ff;
};

class srmp2_state : public driver_device
{
public:
	srmp2_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_maincpu(*this, "maincpu"),
		m_seta001(*this, "spritegen"),
		m_msm(*this, "msm") { }

	required_device<cpu_device> m_maincpu;
	required_device<seta001_device> m_seta001;
	required_device<msm5205_device> m_msm;

	int m_color_bank;
	int m_gfx_bank;
	int m_adpcm_bank;
	int m_adpcm_data;
	uint32_t m_adpcm_sptr;
	uint32_t m_adpcm_eptr;
	iox_t m_iox;

	// common
	DECLARE_READ8_MEMBER(vox_status_r);
	DECLARE_READ8_MEMBER(iox_mux_r);
	DECLARE_READ8_MEMBER(iox_status_r);
	DECLARE_WRITE8_MEMBER(iox_command_w);
	DECLARE_WRITE8_MEMBER(iox_data_w);
	DECLARE_WRITE_LINE_MEMBER(adpcm_int);

	// mjuugi
	DECLARE_WRITE16_MEMBER(mjyuugi_flags_w);
	DECLARE_WRITE16_MEMBER(mjyuugi_adpcm_bank_w);
	DECLARE_READ8_MEMBER(mjyuugi_irq2_ack_r);
	DECLARE_READ8_MEMBER(mjyuugi_irq4_ack_r);

	// rmgoldyh
	DECLARE_WRITE8_MEMBER(rmgoldyh_rombank_w);

	// srmp2
	DECLARE_WRITE8_MEMBER(srmp2_irq2_ack_w);
	DECLARE_WRITE8_MEMBER(srmp2_irq4_ack_w);
	DECLARE_WRITE16_MEMBER(srmp2_flags_w);
	DECLARE_WRITE8_MEMBER(adpcm_code_w);

	// srmp3
	DECLARE_WRITE8_MEMBER(srmp3_rombank_w);
	DECLARE_WRITE8_MEMBER(srmp3_flags_w);
	DECLARE_WRITE8_MEMBER(srmp3_irq_ack_w);

	virtual void machine_start() override;
	DECLARE_MACHINE_START(srmp2);
	DECLARE_PALETTE_INIT(srmp2);
	DECLARE_MACHINE_START(srmp3);
	DECLARE_PALETTE_INIT(srmp3);
	DECLARE_MACHINE_START(rmgoldyh);
	DECLARE_MACHINE_START(mjyuugi);

	uint32_t screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	uint32_t screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	uint32_t screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp3_gfxbank_callback);

	uint8_t iox_key_matrix_calc(uint8_t p_side);
	void mjyuugi(machine_config &config);
	void srmp2(machine_config &config);
	void rmgoldyh(machine_config &config);
	void srmp3(machine_config &config);
	void mjyuugi_map(address_map &map);
	void rmgoldyh_io_map(address_map &map);
	void rmgoldyh_map(address_map &map);
	void srmp2_map(address_map &map);
	void srmp3_io_map(address_map &map);
	void srmp3_map(address_map &map);
};