1 // license:BSD-3-Clause 2 // copyright-holders:Mirko Buffoni 3 /************************************************************************* 4 5 Son Son 6 7 *************************************************************************/ 8 #ifndef MAME_INCLUDES_SONSON_H 9 #define MAME_INCLUDES_SONSON_H 10 11 #pragma once 12 13 #include "emupal.h" 14 #include "tilemap.h" 15 16 class sonson_state : public driver_device 17 { 18 public: sonson_state(const machine_config & mconfig,device_type type,const char * tag)19 sonson_state(const machine_config &mconfig, device_type type, const char *tag) : 20 driver_device(mconfig, type, tag), 21 m_videoram(*this, "videoram"), 22 m_colorram(*this, "colorram"), 23 m_spriteram(*this, "spriteram"), 24 m_audiocpu(*this, "audiocpu"), 25 m_maincpu(*this, "maincpu"), 26 m_gfxdecode(*this, "gfxdecode"), 27 m_palette(*this, "palette") 28 { } 29 30 void sonson(machine_config &config); 31 32 private: 33 /* memory pointers */ 34 required_shared_ptr<uint8_t> m_videoram; 35 required_shared_ptr<uint8_t> m_colorram; 36 required_shared_ptr<uint8_t> m_spriteram; 37 38 /* video-related */ 39 tilemap_t *m_bg_tilemap; 40 41 /* devices */ 42 required_device<cpu_device> m_audiocpu; 43 DECLARE_WRITE_LINE_MEMBER(sh_irqtrigger_w); 44 DECLARE_WRITE_LINE_MEMBER(coin1_counter_w); 45 DECLARE_WRITE_LINE_MEMBER(coin2_counter_w); 46 void sonson_videoram_w(offs_t offset, uint8_t data); 47 void sonson_colorram_w(offs_t offset, uint8_t data); 48 void sonson_scrollx_w(uint8_t data); 49 DECLARE_WRITE_LINE_MEMBER(flipscreen_w); 50 TILE_GET_INFO_MEMBER(get_bg_tile_info); 51 virtual void video_start() override; 52 void sonson_palette(palette_device &palette) const; 53 uint32_t screen_update_sonson(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); 54 void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); 55 required_device<cpu_device> m_maincpu; 56 required_device<gfxdecode_device> m_gfxdecode; 57 required_device<palette_device> m_palette; 58 59 void main_map(address_map &map); 60 void sound_map(address_map &map); 61 }; 62 63 #endif // MAME_INCLUDES_SONSON_H 64