From 387e268e7f865ad42004166d35b865fa94e316df Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 9 Mar 2023 00:51:49 +1100 Subject: Eolith HyperStone driver updates: * eolith/eolith_speedup.cpp: Fixed oversight causing stealsea to crash on start. * eolith/eolith16.cpp: Marked klondkp not working - it locks up on the title screen if you don't insert a coin soon enough. * eolith/eolith.cpp, eolith/eolith16.cpp, eolith/vegaeo.cpp: Added basic support for partial screen updates. * eolith/eolith_speedup.cpp: Renamed base state class to make its purpose more obvious. --- src/mame/eolith/eolith.cpp | 17 ++++++++--------- src/mame/eolith/eolith16.cpp | 15 +++++++-------- src/mame/eolith/eolith_speedup.cpp | 21 ++++++++++----------- src/mame/eolith/eolith_speedup.h | 4 ++-- src/mame/eolith/vegaeo.cpp | 14 +++++++------- 5 files changed, 34 insertions(+), 37 deletions(-) diff --git a/src/mame/eolith/eolith.cpp b/src/mame/eolith/eolith.cpp index 468dd049ee0..b200d346ca8 100644 --- a/src/mame/eolith/eolith.cpp +++ b/src/mame/eolith/eolith.cpp @@ -115,11 +115,11 @@ namespace { -class eolith_state : public eolith_state_base +class eolith_state : public eolith_e1_speedup_state_base { public: eolith_state(const machine_config &mconfig, device_type type, const char *tag) - : eolith_state_base(mconfig, type, tag) + : eolith_e1_speedup_state_base(mconfig, type, tag) , m_soundcpu(*this, "soundcpu") , m_qs1000(*this, "qs1000") , m_eepromoutport(*this, "EEPROMOUT") @@ -220,7 +220,7 @@ uint16_t eolith_state::eolith_vram_r(offs_t offset) void eolith_state::video_start() { - eolith_state_base::video_start(); + eolith_e1_speedup_state_base::video_start(); m_vram = std::make_unique(0x40000); save_pointer(NAME(m_vram), 0x40000); @@ -231,12 +231,11 @@ void eolith_state::video_start() uint32_t eolith_state::screen_update_eolith(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - for (int y = 0; y < 240; y++) + for (int y = cliprect.top(); y <= std::min(cliprect.bottom(), 239); y++) { + auto *pix = &bitmap.pix(y); for (int x = 0; x < 320; x++) - { - bitmap.pix(y, x) = m_vram[(0x40000/2) * (m_buffer ^ 1) + (y * 336) + x] & 0x7fff; - } + *pix++ = m_vram[(0x40000/2) * (m_buffer ^ 1) + (y * 336) + x] & 0x7fff; } return 0; @@ -251,7 +250,7 @@ uint32_t eolith_state::screen_update_eolith(screen_device &screen, bitmap_ind16 void eolith_state::machine_start() { - eolith_state_base::machine_start(); + eolith_e1_speedup_state_base::machine_start(); m_led.resolve(); @@ -261,7 +260,7 @@ void eolith_state::machine_start() void eolith_state::machine_reset() { - eolith_state_base::machine_reset(); + eolith_e1_speedup_state_base::machine_reset(); m_soundcpu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE); } diff --git a/src/mame/eolith/eolith16.cpp b/src/mame/eolith/eolith16.cpp index 34c61c6f7af..360c91bc91a 100644 --- a/src/mame/eolith/eolith16.cpp +++ b/src/mame/eolith/eolith16.cpp @@ -24,11 +24,11 @@ namespace { -class eolith16_state : public eolith_state_base +class eolith16_state : public eolith_e1_speedup_state_base { public: eolith16_state(const machine_config &mconfig, device_type type, const char *tag) - : eolith_state_base(mconfig, type, tag) + : eolith_e1_speedup_state_base(mconfig, type, tag) , m_special_io(*this, "SPECIAL") , m_eepromoutport(*this, "EEPROMOUT") , m_vram(*this, "vram", 0x20000, ENDIANNESS_BIG) @@ -123,7 +123,7 @@ INPUT_PORTS_END void eolith16_state::video_start() { - eolith_state_base::video_start(); + eolith_e1_speedup_state_base::video_start(); m_vrambank->configure_entries(0, 2, memshare("vram")->ptr(), 0x10000); m_vrambank->set_entry(0); @@ -131,12 +131,11 @@ void eolith16_state::video_start() uint32_t eolith16_state::screen_update_eolith16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - for (int y = 0; y < 204; y++) + for (int y = cliprect.top(); y <= std::min(cliprect.bottom(), 203); y++) { + auto *pix = &bitmap.pix(y); for (int x = 0; x < 320; x++) - { - bitmap.pix(y, x) = m_vram[(y * 320) + x] & 0xff; - } + *pix++ = m_vram[(y * 320) + x] & 0xff; } return 0; } @@ -259,4 +258,4 @@ void eolith16_state::init_eolith16() } // anonymous namespace -GAME( 1999, klondkp, 0, eolith16, eolith16, eolith16_state, init_eolith16, ROT0, "Eolith", "KlonDike+", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, klondkp, 0, eolith16, eolith16, eolith16_state, init_eolith16, ROT0, "Eolith", "KlonDike+", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/eolith/eolith_speedup.cpp b/src/mame/eolith/eolith_speedup.cpp index f13fafdacf6..7b2ccb3c52a 100644 --- a/src/mame/eolith/eolith_speedup.cpp +++ b/src/mame/eolith/eolith_speedup.cpp @@ -14,7 +14,7 @@ this could probably be done a bit better using timers */ -void eolith_state_base::speedup_read() +void eolith_e1_speedup_state_base::speedup_read() { /* for debug */ //if ((m_maincpu->pc()!=m_speedup_address) && (m_speedup_vblank!=1) ) @@ -40,8 +40,8 @@ static const struct } eolith_speedup_table[] = { - /* eolith.cpp */ - { "linkypip", 0x4000825c, -1,/*0x4000ABAE,*/ 240 }, // 2nd address is used on the planet cutscene between but idle skipping between levels, but seems too aggressive + // eolith.cpp + { "linkypip", 0x4000825c, -1,/*0x4000abae,*/ 240 }, // 2nd address is used on the planet cutscene between but idle skipping between levels, but seems too aggressive { "ironfort", 0x40020854, -1, 240 }, { "ironfortc",0x40020234, -1, 240 }, { "hidnctch", 0x4000bba0, -1, 240 }, @@ -61,15 +61,14 @@ static const struct { "penfana", 0x4001FAb6, -1, 240 }, { "candy", 0x4001990C, -1, 240 }, { "hidnc2k", 0x40016824, -1, 240 }, - /* eolith16.cpp */ + // eolith16.cpp { "klondkp", 0x0001a046, -1, 240 }, - /* vegaeo.cpp */ - { "crazywar", 0x00008cf8, -1, 240 }, - { nullptr, 0, 0 } + // vegaeo.cpp + { "crazywar", 0x00008cf8, -1, 240 } }; -void eolith_state_base::init_speedup() +void eolith_e1_speedup_state_base::init_speedup() { m_speedup_address = 0; m_speedup_address2 = 0; @@ -93,7 +92,7 @@ void eolith_state_base::init_speedup() } /* todo, use timers instead! */ -TIMER_DEVICE_CALLBACK_MEMBER(eolith_state_base::eolith_speedup) +TIMER_DEVICE_CALLBACK_MEMBER(eolith_e1_speedup_state_base::eolith_speedup) { if (param == 0) m_speedup_vblank = 0; @@ -105,7 +104,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(eolith_state_base::eolith_speedup) m_speedup_vblank = 1; } -READ_LINE_MEMBER(eolith_state_base::speedup_vblank_r) +READ_LINE_MEMBER(eolith_e1_speedup_state_base::speedup_vblank_r) { // printf("%s:eolith speedup_read data %02x\n",machine().describe_context().c_str(), m_speedup_vblank); @@ -114,7 +113,7 @@ READ_LINE_MEMBER(eolith_state_base::speedup_vblank_r) } // StealSee doesn't use interrupts, just the vblank -READ_LINE_MEMBER(eolith_state_base::stealsee_speedup_vblank_r) +READ_LINE_MEMBER(eolith_e1_speedup_state_base::stealsee_speedup_vblank_r) { int pc = m_maincpu->pc(); diff --git a/src/mame/eolith/eolith_speedup.h b/src/mame/eolith/eolith_speedup.h index 9db61e20d42..a72885b83a7 100644 --- a/src/mame/eolith/eolith_speedup.h +++ b/src/mame/eolith/eolith_speedup.h @@ -10,10 +10,10 @@ #include "emupal.h" #include "screen.h" -class eolith_state_base : public driver_device +class eolith_e1_speedup_state_base : public driver_device { public: - eolith_state_base(const machine_config &mconfig, device_type type, const char *tag) + eolith_e1_speedup_state_base(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_screen(*this, "screen") diff --git a/src/mame/eolith/vegaeo.cpp b/src/mame/eolith/vegaeo.cpp index ab72397844c..9914e4fc43a 100644 --- a/src/mame/eolith/vegaeo.cpp +++ b/src/mame/eolith/vegaeo.cpp @@ -26,11 +26,11 @@ namespace { -class vegaeo_state : public eolith_state_base +class vegaeo_state : public eolith_e1_speedup_state_base { public: vegaeo_state(const machine_config &mconfig, device_type type, const char *tag) - : eolith_state_base(mconfig, type, tag) + : eolith_e1_speedup_state_base(mconfig, type, tag) , m_soundlatch(*this, "soundlatch") , m_qs1000(*this, "qs1000") , m_system_io(*this, "SYSTEM") @@ -163,7 +163,7 @@ INPUT_PORTS_END void vegaeo_state::video_start() { - eolith_state_base::video_start(); + eolith_e1_speedup_state_base::video_start(); m_vram = std::make_unique(0x14000*2); save_pointer(NAME(m_vram), 0x14000*2); @@ -172,13 +172,13 @@ void vegaeo_state::video_start() uint32_t vegaeo_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - for (int y = 0; y < 240; y++) + for (int y = cliprect.top(); y <= std::min(cliprect.bottom(), 239); y++) { + auto *pix = &bitmap.pix(y); for (int x = 0; x < 320; x++) - { - bitmap.pix(y, x) = m_vram[0x14000 * (m_vbuffer ^ 1) + (y * 320) + x] & 0xff; - } + *pix++ = m_vram[0x14000 * (m_vbuffer ^ 1) + (y * 320) + x] & 0xff; } + return 0; } -- cgit v1.2.3