deprecat.h

This commit is contained in:
Angelo Salese 2011-12-07 03:25:27 +00:00
parent f0306837fc
commit fcdd0a5c1d
10 changed files with 94 additions and 78 deletions

View File

@ -22,7 +22,7 @@
1.31 fix a minor bug with the dac range. wolfpack clips again, and I'm almost sure its an encoding error on the original speech - LN (0.125u9) 1.31 fix a minor bug with the dac range. wolfpack clips again, and I'm almost sure its an encoding error on the original speech - LN (0.125u9)
1.31a Add chip pinout and other notes - LN (0.128u4) 1.31a Add chip pinout and other notes - LN (0.128u4)
1.31b slight update to notes to clarify input bus stuff, mostly finish the state map in the comments - LN 1.31b slight update to notes to clarify input bus stuff, mostly finish the state map in the comments - LN
1.31c remove usage of deprecat.h - AtariAce (0.128u5) 1.31c remove usage of deprecat lib - AtariAce (0.128u5)
1.32 fix the squealing noise using a define; it isn't accurate to the chip exactly, but there are other issues which need to be fixed too. see TODO. - LN (0.136u2) 1.32 fix the squealing noise using a define; it isn't accurate to the chip exactly, but there are other issues which need to be fixed too. see TODO. - LN (0.136u2)
TODO: TODO:

View File

@ -1331,7 +1331,7 @@ static void irq_raise(running_machine &machine, int level)
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
} }
/* TODO: fix this arrangement (derived from old deprecat.h) */ /* TODO: fix this arrangement (derived from old deprecat lib) */
static TIMER_DEVICE_CALLBACK(ms32_interrupt) static TIMER_DEVICE_CALLBACK(ms32_interrupt)
{ {
int scanline = param; int scanline = param;

View File

@ -44,7 +44,6 @@ Note
#include "emu.h" #include "emu.h"
#include "deprecat.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "sound/2413intf.h" #include "sound/2413intf.h"
@ -53,7 +52,9 @@ class jackie_state : public driver_device
{ {
public: public:
jackie_state(const machine_config &mconfig, device_type type, const char *tag) jackie_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { } : driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu")
{ }
int m_exp_bank; int m_exp_bank;
UINT8 *m_fg_tile_ram; UINT8 *m_fg_tile_ram;
@ -73,6 +74,8 @@ public:
int m_hopper; int m_hopper;
UINT8 m_out[3]; UINT8 m_out[3];
UINT16 m_unk_reg[3][5]; UINT16 m_unk_reg[3][5];
required_device<cpu_device> m_maincpu;
}; };
@ -233,18 +236,6 @@ static MACHINE_RESET( jackie )
state->m_bg_enable = 1; state->m_bg_enable = 1;
} }
static INTERRUPT_GEN( jackie_interrupt )
{
jackie_state *state = device->machine().driver_data<jackie_state>();
if (cpu_getiloops(device) % 2) {
if (state->m_irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
} else {
if (state->m_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
}
static void show_out(jackie_state *state) static void show_out(jackie_state *state)
{ {
@ -555,6 +546,19 @@ static DRIVER_INIT( jackie )
rom[0x7e86] = 0xc3; rom[0x7e86] = 0xc3;
} }
static TIMER_DEVICE_CALLBACK( jackie_irq )
{
jackie_state *state = timer.machine().driver_data<jackie_state>();
int scanline = param;
if((scanline % 32) != 0)
return;
if((scanline % 64) == 32 && state->m_irq_enable)
device_set_input_line(state->m_maincpu, 0, HOLD_LINE);
else if ((scanline % 64) == 0 && state->m_nmi_enable)
device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_CONFIG_START( jackie, jackie_state ) static MACHINE_CONFIG_START( jackie, jackie_state )
@ -562,7 +566,7 @@ static MACHINE_CONFIG_START( jackie, jackie_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz / 2) MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz / 2)
MCFG_CPU_PROGRAM_MAP(jackie_prg_map) MCFG_CPU_PROGRAM_MAP(jackie_prg_map)
MCFG_CPU_IO_MAP(jackie_io_map) MCFG_CPU_IO_MAP(jackie_io_map)
MCFG_CPU_VBLANK_INT_HACK(jackie_interrupt,8) MCFG_TIMER_ADD_SCANLINE("scantimer", jackie_irq, "screen", 0, 1)
MCFG_MACHINE_RESET(jackie) MCFG_MACHINE_RESET(jackie)

View File

@ -95,9 +95,6 @@
*/ */
#include "emu.h" #include "emu.h"
#include "deprecat.h"
#include "video/konamiic.h"
#include "cpu/m68000/m68000.h" #include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "cpu/tms57002/tms57002.h" #include "cpu/tms57002/tms57002.h"
@ -105,6 +102,7 @@
#include "sound/k054539.h" #include "sound/k054539.h"
#include "includes/konamigx.h" #include "includes/konamigx.h"
#include "machine/adc083x.h" #include "machine/adc083x.h"
#include "video/konamiic.h"
#include "rendlay.h" #include "rendlay.h"
#define GX_DEBUG 0 #define GX_DEBUG 0
@ -659,10 +657,15 @@ static INTERRUPT_GEN(konamigx_vbinterrupt)
dmastart_callback(0); dmastart_callback(0);
} }
static INTERRUPT_GEN(konamigx_vbinterrupt_type4) static TIMER_DEVICE_CALLBACK(konamigx_hbinterrupt)
{
konamigx_state *state = timer.machine().driver_data<konamigx_state>();
int scanline = param;
if (scanline == 240)
{ {
// lift idle suspension // lift idle suspension
if (resume_trigger && suspension_active) { suspension_active = 0; device->machine().scheduler().trigger(resume_trigger); } if (resume_trigger && suspension_active) { suspension_active = 0; timer.machine().scheduler().trigger(resume_trigger); }
// IRQ 1 is the main 60hz vblank interrupt // IRQ 1 is the main 60hz vblank interrupt
// the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board // the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board
@ -678,22 +681,14 @@ static INTERRUPT_GEN(konamigx_vbinterrupt_type4)
if ((konamigx_wrport1_1 & 0x81) == 0x81 || (gx_syncen & 1)) if ((konamigx_wrport1_1 & 0x81) == 0x81 || (gx_syncen & 1))
{ {
gx_syncen &= ~1; gx_syncen &= ~1;
device_set_input_line(device, 1, HOLD_LINE); device_set_input_line(state->m_maincpu, 1, HOLD_LINE);
} }
} }
dmastart_callback(0); dmastart_callback(0);
} }
else if(scanline < 240) // hblank
static INTERRUPT_GEN(konamigx_hbinterrupt)
{
if (!cpu_getiloops(device))
{
konamigx_vbinterrupt_type4(device);
}
else // hblank
{ {
// IRQ 2 is a programmable interrupt with scanline resolution // IRQ 2 is a programmable interrupt with scanline resolution
if (gx_syncen & 0x40) if (gx_syncen & 0x40)
@ -703,7 +698,7 @@ static INTERRUPT_GEN(konamigx_hbinterrupt)
if ((konamigx_wrport1_1 & 0x82) == 0x82 || (gx_syncen & 2)) if ((konamigx_wrport1_1 & 0x82) == 0x82 || (gx_syncen & 2))
{ {
gx_syncen &= ~2; gx_syncen &= ~2;
device_set_input_line(device, 2, HOLD_LINE); device_set_input_line(state->m_maincpu, 2, HOLD_LINE);
} }
} }
} }
@ -1785,7 +1780,7 @@ static GFXDECODE_START( type4 )
GFXDECODE_ENTRY( "gfx3", 0, bglayout_8bpp, 0x1800, 8 ) GFXDECODE_ENTRY( "gfx3", 0, bglayout_8bpp, 0x1800, 8 )
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_START( konamigx, driver_device ) static MACHINE_CONFIG_START( konamigx, konamigx_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68EC020, 24000000) MCFG_CPU_ADD("maincpu", M68EC020, 24000000)
MCFG_CPU_PROGRAM_MAP(gx_type2_map) MCFG_CPU_PROGRAM_MAP(gx_type2_map)
@ -1886,9 +1881,11 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gxtype3, konamigx ) static MACHINE_CONFIG_DERIVED( gxtype3, konamigx )
MCFG_CPU_MODIFY("maincpu") MCFG_DEVICE_REMOVE("maincpu")
MCFG_CPU_ADD("maincpu", M68EC020, 24000000)
MCFG_CPU_PROGRAM_MAP(gx_type3_map) MCFG_CPU_PROGRAM_MAP(gx_type3_map)
MCFG_CPU_VBLANK_INT_HACK(konamigx_hbinterrupt, 262) MCFG_TIMER_ADD_SCANLINE("scantimer", konamigx_hbinterrupt, "screen", 0, 1)
MCFG_DEFAULT_LAYOUT(layout_dualhsxs) MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE) MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
@ -1896,13 +1893,13 @@ static MACHINE_CONFIG_DERIVED( gxtype3, konamigx )
MCFG_VIDEO_START(konamigx_type3) MCFG_VIDEO_START(konamigx_type3)
MCFG_PALETTE_LENGTH(16384) MCFG_PALETTE_LENGTH(16384)
MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_SIZE(576, 32*8) MCFG_SCREEN_SIZE(576, 264)
MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16) MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16)
MCFG_SCREEN_ADD("screen2", RASTER) MCFG_SCREEN_ADD("screen2", RASTER)
MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223) MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MCFG_SCREEN_SIZE(576, 32*8) MCFG_SCREEN_SIZE(576, 264)
MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16) MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16)
MCFG_SCREEN_UPDATE(konamigx) MCFG_SCREEN_UPDATE(konamigx)
@ -1911,21 +1908,23 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gxtype4, konamigx ) static MACHINE_CONFIG_DERIVED( gxtype4, konamigx )
MCFG_CPU_MODIFY("maincpu") MCFG_DEVICE_REMOVE("maincpu")
MCFG_CPU_ADD("maincpu", M68EC020, 24000000)
MCFG_CPU_PROGRAM_MAP(gx_type4_map) MCFG_CPU_PROGRAM_MAP(gx_type4_map)
MCFG_CPU_VBLANK_INT_HACK(konamigx_hbinterrupt, 262) MCFG_TIMER_ADD_SCANLINE("scantimer", konamigx_hbinterrupt, "screen", 0, 1)
MCFG_DEFAULT_LAYOUT(layout_dualhsxs) MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE) MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_SIZE(128*8, 32*8) MCFG_SCREEN_SIZE(128*8, 264)
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 32*8-1-16) MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 32*8-1-16)
MCFG_SCREEN_ADD("screen2", RASTER) MCFG_SCREEN_ADD("screen2", RASTER)
MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223) MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MCFG_SCREEN_SIZE(128*8, 32*8) MCFG_SCREEN_SIZE(128*8, 264)
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 32*8-1-16) MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 32*8-1-16)
MCFG_SCREEN_UPDATE(konamigx) MCFG_SCREEN_UPDATE(konamigx)

View File

@ -1324,7 +1324,7 @@ static void irq_raise(running_machine &machine, int level)
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
} }
/* TODO: fix this arrangement (derived from old deprecat.h) */ /* TODO: fix this arrangement (derived from old deprecat lib) */
static TIMER_DEVICE_CALLBACK(ms32_interrupt) static TIMER_DEVICE_CALLBACK(ms32_interrupt)
{ {
int scanline = param; int scanline = param;

View File

@ -79,7 +79,7 @@ static TIMER_DEVICE_CALLBACK( overdriv_cpuA_scanline )
int scanline = param; int scanline = param;
/* TODO: irqs routines are TOO slow right now, it ends up firing spurious irqs for whatever reason (shared ram fighting?) */ /* TODO: irqs routines are TOO slow right now, it ends up firing spurious irqs for whatever reason (shared ram fighting?) */
/* this is a temporary solution to get rid of deprecat.h and the crashes, but also makes the game timer to be too slow */ /* this is a temporary solution to get rid of deprecat lib and the crashes, but also makes the game timer to be too slow */
if(scanline == 256 && timer.machine().primary_screen->frame_number() & 1) // vblank-out irq if(scanline == 256 && timer.machine().primary_screen->frame_number() & 1) // vblank-out irq
cputag_set_input_line(timer.machine(), "maincpu", 4, HOLD_LINE); cputag_set_input_line(timer.machine(), "maincpu", 4, HOLD_LINE);
else if((scanline % 128) == 0) // timer irq else if((scanline % 128) == 0) // timer irq

View File

@ -192,6 +192,7 @@ ADDRESS_MAP_END
***************************************************************************/ ***************************************************************************/
static INPUT_PORTS_START( thedeep ) static INPUT_PORTS_START( thedeep )
PORT_START("e008") PORT_START("e008")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // Up / down shown in service mode PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // Up / down shown in service mode

View File

@ -1,3 +1,15 @@
class konamigx_state : public driver_device
{
public:
konamigx_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu")
{ }
required_device<cpu_device> m_maincpu;
};
/*----------- defined in drivers/konamigx.c -----------*/ /*----------- defined in drivers/konamigx.c -----------*/
extern UINT32 *gx_psacram, *gx_subpaletteram32; extern UINT32 *gx_psacram, *gx_subpaletteram32;

View File

@ -2,7 +2,9 @@ class thedeep_state : public driver_device
{ {
public: public:
thedeep_state(const machine_config &mconfig, device_type type, const char *tag) thedeep_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { } : driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu")
{ }
UINT8 *m_spriteram; UINT8 *m_spriteram;
size_t m_spriteram_size; size_t m_spriteram_size;
@ -18,6 +20,8 @@ public:
UINT8 *m_scroll2; UINT8 *m_scroll2;
tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_0;
tilemap_t *m_tilemap_1; tilemap_t *m_tilemap_1;
required_device<cpu_device> m_maincpu;
}; };

View File

@ -5,7 +5,6 @@
*************************************************************************/ *************************************************************************/
#include "emu.h" #include "emu.h"
#include "deprecat.h"
#include "includes/atarifb.h" #include "includes/atarifb.h"
#include "sound/discrete.h" #include "sound/discrete.h"
@ -121,10 +120,11 @@ WRITE8_HANDLER( soccer_out2_w )
* *
*************************************/ *************************************/
/* FIXME: almost surely not tied with screen vertical position */
WRITE8_HANDLER( atarifb_out3_w ) WRITE8_HANDLER( atarifb_out3_w )
{ {
atarifb_state *state = space->machine().driver_data<atarifb_state>(); //atarifb_state *state = space->machine().driver_data<atarifb_state>();
int loop = cpu_getiloops(state->m_maincpu); int loop = space->machine().primary_screen->vpos() >= 123;
switch (loop) switch (loop)
{ {
@ -137,8 +137,6 @@ WRITE8_HANDLER( atarifb_out3_w )
output_set_value("ledleft4", (data >> 4) & 1); output_set_value("ledleft4", (data >> 4) & 1);
break; break;
case 0x01: case 0x01:
break;
case 0x02:
/* Player 2 play select lamp */ /* Player 2 play select lamp */
output_set_value("ledright0", (data >> 0) & 1); output_set_value("ledright0", (data >> 0) & 1);
output_set_value("ledright1", (data >> 1) & 1); output_set_value("ledright1", (data >> 1) & 1);
@ -146,8 +144,6 @@ WRITE8_HANDLER( atarifb_out3_w )
output_set_value("ledright3", (data >> 3) & 1); output_set_value("ledright3", (data >> 3) & 1);
output_set_value("ledright4", (data >> 4) & 1); output_set_value("ledright4", (data >> 4) & 1);
break; break;
case 0x03:
break;
} }
// logerror("out3_w, %02x:%02x\n", loop, data); // logerror("out3_w, %02x:%02x\n", loop, data);
} }