From 8bef52ec6d31606ef4e2a7da0fc614e2222d162d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 30 Apr 2016 19:56:18 +0200 Subject: [PATCH] fixed wpc, okiadpcm and eolith (nw) --- scripts/src/sound.lua | 3 +- scripts/target/mame/arcade.lua | 5 +- src/mame/drivers/eolith.cpp | 126 ++++++++++++++++++++ src/mame/drivers/eolithsp.cpp | 131 --------------------- src/mame/drivers/wpc_dot.cpp | 2 +- src/mame/drivers/wpc_flip1.cpp | 2 +- src/mame/drivers/wpc_flip2.cpp | 2 +- src/mame/includes/{wpc_pin.h => wpc_dot.h} | 50 +------- src/mame/includes/wpc_flip1.h | 23 ++++ src/mame/includes/wpc_flip2.h | 23 ++++ 10 files changed, 184 insertions(+), 183 deletions(-) delete mode 100644 src/mame/drivers/eolithsp.cpp rename src/mame/includes/{wpc_pin.h => wpc_dot.h} (67%) create mode 100644 src/mame/includes/wpc_flip1.h create mode 100644 src/mame/includes/wpc_flip2.h diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua index c9291ffa8bb..f2b9842544b 100644 --- a/scripts/src/sound.lua +++ b/scripts/src/sound.lua @@ -650,9 +650,10 @@ end --@src/devices/sound/okim6376.h,SOUNDS["OKIM6376"] = true --@src/devices/sound/okim6295.h,SOUNDS["OKIM6295"] = true --@src/devices/sound/okim9810.h,SOUNDS["OKIM9810"] = true +--@src/devices/sound/okiadpcm.h,SOUNDS["OKIADPCM"] = true --------------------------------------------------- -if (SOUNDS["OKIM6258"]~=null or SOUNDS["OKIM6295"]~=null or SOUNDS["OKIM9810"]~=null or SOUNDS["I5000_SND"]~=null) then +if (SOUNDS["OKIM6258"]~=null or SOUNDS["OKIM6295"]~=null or SOUNDS["OKIM9810"]~=null or SOUNDS["I5000_SND"]~=null or SOUNDS["OKIADPCM"]~=null) then files { MAME_DIR .. "src/devices/sound/okiadpcm.cpp", MAME_DIR .. "src/devices/sound/okiadpcm.h", diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 87a1296ff2c..d84a3d4dbef 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -1629,7 +1629,6 @@ files { MAME_DIR .. "src/mame/includes/eolith.h", MAME_DIR .. "src/mame/video/eolith.cpp", MAME_DIR .. "src/mame/drivers/eolith16.cpp", - MAME_DIR .. "src/mame/drivers/eolithsp.cpp", MAME_DIR .. "src/mame/drivers/ghosteo.cpp", MAME_DIR .. "src/mame/drivers/vegaeo.cpp", } @@ -4153,12 +4152,14 @@ files { MAME_DIR .. "src/mame/drivers/wpc_an.cpp", MAME_DIR .. "src/mame/drivers/wpc_dcs.cpp", MAME_DIR .. "src/mame/drivers/wpc_dot.cpp", + MAME_DIR .. "src/mame/includes/wpc_dot.h", MAME_DIR .. "src/mame/drivers/wpc_flip1.cpp", + MAME_DIR .. "src/mame/includes/wpc_flip1.h", MAME_DIR .. "src/mame/drivers/wpc_flip2.cpp", + MAME_DIR .. "src/mame/includes/wpc_flip2.h", MAME_DIR .. "src/mame/drivers/wpc_s.cpp", MAME_DIR .. "src/mame/machine/wpc.cpp", MAME_DIR .. "src/mame/machine/wpc.h", - MAME_DIR .. "src/mame/includes/wpc_pin.h", MAME_DIR .. "src/mame/audio/wpcsnd.cpp", MAME_DIR .. "src/mame/audio/wpcsnd.h", MAME_DIR .. "src/mame/video/wpc_dmd.cpp", diff --git a/src/mame/drivers/eolith.cpp b/src/mame/drivers/eolith.cpp index 81113f41cfb..e17c5be26c0 100644 --- a/src/mame/drivers/eolith.cpp +++ b/src/mame/drivers/eolith.cpp @@ -1564,6 +1564,132 @@ DRIVER_INIT_MEMBER(eolith_state,hidctch3) DRIVER_INIT_CALL(eolith); } +/* Eolith Speedup Handling */ + +/* + This uses triggers and a scanline counter to speed up the eolith games a bit + in some cases this results in a 100% speedup + e.g hidden catch 25% -> 50% speed ingame + + this could probably be done a bit better using timers +*/ + +void eolith_state::speedup_read() +{ + /* for debug */ + //if ((space.device().safe_pc()!=m_speedup_address) && (m_speedup_vblank!=1) ) + // printf("%s:eolith speedup_read data %02x\n",space.machine().describe_context(), m_speedup_vblank); + + if (m_speedup_vblank==0 && m_speedup_scanline < m_speedup_resume_scanline) + { + int pc = m_maincpu->pc(); + + if ((pc==m_speedup_address) || (pc==m_speedup_address2)) + { + m_maincpu->spin_until_trigger(1000); + } + } +} + +static const struct +{ + const char *s_name; + int speedup_address; + int speedup_address2; + int speedup_resume_scanline; + +} eolith_speedup_table[] = +{ + /* eolith.c */ + { "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 }, + { "ironfortj",0x40020234, -1, 240 }, + { "hidnctch", 0x4000bba0, -1, 240 }, + { "raccoon", 0x40008204, -1, 240 }, + { "puzzlekg", 0x40029458, -1, 240 }, + { "hidctch2", 0x40009524, -1, 240 }, + { "hidctch2a",0x40029B58, -1, 240 }, + { "landbrk", 0x40023574, -1, 240 }, + { "landbrka", 0x4002446c, -1, 240 }, + { "nhidctch", 0x40012778, -1, 240 }, + { "hidctch3", 0x4001f6a0, -1, 240 }, + { "fort2b", 0x000081e0, -1, 240 }, + { "fort2ba", 0x000081e0, -1, 240 }, + { "penfan", 0x4001FA66, -1, 240 }, + { "penfana", 0x4001FAb6, -1, 240 }, + { "candy", 0x4001990C, -1, 240 }, + { "hidnc2k", 0x40016824, -1, 240 }, + /* eolith16.c */ + { "klondkp", 0x0001a046, -1, 240 }, + /* vegaeo.c */ + { "crazywar", 0x00008cf8, -1, 240 }, + { nullptr, 0, 0 } +}; + + +void eolith_state::init_speedup() +{ + int n_game = 0; + m_speedup_address = 0; + m_speedup_address2 = 0; + m_speedup_resume_scanline = 0; + m_speedup_vblank = 0; + m_speedup_scanline = 0; + + while( eolith_speedup_table[ n_game ].s_name != nullptr ) + { + if( strcmp( machine().system().name, eolith_speedup_table[ n_game ].s_name ) == 0 ) + { + m_speedup_address = eolith_speedup_table[ n_game ].speedup_address; + m_speedup_address2 = eolith_speedup_table[ n_game ].speedup_address2; + m_speedup_resume_scanline = eolith_speedup_table[ n_game ].speedup_resume_scanline; + } + n_game++; + } + + save_item(NAME(m_speedup_vblank)); + save_item(NAME(m_speedup_scanline)); +} + +/* todo, use timers instead! */ +TIMER_DEVICE_CALLBACK_MEMBER(eolith_state::eolith_speedup) +{ + if (param==0) + { + m_speedup_vblank = 0; + } + + if (param==m_speedup_resume_scanline) + { + machine().scheduler().trigger(1000); + } + + if (param==240) + { + m_speedup_vblank = 1; + } +} + +CUSTOM_INPUT_MEMBER(eolith_state::eolith_speedup_getvblank) +{ +// printf("%s:eolith speedup_read data %02x\n",machine().describe_context(), m_speedup_vblank); + + + return (m_screen->vpos() >= 240); +} + +// StealSee doesn't use interrupts, just the vblank +CUSTOM_INPUT_MEMBER(eolith_state::stealsee_speedup_getvblank) +{ + int pc = m_maincpu->pc(); + + if (pc==0x400081ec) + if(!m_speedup_vblank) + m_maincpu->eat_cycles(500); + + return (m_screen->vpos() >= 240); +} + /************************************* * diff --git a/src/mame/drivers/eolithsp.cpp b/src/mame/drivers/eolithsp.cpp deleted file mode 100644 index cf625b726ba..00000000000 --- a/src/mame/drivers/eolithsp.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/* Eolith Speedup Handling */ - -/* - This uses triggers and a scanline counter to speed up the eolith games a bit - in some cases this results in a 100% speedup - e.g hidden catch 25% -> 50% speed ingame - - this could probably be done a bit better using timers -*/ - -#include "emu.h" -#include "includes/eolith.h" - - -void eolith_state::speedup_read() -{ - /* for debug */ - //if ((space.device().safe_pc()!=m_speedup_address) && (m_speedup_vblank!=1) ) - // printf("%s:eolith speedup_read data %02x\n",space.machine().describe_context(), m_speedup_vblank); - - if (m_speedup_vblank==0 && m_speedup_scanline < m_speedup_resume_scanline) - { - int pc = m_maincpu->pc(); - - if ((pc==m_speedup_address) || (pc==m_speedup_address2)) - { - m_maincpu->spin_until_trigger(1000); - } - } -} - -static const struct -{ - const char *s_name; - int speedup_address; - int speedup_address2; - int speedup_resume_scanline; - -} eolith_speedup_table[] = -{ - /* eolith.c */ - { "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 }, - { "ironfortj",0x40020234, -1, 240 }, - { "hidnctch", 0x4000bba0, -1, 240 }, - { "raccoon", 0x40008204, -1, 240 }, - { "puzzlekg", 0x40029458, -1, 240 }, - { "hidctch2", 0x40009524, -1, 240 }, - { "hidctch2a",0x40029B58, -1, 240 }, - { "landbrk", 0x40023574, -1, 240 }, - { "landbrka", 0x4002446c, -1, 240 }, - { "nhidctch", 0x40012778, -1, 240 }, - { "hidctch3", 0x4001f6a0, -1, 240 }, - { "fort2b", 0x000081e0, -1, 240 }, - { "fort2ba", 0x000081e0, -1, 240 }, - { "penfan", 0x4001FA66, -1, 240 }, - { "penfana", 0x4001FAb6, -1, 240 }, - { "candy", 0x4001990C, -1, 240 }, - { "hidnc2k", 0x40016824, -1, 240 }, - /* eolith16.c */ - { "klondkp", 0x0001a046, -1, 240 }, - /* vegaeo.c */ - { "crazywar", 0x00008cf8, -1, 240 }, - { nullptr, 0, 0 } -}; - - -void eolith_state::init_speedup() -{ - int n_game = 0; - m_speedup_address = 0; - m_speedup_address2 = 0; - m_speedup_resume_scanline = 0; - m_speedup_vblank = 0; - m_speedup_scanline = 0; - - while( eolith_speedup_table[ n_game ].s_name != nullptr ) - { - if( strcmp( machine().system().name, eolith_speedup_table[ n_game ].s_name ) == 0 ) - { - m_speedup_address = eolith_speedup_table[ n_game ].speedup_address; - m_speedup_address2 = eolith_speedup_table[ n_game ].speedup_address2; - m_speedup_resume_scanline = eolith_speedup_table[ n_game ].speedup_resume_scanline; - } - n_game++; - } - - save_item(NAME(m_speedup_vblank)); - save_item(NAME(m_speedup_scanline)); -} - -/* todo, use timers instead! */ -TIMER_DEVICE_CALLBACK_MEMBER(eolith_state::eolith_speedup) -{ - if (param==0) - { - m_speedup_vblank = 0; - } - - if (param==m_speedup_resume_scanline) - { - machine().scheduler().trigger(1000); - } - - if (param==240) - { - m_speedup_vblank = 1; - } -} - -CUSTOM_INPUT_MEMBER(eolith_state::eolith_speedup_getvblank) -{ -// printf("%s:eolith speedup_read data %02x\n",machine().describe_context(), m_speedup_vblank); - - - return (m_screen->vpos() >= 240); -} - -// StealSee doesn't use interrupts, just the vblank -CUSTOM_INPUT_MEMBER(eolith_state::stealsee_speedup_getvblank) -{ - int pc = m_maincpu->pc(); - - if (pc==0x400081ec) - if(!m_speedup_vblank) - m_maincpu->eat_cycles(500); - - return (m_screen->vpos() >= 240); -} diff --git a/src/mame/drivers/wpc_dot.cpp b/src/mame/drivers/wpc_dot.cpp index 959b7a1daff..4bd300c356a 100644 --- a/src/mame/drivers/wpc_dot.cpp +++ b/src/mame/drivers/wpc_dot.cpp @@ -3,7 +3,7 @@ /* Williams WPC Dot Matrix */ -#include "includes/wpc_pin.h" +#include "includes/wpc_dot.h" static ADDRESS_MAP_START( wpc_dot_map, AS_PROGRAM, 8, wpc_dot_state ) diff --git a/src/mame/drivers/wpc_flip1.cpp b/src/mame/drivers/wpc_flip1.cpp index 22f9950745b..c907cf51de5 100644 --- a/src/mame/drivers/wpc_flip1.cpp +++ b/src/mame/drivers/wpc_flip1.cpp @@ -3,7 +3,7 @@ /* Williams WPC Fliptronics I */ -#include "includes/wpc_pin.h" +#include "includes/wpc_flip1.h" static ADDRESS_MAP_START( wpc_flip1_map, AS_PROGRAM, 8, wpc_flip1_state ) diff --git a/src/mame/drivers/wpc_flip2.cpp b/src/mame/drivers/wpc_flip2.cpp index 23249bc7e36..3b04999cab6 100644 --- a/src/mame/drivers/wpc_flip2.cpp +++ b/src/mame/drivers/wpc_flip2.cpp @@ -3,7 +3,7 @@ /* Williams WPC Fliptronics II */ -#include "includes/wpc_pin.h" +#include "includes/wpc_flip2.h" static ADDRESS_MAP_START( wpc_flip2_map, AS_PROGRAM, 8, wpc_flip2_state ) diff --git a/src/mame/includes/wpc_pin.h b/src/mame/includes/wpc_dot.h similarity index 67% rename from src/mame/includes/wpc_pin.h rename to src/mame/includes/wpc_dot.h index 27cf5cfc588..b86fdf88db5 100644 --- a/src/mame/includes/wpc_pin.h +++ b/src/mame/includes/wpc_dot.h @@ -1,14 +1,14 @@ // license:BSD-3-Clause // copyright-holders:Barry Rodewald /* - * wpc_pin.h + * wpc_dot.h * * Created on: 18/10/2013 * Author: bsr */ -#ifndef WPC_PIN_H_ -#define WPC_PIN_H_ +#ifndef WPC_DOT_H_ +#define WPC_DOT_H_ #include "emu.h" #include "cpu/m6809/m6809.h" @@ -81,46 +81,4 @@ private: emu_timer* m_irq_timer; }; -class wpc_flip1_state : public wpc_dot_state -{ -public: - wpc_flip1_state(const machine_config &mconfig, device_type type, const char *tag) - : wpc_dot_state(mconfig, type, tag) - { } -public: - DECLARE_DRIVER_INIT(wpc_flip1); -}; - - -class wpc_flip2_state : public wpc_flip1_state -{ -public: - wpc_flip2_state(const machine_config &mconfig, device_type type, const char *tag) - : wpc_flip1_state(mconfig, type, tag) - { } -public: - DECLARE_DRIVER_INIT(wpc_flip2); -}; - -class wpc_dcs_state : public wpc_flip2_state -{ -public: - wpc_dcs_state(const machine_config &mconfig, device_type type, const char *tag) - : wpc_flip2_state(mconfig, type, tag), - m_dcs(*this, "dcs") - { } -public: - - DECLARE_DRIVER_INIT(wpc_dcs); - DECLARE_READ8_MEMBER(wpc_dcs_sound_ctrl_r); - DECLARE_WRITE8_MEMBER(wpc_dcs_sound_ctrl_w); - DECLARE_READ8_MEMBER(wpc_dcs_sound_data_r); - DECLARE_WRITE8_MEMBER(wpc_dcs_sound_data_w); - - required_device m_dcs; -private: - bool m_send; -// UINT8 m_prev_data; -}; - -#endif /* WPC_PIN_H_ */ +#endif /* WPC_DOT_H_ */ diff --git a/src/mame/includes/wpc_flip1.h b/src/mame/includes/wpc_flip1.h new file mode 100644 index 00000000000..2c17608552f --- /dev/null +++ b/src/mame/includes/wpc_flip1.h @@ -0,0 +1,23 @@ +// license:BSD-3-Clause +// copyright-holders:Barry Rodewald +/* + * wpc_flip1.h + * + */ + +#ifndef WPC_FLIP1_H_ +#define WPC_FLIP1_H_ + +#include "includes/wpc_dot.h" + +class wpc_flip1_state : public wpc_dot_state +{ +public: + wpc_flip1_state(const machine_config &mconfig, device_type type, const char *tag) + : wpc_dot_state(mconfig, type, tag) + { } +public: + DECLARE_DRIVER_INIT(wpc_flip1); +}; + +#endif /* WPC_FLIP1_H_ */ diff --git a/src/mame/includes/wpc_flip2.h b/src/mame/includes/wpc_flip2.h new file mode 100644 index 00000000000..5c9a5acf1b9 --- /dev/null +++ b/src/mame/includes/wpc_flip2.h @@ -0,0 +1,23 @@ +// license:BSD-3-Clause +// copyright-holders:Barry Rodewald +/* + * wpc_flip2.h + * + */ + +#ifndef WPC_FLIP2_H_ +#define WPC_FLIP2_H_ + +#include "includes/wpc_flip1.h" + +class wpc_flip2_state : public wpc_flip1_state +{ +public: + wpc_flip2_state(const machine_config &mconfig, device_type type, const char *tag) + : wpc_flip1_state(mconfig, type, tag) + { } +public: + DECLARE_DRIVER_INIT(wpc_flip2); +}; + +#endif /* WPC_FLIP2_H_ */