Today work for deprecate the deprecat.h

This commit is contained in:
Angelo Salese 2011-04-28 01:54:18 +00:00
parent a8d41ae349
commit 1ce1e3c39c
7 changed files with 75 additions and 64 deletions

View File

@ -30,7 +30,6 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
#include "deprecat.h"
#include "sound/discrete.h"
#include "includes/avalnche.h"
@ -234,11 +233,6 @@ INPUT_PORTS_END
*
*************************************/
static INTERRUPT_GEN( avalnche_interrupt )
{
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_START( avalnche )
{
avalnche_state *state = machine.driver_data<avalnche_state>();
@ -258,7 +252,7 @@ static MACHINE_CONFIG_START( avalnche, avalnche_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502,MASTER_CLOCK/16) /* clock input is the "2H" signal divided by two */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_HACK(avalnche_interrupt,8)
MCFG_CPU_PERIODIC_INT(nmi_line_pulse,8*60)
MCFG_MACHINE_START(avalnche)
MCFG_MACHINE_RESET(avalnche)

View File

@ -44,7 +44,6 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "deprecat.h"
#include "sound/ay8910.h"
#include "includes/battlex.h"

View File

@ -57,7 +57,6 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "deprecat.h"
#include "sound/2151intf.h"
#include "includes/bionicc.h"
@ -127,19 +126,20 @@ static READ16_HANDLER( hacked_soundcommand_r )
IRQ 2 drives the game
IRQ 4 processes the input ports
The game is very picky about timing. The following is the only
way I have found it to work.
********************************************************************/
static INTERRUPT_GEN( bionicc_interrupt )
static TIMER_DEVICE_CALLBACK( bionicc_scanline )
{
if (cpu_getiloops(device) == 0)
device_set_input_line(device, 2, HOLD_LINE);
else
device_set_input_line(device, 4, HOLD_LINE);
int scanline = param;
if(scanline == 240) // vblank-out irq
cputag_set_input_line(timer.machine(), "maincpu", 2, HOLD_LINE);
if(scanline == 0) // vblank-in or i8751 related irq
cputag_set_input_line(timer.machine(), "maincpu", 4, HOLD_LINE);
}
/*************************************
*
* Address maps
@ -361,7 +361,7 @@ static MACHINE_CONFIG_START( bionicc, bionicc_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK / 2) /* 12 MHz - verified in schematics */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_HACK(bionicc_interrupt,8)
MCFG_TIMER_ADD_SCANLINE("scantimer", bionicc_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, EXO3_F0_CLK / 4) /* EXO3 C,B=GND, A=5V ==> Divisor 2^2 */
MCFG_CPU_PROGRAM_MAP(sound_map)

View File

@ -84,7 +84,6 @@ Notes:
***************************************************************************/
#include "emu.h"
#include "deprecat.h"
#include "video/konicdev.h"
#include "cpu/m68000/m68000.h"
#include "sound/ymz280b.h"
@ -110,21 +109,18 @@ static WRITE16_HANDLER( control2_w )
COMBINE_DATA(&state->m_cur_control2);
}
static INTERRUPT_GEN(bishi_interrupt)
static TIMER_DEVICE_CALLBACK( bishi_scanline )
{
bishi_state *state = device->machine().driver_data<bishi_state>();
bishi_state *state = timer.machine().driver_data<bishi_state>();
int scanline = param;
if (state->m_cur_control & 0x800)
{
switch (cpu_getiloops(device))
{
case 0:
device_set_input_line(device, M68K_IRQ_3, HOLD_LINE);
break;
if(scanline == 240) // vblank-out irq
cputag_set_input_line(timer.machine(), "maincpu", M68K_IRQ_3, HOLD_LINE);
case 1:
device_set_input_line(device, M68K_IRQ_4, HOLD_LINE);
break;
}
if(scanline == 0) // vblank-in irq
cputag_set_input_line(timer.machine(), "maincpu", M68K_IRQ_4, HOLD_LINE);
}
}
@ -370,10 +366,8 @@ INPUT_PORTS_END
static void sound_irq_gen(device_t *device, int state)
{
bishi_state *bishi = device->machine().driver_data<bishi_state>();
if (state)
device_set_input_line(bishi->m_maincpu, M68K_IRQ_1, ASSERT_LINE);
else
device_set_input_line(bishi->m_maincpu, M68K_IRQ_1, CLEAR_LINE);
device_set_input_line(bishi->m_maincpu, M68K_IRQ_1, (state) ? ASSERT_LINE : CLEAR_LINE);
}
static const ymz280b_interface ymz280b_intf =
@ -423,7 +417,7 @@ static MACHINE_CONFIG_START( bishi, bishi_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK) /* 12MHz (24MHz OSC / 2 ) */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_HACK(bishi_interrupt, 2)
MCFG_TIMER_ADD_SCANLINE("scantimer", bishi_scanline, "screen", 0, 1)
MCFG_MACHINE_START(bishi)
MCFG_MACHINE_RESET(bishi)

View File

@ -22,11 +22,11 @@
* The protection is not fully understood(Konami 051733). The
game is playable, but is not 100% accurate.
* Missing samples.
(both issues above are outdated?)
***************************************************************************/
#include "emu.h"
#include "deprecat.h"
#include "cpu/m6809/m6809.h"
#include "cpu/hd6309/hd6309.h"
#include "sound/2203intf.h"
@ -36,19 +36,16 @@
#include "includes/bladestl.h"
static INTERRUPT_GEN( bladestl_interrupt )
static TIMER_DEVICE_CALLBACK( bladestl_scanline )
{
bladestl_state *state = device->machine().driver_data<bladestl_state>();
bladestl_state *state = timer.machine().driver_data<bladestl_state>();
int scanline = param;
if (cpu_getiloops(device) == 0)
{
if (k007342_is_int_enabled(state->m_k007342))
device_set_input_line(device, HD6309_FIRQ_LINE, HOLD_LINE);
}
else if (cpu_getiloops(device) % 2)
{
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
if(scanline == 240 && k007342_is_int_enabled(state->m_k007342)) // vblank-out irq
cputag_set_input_line(timer.machine(), "maincpu", HD6309_FIRQ_LINE, HOLD_LINE);
if(scanline == 0) // vblank-in or timer irq
cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
/*************************************
@ -338,7 +335,7 @@ static MACHINE_CONFIG_START( bladestl, bladestl_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", HD6309, 24000000/2) /* 24MHz/2 (?) */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_HACK(bladestl_interrupt,2) /* (1 IRQ + 1 NMI) */
MCFG_TIMER_ADD_SCANLINE("scantimer", bladestl_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M6809, 2000000)
MCFG_CPU_PROGRAM_MAP(sound_map)

View File

@ -66,20 +66,13 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "deprecat.h"
#include "cpu/z80/z80.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
#include "includes/blockout.h"
static INTERRUPT_GEN( blockout_interrupt )
{
/* interrupt 6 is vblank */
/* interrupt 5 reads coin inputs - might have to be triggered only */
/* when a coin is inserted */
device_set_input_line(device, 6 - cpu_getiloops(device), HOLD_LINE);
}
#define MAIN_CLOCK XTAL_10MHz
#define AUDIO_CLOCK XTAL_3_579545MHz
static WRITE16_HANDLER( blockout_sound_command_w )
{
@ -92,6 +85,19 @@ static WRITE16_HANDLER( blockout_sound_command_w )
}
}
static WRITE16_HANDLER( blockout_irq6_ack_w )
{
blockout_state *state = space->machine().driver_data<blockout_state>();
device_set_input_line(state->m_maincpu, 6, CLEAR_LINE);
}
static WRITE16_HANDLER( blockout_irq5_ack_w )
{
blockout_state *state = space->machine().driver_data<blockout_state>();
device_set_input_line(state->m_maincpu, 5, CLEAR_LINE);
}
/*************************************
*
@ -106,6 +112,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
AM_RANGE(0x100004, 0x100005) AM_READ_PORT("SYSTEM")
AM_RANGE(0x100006, 0x100007) AM_READ_PORT("DSW1")
AM_RANGE(0x100008, 0x100009) AM_READ_PORT("DSW2")
AM_RANGE(0x100010, 0x100011) AM_WRITE(blockout_irq6_ack_w)
AM_RANGE(0x100012, 0x100013) AM_WRITE(blockout_irq5_ack_w)
AM_RANGE(0x100014, 0x100015) AM_WRITE(blockout_sound_command_w)
AM_RANGE(0x100016, 0x100017) AM_WRITENOP /* don't know, maybe reset sound CPU */
AM_RANGE(0x180000, 0x1bffff) AM_RAM_WRITE(blockout_videoram_w) AM_BASE_MEMBER(blockout_state, m_videoram)
@ -132,6 +140,11 @@ ADDRESS_MAP_END
*
*************************************/
static INPUT_CHANGED( coin_inserted )
{
cputag_set_input_line(field->port->machine(), "maincpu", 5, newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( blockout )
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
@ -154,9 +167,9 @@ static INPUT_PORTS_START( blockout )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("SYSTEM")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted,0)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted,0)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_CHANGED(coin_inserted,0)
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
@ -257,6 +270,7 @@ static MACHINE_START( blockout )
{
blockout_state *state = machine.driver_data<blockout_state>();
state->m_maincpu = machine.device("maincpu");
state->m_audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->m_color));
@ -269,14 +283,26 @@ static MACHINE_RESET( blockout )
state->m_color = 0;
}
static TIMER_DEVICE_CALLBACK( blockout_scanline )
{
blockout_state *state = timer.machine().driver_data<blockout_state>();
int scanline = param;
if(scanline == 248) // vblank-out irq
device_set_input_line(state->m_maincpu, 6, ASSERT_LINE);
if(scanline == 0) // vblank-in irq or directly tied to coin inputs (TODO: check)
device_set_input_line(state->m_maincpu, 5, ASSERT_LINE);
}
static MACHINE_CONFIG_START( blockout, blockout_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* MRH - 8.76 makes gfx/adpcm samples sync better -- but 10 is correct speed*/
MCFG_CPU_ADD("maincpu", M68000, MAIN_CLOCK) /* MRH - 8.76 makes gfx/adpcm samples sync better -- but 10 is correct speed*/
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_HACK(blockout_interrupt,2)
MCFG_TIMER_ADD_SCANLINE("scantimer", blockout_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */
MCFG_CPU_ADD("audiocpu", Z80, AUDIO_CLOCK) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(audio_map)
MCFG_MACHINE_START(blockout)
@ -298,7 +324,7 @@ static MACHINE_CONFIG_START( blockout, blockout_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
MCFG_SOUND_ADD("ymsnd", YM2151, AUDIO_CLOCK)
MCFG_SOUND_CONFIG(ym2151_config)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)

View File

@ -20,6 +20,7 @@ public:
UINT16 m_color;
/* devices */
device_t *m_maincpu;
device_t *m_audiocpu;
};