Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions src/mame/sinclair/specnext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,33 +959,45 @@ u32 specnext_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c
{
bitmap.fill(m_palette->pen_color(UTM_FALLBACK_PEN), cliprect);

if (m_nr_68_blend_mode != 0b11)
//if (m_nr_68_blend_mode == 0b00)
const bool is_textmode = BIT(m_nr_6b_tm_control, 3);
if (m_nr_68_blend_mode == 0b00) // Use ULA as blend layer
{
if (m_nr_68_ula_en && BIT(~m_nr_6b_tm_control, 3))
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(1), is_textmode ? 1 : 0xff);
if (m_nr_68_ula_en && !is_textmode)
{
if (m_nr_15_lores_en) m_lores->draw(screen, bitmap, clip256x192, 1);
else m_ula_scr->draw(screen, bitmap, clip256x192, flash, 1);
}
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(1), 2);
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(2), 8);
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(2), is_textmode ? 1 : 2);
}
/* TODO No tests for modes below yet
else if (m_nr_68_blend_mode == 0b10)
else if (m_nr_68_blend_mode == 0b10) // Use result of ULA + Tilemap
{
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(1), 1);
if (m_nr_68_ula_en && !is_textmode)
{
if (m_nr_15_lores_en) m_lores->draw(screen, bitmap, clip256x192, 1);
else m_ula_scr->draw(screen, bitmap, clip256x192, flash, 1);
}
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(2), 1);
}
else if (m_nr_68_blend_mode == 0b11)
else if (m_nr_68_blend_mode == 0b11) // Use Tilemap as blend layer
{
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(1), 1);
if (m_nr_68_ula_en && !is_textmode)
{
if (m_nr_15_lores_en) m_lores->draw(screen, bitmap, clip256x192, 2);
else m_ula_scr->draw(screen, bitmap, clip256x192, flash, 2);
}
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(2), 1);
}
*/
else
else // No blending (disable blend)
{
if (m_nr_68_ula_en && BIT(~m_nr_6b_tm_control, 3))
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(1), 2);
if (m_nr_68_ula_en && !is_textmode)
{
if (m_nr_15_lores_en) m_lores->draw(screen, bitmap, clip256x192, 1);
else m_ula_scr->draw(screen, bitmap, clip256x192, flash, 1);
if (m_nr_15_lores_en) m_lores->draw(screen, bitmap, clip256x192, 2);
else m_ula_scr->draw(screen, bitmap, clip256x192, flash, 2);
}
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(1), 2);
if (m_nr_6b_tm_en) m_tiles->draw(screen, bitmap, clip320x256, TILEMAP_DRAW_CATEGORY(2), 2);
}
// mixes only to 1
Expand Down
4 changes: 2 additions & 2 deletions src/mame/sinclair/specnext_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void specnext_tiles_device::tilemap_update()
m_tiles_info = m_host_ram_ptr + ((BIT(m_tm_map_base, 6) ? 7 : 5) << 14) + ((m_tm_map_base & 0x3f) << 8);
}

void specnext_tiles_device::draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 flags, u8 pcode)
void specnext_tiles_device::draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 flags, u8 pcode, u8 priority_mask)
{
rectangle clip = rectangle{ m_clip_x1 << 1, (m_clip_x2 << 1) | 1, m_clip_y1, m_clip_y2 };
clip &= SCREEN_AREA;
Expand All @@ -119,7 +119,7 @@ void specnext_tiles_device::draw(screen_device &screen, bitmap_rgb32 &bitmap, co
clip &= cliprect;

if (!clip.empty())
m_tilemap[BIT(m_control, 6)]->draw(screen, bitmap, clip, flags, pcode);
m_tilemap[BIT(m_control, 6)]->draw(screen, bitmap, clip, flags, pcode, priority_mask);
}

void specnext_tiles_device::device_add_mconfig(machine_config &config)
Expand Down
2 changes: 1 addition & 1 deletion src/mame/sinclair/specnext_tiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class specnext_tiles_device : public device_t, public device_gfx_interface
void clip_y1_w(u8 clip_y1) { m_clip_y1 = clip_y1; }
void clip_y2_w(u8 clip_y2) { m_clip_y2 = clip_y2; }

void draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 flags, u8 pcode = 0xff);
void draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 flags, u8 pcode = 0xff, u8 priority_mask = 0xff);

protected:
static constexpr u8 OVER_BORDER = 32;
Expand Down
Loading