apple2gs: enable some raster-splitting in the 8-bit video modes. [R. Belmont]

This commit is contained in:
arbee 2021-03-13 12:31:40 -05:00
parent a3ee988ec7
commit 3b70d3a8be
2 changed files with 36 additions and 33 deletions

View File

@ -2739,6 +2739,10 @@ void apple2gs_state::c000_w(offs_t offset, u8 data)
break; break;
case 0x22: // TEXTCOL case 0x22: // TEXTCOL
if (m_textcol != data)
{
m_screen->update_now();
}
m_textcol = data; m_textcol = data;
m_video->m_GSfg = (data >> 4) & 0xf; m_video->m_GSfg = (data >> 4) & 0xf;
m_video->m_GSbg = data & 0xf; m_video->m_GSbg = data & 0xf;
@ -2858,6 +2862,10 @@ void apple2gs_state::c000_w(offs_t offset, u8 data)
break; break;
case 0x34: // CLOCKCTL case 0x34: // CLOCKCTL
if ((data & 0xf) != m_video->m_GSborder)
{
m_screen->update_now();
}
m_clock_control = data & 0x7f; m_clock_control = data & 0x7f;
m_video->m_GSborder = data & 0xf; m_video->m_GSborder = data & 0xf;
if (data & 0x80) if (data & 0x80)

View File

@ -1552,10 +1552,9 @@ uint32_t a2_video_device::screen_update_GS(screen_device &screen, bitmap_rgb32 &
} }
else else
{ {
/* call legacy Apple II video rendering at scanline 0 to draw into the off-screen buffer */ if (beamy >= BORDER_TOP)
if (beamy == 0)
{ {
rectangle const new_cliprect(0, 559, 0, 191); rectangle const new_cliprect(0, 559, cliprect.top() - BORDER_TOP, cliprect.bottom() - BORDER_TOP);
screen_update_GS_8bit(screen, *m_8bit_graphics, new_cliprect); screen_update_GS_8bit(screen, *m_8bit_graphics, new_cliprect);
} }
@ -1626,11 +1625,11 @@ uint32_t a2_video_device::screen_update_GS_8bit(screen_device &screen, bitmap_in
{ {
if ((m_dhires) && (m_80col)) if ((m_dhires) && (m_80col))
{ {
dhgr_update(screen, bitmap, cliprect, 0, 191); dhgr_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
} }
else else
{ {
hgr_update(screen, bitmap, cliprect, 0, 191); hgr_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
} }
} }
} }
@ -1653,18 +1652,18 @@ uint32_t a2_video_device::screen_update_GS_8bit(screen_device &screen, bitmap_in
{ {
if ((m_dhires) && (m_80col)) if ((m_dhires) && (m_80col))
{ {
dlores_update(screen, bitmap, cliprect, 0, 191); dlores_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
} }
else else
{ {
lores_update(screen, bitmap, cliprect, 0, 191); lores_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
} }
} }
} }
} }
else else
{ {
text_updateGS(screen, bitmap, cliprect, 0, 191); text_updateGS(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
} }
m_page2 = old_page2; m_page2 = old_page2;
@ -1674,49 +1673,45 @@ uint32_t a2_video_device::screen_update_GS_8bit(screen_device &screen, bitmap_in
void a2_video_device::text_updateGS(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) void a2_video_device::text_updateGS(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
{ {
int row, col; uint8_t const *const aux_page = m_aux_ptr ? m_aux_ptr : m_ram_ptr;
uint32_t start_address;
uint32_t address;
uint8_t *aux_page = m_ram_ptr;
if (m_80col) uint32_t const start_address = m_80col ? 0x400 : m_page2 ? 0x800
{ : 0x400;
start_address = 0x400;
if (m_aux_ptr)
{
aux_page = m_aux_ptr;
}
}
else
{
start_address = m_page2 ? 0x800 : 0x400;
}
beginrow = (std::max)(beginrow, cliprect.top() - (cliprect.top() % 8)); beginrow = (std::max)(beginrow, cliprect.top() - (cliprect.top() % 8));
endrow = (std::min)(endrow, cliprect.bottom() - (cliprect.bottom() % 8) + 7); endrow = (std::min)(endrow, cliprect.bottom() - (cliprect.bottom() % 8) + 7);
for (row = beginrow; row <= endrow; row += 8) const int startrow = (beginrow / 8) * 8;
const int stoprow = ((endrow / 8) + 1) * 8;
const int startcol = (cliprect.left() / 14);
const int stopcol = ((cliprect.right() / 14) + 1);
//printf("TXT: row %d startcol %d stopcol %d left %d right %d\n", beginrow, startcol, stopcol, cliprect.left(), cliprect.right());
for (int row = startrow; row < stoprow; row += 8)
{ {
if (m_80col) if (m_80col)
{ {
for (col = 0; col < 40; col++) for (int col = startcol; col < stopcol; col++)
{ {
/* calculate address */ /* calculate address */
address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col)); uint32_t const address = start_address + ((((row / 8) & 0x07) << 7) | (((row / 8) & 0x18) * 5 + col));
plot_text_characterGS(bitmap, col * 14, row, 1, aux_page[address], m_GSfg, m_GSbg); plot_text_character(bitmap, col * 14, row, 1, aux_page[address],
plot_text_characterGS(bitmap, col * 14 + 7, row, 1, m_ram_ptr[address], m_GSfg, m_GSbg); m_GSfg, m_GSbg);
plot_text_character(bitmap, col * 14 + 7, row, 1, m_ram_ptr[address],
m_GSfg, m_GSbg);
} }
} }
else else
{ {
for (col = 0; col < 40; col++) for (int col = startcol; col < stopcol; col++)
{ {
/* calculate address */ /* calculate address */
address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col)); uint32_t const address = start_address + ((((row / 8) & 0x07) << 7) | (((row / 8) & 0x18) * 5 + col));
plot_text_characterGS(bitmap, col * 14, row, 2, m_ram_ptr[address], m_GSfg, m_GSbg);
plot_text_character(bitmap, col * 14, row, 2, m_ram_ptr[address], m_GSfg, m_GSbg);
} }
} }
} }
} }