summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/thunderx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/thunderx.c')
-rw-r--r--src/mame/video/thunderx.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/mame/video/thunderx.c b/src/mame/video/thunderx.c
index f5ca50ea5f2..0c6577383ad 100644
--- a/src/mame/video/thunderx.c
+++ b/src/mame/video/thunderx.c
@@ -7,12 +7,20 @@
***************************************************************************/
+static const int layer_colorbase[] = { 768 / 16, 0 / 16, 256 / 16 };
+
K052109_CB_MEMBER(thunderx_state::tile_callback)
{
*code |= ((*color & 0x1f) << 8) | (bank << 13);
- *color = m_layer_colorbase[layer] + ((*color & 0xe0) >> 5);
+ *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
+K052109_CB_MEMBER(thunderx_state::gbusters_tile_callback)
+{
+ /* (color & 0x02) is flip y handled internally by the 052109 */
+ *code |= ((*color & 0x0d) << 8) | ((*color & 0x10) << 5) | (bank << 12);
+ *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5);
+}
/***************************************************************************
@@ -20,6 +28,8 @@ K052109_CB_MEMBER(thunderx_state::tile_callback)
***************************************************************************/
+static const int sprite_colorbase = 512 / 16;
+
K051960_CB_MEMBER(thunderx_state::sprite_callback)
{
/* Sprite priority 1 means appear behind background, used only to mask sprites */
@@ -27,13 +37,13 @@ K051960_CB_MEMBER(thunderx_state::sprite_callback)
/* Sprite priority 3 means don't draw (not used) */
switch (*color & 0x30)
{
- case 0x00: *priority = 0xf0; break;
- case 0x10: *priority = 0xf0 | 0xcc | 0xaa; break;
- case 0x20: *priority = 0xf0 | 0xcc; break;
+ case 0x00: *priority = 0; break;
+ case 0x10: *priority = GFX_PMASK_2 | GFX_PMASK_1; break;
+ case 0x20: *priority = GFX_PMASK_2; break;
case 0x30: *priority = 0xffff; break;
}
- *color = m_sprite_colorbase + (*color & 0x0f);
+ *color = sprite_colorbase + (*color & 0x0f);
}
@@ -46,11 +56,6 @@ K051960_CB_MEMBER(thunderx_state::sprite_callback)
void thunderx_state::video_start()
{
- m_layer_colorbase[0] = 48;
- m_layer_colorbase[1] = 0;
- m_layer_colorbase[2] = 16;
- m_sprite_colorbase = 32;
-
m_palette->set_shadow_factor(7.0/8.0);
}
@@ -61,26 +66,21 @@ void thunderx_state::video_start()
***************************************************************************/
-UINT32 thunderx_state::screen_update_scontra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 thunderx_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_k052109->tilemap_update();
screen.priority().fill(0, cliprect);
- /* The background color is always from layer 1 - but it's always black anyway */
-// bitmap.fill(16 * m_layer_colorbase[1], cliprect);
- if (m_priority)
- {
- m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, TILEMAP_DRAW_OPAQUE, 1);
- m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2);
- }
- else
- {
- m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1);
- m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
- }
- m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 4);
+ /* The background color is always from layer 1 */
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 0);
+
+ int bg = m_priority ? 2 : 1;
+ int fg = m_priority ? 1 : 2;
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, bg, 0, 1);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, fg, 0, 2);
m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
return 0;
}