Made the genvdp a derived class of the newer sms vdp because the genesis vdp has an sms compatibility mode where it basically operates as an sms vdp (with a few changes / limitations). From Haze (nw)

Comment:  Not hooked this up to megatech yet to replace the old smsvdp code on the game screen when running sms games, but once I figure out how I'm actually going to do that, that's the plan ;-)
This commit is contained in:
Scott Stone 2012-08-29 19:30:10 +00:00
parent c351fed225
commit 6ba5fa15ea
7 changed files with 48 additions and 8 deletions

View File

@ -66,11 +66,6 @@ PAL frame timing
#define DRAW_TIME_GG 86 /* 1 + 2 + 14 +8 + 96/2 */
#define DRAW_TIME_SMS 0
#define SEGA315_5378_CRAM_SIZE 0x40 /* 32 colors x 2 bytes per color = 64 bytes */
#define SEGA315_5124_CRAM_SIZE 0x20 /* 32 colors x 1 bytes per color = 32 bytes */
#define VRAM_SIZE 0x4000
#define PRIORITY_BIT 0x1000
#define BACKDROP_COLOR ((m_vdp_mode == 4 ? 0x10 : 0x00) + (m_reg[0x07] & 0x0f))

View File

@ -42,6 +42,12 @@ PALETTE_INIT( sega315_5124 );
PALETTE_INIT( sega315_5378 );
#define SEGA315_5378_CRAM_SIZE 0x40 /* 32 colors x 2 bytes per color = 64 bytes */
#define SEGA315_5124_CRAM_SIZE 0x20 /* 32 colors x 1 bytes per color = 32 bytes */
#define VRAM_SIZE 0x4000
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/

View File

@ -1361,7 +1361,13 @@ void genesis_vdp_lv4irqline_callback_segac2(running_machine &machine, bool state
cputag_set_input_line(machine, "maincpu", 4, CLEAR_LINE);
}
static const sega315_5124_interface sms_vdp_ntsc_intf =
{
false,
"megadriv",
DEVCB_NULL,
DEVCB_NULL,
};
static MACHINE_CONFIG_START( segac, segac2_state )
@ -1376,6 +1382,7 @@ static MACHINE_CONFIG_START( segac, segac2_state )
// MCFG_FRAGMENT_ADD(megadriv_timers)
MCFG_DEVICE_ADD("gen_vdp", SEGA_GEN_VDP, 0)
MCFG_DEVICE_CONFIG( sms_vdp_ntsc_intf )
sega_genesis_vdp_device::set_genesis_vdp_sndirqline_callback(*device, genesis_vdp_sndirqline_callback_segac2);
sega_genesis_vdp_device::set_genesis_vdp_lv6irqline_callback(*device, genesis_vdp_lv6irqline_callback_segac2);
sega_genesis_vdp_device::set_genesis_vdp_lv4irqline_callback(*device, genesis_vdp_lv4irqline_callback_segac2);

View File

@ -1231,6 +1231,14 @@ void genesis_vdp_lv4irqline_callback_segas18(running_machine &machine, bool stat
*
*************************************/
static const sega315_5124_interface sms_vdp_ntsc_intf =
{
false,
"screen",
DEVCB_NULL,
DEVCB_NULL,
};
static MACHINE_CONFIG_START( system18, segas18_state )
// basic machine hardware
@ -1248,6 +1256,7 @@ static MACHINE_CONFIG_START( system18, segas18_state )
MCFG_DEVICE_ADD("gen_vdp", SEGA_GEN_VDP, 0)
MCFG_DEVICE_CONFIG( sms_vdp_ntsc_intf )
sega_genesis_vdp_device::set_genesis_vdp_sndirqline_callback(*device, genesis_vdp_sndirqline_callback_segas18);
sega_genesis_vdp_device::set_genesis_vdp_lv6irqline_callback(*device, genesis_vdp_lv6irqline_callback_segas18);
sega_genesis_vdp_device::set_genesis_vdp_lv4irqline_callback(*device, genesis_vdp_lv4irqline_callback_segas18);

View File

@ -1128,6 +1128,25 @@ MACHINE_CONFIG_END
static const sega315_5124_interface sms_vdp_ntsc_intf =
{
false,
"megadriv",
DEVCB_NULL,
DEVCB_NULL,
};
static const sega315_5124_interface sms_vdp_pal_intf =
{
true,
"megadriv",
DEVCB_NULL,
DEVCB_NULL,
};
MACHINE_CONFIG_FRAGMENT( md_ntsc )
MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK_NTSC / 7) /* 7.67 MHz */
MCFG_CPU_PROGRAM_MAP(megadriv_map)
@ -1144,6 +1163,7 @@ MACHINE_CONFIG_FRAGMENT( md_ntsc )
MCFG_FRAGMENT_ADD(megadriv_timers)
MCFG_DEVICE_ADD("gen_vdp", SEGA_GEN_VDP, 0)
MCFG_DEVICE_CONFIG( sms_vdp_ntsc_intf )
sega_genesis_vdp_device::set_genesis_vdp_sndirqline_callback(*device, genesis_vdp_sndirqline_callback_genesis_z80);
sega_genesis_vdp_device::set_genesis_vdp_lv6irqline_callback(*device, genesis_vdp_lv6irqline_callback_genesis_68k);
sega_genesis_vdp_device::set_genesis_vdp_lv4irqline_callback(*device, genesis_vdp_lv4irqline_callback_genesis_68k);
@ -1201,6 +1221,7 @@ MACHINE_CONFIG_FRAGMENT( md_pal )
MCFG_FRAGMENT_ADD(megadriv_timers)
MCFG_DEVICE_ADD("gen_vdp", SEGA_GEN_VDP, 0)
MCFG_DEVICE_CONFIG( sms_vdp_pal_intf )
sega_genesis_vdp_device::set_genesis_vdp_sndirqline_callback(*device, genesis_vdp_sndirqline_callback_genesis_z80);
sega_genesis_vdp_device::set_genesis_vdp_lv6irqline_callback(*device, genesis_vdp_lv6irqline_callback_genesis_68k);
sega_genesis_vdp_device::set_genesis_vdp_lv4irqline_callback(*device, genesis_vdp_lv4irqline_callback_genesis_68k);

View File

@ -3,6 +3,7 @@
#include "emu.h"
#include "megavdp.h"
#include "mega32x.h"
#include "video/315_5124.h"
/* still have dependencies on the following external gunk */
@ -57,7 +58,7 @@ void genesis_vdp_lv4irqline_callback_default(running_machine &machine, bool stat
const device_type SEGA_GEN_VDP = &device_creator<sega_genesis_vdp_device>;
sega_genesis_vdp_device::sega_genesis_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, SEGA_GEN_VDP, "sega_genesis_vdp_device", tag, owner, clock)
: sega315_5124_device( mconfig, SEGA315_5246, "Sega Genesis VDP", tag, owner, clock, SEGA315_5124_CRAM_SIZE, 0, true )
{
m_genesis_vdp_sndirqline_callback = genesis_vdp_sndirqline_callback_default;
m_genesis_vdp_lv6irqline_callback = genesis_vdp_lv6irqline_callback_default;

View File

@ -2,6 +2,7 @@
#pragma once
#include "video/315_5124.h"
/* The VDP occupies addresses C00000h to C0001Fh.
@ -153,7 +154,7 @@ extern void megadriv_reset_vdp(running_machine &machine);
extern int genvdp_use_cram;
class sega_genesis_vdp_device : public device_t
class sega_genesis_vdp_device : public sega315_5124_device
{
public:
sega_genesis_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);