diff options
author | ajrhacker <ajrhacker@users.noreply.github.com> | 2020-03-02 09:20:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 09:20:47 -0500 |
commit | f660c45620ccae2055c3b2d6229759a1997ccda1 (patch) | |
tree | 8723527d44aacadf869443d79749a46a022e6ecc | |
parent | 527cb1d5284b368752cbdfd42e647d15bb833b89 (diff) | |
parent | 2e5acf3d7b2c158f6885ca7416fad800df0ce2bf (diff) |
Merge pull request #6380 from cam900/decospr_pri
decospr.cpp : Allow priority/color callback usable with external mixing bit
-rw-r--r-- | src/mame/drivers/deco32.cpp | 10 | ||||
-rw-r--r-- | src/mame/includes/deco32.h | 1 | ||||
-rw-r--r-- | src/mame/video/deco32.cpp | 14 | ||||
-rw-r--r-- | src/mame/video/decospr.cpp | 8 | ||||
-rw-r--r-- | src/mame/video/decospr.h | 8 |
5 files changed, 25 insertions, 16 deletions
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp index 3cbe6c4e564..41fc3007fcc 100644 --- a/src/mame/drivers/deco32.cpp +++ b/src/mame/drivers/deco32.cpp @@ -874,6 +874,15 @@ DECOSPR_PRIORITY_CB_MEMBER( captaven_state::captaven_pri_callback ) } } +DECOSPR_PRIORITY_CB_MEMBER( fghthist_state::fghthist_pri_callback ) +{ + u32 mask = GFX_PMASK_8; // under the text layer + if (extpri) + mask |= GFX_PMASK_4; // under the uppermost playfield + + return mask; +} + DECO16IC_BANK_CB_MEMBER( captaven_state::bank_callback ) { return (bank & 0x20) << 9; @@ -1966,6 +1975,7 @@ void fghthist_state::fghthist(machine_config &config) DECO_SPRITE(config, m_sprgen[0], 0); m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_pri_callback(FUNC(fghthist_state::fghthist_pri_callback)); m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); DECO146PROT(config, m_ioprot, 0); diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h index e591f316445..afda3b5b7ea 100644 --- a/src/mame/includes/deco32.h +++ b/src/mame/includes/deco32.h @@ -153,6 +153,7 @@ private: u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECO16IC_BANK_CB_MEMBER(bank_callback); + DECOSPR_PRIORITY_CB_MEMBER(fghthist_pri_callback); void fghthist_map(address_map &map); void fghthsta_memmap(address_map &map); diff --git a/src/mame/video/deco32.cpp b/src/mame/video/deco32.cpp index c79b6edd7c8..f637f6b48a0 100644 --- a/src/mame/video/deco32.cpp +++ b/src/mame/video/deco32.cpp @@ -112,7 +112,6 @@ void captaven_state::video_start() void fghthist_state::video_start() { - m_sprgen[0]->alloc_sprite_bitmap(); deco32_state::allocate_spriteram(0); deco32_state::allocate_rowscroll(0x2000/4, 0x2000/4, 0x2000/4, 0x2000/4); deco32_state::allocate_buffered_palette(); @@ -219,29 +218,26 @@ u32 fghthist_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c m_deco_tilegen[0]->pf_update(m_pf_rowscroll[0].get(), m_pf_rowscroll[1].get()); m_deco_tilegen[1]->pf_update(m_pf_rowscroll[2].get(), m_pf_rowscroll[3].get()); - // sprites are flipped relative to tilemaps - m_sprgen[0]->set_flip_screen(true); - m_sprgen[0]->draw_sprites(bitmap, cliprect, m_spriteram16_buffered[0].get(), 0x800); - /* Draw screen */ m_deco_tilegen[1]->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); if (m_pri & 1) { m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); - m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); } else { m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); - m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); } - m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff); + m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 8); + + // sprites are flipped relative to tilemaps + m_sprgen[0]->set_flip_screen(true); + m_sprgen[0]->draw_sprites(bitmap, cliprect, m_spriteram16_buffered[0].get(), 0x800); - m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/decospr.cpp b/src/mame/video/decospr.cpp index 5c6aa4b2a14..3f76594f56c 100644 --- a/src/mame/video/decospr.cpp +++ b/src/mame/video/decospr.cpp @@ -118,6 +118,8 @@ ssssSSSS pppccccc s = size (height) S = size (width) +p = priority +c = colour palette offs +3 -------- -------- @@ -237,7 +239,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle & if (!m_sprite_bitmap.valid()) { - colour = m_col_cb(x); + colour = m_col_cb(x, y & 0x8000); } else { @@ -247,7 +249,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle & if (!m_pri_cb.isnull()) - pri = m_pri_cb(x); + pri = m_pri_cb(x, y & 0x8000); else pri = 0; @@ -409,7 +411,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle & if (!m_pri_cb.isnull()) - pri = m_pri_cb(spriteram[offs+2]&0x00ff); + pri = m_pri_cb(spriteram[offs+2]&0x00ff, false); else pri = 0; diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h index 338b67772dc..c3a5d04b12e 100644 --- a/src/mame/video/decospr.h +++ b/src/mame/video/decospr.h @@ -5,13 +5,13 @@ #pragma once -typedef device_delegate<uint16_t (uint16_t pri)> decospr_pri_cb_delegate; -typedef device_delegate<uint16_t (uint16_t col)> decospr_col_cb_delegate; +typedef device_delegate<uint16_t (uint16_t pri, bool extpri)> decospr_pri_cb_delegate; +typedef device_delegate<uint16_t (uint16_t col, bool extcol)> decospr_col_cb_delegate; // function definition for a callback -#define DECOSPR_PRIORITY_CB_MEMBER(_name) uint16_t _name(uint16_t pri) -#define DECOSPR_COLOUR_CB_MEMBER(_name) uint16_t _name(uint16_t col) +#define DECOSPR_PRIORITY_CB_MEMBER(_name) uint16_t _name(uint16_t pri, bool extpri) +#define DECOSPR_COLOUR_CB_MEMBER(_name) uint16_t _name(uint16_t col, bool extcol) class decospr_device : public device_t, public device_video_interface |