summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/apple2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/apple2.cpp')
-rw-r--r--src/mame/video/apple2.cpp61
1 files changed, 28 insertions, 33 deletions
diff --git a/src/mame/video/apple2.cpp b/src/mame/video/apple2.cpp
index 154dfaa7ded..329f3b38c34 100644
--- a/src/mame/video/apple2.cpp
+++ b/src/mame/video/apple2.cpp
@@ -1552,10 +1552,9 @@ uint32_t a2_video_device::screen_update_GS(screen_device &screen, bitmap_rgb32 &
}
else
{
- /* call legacy Apple II video rendering at scanline 0 to draw into the off-screen buffer */
- if (beamy == 0)
+ if (beamy >= BORDER_TOP)
{
- 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);
}
@@ -1626,11 +1625,11 @@ uint32_t a2_video_device::screen_update_GS_8bit(screen_device &screen, bitmap_in
{
if ((m_dhires) && (m_80col))
{
- dhgr_update(screen, bitmap, cliprect, 0, 191);
+ dhgr_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
}
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))
{
- dlores_update(screen, bitmap, cliprect, 0, 191);
+ dlores_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
}
else
{
- lores_update(screen, bitmap, cliprect, 0, 191);
+ lores_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
}
}
}
}
else
{
- text_updateGS(screen, bitmap, cliprect, 0, 191);
+ text_updateGS(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
}
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)
{
- int row, col;
- uint32_t start_address;
- uint32_t address;
- uint8_t *aux_page = m_ram_ptr;
+ uint8_t const *const aux_page = m_aux_ptr ? m_aux_ptr : m_ram_ptr;
- if (m_80col)
- {
- start_address = 0x400;
- if (m_aux_ptr)
- {
- aux_page = m_aux_ptr;
- }
- }
- else
- {
- start_address = m_page2 ? 0x800 : 0x400;
- }
+ uint32_t const start_address = m_80col ? 0x400 : m_page2 ? 0x800
+ : 0x400;
beginrow = (std::max)(beginrow, cliprect.top() - (cliprect.top() % 8));
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)
{
- for (col = 0; col < 40; col++)
+ for (int col = startcol; col < stopcol; col++)
{
/* 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_characterGS(bitmap, col * 14 + 7, row, 1, m_ram_ptr[address], m_GSfg, m_GSbg);
+ plot_text_character(bitmap, col * 14, row, 1, aux_page[address],
+ m_GSfg, m_GSbg);
+ plot_text_character(bitmap, col * 14 + 7, row, 1, m_ram_ptr[address],
+ m_GSfg, m_GSbg);
}
}
else
{
- for (col = 0; col < 40; col++)
+ for (int col = startcol; col < stopcol; col++)
{
/* calculate address */
- 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);
+ uint32_t const address = start_address + ((((row / 8) & 0x07) << 7) | (((row / 8) & 0x18) * 5 + col));
+
+ plot_text_character(bitmap, col * 14, row, 2, m_ram_ptr[address], m_GSfg, m_GSbg);
}
}
}
}
-