diff options
Diffstat (limited to 'src/mame/video/tc0100scn.h')
-rw-r--r-- | src/mame/video/tc0100scn.h | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/src/mame/video/tc0100scn.h b/src/mame/video/tc0100scn.h index 8bd82a48773..5f61ce72440 100644 --- a/src/mame/video/tc0100scn.h +++ b/src/mame/video/tc0100scn.h @@ -7,14 +7,18 @@ #include "emupal.h" +typedef device_delegate<void (u32 *code, u16 *color)> tc0100scn_cb_delegate; +#define TC0100SCN_CB_MEMBER(_name) void _name(u32 *code, u16 *color) + class tc0100scn_device : public device_t { public: - tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // configuration template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); } template <typename T> void set_palette_tag(T &&tag) { m_palette.set_tag(std::forward<T>(tag)); } + template <typename... T> void set_tile_callback(T &&... args) { m_tc0100scn_cb = tc0100scn_cb_delegate(std::forward<T>(args)...); } void set_gfx_region(int gfxregion) { m_gfxnum = gfxregion; } void set_tx_region(int txregion) { m_txnum = txregion; } void set_multiscr_xoffs(int xoffs) { m_multiscrn_xoffs = xoffs; } @@ -41,25 +45,14 @@ public: To change from the default (0,0,0) use after calling TC0100SCN_vh_start */ void set_colbanks(int bg0, int bg1, int tx); - /* Function to set bg tilemask < 0xffff */ - void set_bg_tilemask(int mask); - - /* Function to for Mjnquest to select gfx bank */ - DECLARE_WRITE16_MEMBER(gfxbank_w); - - DECLARE_READ16_MEMBER(word_r); - DECLARE_WRITE16_MEMBER(word_w); - DECLARE_READ16_MEMBER(ctrl_word_r); - DECLARE_WRITE16_MEMBER(ctrl_word_w); - - /* Functions for use with 68020 (Under Fire) */ - DECLARE_READ32_MEMBER(long_r); - DECLARE_WRITE32_MEMBER(long_w); - DECLARE_READ32_MEMBER(ctrl_long_r); - DECLARE_WRITE32_MEMBER(ctrl_long_w); + u16 ram_r(offs_t offset); + void ram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + u16 ctrl_r(offs_t offset); + void ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0); void tilemap_update(); - int tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority); + int tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority, u8 pmask = 0xff); + void tilemap_set_dirty(); /* returns 0 or 1 depending on the lowest priority tilemap set in the internal register. Use this function to draw tilemaps in the correct order. */ @@ -73,26 +66,27 @@ protected: private: // internal state - uint16_t m_ctrl[8]; + tc0100scn_cb_delegate m_tc0100scn_cb; + + u16 m_ctrl[8]; - std::unique_ptr<uint16_t[]> m_ram; - uint16_t * m_bg_ram; - uint16_t * m_fg_ram; - uint16_t * m_tx_ram; - uint16_t * m_char_ram; - uint16_t * m_bgscroll_ram; - uint16_t * m_fgscroll_ram; - uint16_t * m_colscroll_ram; + std::unique_ptr<u16[]> m_ram; + u16 * m_bg_ram; + u16 * m_fg_ram; + u16 * m_tx_ram; + u16 * m_char_ram; + u16 * m_bgscroll_ram; + u16 * m_fgscroll_ram; + u16 * m_colscroll_ram; int m_bgscrollx, m_bgscrolly, m_fgscrollx, m_fgscrolly; /* We keep two tilemaps for each of the 3 actual tilemaps: one at standard width, one double */ - tilemap_t *m_tilemap[3][2]; + tilemap_t *m_tilemap[3][2]; - int m_bg_tilemask; - int32_t m_gfxbank; - int32_t m_bg0_colbank, m_bg1_colbank, m_tx_colbank; + s32 m_bg0_colbank, m_bg1_colbank, m_tx_colbank; int m_dblwidth; + bool m_dirty; int m_gfxnum; int m_txnum; @@ -109,9 +103,9 @@ private: TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info); - void common_get_tile_info(tile_data &tileinfo, int tile_index, uint16_t *ram, int colbank); + void common_get_tile_info(tile_data &tileinfo, int tile_index, u16 *ram, int colbank); - void tilemap_draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t* tmap, int flags, uint32_t priority); + void tilemap_draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t* tmap, int flags, u32 priority, u8 pmask = 0xff); void set_layer_ptrs(); void dirty_tilemaps(); void restore_scroll(); |