From 39de9fbf921017aa33d4a4bc32d62e7459a71023 Mon Sep 17 00:00:00 2001 From: arbee Date: Wed, 19 Feb 2020 21:43:53 -0500 Subject: [PATCH] New working machines -------------------- GTAC Do-Do [R. Belmont, rfka01] --- src/mame/drivers/apple2.cpp | 61 ++++++++++++++++++++++++++++ src/mame/mame.lst | 1 + src/mame/video/apple2.cpp | 80 +++++++++++++++++++++++++++++++++++++ src/mame/video/apple2.h | 2 + 4 files changed, 144 insertions(+) diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp index bd3c6c7defe..82c48032390 100644 --- a/src/mame/drivers/apple2.cpp +++ b/src/mame/drivers/apple2.cpp @@ -157,6 +157,7 @@ public: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_jp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dodo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(ram_r); DECLARE_WRITE8_MEMBER(ram_w); @@ -193,6 +194,7 @@ public: void apple2jp(machine_config &config); void apple2(machine_config &config); void space84(machine_config &config); + void dodo(machine_config &config); void apple2p(machine_config &config); void apple2_map(address_map &map); void inhbank_map(address_map &map); @@ -501,6 +503,46 @@ uint32_t apple2_state::screen_update_jp(screen_device &screen, bitmap_ind16 &bit return 0; } +uint32_t apple2_state::screen_update_dodo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // always update the flash timer here so it's smooth regardless of mode switches + m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false; + + if (m_video->m_graphics) + { + if (m_video->m_hires) + { + if (m_video->m_mix) + { + m_video->hgr_update(screen, bitmap, cliprect, 0, 159); + m_video->text_update_dodo(screen, bitmap, cliprect, 160, 191); + } + else + { + m_video->hgr_update(screen, bitmap, cliprect, 0, 191); + } + } + else // lo-res + { + if (m_video->m_mix) + { + m_video->lores_update(screen, bitmap, cliprect, 0, 159); + m_video->text_update_dodo(screen, bitmap, cliprect, 160, 191); + } + else + { + m_video->lores_update(screen, bitmap, cliprect, 0, 191); + } + } + } + else + { + m_video->text_update_dodo(screen, bitmap, cliprect, 0, 191); + } + + return 0; +} + /*************************************************************************** I/O ***************************************************************************/ @@ -1392,6 +1434,12 @@ void apple2_state::apple2jp(machine_config &config) m_screen->set_screen_update(FUNC(apple2_state::screen_update_jp)); } +void apple2_state::dodo(machine_config &config) +{ + apple2p(config); + m_screen->set_screen_update(FUNC(apple2_state::screen_update_dodo)); +} + #if 0 void apple2_state::laba2p(machine_config &config) { @@ -1719,6 +1767,18 @@ ROM_START(am100) ROM_LOAD("nfl-asem-am100-u24.bin", 0x0000, 0x4000, CRC(2fb0c717) SHA1(cb4f754d3e1aec9603faebc308a4a63466242e43) ) ROM_END +ROM_START(dodo) + ROM_REGION(0x2000,"gfx1", 0) + ROM_LOAD( "gtac_2_charrom_um2316_a5.bin", 0x0000, 0x0800, CRC(a2dfcfeb) SHA1(adea922f950667d3b24297d2f64de697c28d6c17) ) + + ROM_REGION( 0x1000, "keyboard", ROMREGION_ERASE00 ) + ROM_LOAD( "nfl-asem-am100-keyboard-u5.bin", 0x0000, 0x0800, CRC(28f5ea38) SHA1(9f24c54f7cee41f7fef41294f05c4bc89d65acfb) ) // borrowed from the am100 + + ROM_REGION(0x4000, "maincpu",0) + ROM_LOAD( "dodo2764.bin", 0x2000, 0x1000, CRC(4b761f87) SHA1(2e1741db8134c4c715ecae480f5bda51d58ae296) ) + ROM_CONTINUE(0x1000, 0x1000) + ROM_LOAD( "dodo2732.bin", 0x3000, 0x1000, CRC(405cdb0c) SHA1(3ed133eb94ee33194c668c4ee3f67885dd489d13) ) +ROM_END // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME COMP( 1977, apple2, 0, 0, apple2, apple2, apple2_state, empty_init, "Apple Computer", "Apple ][", MACHINE_SUPPORTS_SAVE ) @@ -1744,3 +1804,4 @@ COMP( 1982, basis108, apple2, 0, apple2, apple2p, apple2_state, empty_ini COMP( 1984, hkc8800a, apple2, 0, apple2p, apple2p, apple2_state, empty_init, "China HKC", "HKC 8800A", MACHINE_SUPPORTS_SAVE ) COMP( 1984, albert, apple2, 0, apple2p, apple2p, apple2_state, empty_init, "Albert Computers, Inc.", "Albert", MACHINE_SUPPORTS_SAVE ) COMP( 198?, am100, apple2, 0, apple2p, apple2p, apple2_state, empty_init, "ASEM S.p.A.", "AM100", MACHINE_SUPPORTS_SAVE ) +COMP( 198?, dodo, apple2, 0, dodo, apple2p, apple2_state, empty_init, "GTAC", "Do-Do", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 66c973ded61..0797a2890ce 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -1390,6 +1390,7 @@ laser2c // 1985? Laser //c (Brazil) hkc8800a // 1984 HKC 8800A albert // Albert am100 // ASEM AM100 +dodo // GTAC Do-Do @source:apple2e.cpp apple2c // Apr 1984 Apple //c diff --git a/src/mame/video/apple2.cpp b/src/mame/video/apple2.cpp index 051d25b0337..af8dfbb6fc0 100644 --- a/src/mame/video/apple2.cpp +++ b/src/mame/video/apple2.cpp @@ -231,6 +231,55 @@ void a2_video_device::plot_text_character(bitmap_ind16 &bitmap, int xpos, int yp } } +void a2_video_device::plot_text_character_dodo(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, + const uint8_t *textgfx_data, uint32_t textgfx_datalen, int fg, int bg) +{ + int x, y, i; + const uint8_t *chardata; + uint16_t color; + + if (!m_altcharset) + { + if ((code >= 0x40) && (code <= 0x7f)) + { + code &= 0x3f; + + if (m_flash) + { + i = fg; + fg = bg; + bg = i; + } + } + } + else + { + if ((code >= 0x60) && (code <= 0x7f)) + { + code |= 0x80; // map to lowercase normal + i = fg; // and flip the color + fg = bg; + bg = i; + } + } + + /* look up the character data */ + chardata = &textgfx_data[(code * 8)]; + + for (y = 0; y < 8; y++) + { + for (x = 0; x < 7; x++) + { + color = (chardata[y] & (1 << (x+1))) ? fg : bg; + + for (i = 0; i < xscale; i++) + { + bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color; + } + } + } +} + void a2_video_device::plot_text_character_orig(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen, int fg, int bg) { @@ -784,6 +833,37 @@ void a2_video_device::text_update_orig(screen_device &screen, bitmap_ind16 &bitm } } +void a2_video_device::text_update_dodo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) +{ + int row, col; + uint32_t start_address = m_page2 ? 0x800 : 0x400; + uint32_t address; + int fg = 0; + int bg = 0; + + beginrow = (std::max)(beginrow, cliprect.top() - (cliprect.top() % 8)); + endrow = (std::min)(endrow, cliprect.bottom() - (cliprect.bottom() % 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_dodo(bitmap, col * 14, row, 2, m_ram_ptr[address], + m_char_ptr, m_char_size, fg, bg); + } + } +} + void a2_video_device::text_update_jplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) { int row, col; diff --git a/src/mame/video/apple2.h b/src/mame/video/apple2.h index 0cdfa915acb..bc9e113f1e2 100644 --- a/src/mame/video/apple2.h +++ b/src/mame/video/apple2.h @@ -53,6 +53,7 @@ public: 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 text_update_dodo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); void text_update_jplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); void text_updateGS(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); @@ -76,6 +77,7 @@ private: void plot_text_character_ultr(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen, int fg, int bg); void plot_text_character_orig(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen, int fg, int bg); void plot_text_character_jplus(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen, int fg, int bg); + void plot_text_character_dodo(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen, int fg, int bg); void plot_text_characterGS(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen, int fg, int bg); };