1 // license:BSD-3-Clause 2 // copyright-holders:Brad Oliver 3 /*************************************************************************** 4 5 Mr. Do's Castle hardware 6 7 ***************************************************************************/ 8 #ifndef MAME_INCLUDES_DOCASTLE_H 9 #define MAME_INCLUDES_DOCASTLE_H 10 11 #pragma once 12 13 #include "machine/tms1024.h" 14 #include "video/mc6845.h" 15 #include "sound/msm5205.h" 16 #include "emupal.h" 17 #include "tilemap.h" 18 19 class docastle_state : public driver_device 20 { 21 public: docastle_state(const machine_config & mconfig,device_type type,const char * tag)22 docastle_state(const machine_config &mconfig, device_type type, const char *tag) : 23 driver_device(mconfig, type, tag), 24 m_maincpu(*this, "maincpu"), 25 m_slave(*this, "slave"), 26 m_cpu3(*this, "cpu3"), 27 m_crtc(*this, "crtc"), 28 m_msm(*this, "msm"), 29 m_inp(*this, "inp%u", 1), 30 m_videoram(*this, "videoram"), 31 m_colorram(*this, "colorram"), 32 m_spriteram(*this, "spriteram"), 33 m_gfxdecode(*this, "gfxdecode"), 34 m_palette(*this, "palette") 35 { } 36 37 void dorunrun(machine_config &config); 38 void idsoccer(machine_config &config); 39 void docastle(machine_config &config); 40 41 protected: 42 virtual void machine_start() override; 43 virtual void machine_reset() override; 44 virtual void video_start() override; 45 46 private: 47 /* devices */ 48 required_device<cpu_device> m_maincpu; 49 required_device<cpu_device> m_slave; 50 required_device<cpu_device> m_cpu3; 51 required_device<hd6845s_device> m_crtc; 52 optional_device<msm5205_device> m_msm; 53 required_device_array<tms1025_device, 2> m_inp; 54 55 /* memory pointers */ 56 required_shared_ptr<uint8_t> m_videoram; 57 required_shared_ptr<uint8_t> m_colorram; 58 required_shared_ptr<uint8_t> m_spriteram; 59 60 required_device<gfxdecode_device> m_gfxdecode; 61 required_device<palette_device> m_palette; 62 63 /* video-related */ 64 tilemap_t *m_do_tilemap; 65 66 /* misc */ 67 int m_prev_ma6; 68 int m_adpcm_pos; 69 int m_adpcm_idle; 70 int m_adpcm_data; 71 int m_adpcm_status; 72 uint8_t m_buffer0[9]; 73 uint8_t m_buffer1[9]; 74 75 uint8_t docastle_shared0_r(offs_t offset); 76 uint8_t docastle_shared1_r(offs_t offset); 77 void docastle_shared0_w(offs_t offset, uint8_t data); 78 void docastle_shared1_w(offs_t offset, uint8_t data); 79 void docastle_nmitrigger_w(uint8_t data); 80 void docastle_videoram_w(offs_t offset, uint8_t data); 81 void docastle_colorram_w(offs_t offset, uint8_t data); 82 uint8_t inputs_flipscreen_r(offs_t offset); 83 void flipscreen_w(offs_t offset, uint8_t data); 84 uint8_t idsoccer_adpcm_status_r(); 85 void idsoccer_adpcm_w(uint8_t data); 86 TILE_GET_INFO_MEMBER(get_tile_info); 87 void docastle_palette(palette_device &palette) const; 88 DECLARE_VIDEO_START(dorunrun); 89 uint32_t screen_update_docastle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); 90 void video_start_common( uint32_t tile_transmask ); 91 void draw_sprites( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ); 92 DECLARE_WRITE_LINE_MEMBER(docastle_tint); 93 DECLARE_WRITE_LINE_MEMBER(idsoccer_adpcm_int); 94 void docastle_io_map(address_map &map); 95 void docastle_map(address_map &map); 96 void docastle_map2(address_map &map); 97 void docastle_map3(address_map &map); 98 void dorunrun_map(address_map &map); 99 void dorunrun_map2(address_map &map); 100 void idsoccer_map(address_map &map); 101 }; 102 103 #endif // MAME_INCLUDES_DOCASTLE_H 104