fixed wpc, okiadpcm and eolith (nw)

This commit is contained in:
Miodrag Milanovic 2016-04-30 19:56:18 +02:00
parent 5408999eb0
commit 8bef52ec6d
10 changed files with 184 additions and 183 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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);
}
/*************************************
*

View File

@ -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);
}

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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<dcs_audio_wpc_device> m_dcs;
private:
bool m_send;
// UINT8 m_prev_data;
};
#endif /* WPC_PIN_H_ */
#endif /* WPC_DOT_H_ */

View File

@ -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_ */

View File

@ -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_ */