1 // license:BSD-3-Clause 2 // copyright-holders:Luca Elia 3 #ifndef MAME_INCLUDES_REALBRK_H 4 #define MAME_INCLUDES_REALBRK_H 5 6 #pragma once 7 8 #include "machine/tmp68301.h" 9 #include "emupal.h" 10 #include "screen.h" 11 #include "tilemap.h" 12 13 class realbrk_state : public driver_device 14 { 15 public: realbrk_state(const machine_config & mconfig,device_type type,const char * tag)16 realbrk_state(const machine_config &mconfig, device_type type, const char *tag) : 17 driver_device(mconfig, type, tag), 18 m_maincpu(*this, "maincpu"), 19 m_gfxdecode(*this, "gfxdecode"), 20 m_screen(*this, "screen"), 21 m_palette(*this, "palette"), 22 m_spriteram(*this, "spriteram"), 23 m_vram(*this, "vram_%u", 0U), 24 m_vregs(*this, "vregs"), 25 m_dsw_select(*this, "dsw_select"), 26 m_backup_ram(*this, "backup_ram"), 27 m_vram_ras(*this, "vram_%uras", 0U), 28 m_in_io(*this, "IN%u", 0U), 29 m_dsw_io(*this, "SW%u", 1U), 30 m_paddle_io(*this, "PADDLE%u", 1U), 31 m_player_io(*this, "P%u", 1U) 32 { } 33 34 void pkgnsh(machine_config &config); 35 void dai2kaku(machine_config &config); 36 void realbrk(machine_config &config); 37 void pkgnshdx(machine_config &config); 38 39 protected: 40 virtual void video_start() override; 41 42 private: 43 required_device<tmp68301_device> m_maincpu; 44 required_device<gfxdecode_device> m_gfxdecode; 45 required_device<screen_device> m_screen; 46 required_device<palette_device> m_palette; 47 48 required_shared_ptr<u16> m_spriteram; 49 required_shared_ptr_array<u16, 3> m_vram; 50 required_shared_ptr<u16> m_vregs; 51 optional_shared_ptr<u16> m_dsw_select; 52 optional_shared_ptr<u16> m_backup_ram; 53 optional_shared_ptr_array<u16, 2> m_vram_ras; 54 55 optional_ioport_array<2> m_in_io; 56 optional_ioport_array<4> m_dsw_io; 57 optional_ioport_array<2> m_paddle_io; 58 optional_ioport_array<2> m_player_io; 59 60 std::unique_ptr<bitmap_ind16> m_tmpbitmap0; 61 std::unique_ptr<bitmap_ind16> m_tmpbitmap1; 62 int m_disable_video; 63 tilemap_t *m_tilemap[3]; 64 65 // common 66 template<int Layer> void vram_w(offs_t offset, u16 data, u16 mem_mask); 67 void vram_2_w(offs_t offset, u16 data, u16 mem_mask); 68 void vregs_w(offs_t offset, u16 data, u16 mem_mask); 69 70 // realbrk and/or dai2kaku 71 u16 realbrk_dsw_r(); 72 void realbrk_flipscreen_w(offs_t offset, u16 data, u16 mem_mask); 73 void dai2kaku_flipscreen_w(u16 data); 74 75 // pkgnsh and/or pkgnshdx 76 u16 pkgnsh_input_r(offs_t offset); 77 u16 pkgnshdx_input_r(offs_t offset); 78 u16 backup_ram_r(offs_t offset); 79 u16 backup_ram_dx_r(offs_t offset); 80 void backup_ram_w(offs_t offset, u16 data, u16 mem_mask); 81 82 template<int Layer> TILE_GET_INFO_MEMBER(get_tile_info); 83 TILE_GET_INFO_MEMBER(get_tile_info_2); 84 85 u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); 86 u32 screen_update_dai2kaku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); 87 template <bool Rotatable> void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, bitmap_ind8 &priority); 88 89 DECLARE_WRITE_LINE_MEMBER(vblank_irq); 90 void base_mem(address_map &map); 91 void dai2kaku_mem(address_map &map); 92 void pkgnsh_mem(address_map &map); 93 void pkgnshdx_mem(address_map &map); 94 void realbrk_mem(address_map &map); 95 }; 96 97 #endif // MAME_INCLUDES_REALBRK_H 98