diff options
author | arbee <rb6502@users.noreply.github.com> | 2015-08-22 18:21:25 -0400 |
---|---|---|
committer | arbee <rb6502@users.noreply.github.com> | 2015-08-22 18:21:25 -0400 |
commit | b1ce31faebfbe1d31c858cf22940affe716cbedb (patch) | |
tree | e299e62f02dc639de89bb92e3f5dcbe9707a342f | |
parent | 18863bae382c767837bd41da23e08638627a589f (diff) |
apple2: fix Ivel Ultra's unique text drawing (MT#5814) [R. Belmont]
-rw-r--r-- | src/mess/drivers/apple2.c | 27 | ||||
-rw-r--r-- | src/mess/video/apple2.c | 67 | ||||
-rw-r--r-- | src/mess/video/apple2.h | 2 |
3 files changed, 92 insertions, 4 deletions
diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c index bbe05013928..4c03b3fb63c 100644 --- a/src/mess/drivers/apple2.c +++ b/src/mess/drivers/apple2.c @@ -377,7 +377,14 @@ UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, if (m_video->m_mix) { m_video->hgr_update(screen, bitmap, cliprect, 0, 159); - m_video->text_update_orig(screen, bitmap, cliprect, 160, 191); + if (!strcmp(machine().system().name, "ivelultr")) + { + m_video->text_update_ultr(screen, bitmap, cliprect, 160, 191); + } + else + { + m_video->text_update_orig(screen, bitmap, cliprect, 160, 191); + } } else { @@ -389,7 +396,14 @@ UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, if (m_video->m_mix) { m_video->lores_update(screen, bitmap, cliprect, 0, 159); - m_video->text_update_orig(screen, bitmap, cliprect, 160, 191); + if (!strcmp(machine().system().name, "ivelultr")) + { + m_video->text_update_ultr(screen, bitmap, cliprect, 160, 191); + } + else + { + m_video->text_update_orig(screen, bitmap, cliprect, 160, 191); + } } else { @@ -399,7 +413,14 @@ UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, } else { - m_video->text_update_orig(screen, bitmap, cliprect, 0, 191); + if (!strcmp(machine().system().name, "ivelultr")) + { + m_video->text_update_ultr(screen, bitmap, cliprect, 0, 191); + } + else + { + m_video->text_update_orig(screen, bitmap, cliprect, 0, 191); + } } return 0; diff --git a/src/mess/video/apple2.c b/src/mess/video/apple2.c index 28fed7e36dc..195fed4ce8f 100644 --- a/src/mess/video/apple2.c +++ b/src/mess/video/apple2.c @@ -543,7 +543,7 @@ void apple2_state::apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram, || !strcmp(machine().system().name, "apple2p") || !strcmp(machine().system().name, "prav82") || !strcmp(machine().system().name, "prav8m") - || !strcmp(machine().system().name, "ace100") + || !strcmp(machine().system().name, "ivelultr") || !strcmp(machine().system().name, "apple2jp")) { int len = memregion("gfx1")->bytes(); @@ -845,6 +845,40 @@ void a2_video_device::plot_text_character_orig(bitmap_ind16 &bitmap, int xpos, i } } +void a2_video_device::plot_text_character_ultr(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, + const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg) +{ + int x, y, i; + const UINT8 *chardata; + UINT16 color; + + if ((code >= 0x40) && (code <= 0x7f)) + { + if (m_flash) + { + i = fg; + fg = bg; + bg = i; + } + } + + /* look up the character data */ + chardata = &textgfx_data[(code * 8)]; + + for (y = 0; y < 8; y++) + { + for (x = 1; x < 8; x++) + { + color = (chardata[y] & (1 << x)) ? fg : bg; + + for (i = 0; i < xscale; i++) + { + bitmap.pix16(ypos + y, xpos + ((x-1) * xscale) + i) = color; + } + } + } +} + void a2_video_device::lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) { int row, col, y, x; @@ -1160,6 +1194,37 @@ void a2_video_device::text_update_orig(screen_device &screen, bitmap_ind16 &bitm } } +void a2_video_device::text_update_ultr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) +{ + int row, col; + UINT32 start_address = m_page2 ? 0x800 : 0x400; + UINT32 address; + int fg = 0; + int bg = 0; + + beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8)); + endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7); + + switch (m_sysconfig & 0x03) + { + case 0: fg = WHITE; break; + case 1: fg = WHITE; break; + case 2: fg = GREEN; break; + case 3: fg = ORANGE; break; + } + + for (row = beginrow; row <= endrow; row += 8) + { + for (col = 0; col < 40; col++) + { + /* calculate address */ + address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col)); + plot_text_character_ultr(bitmap, col * 14, row, 2, m_ram_ptr[address], + m_char_ptr, m_char_size, fg, bg); + } + } +} + void a2_video_device::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) { const UINT8 *vram; diff --git a/src/mess/video/apple2.h b/src/mess/video/apple2.h index f0df6717578..6f5f76e4cbf 100644 --- a/src/mess/video/apple2.h +++ b/src/mess/video/apple2.h @@ -37,6 +37,7 @@ public: int m_sysconfig; void text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); + void text_update_ultr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); void text_update_orig(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); void lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); void dlores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); @@ -50,6 +51,7 @@ protected: private: void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg); + void plot_text_character_ultr(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg); void plot_text_character_orig(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg); }; |