mirror of
https://github.com/holub/mame
synced 2025-05-21 13:18:56 +03:00
Sega 16-bit cleanup, part 1 (still more coming):
* Converted FD1089/FD1094 into proper devices, derived from m68000. They now handle their own decryption and memory management, so we can remove all the calls for initialization/reset/etc. The key now lives as a 'key' subdevice under the CPU, and the FD1089/1094 are now specified just like any other CPU. * Removed the horrible s16fd and s24fd files. Good riddance. * Created a helper class for managing fd1094 decryption caches. * Converted the memory mapper into a new modern device and updated the segas16b, segaorun, and segas18 drivers to use it. Fixed ROM memory mapping so that the source ROMs can be loaded contiguously, removing a bunch of hacks. * Untangled the joined segas1x_state and split the states for each system into their own classes. Cleaned up some implementations. * Added support for member functions to be called as DRIVER_INIT functions. To do this, #define MODERN_DRIVER_INIT prior to #including "emu.h" and you will be required to specify a class and member function for your driver init. * Fully modernized the segas16b and segas18 drivers. New working games added ----------------------- GP Rider (Japan) [ShouTime, Charles MacDonald, Aaron Giles] Last Survivor [ShouTime, Charles MacDonald, Aaron Giles, 9ofzeven, TrevEB, Dr. Spankenstein, ghoolster, Surgeville, Tormod, Tjaberg, Waremonger] (Note: A couple games are still busted, but most are working. Will follow up with more updates.)
This commit is contained in:
parent
13e2f8b5fc
commit
aa9bc95573
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -4402,8 +4402,6 @@ src/mame/machine/qix.c svneol=native#text/plain
|
||||
src/mame/machine/r2crypt.c svneol=native#text/plain
|
||||
src/mame/machine/rainbow.c svneol=native#text/plain
|
||||
src/mame/machine/retofinv.c svneol=native#text/plain
|
||||
src/mame/machine/s16fd.c svneol=native#text/plain
|
||||
src/mame/machine/s24fd.c svneol=native#text/plain
|
||||
src/mame/machine/scramble.c svneol=native#text/plain
|
||||
src/mame/machine/scudsp.c svneol=native#text/plain
|
||||
src/mame/machine/scudsp.h svneol=native#text/plain
|
||||
|
@ -471,14 +471,15 @@ void driver_device::soundlatch_sync_callback(void *ptr, INT32 param)
|
||||
// writing to sound latches
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER( driver_device::soundlatch_byte_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 0 | (data << 8)); }
|
||||
WRITE16_MEMBER( driver_device::soundlatch_word_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 0 | (data << 8)); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch2_byte_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 1 | (data << 8)); }
|
||||
WRITE16_MEMBER( driver_device::soundlatch2_word_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 1 | (data << 8)); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch3_byte_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 2 | (data << 8)); }
|
||||
WRITE16_MEMBER( driver_device::soundlatch3_word_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 2 | (data << 8)); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch4_byte_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 3 | (data << 8)); }
|
||||
WRITE16_MEMBER( driver_device::soundlatch4_word_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 3 | (data << 8)); }
|
||||
void driver_device::soundlatch_write(UINT8 index, UINT32 data) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), index | (data << 8)); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch_byte_w ) { soundlatch_write(0, data); }
|
||||
WRITE16_MEMBER( driver_device::soundlatch_word_w ) { soundlatch_write(0, data); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch2_byte_w ) { soundlatch_write(1, data); }
|
||||
WRITE16_MEMBER( driver_device::soundlatch2_word_w ) { soundlatch_write(1, data); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch3_byte_w ) { soundlatch_write(2, data); }
|
||||
WRITE16_MEMBER( driver_device::soundlatch3_word_w ) { soundlatch_write(2, data); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch4_byte_w ) { soundlatch_write(3, data); }
|
||||
WRITE16_MEMBER( driver_device::soundlatch4_word_w ) { soundlatch_write(3, data); }
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -486,14 +487,15 @@ WRITE16_MEMBER( driver_device::soundlatch4_word_w ) { machine().scheduler().sync
|
||||
// reading from sound latches
|
||||
//-------------------------------------------------
|
||||
|
||||
READ8_MEMBER( driver_device::soundlatch_byte_r ) { m_latch_read[0] = 1; return m_latched_value[0]; }
|
||||
READ16_MEMBER( driver_device::soundlatch_word_r ) { m_latch_read[0] = 1; return m_latched_value[0]; }
|
||||
READ8_MEMBER( driver_device::soundlatch2_byte_r ) { m_latch_read[1] = 1; return m_latched_value[1]; }
|
||||
READ16_MEMBER( driver_device::soundlatch2_word_r ) { m_latch_read[1] = 1; return m_latched_value[1]; }
|
||||
READ8_MEMBER( driver_device::soundlatch3_byte_r ) { m_latch_read[2] = 1; return m_latched_value[2]; }
|
||||
READ16_MEMBER( driver_device::soundlatch3_word_r ) { m_latch_read[2] = 1; return m_latched_value[2]; }
|
||||
READ8_MEMBER( driver_device::soundlatch4_byte_r ) { m_latch_read[3] = 1; return m_latched_value[3]; }
|
||||
READ16_MEMBER( driver_device::soundlatch4_word_r ) { m_latch_read[3] = 1; return m_latched_value[3]; }
|
||||
UINT32 driver_device::soundlatch_read(UINT8 index) { m_latch_read[index] = 1; return m_latched_value[index]; }
|
||||
READ8_MEMBER( driver_device::soundlatch_byte_r ) { return soundlatch_read(0); }
|
||||
READ16_MEMBER( driver_device::soundlatch_word_r ) { return soundlatch_read(0); }
|
||||
READ8_MEMBER( driver_device::soundlatch2_byte_r ) { return soundlatch_read(1); }
|
||||
READ16_MEMBER( driver_device::soundlatch2_word_r ) { return soundlatch_read(1); }
|
||||
READ8_MEMBER( driver_device::soundlatch3_byte_r ) { return soundlatch_read(2); }
|
||||
READ16_MEMBER( driver_device::soundlatch3_word_r ) { return soundlatch_read(2); }
|
||||
READ8_MEMBER( driver_device::soundlatch4_byte_r ) { return soundlatch_read(3); }
|
||||
READ16_MEMBER( driver_device::soundlatch4_word_r ) { return soundlatch_read(3); }
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -501,10 +503,11 @@ READ16_MEMBER( driver_device::soundlatch4_word_r ) { m_latch_read[3] = 1; return
|
||||
// for clearing sound latches
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER( driver_device::soundlatch_clear_byte_w ) { m_latched_value[0] = m_latch_clear_value; }
|
||||
WRITE8_MEMBER( driver_device::soundlatch2_clear_byte_w ) { m_latched_value[1] = m_latch_clear_value; }
|
||||
WRITE8_MEMBER( driver_device::soundlatch3_clear_byte_w ) { m_latched_value[2] = m_latch_clear_value; }
|
||||
WRITE8_MEMBER( driver_device::soundlatch4_clear_byte_w ) { m_latched_value[3] = m_latch_clear_value; }
|
||||
void driver_device::soundlatch_clear(UINT8 index) { m_latched_value[index] = m_latch_clear_value; }
|
||||
WRITE8_MEMBER( driver_device::soundlatch_clear_byte_w ) { soundlatch_clear(0); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch2_clear_byte_w ) { soundlatch_clear(1); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch3_clear_byte_w ) { soundlatch_clear(2); }
|
||||
WRITE8_MEMBER( driver_device::soundlatch4_clear_byte_w ) { soundlatch_clear(3); }
|
||||
|
||||
|
||||
|
||||
|
@ -178,9 +178,9 @@ public:
|
||||
|
||||
// generic helpers
|
||||
template<class _DriverClass, void (_DriverClass::*_Function)()>
|
||||
static void static_wrapper(driver_device &device)
|
||||
static void driver_init_wrapper(running_machine &machine)
|
||||
{
|
||||
(downcast<_DriverClass &>(device).*_Function)();
|
||||
(machine.driver_data<_DriverClass>()->*_Function)();
|
||||
}
|
||||
|
||||
// generic interrupt generators
|
||||
@ -234,6 +234,7 @@ public:
|
||||
void soundlatch_setclearedvalue(UINT16 value) { m_latch_clear_value = value; }
|
||||
|
||||
// sound latch readers
|
||||
UINT32 soundlatch_read(UINT8 index = 0);
|
||||
DECLARE_READ8_MEMBER( soundlatch_byte_r );
|
||||
DECLARE_READ8_MEMBER( soundlatch2_byte_r );
|
||||
DECLARE_READ8_MEMBER( soundlatch3_byte_r );
|
||||
@ -244,6 +245,8 @@ public:
|
||||
DECLARE_READ16_MEMBER( soundlatch4_word_r );
|
||||
|
||||
// sound latch writers
|
||||
void soundlatch_write(UINT8 index, UINT32 data);
|
||||
void soundlatch_write(UINT32 data) { soundlatch_write(0, data); }
|
||||
DECLARE_WRITE8_MEMBER( soundlatch_byte_w );
|
||||
DECLARE_WRITE8_MEMBER( soundlatch2_byte_w );
|
||||
DECLARE_WRITE8_MEMBER( soundlatch3_byte_w );
|
||||
@ -254,6 +257,7 @@ public:
|
||||
DECLARE_WRITE16_MEMBER( soundlatch4_word_w );
|
||||
|
||||
// sound latch clearers
|
||||
void soundlatch_clear(UINT8 index = 0);
|
||||
DECLARE_WRITE8_MEMBER( soundlatch_clear_byte_w );
|
||||
DECLARE_WRITE8_MEMBER( soundlatch2_clear_byte_w );
|
||||
DECLARE_WRITE8_MEMBER( soundlatch3_clear_byte_w );
|
||||
|
@ -120,6 +120,90 @@ struct game_driver
|
||||
#define GAME_NAME(name) driver_##name
|
||||
#define GAME_EXTERN(name) extern const game_driver GAME_NAME(name)
|
||||
|
||||
#ifdef MODERN_DRIVER_INIT
|
||||
|
||||
// standard GAME() macro
|
||||
#define GAME(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS) \
|
||||
GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,((const char *)0))
|
||||
|
||||
// standard macro with additional layout
|
||||
#define GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,LAYOUT) \
|
||||
extern const game_driver GAME_NAME(NAME) = \
|
||||
{ \
|
||||
__FILE__, \
|
||||
#PARENT, \
|
||||
#NAME, \
|
||||
FULLNAME, \
|
||||
#YEAR, \
|
||||
COMPANY, \
|
||||
MACHINE_CONFIG_NAME(MACHINE), \
|
||||
INPUT_PORTS_NAME(INPUT), \
|
||||
&driver_device::driver_init_wrapper<CLASS, &CLASS::INIT>, \
|
||||
ROM_NAME(NAME), \
|
||||
NULL, \
|
||||
(MONITOR)|(FLAGS)|GAME_TYPE_ARCADE, \
|
||||
&LAYOUT[0] \
|
||||
};
|
||||
|
||||
// standard console definition macro
|
||||
#define CONS(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
||||
extern const game_driver GAME_NAME(NAME) = \
|
||||
{ \
|
||||
__FILE__, \
|
||||
#PARENT, \
|
||||
#NAME, \
|
||||
FULLNAME, \
|
||||
#YEAR, \
|
||||
COMPANY, \
|
||||
MACHINE_CONFIG_NAME(MACHINE), \
|
||||
INPUT_PORTS_NAME(INPUT), \
|
||||
&driver_device::driver_init_wrapper<CLASS, &CLASS::INIT>, \
|
||||
ROM_NAME(NAME), \
|
||||
#COMPAT, \
|
||||
ROT0|(FLAGS)|GAME_TYPE_CONSOLE, \
|
||||
NULL \
|
||||
};
|
||||
|
||||
// standard computer definition macro
|
||||
#define COMP(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
||||
extern const game_driver GAME_NAME(NAME) = \
|
||||
{ \
|
||||
__FILE__, \
|
||||
#PARENT, \
|
||||
#NAME, \
|
||||
FULLNAME, \
|
||||
#YEAR, \
|
||||
COMPANY, \
|
||||
MACHINE_CONFIG_NAME(MACHINE), \
|
||||
INPUT_PORTS_NAME(INPUT), \
|
||||
&driver_device::driver_init_wrapper<CLASS, &CLASS::INIT>, \
|
||||
ROM_NAME(NAME), \
|
||||
#COMPAT, \
|
||||
ROT0|(FLAGS)|GAME_TYPE_COMPUTER, \
|
||||
NULL \
|
||||
};
|
||||
|
||||
// standard system definition macro
|
||||
#define SYST(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
||||
extern const game_driver GAME_NAME(NAME) = \
|
||||
{ \
|
||||
__FILE__, \
|
||||
#PARENT, \
|
||||
#NAME, \
|
||||
FULLNAME, \
|
||||
#YEAR, \
|
||||
COMPANY, \
|
||||
MACHINE_CONFIG_NAME(MACHINE), \
|
||||
INPUT_PORTS_NAME(INPUT), \
|
||||
&driver_device::driver_init_wrapper<CLASS, &CLASS::INIT>, \
|
||||
ROM_NAME(NAME), \
|
||||
#COMPAT, \
|
||||
ROT0|(FLAGS)|GAME_TYPE_OTHER, \
|
||||
NULL \
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
// standard GAME() macro
|
||||
#define GAME(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS) \
|
||||
GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,((const char *)0))
|
||||
@ -200,6 +284,7 @@ extern const game_driver GAME_NAME(NAME) = \
|
||||
NULL \
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
|
@ -1031,10 +1031,11 @@ astring &game_info_astring(running_machine &machine, astring &string)
|
||||
|
||||
/* count how many identical CPUs we have */
|
||||
int count = 1;
|
||||
const char *name = exec->device().name();
|
||||
execute_interface_iterator execinneriter(machine.root_device());
|
||||
for (device_execute_interface *scan = execinneriter.first(); scan != NULL; scan = execinneriter.next())
|
||||
{
|
||||
if (exec->device().type() == scan->device().type() && exec->device().clock() == scan->device().clock())
|
||||
if (exec->device().type() == scan->device().type() && strcmp(name, scan->device().name()) == 0 && exec->device().clock() == scan->device().clock())
|
||||
if (exectags.add(scan->device().tag(), 1, FALSE) != TMERR_DUPLICATE)
|
||||
count++;
|
||||
}
|
||||
@ -1042,7 +1043,7 @@ astring &game_info_astring(running_machine &machine, astring &string)
|
||||
/* if more than one, prepend a #x in front of the CPU name */
|
||||
if (count > 1)
|
||||
string.catprintf("%d" UTF8_MULTIPLY, count);
|
||||
string.cat(exec->device().name());
|
||||
string.cat(name);
|
||||
|
||||
/* display clock in kHz or MHz */
|
||||
if (clock >= 1000000)
|
||||
|
@ -2,7 +2,38 @@
|
||||
|
||||
Atari "Stella on Steroids" hardware
|
||||
|
||||
driver by Aaron Giles
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Games supported:
|
||||
* BeatHead
|
||||
|
@ -2,6 +2,37 @@
|
||||
|
||||
Sega Hang On hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Known bugs:
|
||||
@ -14,17 +45,13 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/mcs51/mcs51.h"
|
||||
#include "includes/segas16.h"
|
||||
#include "machine/segaic16.h"
|
||||
#include "machine/fd1089.h"
|
||||
#include "machine/8255ppi.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/fd1094.h"
|
||||
#include "sound/2203intf.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/segapcm.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segaipt.h"
|
||||
|
||||
|
||||
@ -92,25 +119,18 @@ static const ppi8255_interface hangon_ppi_intf[2] =
|
||||
|
||||
static void hangon_generic_init( running_machine &machine )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segahang_state *state = machine.driver_data<segahang_state>();
|
||||
|
||||
/* reset the custom handlers and other pointers */
|
||||
state->m_i8751_vblank_hook = NULL;
|
||||
|
||||
state->m_maincpu = machine.device("maincpu");
|
||||
state->m_soundcpu = machine.device("soundcpu");
|
||||
state->m_subcpu = machine.device("sub");
|
||||
state->m_mcu = machine.device("mcu");
|
||||
state->m_ppi8255_1 = machine.device("ppi8255_1");
|
||||
state->m_ppi8255_2 = machine.device("ppi8255_2");
|
||||
|
||||
state->save_item(NAME(state->m_adc_select));
|
||||
}
|
||||
|
||||
|
||||
static TIMER_CALLBACK( suspend_i8751 )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segahang_state *state = machine.driver_data<segahang_state>();
|
||||
device_suspend(state->m_mcu, SUSPEND_REASON_DISABLE, 1);
|
||||
}
|
||||
|
||||
@ -124,9 +144,7 @@ static TIMER_CALLBACK( suspend_i8751 )
|
||||
|
||||
static MACHINE_RESET( hangon )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
|
||||
fd1094_machine_init(machine.device("sub"));
|
||||
segahang_state *state = machine.driver_data<segahang_state>();
|
||||
|
||||
/* reset misc components */
|
||||
segaic16_tilemap_reset(machine, 0);
|
||||
@ -142,7 +160,7 @@ static MACHINE_RESET( hangon )
|
||||
#if 0
|
||||
static TIMER_DEVICE_CALLBACK( hangon_irq )
|
||||
{
|
||||
segas1x_state *state = timer.machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = timer.machine().driver_data<segahang_state>();
|
||||
int scanline = param;
|
||||
|
||||
/* according to the schematics, IRQ2 is generated every 16 scanlines */
|
||||
@ -163,14 +181,14 @@ static TIMER_DEVICE_CALLBACK( hangon_irq )
|
||||
|
||||
static TIMER_CALLBACK( delayed_ppi8255_w )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segahang_state *state = machine.driver_data<segahang_state>();
|
||||
ppi8255_w(state->m_ppi8255_1, param >> 8, param & 0xff);
|
||||
}
|
||||
|
||||
|
||||
static READ16_HANDLER( hangon_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = space->machine().driver_data<segahang_state>();
|
||||
|
||||
switch (offset & 0x3020/2)
|
||||
{
|
||||
@ -200,7 +218,7 @@ static READ16_HANDLER( hangon_io_r )
|
||||
|
||||
static WRITE16_HANDLER( hangon_io_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = space->machine().driver_data<segahang_state>();
|
||||
|
||||
if (ACCESSING_BITS_0_7)
|
||||
switch (offset & 0x3020/2)
|
||||
@ -225,7 +243,7 @@ static WRITE16_HANDLER( hangon_io_w )
|
||||
|
||||
static READ16_HANDLER( sharrier_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = space->machine().driver_data<segahang_state>();
|
||||
|
||||
switch (offset & 0x0030/2)
|
||||
{
|
||||
@ -256,7 +274,7 @@ static READ16_HANDLER( sharrier_io_r )
|
||||
|
||||
static WRITE16_HANDLER( sharrier_io_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = space->machine().driver_data<segahang_state>();
|
||||
|
||||
if (ACCESSING_BITS_0_7)
|
||||
switch (offset & 0x0030/2)
|
||||
@ -288,7 +306,7 @@ static WRITE16_HANDLER( sharrier_io_w )
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( sound_latch_w )
|
||||
{
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = device->machine().driver_data<segahang_state>();
|
||||
address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
|
||||
state->soundlatch_byte_w(*space, offset, data);
|
||||
}
|
||||
@ -317,7 +335,7 @@ static WRITE8_DEVICE_HANDLER( video_lamps_w )
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
|
||||
{
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = device->machine().driver_data<segahang_state>();
|
||||
|
||||
/* Port C : Tilemap origin and audio mute */
|
||||
/* D7 : Port A handshaking signal /OBF */
|
||||
@ -337,7 +355,7 @@ static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( sub_control_adc_w )
|
||||
{
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = device->machine().driver_data<segahang_state>();
|
||||
|
||||
/* Port A : S.CPU control and ADC channel select */
|
||||
/* D6 : INTR line on second CPU */
|
||||
@ -346,12 +364,6 @@ static WRITE8_DEVICE_HANDLER( sub_control_adc_w )
|
||||
device_set_input_line(state->m_subcpu, 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
device_set_input_line(state->m_subcpu, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* If the CPU is being Reset we also need to reset the fd1094 state */
|
||||
if (data & 0x20)
|
||||
{
|
||||
fd1094_machine_init(state->m_subcpu);
|
||||
}
|
||||
|
||||
state->m_adc_select = (data >> 2) & 3;
|
||||
}
|
||||
|
||||
@ -375,7 +387,7 @@ static READ8_DEVICE_HANDLER( adc_status_r )
|
||||
|
||||
static INTERRUPT_GEN( i8751_main_cpu_vblank )
|
||||
{
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = device->machine().driver_data<segahang_state>();
|
||||
|
||||
/* if we have a fake 8751 handler, call it on VBLANK */
|
||||
if (state->m_i8751_vblank_hook != NULL)
|
||||
@ -406,14 +418,14 @@ static void sharrier_i8751_sim(running_machine &machine)
|
||||
|
||||
static void sound_irq(device_t *device, int irq)
|
||||
{
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = device->machine().driver_data<segahang_state>();
|
||||
device_set_input_line(state->m_soundcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
static READ8_HANDLER( sound_data_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segahang_state *state = space->machine().driver_data<segahang_state>();
|
||||
|
||||
/* assert ACK */
|
||||
ppi8255_set_port_c(state->m_ppi8255_1, 0x00);
|
||||
@ -428,7 +440,7 @@ static READ8_HANDLER( sound_data_r )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( hangon_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( hangon_map, AS_PROGRAM, 16, segahang_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
AM_RANGE(0x20c000, 0x20ffff) AM_RAM
|
||||
@ -436,13 +448,13 @@ static ADDRESS_MAP_START( hangon_map, AS_PROGRAM, 16, segas1x_state )
|
||||
AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE_LEGACY(segaic16_textram_0_w) AM_BASE_LEGACY(&segaic16_textram_0)
|
||||
AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_BASE_LEGACY(&segaic16_spriteram_0)
|
||||
AM_RANGE(0xa00000, 0xa00fff) AM_RAM_WRITE_LEGACY(segaic16_paletteram_w) AM_BASE_LEGACY(&segaic16_paletteram)
|
||||
AM_RANGE(0xc00000, 0xc3ffff) AM_ROM AM_REGION("sub", 0)
|
||||
AM_RANGE(0xc00000, 0xc3ffff) AM_ROM AM_REGION("subcpu", 0)
|
||||
AM_RANGE(0xc68000, 0xc68fff) AM_RAM AM_SHARE("share1") AM_BASE_LEGACY(&segaic16_roadram_0)
|
||||
AM_RANGE(0xc7c000, 0xc7ffff) AM_RAM AM_SHARE("share2")
|
||||
AM_RANGE(0xe00000, 0xffffff) AM_READWRITE_LEGACY(hangon_io_r, hangon_io_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sharrier_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( sharrier_map, AS_PROGRAM, 16, segahang_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
AM_RANGE(0x040000, 0x043fff) AM_RAM AM_BASE_LEGACY(&workram)
|
||||
@ -464,7 +476,7 @@ ADDRESS_MAP_END
|
||||
*************************************/
|
||||
|
||||
/* On Super Hang On there is a memory mapper, like the System16 one, todo: emulate it! */
|
||||
static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 16, segahang_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0x7ffff)
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
@ -480,7 +492,7 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( sound_map_2203, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_map_2203, AS_PROGRAM, 8, segahang_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x0800) AM_RAM
|
||||
@ -488,28 +500,28 @@ static ADDRESS_MAP_START( sound_map_2203, AS_PROGRAM, 8, segas1x_state )
|
||||
AM_RANGE(0xe000, 0xe0ff) AM_MIRROR(0x0f00) AM_DEVREADWRITE_LEGACY("pcm", sega_pcm_r, sega_pcm_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_portmap_2203, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_portmap_2203, AS_IO, 8, segahang_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_READ_LEGACY(sound_data_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( sound_map_2151, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_map_2151, AS_PROGRAM, 8, segahang_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0xf000, 0xf0ff) AM_MIRROR(0x700) AM_DEVREADWRITE_LEGACY("pcm", sega_pcm_r, sega_pcm_w)
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_portmap_2151, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_portmap_2151, AS_IO, 8, segahang_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_READ_LEGACY(sound_data_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_portmap_2203x2, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_portmap_2203x2, AS_IO, 8, segahang_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w)
|
||||
@ -525,7 +537,7 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, segahang_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -819,14 +831,14 @@ GFXDECODE_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static MACHINE_CONFIG_START( hangon_base, segas1x_state )
|
||||
static MACHINE_CONFIG_START( hangon_base, segahang_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK_25MHz/4)
|
||||
MCFG_CPU_PROGRAM_MAP(hangon_map)
|
||||
MCFG_CPU_VBLANK_INT("screen", irq4_line_hold)
|
||||
|
||||
MCFG_CPU_ADD("sub", M68000, MASTER_CLOCK_25MHz/4)
|
||||
MCFG_CPU_ADD("subcpu", M68000, MASTER_CLOCK_25MHz/4)
|
||||
MCFG_CPU_PROGRAM_MAP(sub_map)
|
||||
|
||||
MCFG_MACHINE_RESET(hangon)
|
||||
@ -855,7 +867,7 @@ static MACHINE_CONFIG_DERIVED( sharrier_base, hangon_base )
|
||||
MCFG_CPU_PROGRAM_MAP(sharrier_map)
|
||||
MCFG_CPU_VBLANK_INT("screen", i8751_main_cpu_vblank)
|
||||
|
||||
MCFG_CPU_MODIFY("sub")
|
||||
MCFG_CPU_MODIFY("subcpu")
|
||||
MCFG_CPU_CLOCK(MASTER_CLOCK_10MHz)
|
||||
|
||||
/* video hardware */
|
||||
@ -863,6 +875,15 @@ static MACHINE_CONFIG_DERIVED( sharrier_base, hangon_base )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( enduror_base, sharrier_base )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_REPLACE("maincpu", FD1089B, MASTER_CLOCK_10MHz)
|
||||
MCFG_CPU_PROGRAM_MAP(sharrier_map)
|
||||
MCFG_CPU_VBLANK_INT("screen", i8751_main_cpu_vblank)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( sound_board_2203 )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -971,13 +992,19 @@ static MACHINE_CONFIG_DERIVED( shangupb, hangon_base )
|
||||
/* not sure about these speeds, but at 6MHz, the road is not updated fast enough */
|
||||
MCFG_CPU_MODIFY("maincpu")
|
||||
MCFG_CPU_CLOCK(10000000)
|
||||
MCFG_CPU_MODIFY("sub")
|
||||
MCFG_CPU_MODIFY("subcpu")
|
||||
MCFG_CPU_CLOCK(10000000)
|
||||
|
||||
MCFG_SEGA16SP_ADD_HANGON("segaspr1")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( shangonro, shangupb )
|
||||
MCFG_CPU_REPLACE("subcpu", FD1094, 10000000)
|
||||
MCFG_CPU_PROGRAM_MAP(sub_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( sharrier, sharrier_base )
|
||||
MCFG_FRAGMENT_ADD(sound_board_2203)
|
||||
|
||||
@ -989,14 +1016,21 @@ static MACHINE_CONFIG_DERIVED( sharrier, sharrier_base )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( enduror, sharrier_base )
|
||||
static MACHINE_CONFIG_DERIVED( enduror, enduror_base )
|
||||
MCFG_FRAGMENT_ADD(sound_board_2151)
|
||||
|
||||
MCFG_SEGA16SP_ADD_SHARRIER("segaspr1")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( enduror1, sharrier_base )
|
||||
static MACHINE_CONFIG_DERIVED( enduror1, enduror_base )
|
||||
MCFG_FRAGMENT_ADD(sound_board_2203)
|
||||
|
||||
MCFG_SEGA16SP_ADD_SHARRIER("segaspr1")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( endurobl, sharrier_base )
|
||||
MCFG_FRAGMENT_ADD(sound_board_2203)
|
||||
|
||||
MCFG_SEGA16SP_ADD_SHARRIER("segaspr1")
|
||||
@ -1036,7 +1070,7 @@ ROM_START( hangon )
|
||||
ROM_LOAD16_BYTE( "epr-6917a.ic20", 0x010000, 0x8000, CRC(fea12367) SHA1(9a1ce5863c562160b657ad948812b43f42d7d0cc) )
|
||||
ROM_LOAD16_BYTE( "epr-6915a.ic6", 0x010001, 0x8000, CRC(ac883240) SHA1(f943341ae13e062f3d12c6221180086ce8bdb8c4) )
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE( "epr-6920.ic63", 0x0000, 0x8000, CRC(1c95013e) SHA1(8344ac953477279c2c701f984d98292a21dd2f7d) )
|
||||
ROM_LOAD16_BYTE( "epr-6919.ic51", 0x0001, 0x8000, CRC(6ca30d69) SHA1(ed933351883ebf6d9ef9428a81d09749b609cd60) )
|
||||
|
||||
@ -1095,7 +1129,7 @@ ROM_START( hangon1 )
|
||||
ROM_LOAD16_BYTE( "epr-6917.ic20", 0x010000, 0x8000, CRC(f48a6cbc) SHA1(6437efaeb0e4cb727c03eb83678a9e107d244af1) )
|
||||
ROM_LOAD16_BYTE( "epr-6915.ic6", 0x010001, 0x8000, CRC(75d3b5ee) SHA1(00948d0610f52b1b554cadde96227428e510e73e) )
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE( "epr-6920.ic63", 0x0000, 0x8000, CRC(1c95013e) SHA1(8344ac953477279c2c701f984d98292a21dd2f7d) )
|
||||
ROM_LOAD16_BYTE( "epr-6919.ic51", 0x0001, 0x8000, CRC(6ca30d69) SHA1(ed933351883ebf6d9ef9428a81d09749b609cd60) )
|
||||
|
||||
@ -1159,15 +1193,15 @@ ROM_START( shangonro )
|
||||
ROM_LOAD16_BYTE( "epr-10840.18", 0x20000, 0x08000, CRC(12ee8716) SHA1(8e798d23d22f85cd046641184d104c17b27995b2) )
|
||||
ROM_LOAD16_BYTE( "epr-10837.4", 0x20001, 0x08000, CRC(155e0cfd) SHA1(e51734351c887fe3920c881f57abdfbb7d075f57) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* FD1094 decryption key */
|
||||
ROM_LOAD( "317-0038.key", 0x0000, 0x2000, CRC(85943925) SHA1(76303b0aa79ca9d4a8d10d4e63ee2efe756a0a00) )
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU (encrypted FD1094) */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU (encrypted FD1094) */
|
||||
ROM_LOAD16_BYTE( "epr-10833.31", 0x000001, 0x10000, CRC(13ba98bc) SHA1(83710a7bb9d038f8663e6d42b184d4e4d937a26f) )
|
||||
ROM_LOAD16_BYTE( "epr-10831.25", 0x000000, 0x10000, CRC(3a2de9eb) SHA1(20da548cd1fb466942ee45306cfd04766e5a4f50) )
|
||||
ROM_LOAD16_BYTE( "epr-10832.30", 0x020001, 0x10000, CRC(543cd7bb) SHA1(124b426adc2d8dc51172ef94cb215bde3b8b42a7) )
|
||||
ROM_LOAD16_BYTE( "epr-10830.24", 0x020000, 0x10000, CRC(2ae4e53a) SHA1(b15b5a8b36cbe5fe68b5e18ab3398ebc7214dbee) )
|
||||
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* FD1094 decryption key */
|
||||
ROM_LOAD( "317-0038.key", 0x0000, 0x2000, CRC(85943925) SHA1(76303b0aa79ca9d4a8d10d4e63ee2efe756a0a00) )
|
||||
|
||||
ROM_REGION( 0x18000, "gfx1", 0 ) /* tiles */
|
||||
ROM_LOAD( "epr-10652.38", 0x00000, 0x08000, CRC(260286f9) SHA1(dc7c8d2c6ef924a937328685eed19bda1c8b1819) )
|
||||
ROM_LOAD( "epr-10651.23", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
|
||||
@ -1215,7 +1249,7 @@ ROM_START( shangonrb )
|
||||
ROM_LOAD16_BYTE( "s-hangon.29", 0x020000, 0x08000, CRC(12ee8716) SHA1(8e798d23d22f85cd046641184d104c17b27995b2) ) /* Same as EPR-10840 above */
|
||||
ROM_LOAD16_BYTE( "s-hangon.31", 0x020001, 0x08000, CRC(155e0cfd) SHA1(e51734351c887fe3920c881f57abdfbb7d075f57) ) /* Same as EPR-10837 above */
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE( "s-hangon.09", 0x00000, 0x10000, CRC(070c8059) SHA1(a18c5e9473b6634f6e7165300e39029335b41ba3) )
|
||||
ROM_LOAD16_BYTE( "s-hangon.05", 0x00001, 0x10000, CRC(9916c54b) SHA1(41a7c5a9bdb1e3feae8fadf1ac5f51fab6376157) )
|
||||
ROM_LOAD16_BYTE( "s-hangon.08", 0x20000, 0x10000, CRC(000ad595) SHA1(eb80e798159c09bc5142a7ea8b9b0f895976b0d4) )
|
||||
@ -1278,7 +1312,7 @@ ROM_START( sharrier )
|
||||
ROM_LOAD16_BYTE( "epr-7191.ic100", 0x030000, 0x8000, CRC(6171e9d3) SHA1(72f8736f421dc93139859fd47f0c8c3c32b6ff0b) )
|
||||
ROM_LOAD16_BYTE( "epr-7187.ic87", 0x030001, 0x8000, CRC(70cb72ef) SHA1(d1d89bd133b6905f81c25513d852b7e3a05a7312) )
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE( "epr-7182.ic54", 0x0000, 0x8000, CRC(d7c535b6) SHA1(c0659a678c0c3776387a4a675016e9a2e9c67ee3) )
|
||||
ROM_LOAD16_BYTE( "epr-7183.ic67", 0x0001, 0x8000, CRC(a6153af8) SHA1(b56ba472e4afb474c7a3f7dc11d7428ebbe1a9c7) )
|
||||
|
||||
@ -1358,7 +1392,7 @@ ROM_START( sharrier1 )
|
||||
ROM_LOAD16_BYTE( "epr-7191.ic100", 0x030000, 0x8000, CRC(6171e9d3) SHA1(72f8736f421dc93139859fd47f0c8c3c32b6ff0b) )
|
||||
ROM_LOAD16_BYTE( "epr-7187.ic87", 0x030001, 0x8000, CRC(70cb72ef) SHA1(d1d89bd133b6905f81c25513d852b7e3a05a7312) )
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE( "epr-7182.ic54", 0x0000, 0x8000, CRC(d7c535b6) SHA1(c0659a678c0c3776387a4a675016e9a2e9c67ee3) )
|
||||
ROM_LOAD16_BYTE( "epr-7183.ic67", 0x0001, 0x8000, CRC(a6153af8) SHA1(b56ba472e4afb474c7a3f7dc11d7428ebbe1a9c7) )
|
||||
|
||||
@ -1441,7 +1475,7 @@ ROM_START( enduror )
|
||||
ROM_LOAD16_BYTE( "epr-7642.ic99", 0x20000, 0x8000, CRC(1c453bea) SHA1(c6e606cdcb1690de05ef5283b48a8a61b2e0ad51) )
|
||||
ROM_LOAD16_BYTE( "epr-7638.ic86", 0x20001, 0x8000, CRC(70544779) SHA1(e6403edd7fc0ad5d447c25be5d7f10889aa109ff) )
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE("epr-7634a.ic54", 0x0000, 0x8000, CRC(aec83731) SHA1(3fe2d0f1a8806b850836741d664c07754a701459) )
|
||||
ROM_LOAD16_BYTE("epr-7635a.ic67", 0x0001, 0x8000, CRC(b2fce96f) SHA1(9d6c1a7c2bdbf86430b849a5f6c6fdb5595dc91c) )
|
||||
|
||||
@ -1497,7 +1531,7 @@ ROM_START( enduror )
|
||||
ROM_REGION( 0x2000, "proms", 0 ) /* zoom table */
|
||||
ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0013a.key", 0x0000, 0x2000, CRC(295e6737) SHA1(2eff36f1f24db1154cf970d4c9fd481ae4f9a57c) )
|
||||
ROM_END
|
||||
|
||||
@ -1520,7 +1554,7 @@ ROM_START( enduror1 )
|
||||
ROM_LOAD16_BYTE( "epr-7642.ic99", 0x20000, 0x8000, CRC(1c453bea) SHA1(c6e606cdcb1690de05ef5283b48a8a61b2e0ad51) )
|
||||
ROM_LOAD16_BYTE( "epr-7638.ic86", 0x20001, 0x8000, CRC(70544779) SHA1(e6403edd7fc0ad5d447c25be5d7f10889aa109ff) )
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE("epr-7634.ic54", 0x0000, 0x8000, CRC(3e07fd32) SHA1(7acb9e9712ecfe928c421c84dece783e75077746) )
|
||||
ROM_LOAD16_BYTE("epr-7635.ic67", 0x0001, 0x8000, CRC(22f762ab) SHA1(70fa87da76c714db7213c42128a0b6a27644a1d4) )
|
||||
|
||||
@ -1577,7 +1611,7 @@ ROM_START( enduror1 )
|
||||
ROM_REGION( 0x2000, "proms", 0 ) /* zoom table */
|
||||
ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0013a.key", 0x0000, 0x2000, CRC(295e6737) SHA1(2eff36f1f24db1154cf970d4c9fd481ae4f9a57c) )
|
||||
ROM_END
|
||||
|
||||
@ -1597,7 +1631,7 @@ ROM_START( endurobl )
|
||||
ROM_LOAD16_BYTE( "9.15j", 0x020000, 0x08000, CRC(db3bff1c) SHA1(343ed27a690800683cdd5128dcdb28c7b45288a3) ) /* one byte difference from */
|
||||
ROM_LOAD16_BYTE( "6.15h", 0x020001, 0x08000, CRC(54b1885a) SHA1(f53d906390e5414e73c4cdcbc102d3cb3e719e67) ) /* epr-7638.ic86 / epr-7642.ic99 */
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE("epr-7634.ic54", 0x0000, 0x8000, CRC(3e07fd32) SHA1(7acb9e9712ecfe928c421c84dece783e75077746) )
|
||||
ROM_LOAD16_BYTE("epr-7635.ic67", 0x0001, 0x8000, CRC(22f762ab) SHA1(70fa87da76c714db7213c42128a0b6a27644a1d4) )
|
||||
|
||||
@ -1672,7 +1706,7 @@ ROM_START( endurob2 )
|
||||
ROM_LOAD16_BYTE( "enduro.a09", 0x020000, 0x08000, CRC(f6391091) SHA1(3160b342b6447cccf67c932c7c1a42354cdfb058) )
|
||||
ROM_LOAD16_BYTE( "enduro.a06", 0x020001, 0x08000, CRC(79b367d7) SHA1(e901036b1b9fac460415d513837c8f852f7750b0) )
|
||||
|
||||
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
|
||||
ROM_REGION( 0x40000, "subcpu", 0 ) /* second 68000 CPU */
|
||||
ROM_LOAD16_BYTE("epr-7634.ic54", 0x0000, 0x8000, CRC(3e07fd32) SHA1(7acb9e9712ecfe928c421c84dece783e75077746) )
|
||||
ROM_LOAD16_BYTE("epr-7635.ic67", 0x0001, 0x8000, CRC(22f762ab) SHA1(70fa87da76c714db7213c42128a0b6a27644a1d4) )
|
||||
|
||||
@ -1745,7 +1779,7 @@ static DRIVER_INIT( hangon )
|
||||
|
||||
static DRIVER_INIT( sharrier )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segahang_state *state = machine.driver_data<segahang_state>();
|
||||
|
||||
hangon_generic_init(machine);
|
||||
state->m_i8751_vblank_hook = sharrier_i8751_sim;
|
||||
@ -1755,7 +1789,6 @@ static DRIVER_INIT( sharrier )
|
||||
static DRIVER_INIT( enduror )
|
||||
{
|
||||
hangon_generic_init(machine);
|
||||
fd1089b_decrypt(machine);
|
||||
}
|
||||
|
||||
|
||||
@ -1789,9 +1822,6 @@ static DRIVER_INIT( endurob2 )
|
||||
static DRIVER_INIT( shangonro )
|
||||
{
|
||||
hangon_generic_init(machine);
|
||||
|
||||
/* init the FD1094 */
|
||||
fd1094_driver_init(machine, "sub", NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -1804,12 +1834,12 @@ static DRIVER_INIT( shangonro )
|
||||
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
|
||||
GAME( 1985, hangon, 0, hangon, hangon, hangon, ROT0, "Sega", "Hang-On (Rev A)", 0 )
|
||||
GAME( 1985, hangon1, hangon, hangon, hangon, hangon, ROT0, "Sega", "Hang-On", 0 )
|
||||
GAME( 1987, shangonro, shangon, shangupb, shangonro, shangonro, ROT0, "Sega", "Super Hang-On (ride-on, Japan, FD1094 317-0038)", 0 )
|
||||
GAME( 1987, shangonro, shangon, shangonro,shangonro, shangonro, ROT0, "Sega", "Super Hang-On (ride-on, Japan, FD1094 317-0038)", 0 )
|
||||
GAME( 1992, shangonrb, shangon, shangupb, shangupb, hangon, ROT0, "bootleg", "Super Hang-On (bootleg)", 0 )
|
||||
GAME( 1985, sharrier, 0, sharrier, sharrier, sharrier, ROT0, "Sega", "Space Harrier (Rev A, 8751 315-5163A)", 0 )
|
||||
GAME( 1985, sharrier1, sharrier, sharrier, sharrier, sharrier, ROT0, "Sega", "Space Harrier (8751 315-5163)", 0 )
|
||||
GAME( 1986, enduror, 0, enduror, enduror, enduror, ROT0, "Sega", "Enduro Racer (YM2151, FD1089B 317-0013A)", 0 )
|
||||
GAME( 1986, enduror1, enduror, enduror1, enduror, enduror, ROT0, "Sega", "Enduro Racer (YM2203, FD1089B 317-0013A)", 0 )
|
||||
GAME( 1986, endurobl, enduror, enduror1, enduror, endurobl, ROT0, "bootleg", "Enduro Racer (bootleg set 1)", 0 )
|
||||
GAME( 1986, endurobl, enduror, endurobl, enduror, endurobl, ROT0, "bootleg", "Enduro Racer (bootleg set 1)", 0 )
|
||||
GAME( 1986, endurob2, enduror, endurob2, enduror, endurob2, ROT0, "bootleg", "Enduro Racer (bootleg set 2)", GAME_NOT_WORKING )
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,37 @@
|
||||
|
||||
Sega pre-System 16 & System 16A hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Known bugs:
|
||||
@ -144,19 +175,10 @@ Tetris - - - - EPR12169 EPR12170 -
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/mcs51/mcs51.h"
|
||||
#include "includes/segas16.h"
|
||||
#include "machine/8255ppi.h"
|
||||
#include "machine/segacrp2.h"
|
||||
#include "machine/fd1089.h"
|
||||
#include "machine/i8243.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
#include "sound/dac.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segaipt.h"
|
||||
|
||||
|
||||
@ -209,29 +231,19 @@ static const ppi8255_interface single_ppi_intf =
|
||||
|
||||
static void system16a_generic_init(running_machine &machine)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
|
||||
/* init the FD1094 */
|
||||
fd1094_driver_init(machine, "maincpu", NULL);
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
/* reset the custom handlers and other pointers */
|
||||
state->m_custom_io_r = NULL;
|
||||
state->m_custom_io_w = NULL;
|
||||
state->m_lamp_changed_w = NULL;
|
||||
state->m_i8751_vblank_hook = NULL;
|
||||
|
||||
state->m_maincpu = machine.device("maincpu");
|
||||
state->m_soundcpu = machine.device("soundcpu");
|
||||
state->m_mcu = machine.device("mcu");
|
||||
state->m_ymsnd = machine.device("ymsnd");
|
||||
state->m_ppi8255 = machine.device("ppi8255");
|
||||
state->m_n7751 = machine.device("n7751");
|
||||
}
|
||||
|
||||
|
||||
static TIMER_CALLBACK( suspend_i8751 )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
device_suspend(state->m_mcu, SUSPEND_REASON_DISABLE, 1);
|
||||
}
|
||||
|
||||
@ -245,7 +257,7 @@ static TIMER_CALLBACK( suspend_i8751 )
|
||||
|
||||
static MACHINE_START( system16a )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
state->save_item(NAME(state->m_video_control));
|
||||
state->save_item(NAME(state->m_mcu_control));
|
||||
@ -260,9 +272,7 @@ static MACHINE_START( system16a )
|
||||
|
||||
static MACHINE_RESET( system16a )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
|
||||
fd1094_machine_init(machine.device("maincpu"));
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
/* if we have a fake i8751 handler, disable the actual 8751 */
|
||||
if (state->m_i8751_vblank_hook != NULL)
|
||||
@ -281,14 +291,14 @@ static MACHINE_RESET( system16a )
|
||||
|
||||
static TIMER_CALLBACK( delayed_ppi8255_w )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
ppi8255_w(state->m_ppi8255, param >> 8, param & 0xff);
|
||||
}
|
||||
|
||||
|
||||
static READ16_HANDLER( standard_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
offset &= 0x3fff/2;
|
||||
switch (offset & (0x3000/2))
|
||||
{
|
||||
@ -327,7 +337,7 @@ static WRITE16_HANDLER( standard_io_w )
|
||||
|
||||
static READ16_HANDLER( misc_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
if (state->m_custom_io_r)
|
||||
return (*state->m_custom_io_r)(space, offset, mem_mask);
|
||||
@ -338,7 +348,7 @@ static READ16_HANDLER( misc_io_r )
|
||||
|
||||
static WRITE16_HANDLER( misc_io_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
if (state->m_custom_io_w)
|
||||
(*state->m_custom_io_w)(space, offset, data, mem_mask);
|
||||
@ -369,7 +379,7 @@ static WRITE8_DEVICE_HANDLER( video_control_w )
|
||||
D0 : Coin meter #1
|
||||
*/
|
||||
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = device->machine().driver_data<segas16a_state>();
|
||||
|
||||
if (((state->m_video_control ^ data) & 0x0c) && state->m_lamp_changed_w)
|
||||
(*state->m_lamp_changed_w)(device->machine(), state->m_video_control ^ data, data);
|
||||
@ -412,7 +422,7 @@ static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
|
||||
0= Sound is disabled
|
||||
1= sound is enabled
|
||||
*/
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = device->machine().driver_data<segas16a_state>();
|
||||
|
||||
device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
|
||||
segaic16_tilemap_set_colscroll(device->machine(), 0, ~data & 0x04);
|
||||
@ -429,7 +439,7 @@ static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
|
||||
|
||||
static READ8_HANDLER( sound_data_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
/* assert ACK */
|
||||
ppi8255_set_port_c(state->m_ppi8255, 0x00);
|
||||
@ -449,7 +459,7 @@ static WRITE8_HANDLER( n7751_command_w )
|
||||
D1 = /CS for ROM 0
|
||||
D0 = A14 line to ROMs
|
||||
*/
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
int numroms = state->memregion("n7751data")->bytes() / 0x8000;
|
||||
state->m_n7751_rom_address &= 0x3fff;
|
||||
@ -470,7 +480,7 @@ static WRITE8_DEVICE_HANDLER( n7751_control_w )
|
||||
D1 = /RESET line on 7751
|
||||
D0 = /IRQ line on 7751
|
||||
*/
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = device->machine().driver_data<segas16a_state>();
|
||||
|
||||
device_set_input_line(state->m_n7751, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
|
||||
device_set_input_line(state->m_n7751, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
|
||||
@ -484,7 +494,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_offset_w )
|
||||
/* P5 - address lines 4-7 */
|
||||
/* P6 - address lines 8-11 */
|
||||
/* P7 - address lines 12-13 */
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = device->machine().driver_data<segas16a_state>();
|
||||
|
||||
int mask = (0xf << (4 * offset)) & 0x3fff;
|
||||
int newdata = (data << (4 * offset)) & mask;
|
||||
@ -495,7 +505,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_offset_w )
|
||||
static READ8_HANDLER( n7751_rom_r )
|
||||
{
|
||||
/* read from BUS */
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
return state->memregion("n7751data")->base()[state->m_n7751_rom_address];
|
||||
}
|
||||
|
||||
@ -504,7 +514,7 @@ static READ8_DEVICE_HANDLER( n7751_p2_r )
|
||||
{
|
||||
/* read from P2 - 8255's PC0-2 connects to 7751's S0-2 (P24-P26 on an 8048) */
|
||||
/* bit 0x80 is an alternate way to control the sample on/off; doesn't appear to be used */
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = device->machine().driver_data<segas16a_state>();
|
||||
return 0x80 | ((state->m_n7751_command & 0x07) << 4) | (i8243_p2_r(device, offset) & 0x0f);
|
||||
}
|
||||
|
||||
@ -536,7 +546,7 @@ static READ8_HANDLER( n7751_t1_r )
|
||||
static INTERRUPT_GEN( i8751_main_cpu_vblank )
|
||||
{
|
||||
/* if we have a fake 8751 handler, call it on VBLANK */
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = device->machine().driver_data<segas16a_state>();
|
||||
|
||||
if (state->m_i8751_vblank_hook != NULL)
|
||||
(*state->m_i8751_vblank_hook)(device->machine());
|
||||
@ -552,7 +562,7 @@ static INTERRUPT_GEN( i8751_main_cpu_vblank )
|
||||
|
||||
static void dumpmtmt_i8751_sim(running_machine &machine)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
UINT8 flag = workram[0x200/2] >> 8;
|
||||
UINT8 tick = workram[0x200/2] & 0xff;
|
||||
UINT8 sec = workram[0x202/2] >> 8;
|
||||
@ -598,7 +608,7 @@ static void dumpmtmt_i8751_sim(running_machine &machine)
|
||||
|
||||
static void quartet_i8751_sim(running_machine &machine)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
|
||||
|
||||
/* signal a VBLANK to the main CPU */
|
||||
@ -623,7 +633,7 @@ static void quartet_i8751_sim(running_machine &machine)
|
||||
|
||||
static READ16_HANDLER( aceattaa_custom_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
switch (offset & (0x3000/2))
|
||||
{
|
||||
@ -675,7 +685,7 @@ static READ16_HANDLER( aceattaa_custom_io_r )
|
||||
|
||||
static READ16_HANDLER( mjleague_custom_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
switch (offset & (0x3000/2))
|
||||
{
|
||||
@ -759,7 +769,7 @@ static READ16_HANDLER( mjleague_custom_io_r )
|
||||
|
||||
static READ16_HANDLER( passsht16a_custom_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
switch (offset & (0x3000/2))
|
||||
{
|
||||
@ -796,7 +806,7 @@ static READ16_HANDLER( passsht16a_custom_io_r )
|
||||
|
||||
static READ16_HANDLER( sdi_custom_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
switch (offset & (0x3000/2))
|
||||
{
|
||||
@ -821,7 +831,7 @@ static READ16_HANDLER( sdi_custom_io_r )
|
||||
|
||||
static READ16_HANDLER( sjryuko_custom_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
static const char *const portname[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5" };
|
||||
switch (offset & (0x3000/2))
|
||||
@ -845,7 +855,7 @@ static READ16_HANDLER( sjryuko_custom_io_r )
|
||||
|
||||
static void sjryuko_lamp_changed_w(running_machine &machine, UINT8 changed, UINT8 newval)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
if ((changed & 4) && (newval & 4))
|
||||
state->m_mj_input_num = (state->m_mj_input_num + 1) % 6;
|
||||
@ -861,21 +871,21 @@ static void sjryuko_lamp_changed_w(running_machine &machine, UINT8 changed, UINT
|
||||
|
||||
INLINE UINT8 maincpu_byte_r(running_machine &machine, offs_t offset)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
return downcast<cpu_device *>(state->m_maincpu)->space(AS_PROGRAM)->read_byte(offset);
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
return state->m_maincpu->space(AS_PROGRAM)->read_byte(offset);
|
||||
}
|
||||
|
||||
|
||||
INLINE void maincpu_byte_w(running_machine &machine, offs_t offset, UINT8 data)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
downcast<cpu_device *>(state->m_maincpu)->space(AS_PROGRAM)->write_byte(offset, data);
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
state->m_maincpu->space(AS_PROGRAM)->write_byte(offset, data);
|
||||
}
|
||||
|
||||
|
||||
static WRITE8_HANDLER( mcu_control_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
int irqline;
|
||||
|
||||
/* if we have a fake i8751 handler, ignore writes by the actual 8751 */
|
||||
@ -906,7 +916,7 @@ static WRITE8_HANDLER( mcu_io_w )
|
||||
1.11 0... = checksum #1
|
||||
1.11 1... = checksum #2
|
||||
*/
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
switch ((state->m_mcu_control >> 3) & 7)
|
||||
{
|
||||
@ -947,7 +957,7 @@ static WRITE8_HANDLER( mcu_io_w )
|
||||
|
||||
static READ8_HANDLER( mcu_io_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segas16a_state *state = space->machine().driver_data<segas16a_state>();
|
||||
|
||||
switch ((state->m_mcu_control >> 3) & 7)
|
||||
{
|
||||
@ -1005,7 +1015,7 @@ static INTERRUPT_GEN( mcu_irq_assert )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( system16a_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( system16a_map, AS_PROGRAM, 16, segas16a_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x380000) AM_ROM
|
||||
AM_RANGE(0x400000, 0x407fff) AM_MIRROR(0xb88000) AM_RAM_WRITE_LEGACY(segaic16_tileram_0_w) AM_BASE_LEGACY(&segaic16_tileram_0)
|
||||
@ -1025,14 +1035,14 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas16a_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0xe800, 0xe800) AM_READ_LEGACY(sound_data_r)
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segas16a_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
@ -1048,7 +1058,7 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( n7751_portmap, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( n7751_portmap, AS_IO, 8, segas16a_state )
|
||||
AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ_LEGACY(n7751_rom_r)
|
||||
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_LEGACY(n7751_t1_r)
|
||||
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_w)
|
||||
@ -1064,7 +1074,7 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, segas16a_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0xffff) AM_READWRITE_LEGACY(mcu_io_r, mcu_io_w)
|
||||
AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READNOP AM_WRITE_LEGACY(mcu_control_w)
|
||||
@ -1972,7 +1982,7 @@ GFXDECODE_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static MACHINE_CONFIG_START( system16a, segas1x_state )
|
||||
static MACHINE_CONFIG_START( system16a, segas16a_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M68000, 10000000)
|
||||
@ -2020,12 +2030,22 @@ static MACHINE_CONFIG_START( system16a, segas1x_state )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( system16a_no7751, system16a )
|
||||
MCFG_DEVICE_REMOVE("n7751")
|
||||
MCFG_DEVICE_REMOVE("dac")
|
||||
static MACHINE_CONFIG_DERIVED( system16a_fd1089a, system16a )
|
||||
MCFG_CPU_REPLACE("maincpu", FD1089A, 10000000)
|
||||
MCFG_CPU_PROGRAM_MAP(system16a_map)
|
||||
MCFG_CPU_VBLANK_INT("screen", irq4_line_hold)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
static MACHINE_CONFIG_DERIVED( system16a_fd1089b, system16a )
|
||||
MCFG_CPU_REPLACE("maincpu", FD1089B, 10000000)
|
||||
MCFG_CPU_PROGRAM_MAP(system16a_map)
|
||||
MCFG_CPU_VBLANK_INT("screen", irq4_line_hold)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( system16a_fd1094, system16a )
|
||||
MCFG_CPU_REPLACE("maincpu", FD1094, 10000000)
|
||||
MCFG_CPU_PROGRAM_MAP(system16a_map)
|
||||
MCFG_CPU_VBLANK_INT("screen", irq4_line_hold)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -2039,6 +2059,40 @@ static MACHINE_CONFIG_DERIVED( system16a_8751, system16a )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( system16a_no7751, system16a )
|
||||
MCFG_DEVICE_REMOVE("n7751")
|
||||
MCFG_DEVICE_REMOVE("dac")
|
||||
|
||||
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( system16a_fd1089a_no7751, system16a_fd1089a )
|
||||
MCFG_DEVICE_REMOVE("n7751")
|
||||
MCFG_DEVICE_REMOVE("dac")
|
||||
|
||||
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( system16a_fd1089b_no7751, system16a_fd1089b )
|
||||
MCFG_DEVICE_REMOVE("n7751")
|
||||
MCFG_DEVICE_REMOVE("dac")
|
||||
|
||||
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( system16a_fd1094_no7751, system16a_fd1094 )
|
||||
MCFG_DEVICE_REMOVE("n7751")
|
||||
MCFG_DEVICE_REMOVE("dac")
|
||||
|
||||
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -2059,7 +2113,7 @@ ROM_START( aceattaca )
|
||||
ROM_LOAD16_BYTE( "epr-11574.42", 0x20000, 0x10000, CRC(8d3ed7bd) SHA1(0cb947a796071b0b787638a85fce39135ad8d3cb) )
|
||||
ROM_LOAD16_BYTE( "epr-11572.25", 0x20001, 0x10000, CRC(35c27c25) SHA1(ac983db30edb4c4b71f04359cd22c663940435f5) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0060.key", 0x0000, 0x2000, CRC(f4ee940f) SHA1(13cca3f19bd9761d484185a3476bec3c8c18efcf) )
|
||||
|
||||
ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
|
||||
@ -2131,7 +2185,7 @@ ROM_START( afighter )
|
||||
ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
|
||||
ROM_LOAD( "epr-10284.12", 0x00000, 0x8000, CRC(8ff09116) SHA1(8b99b6d2499897cfbd037a7e7cf5bc53bce8a63a) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0018.key", 0x0000, 0x2000, CRC(fee04be8) SHA1(c58d78299ef4cede517be823a8a8a90e46c6ba0d) )
|
||||
ROM_END
|
||||
|
||||
@ -2211,7 +2265,7 @@ ROM_START( alexkidd1 )
|
||||
ROM_LOAD( "epr-10435.1", 0x0000, 0x8000, CRC(ad89f6e3) SHA1(812a132142065b0fe13b5f0ac534b6d8830ba102) )
|
||||
ROM_LOAD( "epr-10436.2", 0x8000, 0x8000, CRC(96c76613) SHA1(fe3e4e649fd2cb2453eec0c92015bd54b3b9a1b5) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0021.key", 0x0000, 0x2000, BAD_DUMP CRC(85be8eac) SHA1(3857bf43b3b0ab60c04223e2393d99504a730d73) )
|
||||
ROM_END
|
||||
|
||||
@ -2265,7 +2319,7 @@ ROM_START( aliensyn5 )
|
||||
ROM_LOAD( "epr-10707.2", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
|
||||
ROM_LOAD( "epr-10708.4", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0037.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
|
||||
ROM_END
|
||||
|
||||
@ -2319,7 +2373,7 @@ ROM_START( aliensyn2 )
|
||||
ROM_LOAD( "10707", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
|
||||
ROM_LOAD( "10708", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0033.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
|
||||
ROM_END
|
||||
|
||||
@ -2370,7 +2424,7 @@ ROM_START( aliensynjo )
|
||||
ROM_LOAD( "epr-10707.2", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
|
||||
ROM_LOAD( "epr-10708.4", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0033.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
|
||||
ROM_END
|
||||
|
||||
@ -2617,7 +2671,7 @@ ROM_START( passsht16a )
|
||||
ROM_LOAD16_BYTE( "epr-11833.43", 0x000000, 0x10000, CRC(5eb1405c) SHA1(0a68d3fcc074475d38f999c93082d4a9dff0f19a) )
|
||||
ROM_LOAD16_BYTE( "epr-11832.26", 0x000001, 0x10000, CRC(718a3fe4) SHA1(bd6844c53ce3b64b113795360175df92d095b467) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0071.key", 0x0000, 0x2000, CRC(c69949ec) SHA1(1c63f42404ee1d8333e734e892b1c4cac0cb440e) )
|
||||
|
||||
ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
|
||||
@ -2884,7 +2938,7 @@ ROM_START( sdi )
|
||||
ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
|
||||
ROM_LOAD( "epr-10759.12", 0x0000, 0x8000, CRC(d7f9649f) SHA1(ce4abe7dd7e33da048569d7817063345fab75ea7) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0027.key", 0x0000, 0x2000, BAD_DUMP CRC(9a5307b2) SHA1(2fcc576ed95b96ff6ea71252c3fab33b8b3fc1f5) )
|
||||
ROM_END
|
||||
|
||||
@ -3038,7 +3092,7 @@ ROM_START( shinobi1 )
|
||||
ROM_LOAD16_BYTE( "epr-11263.43", 0x020000, 0x10000, CRC(a2a620bd) SHA1(f8b135ce14d6c5eac5e40ddfd5ad2f1e6f2bc7a6) )
|
||||
ROM_LOAD16_BYTE( "epr-11261.25", 0x020001, 0x10000, CRC(a3ceda52) SHA1(97a1c52a162fb1d43b3f8f16613b70ce582a8d26) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0050.key", 0x0000, 0x2000, CRC(82c39ced) SHA1(5490237ff7f20f9ebfa3e46eedd5afd4f1c28548) )
|
||||
|
||||
ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
|
||||
@ -3135,7 +3189,7 @@ ROM_START( sjryuko1 )
|
||||
ROM_LOAD( "epr-12230.4", 0x10000, 0x8000, CRC(d0f61fd4) SHA1(e6f29459d7395122f26957f56e38926aebd9004c) )
|
||||
ROM_LOAD( "epr-12231.5", 0x18000, 0x8000, CRC(780bdc57) SHA1(8c859043bba389292604385b88c743728180f9a9) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-5021.key", 0x0000, 0x2000, BAD_DUMP CRC(4a3422e4) SHA1(69a32a6987ff2481f6d6cbbe399269a2461b8bad) )
|
||||
ROM_END
|
||||
|
||||
@ -3179,7 +3233,7 @@ ROM_START( tetris )
|
||||
ROM_LOAD16_BYTE( "epr-12201.rom", 0x000000, 0x8000, CRC(338e9b51) SHA1(f56a1124c963d4ad72a806b26f9aa906aaa37d2b) )
|
||||
ROM_LOAD16_BYTE( "epr-12200.rom", 0x000001, 0x8000, CRC(fb058779) SHA1(0045985ea943ebc7e44bd95127c5e5212c2821e8) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0093.key", 0x0000, 0x2000, CRC(e0064442) SHA1(cc70b1a2c66729c4540dabd6a24a5f5615beedcd) )
|
||||
|
||||
ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
|
||||
@ -3204,7 +3258,7 @@ ROM_START( tetris3 )
|
||||
ROM_LOAD16_BYTE( "epr-12201a.43", 0x000000, 0x8000, CRC(9250e5cf) SHA1(e848a8279ce35f516754eec33b3b443d2e819eaa) )
|
||||
ROM_LOAD16_BYTE( "epr-12200a.26", 0x000001, 0x8000, CRC(85d4b0ff) SHA1(f9d8e1ebb0c02a6c3c0b0acc78a6bea081ffc6f7) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0093a.key", 0x0000, 0x2000, CRC(7ca4a8ee) SHA1(c85763b7c5d606ee72181d9baba7de5e2c457fd8) )
|
||||
|
||||
ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
|
||||
@ -3304,7 +3358,7 @@ ROM_START( timescan1 )
|
||||
ROM_REGION( 0x08000, "n7751data", 0 ) /* 7751 sound data */
|
||||
ROM_LOAD( "epr-10547.1", 0x0000, 0x8000, CRC(d24ffc4b) SHA1(3b250e1f026664f7a37f65d1c1a07381e88f11e8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0024.key", 0x0000, 0x2000, BAD_DUMP CRC(ee42ec18) SHA1(cb65dd681f38ce20440ddcb01a935c2c8eecc77f) )
|
||||
ROM_END
|
||||
|
||||
@ -3322,7 +3376,7 @@ ROM_START( wb31 )
|
||||
ROM_LOAD16_BYTE( "epr-12085.bin", 0x020000, 0x10000, CRC(0962098b) SHA1(150fc439dd5e773bef706f058abdb4d2ec44e355) )
|
||||
ROM_LOAD16_BYTE( "epr-12083.bin", 0x020001, 0x10000, CRC(3d631a8e) SHA1(4940ff6cf380fb914876ade39ea37f42b79bf11d) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0084.key", 0x0000, 0x2000, CRC(2c58dafa) SHA1(24d06970eda896fdd5e3486132bd19834f7d3659) )
|
||||
|
||||
ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
|
||||
@ -3391,7 +3445,7 @@ ROM_START( wb35 )
|
||||
ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
|
||||
ROM_LOAD( "epr-12089.12", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-wb35.key", 0x0000, 0x2000, BAD_DUMP CRC(8a2e0575) SHA1(e43a2c8ca102ec38871067685a860da53d748765) )
|
||||
ROM_END
|
||||
|
||||
@ -3428,7 +3482,7 @@ ROM_START( wb35a )
|
||||
ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
|
||||
ROM_LOAD( "epr-12089.12", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-wb35.key", 0x0000, 0x2000, BAD_DUMP CRC(8a2e0575) SHA1(e43a2c8ca102ec38871067685a860da53d748765) )
|
||||
ROM_END
|
||||
|
||||
@ -3447,30 +3501,16 @@ static DRIVER_INIT( generic_16a )
|
||||
|
||||
static DRIVER_INIT( aceattaa )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
system16a_generic_init(machine);
|
||||
state->m_custom_io_r = aceattaa_custom_io_r;
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( fd1089a_16a )
|
||||
{
|
||||
system16a_generic_init(machine);
|
||||
fd1089a_decrypt(machine);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( fd1089b_16a )
|
||||
{
|
||||
system16a_generic_init(machine);
|
||||
fd1089b_decrypt(machine);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( dumpmtmt )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
system16a_generic_init(machine);
|
||||
state->m_i8751_vblank_hook = dumpmtmt_i8751_sim;
|
||||
@ -3479,7 +3519,7 @@ static DRIVER_INIT( dumpmtmt )
|
||||
|
||||
static DRIVER_INIT( mjleague )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
system16a_generic_init(machine);
|
||||
state->m_custom_io_r = mjleague_custom_io_r;
|
||||
@ -3487,7 +3527,7 @@ static DRIVER_INIT( mjleague )
|
||||
|
||||
static DRIVER_INIT( passsht16a )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
system16a_generic_init(machine);
|
||||
state->m_custom_io_r = passsht16a_custom_io_r;
|
||||
@ -3495,7 +3535,7 @@ static DRIVER_INIT( passsht16a )
|
||||
|
||||
static DRIVER_INIT( quartet )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
system16a_generic_init(machine);
|
||||
state->m_i8751_vblank_hook = quartet_i8751_sim;
|
||||
@ -3512,20 +3552,18 @@ static DRIVER_INIT( fantzonep )
|
||||
|
||||
static DRIVER_INIT( sdi )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
system16a_generic_init(machine);
|
||||
fd1089b_decrypt(machine);
|
||||
state->m_custom_io_r = sdi_custom_io_r;
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( sjryukoa )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segas16a_state *state = machine.driver_data<segas16a_state>();
|
||||
|
||||
system16a_generic_init(machine);
|
||||
fd1089b_decrypt(machine);
|
||||
state->m_custom_io_r = sjryuko_custom_io_r;
|
||||
state->m_lamp_changed_w = sjryuko_lamp_changed_w;
|
||||
}
|
||||
@ -3549,26 +3587,26 @@ GAME( 1986, quartet2, quartet, system16a_8751, quart2, generic_16a, ROT
|
||||
GAME( 1986, quartet2a, quartet, system16a, quart2, generic_16a, ROT0, "Sega", "Quartet 2 (unprotected)", GAME_SUPPORTS_SAVE )
|
||||
|
||||
/* System 16A */
|
||||
GAME( 1987, aliensyn5, aliensyn, system16a, aliensyn, fd1089b_16a, ROT0, "Sega", "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, aliensyn2, aliensyn, system16a, aliensyn, fd1089a_16a, ROT0, "Sega", "Alien Syndrome (set 2, System 16A, FD1089A 317-0033)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, aliensynjo, aliensyn, system16a, aliensynj, fd1089a_16a, ROT0, "Sega", "Alien Syndrome (set 1, Japan, old, System 16A, FD1089A 317-0033)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, aceattaca, aceattac, system16a, aceattaa, aceattaa, ROT270, "Sega", "Ace Attacker (Japan, System 16A, FD1094 317-0060)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, afighter, 0, system16a_no7751, afighter, fd1089a_16a, ROT270, "Sega", "Action Fighter (FD1089A 317-0018)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, alexkidd, 0, system16a, alexkidd, generic_16a, ROT0, "Sega", "Alex Kidd: The Lost Stars (set 2, unprotected)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, alexkidd1, alexkidd, system16a, alexkidd, fd1089a_16a, ROT0, "Sega", "Alex Kidd: The Lost Stars (set 1, FD1089A 317-0021)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, fantzone, 0, system16a_no7751, fantzone, generic_16a, ROT0, "Sega", "Fantasy Zone (Rev A, unprotected)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, fantzone1, fantzone, system16a_no7751, fantzone, generic_16a, ROT0, "Sega", "Fantasy Zone (unprotected)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, fantzonep, fantzone, system16a_no7751, fantzone, fantzonep, ROT0, "Sega", "Fantasy Zone (317-5000)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, passsht16a, passsht, system16a, passsht16a, passsht16a, ROT270, "Sega", "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, sdi, 0, system16a_no7751, sdi, sdi, ROT0, "Sega", "SDI - Strategic Defense Initiative (Japan, old, System 16A, FD1089B 317-0027)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, shinobi, 0, system16a, shinobi, generic_16a, ROT0, "Sega", "Shinobi (set 6, System 16A, unprotected)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, shinobi1, shinobi, system16a, shinobi, generic_16a, ROT0, "Sega", "Shinobi (set 1, System 16A, FD1094 317-0050)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, shinobls, shinobi, system16a, shinobi, generic_16a, ROT0, "bootleg (Star)", "Shinobi (Star bootleg, System 16A)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, shinoblb, shinobi, system16a, shinobi, generic_16a, ROT0, "bootleg (Beta)", "Shinobi (Beta bootleg)", GAME_SUPPORTS_SAVE ) // should have different sound hw? using original ATM
|
||||
GAME( 1987, sjryuko1, sjryuko, system16a, sjryuko, sjryukoa, ROT0, "White Board", "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, tetris, 0, system16a_no7751, tetris, generic_16a, ROT0, "Sega", "Tetris (set 4, Japan, System 16A, FD1094 317-0093)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, tetris3, tetris, system16a_no7751, tetris, generic_16a, ROT0, "Sega", "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, timescan1, timescan, system16a, timescan, fd1089b_16a, ROT270, "Sega", "Time Scanner (set 1, System 16A, FD1089B 317-0024)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, wb31, wb3, system16a_no7751, wb3, generic_16a, ROT0, "Sega / Westone", "Wonder Boy III - Monster Lair (set 1, System 16A, FD1094 317-0084)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, wb35, wb3, system16a_no7751, wb3, fd1089a_16a, ROT0, "Sega / Westone", "Wonder Boy III - Monster Lair (set 5, System 16A, FD1089A 317-xxxx, bad dump?)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, wb35a, wb3, system16a_no7751, wb3, fd1089a_16a, ROT0, "Sega / Westone", "Wonder Boy III - Monster Lair (set 6, System 16A, FD1089A 317-xxxx)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, aliensyn5, aliensyn, system16a_fd1089b, aliensyn, generic_16a, ROT0, "Sega", "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, aliensyn2, aliensyn, system16a_fd1089a, aliensyn, generic_16a, ROT0, "Sega", "Alien Syndrome (set 2, System 16A, FD1089A 317-0033)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, aliensynjo, aliensyn, system16a_fd1089a, aliensynj, generic_16a, ROT0, "Sega", "Alien Syndrome (set 1, Japan, old, System 16A, FD1089A 317-0033)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, aceattaca, aceattac, system16a_fd1094, aceattaa, aceattaa, ROT270, "Sega", "Ace Attacker (Japan, System 16A, FD1094 317-0060)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, afighter, 0, system16a_fd1089a_no7751, afighter, generic_16a, ROT270, "Sega", "Action Fighter (FD1089A 317-0018)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, alexkidd, 0, system16a, alexkidd, generic_16a, ROT0, "Sega", "Alex Kidd: The Lost Stars (set 2, unprotected)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, alexkidd1, alexkidd, system16a_fd1089a, alexkidd, generic_16a, ROT0, "Sega", "Alex Kidd: The Lost Stars (set 1, FD1089A 317-0021)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, fantzone, 0, system16a_no7751, fantzone, generic_16a, ROT0, "Sega", "Fantasy Zone (Rev A, unprotected)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, fantzone1, fantzone, system16a_no7751, fantzone, generic_16a, ROT0, "Sega", "Fantasy Zone (unprotected)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, fantzonep, fantzone, system16a_no7751, fantzone, fantzonep, ROT0, "Sega", "Fantasy Zone (317-5000)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, passsht16a, passsht, system16a_fd1094, passsht16a, passsht16a, ROT270, "Sega", "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, sdi, 0, system16a_fd1089b_no7751, sdi, sdi, ROT0, "Sega", "SDI - Strategic Defense Initiative (Japan, old, System 16A, FD1089B 317-0027)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, shinobi, 0, system16a, shinobi, generic_16a, ROT0, "Sega", "Shinobi (set 6, System 16A, unprotected)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, shinobi1, shinobi, system16a_fd1094, shinobi, generic_16a, ROT0, "Sega", "Shinobi (set 1, System 16A, FD1094 317-0050)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, shinobls, shinobi, system16a, shinobi, generic_16a, ROT0, "bootleg (Star)", "Shinobi (Star bootleg, System 16A)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, shinoblb, shinobi, system16a, shinobi, generic_16a, ROT0, "bootleg (Beta)", "Shinobi (Beta bootleg)", GAME_SUPPORTS_SAVE ) // should have different sound hw? using original ATM
|
||||
GAME( 1987, sjryuko1, sjryuko, system16a_fd1089b, sjryuko, sjryukoa, ROT0, "White Board", "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, tetris, 0, system16a_fd1094_no7751, tetris, generic_16a, ROT0, "Sega", "Tetris (set 4, Japan, System 16A, FD1094 317-0093)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, tetris3, tetris, system16a_fd1094_no7751, tetris, generic_16a, ROT0, "Sega", "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1987, timescan1, timescan, system16a_fd1089b, timescan, generic_16a, ROT270, "Sega", "Time Scanner (set 1, System 16A, FD1089B 317-0024)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, wb31, wb3, system16a_fd1094_no7751, wb3, generic_16a, ROT0, "Sega / Westone", "Wonder Boy III - Monster Lair (set 1, System 16A, FD1094 317-0084)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, wb35, wb3, system16a_fd1089a_no7751, wb3, generic_16a, ROT0, "Sega / Westone", "Wonder Boy III - Monster Lair (set 5, System 16A, FD1089A 317-xxxx, bad dump?)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1988, wb35a, wb3, system16a_fd1089a_no7751, wb3, generic_16a, ROT0, "Sega / Westone", "Wonder Boy III - Monster Lair (set 6, System 16A, FD1089A 317-xxxx)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -338,6 +338,7 @@ Notes:
|
||||
#include "sound/ym2151.h"
|
||||
#include "sound/dac.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "machine/fd1094.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "video/segaic24.h"
|
||||
#include "includes/segas24.h"
|
||||
@ -686,14 +687,13 @@ void segas24_state::reset_reset()
|
||||
int changed = resetcontrol ^ prev_resetcontrol;
|
||||
if(changed & 2) {
|
||||
if(resetcontrol & 2) {
|
||||
cputag_set_input_line(machine(), "sub", INPUT_LINE_HALT, CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, PULSE_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", INPUT_LINE_HALT, CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", INPUT_LINE_RESET, PULSE_LINE);
|
||||
// mame_printf_debug("enable 2nd cpu!\n");
|
||||
// debugger_break(machine);
|
||||
s24_fd1094_machine_init(machine());
|
||||
|
||||
} else
|
||||
cputag_set_input_line(machine(), "sub", INPUT_LINE_HALT, ASSERT_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", INPUT_LINE_HALT, ASSERT_LINE);
|
||||
}
|
||||
if(changed & 4)
|
||||
devtag_reset(machine(), "ymsnd");
|
||||
@ -757,7 +757,7 @@ WRITE8_MEMBER( segas24_state::frc_w )
|
||||
{
|
||||
/* Undocumented behaviour, Bonanza Bros. seems to use this for irq ack'ing ... */
|
||||
cputag_set_input_line(machine(), "maincpu", IRQ_FRC+1, CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "sub", IRQ_FRC+1, CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", IRQ_FRC+1, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -876,7 +876,7 @@ static TIMER_DEVICE_CALLBACK( irq_timer_cb )
|
||||
if(state->irq_allow0 & (1 << IRQ_TIMER))
|
||||
cputag_set_input_line(timer.machine(), "maincpu", IRQ_TIMER+1, ASSERT_LINE);
|
||||
if(state->irq_allow1 & (1 << IRQ_TIMER))
|
||||
cputag_set_input_line(timer.machine(), "sub", IRQ_TIMER+1, ASSERT_LINE);
|
||||
cputag_set_input_line(timer.machine(), "subcpu", IRQ_TIMER+1, ASSERT_LINE);
|
||||
|
||||
if(state->irq_tmode == 1 || state->irq_tmode == 2)
|
||||
timer.machine().primary_screen->update_now();
|
||||
@ -888,8 +888,8 @@ static TIMER_DEVICE_CALLBACK( irq_timer_clear_cb )
|
||||
state->irq_sprite = state->irq_vblank = 0;
|
||||
cputag_set_input_line(timer.machine(), "maincpu", IRQ_VBLANK+1, CLEAR_LINE);
|
||||
cputag_set_input_line(timer.machine(), "maincpu", IRQ_SPRITE+1, CLEAR_LINE);
|
||||
cputag_set_input_line(timer.machine(), "sub", IRQ_VBLANK+1, CLEAR_LINE);
|
||||
cputag_set_input_line(timer.machine(), "sub", IRQ_SPRITE+1, CLEAR_LINE);
|
||||
cputag_set_input_line(timer.machine(), "subcpu", IRQ_VBLANK+1, CLEAR_LINE);
|
||||
cputag_set_input_line(timer.machine(), "subcpu", IRQ_SPRITE+1, CLEAR_LINE);
|
||||
}
|
||||
|
||||
static TIMER_DEVICE_CALLBACK( irq_frc_cb )
|
||||
@ -900,7 +900,7 @@ static TIMER_DEVICE_CALLBACK( irq_frc_cb )
|
||||
cputag_set_input_line(timer.machine(), "maincpu", IRQ_FRC+1, ASSERT_LINE);
|
||||
|
||||
if(state->irq_allow1 & (1 << IRQ_FRC) && state->frc_mode == 1)
|
||||
cputag_set_input_line(timer.machine(), "sub", IRQ_FRC+1, ASSERT_LINE);
|
||||
cputag_set_input_line(timer.machine(), "subcpu", IRQ_FRC+1, ASSERT_LINE);
|
||||
}
|
||||
|
||||
void segas24_state::irq_init()
|
||||
@ -950,11 +950,11 @@ WRITE16_MEMBER(segas24_state::irq_w)
|
||||
case 3:
|
||||
irq_allow1 = data & 0x3f;
|
||||
irq_timer_pend1 = 0;
|
||||
cputag_set_input_line(machine(), "sub", IRQ_TIMER+1, CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "sub", IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "sub", IRQ_VBLANK+1, irq_vblank && (irq_allow1 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "sub", IRQ_SPRITE+1, irq_sprite && (irq_allow1 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
//cputag_set_input_line(machine(), "sub", IRQ_FRC+1, irq_frc && (irq_allow1 & (1 << IRQ_FRC)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", IRQ_TIMER+1, CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", IRQ_VBLANK+1, irq_vblank && (irq_allow1 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", IRQ_SPRITE+1, irq_sprite && (irq_allow1 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
//cputag_set_input_line(machine(), "subcpu", IRQ_FRC+1, irq_frc && (irq_allow1 & (1 << IRQ_FRC)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -978,7 +978,7 @@ READ16_MEMBER(segas24_state::irq_r)
|
||||
break;
|
||||
case 3:
|
||||
irq_timer_pend1 = 0;
|
||||
cputag_set_input_line(machine(), "sub", IRQ_TIMER+1, CLEAR_LINE);
|
||||
cputag_set_input_line(machine(), "subcpu", IRQ_TIMER+1, CLEAR_LINE);
|
||||
break;
|
||||
}
|
||||
irq_timer_sync();
|
||||
@ -1005,7 +1005,7 @@ static TIMER_DEVICE_CALLBACK(irq_vbl)
|
||||
cputag_set_input_line(timer.machine(), "maincpu", 1+irq, ASSERT_LINE);
|
||||
|
||||
if(state->irq_allow1 & mask)
|
||||
cputag_set_input_line(timer.machine(), "sub", 1+irq, ASSERT_LINE);
|
||||
cputag_set_input_line(timer.machine(), "subcpu", 1+irq, ASSERT_LINE);
|
||||
|
||||
if(scanline == 384) {
|
||||
// Ensure one index pulse every 20 frames
|
||||
@ -1025,7 +1025,7 @@ static void irq_ym(device_t *device, int irq)
|
||||
segas24_state *state = device->machine().driver_data<segas24_state>();
|
||||
state->irq_yms = irq;
|
||||
cputag_set_input_line(device->machine(), "maincpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
cputag_set_input_line(device->machine(), "sub", IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
cputag_set_input_line(device->machine(), "subcpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -1205,7 +1205,7 @@ static ADDRESS_MAP_START( system24_cpu1_map, AS_PROGRAM, 16, segas24_state )
|
||||
AM_RANGE(0xcc0002, 0xcc0003) AM_MIRROR(0x03fff8) AM_READWRITE8(frc_mode_r, frc_mode_w,0x00ff)
|
||||
AM_RANGE(0xcc0004, 0xcc0005) AM_MIRROR(0x03fff8) AM_READWRITE8(frc_r, frc_w,0x00ff)
|
||||
AM_RANGE(0xcc0006, 0xcc0007) AM_MIRROR(0x03fff8) AM_READWRITE(mlatch_r, mlatch_w)
|
||||
AM_RANGE(0xf00000, 0xf3ffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share2")
|
||||
AM_RANGE(0xf00000, 0xf3ffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("subcpu")
|
||||
AM_RANGE(0xf80000, 0xfbffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -1218,7 +1218,7 @@ ADDRESS_MAP_END
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( system24_cpu2_map, AS_PROGRAM, 16, segas24_state )
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share2")
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("subcpu")
|
||||
AM_RANGE(0x080000, 0x0bffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share1")
|
||||
AM_RANGE(0x100000, 0x13ffff) AM_MIRROR(0x0c0000) AM_ROM AM_REGION("maincpu", 0)
|
||||
AM_RANGE(0x200000, 0x20ffff) AM_MIRROR(0x110000) AM_DEVREADWRITE("tile", segas24_tile, tile_r, tile_w)
|
||||
@ -1246,7 +1246,7 @@ static ADDRESS_MAP_START( system24_cpu2_map, AS_PROGRAM, 16, segas24_state )
|
||||
AM_RANGE(0xcc0002, 0xcc0003) AM_MIRROR(0x03fff8) AM_READWRITE8(frc_mode_r, frc_mode_w,0x00ff)
|
||||
AM_RANGE(0xcc0004, 0xcc0005) AM_MIRROR(0x03fff8) AM_READWRITE8(frc_r, frc_w,0x00ff)
|
||||
AM_RANGE(0xcc0006, 0xcc0007) AM_MIRROR(0x03fff8) AM_READWRITE(mlatch_r, mlatch_w)
|
||||
AM_RANGE(0xf00000, 0xf3ffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share2")
|
||||
AM_RANGE(0xf00000, 0xf3ffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("subcpu")
|
||||
AM_RANGE(0xf80000, 0xfbffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -1279,7 +1279,7 @@ static MACHINE_START( system24 )
|
||||
static MACHINE_RESET( system24 )
|
||||
{
|
||||
segas24_state *state = machine.driver_data<segas24_state>();
|
||||
cputag_set_input_line(machine, "sub", INPUT_LINE_HALT, ASSERT_LINE);
|
||||
cputag_set_input_line(machine, "subcpu", INPUT_LINE_HALT, ASSERT_LINE);
|
||||
state->prev_resetcontrol = state->resetcontrol = 0x06;
|
||||
state->fdc_init();
|
||||
state->curbank = 0;
|
||||
@ -1950,7 +1950,7 @@ static MACHINE_CONFIG_START( system24, segas24_state )
|
||||
MCFG_CPU_PROGRAM_MAP(system24_cpu1_map)
|
||||
MCFG_TIMER_ADD_SCANLINE("scantimer", irq_vbl, "screen", 0, 1)
|
||||
|
||||
MCFG_CPU_ADD("sub", M68000, MASTER_CLOCK/2)
|
||||
MCFG_CPU_ADD("subcpu", M68000, MASTER_CLOCK/2)
|
||||
MCFG_CPU_PROGRAM_MAP(system24_cpu2_map)
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
|
||||
@ -1991,6 +1991,11 @@ static MACHINE_CONFIG_DERIVED( system24_floppy, system24 )
|
||||
MCFG_NVRAM_ADD_NO_FILL("floppy_nvram")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( system24_floppy_fd1094, system24_floppy )
|
||||
MCFG_CPU_REPLACE("subcpu", FD1094, MASTER_CLOCK/2)
|
||||
MCFG_CPU_PROGRAM_MAP(system24_cpu2_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -2154,7 +2159,7 @@ ROM_START( sspirtfc )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-02c.key", 0x0000, 0x2000, CRC(ebae170e) SHA1(b6d1e1b6943a35b96e98e426ecb39bb5a42fb643) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2166,7 +2171,7 @@ ROM_START( sgmast )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-05d.key", 0x0000, 0x2000, NO_DUMP )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2182,7 +2187,7 @@ ROM_START( sgmastc )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-05c.key", 0x0000, 0x2000, CRC(ae0eabe5) SHA1(692d7565bf9c5b32cc80bb4bd88c9193aa04cbb0) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2194,7 +2199,7 @@ ROM_START( sgmastj )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-05b.key", 0x0000, 0x2000, CRC(adc0c83b) SHA1(2328d82d5057062eeb0072fd57f0422218cf24fc) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2206,7 +2211,7 @@ ROM_START( qsww )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-08b.key", 0x0000, 0x2000, CRC(fe0a336a) SHA1(f7a5b2c1a057d0bb8c1ae0453c58aa8f5fb731b9) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2218,7 +2223,7 @@ ROM_START( gground )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-03d.key", 0x0000, 0x2000, CRC(e1785bbd) SHA1(b4bebb2829299f1c0815d6a5f317a2526b322f63) ) /* Also labeled "rev-A" but is it different? */
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2230,7 +2235,7 @@ ROM_START( ggroundj )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-03b.key", 0x0000, 0x2000, CRC(84aecdba) SHA1(ceddf967359a6e76543fe1ab00be53d0a11fe1ab) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2242,7 +2247,7 @@ ROM_START( crkdown )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-04c.key", 0x0000, 0x2000, CRC(16e978cc) SHA1(0e1482b5efa93b732d4cf0990919cb3fc903dca7) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2254,7 +2259,7 @@ ROM_START( crkdownu )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-04d.key", 0x0000, 0x2000, CRC(934ac358) SHA1(73418e22c9d201bc3fec5c63284858958c010e05) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2266,7 +2271,7 @@ ROM_START( crkdownj )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-04b.key", 0x0000, 0x2000, CRC(4a99a202) SHA1(d7375f09e7246ecd60ba0e48f049e9e252af92a8) ) /* Also labeled "rev-A" but is it different? */
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2302,7 +2307,7 @@ ROM_START( dcclubfd )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-09d.key", 0x0000, 0x2000, CRC(a91ebffb) SHA1(70b8b4272ca456491f254d115b434bb4ce73f049) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2314,7 +2319,7 @@ ROM_START( roughrac )
|
||||
ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
|
||||
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
|
||||
|
||||
ROM_REGION( 0x2000, "fd1094key", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "subcpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0058-06b.key", 0x000000, 0x2000, CRC(6a5bf536) SHA1(3fc3e93ce8a47d7ee86da889efad2e7eca6e2ee9) )
|
||||
|
||||
ROM_REGION( 0x1c2000, "floppy", 0)
|
||||
@ -2434,7 +2439,6 @@ static DRIVER_INIT( sspirits )
|
||||
state->io_w = &segas24_state::hotrod_io_w;
|
||||
state->mlatch_table = 0;
|
||||
state->track_size = 0x2d00;
|
||||
s24_fd1094_driver_init(machine);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( sspiritj )
|
||||
@ -2444,7 +2448,6 @@ static DRIVER_INIT( sspiritj )
|
||||
state->io_w = &segas24_state::hotrod_io_w;
|
||||
state->mlatch_table = 0;
|
||||
state->track_size = 0x2f00;
|
||||
s24_fd1094_driver_init(machine);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( dcclubfd )
|
||||
@ -2454,7 +2457,6 @@ static DRIVER_INIT( dcclubfd )
|
||||
state->io_w = &segas24_state::hotrod_io_w;
|
||||
state->mlatch_table = segas24_state::dcclub_mlt;
|
||||
state->track_size = 0x2d00;
|
||||
s24_fd1094_driver_init(machine);
|
||||
}
|
||||
|
||||
|
||||
@ -2465,7 +2467,6 @@ static DRIVER_INIT( sgmast )
|
||||
state->io_w = &segas24_state::hotrod_io_w;
|
||||
state->mlatch_table = 0;
|
||||
state->track_size = 0x2d00;
|
||||
s24_fd1094_driver_init(machine);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( qsww )
|
||||
@ -2475,7 +2476,6 @@ static DRIVER_INIT( qsww )
|
||||
state->io_w = &segas24_state::hotrod_io_w;
|
||||
state->mlatch_table = 0;
|
||||
state->track_size = 0x2d00;
|
||||
s24_fd1094_driver_init(machine);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( gground )
|
||||
@ -2485,7 +2485,6 @@ static DRIVER_INIT( gground )
|
||||
state->io_w = &segas24_state::hotrod_io_w;
|
||||
state->mlatch_table = 0;
|
||||
state->track_size = 0x2d00;
|
||||
s24_fd1094_driver_init(machine);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( crkdown )
|
||||
@ -2495,7 +2494,6 @@ static DRIVER_INIT( crkdown )
|
||||
state->io_w = &segas24_state::hotrod_io_w;
|
||||
state->mlatch_table = 0;
|
||||
state->track_size = 0x2d00;
|
||||
s24_fd1094_driver_init(machine);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( roughrac )
|
||||
@ -2505,7 +2503,6 @@ static DRIVER_INIT( roughrac )
|
||||
state->io_w = &segas24_state::hotrod_io_w;
|
||||
state->mlatch_table = 0;
|
||||
state->track_size = 0x2d00;
|
||||
s24_fd1094_driver_init(machine);
|
||||
}
|
||||
|
||||
|
||||
@ -2515,27 +2512,27 @@ static DRIVER_INIT( roughrac )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
|
||||
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
|
||||
/* Disk Based Games */
|
||||
/* 01 */GAME( 1988, hotrod, 0, system24_floppy, hotrod, hotrod, ROT0, "Sega", "Hot Rod (World, 3 Players, Turbo set 1, Floppy Based)", 0 )
|
||||
/* 01 */GAME( 1988, hotroda, hotrod, system24_floppy, hotrod, hotrod, ROT0, "Sega", "Hot Rod (World, 3 Players, Turbo set 2, Floppy Based)", 0 )
|
||||
/* 01 */GAME( 1988, hotrodj, hotrod, system24_floppy, hotrodj, hotrod, ROT0, "Sega", "Hot Rod (Japan, 4 Players, Floppy Based)", 0 )
|
||||
/* 02 */GAME( 1988, sspirits, 0, system24_floppy, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based)", 0 )
|
||||
/* 02 */GAME( 1988, sspiritj, sspirits, system24_floppy, sspirits, sspiritj, ROT270, "Sega", "Scramble Spirits (Japan, Floppy DS3-5000-02-REV-A Based)", 0 )
|
||||
/* 02 */GAME( 1988, sspirtfc, sspirits, system24_floppy, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based, FD1094 317-0058-02c)", GAME_NOT_WORKING ) /* MISSING disk image */
|
||||
/* 03 */GAME( 1988, gground, 0, system24_floppy, gground, gground, ROT270, "Sega", "Gain Ground (World, 3 Players, Floppy Based, FD1094 317-0058-03d Rev A)", 0 )
|
||||
/* 03 */GAME( 1988, ggroundj, gground, system24_floppy, gground, gground, ROT270, "Sega", "Gain Ground (Japan, 2 Players, Floppy Based, FD1094 317-0058-03b)", 0 )
|
||||
/* 04 */GAME( 1989, crkdown, 0, system24_floppy, crkdown, crkdown, ROT0, "Sega", "Crack Down (World, Floppy Based, FD1094 317-0058-04c)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
|
||||
/* 04 */GAME( 1989, crkdownu, crkdown, system24_floppy, crkdown, crkdown, ROT0, "Sega", "Crack Down (US, Floppy Based, FD1094 317-0058-04d)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
|
||||
/* 04 */GAME( 1989, crkdownj, crkdown, system24_floppy, crkdown, crkdown, ROT0, "Sega", "Crack Down (Japan, Floppy Based, FD1094 317-0058-04b Rev A)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
|
||||
/* 05 */GAME( 1989, sgmast, 0, system24_floppy, sgmast, sgmast, ROT0, "Sega", "Super Masters Golf (World?, Floppy Based, FD1094 317-0058-05d?)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) // NOT decrypted
|
||||
/* 05 */GAME( 1989, sgmastc, sgmast, system24_floppy, sgmast, sgmast, ROT0, "Sega", "Jumbo Ozaki Super Masters Golf (World, Floppy Based, FD1094 317-0058-05c)", GAME_IMPERFECT_GRAPHICS ) // some gfx offset / colour probs?
|
||||
/* 05 */GAME( 1989, sgmastj, sgmast, system24_floppy, sgmastj, sgmast, ROT0, "Sega", "Jumbo Ozaki Super Masters Golf (Japan, Floppy Based, FD1094 317-0058-05b)", GAME_IMPERFECT_GRAPHICS ) // some gfx offset / colour probs?
|
||||
/* 06 */GAME( 1990, roughrac, 0, system24_floppy, roughrac, roughrac, ROT0, "Sega", "Rough Racer (Japan, Floppy Based, FD1094 317-0058-06b)", 0 )
|
||||
/* 07 */GAME( 1990, bnzabros, 0, system24_floppy, bnzabros, bnzabros, ROT0, "Sega", "Bonanza Bros (US, Floppy DS3-5000-07d? Based)", 0 )
|
||||
/* 07 */GAME( 1990, bnzabrosj, bnzabros, system24_floppy, bnzabros, bnzabros, ROT0, "Sega", "Bonanza Bros (Japan, Floppy DS3-5000-07b Based)", 0 )
|
||||
/* 08 */GAME( 1991, qsww, 0, system24_floppy, qsww, qsww, ROT0, "Sega", "Quiz Syukudai wo Wasuremashita (Japan, Floppy Based, FD1094 317-0058-08b)", GAME_IMPERFECT_GRAPHICS ) // wrong bg colour on title
|
||||
/* 09 */GAME( 1991, dcclubfd, dcclub, system24_floppy, dcclub, dcclubfd, ROT0, "Sega", "Dynamic Country Club (US, Floppy Based, FD1094 317-0058-09d)", 0 )
|
||||
/* 01 */GAME( 1988, hotrod, 0, system24_floppy, hotrod, hotrod, ROT0, "Sega", "Hot Rod (World, 3 Players, Turbo set 1, Floppy Based)", 0 )
|
||||
/* 01 */GAME( 1988, hotroda, hotrod, system24_floppy, hotrod, hotrod, ROT0, "Sega", "Hot Rod (World, 3 Players, Turbo set 2, Floppy Based)", 0 )
|
||||
/* 01 */GAME( 1988, hotrodj, hotrod, system24_floppy, hotrodj, hotrod, ROT0, "Sega", "Hot Rod (Japan, 4 Players, Floppy Based)", 0 )
|
||||
/* 02 */GAME( 1988, sspirits, 0, system24_floppy, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based)", 0 )
|
||||
/* 02 */GAME( 1988, sspiritj, sspirits, system24_floppy, sspirits, sspiritj, ROT270, "Sega", "Scramble Spirits (Japan, Floppy DS3-5000-02-REV-A Based)", 0 )
|
||||
/* 02 */GAME( 1988, sspirtfc, sspirits, system24_floppy_fd1094, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based, FD1094 317-0058-02c)", GAME_NOT_WORKING ) /* MISSING disk image */
|
||||
/* 03 */GAME( 1988, gground, 0, system24_floppy_fd1094, gground, gground, ROT270, "Sega", "Gain Ground (World, 3 Players, Floppy Based, FD1094 317-0058-03d Rev A)", 0 )
|
||||
/* 03 */GAME( 1988, ggroundj, gground, system24_floppy_fd1094, gground, gground, ROT270, "Sega", "Gain Ground (Japan, 2 Players, Floppy Based, FD1094 317-0058-03b)", 0 )
|
||||
/* 04 */GAME( 1989, crkdown, 0, system24_floppy_fd1094, crkdown, crkdown, ROT0, "Sega", "Crack Down (World, Floppy Based, FD1094 317-0058-04c)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
|
||||
/* 04 */GAME( 1989, crkdownu, crkdown, system24_floppy_fd1094, crkdown, crkdown, ROT0, "Sega", "Crack Down (US, Floppy Based, FD1094 317-0058-04d)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
|
||||
/* 04 */GAME( 1989, crkdownj, crkdown, system24_floppy_fd1094, crkdown, crkdown, ROT0, "Sega", "Crack Down (Japan, Floppy Based, FD1094 317-0058-04b Rev A)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
|
||||
/* 05 */GAME( 1989, sgmast, 0, system24_floppy_fd1094, sgmast, sgmast, ROT0, "Sega", "Super Masters Golf (World?, Floppy Based, FD1094 317-0058-05d?)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) // NOT decrypted
|
||||
/* 05 */GAME( 1989, sgmastc, sgmast, system24_floppy_fd1094, sgmast, sgmast, ROT0, "Sega", "Jumbo Ozaki Super Masters Golf (World, Floppy Based, FD1094 317-0058-05c)", GAME_IMPERFECT_GRAPHICS ) // some gfx offset / colour probs?
|
||||
/* 05 */GAME( 1989, sgmastj, sgmast, system24_floppy_fd1094, sgmastj, sgmast, ROT0, "Sega", "Jumbo Ozaki Super Masters Golf (Japan, Floppy Based, FD1094 317-0058-05b)", GAME_IMPERFECT_GRAPHICS ) // some gfx offset / colour probs?
|
||||
/* 06 */GAME( 1990, roughrac, 0, system24_floppy_fd1094, roughrac, roughrac, ROT0, "Sega", "Rough Racer (Japan, Floppy Based, FD1094 317-0058-06b)", 0 )
|
||||
/* 07 */GAME( 1990, bnzabros, 0, system24_floppy, bnzabros, bnzabros, ROT0, "Sega", "Bonanza Bros (US, Floppy DS3-5000-07d? Based)", 0 )
|
||||
/* 07 */GAME( 1990, bnzabrosj, bnzabros, system24_floppy, bnzabros, bnzabros, ROT0, "Sega", "Bonanza Bros (Japan, Floppy DS3-5000-07b Based)", 0 )
|
||||
/* 08 */GAME( 1991, qsww, 0, system24_floppy_fd1094, qsww, qsww, ROT0, "Sega", "Quiz Syukudai wo Wasuremashita (Japan, Floppy Based, FD1094 317-0058-08b)", GAME_IMPERFECT_GRAPHICS ) // wrong bg colour on title
|
||||
/* 09 */GAME( 1991, dcclubfd, dcclub, system24_floppy_fd1094, dcclub, dcclubfd, ROT0, "Sega", "Dynamic Country Club (US, Floppy Based, FD1094 317-0058-09d)", 0 )
|
||||
|
||||
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
|
||||
/* ROM Based */
|
||||
|
@ -4,6 +4,37 @@
|
||||
|
||||
Special thanks to Charles MacDonald for his priceless assistance
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Known bugs:
|
||||
@ -26,7 +57,7 @@ After Burner (C) Sega 1987
|
||||
After Burner II (C) Sega 1987
|
||||
*Caribbean Boule (C) Sega 1992
|
||||
GP Rider (C) Sega 1990
|
||||
*Last Survivor (C) Sega 1989
|
||||
Last Survivor (C) Sega 1989
|
||||
Line of Fire (C) Sega 1989
|
||||
Racing Hero (C) Sega 1990
|
||||
Royal Ascot (C) Sega 1991 dumped, but very likely incomplete
|
||||
@ -267,7 +298,6 @@ ROMs:
|
||||
#include "machine/nvram.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/segapcm.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segaipt.h"
|
||||
|
||||
|
||||
@ -284,7 +314,7 @@ ROMs:
|
||||
|
||||
static void update_main_irqs(running_machine &machine)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
int irq = 0;
|
||||
|
||||
if (state->m_timer_irq_state)
|
||||
@ -311,9 +341,9 @@ static void update_main_irqs(running_machine &machine)
|
||||
}
|
||||
|
||||
|
||||
static TIMER_DEVICE_CALLBACK( scanline_callback )
|
||||
static TIMER_CALLBACK( scanline_callback )
|
||||
{
|
||||
segas1x_state *state = timer.machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
|
||||
int scanline = param;
|
||||
int next_scanline = (scanline + 2) % 262;
|
||||
@ -342,16 +372,16 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
|
||||
|
||||
/* update IRQs on the main CPU */
|
||||
if (update)
|
||||
update_main_irqs(timer.machine());
|
||||
update_main_irqs(machine);
|
||||
|
||||
/* come back in 2 scanlines */
|
||||
timer.adjust(timer.machine().primary_screen->time_until_pos(next_scanline), next_scanline);
|
||||
state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(next_scanline), next_scanline);
|
||||
}
|
||||
|
||||
|
||||
static void timer_ack_callback(running_machine &machine)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
|
||||
/* clear the timer IRQ */
|
||||
state->m_timer_irq_state = 0;
|
||||
@ -368,7 +398,7 @@ static void timer_ack_callback(running_machine &machine)
|
||||
|
||||
static TIMER_CALLBACK( delayed_sound_data_w )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
|
||||
|
||||
state->soundlatch_byte_w(*space, 0, param);
|
||||
@ -388,7 +418,7 @@ static void sound_data_w(running_machine &machine, UINT8 data)
|
||||
|
||||
static void sound_cpu_irq(device_t *device, int state)
|
||||
{
|
||||
segas1x_state *driver = device->machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *driver = device->machine().driver_data<segaxbd_state>();
|
||||
|
||||
device_set_input_line(driver->m_soundcpu, 0, state);
|
||||
}
|
||||
@ -396,7 +426,7 @@ static void sound_cpu_irq(device_t *device, int state)
|
||||
|
||||
static READ8_HANDLER( sound_data_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *state = space->machine().driver_data<segaxbd_state>();
|
||||
|
||||
device_set_input_line(&space->device(), INPUT_LINE_NMI, CLEAR_LINE);
|
||||
return state->soundlatch_byte_r(*space, offset);
|
||||
@ -412,7 +442,7 @@ static READ8_HANDLER( sound_data_r )
|
||||
|
||||
static READ16_HANDLER( adc_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *state = space->machine().driver_data<segaxbd_state>();
|
||||
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
|
||||
int which = (state->m_iochip_regs[0][2] >> 2) & 7;
|
||||
|
||||
@ -435,7 +465,7 @@ static WRITE16_HANDLER( adc_w )
|
||||
|
||||
INLINE UINT16 iochip_r(running_machine &machine, int which, int port, int inputval)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
UINT16 result = state->m_iochip_regs[which][port];
|
||||
|
||||
/* if there's custom I/O, do that to get the input value */
|
||||
@ -445,9 +475,9 @@ INLINE UINT16 iochip_r(running_machine &machine, int which, int port, int inputv
|
||||
/* for ports 0-3, the direction is controlled 4 bits at a time by register 6 */
|
||||
if (port <= 3)
|
||||
{
|
||||
if (state->m_iochip_force_input || ((state->m_iochip_regs[which][6] >> (2 * port + 0)) & 1))
|
||||
if ((state->m_iochip_regs[which][6] >> (2 * port + 0)) & 1)
|
||||
result = (result & ~0x0f) | (inputval & 0x0f);
|
||||
if (state->m_iochip_force_input || ((state->m_iochip_regs[which][6] >> (2 * port + 1)) & 1))
|
||||
if ((state->m_iochip_regs[which][6] >> (2 * port + 1)) & 1)
|
||||
result = (result & ~0xf0) | (inputval & 0xf0);
|
||||
}
|
||||
|
||||
@ -504,7 +534,7 @@ static READ16_HANDLER( iochip_0_r )
|
||||
|
||||
static WRITE16_HANDLER( iochip_0_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *state = space->machine().driver_data<segaxbd_state>();
|
||||
UINT8 oldval;
|
||||
|
||||
/* access is via the low 8 bits */
|
||||
@ -590,7 +620,7 @@ static READ16_HANDLER( iochip_1_r )
|
||||
|
||||
static WRITE16_HANDLER( iochip_1_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *state = space->machine().driver_data<segaxbd_state>();
|
||||
|
||||
/* access is via the low 8 bits */
|
||||
if (!ACCESSING_BITS_0_7)
|
||||
@ -680,6 +710,21 @@ static void smgp_iochip0_motor_w(running_machine &machine, UINT8 data)
|
||||
}
|
||||
|
||||
|
||||
// Last Survivor
|
||||
static UINT8 lastsurv_iochip0_port_r(running_machine &machine, UINT8 data)
|
||||
{
|
||||
static const char * const port_names[] = { "MUX0", "MUX1", "MUX2", "MUX3" };
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
return state->ioport(port_names[state->m_lastsurv_mux])->read_safe(0xff);
|
||||
}
|
||||
|
||||
static void lastsurv_iochip0_muxer_w(running_machine &machine, UINT8 data)
|
||||
{
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
state->m_lastsurv_mux = (data >> 5) & 3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -687,7 +732,7 @@ static void smgp_iochip0_motor_w(running_machine &machine, UINT8 data)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0x3fffff)
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
@ -705,7 +750,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, segas1x_state )
|
||||
AM_RANGE(0x140000, 0x14000f) AM_MIRROR(0x00fff0) AM_READWRITE_LEGACY(iochip_0_r, iochip_0_w)
|
||||
AM_RANGE(0x150000, 0x15000f) AM_MIRROR(0x00fff0) AM_READWRITE_LEGACY(iochip_1_r, iochip_1_w)
|
||||
AM_RANGE(0x160000, 0x16ffff) AM_WRITE_LEGACY(iocontrol_w)
|
||||
AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("sub", 0x00000)
|
||||
AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("subcpu", 0x00000)
|
||||
AM_RANGE(0x280000, 0x283fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("share3")
|
||||
AM_RANGE(0x2a0000, 0x2a3fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("share4")
|
||||
AM_RANGE(0x2e0000, 0x2e0007) AM_MIRROR(0x003ff8) AM_DEVREADWRITE_LEGACY("5248_subx", segaic16_multiply_r, segaic16_multiply_w)
|
||||
@ -726,7 +771,7 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 16, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xfffff)
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
@ -748,14 +793,14 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0xefff) AM_ROM
|
||||
AM_RANGE(0xf000, 0xf0ff) AM_MIRROR(0x0700) AM_DEVREADWRITE_LEGACY("pcm", sega_pcm_r, sega_pcm_w)
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
@ -784,27 +829,27 @@ static WRITE16_HANDLER( smgp_excs_w )
|
||||
// Sound Board
|
||||
// The extra sound is used when the cabinet is Deluxe(Air Drive), or Cockpit. The soundlatch is
|
||||
// shared with the main board sound.
|
||||
static ADDRESS_MAP_START( smgp_sound2_map, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( smgp_sound2_map, AS_PROGRAM, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0xefff) AM_ROM
|
||||
AM_RANGE(0xf000, 0xf0ff) AM_MIRROR(0x0700) AM_DEVREADWRITE_LEGACY("pcm2", sega_pcm_r, sega_pcm_w)
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( smgp_sound2_portmap, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( smgp_sound2_portmap, AS_IO, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_READ_LEGACY(sound_data_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
// Motor Board, not yet emulated
|
||||
static ADDRESS_MAP_START( smgp_airdrive_map, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( smgp_airdrive_map, AS_PROGRAM, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xafff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( smgp_airdrive_portmap, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( smgp_airdrive_portmap, AS_IO, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x01, 0x01) AM_READNOP
|
||||
@ -812,14 +857,14 @@ static ADDRESS_MAP_START( smgp_airdrive_portmap, AS_IO, 8, segas1x_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
// Link Board, not yet emulated
|
||||
static ADDRESS_MAP_START( smgp_comm_map, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( smgp_comm_map, AS_PROGRAM, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x3fff) AM_RAM
|
||||
AM_RANGE(0x4000, 0x47ff) AM_RAM // MB8421 Dual-Port SRAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( smgp_comm_portmap, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( smgp_comm_portmap, AS_IO, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
ADDRESS_MAP_END
|
||||
@ -848,13 +893,13 @@ static WRITE16_HANDLER( rascot_excs_w )
|
||||
}
|
||||
|
||||
// Z80, unknown function
|
||||
static ADDRESS_MAP_START( rascot_z80_map, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( rascot_z80_map, AS_PROGRAM, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xafff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( rascot_z80_portmap, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( rascot_z80_portmap, AS_IO, 8, segaxbd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
ADDRESS_MAP_END
|
||||
@ -1063,6 +1108,71 @@ static INPUT_PORTS_START( thndrbd1 )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
static const ioport_value lastsurv_position_table[] =
|
||||
{
|
||||
0x0f ^ 0x08 ^ 0x01, // down + left
|
||||
0x0f ^ 0x01, // left
|
||||
0x0f ^ 0x04 ^ 0x01, // up + left
|
||||
0x0f ^ 0x04, // up
|
||||
0x0f ^ 0x04 ^ 0x02, // up + right
|
||||
0x0f ^ 0x02, // right
|
||||
0x0f ^ 0x08 ^ 0x02, // down + right
|
||||
0x0f ^ 0x08, // down
|
||||
};
|
||||
static INPUT_PORTS_START( lastsurv )
|
||||
PORT_INCLUDE( xboard_generic )
|
||||
|
||||
PORT_MODIFY("IO1PORTA")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )
|
||||
|
||||
PORT_START("MUX0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0xf0, 0xf0 ^ 0x40, IPT_POSITIONAL ) PORT_PLAYER(2) PORT_POSITIONS(8) PORT_REMAP_TABLE(lastsurv_position_table) PORT_WRAPS PORT_SENSITIVITY(1) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_Q) PORT_CODE_INC(KEYCODE_W)
|
||||
|
||||
PORT_START("MUX1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0xf0, 0xf0 ^ 0x40, IPT_POSITIONAL ) PORT_PLAYER(1) PORT_POSITIONS(8) PORT_REMAP_TABLE(lastsurv_position_table) PORT_WRAPS PORT_SENSITIVITY(1) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X)
|
||||
|
||||
PORT_START("MUX2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("MUX3")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_MODIFY("IO1PORTD")
|
||||
PORT_DIPNAME( 0x03, 0x03, "I.D. No" ) PORT_DIPLOCATION("SWB:1,2")
|
||||
PORT_DIPSETTING( 0x03, "1" )
|
||||
PORT_DIPSETTING( 0x02, "2" )
|
||||
PORT_DIPSETTING( 0x01, "3" )
|
||||
PORT_DIPSETTING( 0x00, "4" )
|
||||
PORT_DIPNAME( 0x0c, 0x0c, "Network" ) PORT_DIPLOCATION("SWB:3,4")
|
||||
PORT_DIPSETTING( 0x0c, "Off" )
|
||||
PORT_DIPSETTING( 0x08, "On (2)" )
|
||||
PORT_DIPSETTING( 0x04, "On (4)" )
|
||||
// PORT_DIPSETTING( 0x00, "No Use" )
|
||||
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Easy ) )
|
||||
PORT_DIPSETTING( 0x30, DEF_STR( Normal ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
|
||||
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:7")
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, "Coin Chute" ) PORT_DIPLOCATION("SWB:8")
|
||||
PORT_DIPSETTING( 0x80, "Single" )
|
||||
PORT_DIPSETTING( 0x00, "Twin" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( loffire )
|
||||
PORT_INCLUDE( xboard_generic )
|
||||
|
||||
@ -1330,23 +1440,28 @@ GFXDECODE_END
|
||||
|
||||
static void xboard_reset(device_t *device)
|
||||
{
|
||||
segas1x_state *state = device->machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *state = device->machine().driver_data<segaxbd_state>();
|
||||
|
||||
device_set_input_line(state->m_subcpu, INPUT_LINE_RESET, PULSE_LINE);
|
||||
device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
|
||||
}
|
||||
|
||||
static MACHINE_START( xboard )
|
||||
{
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
|
||||
}
|
||||
|
||||
static MACHINE_RESET( xboard )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
fd1094_machine_init(machine.device("maincpu"));
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
segaic16_tilemap_reset(machine, 0);
|
||||
|
||||
/* hook the RESET line, which resets CPU #1 */
|
||||
m68k_set_reset_callback(machine.device("maincpu"), xboard_reset);
|
||||
|
||||
/* start timers to track interrupts */
|
||||
state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(1), 1);
|
||||
state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(1), 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1360,26 +1475,25 @@ static const ic_315_5250_interface segaxb_5250_2_intf =
|
||||
NULL, NULL
|
||||
};
|
||||
|
||||
static MACHINE_CONFIG_START( xboard, segas1x_state )
|
||||
static MACHINE_CONFIG_START( xboard, segaxbd_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK/4)
|
||||
MCFG_CPU_PROGRAM_MAP(main_map)
|
||||
|
||||
MCFG_CPU_ADD("sub", M68000, MASTER_CLOCK/4)
|
||||
MCFG_CPU_ADD("subcpu", M68000, MASTER_CLOCK/4)
|
||||
MCFG_CPU_PROGRAM_MAP(sub_map)
|
||||
|
||||
MCFG_CPU_ADD("soundcpu", Z80, SOUND_CLOCK/4)
|
||||
MCFG_CPU_PROGRAM_MAP(sound_map)
|
||||
MCFG_CPU_IO_MAP(sound_portmap)
|
||||
|
||||
MCFG_MACHINE_START(xboard)
|
||||
MCFG_MACHINE_RESET(xboard)
|
||||
MCFG_NVRAM_ADD_0FILL("backup1")
|
||||
MCFG_NVRAM_ADD_0FILL("backup2")
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
|
||||
|
||||
MCFG_TIMER_ADD("int_timer", scanline_callback)
|
||||
|
||||
MCFG_315_5248_ADD("5248_main")
|
||||
MCFG_315_5248_ADD("5248_subx")
|
||||
MCFG_315_5249_ADD("5249_main")
|
||||
@ -1413,8 +1527,13 @@ static MACHINE_CONFIG_START( xboard, segas1x_state )
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( xboard_fd1094, xboard )
|
||||
MCFG_CPU_REPLACE("maincpu", FD1094, MASTER_CLOCK/4)
|
||||
MCFG_CPU_PROGRAM_MAP(main_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( smgp, xboard )
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( smgp_fd1094, xboard_fd1094 )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("soundcpu2", Z80, SOUND_CLOCK/4)
|
||||
@ -1492,7 +1611,7 @@ ROM_START( aburner )
|
||||
ROM_LOAD16_BYTE( "epr-10940.58", 0x00000, 0x20000, CRC(4d132c4e) SHA1(007af52167c369177b86fc0f8b007ebceba2a30c) )
|
||||
ROM_LOAD16_BYTE( "epr-10941.63", 0x00001, 0x20000, CRC(136ea264) SHA1(606ac67db53a6002ed1bd71287aed2e3e720cdf4) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-10927.20", 0x00000, 0x20000, CRC(66d36757) SHA1(c7f6d653fb6bfd629bb62057010d41f3ccfccc4d) )
|
||||
ROM_LOAD16_BYTE( "epr-10928.29", 0x00001, 0x20000, CRC(7c01d40b) SHA1(d95b4702a9c813db8bc24c8cd7e0933cbe54a573) )
|
||||
|
||||
@ -1543,7 +1662,7 @@ ROM_START( aburner2 )
|
||||
ROM_LOAD16_BYTE( "epr-11107.58", 0x00000, 0x20000, CRC(6d87bab7) SHA1(ab34fe78f1f216037b3e3dca3e61f1b31c05cedf) )
|
||||
ROM_LOAD16_BYTE( "epr-11108.63", 0x00001, 0x20000, CRC(202a3e1d) SHA1(cf2018bbad366de4b222eae35942636ca68aa581) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-11109.20", 0x00000, 0x20000, CRC(85a0fe07) SHA1(5a3a8fda6cb4898cfece4ec865b81b9b60f9ad55) )
|
||||
ROM_LOAD16_BYTE( "epr-11110.29", 0x00001, 0x20000, CRC(f3d6797c) SHA1(17487b89ddbfbcc32a0b52268259f1c8d10fd0b2) )
|
||||
|
||||
@ -1605,10 +1724,10 @@ ROM_START( loffire )
|
||||
Nicola Salmoria
|
||||
*/
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0136.key", 0x0000, 0x2000, BAD_DUMP CRC(344bfe0c) SHA1(f6bb8045b46f90f8abadf1dc2e1ae1d7cef9c810) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12804.20", 0x000000, 0x20000, CRC(b853480e) SHA1(de0889e99251da7ea50316282ebf6f434cc2db11) )
|
||||
ROM_LOAD16_BYTE( "epr-12805.29", 0x000001, 0x20000, CRC(4a7200c3) SHA1(3e6febed36a55438e0d24441b68f2b7952791584) )
|
||||
ROM_LOAD16_BYTE( "epr-12802.21", 0x040000, 0x20000, CRC(d746bb39) SHA1(08dc8cf565997c7e52329961bf7a229a15900cff) )
|
||||
@ -1659,10 +1778,10 @@ ROM_START( loffireu )
|
||||
ROM_LOAD16_BYTE( "epr-12847a.58", 0x000000, 0x20000, CRC(c50eb4ed) SHA1(18a46c97aec2fefd160338c1760b6ee367dcb57f) )
|
||||
ROM_LOAD16_BYTE( "epr-12848a.63", 0x000001, 0x20000, CRC(f8ff8640) SHA1(193bb8f42f3c5011ad1fbf87215f012de5e950fb) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0135.key", 0x0000, 0x2000, CRC(c53ad019) SHA1(7e6dc2b35ebfeefb507d4d03f5a59574944177d1) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12804.20", 0x000000, 0x20000, CRC(b853480e) SHA1(de0889e99251da7ea50316282ebf6f434cc2db11) )
|
||||
ROM_LOAD16_BYTE( "epr-12805.29", 0x000001, 0x20000, CRC(4a7200c3) SHA1(3e6febed36a55438e0d24441b68f2b7952791584) )
|
||||
ROM_LOAD16_BYTE( "epr-12802.21", 0x040000, 0x20000, CRC(d746bb39) SHA1(08dc8cf565997c7e52329961bf7a229a15900cff) )
|
||||
@ -1716,10 +1835,10 @@ ROM_START( loffirej )
|
||||
ROM_LOAD16_BYTE( "epr-12794.58", 0x000000, 0x20000, CRC(1e588992) SHA1(fe7107e83c12643e7d22fd4b4cd0c7bcff0d84c3) )
|
||||
ROM_LOAD16_BYTE( "epr-12795.63", 0x000001, 0x20000, CRC(d43d7427) SHA1(ecbd425bab6aa65ffbd441d6a0936ac055d5f06d) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0134.key", 0x0000, 0x2000, CRC(732626d4) SHA1(75ed7ca417758dd62afb4edbb9daee754932c392) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12804.20", 0x000000, 0x20000, CRC(b853480e) SHA1(de0889e99251da7ea50316282ebf6f434cc2db11) )
|
||||
ROM_LOAD16_BYTE( "epr-12805.29", 0x000001, 0x20000, CRC(4a7200c3) SHA1(3e6febed36a55438e0d24441b68f2b7952791584) )
|
||||
ROM_LOAD16_BYTE( "epr-12802.21", 0x040000, 0x20000, CRC(d746bb39) SHA1(08dc8cf565997c7e52329961bf7a229a15900cff) )
|
||||
@ -1776,10 +1895,10 @@ ROM_START( thndrbld )
|
||||
ROM_LOAD16_BYTE( "epr-11306.ic57", 0x040000, 0x20000, CRC(4b95f2b4) SHA1(9e0ff898a2af05c35db3551e52c7485748698c28) )
|
||||
ROM_LOAD16_BYTE( "epr-11307.ic62", 0x040001, 0x20000, CRC(2d6833e4) SHA1(b39a744370014237121f0010d18897e63f7058cf) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0056.key", 0x0000, 0x2000, CRC(b40cd2c5) SHA1(865e70bce4f55f6702960d6eaa780b7b1f880e41) )
|
||||
|
||||
ROM_REGION( 0x100000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x100000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-11390.ic20", 0x000000, 0x20000, CRC(ed988fdb) SHA1(b809b0b7dabd5cb29f5387522c6dfb993d1d0271) )
|
||||
ROM_LOAD16_BYTE( "epr-11391.ic29", 0x000001, 0x20000, CRC(12523bc1) SHA1(54635d6c4cc97cf4148dcac3bb2056fc414252f7) )
|
||||
ROM_LOAD16_BYTE( "epr-11310.ic21", 0x040000, 0x20000, CRC(5d9fa02c) SHA1(0ca71e35cf9740e38a52960f7d1ef96e7e1dda94) )
|
||||
@ -1833,7 +1952,7 @@ ROM_START( thndrbld1 )
|
||||
ROM_LOAD16_BYTE( "epr-11306.ic57", 0x040000, 0x20000, CRC(4b95f2b4) SHA1(9e0ff898a2af05c35db3551e52c7485748698c28) )
|
||||
ROM_LOAD16_BYTE( "epr-11307.ic62", 0x040001, 0x20000, CRC(2d6833e4) SHA1(b39a744370014237121f0010d18897e63f7058cf) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-11308.ic20", 0x00000, 0x20000, CRC(7956c238) SHA1(4608225cfd6ea3d38317cbe970f26a5fc2f8e320) )
|
||||
ROM_LOAD16_BYTE( "epr-11309.ic29", 0x00001, 0x20000, CRC(c887f620) SHA1(644c47cc2cf75cbe489ea084c13c59d94631e83f) )
|
||||
ROM_LOAD16_BYTE( "epr-11310.ic21", 0x040000, 0x20000, CRC(5d9fa02c) SHA1(0ca71e35cf9740e38a52960f7d1ef96e7e1dda94) )
|
||||
@ -1875,6 +1994,66 @@ ROM_START( thndrbld1 )
|
||||
ROM_END
|
||||
|
||||
|
||||
/**************************************************************************************************************************
|
||||
**************************************************************************************************************************
|
||||
**************************************************************************************************************************
|
||||
Last Survivor, Sega X-board
|
||||
CPU: FD1094 (317-0083)
|
||||
|
||||
GAME BD NO. 834-6493-03 (Uses "MPR" mask roms) or 834-6493-05 (Uses "EPR" eproms)
|
||||
*/
|
||||
ROM_START( lastsurv )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12046.ic58", 0x000000, 0x20000, CRC(f94f3a1a) SHA1(f509cbccb1f36ce52ed3e44d4d7b31a047050700) )
|
||||
ROM_LOAD16_BYTE( "epr-12047.ic63", 0x000001, 0x20000, CRC(1b45c116) SHA1(c46ad622a145baea52d918537fa43a2009ed0cca) )
|
||||
ROM_LOAD16_BYTE( "epr-12048.ic57", 0x040000, 0x20000, CRC(648e38ca) SHA1(e5f7fd42f49dbbddd1a812a04d8b95c1a73e640b) )
|
||||
ROM_LOAD16_BYTE( "epr-12049.ic62", 0x040001, 0x20000, CRC(6c5c4753) SHA1(6834542005bc8cad7918ae17d3764306d7f9a959) )
|
||||
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0083.key", 0x0000, 0x2000, CRC(dca0b9cc) SHA1(77510804d36d486ffa1e0bb5b0a36d43adc63415) )
|
||||
|
||||
ROM_REGION( 0x100000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12050.ic20", 0x000000, 0x20000, CRC(985a0f36) SHA1(bd0a93aa16565c8338db0c67b031bfa409bce5a9) )
|
||||
ROM_LOAD16_BYTE( "epr-12051.ic29", 0x000001, 0x20000, CRC(f967d5a8) SHA1(16d742da755b5b7c3c3a9f6b4baaf242e5e54441) )
|
||||
ROM_LOAD16_BYTE( "epr-12052.ic21", 0x040000, 0x20000, CRC(9f7a424d) SHA1(b8c2d3aa08ba71f08f2c1f403edac16bf4334184) )
|
||||
ROM_LOAD16_BYTE( "epr-12053.ic30", 0x040001, 0x20000, CRC(efcf30f6) SHA1(55cd42c78f117995a89844529386ae3d11c718c1) )
|
||||
|
||||
ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
|
||||
ROM_LOAD( "epr-12055.ic154", 0x00000, 0x10000, CRC(150014a4) SHA1(9fbab916ee903c541f61014e137ccecd071b5c3a) )
|
||||
ROM_LOAD( "epr-12056.ic153", 0x10000, 0x10000, CRC(3cd4c306) SHA1(b0f178688870c67936a15383024c392072e3bc66) )
|
||||
ROM_LOAD( "epr-12057.ic152", 0x20000, 0x10000, CRC(37e91770) SHA1(69e26f4d3c4ebfaf0225a9b1c60038595929ef05) )
|
||||
|
||||
ROM_REGION32_LE( 0x200000, "gfx2", 0 ) /* sprites */
|
||||
ROM_LOAD32_BYTE( "mpr-12064.ic90", 0x000000, 0x20000, CRC(84562a69) SHA1(815189a65065def213ef171fe40a44a455dfe75a) )
|
||||
ROM_LOAD32_BYTE( "mpr-12063.ic94", 0x000001, 0x20000, CRC(d163727c) SHA1(50ed2b401e107a359874dad5d86eec788f5504eb) )
|
||||
ROM_LOAD32_BYTE( "mpr-12062.ic98", 0x000002, 0x20000, CRC(6b57833b) SHA1(1d70894c81a4cd39f43067701a598d2c4fbffa58) )
|
||||
ROM_LOAD32_BYTE( "mpr-12061.ic102", 0x000003, 0x20000, CRC(8907d5ba) SHA1(f4f9a19f3c27ef02314e59294a9658e2b20d52e0) )
|
||||
ROM_LOAD32_BYTE( "epr-12068.ic91", 0x080000, 0x20000, CRC(8b12d342) SHA1(0356a413c2438e9c6c660454f03c0e24c6325f6b) )
|
||||
ROM_LOAD32_BYTE( "epr-12067.ic95", 0x080001, 0x20000, CRC(1a1cdd89) SHA1(cd725aa450efa60ecc7d4111d0690cb441633935) )
|
||||
ROM_LOAD32_BYTE( "epr-12066.ic99", 0x080002, 0x20000, CRC(a91d16b5) SHA1(501ddedf79130979c90c72882c2d96f5fd01adea) )
|
||||
ROM_LOAD32_BYTE( "epr-12065.ic103", 0x080003, 0x20000, CRC(f4ce14c6) SHA1(42221ee03f363e94bf7b6de0bd89172525500412) )
|
||||
ROM_LOAD32_BYTE( "epr-12072.ic92", 0x100000, 0x20000, CRC(222064c8) SHA1(a3914f8dabd8a3d99eaf4e03fa45e177c9f30666) )
|
||||
ROM_LOAD32_BYTE( "epr-12071.ic96", 0x100001, 0x20000, CRC(a329b78c) SHA1(33b1f27dcc5ac36fdfd7374e1edda4fc31421126) )
|
||||
ROM_LOAD32_BYTE( "epr-12070.ic100", 0x100002, 0x20000, CRC(97cc6706) SHA1(9160f100bd85f9c8b774e27a5d68e1c513111a61) )
|
||||
ROM_LOAD32_BYTE( "epr-12069.ic104", 0x100003, 0x20000, CRC(2c3ba66e) SHA1(087fbf9d17f38b06b134088d89965c8d17dd5846) )
|
||||
ROM_LOAD32_BYTE( "epr-12076.ic93", 0x180000, 0x20000, CRC(24f628e1) SHA1(abbc22282c7a9df203a8c589ddf08413d67392b1) )
|
||||
ROM_LOAD32_BYTE( "epr-12075.ic97", 0x180001, 0x20000, CRC(69b3507f) SHA1(c447ceb38b473a3f65847471ef6de559e6ecce4a) )
|
||||
ROM_LOAD32_BYTE( "epr-12074.ic101", 0x180002, 0x20000, CRC(ee6cbb73) SHA1(c68d825ded83dd06ba7b816622db3d57631b4fcc) )
|
||||
ROM_LOAD32_BYTE( "epr-12073.ic105", 0x180003, 0x20000, CRC(167e6342) SHA1(2f87074d6821a974cbb137ca2bec28fafc0df46f) )
|
||||
|
||||
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) /* Road Data */
|
||||
/* none */
|
||||
|
||||
ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
|
||||
ROM_LOAD( "epr-12054.ic17", 0x00000, 0x10000, CRC(e9b39216) SHA1(142764b40b4db69ff08d28338d1b12b1dd1ed0a0) )
|
||||
|
||||
ROM_REGION( 0x80000, "pcm", ROMREGION_ERASEFF ) /* Sega PCM sound data */
|
||||
ROM_LOAD( "epr-12058.ic11", 0x00000, 0x20000, CRC(4671cb46) SHA1(03ecaa4409a5b86a558313d4ccfb2334f79cff17) )
|
||||
ROM_LOAD( "epr-12059.ic12", 0x20000, 0x20000, CRC(8c99aff4) SHA1(818418e4e92f601b09fcaa0979802a2c2c85b435) )
|
||||
ROM_LOAD( "epr-12060.ic13", 0x40000, 0x20000, CRC(7ed382b3) SHA1(c87306d1b9edb8b4b97aee4af1317526750e2da2) )
|
||||
ROM_END
|
||||
|
||||
|
||||
/**************************************************************************************************************************
|
||||
**************************************************************************************************************************
|
||||
**************************************************************************************************************************
|
||||
@ -1888,10 +2067,10 @@ ROM_START( rachero )
|
||||
ROM_LOAD16_BYTE( "epr-12855.ic57", 0x40000, 0x20000,CRC(cecf1e73) SHA1(3f8631379f32dbfda7720ef345276f9be23ada06) )
|
||||
ROM_LOAD16_BYTE( "epr-12856.ic62", 0x40001, 0x20000,CRC(da900ebb) SHA1(595ed65248185ddf8666b3f30ad6329162116448) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0144.key", 0x0000, 0x2000, CRC(8740bbff) SHA1(de96e606c04a09258b966532fb01a6b4d4db86a6) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12857.ic20", 0x00000, 0x20000, CRC(8a2328cc) SHA1(c34498428ddfb3eeb986f4153a6165a685d8fc8a) )
|
||||
ROM_LOAD16_BYTE( "epr-12858.ic29", 0x00001, 0x20000, CRC(38a248b7) SHA1(a17672123665403c1c56fedab6c8abf44b1131f9) )
|
||||
|
||||
@ -1985,10 +2164,10 @@ ROM_START( smgp )
|
||||
ROM_LOAD16_BYTE( "epr-12563b.58", 0x00000, 0x20000, CRC(baf1f333) SHA1(f91a7a311237b9940a44b815716d4226a7ae1e8b) )
|
||||
ROM_LOAD16_BYTE( "epr-12564b.63", 0x00001, 0x20000, CRC(b5191af0) SHA1(d6fb19552e4816eefe751907ec55a2e07ad24879) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0126a.key", 0x0000, 0x2000, CRC(2abc1982) SHA1(cc4c36e6ba52431df17c6e36ba08d3a89be7b7e7) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12576a.20", 0x00000, 0x20000, CRC(2c9599c1) SHA1(79206f38c2976bd9299ed37bf62ac26dd3fba801) )
|
||||
ROM_LOAD16_BYTE( "epr-12577a.29", 0x00001, 0x20000, CRC(abf9a50b) SHA1(e367b305cd45900aae4849af4904543f05456dc6) )
|
||||
|
||||
@ -2051,10 +2230,10 @@ ROM_START( smgp6 )
|
||||
ROM_LOAD16_BYTE( "epr-12563a.58", 0x00000, 0x20000, CRC(2e64b10e) SHA1(2be1ffb3120e4af6a61880e2a2602db07a73f373) )
|
||||
ROM_LOAD16_BYTE( "epr-12564a.63", 0x00001, 0x20000, CRC(5baba3e7) SHA1(37194d5a4d3ee48a276f6aeb35b2f20a7661caa2) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0126a.key", 0x0000, 0x2000, CRC(2abc1982) SHA1(cc4c36e6ba52431df17c6e36ba08d3a89be7b7e7) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12576a.20", 0x00000, 0x20000, CRC(2c9599c1) SHA1(79206f38c2976bd9299ed37bf62ac26dd3fba801) )
|
||||
ROM_LOAD16_BYTE( "epr-12577a.29", 0x00001, 0x20000, CRC(abf9a50b) SHA1(e367b305cd45900aae4849af4904543f05456dc6) )
|
||||
|
||||
@ -2167,10 +2346,10 @@ ROM_START( smgp5 )
|
||||
ROM_LOAD16_BYTE( "epr-12563.58", 0x00000, 0x20000, CRC(6d7325ae) SHA1(bf88ceddc49dab5b439080d5bf0e7e084a79546c) )
|
||||
ROM_LOAD16_BYTE( "epr-12564.63", 0x00001, 0x20000, CRC(adfbf921) SHA1(f3321e03dc37b14db065b85d63e321810e4ea797) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0126.key", 0x0000, 0x2000, CRC(4d917996) SHA1(17232c0e35d439a12db3d966064cf00104088903) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12576.20", 0x00000, 0x20000, CRC(23266b26) SHA1(240b9bf198fd2975851e769766566ec4e8379f87) )
|
||||
ROM_LOAD16_BYTE( "epr-12577.29", 0x00001, 0x20000, CRC(d5b53211) SHA1(b11f5c5094eb7ea9578f15489b00d8bbac1edee6) )
|
||||
|
||||
@ -2232,10 +2411,10 @@ ROM_START( smgpu )
|
||||
ROM_LOAD16_BYTE( "epr-12561c.58", 0x00000, 0x20000, CRC(a5b0f3fe) SHA1(17103e56f822fdb52e72f597c01415ed375aa102) )
|
||||
ROM_LOAD16_BYTE( "epr-12562c.63", 0x00001, 0x20000, CRC(799e55f4) SHA1(2e02cdc63bda47b087c81021018287cfa961c083) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0125a.key", 0x0000, 0x2000, CRC(3ecdb120) SHA1(c484198e4509d79214e78d4a47e9a7e339f7a2ed) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12574a.20", 0x00000, 0x20000, CRC(f8b5c38b) SHA1(0184d5a1b71fb42d33dbaaad99d2c0fbc5750e7e) )
|
||||
ROM_LOAD16_BYTE( "epr-12575a.29", 0x00001, 0x20000, CRC(248b1d17) SHA1(22f1e0d0d698abdf0cb1954f1f6382432a12c186) )
|
||||
|
||||
@ -2298,10 +2477,10 @@ ROM_START( smgpu1 )
|
||||
ROM_LOAD16_BYTE( "epr-12561b.58", 0x00000, 0x20000, CRC(80a32655) SHA1(fe1ffa8af9f1ca175ba90b24a0853329b08d19af) )
|
||||
ROM_LOAD16_BYTE( "epr-12562b.63", 0x00001, 0x20000, CRC(d525f2a8) SHA1(f3241e11485c7428cd9f081ec6768fda39ae3250) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0125a.key", 0x0000, 0x2000, CRC(3ecdb120) SHA1(c484198e4509d79214e78d4a47e9a7e339f7a2ed) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12574a.20", 0x00000, 0x20000, CRC(f8b5c38b) SHA1(0184d5a1b71fb42d33dbaaad99d2c0fbc5750e7e) )
|
||||
ROM_LOAD16_BYTE( "epr-12575a.29", 0x00001, 0x20000, CRC(248b1d17) SHA1(22f1e0d0d698abdf0cb1954f1f6382432a12c186) )
|
||||
|
||||
@ -2535,10 +2714,10 @@ ROM_START( smgpu2 )
|
||||
ROM_LOAD16_BYTE( "epr-12561a.58", 0x00000, 0x20000, CRC(e505eb89) SHA1(bfb9a7a8b13ae454a92349e57215562477cd2cd2) )
|
||||
ROM_LOAD16_BYTE( "epr-12562a.63", 0x00001, 0x20000, CRC(c3af4215) SHA1(c46829e08d5492515de5d3269b0e899705d0b108) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0125a.key", 0x0000, 0x2000, CRC(3ecdb120) SHA1(c484198e4509d79214e78d4a47e9a7e339f7a2ed) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12574a.20", 0x00000, 0x20000, CRC(f8b5c38b) SHA1(0184d5a1b71fb42d33dbaaad99d2c0fbc5750e7e) )
|
||||
ROM_LOAD16_BYTE( "epr-12575a.29", 0x00001, 0x20000, CRC(248b1d17) SHA1(22f1e0d0d698abdf0cb1954f1f6382432a12c186) )
|
||||
|
||||
@ -2600,10 +2779,10 @@ ROM_START( smgpj )
|
||||
ROM_LOAD16_BYTE( "epr-12432b.58", 0x00000, 0x20000, CRC(c1a29db1) SHA1(0122d366899f98f7a60b0c9bddeece7995cebf83) )
|
||||
ROM_LOAD16_BYTE( "epr-12433b.63", 0x00001, 0x20000, CRC(97199eb1) SHA1(3baccf8159821d4b4d5caedf5eb691f07372be93) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0124a.key", 0x0000, 0x2000, CRC(022a8a16) SHA1(4fd80105cb85ccba77cf1e76a21d6e245d5d2e7d) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12441a.20", 0x00000, 0x20000, CRC(2c9599c1) SHA1(79206f38c2976bd9299ed37bf62ac26dd3fba801) )
|
||||
ROM_LOAD16_BYTE( "epr-12442a.29", 0x00001, 0x20000, CRC(77a5ec16) SHA1(b8cf6a3f12689d89bbdd9fb39d1cb7d1a3c10602) )
|
||||
|
||||
@ -2665,10 +2844,10 @@ ROM_START( smgpja )
|
||||
ROM_LOAD16_BYTE( "epr-12432a.58", 0x00000, 0x20000, CRC(22517672) SHA1(db9ac40e83e9786bc9dad70f62c2080d3df694ee) )
|
||||
ROM_LOAD16_BYTE( "epr-12433a.63", 0x00001, 0x20000, CRC(a46b5d13) SHA1(3a7de5cb6f3e6d726f0ea886a87125dedc6f849f) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0124a.key", 0x0000, 0x2000, CRC(022a8a16) SHA1(4fd80105cb85ccba77cf1e76a21d6e245d5d2e7d) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-12441a.20", 0x00000, 0x20000, CRC(2c9599c1) SHA1(79206f38c2976bd9299ed37bf62ac26dd3fba801) )
|
||||
ROM_LOAD16_BYTE( "epr-12442a.29", 0x00001, 0x20000, CRC(77a5ec16) SHA1(b8cf6a3f12689d89bbdd9fb39d1cb7d1a3c10602) )
|
||||
|
||||
@ -2735,10 +2914,10 @@ ROM_START( abcop )
|
||||
ROM_LOAD16_BYTE( "epr-13559.ic57", 0x40000, 0x20000, CRC(4588bf19) SHA1(6a8b3d4450ac0bc41b46e6a4e1b44d82112fcd64) )
|
||||
ROM_LOAD16_BYTE( "epr-13558.ic62", 0x40001, 0x20000, CRC(11259ed4) SHA1(e7de174a0bdb1d1111e5e419f1d501ab5be1d32d) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0169b.key", 0x0000, 0x2000, CRC(058da36e) SHA1(ab3f68a90725063c68fc5d0f8dbece1f8940dc7d) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-13566.ic20", 0x00000, 0x20000, CRC(22e52f32) SHA1(c67a4ccb88becc58dddcbfea0a1ac2017f7b2929) )
|
||||
ROM_LOAD16_BYTE( "epr-13565.ic29", 0x00001, 0x20000, CRC(a21784bd) SHA1(b40ba0ef65bbfe514625253f6aeec14bf4bcf08c) )
|
||||
|
||||
@ -2791,10 +2970,10 @@ ROM_START( gprider )
|
||||
ROM_LOAD16_BYTE( "epr-13409.ic58", 0x00000, 0x20000, CRC(9abb81b6) SHA1(f6308f3ec99ee66677e86f6a915e4dff8557d25f) )
|
||||
ROM_LOAD16_BYTE( "epr-13408.ic63", 0x00001, 0x20000, CRC(8e410e97) SHA1(2021d738064e57d175b59ba053d9ee35ed4516c8) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0163.key", 0x0000, 0x2000, CRC(c1d4d207) SHA1(c35b0a49fb6a1e0e9a1c087f0ccd190ad5c2bb2c) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-13395.ic20", 0x00000, 0x20000,CRC(d6ccfac7) SHA1(9287ab08600163a0d9bd33618c629f99391316bd) )
|
||||
ROM_LOAD16_BYTE( "epr-13394.ic29", 0x00001, 0x20000,CRC(914a55ec) SHA1(84fe1df12478990418b46b6800425e5599e9eff9) )
|
||||
ROM_LOAD16_BYTE( "epr-13393.ic21", 0x40000, 0x20000,CRC(08d023cc) SHA1(d008d57e494f484a1a84896065d53fb9b1d8d60e) )
|
||||
@ -2846,10 +3025,65 @@ ROM_START( gprideru )
|
||||
ROM_LOAD16_BYTE( "epr-13407.ic58", 0x00000, 0x20000, CRC(03553ebd) SHA1(041a71a2dce2ad56360f500cb11e29a629020160) )
|
||||
ROM_LOAD16_BYTE( "epr-13406.ic63", 0x00001, 0x20000, CRC(122c711f) SHA1(2bcc51347e771a7e7f770e68b24d82497d24aa2e) )
|
||||
|
||||
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0162.key", 0x0000, 0x2000, CRC(8067de53) SHA1(e8cd1dfbad94856c6bd51569557667e72f0a5dd4) )
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-13395.ic20", 0x00000, 0x20000,CRC(d6ccfac7) SHA1(9287ab08600163a0d9bd33618c629f99391316bd) )
|
||||
ROM_LOAD16_BYTE( "epr-13394.ic29", 0x00001, 0x20000,CRC(914a55ec) SHA1(84fe1df12478990418b46b6800425e5599e9eff9) )
|
||||
ROM_LOAD16_BYTE( "epr-13393.ic21", 0x40000, 0x20000,CRC(08d023cc) SHA1(d008d57e494f484a1a84896065d53fb9b1d8d60e) )
|
||||
ROM_LOAD16_BYTE( "epr-13392.ic30", 0x40001, 0x20000,CRC(f927cd42) SHA1(67eab328c1fb878fe3d086d0639f5051b135a037) )
|
||||
|
||||
ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
|
||||
ROM_LOAD( "epr-13383.ic154", 0x00000, 0x10000, CRC(24f897a7) SHA1(68ba17067d90f07bb5a549017be4773b33ae81d0) )
|
||||
ROM_LOAD( "epr-13384.ic153", 0x10000, 0x10000, CRC(fe8238bd) SHA1(601910bd86536e6b08f5308b298c8f01fa60f233) )
|
||||
ROM_LOAD( "epr-13385.ic152", 0x20000, 0x10000, CRC(6df1b995) SHA1(5aab19b87a9ef162c30ccf5974cb795e37dba91f) )
|
||||
|
||||
ROM_REGION32_LE( 0x200000, "gfx2", 0 ) /* sprites */
|
||||
ROM_LOAD32_BYTE( "epr-13382.ic90", 0x000000, 0x20000, CRC(01dac209) SHA1(4c6b03308193c472f6cdbcede306f8ce6db0cc4b) )
|
||||
ROM_LOAD32_BYTE( "epr-13381.ic94", 0x000001, 0x20000, CRC(3a50d931) SHA1(9d9cb1793f3b8f562ce0ea49f2afeef099f20859) )
|
||||
ROM_LOAD32_BYTE( "epr-13380.ic98", 0x000002, 0x20000, CRC(ad1024c8) SHA1(86e941424b2e2e00940886e5daed640a78ed7403) )
|
||||
ROM_LOAD32_BYTE( "epr-13379.ic102", 0x000003, 0x20000, CRC(1ac17625) SHA1(7aefd382041dd3f97936ecb8738a3f2c9780c58f) )
|
||||
ROM_LOAD32_BYTE( "epr-13378.ic91", 0x080000, 0x20000, CRC(50c9b867) SHA1(dd9702b369ea8abd50da22ce721b7040428e9d4b) )
|
||||
ROM_LOAD32_BYTE( "epr-13377.ic95", 0x080001, 0x20000, CRC(9b12f5c0) SHA1(2060420611b3354974c49bc80f556f945512570b) )
|
||||
ROM_LOAD32_BYTE( "epr-13376.ic99", 0x080002, 0x20000, CRC(449ac518) SHA1(0438a72e53a7889d39ea7e2530e49a2594d97e90) )
|
||||
ROM_LOAD32_BYTE( "epr-13375.ic103", 0x080003, 0x20000, CRC(5489a9ff) SHA1(c458cb55d957edae340535f54189438296f3ec2f) )
|
||||
ROM_LOAD32_BYTE( "epr-13374.ic92", 0x100000, 0x20000, CRC(6a319e4f) SHA1(d9f92b15f4baa14745048073205add35b7d42d27) )
|
||||
ROM_LOAD32_BYTE( "epr-13373.ic96", 0x100001, 0x20000, CRC(eca5588b) SHA1(11def0c293868193d457958fe7459fd8c31dbd2b) )
|
||||
ROM_LOAD32_BYTE( "epr-13372.ic100", 0x100002, 0x20000, CRC(0b45a433) SHA1(82fa2b208eaf70b70524681fbc3ec70085e70d83) )
|
||||
ROM_LOAD32_BYTE( "epr-13371.ic104", 0x100003, 0x20000, CRC(b68f4cff) SHA1(166f2a685cbc230c098fdc1646b6e632dd2b09dd) )
|
||||
ROM_LOAD32_BYTE( "epr-13370.ic93", 0x180000, 0x20000, CRC(78276620) SHA1(2c4505c57a1e765f9cfd48fb1637d67d199a2f1d) )
|
||||
ROM_LOAD32_BYTE( "epr-13369.ic97", 0x180001, 0x20000, CRC(8625bf0f) SHA1(0ae70bc0d54e25eecf4a11cf0600225dca35914d) )
|
||||
ROM_LOAD32_BYTE( "epr-13368.ic101", 0x180002, 0x20000, CRC(0f50716c) SHA1(eb4c7f47e11c58fe0d58f67e6dafabc6291eabb8) )
|
||||
ROM_LOAD32_BYTE( "epr-13367.ic105", 0x180003, 0x20000, CRC(4b1bb51f) SHA1(17fd5ac9e18dd6097a015e9d7b6815826f9c53f1) )
|
||||
|
||||
ROM_REGION( 0x10000, "gfx3", ROMREGION_ERASE00 ) /* road gfx */
|
||||
/* none?? */
|
||||
|
||||
ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
|
||||
ROM_LOAD( "epr-13388.ic17", 0x00000, 0x10000, CRC(706581e4) SHA1(51c9dbf2bf0d6b8826de24cd33596f5c95136870) )
|
||||
|
||||
ROM_REGION( 0x80000, "pcm", ROMREGION_ERASEFF ) /* Sega PCM sound data */
|
||||
ROM_LOAD( "epr-13391.ic11", 0x00000, 0x20000, CRC(8c30c867) SHA1(0d735291b1311890938f8a1143fae6af9feb2a69) )
|
||||
ROM_LOAD( "epr-13390.ic12", 0x20000, 0x20000, CRC(8c93cd05) SHA1(bb08094abac6c104eddf14f634e9791f03122946) )
|
||||
ROM_LOAD( "epr-13389.ic13", 0x40000, 0x20000, CRC(4e4c758e) SHA1(181750dfcdd6d5b28b063c980c251991163d9474) )
|
||||
ROM_END
|
||||
|
||||
/**************************************************************************************************************************
|
||||
GP Rider (Japan), Sega X-board
|
||||
CPU: FD1094 (317-0161)
|
||||
Custom Chip 315-5304 (IC 127)
|
||||
IC BD Number: 834-7626-01 (roms are "MPR") / 834-7626-04 (roms are "EPR")
|
||||
*/
|
||||
ROM_START( gpriderj )
|
||||
ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-13387.ic58", 0x00000, 0x20000, CRC(a1e8b2c5) SHA1(22b70a9074263af808bb9dffee29cbcff7e304e3) )
|
||||
ROM_LOAD16_BYTE( "epr-13386.ic63", 0x00001, 0x20000, CRC(d8be9e66) SHA1(d81c03b08fd6b971554b94e0adac131a1dcf3248) )
|
||||
|
||||
ROM_REGION( 0x2000, "maincpu:key", 0 ) /* decryption key */
|
||||
ROM_LOAD( "317-0161.key", 0x0000, 0x2000, CRC(e38ddc16) SHA1(d1f7f261320cbc605b4f7e5a9c28f49af5471d87) )
|
||||
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-13395.ic20", 0x00000, 0x20000,CRC(d6ccfac7) SHA1(9287ab08600163a0d9bd33618c629f99391316bd) )
|
||||
ROM_LOAD16_BYTE( "epr-13394.ic29", 0x00001, 0x20000,CRC(914a55ec) SHA1(84fe1df12478990418b46b6800425e5599e9eff9) )
|
||||
ROM_LOAD16_BYTE( "epr-13393.ic21", 0x40000, 0x20000,CRC(08d023cc) SHA1(d008d57e494f484a1a84896065d53fb9b1d8d60e) )
|
||||
@ -2896,7 +3130,7 @@ ROM_START( rascot )
|
||||
ROM_LOAD16_BYTE( "epr-13965a.ic58", 0x00000, 0x20000, CRC(7eacdfb3) SHA1(fad23352d9c5e266ad9f7fe3ccbd29b5b912b90b) )
|
||||
ROM_LOAD16_BYTE( "epr-13694a.ic63", 0x00001, 0x20000, CRC(15b86498) SHA1(ccb57063ca53347b5f771b0d7ceaeb9cd50d246a) ) // 13964a?
|
||||
|
||||
ROM_REGION( 0x80000, "sub", 0 ) /* 2nd 68000 code */
|
||||
ROM_REGION( 0x80000, "subcpu", 0 ) /* 2nd 68000 code */
|
||||
ROM_LOAD16_BYTE( "epr-13967.ic20", 0x00000, 0x20000, CRC(3b92e2b8) SHA1(5d456d7d6fa540709facda1fd8813707ebfd99d8) )
|
||||
ROM_LOAD16_BYTE( "epr-13966.ic29", 0x00001, 0x20000, CRC(eaa644e1) SHA1(b9cc171523995f5120ea7b9748af2f8de697b933) )
|
||||
|
||||
@ -2933,10 +3167,7 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( generic_xboard )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
|
||||
/* init the FD1094 */
|
||||
fd1094_driver_init(machine, "maincpu", NULL);
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
|
||||
/* set the default road priority */
|
||||
state->m_road_priority = 1;
|
||||
@ -2949,25 +3180,16 @@ static DRIVER_INIT( generic_xboard )
|
||||
|
||||
state->m_gprider_hack = 0;
|
||||
|
||||
state->m_maincpu = machine.device("maincpu");
|
||||
state->m_soundcpu = machine.device("soundcpu");
|
||||
state->m_soundcpu2 = NULL;
|
||||
state->m_subcpu = machine.device("sub");
|
||||
state->m_315_5250_1 = machine.device("5250_main");
|
||||
|
||||
state->save_item(NAME(state->m_iochip_force_input));
|
||||
state->save_item(NAME(state->m_vblank_irq_state));
|
||||
state->save_item(NAME(state->m_timer_irq_state));
|
||||
state->save_item(NAME(state->m_gprider_hack));
|
||||
state->save_item(NAME(state->m_iochip_regs[0]));
|
||||
state->save_item(NAME(state->m_iochip_regs[1]));
|
||||
state->save_item(NAME(state->m_adc_reverse));
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( aburner2 )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
|
||||
DRIVER_INIT_CALL( generic_xboard );
|
||||
state->m_road_priority = 0;
|
||||
@ -2976,9 +3198,19 @@ static DRIVER_INIT( aburner2 )
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( lastsurv )
|
||||
{
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
|
||||
DRIVER_INIT_CALL( generic_xboard );
|
||||
state->m_iochip_custom_io_r[1][1] = lastsurv_iochip0_port_r;
|
||||
state->m_iochip_custom_io_w[0][3] = lastsurv_iochip0_muxer_w;
|
||||
}
|
||||
|
||||
|
||||
static WRITE16_HANDLER( loffire_sync0_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *state = space->machine().driver_data<segaxbd_state>();
|
||||
|
||||
COMBINE_DATA(&state->m_loffire_sync[offset]);
|
||||
space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
|
||||
@ -2986,7 +3218,7 @@ static WRITE16_HANDLER( loffire_sync0_w )
|
||||
|
||||
static DRIVER_INIT( loffire )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
|
||||
DRIVER_INIT_CALL( generic_xboard );
|
||||
state->m_adc_reverse[1] = state->m_adc_reverse[3] = 1;
|
||||
@ -2998,10 +3230,9 @@ static DRIVER_INIT( loffire )
|
||||
|
||||
static DRIVER_INIT( smgp )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
|
||||
DRIVER_INIT_CALL( generic_xboard );
|
||||
state->m_soundcpu2 = machine.device("soundcpu2");
|
||||
state->m_iochip_custom_io_r[0][0] = smgp_iochip0_motor_r;
|
||||
state->m_iochip_custom_io_w[0][1] = smgp_iochip0_motor_w;
|
||||
|
||||
@ -3012,7 +3243,7 @@ static DRIVER_INIT( smgp )
|
||||
static DRIVER_INIT( rascot )
|
||||
{
|
||||
// patch out bootup link test
|
||||
UINT16 *rom = (UINT16 *)machine.root_device().memregion("sub")->base();
|
||||
UINT16 *rom = (UINT16 *)machine.root_device().memregion("subcpu")->base();
|
||||
rom[0xb78/2] = 0x601e; // subrom checksum test
|
||||
rom[0x57e/2] = 0x4e71;
|
||||
rom[0x5d0/2] = 0x6008;
|
||||
@ -3020,13 +3251,13 @@ static DRIVER_INIT( rascot )
|
||||
|
||||
DRIVER_INIT_CALL( generic_xboard );
|
||||
|
||||
machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0f0000, 0x0f3fff, FUNC(rascot_excs_r), FUNC(rascot_excs_w));
|
||||
machine.device("subcpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0f0000, 0x0f3fff, FUNC(rascot_excs_r), FUNC(rascot_excs_w));
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( gprider )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaxbd_state *state = machine.driver_data<segaxbd_state>();
|
||||
|
||||
DRIVER_INIT_CALL( generic_xboard );
|
||||
state->m_gprider_hack = 1;
|
||||
@ -3040,24 +3271,26 @@ static DRIVER_INIT( gprider )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
|
||||
GAME( 1987, aburner2, 0, xboard, aburner2, aburner2, ROT0, "Sega", "After Burner II", 0 )
|
||||
GAME( 1987, aburner, aburner2, xboard, aburner, aburner2, ROT0, "Sega", "After Burner (Japan)", 0 )
|
||||
GAME( 1987, thndrbld, 0, xboard, thndrbld, generic_xboard, ROT0, "Sega", "Thunder Blade (upright, FD1094 317-0056)", 0 )
|
||||
GAME( 1987, thndrbld1,thndrbld, xboard, thndrbd1, generic_xboard, ROT0, "Sega", "Thunder Blade (deluxe/standing, unprotected)", 0 )
|
||||
GAME( 1989, loffire, 0, xboard, loffire, loffire, ROT0, "Sega", "Line of Fire / Bakudan Yarou (World, FD1094 317-0136)", 0 )
|
||||
GAME( 1989, loffireu, loffire, xboard, loffire, loffire, ROT0, "Sega", "Line of Fire / Bakudan Yarou (US, FD1094 317-0135)", 0 )
|
||||
GAME( 1989, loffirej, loffire, xboard, loffire, loffire, ROT0, "Sega", "Line of Fire / Bakudan Yarou (Japan, FD1094 317-0134)", 0 )
|
||||
GAME( 1989, rachero, 0, xboard, rachero, generic_xboard, ROT0, "Sega", "Racing Hero (FD1094 317-0144)", 0 )
|
||||
GAME( 1989, smgp, 0, smgp, smgp, smgp, ROT0, "Sega", "Super Monaco GP (World, Rev B, FD1094 317-0126a)", 0 )
|
||||
GAME( 1989, smgp6, smgp, smgp, smgp, smgp, ROT0, "Sega", "Super Monaco GP (World, Rev A, FD1094 317-0126a)", 0 )
|
||||
GAME( 1989, smgp5, smgp, smgp, smgp, smgp, ROT0, "Sega", "Super Monaco GP (World, FD1094 317-0126)", 0 )
|
||||
GAME( 1989, smgpu, smgp, smgp, smgp, smgp, ROT0, "Sega", "Super Monaco GP (US, Rev C, FD1094 317-0125a)", 0 )
|
||||
GAME( 1989, smgpu1, smgp, smgp, smgp, smgp, ROT0, "Sega", "Super Monaco GP (US, Rev B, FD1094 317-0125a)", 0 )
|
||||
GAME( 1989, smgpu2, smgp, smgp, smgp, smgp, ROT0, "Sega", "Super Monaco GP (US, Rev A, FD1094 317-0125a)", 0 )
|
||||
GAME( 1989, smgpj, smgp, smgp, smgp, smgp, ROT0, "Sega", "Super Monaco GP (Japan, Rev B, FD1094 317-0124a)", 0 )
|
||||
GAME( 1989, smgpja, smgp, smgp, smgp, smgp, ROT0, "Sega", "Super Monaco GP (Japan, Rev A, FD1094 317-0124a)", 0 )
|
||||
GAME( 1990, abcop, 0, xboard, abcop, generic_xboard, ROT0, "Sega", "A.B. Cop (FD1094 317-0169b)", 0 )
|
||||
GAME( 1990, gprider, 0, xboard, gprider, gprider, ROT0, "Sega", "GP Rider (World, FD1094 317-0163)", 0 )
|
||||
GAME( 1990, gprideru, gprider, xboard, gprider, gprider, ROT0, "Sega", "GP Rider (US, FD1094 317-0162)", 0 )
|
||||
GAME( 1991, rascot, 0, rascot, rascot, rascot, ROT0, "Sega", "Royal Ascot (Japan, terminal?)", GAME_NOT_WORKING | GAME_NO_SOUND )
|
||||
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
|
||||
GAME( 1987, aburner2, 0, xboard, aburner2, aburner2, ROT0, "Sega", "After Burner II", 0 )
|
||||
GAME( 1987, aburner, aburner2, xboard, aburner, aburner2, ROT0, "Sega", "After Burner (Japan)", 0 )
|
||||
GAME( 1987, thndrbld, 0, xboard_fd1094, thndrbld, generic_xboard, ROT0, "Sega", "Thunder Blade (upright, FD1094 317-0056)", 0 )
|
||||
GAME( 1987, thndrbld1,thndrbld, xboard, thndrbd1, generic_xboard, ROT0, "Sega", "Thunder Blade (deluxe/standing, unprotected)", 0 )
|
||||
GAME( 1989, lastsurv, 0, xboard_fd1094, lastsurv, lastsurv, ROT0, "Sega", "Last Survivor (FD1094 317-0083)", 0 )
|
||||
GAME( 1989, loffire, 0, xboard_fd1094, loffire, loffire, ROT0, "Sega", "Line of Fire / Bakudan Yarou (World, FD1094 317-0136)", 0 )
|
||||
GAME( 1989, loffireu, loffire, xboard_fd1094, loffire, loffire, ROT0, "Sega", "Line of Fire / Bakudan Yarou (US, FD1094 317-0135)", 0 )
|
||||
GAME( 1989, loffirej, loffire, xboard_fd1094, loffire, loffire, ROT0, "Sega", "Line of Fire / Bakudan Yarou (Japan, FD1094 317-0134)", 0 )
|
||||
GAME( 1989, rachero, 0, xboard_fd1094, rachero, generic_xboard, ROT0, "Sega", "Racing Hero (FD1094 317-0144)", 0 )
|
||||
GAME( 1989, smgp, 0, smgp_fd1094, smgp, smgp, ROT0, "Sega", "Super Monaco GP (World, Rev B, FD1094 317-0126a)", 0 )
|
||||
GAME( 1989, smgp6, smgp, smgp_fd1094, smgp, smgp, ROT0, "Sega", "Super Monaco GP (World, Rev A, FD1094 317-0126a)", 0 )
|
||||
GAME( 1989, smgp5, smgp, smgp_fd1094, smgp, smgp, ROT0, "Sega", "Super Monaco GP (World, FD1094 317-0126)", 0 )
|
||||
GAME( 1989, smgpu, smgp, smgp_fd1094, smgp, smgp, ROT0, "Sega", "Super Monaco GP (US, Rev C, FD1094 317-0125a)", 0 )
|
||||
GAME( 1989, smgpu1, smgp, smgp_fd1094, smgp, smgp, ROT0, "Sega", "Super Monaco GP (US, Rev B, FD1094 317-0125a)", 0 )
|
||||
GAME( 1989, smgpu2, smgp, smgp_fd1094, smgp, smgp, ROT0, "Sega", "Super Monaco GP (US, Rev A, FD1094 317-0125a)", 0 )
|
||||
GAME( 1989, smgpj, smgp, smgp_fd1094, smgp, smgp, ROT0, "Sega", "Super Monaco GP (Japan, Rev B, FD1094 317-0124a)", 0 )
|
||||
GAME( 1989, smgpja, smgp, smgp_fd1094, smgp, smgp, ROT0, "Sega", "Super Monaco GP (Japan, Rev A, FD1094 317-0124a)", 0 )
|
||||
GAME( 1990, abcop, 0, xboard_fd1094, abcop, generic_xboard, ROT0, "Sega", "A.B. Cop (FD1094 317-0169b)", 0 )
|
||||
GAME( 1990, gprider, 0, xboard_fd1094, gprider, gprider, ROT0, "Sega", "GP Rider (World, FD1094 317-0163)", 0 )
|
||||
GAME( 1990, gprideru, gprider, xboard_fd1094, gprider, gprider, ROT0, "Sega", "GP Rider (US, FD1094 317-0162)", 0 )
|
||||
GAME( 1990, gpriderj, gprider, xboard_fd1094, gprider, gprider, ROT0, "Sega", "GP Rider (Japan, FD1094 317-0161)", 0 )
|
||||
GAME( 1991, rascot, 0, rascot, rascot, rascot, ROT0, "Sega", "Royal Ascot (Japan, terminal?)", GAME_NOT_WORKING | GAME_NO_SOUND )
|
||||
|
@ -2,18 +2,51 @@
|
||||
|
||||
Sega Y-board hardware
|
||||
|
||||
Games supported:
|
||||
****************************************************************************
|
||||
|
||||
G-LOC Air Battle
|
||||
G-LOC R360
|
||||
Galaxy Force 2
|
||||
Power Drift
|
||||
Rail Chase
|
||||
Strike Fighter
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Known games currently not dumped:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
Galaxy Force
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Games supported:
|
||||
|
||||
G-LOC Air Battle
|
||||
G-LOC R360
|
||||
Galaxy Force 2
|
||||
Power Drift
|
||||
Rail Chase
|
||||
Strike Fighter
|
||||
|
||||
Known games currently not dumped:
|
||||
|
||||
Galaxy Force
|
||||
|
||||
****************************************************************************
|
||||
|
||||
@ -30,7 +63,6 @@ Known games currently not dumped:
|
||||
#include "machine/nvram.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/segapcm.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segaipt.h"
|
||||
|
||||
#include "pdrift.lh"
|
||||
@ -64,7 +96,7 @@ static UINT16 pdrift_bank;
|
||||
|
||||
static void yboard_generic_init( running_machine &machine )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaybd_state *state = machine.driver_data<segaybd_state>();
|
||||
|
||||
/* reset globals */
|
||||
state->m_vblank_irq_state = 0;
|
||||
@ -84,7 +116,7 @@ static void yboard_generic_init( running_machine &machine )
|
||||
|
||||
static void update_main_irqs(running_machine &machine)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaybd_state *state = machine.driver_data<segaybd_state>();
|
||||
|
||||
device_set_input_line(state->m_maincpu, 2, state->m_timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->m_subx, 2, state->m_timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
@ -135,9 +167,9 @@ static void update_main_irqs(running_machine &machine)
|
||||
150-200 = ok
|
||||
*/
|
||||
|
||||
static TIMER_DEVICE_CALLBACK( scanline_callback )
|
||||
static TIMER_CALLBACK( scanline_callback )
|
||||
{
|
||||
segas1x_state *state = timer.machine().driver_data<segas1x_state>();
|
||||
segaybd_state *state = machine.driver_data<segaybd_state>();
|
||||
int scanline = param;
|
||||
|
||||
/* on scanline 'irq2_scanline' generate an IRQ2 */
|
||||
@ -169,10 +201,10 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
|
||||
}
|
||||
|
||||
/* update IRQs on the main CPU */
|
||||
update_main_irqs(timer.machine());
|
||||
update_main_irqs(machine);
|
||||
|
||||
/* come back at the next appropriate scanline */
|
||||
timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
|
||||
state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
|
||||
|
||||
#if TWEAK_IRQ2_SCANLINE
|
||||
if (scanline == 223)
|
||||
@ -180,10 +212,10 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
|
||||
int old = state->m_irq2_scanline;
|
||||
|
||||
/* Q = -10 scanlines, W = -1 scanline, E = +1 scanline, R = +10 scanlines */
|
||||
if (timer->machine().input().code_pressed(KEYCODE_Q)) { while (timer->machine().input().code_pressed(KEYCODE_Q)) ; state->m_irq2_scanline -= 10; }
|
||||
if (timer->machine().input().code_pressed(KEYCODE_W)) { while (timer->machine().input().code_pressed(KEYCODE_W)) ; state->m_irq2_scanline -= 1; }
|
||||
if (timer->machine().input().code_pressed(KEYCODE_E)) { while (timer->machine().input().code_pressed(KEYCODE_E)) ; state->m_irq2_scanline += 1; }
|
||||
if (timer->machine().input().code_pressed(KEYCODE_R)) { while (timer->machine().input().code_pressed(KEYCODE_R)) ; state->m_irq2_scanline += 10; }
|
||||
if (machine.input().code_pressed(KEYCODE_Q)) { while (machine.input().code_pressed(KEYCODE_Q)) ; state->m_irq2_scanline -= 10; }
|
||||
if (machine.input().code_pressed(KEYCODE_W)) { while (machine.input().code_pressed(KEYCODE_W)) ; state->m_irq2_scanline -= 1; }
|
||||
if (machine.input().code_pressed(KEYCODE_E)) { while (machine.input().code_pressed(KEYCODE_E)) ; state->m_irq2_scanline += 1; }
|
||||
if (machine.input().code_pressed(KEYCODE_R)) { while (machine.input().code_pressed(KEYCODE_R)) ; state->m_irq2_scanline += 10; }
|
||||
if (old != state->m_irq2_scanline)
|
||||
popmessage("scanline = %d", state->m_irq2_scanline);
|
||||
}
|
||||
@ -193,28 +225,25 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
|
||||
|
||||
static MACHINE_START( yboard )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
|
||||
state->m_maincpu = machine.device("maincpu");
|
||||
state->m_soundcpu = machine.device("soundcpu");
|
||||
state->m_subx = machine.device("subx");
|
||||
state->m_suby = machine.device("suby");
|
||||
segaybd_state *state = machine.driver_data<segaybd_state>();
|
||||
|
||||
state->save_item(NAME(state->m_vblank_irq_state));
|
||||
state->save_item(NAME(state->m_timer_irq_state));
|
||||
state->save_item(NAME(state->m_irq2_scanline));
|
||||
state->save_item(NAME(state->m_misc_io_data));
|
||||
state->save_item(NAME(state->m_analog_data));
|
||||
|
||||
state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
|
||||
}
|
||||
|
||||
|
||||
static MACHINE_RESET( yboard )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaybd_state *state = machine.driver_data<segaybd_state>();
|
||||
|
||||
state->m_irq2_scanline = 170;
|
||||
|
||||
state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(223), 223);
|
||||
state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(223), 223);
|
||||
}
|
||||
|
||||
|
||||
@ -227,7 +256,7 @@ static MACHINE_RESET( yboard )
|
||||
|
||||
static void sound_cpu_irq(device_t *device, int state)
|
||||
{
|
||||
segas1x_state *driver = device->machine().driver_data<segas1x_state>();
|
||||
segaybd_state *driver = device->machine().driver_data<segaybd_state>();
|
||||
|
||||
device_set_input_line(driver->m_soundcpu, 0, state);
|
||||
}
|
||||
@ -235,7 +264,7 @@ static void sound_cpu_irq(device_t *device, int state)
|
||||
|
||||
static TIMER_CALLBACK( delayed_sound_data_w )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaybd_state *state = machine.driver_data<segaybd_state>();
|
||||
address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
|
||||
|
||||
state->soundlatch_byte_w(*space, 0, param);
|
||||
@ -252,7 +281,7 @@ static WRITE16_HANDLER( sound_data_w )
|
||||
|
||||
static READ8_HANDLER( sound_data_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaybd_state *state = space->machine().driver_data<segaybd_state>();
|
||||
device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, CLEAR_LINE);
|
||||
return state->soundlatch_byte_r(*space, offset);
|
||||
}
|
||||
@ -267,7 +296,7 @@ static READ8_HANDLER( sound_data_r )
|
||||
|
||||
static READ16_HANDLER( io_chip_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaybd_state *state = space->machine().driver_data<segaybd_state>();
|
||||
static const char *const portnames[] = { "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
|
||||
offset &= 0x1f/2;
|
||||
|
||||
@ -315,7 +344,7 @@ static READ16_HANDLER( io_chip_r )
|
||||
|
||||
static WRITE16_HANDLER( io_chip_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaybd_state *state = space->machine().driver_data<segaybd_state>();
|
||||
UINT8 old;
|
||||
|
||||
/* generic implementation */
|
||||
@ -387,7 +416,7 @@ static WRITE16_HANDLER( io_chip_w )
|
||||
|
||||
static READ16_HANDLER( analog_r )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaybd_state *state = space->machine().driver_data<segaybd_state>();
|
||||
int result = 0xff;
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
@ -400,7 +429,7 @@ static READ16_HANDLER( analog_r )
|
||||
|
||||
static WRITE16_HANDLER( analog_w )
|
||||
{
|
||||
segas1x_state *state = space->machine().driver_data<segas1x_state>();
|
||||
segaybd_state *state = space->machine().driver_data<segaybd_state>();
|
||||
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6" };
|
||||
int selected = ((offset & 3) == 3) ? (3 + (state->m_misc_io_data[0x08/2] & 3)) : (offset & 3);
|
||||
int value = state->ioport(ports[selected])->read_safe(0xff);
|
||||
@ -416,7 +445,7 @@ static WRITE16_HANDLER( analog_w )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, segaybd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0x1fffff)
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
@ -438,7 +467,7 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( subx_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( subx_map, AS_PROGRAM, 16, segaybd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0x1fffff)
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
@ -451,7 +480,7 @@ static ADDRESS_MAP_START( subx_map, AS_PROGRAM, 16, segas1x_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( suby_map, AS_PROGRAM, 16, segas1x_state )
|
||||
static ADDRESS_MAP_START( suby_map, AS_PROGRAM, 16, segaybd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0x1fffff)
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
@ -473,14 +502,14 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segaybd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0xefff) AM_ROM
|
||||
AM_RANGE(0xf000, 0xf0ff) AM_MIRROR(0x0700) AM_DEVREADWRITE_LEGACY("pcm", sega_pcm_r, sega_pcm_w)
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segas1x_state )
|
||||
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segaybd_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
|
||||
@ -934,7 +963,7 @@ static const sega_pcm_interface segapcm_interface =
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static MACHINE_CONFIG_START( yboard, segas1x_state )
|
||||
static MACHINE_CONFIG_START( yboard, segaybd_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK/4)
|
||||
@ -955,8 +984,6 @@ static MACHINE_CONFIG_START( yboard, segas1x_state )
|
||||
MCFG_NVRAM_ADD_0FILL("backupram")
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
|
||||
|
||||
MCFG_TIMER_ADD("int_timer", scanline_callback)
|
||||
|
||||
MCFG_315_5248_ADD("5248_main")
|
||||
MCFG_315_5248_ADD("5248_subx")
|
||||
MCFG_315_5248_ADD("5248_suby")
|
||||
|
@ -1,8 +1,39 @@
|
||||
/*************************************************************************
|
||||
/***************************************************************************
|
||||
|
||||
Atari "Stella on Steroids" hardware
|
||||
|
||||
*************************************************************************/
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "machine/atarigen.h"
|
||||
#include "cpu/asap/asap.h"
|
||||
|
@ -1,105 +1,705 @@
|
||||
/***************************************************************************
|
||||
|
||||
class segas1x_state : public driver_device
|
||||
Sega System 16A/16B/18/Outrun/Hang On/X-Board/Y-Board hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
#include "cpu/mcs51/mcs51.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/8255ppi.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/segaic16.h"
|
||||
#include "sound/dac.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/2413intf.h"
|
||||
#include "sound/upd7759.h"
|
||||
#include "video/segaic16.h"
|
||||
|
||||
|
||||
// ======================> segahang_state
|
||||
|
||||
class segahang_state : public driver_device
|
||||
{
|
||||
public:
|
||||
segas1x_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
// construction/destruction
|
||||
segahang_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_interrupt_timer(*this, "int_timer")
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subcpu(*this, "subcpu"),
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_mcu(*this, "mcu"),
|
||||
m_ppi8255_1(*this, "ppi8255_1"),
|
||||
m_ppi8255_2(*this, "ppi8255_2"),
|
||||
m_i8751_vblank_hook(NULL),
|
||||
m_adc_select(0)
|
||||
{ }
|
||||
|
||||
/* memory pointers */
|
||||
// UINT16 * m_workram; // this is used in the nvram handler, hence it cannot be added here
|
||||
// UINT16 * m_paletteram; // this is used in the segaic16 mapper, hence it cannot be added here (yet)
|
||||
// UINT16 * m_tileram_0; // this is used in the segaic16 mapper, hence it cannot be added here (yet)
|
||||
// UINT16 * m_textram_0; // this is used in the segaic16 mapper, hence it cannot be added here (yet)
|
||||
// UINT16 * m_spriteram_0; // this is used in the segaic16 mapper, hence it cannot be added here (yet)
|
||||
|
||||
/* misc video */
|
||||
UINT8 m_road_priority; // segaxbd
|
||||
bitmap_ind16 *m_tmp_bitmap; // segaybd & segas18
|
||||
UINT8 m_grayscale_enable; // segas18
|
||||
UINT8 m_vdp_enable; // segas18
|
||||
UINT8 m_vdp_mixing; // segas18
|
||||
|
||||
/* misc common */
|
||||
UINT8 m_rom_board; // segas16b
|
||||
UINT8 m_mj_input_num; // segas16a & segas16b
|
||||
UINT8 m_mj_last_val; // segas16b
|
||||
UINT8 m_adc_select; // segahang & segaorun
|
||||
UINT8 m_timer_irq_state; // segaxbd & segaybd
|
||||
UINT8 m_vblank_irq_state; // segaorun, segaxbd & segaybd
|
||||
UINT8 m_misc_io_data[0x10]; // system18 & segaybd
|
||||
|
||||
//protected:
|
||||
// devices
|
||||
required_device<m68000_device> m_maincpu;
|
||||
required_device<m68000_device> m_subcpu;
|
||||
required_device<z80_device> m_soundcpu;
|
||||
optional_device<i8751_device> m_mcu;
|
||||
required_device<ppi8255_device> m_ppi8255_1;
|
||||
required_device<ppi8255_device> m_ppi8255_2;
|
||||
|
||||
// configuration
|
||||
void (*m_i8751_vblank_hook)(running_machine &machine);
|
||||
const UINT8 *m_i8751_initial_config;
|
||||
|
||||
read16_space_func m_custom_io_r;
|
||||
write16_space_func m_custom_io_w;
|
||||
|
||||
/* misc system 16b */
|
||||
UINT8 m_atomicp_sound_divisor;
|
||||
UINT8 m_atomicp_sound_count;
|
||||
UINT8 m_disable_screen_blanking;
|
||||
UINT8 m_hwc_input_value;
|
||||
// internal state
|
||||
UINT8 m_adc_select;
|
||||
};
|
||||
|
||||
|
||||
/* misc system 16a */
|
||||
UINT8 m_video_control;
|
||||
UINT8 m_mcu_control;
|
||||
UINT8 m_n7751_command;
|
||||
UINT32 m_n7751_rom_address;
|
||||
UINT8 m_last_buttons1;
|
||||
UINT8 m_last_buttons2;
|
||||
int m_read_port;
|
||||
// ======================> segas16a_state
|
||||
|
||||
class segas16a_state : public driver_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
segas16a_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_mcu(*this, "mcu"),
|
||||
m_ppi8255(*this, "ppi8255"),
|
||||
m_ymsnd(*this, "ymsnd"),
|
||||
m_n7751(*this, "n7751")
|
||||
{ }
|
||||
|
||||
//protected:
|
||||
// devices
|
||||
required_device<m68000_device> m_maincpu;
|
||||
required_device<z80_device> m_soundcpu;
|
||||
optional_device<i8751_device> m_mcu;
|
||||
required_device<ppi8255_device> m_ppi8255;
|
||||
required_device<ym2151_device> m_ymsnd;
|
||||
optional_device<n7751_device> m_n7751;
|
||||
|
||||
// configuration
|
||||
read16_space_func m_custom_io_r;
|
||||
write16_space_func m_custom_io_w;
|
||||
void (*m_i8751_vblank_hook)(running_machine &machine);
|
||||
void (*m_lamp_changed_w)(running_machine &machine, UINT8 changed, UINT8 newval);
|
||||
|
||||
/* misc system 18 */
|
||||
UINT8 m_mcu_data;
|
||||
// internal state
|
||||
UINT8 m_video_control;
|
||||
UINT8 m_mcu_control;
|
||||
UINT8 m_n7751_command;
|
||||
UINT32 m_n7751_rom_address;
|
||||
UINT8 m_last_buttons1;
|
||||
UINT8 m_last_buttons2;
|
||||
int m_read_port;
|
||||
UINT8 m_mj_input_num;
|
||||
};
|
||||
|
||||
UINT8 m_wwally_last_x[3];
|
||||
UINT8 m_wwally_last_y[3];
|
||||
UINT8 m_lghost_value;
|
||||
UINT8 m_lghost_select;
|
||||
|
||||
/* misc segaorun */
|
||||
UINT8 m_irq2_state;
|
||||
const UINT8 *m_custom_map;
|
||||
// ======================> segas16b_state
|
||||
|
||||
/* misc yboard */
|
||||
UINT8 m_analog_data[4];
|
||||
int m_irq2_scanline;
|
||||
class segas16b_state : public driver_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
segas16b_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_mapper(*this, "mapper"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_mcu(*this, "mcu"),
|
||||
m_ym2151(*this, "ym2151"),
|
||||
m_ym2413(*this, "ym2413"),
|
||||
m_upd7759(*this, "upd"),
|
||||
m_315_5248_1(*this, "315_5248"),
|
||||
m_315_5250_1(*this, "315_5250_1"),
|
||||
m_315_5250_2(*this, "315_5250_2"),
|
||||
m_nvram(*this, "nvram"),
|
||||
m_workram(*this, "workram"),
|
||||
m_romboard(ROM_BOARD_INVALID),
|
||||
m_tilemap_type(SEGAIC16_TILEMAP_16B),
|
||||
m_disable_screen_blanking(false),
|
||||
m_i8751_initial_config(NULL),
|
||||
m_atomicp_sound_divisor(0),
|
||||
m_atomicp_sound_count(0),
|
||||
m_hwc_input_value(0),
|
||||
m_mj_input_num(0),
|
||||
m_mj_last_val(0)
|
||||
{ }
|
||||
|
||||
/* misc xboard */
|
||||
UINT8 m_iochip_regs[2][8];
|
||||
UINT8 m_iochip_force_input;
|
||||
// memory mapping
|
||||
void memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index);
|
||||
UINT8 mapper_sound_r();
|
||||
void mapper_sound_w(UINT8 data);
|
||||
|
||||
// main CPU read/write handlers
|
||||
DECLARE_WRITE16_MEMBER( rom_5704_bank_w );
|
||||
DECLARE_READ16_MEMBER( rom_5797_bank_math_r );
|
||||
DECLARE_WRITE16_MEMBER( rom_5797_bank_math_w );
|
||||
DECLARE_READ16_MEMBER( unknown_rgn2_r );
|
||||
DECLARE_WRITE16_MEMBER( unknown_rgn2_w );
|
||||
DECLARE_READ16_MEMBER( standard_io_r );
|
||||
DECLARE_WRITE16_MEMBER( standard_io_w );
|
||||
DECLARE_WRITE16_MEMBER( atomicp_sound_w );
|
||||
|
||||
// sound CPU read/write handlers
|
||||
DECLARE_WRITE8_MEMBER( upd7759_control_w );
|
||||
DECLARE_READ8_MEMBER( upd7759_status_r );
|
||||
|
||||
// other callbacks
|
||||
static void upd7759_generate_nmi(device_t *device, int state);
|
||||
INTERRUPT_GEN_MEMBER( i8751_main_cpu_vblank );
|
||||
|
||||
// ROM board-specific driver init
|
||||
void init_generic_5358_small();
|
||||
void init_generic_5358();
|
||||
void init_generic_5521();
|
||||
void init_generic_5704();
|
||||
void init_generic_5797();
|
||||
void init_generic_korean();
|
||||
|
||||
// game-specific driver init
|
||||
void init_aceattac_5358();
|
||||
void init_aliensy3_5358_small();
|
||||
void init_altbeast_5521();
|
||||
void init_altbeasj_5521();
|
||||
void init_altbeas5_5521();
|
||||
void init_altbeas4_5521();
|
||||
void init_aurail1_5704();
|
||||
void init_aurailj_5704();
|
||||
void init_ddux_5704();
|
||||
void init_dunkshot_5358_small();
|
||||
void init_exctleag_5358();
|
||||
void init_goldnaxe_5704();
|
||||
void init_goldnaxe_5797();
|
||||
void init_hwchamp_5521();
|
||||
void init_passshtj_5358();
|
||||
void init_sdi_5358_small();
|
||||
void init_defense_5358_small();
|
||||
void init_shinobi4_5521();
|
||||
void init_shinobi3_5358();
|
||||
void init_sjryuko_5358_small();
|
||||
void init_timescan_5358_small();
|
||||
void init_tturf_5704();
|
||||
void init_wb3_5704();
|
||||
void init_snapper();
|
||||
|
||||
// video updates
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
// wrappers for legacy functions (to be removed)
|
||||
template<write16_space_func _Legacy>
|
||||
WRITE16_MEMBER( legacy_wrapper ) { _Legacy(&space, offset, data, mem_mask); }
|
||||
|
||||
protected:
|
||||
// internal types
|
||||
typedef delegate<void ()> i8751_sim_delegate;
|
||||
|
||||
// timer IDs
|
||||
enum
|
||||
{
|
||||
TID_INIT_I8751,
|
||||
TID_ATOMICP_SOUND_IRQ
|
||||
};
|
||||
|
||||
// rom board types
|
||||
enum segas16b_rom_board
|
||||
{
|
||||
ROM_BOARD_INVALID,
|
||||
ROM_BOARD_171_5358_SMALL, // 171-5358 with smaller ROMs
|
||||
ROM_BOARD_171_5358, // 171-5358
|
||||
ROM_BOARD_171_5521, // 171-5521
|
||||
ROM_BOARD_171_5704, // 171-5704 - don't know any diff between this and 171-5521
|
||||
ROM_BOARD_171_5797, // 171-5797
|
||||
ROM_BOARD_KOREAN // (custom Korean)
|
||||
};
|
||||
|
||||
// device overrides
|
||||
virtual void video_start();
|
||||
virtual void machine_reset();
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
// internal helpers
|
||||
void init_generic(segas16b_rom_board rom_board);
|
||||
|
||||
// i8751 simulations
|
||||
void altbeast_common_i8751_sim(offs_t soundoffs, offs_t inputoffs);
|
||||
void altbeasj_i8751_sim();
|
||||
void altbeas5_i8751_sim();
|
||||
void altbeast_i8751_sim();
|
||||
void ddux_i8751_sim();
|
||||
void goldnaxe_i8751_sim();
|
||||
void tturf_i8751_sim();
|
||||
void wb3_i8751_sim();
|
||||
|
||||
// custom I/O
|
||||
DECLARE_READ16_MEMBER( aceattac_custom_io_r );
|
||||
DECLARE_READ16_MEMBER( dunkshot_custom_io_r );
|
||||
DECLARE_READ16_MEMBER( hwchamp_custom_io_r );
|
||||
DECLARE_WRITE16_MEMBER( hwchamp_custom_io_w );
|
||||
DECLARE_READ16_MEMBER( passshtj_custom_io_r );
|
||||
DECLARE_READ16_MEMBER( sdi_custom_io_r );
|
||||
DECLARE_READ16_MEMBER( sjryuko_custom_io_r );
|
||||
DECLARE_WRITE16_MEMBER( sjryuko_custom_io_w );
|
||||
|
||||
// devices
|
||||
required_device<sega_315_5195_mapper_device> m_mapper;
|
||||
required_device<m68000_device> m_maincpu;
|
||||
optional_device<z80_device> m_soundcpu;
|
||||
optional_device<i8751_device> m_mcu;
|
||||
optional_device<ym2151_device> m_ym2151;
|
||||
optional_device<ym2413_device> m_ym2413;
|
||||
optional_device<upd7759_device> m_upd7759;
|
||||
optional_device<ic_315_5248_device> m_315_5248_1;
|
||||
optional_device<ic_315_5250_device> m_315_5250_1;
|
||||
optional_device<ic_315_5250_device> m_315_5250_2;
|
||||
required_device<nvram_device> m_nvram;
|
||||
|
||||
// memory pointers
|
||||
required_shared_ptr<UINT16> m_workram;
|
||||
|
||||
// configuration
|
||||
segas16b_rom_board m_romboard;
|
||||
int m_tilemap_type;
|
||||
read16_delegate m_custom_io_r;
|
||||
write16_delegate m_custom_io_w;
|
||||
bool m_disable_screen_blanking;
|
||||
const UINT8 * m_i8751_initial_config;
|
||||
i8751_sim_delegate m_i8751_vblank_hook;
|
||||
UINT8 m_atomicp_sound_divisor;
|
||||
|
||||
// game-specific state
|
||||
UINT8 m_atomicp_sound_count;
|
||||
UINT8 m_hwc_input_value;
|
||||
UINT8 m_mj_input_num;
|
||||
UINT8 m_mj_last_val;
|
||||
};
|
||||
|
||||
|
||||
// ======================> isgsm_state
|
||||
|
||||
class isgsm_state : public segas16b_state
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
isgsm_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: segas16b_state(mconfig, type, tag),
|
||||
m_read_xor(0),
|
||||
m_cart_addrlatch(0),
|
||||
m_cart_addr(0),
|
||||
m_data_type(0),
|
||||
m_data_addr(0),
|
||||
m_data_mode(0),
|
||||
m_addr_latch(0),
|
||||
m_security_value(0),
|
||||
m_security_latch(0),
|
||||
m_rle_control_position(8),
|
||||
m_rle_control_byte(0),
|
||||
m_rle_latched(false),
|
||||
m_rle_byte(0)
|
||||
{ }
|
||||
|
||||
// driver init
|
||||
void init_isgsm();
|
||||
void init_shinfz();
|
||||
void init_tetrbx();
|
||||
|
||||
// read/write handlers
|
||||
DECLARE_WRITE16_MEMBER( sound_w16 );
|
||||
DECLARE_WRITE16_MEMBER( cart_addr_high_w );
|
||||
DECLARE_WRITE16_MEMBER( cart_addr_low_w );
|
||||
DECLARE_READ16_MEMBER( cart_data_r );
|
||||
DECLARE_WRITE16_MEMBER( data_w );
|
||||
DECLARE_WRITE16_MEMBER( datatype_w );
|
||||
DECLARE_WRITE16_MEMBER( addr_high_w );
|
||||
DECLARE_WRITE16_MEMBER( addr_low_w );
|
||||
DECLARE_WRITE16_MEMBER( cart_security_high_w );
|
||||
DECLARE_WRITE16_MEMBER( cart_security_low_w );
|
||||
DECLARE_READ16_MEMBER( cart_security_low_r );
|
||||
DECLARE_READ16_MEMBER( cart_security_high_r );
|
||||
DECLARE_WRITE16_MEMBER( sound_reset_w );
|
||||
DECLARE_WRITE16_MEMBER( main_bank_change_w );
|
||||
|
||||
// security callbacks
|
||||
UINT32 shinfz_security(UINT32 input);
|
||||
UINT32 tetrbx_security(UINT32 input);
|
||||
|
||||
//protected:
|
||||
// driver overrides
|
||||
virtual void machine_reset();
|
||||
|
||||
// configuration
|
||||
UINT8 m_read_xor;
|
||||
typedef delegate<UINT32 (UINT32)> security_callback_delegate;
|
||||
security_callback_delegate m_security_callback;
|
||||
|
||||
// internal state
|
||||
UINT16 m_cart_addrlatch;
|
||||
UINT32 m_cart_addr;
|
||||
UINT8 m_data_type;
|
||||
UINT32 m_data_addr;
|
||||
UINT8 m_data_mode;
|
||||
UINT16 m_addr_latch;
|
||||
UINT32 m_security_value;
|
||||
UINT16 m_security_latch;
|
||||
UINT8 m_rle_control_position;
|
||||
UINT8 m_rle_control_byte;
|
||||
bool m_rle_latched;
|
||||
UINT8 m_rle_byte;
|
||||
};
|
||||
|
||||
|
||||
// ======================> segas18_state
|
||||
|
||||
class segas18_state : public driver_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
segas18_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_mapper(*this, "mapper"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_mcu(*this, "mcu"),
|
||||
m_nvram(*this, "nvram"),
|
||||
m_workram(*this, "workram"),
|
||||
m_romboard(ROM_BOARD_INVALID),
|
||||
m_has_guns(false),
|
||||
m_grayscale_enable(false),
|
||||
m_vdp_enable(false),
|
||||
m_vdp_mixing(0),
|
||||
m_mcu_data(0),
|
||||
m_lghost_value(0),
|
||||
m_lghost_select(0)
|
||||
{
|
||||
memset(m_misc_io_data, 0, sizeof(m_misc_io_data));
|
||||
memset(m_wwally_last_x, 0, sizeof(m_wwally_last_x));
|
||||
memset(m_wwally_last_y, 0, sizeof(m_wwally_last_y));
|
||||
}
|
||||
|
||||
// driver init
|
||||
void init_generic_shad();
|
||||
void init_generic_5874();
|
||||
void init_generic_5987();
|
||||
void init_ddcrew();
|
||||
void init_lghost();
|
||||
void init_wwally();
|
||||
|
||||
// memory mapping
|
||||
void memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index);
|
||||
UINT8 mapper_sound_r();
|
||||
void mapper_sound_w(UINT8 data);
|
||||
|
||||
// read/write handlers
|
||||
DECLARE_WRITE16_MEMBER( rom_5987_bank_w );
|
||||
DECLARE_READ16_MEMBER( io_chip_r );
|
||||
DECLARE_WRITE16_MEMBER( io_chip_w );
|
||||
DECLARE_READ16_MEMBER( misc_io_r );
|
||||
DECLARE_WRITE16_MEMBER( misc_io_w );
|
||||
DECLARE_WRITE8_MEMBER( soundbank_w );
|
||||
DECLARE_WRITE8_MEMBER( mcu_data_w );
|
||||
|
||||
// custom I/O
|
||||
DECLARE_READ16_MEMBER( ddcrew_custom_io_r );
|
||||
DECLARE_READ16_MEMBER( lghost_custom_io_r );
|
||||
DECLARE_WRITE16_MEMBER( lghost_custom_io_w );
|
||||
DECLARE_READ16_MEMBER( wwally_custom_io_r );
|
||||
DECLARE_WRITE16_MEMBER( wwally_custom_io_w );
|
||||
|
||||
// video rendering
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
// wrappers for legacy functions (to be removed)
|
||||
template<read16_space_func _Legacy>
|
||||
READ16_MEMBER( legacy_wrapper_r ) { return _Legacy(&space, offset, mem_mask); }
|
||||
template<write16_space_func _Legacy>
|
||||
WRITE16_MEMBER( legacy_wrapper ) { _Legacy(&space, offset, data, mem_mask); }
|
||||
|
||||
protected:
|
||||
// timer IDs
|
||||
enum
|
||||
{
|
||||
TID_INITIAL_BOOST
|
||||
};
|
||||
|
||||
// rom board types
|
||||
enum segas18_rom_board
|
||||
{
|
||||
ROM_BOARD_INVALID,
|
||||
ROM_BOARD_171_SHADOW, // 171-???? -- used by shadow dancer
|
||||
ROM_BOARD_171_5874, // 171-5874
|
||||
ROM_BOARD_171_5987 // 171-5987
|
||||
};
|
||||
|
||||
// device overrides
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
// internal helpers
|
||||
void init_generic(segas18_rom_board rom_board);
|
||||
void set_grayscale(bool enable);
|
||||
void set_vdp_enable(bool enable);
|
||||
void set_vdp_mixing(UINT8 mixing);
|
||||
void draw_vdp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority);
|
||||
|
||||
// devices
|
||||
required_device<sega_315_5195_mapper_device> m_mapper;
|
||||
required_device<m68000_device> m_maincpu;
|
||||
required_device<z80_device> m_soundcpu;
|
||||
optional_device<i8751_device> m_mcu;
|
||||
required_device<nvram_device> m_nvram;
|
||||
|
||||
// memory pointers
|
||||
required_shared_ptr<UINT16> m_workram;
|
||||
|
||||
// configuration
|
||||
segas18_rom_board m_romboard;
|
||||
read16_delegate m_custom_io_r;
|
||||
write16_delegate m_custom_io_w;
|
||||
bool m_has_guns;
|
||||
|
||||
// internal state
|
||||
bool m_grayscale_enable;
|
||||
bool m_vdp_enable;
|
||||
UINT8 m_vdp_mixing;
|
||||
bitmap_ind16 m_temp_bitmap;
|
||||
UINT8 m_mcu_data;
|
||||
UINT8 m_misc_io_data[0x10];
|
||||
|
||||
// game-specific state
|
||||
UINT8 m_wwally_last_x[3];
|
||||
UINT8 m_wwally_last_y[3];
|
||||
UINT8 m_lghost_value;
|
||||
UINT8 m_lghost_select;
|
||||
};
|
||||
|
||||
|
||||
// ======================> segaorun_state
|
||||
|
||||
class segaorun_state : public driver_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
segaorun_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_mapper(*this, "mapper"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subcpu(*this, "subcpu"),
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_ppi8255(*this, "ppi8255"),
|
||||
m_nvram(*this, "nvram"),
|
||||
m_workram(*this, "workram"),
|
||||
m_custom_map(NULL),
|
||||
m_is_shangon(false),
|
||||
m_scanline_timer(NULL),
|
||||
m_irq2_state(0),
|
||||
m_adc_select(0),
|
||||
m_vblank_irq_state(0)
|
||||
{ }
|
||||
|
||||
// driver init
|
||||
void init_outrun();
|
||||
void init_outrunb();
|
||||
void init_shangon();
|
||||
void init_shangon3();
|
||||
|
||||
// memory mapping
|
||||
void memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index);
|
||||
UINT8 mapper_sound_r();
|
||||
void mapper_sound_w(UINT8 data);
|
||||
|
||||
// read/write handlers
|
||||
DECLARE_READ16_MEMBER( misc_io_r );
|
||||
DECLARE_WRITE16_MEMBER( misc_io_w );
|
||||
DECLARE_WRITE16_MEMBER( nop_w );
|
||||
DECLARE_READ8_MEMBER( unknown_porta_r );
|
||||
DECLARE_READ8_MEMBER( unknown_portb_r );
|
||||
DECLARE_READ8_MEMBER( unknown_portc_r );
|
||||
DECLARE_WRITE8_MEMBER( unknown_porta_w );
|
||||
DECLARE_WRITE8_MEMBER( unknown_portb_w );
|
||||
DECLARE_WRITE8_MEMBER( video_control_w );
|
||||
DECLARE_READ8_MEMBER( sound_data_r );
|
||||
|
||||
// custom I/O
|
||||
DECLARE_READ16_MEMBER( outrun_custom_io_r );
|
||||
DECLARE_WRITE16_MEMBER( outrun_custom_io_w );
|
||||
DECLARE_READ16_MEMBER( shangon_custom_io_r );
|
||||
DECLARE_WRITE16_MEMBER( shangon_custom_io_w );
|
||||
|
||||
// video rendering
|
||||
UINT32 screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_shangon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
// wrappers for legacy functions (to be removed)
|
||||
template<read16_space_func _Legacy>
|
||||
READ16_MEMBER( legacy_wrapper_r ) { return _Legacy(&space, offset, mem_mask); }
|
||||
template<write16_space_func _Legacy>
|
||||
WRITE16_MEMBER( legacy_wrapper ) { _Legacy(&space, offset, data, mem_mask); }
|
||||
|
||||
protected:
|
||||
// timer IDs
|
||||
enum
|
||||
{
|
||||
TID_SCANLINE,
|
||||
TID_IRQ2_GEN,
|
||||
TID_SOUND_WRITE
|
||||
};
|
||||
|
||||
// device overrides
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
// internal helpers
|
||||
void init_generic();
|
||||
void update_main_irqs();
|
||||
static void m68k_reset_callback(device_t *device);
|
||||
|
||||
// devices
|
||||
required_device<sega_315_5195_mapper_device> m_mapper;
|
||||
required_device<m68000_device> m_maincpu;
|
||||
required_device<m68000_device> m_subcpu;
|
||||
required_device<z80_device> m_soundcpu;
|
||||
required_device<ppi8255_device> m_ppi8255;
|
||||
optional_device<nvram_device> m_nvram;
|
||||
|
||||
// memory
|
||||
required_shared_ptr<UINT16> m_workram;
|
||||
|
||||
// configuration
|
||||
read16_delegate m_custom_io_r;
|
||||
write16_delegate m_custom_io_w;
|
||||
const UINT8 * m_custom_map;
|
||||
bool m_is_shangon;
|
||||
|
||||
// internal state
|
||||
emu_timer * m_scanline_timer;
|
||||
UINT8 m_irq2_state;
|
||||
UINT8 m_adc_select;
|
||||
UINT8 m_vblank_irq_state;
|
||||
};
|
||||
|
||||
|
||||
// ======================> segaxbd_state
|
||||
|
||||
class segaxbd_state : public driver_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
segaxbd_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subcpu(*this, "subcpu"),
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_soundcpu2(*this, "soundcpu2"),
|
||||
m_mcu(*this, "mcu"),
|
||||
m_315_5250_1(*this, "5250_main"),
|
||||
m_gprider_hack(false),
|
||||
m_timer_irq_state(0),
|
||||
m_vblank_irq_state(0),
|
||||
m_road_priority(0),
|
||||
m_loffire_sync(NULL),
|
||||
m_lastsurv_mux(0)
|
||||
{
|
||||
memset(m_adc_reverse, 0, sizeof(m_adc_reverse));
|
||||
memset(m_iochip_custom_io_r, 0, sizeof(m_iochip_custom_io_r));
|
||||
memset(m_iochip_custom_io_w, 0, sizeof(m_iochip_custom_io_w));
|
||||
memset(m_iochip_regs, 0, sizeof(m_iochip_regs));
|
||||
}
|
||||
|
||||
//protected:
|
||||
// devices
|
||||
required_device<m68000_device> m_maincpu;
|
||||
required_device<m68000_device> m_subcpu;
|
||||
required_device<z80_device> m_soundcpu;
|
||||
optional_device<z80_device> m_soundcpu2;
|
||||
optional_device<i8751_device> m_mcu;
|
||||
required_device<ic_315_5250_device> m_315_5250_1;
|
||||
|
||||
// configuration
|
||||
bool m_gprider_hack;
|
||||
bool m_adc_reverse[8];
|
||||
UINT8 (*m_iochip_custom_io_r[2][8])(running_machine &machine, UINT8 data);
|
||||
void (*m_iochip_custom_io_w[2][8])(running_machine &machine, UINT8 data);
|
||||
|
||||
// internal state
|
||||
emu_timer * m_scanline_timer;
|
||||
UINT8 m_timer_irq_state;
|
||||
UINT8 m_vblank_irq_state;
|
||||
UINT8 m_iochip_regs[2][8];
|
||||
UINT8 m_road_priority;
|
||||
|
||||
UINT8 m_adc_reverse[8];
|
||||
|
||||
UINT8 m_gprider_hack;
|
||||
UINT16 *m_loffire_sync;
|
||||
// game-specific state
|
||||
UINT16 * m_loffire_sync;
|
||||
UINT8 m_lastsurv_mux;
|
||||
};
|
||||
|
||||
|
||||
/* devices */
|
||||
device_t *m_maincpu;
|
||||
device_t *m_soundcpu;
|
||||
device_t *m_soundcpu2;
|
||||
device_t *m_subcpu;
|
||||
device_t *m_subx;
|
||||
device_t *m_suby;
|
||||
device_t *m_mcu;
|
||||
device_t *m_ymsnd;
|
||||
device_t *m_ppi8255;
|
||||
device_t *m_n7751;
|
||||
device_t *m_ppi8255_1;
|
||||
device_t *m_ppi8255_2;
|
||||
optional_device<timer_device> m_interrupt_timer;
|
||||
device_t *m_315_5248_1;
|
||||
device_t *m_315_5250_1;
|
||||
device_t *m_315_5250_2;
|
||||
// ======================> segaybd_state
|
||||
|
||||
class segaybd_state : public driver_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
segaybd_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subx(*this, "subx"),
|
||||
m_suby(*this, "suby"),
|
||||
m_soundcpu(*this, "soundcpu")
|
||||
{
|
||||
memset(m_analog_data, 0, sizeof(m_analog_data));
|
||||
memset(m_misc_io_data, 0, sizeof(m_misc_io_data));
|
||||
}
|
||||
|
||||
//protected:
|
||||
// devices
|
||||
required_device<m68000_device> m_maincpu;
|
||||
required_device<m68000_device> m_subx;
|
||||
required_device<m68000_device> m_suby;
|
||||
required_device<z80_device> m_soundcpu;
|
||||
|
||||
// internal state
|
||||
emu_timer * m_scanline_timer;
|
||||
UINT8 m_analog_data[4];
|
||||
int m_irq2_scanline;
|
||||
UINT8 m_timer_irq_state;
|
||||
UINT8 m_vblank_irq_state;
|
||||
UINT8 m_misc_io_data[0x10];
|
||||
bitmap_ind16 * m_tmp_bitmap;
|
||||
};
|
||||
|
||||
|
||||
@ -114,28 +714,6 @@ SCREEN_UPDATE_IND16( hangon );
|
||||
VIDEO_START( system16a );
|
||||
SCREEN_UPDATE_IND16( system16a );
|
||||
|
||||
/*----------- defined in video/segas16b.c -----------*/
|
||||
|
||||
VIDEO_START( system16b );
|
||||
VIDEO_START( timscanr );
|
||||
SCREEN_UPDATE_IND16( system16b );
|
||||
|
||||
/*----------- defined in video/segas18.c -----------*/
|
||||
|
||||
VIDEO_START( system18 );
|
||||
SCREEN_UPDATE_IND16( system18 );
|
||||
|
||||
void system18_set_grayscale(running_machine &machine, int enable);
|
||||
void system18_set_vdp_enable(running_machine &machine, int eanble);
|
||||
void system18_set_vdp_mixing(running_machine &machine, int mixing);
|
||||
|
||||
/*----------- defined in video/segaorun.c -----------*/
|
||||
|
||||
VIDEO_START( outrun );
|
||||
VIDEO_START( shangon );
|
||||
SCREEN_UPDATE_IND16( outrun );
|
||||
SCREEN_UPDATE_IND16( shangon );
|
||||
|
||||
/*----------- defined in video/segaxbd.c -----------*/
|
||||
|
||||
VIDEO_START( xboard );
|
||||
@ -145,10 +723,3 @@ SCREEN_UPDATE_IND16( xboard );
|
||||
|
||||
VIDEO_START( yboard );
|
||||
SCREEN_UPDATE_IND16( yboard );
|
||||
|
||||
|
||||
/*----------- defined in machine/s16fd.c -----------*/
|
||||
|
||||
void *fd1094_get_decrypted_base(void);
|
||||
void fd1094_machine_init(device_t *device);
|
||||
void fd1094_driver_init(running_machine &machine, const char* tag, void (*set_decrypted)(running_machine &, UINT8 *));
|
||||
|
@ -96,12 +96,6 @@ public:
|
||||
void reset_control_w(UINT8 data);
|
||||
};
|
||||
|
||||
/*----------- defined in machine/s24fd.c -----------*/
|
||||
|
||||
extern void s24_fd1094_machine_init(running_machine &machine);
|
||||
extern void s24_fd1094_driver_init(running_machine &machine);
|
||||
|
||||
|
||||
/*----------- defined in video/segas24.c -----------*/
|
||||
|
||||
SCREEN_UPDATE_IND16(system24);
|
||||
|
@ -1,135 +1,147 @@
|
||||
/***************************************************************************
|
||||
|
||||
Hitachi FD1089A/FD1089B encryption emulation
|
||||
Hitachi FD1089A/FD1089B encryption emulation
|
||||
|
||||
Decryption tables provided by Charles MacDonald
|
||||
Decryption algorithm by Nicola Salmoria
|
||||
LCG algorithm by Andreas Naive
|
||||
****************************************************************************
|
||||
|
||||
The FD1089 is a 68000 with built-in encryption.
|
||||
It contains some battery-backed RAM, when the battery dies the CPU stops
|
||||
working.
|
||||
Copyright Nicola Salmoria, Andreas Naive, and Charles MacDonald.
|
||||
|
||||
Both opcodes and data are encrypted, using different (but related) mappings.
|
||||
Decryption works on 16-bit words, but only 8 bits are affected, the other 8 are
|
||||
left untouched. A special value in internal RAM disables the encryption, this
|
||||
is necessary otherwise RAM would not work as expected (writing data and reading
|
||||
it back would return a different number).
|
||||
All rights reserved.
|
||||
|
||||
The FD1089A and FD1089B work in the same way, but the decryption tables are
|
||||
different. The internal RAM contains the 8-bit key to use at every address
|
||||
(only 12 bits of the address are used, so the encryption repeats).
|
||||
****************************************************************************
|
||||
|
||||
The FD1089 design is clearly derived from the MC8123. The MC8123 is a Z80 so it
|
||||
made sense to encrypt all 8 data bits and use 12 of the 16 address bits. It makes
|
||||
a lot less sense to encrypt only half of the 16 data bits; using 12 of the 24
|
||||
address bits might be ok, but not in the way it was done. The choice of address
|
||||
bits to use was probably dictated by the need to not encrypt data in certain areas
|
||||
of the address space, so they had to include the top 8 bits of the address.
|
||||
However this means that if you pick e.g. area 000000-00FFFF, where most of the
|
||||
program code resides, just 4 address bits affect the encryption, making it very
|
||||
weak when compared to the MC8123. Out of the 16KB of internal RAM, you need less
|
||||
than 128 bytes to decrypt a whole game - the rest is not used. A waste of space
|
||||
and security. Also, since only 8 of the 16 bits are encrypted, it is very easy
|
||||
to use the unencrypted ones to search for known sequences of code or data.
|
||||
Decryption tables provided by Charles MacDonald
|
||||
Decryption algorithm by Nicola Salmoria
|
||||
LCG algorithm by Andreas Naive
|
||||
|
||||
Like for the MC8123, the contents of the internal RAM were generated using a
|
||||
linear congruential generator, so the whole key can be generated starting from
|
||||
a single 24-bit seed. Note however that the "don't decrypt" data sections need
|
||||
special treatment so it's not possible to derive the precise key without access
|
||||
to the CPU.
|
||||
The FD1089 is a 68000 with built-in encryption.
|
||||
It contains some battery-backed RAM, when the battery dies the CPU stops
|
||||
working.
|
||||
|
||||
static int rndseed;
|
||||
Both opcodes and data are encrypted, using different (but related) mappings.
|
||||
Decryption works on 16-bit words, but only 8 bits are affected, the other 8 are
|
||||
left untouched. A special value in internal RAM disables the encryption, this
|
||||
is necessary otherwise RAM would not work as expected (writing data and reading
|
||||
it back would return a different number).
|
||||
|
||||
int rnd()
|
||||
{
|
||||
rndseed = rndseed * 0x290029;
|
||||
return (rndseed >> 16) & 0xff;
|
||||
}
|
||||
The FD1089A and FD1089B work in the same way, but the decryption tables are
|
||||
different. The internal RAM contains the 8-bit key to use at every address
|
||||
(only 12 bits of the address are used, so the encryption repeats).
|
||||
|
||||
void generate_key(int seed)
|
||||
{
|
||||
int i;
|
||||
The FD1089 design is clearly derived from the MC8123. The MC8123 is a Z80 so it
|
||||
made sense to encrypt all 8 data bits and use 12 of the 16 address bits. It makes
|
||||
a lot less sense to encrypt only half of the 16 data bits; using 12 of the 24
|
||||
address bits might be ok, but not in the way it was done. The choice of address
|
||||
bits to use was probably dictated by the need to not encrypt data in certain areas
|
||||
of the address space, so they had to include the top 8 bits of the address.
|
||||
However this means that if you pick e.g. area 000000-00FFFF, where most of the
|
||||
program code resides, just 4 address bits affect the encryption, making it very
|
||||
weak when compared to the MC8123. Out of the 16KB of internal RAM, you need less
|
||||
than 128 bytes to decrypt a whole game - the rest is not used. A waste of space
|
||||
and security. Also, since only 8 of the 16 bits are encrypted, it is very easy
|
||||
to use the unencrypted ones to search for known sequences of code or data.
|
||||
|
||||
rndseed = seed;
|
||||
for (i = 0; i < 0x1000; ++i)
|
||||
{
|
||||
if ("we must encrypt this data table position")
|
||||
{
|
||||
UINT8 byteval;
|
||||
Like for the MC8123, the contents of the internal RAM were generated using a
|
||||
linear congruential generator, so the whole key can be generated starting from
|
||||
a single 24-bit seed. Note however that the "don't decrypt" data sections need
|
||||
special treatment so it's not possible to derive the precise key without access
|
||||
to the CPU.
|
||||
|
||||
do
|
||||
{
|
||||
byteval = rnd();
|
||||
} while (byteval == 0x40);
|
||||
static int rndseed;
|
||||
|
||||
opcode_key[i] = byteval;
|
||||
int rnd()
|
||||
{
|
||||
rndseed = rndseed * 0x290029;
|
||||
return (rndseed >> 16) & 0xff;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
byteval = rnd();
|
||||
} while (byteval == 0x40);
|
||||
void generate_key(int seed)
|
||||
{
|
||||
int i;
|
||||
|
||||
data_key[i] = byteval;
|
||||
}
|
||||
}
|
||||
rndseed = seed;
|
||||
for (i = 0; i < 0x1000; ++i)
|
||||
{
|
||||
if ("we must encrypt this data table position")
|
||||
{
|
||||
UINT8 byteval;
|
||||
|
||||
for (i = 0; i < 0x1000; ++i)
|
||||
{
|
||||
if ("we mustn't encrypt this data table position")
|
||||
{
|
||||
UINT8 byteval;
|
||||
do
|
||||
{
|
||||
byteval = rnd();
|
||||
} while (byteval == 0x40);
|
||||
|
||||
do
|
||||
{
|
||||
byteval = rnd();
|
||||
} while (byteval == 0x40);
|
||||
opcode_key[i] = byteval;
|
||||
|
||||
opcode_key[i] = byteval;
|
||||
data_key[i] = 0x40;
|
||||
}
|
||||
}
|
||||
}
|
||||
do
|
||||
{
|
||||
byteval = rnd();
|
||||
} while (byteval == 0x40);
|
||||
|
||||
data_key[i] = byteval;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 0x1000; ++i)
|
||||
{
|
||||
if ("we mustn't encrypt this data table position")
|
||||
{
|
||||
UINT8 byteval;
|
||||
|
||||
do
|
||||
{
|
||||
byteval = rnd();
|
||||
} while (byteval == 0x40);
|
||||
|
||||
opcode_key[i] = byteval;
|
||||
data_key[i] = 0x40;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Note that when both FD1089A and FD1089B versions of a game exist, they use the
|
||||
same key.
|
||||
Note that when both FD1089A and FD1089B versions of a game exist, they use the
|
||||
same key.
|
||||
|
||||
Known games that use this CPU:
|
||||
Known games that use this CPU:
|
||||
|
||||
CPU # Type Status Game Seed Unencrypted data range
|
||||
--------- ------- --- -------------------- ------ -----------------------------------
|
||||
317-0013A FD1089B [1] Enduro Racer 400001 030000-04ffff + 100000-1fffff
|
||||
317-0018 FD1089A [1] Action Fighter 400003 400000-4fffff + 840000-8dffff + c00000-c4ffff + ff0000-ffffff
|
||||
317-0021 FD1089A [2] Alex Kidd 40000b ?
|
||||
317-0022 FD1089A [1] Dunk Shot 40000d 030000-ffffff
|
||||
317-0024 FD1089B [2] Time Scanner 40000f ?
|
||||
317-0027 FD1089B [2] SDI 400011 ?
|
||||
317-0028 FD1089A [2] Defense 400011 ?
|
||||
317-0033 FD1089A [1] Alien Syndrome 400013 030000-ffffff
|
||||
317-0037 FD1089B [2] Alien Syndrome 400013 030000-ffffff
|
||||
317-0034 FD1089B [1] Super Hang-On 400015 030000-06ffff + 100000-2fffff + ff0000-ffffff
|
||||
317-0167 FD1089A [2] Aurail 400030 010000-ffffff
|
||||
317-0168 FD1089B [1] Aurail 400030 010000-ffffff
|
||||
317-???? FD1089A [2] Wonder Boy III 400043 ?
|
||||
317-5021 FD1089B [2] Sukeban Jansi Ryuko 40004b ?
|
||||
CPU # Type Status Game Seed Unencrypted data range
|
||||
--------- ------- --- -------------------- ------ -----------------------------------
|
||||
317-0013A FD1089B [1] Enduro Racer 400001 030000-04ffff + 100000-1fffff
|
||||
317-0018 FD1089A [1] Action Fighter 400003 400000-4fffff + 840000-8dffff + c00000-c4ffff + ff0000-ffffff
|
||||
317-0021 FD1089A [2] Alex Kidd 40000b ?
|
||||
317-0022 FD1089A [1] Dunk Shot 40000d 030000-ffffff
|
||||
317-0024 FD1089B [2] Time Scanner 40000f ?
|
||||
317-0027 FD1089B [2] SDI 400011 ?
|
||||
317-0028 FD1089A [2] Defense 400011 ?
|
||||
317-0033 FD1089A [1] Alien Syndrome 400013 030000-ffffff
|
||||
317-0037 FD1089B [2] Alien Syndrome 400013 030000-ffffff
|
||||
317-0034 FD1089B [1] Super Hang-On 400015 030000-06ffff + 100000-2fffff + ff0000-ffffff
|
||||
317-0167 FD1089A [2] Aurail 400030 010000-ffffff
|
||||
317-0168 FD1089B [1] Aurail 400030 010000-ffffff
|
||||
317-???? FD1089A [2] Wonder Boy III 400043 ?
|
||||
317-5021 FD1089B [2] Sukeban Jansi Ryuko 40004b ?
|
||||
|
||||
[1] Complete
|
||||
[2] Partial
|
||||
[1] Complete
|
||||
[2] Partial
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "fd1089.h"
|
||||
#include "segaic16.h"
|
||||
|
||||
|
||||
struct parameters
|
||||
{
|
||||
int xorval;
|
||||
int s7,s6,s5,s4,s3,s2,s1,s0;
|
||||
};
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
static const UINT8 basetable_fd1089[0x100] =
|
||||
// device type definition
|
||||
const device_type FD1089A = &device_creator<fd1089a_device>;
|
||||
const device_type FD1089B = &device_creator<fd1089b_device>;
|
||||
|
||||
// common base lookup table, shared between A and B variants
|
||||
const UINT8 fd1089_base_device::s_basetable_fd1089[0x100] =
|
||||
{
|
||||
0x00,0x1c,0x76,0x6a,0x5e,0x42,0x24,0x38,0x4b,0x67,0xad,0x81,0xe9,0xc5,0x03,0x2f,
|
||||
0x45,0x69,0xaf,0x83,0xe7,0xcb,0x01,0x2d,0x02,0x1e,0x78,0x64,0x5c,0x40,0x2a,0x36,
|
||||
@ -149,9 +161,8 @@ static const UINT8 basetable_fd1089[0x100] =
|
||||
0x35,0x19,0xd3,0xff,0xc9,0xe5,0x23,0x0f,0xbe,0xa2,0xc8,0xd4,0x4e,0x52,0x34,0x28,
|
||||
};
|
||||
|
||||
|
||||
/* common to FD1089A and FD1089B */
|
||||
static const struct parameters addr_params[16] =
|
||||
// address decryption parameters, shared between A and B variants
|
||||
const fd1089_base_device::decrypt_parameters fd1089_base_device::s_addr_params[16] =
|
||||
{
|
||||
{ 0x23, 6,4,5,7,3,0,1,2 },
|
||||
{ 0x92, 2,5,3,6,7,1,0,4 },
|
||||
@ -171,9 +182,97 @@ static const struct parameters addr_params[16] =
|
||||
{ 0x5b, 0,7,5,3,1,4,2,6 },
|
||||
};
|
||||
|
||||
static UINT8 rearrange_key(UINT8 table, int opcode)
|
||||
// data decryption parameters for the A variant
|
||||
const fd1089_base_device::decrypt_parameters fd1089_base_device::s_data_params_a[16] =
|
||||
{
|
||||
if (opcode == 0)
|
||||
{ 0x55, 6,5,1,0,7,4,2,3 },
|
||||
{ 0x94, 7,6,4,2,0,5,1,3 },
|
||||
{ 0x8d, 1,4,2,3,0,6,7,5 },
|
||||
{ 0x9a, 4,3,5,6,0,2,1,7 },
|
||||
{ 0x72, 4,3,7,0,5,6,1,2 },
|
||||
{ 0xff, 1,7,2,3,6,4,5,0 },
|
||||
{ 0x06, 6,5,3,2,4,1,0,7 },
|
||||
{ 0xc5, 3,5,1,4,2,7,0,6 },
|
||||
{ 0xec, 4,7,5,1,6,0,2,3 },
|
||||
{ 0x89, 3,5,0,6,1,2,7,4 },
|
||||
{ 0x5c, 1,3,0,7,5,2,4,6 },
|
||||
{ 0x3f, 7,3,0,2,4,6,1,5 },
|
||||
{ 0x57, 6,4,7,2,1,5,3,0 },
|
||||
{ 0xf7, 6,3,7,0,5,4,2,1 },
|
||||
{ 0x3a, 6,1,3,2,7,4,5,0 },
|
||||
{ 0xac, 1,6,3,5,0,7,4,2 },
|
||||
};
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CORE IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// fd1089_base_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
fd1089_base_device::fd1089_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, char cputype)
|
||||
: m68000_device(mconfig, M68000, tag, owner, clock),
|
||||
m_cputype(cputype)
|
||||
{
|
||||
// override the name after the m68000 initializes
|
||||
m_name.printf("FD1089%c", m_cputype);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - one-time device initialization
|
||||
//-------------------------------------------------
|
||||
|
||||
void fd1089_base_device::device_start()
|
||||
{
|
||||
// start the base device
|
||||
m68000_device::device_start();
|
||||
|
||||
// find the key
|
||||
m_key = memregion("key")->base();
|
||||
if (m_key == NULL)
|
||||
throw emu_fatalerror("FD1089 key region not found!");
|
||||
|
||||
// get a pointer to the ROM region
|
||||
UINT16 *rombase = reinterpret_cast<UINT16 *>(region()->base());
|
||||
if (rombase == NULL)
|
||||
throw emu_fatalerror("FD1089 found no ROM data to decrypt!");
|
||||
|
||||
// determine length and resize our internal buffers
|
||||
UINT32 romsize = region()->bytes();
|
||||
m_plaintext.resize(romsize/2);
|
||||
m_decrypted_opcodes.resize(romsize/2);
|
||||
|
||||
// copy the plaintext
|
||||
memcpy(m_plaintext, rombase, romsize);
|
||||
|
||||
// decrypt it, overwriting original data with the decrypted data
|
||||
decrypt(0x000000, romsize, m_plaintext, m_decrypted_opcodes, rombase);
|
||||
|
||||
// mark the ROM region as decrypted, pointing to the opcodes (if it is mapped)
|
||||
address_space *program = space(AS_PROGRAM);
|
||||
if (program->get_read_ptr(0) != NULL)
|
||||
program->set_decrypted_region(0x000000, romsize - 1, m_decrypted_opcodes);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERNAL HELPERS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// rearrange_key - shuffle bits in the table
|
||||
// based on whether this is an opcode or a data
|
||||
// decode
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 fd1089_base_device::rearrange_key(UINT8 table, bool opcode)
|
||||
{
|
||||
if (!opcode)
|
||||
{
|
||||
table ^= (1<<4);
|
||||
table ^= (1<<5);
|
||||
@ -223,41 +322,21 @@ static UINT8 rearrange_key(UINT8 table, int opcode)
|
||||
}
|
||||
|
||||
|
||||
static int decode_fd1089a(int val,int key,int opcode)
|
||||
//-------------------------------------------------
|
||||
// decode_fd1089a - decode an 8-bit value
|
||||
// according to FD1089A rules
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 fd1089_base_device::decode_fd1089a(UINT8 val, UINT8 key, bool opcode)
|
||||
{
|
||||
int table;
|
||||
|
||||
static const struct parameters data_params[16] =
|
||||
{
|
||||
{ 0x55, 6,5,1,0,7,4,2,3 },
|
||||
{ 0x94, 7,6,4,2,0,5,1,3 },
|
||||
{ 0x8d, 1,4,2,3,0,6,7,5 },
|
||||
{ 0x9a, 4,3,5,6,0,2,1,7 },
|
||||
{ 0x72, 4,3,7,0,5,6,1,2 },
|
||||
{ 0xff, 1,7,2,3,6,4,5,0 },
|
||||
{ 0x06, 6,5,3,2,4,1,0,7 },
|
||||
{ 0xc5, 3,5,1,4,2,7,0,6 },
|
||||
{ 0xec, 4,7,5,1,6,0,2,3 },
|
||||
{ 0x89, 3,5,0,6,1,2,7,4 },
|
||||
{ 0x5c, 1,3,0,7,5,2,4,6 },
|
||||
{ 0x3f, 7,3,0,2,4,6,1,5 },
|
||||
{ 0x57, 6,4,7,2,1,5,3,0 },
|
||||
{ 0xf7, 6,3,7,0,5,4,2,1 },
|
||||
{ 0x3a, 6,1,3,2,7,4,5,0 },
|
||||
{ 0xac, 1,6,3,5,0,7,4,2 },
|
||||
};
|
||||
const struct parameters *p;
|
||||
const struct parameters *q;
|
||||
int family;
|
||||
|
||||
/* special case - don't decrypt */
|
||||
// special case - don't decrypt
|
||||
if (key == 0x40)
|
||||
return val;
|
||||
|
||||
table = rearrange_key(key, opcode);
|
||||
UINT8 table = rearrange_key(key, opcode);
|
||||
|
||||
p = &addr_params[table >> 4];
|
||||
val = BITSWAP8(val, p->s7,p->s6,p->s5,p->s4,p->s3,p->s2,p->s1,p->s0) ^ p->xorval;
|
||||
const decrypt_parameters &p = s_addr_params[table >> 4];
|
||||
val = BITSWAP8(val, p.s7,p.s6,p.s5,p.s4,p.s3,p.s2,p.s1,p.s0) ^ p.xorval;
|
||||
|
||||
if (BIT(table,3)) val ^= 0x01;
|
||||
if (BIT(table,0)) val ^= 0xb1;
|
||||
@ -266,9 +345,9 @@ static int decode_fd1089a(int val,int key,int opcode)
|
||||
if (BIT(table,6))
|
||||
val ^= 0x01;
|
||||
|
||||
val = basetable_fd1089[val];
|
||||
val = s_basetable_fd1089[val];
|
||||
|
||||
family = table & 0x07;
|
||||
UINT8 family = table & 0x07;
|
||||
if (opcode == 0)
|
||||
{
|
||||
if (BIT(~table,6) & BIT(table,2)) family ^= 8;
|
||||
@ -294,29 +373,30 @@ static int decode_fd1089a(int val,int key,int opcode)
|
||||
if (BIT(~val,6))
|
||||
val = BITSWAP8(val, 7,6,5,4,2,3,0,1);
|
||||
|
||||
q = &data_params[family];
|
||||
const decrypt_parameters &q = s_data_params_a[family];
|
||||
|
||||
val ^= q->xorval;
|
||||
val = BITSWAP8(val, q->s7,q->s6,q->s5,q->s4,q->s3,q->s2,q->s1,q->s0);
|
||||
val ^= q.xorval;
|
||||
val = BITSWAP8(val, q.s7,q.s6,q.s5,q.s4,q.s3,q.s2,q.s1,q.s0);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static int decode_fd1089b(int val,int key,int opcode)
|
||||
|
||||
//-------------------------------------------------
|
||||
// decode_fd1089b - decode an 8-bit value
|
||||
// according to FD1089B rules
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 fd1089_base_device::decode_fd1089b(UINT8 val, UINT8 key, bool opcode)
|
||||
{
|
||||
int table;
|
||||
int xorval;
|
||||
|
||||
const struct parameters *p;
|
||||
|
||||
/* special case - don't decrypt */
|
||||
// special case - don't decrypt
|
||||
if (key == 0x40)
|
||||
return val;
|
||||
|
||||
table = rearrange_key(key, opcode);
|
||||
UINT8 table = rearrange_key(key, opcode);
|
||||
|
||||
p = &addr_params[table >> 4];
|
||||
val = BITSWAP8(val, p->s7,p->s6,p->s5,p->s4,p->s3,p->s2,p->s1,p->s0) ^ p->xorval;
|
||||
const decrypt_parameters &p = s_addr_params[table >> 4];
|
||||
val = BITSWAP8(val, p.s7,p.s6,p.s5,p.s4,p.s3,p.s2,p.s1,p.s0) ^ p.xorval;
|
||||
|
||||
if (BIT(table,3)) val ^= 0x01;
|
||||
if (BIT(table,0)) val ^= 0xb1;
|
||||
@ -325,9 +405,9 @@ static int decode_fd1089b(int val,int key,int opcode)
|
||||
if (BIT(table,6))
|
||||
val ^= 0x01;
|
||||
|
||||
val = basetable_fd1089[val];
|
||||
val = s_basetable_fd1089[val];
|
||||
|
||||
xorval = 0;
|
||||
UINT8 xorval = 0;
|
||||
if (opcode == 0)
|
||||
{
|
||||
if (BIT(~table,6) & BIT(table,2)) xorval ^= 0x01;
|
||||
@ -360,32 +440,29 @@ static int decode_fd1089b(int val,int key,int opcode)
|
||||
}
|
||||
|
||||
|
||||
enum
|
||||
//-------------------------------------------------
|
||||
// decrypt_one - decrypt a single 16-bit value
|
||||
// interpreted as being read at the given address
|
||||
// as either an opcode or as data
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT16 fd1089_base_device::decrypt_one(offs_t addr, UINT16 val, const UINT8 *key, bool opcode, char cputype)
|
||||
{
|
||||
FD1089A,
|
||||
FD1089B
|
||||
};
|
||||
|
||||
static UINT16 fd1089_decrypt(offs_t addr,UINT16 val,const UINT8 *key,int opcode,int cputype)
|
||||
{
|
||||
int tbl_num,src;
|
||||
|
||||
/* pick the translation table from bits ff022a of the address */
|
||||
tbl_num = ((addr & 0x000002) >> 1) |
|
||||
((addr & 0x000008) >> 2) |
|
||||
((addr & 0x000020) >> 3) |
|
||||
((addr & 0x000200) >> 6) |
|
||||
((addr & 0xff0000) >> 12);
|
||||
|
||||
src = ((val & 0x0008) >> 3) |
|
||||
((val & 0x0040) >> 5) |
|
||||
((val & 0xfc00) >> 8);
|
||||
// pick the translation table from bits ff022a of the address
|
||||
int tbl_num = ((addr & 0x000002) >> 1) |
|
||||
((addr & 0x000008) >> 2) |
|
||||
((addr & 0x000020) >> 3) |
|
||||
((addr & 0x000200) >> 6) |
|
||||
((addr & 0xff0000) >> 12);
|
||||
|
||||
UINT16 src = ((val & 0x0008) >> 3) |
|
||||
((val & 0x0040) >> 5) |
|
||||
((val & 0xfc00) >> 8);
|
||||
|
||||
switch (cputype)
|
||||
{
|
||||
case FD1089A: src = decode_fd1089a(src, key[tbl_num + (1^opcode) * 0x1000], opcode); break;
|
||||
case FD1089B: src = decode_fd1089b(src, key[tbl_num + (1^opcode) * 0x1000], opcode); break;
|
||||
case 'A': src = decode_fd1089a(src, key[tbl_num + (opcode ? 0 : 1) * 0x1000], opcode); break;
|
||||
case 'B': src = decode_fd1089b(src, key[tbl_num + (opcode ? 0 : 1) * 0x1000], opcode); break;
|
||||
}
|
||||
|
||||
src = ((src & 0x01) << 3) |
|
||||
@ -395,48 +472,18 @@ static UINT16 fd1089_decrypt(offs_t addr,UINT16 val,const UINT8 *key,int opcode,
|
||||
return (val & ~0xfc48) | src;
|
||||
}
|
||||
|
||||
static UINT16 *decrypted;
|
||||
|
||||
static void clear_decrypted(running_machine &machine)
|
||||
//-------------------------------------------------
|
||||
// decrypt - decrypt a buffers' worth of opcodes
|
||||
// and data
|
||||
//-------------------------------------------------
|
||||
|
||||
void fd1089_base_device::decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT16 *dataptr)
|
||||
{
|
||||
decrypted = NULL;
|
||||
}
|
||||
|
||||
static void sys16_decrypt(running_machine &machine, const UINT8 *key,int cputype)
|
||||
{
|
||||
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
|
||||
UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
|
||||
int size = machine.root_device().memregion("maincpu")->bytes();
|
||||
int A;
|
||||
decrypted = auto_alloc_array(machine, UINT16, size/2);
|
||||
|
||||
machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(clear_decrypted), &machine));
|
||||
space->set_decrypted_region(0x000000, size - 1, decrypted);
|
||||
|
||||
for (A = 0;A < size;A+=2)
|
||||
for (offs_t offset = 0; offset < size; offset += 2)
|
||||
{
|
||||
UINT16 src = rom[A/2];
|
||||
|
||||
/* decode the opcodes */
|
||||
decrypted[A/2] = fd1089_decrypt(A,src,key,1,cputype);
|
||||
|
||||
/* decode the data */
|
||||
rom[A/2] = fd1089_decrypt(A,src,key,0,cputype);
|
||||
UINT16 src = srcptr[offset / 2];
|
||||
opcodesptr[offset / 2] = decrypt_one(baseaddr + offset, src, m_key, true, m_cputype);
|
||||
dataptr[offset / 2] = decrypt_one(baseaddr + offset, src, m_key, false, m_cputype);
|
||||
}
|
||||
}
|
||||
|
||||
void *fd1089_get_decrypted_base(void)
|
||||
{
|
||||
return decrypted;
|
||||
}
|
||||
|
||||
void fd1089a_decrypt(running_machine &machine)
|
||||
{
|
||||
sys16_decrypt(machine, machine.root_device().memregion("fd1089a")->base(), FD1089A);
|
||||
}
|
||||
|
||||
void fd1089b_decrypt(running_machine &machine)
|
||||
{
|
||||
sys16_decrypt(machine, machine.root_device().memregion("fd1089b")->base(), FD1089B);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,100 @@
|
||||
void *fd1089_get_decrypted_base(void);
|
||||
/***************************************************************************
|
||||
|
||||
void fd1089a_decrypt(running_machine &machine);
|
||||
void fd1089b_decrypt(running_machine &machine);
|
||||
Hitachi FD1089A/FD1089B encryption emulation
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Nicola Salmoria, Andreas Naive, and Charles MacDonald.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __FD1089_H__
|
||||
#define __FD1089_H__
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
extern const device_type FD1089A;
|
||||
extern const device_type FD1089B;
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> fd1089_base_device
|
||||
|
||||
// base device, shared implementation between A and B variants
|
||||
class fd1089_base_device : public m68000_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
fd1089_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, char cputype);
|
||||
|
||||
// explicit decryption helpers
|
||||
void decrypt(offs_t baseaddr, UINT32 size, offs_t regionoffs, UINT16 *opcodesptr, UINT16 *dataptr) { decrypt(baseaddr, size, &m_plaintext[regionoffs/2], opcodesptr, dataptr); }
|
||||
|
||||
protected:
|
||||
// device overrides
|
||||
virtual void device_start();
|
||||
|
||||
// internal helpers
|
||||
UINT8 rearrange_key(UINT8 table, bool opcode);
|
||||
UINT8 decode_fd1089a(UINT8 val, UINT8 key, bool opcode);
|
||||
UINT8 decode_fd1089b(UINT8 val, UINT8 key, bool opcode);
|
||||
UINT16 decrypt_one(offs_t addr, UINT16 val, const UINT8 *key, bool opcode, char cputype);
|
||||
void decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT16 *dataptr);
|
||||
|
||||
// internal state
|
||||
const UINT8 * m_key;
|
||||
char m_cputype;
|
||||
dynamic_array<UINT16> m_plaintext;
|
||||
dynamic_array<UINT16> m_decrypted_opcodes;
|
||||
|
||||
// internal types
|
||||
struct decrypt_parameters
|
||||
{
|
||||
UINT8 xorval;
|
||||
UINT8 s7,s6,s5,s4,s3,s2,s1,s0;
|
||||
};
|
||||
|
||||
// static tables
|
||||
static const UINT8 s_basetable_fd1089[0x100];
|
||||
static const decrypt_parameters s_addr_params[16];
|
||||
static const decrypt_parameters s_data_params_a[16];
|
||||
};
|
||||
|
||||
|
||||
// ======================> fd1089a_device
|
||||
|
||||
// FD1089A variant
|
||||
class fd1089a_device : public fd1089_base_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
fd1089a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: fd1089_base_device(mconfig, FD1089A, tag, owner, clock, 'A') { }
|
||||
};
|
||||
|
||||
|
||||
// ======================> fd1089b_device
|
||||
|
||||
// FD1089B variant
|
||||
class fd1089b_device : public fd1089_base_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
fd1089b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: fd1089_base_device(mconfig, FD1089B, tag, owner, clock, 'B') { }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,15 +1,126 @@
|
||||
#define FD1094_STATE_RESET 0x0100
|
||||
#define FD1094_STATE_IRQ 0x0200
|
||||
#define FD1094_STATE_RTE 0x0300
|
||||
/***************************************************************************
|
||||
|
||||
int fd1094_set_state(UINT8 *key,int state);
|
||||
int fd1094_decode(int address,int val,UINT8 *key,int vector_fetch);
|
||||
Hitachi FD1094 encryption emulation
|
||||
|
||||
typedef struct _fd1094_constraint fd1094_constraint;
|
||||
struct _fd1094_constraint
|
||||
****************************************************************************
|
||||
|
||||
Copyright Nicola Salmoria, Andreas Naive, and Charles MacDonald.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __FD1094_H__
|
||||
#define __FD1094_H__
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
extern const device_type FD1094;
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
class fd1094_device;
|
||||
|
||||
|
||||
// ======================> fd1094_decryption_cache
|
||||
|
||||
class fd1094_decryption_cache
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
fd1094_decryption_cache(fd1094_device &fd1094);
|
||||
|
||||
// getters
|
||||
fd1094_device &fd1094() const { return m_fd1094; }
|
||||
UINT16 *decrypted_opcodes(UINT8 state);
|
||||
|
||||
// operations
|
||||
void reset();
|
||||
void configure(offs_t baseaddress, UINT32 size, offs_t rgnoffset);
|
||||
|
||||
protected:
|
||||
// internal state
|
||||
fd1094_device & m_fd1094;
|
||||
UINT32 m_baseaddress;
|
||||
UINT32 m_size;
|
||||
UINT32 m_rgnoffset;
|
||||
dynamic_array<UINT16> m_decrypted_opcodes[256];
|
||||
};
|
||||
|
||||
|
||||
// ======================> fd1094_device
|
||||
|
||||
// base device, shared implementation between A and B variants
|
||||
class fd1094_device : public m68000_device
|
||||
{
|
||||
public:
|
||||
typedef delegate<void (UINT8)> state_change_delegate;
|
||||
|
||||
// construction/destruction
|
||||
fd1094_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// explicit decryption helpers
|
||||
void decrypt(offs_t baseaddr, UINT32 size, offs_t regionoffs, UINT16 *opcodesptr, UINT8 state) { decrypt(baseaddr, size, m_srcbase + regionoffs/2, opcodesptr, state); }
|
||||
|
||||
// live state management
|
||||
UINT8 state() const { return m_irqmode ? m_key[0] : m_state; }
|
||||
void change_state(int newstate = -1);
|
||||
void notify_state_change(state_change_delegate callback) { m_state_change = callback; }
|
||||
|
||||
// constants
|
||||
enum
|
||||
{
|
||||
STATE_RESET = 0x100,
|
||||
STATE_IRQ = 0x200,
|
||||
STATE_RTE = 0x300
|
||||
};
|
||||
|
||||
protected:
|
||||
// device overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
virtual void device_postload();
|
||||
|
||||
// internal helpers
|
||||
UINT16 decrypt_one(offs_t address, UINT16 val, const UINT8 *main_key, UINT8 state, bool vector_fetch);
|
||||
void decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT8 state);
|
||||
void default_state_change(UINT8 state);
|
||||
|
||||
// static helpers
|
||||
static void cmp_callback(device_t *device, UINT32 val, UINT8 reg);
|
||||
static IRQ_CALLBACK( irq_callback );
|
||||
static void rte_callback(device_t *device);
|
||||
|
||||
// internal state
|
||||
UINT8 m_state;
|
||||
bool m_irqmode;
|
||||
state_change_delegate m_state_change;
|
||||
fd1094_decryption_cache m_cache;
|
||||
UINT16 * m_srcbase;
|
||||
UINT32 m_srcbytes;
|
||||
const UINT8 * m_key;
|
||||
UINT8 m_masked_opcodes_lookup[2][65536/8/2];
|
||||
|
||||
// static tables
|
||||
static const UINT16 s_masked_opcodes[];
|
||||
};
|
||||
|
||||
struct fd1094_constraint
|
||||
{
|
||||
offs_t pc;
|
||||
UINT16 state;
|
||||
UINT16 value;
|
||||
UINT16 mask;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,11 +1,48 @@
|
||||
#include "emu.h"
|
||||
#include "machine/fddebug.h"
|
||||
|
||||
void fd1094_init_debugging(running_machine &machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(running_machine &))
|
||||
{
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
fddebug.c
|
||||
|
||||
FD1094 decryption helper routines.
|
||||
|
||||
Copyright Nicola Salmoria and the MAME Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
****************************************************************************
|
||||
|
||||
@ -2414,3 +2451,5 @@ static int validate_opcode(address_space *space, UINT32 pc, const UINT8 *opdata,
|
||||
assert(offset == oplength);
|
||||
return iffy ? -oplength : oplength;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,234 +0,0 @@
|
||||
/* System 16 and friends FD1094 handling */
|
||||
|
||||
/*
|
||||
todo:
|
||||
|
||||
support multiple FD1094s (does anything /use/ multiple FD1094s?)
|
||||
make more configurable (select caches per game?)
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/fd1094.h"
|
||||
#include "machine/fddebug.h"
|
||||
#include "includes/segas16.h"
|
||||
|
||||
#define KEY_DEBUGGING 0
|
||||
#define CACHE_ENTRIES 8
|
||||
|
||||
static UINT8 *fd1094_key; // the memory region containing key
|
||||
static UINT16 *fd1094_cpuregion; // the CPU region with encrypted code
|
||||
static UINT32 fd1094_cpuregionsize; // the size of this region in bytes
|
||||
|
||||
static UINT16 *fd1094_userregion; // a user region where the current decrypted state is put and executed from
|
||||
static UINT16 *fd1094_cacheregion[CACHE_ENTRIES]; // a cache region where CACHE_ENTRIES states are stored to improve performance
|
||||
static int fd1094_cached_states[CACHE_ENTRIES]; // array of cached state numbers
|
||||
static int fd1094_current_cacheposition; // current position in cache array
|
||||
|
||||
static int fd1094_state;
|
||||
static int fd1094_selected_state;
|
||||
|
||||
static char fd1094_cputag[64];
|
||||
|
||||
static void (*fd1094_set_decrypted)(running_machine &, UINT8 *);
|
||||
|
||||
void *fd1094_get_decrypted_base(void)
|
||||
{
|
||||
if (!fd1094_key)
|
||||
return NULL;
|
||||
return fd1094_userregion;
|
||||
}
|
||||
|
||||
static void set_decrypted_region(running_machine &machine)
|
||||
{
|
||||
if (fd1094_set_decrypted != NULL)
|
||||
(*fd1094_set_decrypted)(machine, (UINT8 *)fd1094_userregion);
|
||||
else
|
||||
machine.device<cpu_device>(fd1094_cputag)->space(AS_PROGRAM)->set_decrypted_region(0, fd1094_cpuregionsize - 1, fd1094_userregion);
|
||||
}
|
||||
|
||||
/* this function checks the cache to see if the current state is cached,
|
||||
if it is then it copies the cached data to the user region where code is
|
||||
executed from, if its not cached then it gets decrypted to the current
|
||||
cache position using the functions in fd1094.c */
|
||||
static void fd1094_setstate_and_decrypt(running_machine &machine, int state)
|
||||
{
|
||||
int i;
|
||||
UINT32 addr;
|
||||
|
||||
switch (state & 0x300)
|
||||
{
|
||||
case 0x000:
|
||||
case FD1094_STATE_RESET:
|
||||
fd1094_selected_state = state & 0xff;
|
||||
break;
|
||||
}
|
||||
|
||||
fd1094_state = state;
|
||||
|
||||
cpu_set_reg(machine.device(fd1094_cputag), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
|
||||
|
||||
/* set the FD1094 state ready to decrypt.. */
|
||||
state = fd1094_set_state(fd1094_key, state) & 0xff;
|
||||
|
||||
/* first check the cache, if its cached we don't need to decrypt it, just copy */
|
||||
for (i = 0; i < CACHE_ENTRIES; i++)
|
||||
{
|
||||
if (fd1094_cached_states[i] == state)
|
||||
{
|
||||
/* copy cached state */
|
||||
fd1094_userregion = fd1094_cacheregion[i];
|
||||
set_decrypted_region(machine);
|
||||
m68k_set_encrypted_opcode_range(machine.device(fd1094_cputag), 0, fd1094_cpuregionsize);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* mark it as cached (because it will be once we decrypt it) */
|
||||
fd1094_cached_states[fd1094_current_cacheposition] = state;
|
||||
|
||||
for (addr = 0; addr < fd1094_cpuregionsize / 2; addr++)
|
||||
{
|
||||
UINT16 dat;
|
||||
dat = fd1094_decode(addr,fd1094_cpuregion[addr],fd1094_key,0);
|
||||
fd1094_cacheregion[fd1094_current_cacheposition][addr]=dat;
|
||||
}
|
||||
|
||||
/* copy newly decrypted data to user region */
|
||||
fd1094_userregion = fd1094_cacheregion[fd1094_current_cacheposition];
|
||||
set_decrypted_region(machine);
|
||||
m68k_set_encrypted_opcode_range(machine.device(fd1094_cputag), 0, fd1094_cpuregionsize);
|
||||
|
||||
fd1094_current_cacheposition++;
|
||||
|
||||
if (fd1094_current_cacheposition >= CACHE_ENTRIES)
|
||||
{
|
||||
mame_printf_debug("out of cache, performance may suffer, incrase CACHE_ENTRIES!\n");
|
||||
fd1094_current_cacheposition = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Callback for CMP.L instructions (state change) */
|
||||
static void fd1094_cmp_callback(device_t *device, UINT32 val, UINT8 reg)
|
||||
{
|
||||
if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ?
|
||||
{
|
||||
fd1094_setstate_and_decrypt(device->machine(), (val & 0xffff0000) >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
/* Callback when the FD1094 enters interrupt code */
|
||||
static IRQ_CALLBACK(fd1094_int_callback)
|
||||
{
|
||||
fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_IRQ);
|
||||
return (0x60+irqline*4)/4; // vector address
|
||||
}
|
||||
|
||||
static void fd1094_rte_callback (device_t *device)
|
||||
{
|
||||
fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_RTE);
|
||||
}
|
||||
|
||||
|
||||
/* KLUDGE, set the initial PC / SP based on table as we can't decrypt them yet */
|
||||
static void fd1094_kludge_reset_values(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0;i < 4;i++)
|
||||
fd1094_userregion[i] = fd1094_decode(i,fd1094_cpuregion[i],fd1094_key,1);
|
||||
}
|
||||
|
||||
|
||||
/* function, to be called from MACHINE_RESET (every reset) */
|
||||
void fd1094_machine_init(device_t *device)
|
||||
{
|
||||
/* punt if no key; this allows us to be called even for non-FD1094 games */
|
||||
if (!fd1094_key)
|
||||
return;
|
||||
|
||||
fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_RESET);
|
||||
fd1094_kludge_reset_values();
|
||||
|
||||
m68k_set_cmpild_callback(device, fd1094_cmp_callback);
|
||||
m68k_set_rte_callback(device, fd1094_rte_callback);
|
||||
device_set_irq_callback(device, fd1094_int_callback);
|
||||
|
||||
device->reset();
|
||||
}
|
||||
|
||||
static void fd1094_postload(running_machine &machine)
|
||||
{
|
||||
if (fd1094_state != -1)
|
||||
{
|
||||
int selected_state = fd1094_selected_state;
|
||||
int state = fd1094_state;
|
||||
|
||||
fd1094_machine_init(machine.device(fd1094_cputag));
|
||||
|
||||
fd1094_setstate_and_decrypt(machine, selected_state);
|
||||
fd1094_setstate_and_decrypt(machine, state);
|
||||
}
|
||||
}
|
||||
|
||||
#if KEY_DEBUGGING
|
||||
static void key_changed(running_machine &machine)
|
||||
{
|
||||
int addr;
|
||||
|
||||
/* re-decode the against the current parameter into cache entry 0 */
|
||||
for (addr = 0; addr < fd1094_cpuregionsize / 2; addr++)
|
||||
{
|
||||
UINT16 dat;
|
||||
dat = fd1094_decode(addr, fd1094_cpuregion[addr], fd1094_key, 0);
|
||||
fd1094_cacheregion[0][addr]=dat;
|
||||
}
|
||||
|
||||
/* set cache entry 0 to be the active one, and reset the cache position to 1 */
|
||||
fd1094_userregion = fd1094_cacheregion[0];
|
||||
set_decrypted_region(machine);
|
||||
fd1094_current_cacheposition = 1;
|
||||
|
||||
/* flush the prefetch queue */
|
||||
cpu_set_reg(machine.device(fd1094_cputag), M68K_PREF_ADDR, 0x0010);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* startup function, to be called from DRIVER_INIT (once on startup) */
|
||||
void fd1094_driver_init(running_machine &machine, const char* tag, void (*set_decrypted)(running_machine &, UINT8 *))
|
||||
{
|
||||
int i;
|
||||
|
||||
strcpy(fd1094_cputag, tag);
|
||||
|
||||
fd1094_cpuregion = (UINT16*)machine.root_device().memregion(fd1094_cputag)->base();
|
||||
fd1094_cpuregionsize = machine.root_device().memregion(fd1094_cputag)->bytes();
|
||||
fd1094_key = machine.root_device().memregion("user1")->base();
|
||||
fd1094_set_decrypted = set_decrypted;
|
||||
|
||||
/* punt if no key; this allows us to be called even for non-FD1094 games */
|
||||
if (fd1094_key == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < CACHE_ENTRIES; i++)
|
||||
{
|
||||
fd1094_cacheregion[i] = auto_alloc_array(machine, UINT16, fd1094_cpuregionsize / 2);
|
||||
fd1094_cached_states[i] = -1;
|
||||
}
|
||||
fd1094_current_cacheposition = 0;
|
||||
fd1094_state = -1;
|
||||
|
||||
/* key debugging */
|
||||
#if KEY_DEBUGGING
|
||||
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0 && machine.root_device().memregion("user2")->base() != NULL)
|
||||
{
|
||||
fd1094_init_debugging(machine, fd1094_cputag, "user1", "user2", key_changed);
|
||||
}
|
||||
#endif
|
||||
|
||||
state_save_register_global(machine, fd1094_selected_state);
|
||||
state_save_register_global(machine, fd1094_state);
|
||||
machine.save().register_postload(save_prepost_delegate(FUNC(fd1094_postload), &machine));
|
||||
}
|
@ -1,183 +0,0 @@
|
||||
/* s16fd.c modified to support s24
|
||||
|
||||
this could get messy if games change their own code after initial loading as we'll have to invalidate caches etc.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/fd1094.h"
|
||||
#include "includes/segas24.h"
|
||||
|
||||
#define S16_NUMCACHE 8
|
||||
|
||||
static UINT8 *s24_fd1094_key; // the memory region containing key
|
||||
static UINT16 *s24_fd1094_cpuregion; // the CPU region with encrypted code
|
||||
static UINT32 s24_fd1094_cpuregionsize; // the size of this region in bytes
|
||||
|
||||
static UINT16* s24_fd1094_userregion; // a user region where the current decrypted state is put and executed from
|
||||
static UINT16* s24_fd1094_cacheregion[S16_NUMCACHE]; // a cache region where S16_NUMCACHE states are stored to improve performance
|
||||
static int fd1094_cached_states[S16_NUMCACHE]; // array of cached state numbers
|
||||
static int fd1094_current_cacheposition; // current position in cache array
|
||||
|
||||
static int fd1094_state;
|
||||
static int fd1094_selected_state;
|
||||
|
||||
/* this function checks the cache to see if the current state is cached,
|
||||
if it is then it copies the cached data to the user region where code is
|
||||
executed from, if its not cached then it gets decrypted to the current
|
||||
cache position using the functions in s24_fd1094.c */
|
||||
static void s24_fd1094_setstate_and_decrypt(running_machine &machine, int state)
|
||||
{
|
||||
int i;
|
||||
UINT32 addr;
|
||||
|
||||
switch (state & 0x300)
|
||||
{
|
||||
case 0x000:
|
||||
case FD1094_STATE_RESET:
|
||||
fd1094_selected_state = state & 0xff;
|
||||
break;
|
||||
}
|
||||
|
||||
fd1094_state = state;
|
||||
|
||||
cpu_set_reg(machine.device("sub"), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
|
||||
|
||||
/* set the s24_fd1094 state ready to decrypt.. */
|
||||
state = fd1094_set_state(s24_fd1094_key,state) & 0xff;
|
||||
|
||||
/* first check the cache, if its cached we don't need to decrypt it, just copy */
|
||||
for (i = 0; i < S16_NUMCACHE; i++)
|
||||
{
|
||||
if (fd1094_cached_states[i] == state)
|
||||
{
|
||||
/* copy cached state */
|
||||
s24_fd1094_userregion = s24_fd1094_cacheregion[i];
|
||||
machine.device<cpu_device>("sub")->space(AS_PROGRAM)->set_decrypted_region(0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
|
||||
m68k_set_encrypted_opcode_range(machine.device("sub"), 0, s24_fd1094_cpuregionsize);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// mame_printf_debug("new state %04x\n",state);
|
||||
|
||||
/* mark it as cached (because it will be once we decrypt it) */
|
||||
fd1094_cached_states[fd1094_current_cacheposition] = state;
|
||||
|
||||
for (addr = 0; addr < s24_fd1094_cpuregionsize / 2; addr++)
|
||||
{
|
||||
UINT16 dat;
|
||||
dat = fd1094_decode(addr, s24_fd1094_cpuregion[addr], s24_fd1094_key, 0);
|
||||
s24_fd1094_cacheregion[fd1094_current_cacheposition][addr] = dat;
|
||||
}
|
||||
|
||||
/* copy newly decrypted data to user region */
|
||||
s24_fd1094_userregion = s24_fd1094_cacheregion[fd1094_current_cacheposition];
|
||||
machine.device<cpu_device>("sub")->space(AS_PROGRAM)->set_decrypted_region(0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
|
||||
m68k_set_encrypted_opcode_range(machine.device("sub"), 0, s24_fd1094_cpuregionsize);
|
||||
|
||||
fd1094_current_cacheposition++;
|
||||
|
||||
if (fd1094_current_cacheposition >= S16_NUMCACHE)
|
||||
{
|
||||
mame_printf_debug("out of cache, performance may suffer, incrase S16_NUMCACHE!\n");
|
||||
fd1094_current_cacheposition = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Callback for CMP.L instructions (state change) */
|
||||
static void s24_fd1094_cmp_callback(device_t *device, UINT32 val, UINT8 reg)
|
||||
{
|
||||
if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ?
|
||||
{
|
||||
s24_fd1094_setstate_and_decrypt(device->machine(), (val & 0xffff0000) >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
/* Callback when the s24_fd1094 enters interrupt code */
|
||||
static IRQ_CALLBACK(s24_fd1094_int_callback)
|
||||
{
|
||||
s24_fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_IRQ);
|
||||
return (0x60+irqline*4)/4; // vector address
|
||||
}
|
||||
|
||||
static void s24_fd1094_rte_callback (device_t *device)
|
||||
{
|
||||
s24_fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_RTE);
|
||||
}
|
||||
|
||||
|
||||
/* KLUDGE, set the initial PC / SP based on table as we can't decrypt them yet */
|
||||
static void s24_fd1094_kludge_reset_values(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
s24_fd1094_userregion[i] = fd1094_decode(i, s24_fd1094_cpuregion[i], s24_fd1094_key, 1);
|
||||
}
|
||||
|
||||
|
||||
/* function, to be called from MACHINE_RESET (every reset) */
|
||||
void s24_fd1094_machine_init(running_machine &machine)
|
||||
{
|
||||
/* punt if no key; this allows us to be called even for non-s24_fd1094 games */
|
||||
if (!s24_fd1094_key)
|
||||
return;
|
||||
|
||||
s24_fd1094_setstate_and_decrypt(machine, FD1094_STATE_RESET);
|
||||
s24_fd1094_kludge_reset_values();
|
||||
|
||||
m68k_set_cmpild_callback(machine.device("sub"), s24_fd1094_cmp_callback);
|
||||
m68k_set_rte_callback(machine.device("sub"), s24_fd1094_rte_callback);
|
||||
device_set_irq_callback(machine.device("sub"), s24_fd1094_int_callback);
|
||||
|
||||
machine.device("sub")->reset();
|
||||
}
|
||||
|
||||
static void s24_fd1094_postload(running_machine &machine)
|
||||
{
|
||||
if (fd1094_state != -1)
|
||||
{
|
||||
int selected_state = fd1094_selected_state;
|
||||
int state = fd1094_state;
|
||||
|
||||
s24_fd1094_machine_init(machine);
|
||||
|
||||
s24_fd1094_setstate_and_decrypt(machine, selected_state);
|
||||
s24_fd1094_setstate_and_decrypt(machine, state);
|
||||
}
|
||||
}
|
||||
|
||||
/* startup function, to be called from DRIVER_INIT (once on startup) */
|
||||
void s24_fd1094_driver_init(running_machine &machine)
|
||||
{
|
||||
int i;
|
||||
|
||||
s24_fd1094_cpuregion = (UINT16*)machine.root_device().memshare("share2")->ptr();
|
||||
s24_fd1094_cpuregionsize = 0x40000;
|
||||
s24_fd1094_key = machine.root_device().memregion("fd1094key")->base();
|
||||
|
||||
/* punt if no key; this allows us to be called even for non-s24_fd1094 games */
|
||||
if (!s24_fd1094_key)
|
||||
return;
|
||||
|
||||
for (i=0;i<S16_NUMCACHE;i++)
|
||||
{
|
||||
s24_fd1094_cacheregion[i]=auto_alloc_array(machine, UINT16, s24_fd1094_cpuregionsize/2);
|
||||
}
|
||||
|
||||
/* flush the cached state array */
|
||||
for (i=0;i<S16_NUMCACHE;i++)
|
||||
fd1094_cached_states[i] = -1;
|
||||
|
||||
fd1094_current_cacheposition = 0;
|
||||
|
||||
fd1094_state = -1;
|
||||
|
||||
state_save_register_global(machine, fd1094_selected_state);
|
||||
state_save_register_global(machine, fd1094_state);
|
||||
machine.save().register_postload(save_prepost_delegate(FUNC(s24_fd1094_postload), &machine));
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -2,41 +2,172 @@
|
||||
|
||||
Sega 16-bit common hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __SEGAIC16_H__
|
||||
#define __SEGAIC16_H__
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/fd1089.h"
|
||||
#include "machine/fd1094.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_SEGA_315_5195_MAPPER_ADD(_tag, _cputag, _class, _mapper, _read, _write) \
|
||||
MCFG_DEVICE_ADD(_tag, SEGA_MEM_MAPPER, 0) \
|
||||
sega_315_5195_mapper_device::static_set_cputag(*device, _cputag); \
|
||||
sega_315_5195_mapper_device::static_set_mapper(*device, sega_315_5195_mapper_device::mapper_delegate(&_class::_mapper, #_class "::" #_mapper, NULL, (_class *)0)); \
|
||||
sega_315_5195_mapper_device::static_set_sound_readwrite(*device, sega_315_5195_mapper_device::sound_read_delegate(&_class::_read, #_class "::" #_read, NULL, (_class *)0), sega_315_5195_mapper_device::sound_write_delegate(&_class::_write, #_class "::" #_write, NULL, (_class *)0)); \
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
|
||||
// ======================> sega_315_5195_mapper_device
|
||||
|
||||
class sega_315_5195_mapper_device : public device_t
|
||||
{
|
||||
public:
|
||||
typedef device_delegate<void (sega_315_5195_mapper_device &, UINT8)> mapper_delegate;
|
||||
typedef device_delegate<UINT8 ()> sound_read_delegate;
|
||||
typedef device_delegate<void (UINT8)> sound_write_delegate;
|
||||
|
||||
// construction/destruction
|
||||
sega_315_5195_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// inline configuration helpers
|
||||
static void static_set_cputag(device_t &device, const char *cpu);
|
||||
static void static_set_mapper(device_t &device, mapper_delegate callback);
|
||||
static void static_set_sound_readwrite(device_t &device, sound_read_delegate read, sound_write_delegate write);
|
||||
|
||||
// public interface
|
||||
DECLARE_READ8_MEMBER( read );
|
||||
DECLARE_WRITE8_MEMBER( write );
|
||||
|
||||
// mapping helpers
|
||||
void map_as_rom(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_name, offs_t rgnoffset, write16_delegate whandler);
|
||||
void map_as_ram(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_share_name, write16_delegate whandler);
|
||||
void map_as_handler(UINT32 offset, UINT32 length, offs_t mirror, read16_delegate rhandler, write16_delegate whandler);
|
||||
|
||||
// perform an explicit configuration (for bootlegs with hard-coded mappings)
|
||||
void configure_explicit(const UINT8 *map_data);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
private:
|
||||
// internal region struct
|
||||
struct region_info
|
||||
{
|
||||
offs_t size_mask;
|
||||
offs_t base;
|
||||
offs_t mirror;
|
||||
offs_t start;
|
||||
offs_t end;
|
||||
};
|
||||
|
||||
// helper class for tracking banks mapped to ROM regions
|
||||
class decrypt_bank
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
decrypt_bank();
|
||||
~decrypt_bank();
|
||||
|
||||
// configuration
|
||||
void set_decrypt(fd1089_base_device *fd1089);
|
||||
void set_decrypt(fd1094_device *fd1094);
|
||||
void clear() { set(NULL, 0, 0, ~0, NULL); }
|
||||
void set(memory_bank *bank, offs_t start, offs_t end, offs_t rgnoffs, UINT8 *src);
|
||||
|
||||
// updating
|
||||
void update();
|
||||
void reset() { m_fd1089_decrypted.reset(); if (m_fd1094_cache != NULL) m_fd1094_cache->reset(); }
|
||||
|
||||
private:
|
||||
// internal state
|
||||
memory_bank * m_bank;
|
||||
offs_t m_start;
|
||||
offs_t m_end;
|
||||
offs_t m_rgnoffs;
|
||||
UINT8 * m_srcptr;
|
||||
fd1089_base_device * m_fd1089;
|
||||
dynamic_array<UINT16> m_fd1089_decrypted;
|
||||
fd1094_decryption_cache *m_fd1094_cache;
|
||||
};
|
||||
|
||||
// internal helpers
|
||||
void compute_region(region_info &info, UINT8 index, UINT32 length, UINT32 mirror, UINT32 offset = 0);
|
||||
void update_mapping();
|
||||
void fd1094_state_change(UINT8 state);
|
||||
|
||||
// configuration
|
||||
const char * m_cputag;
|
||||
mapper_delegate m_mapper;
|
||||
sound_read_delegate m_sound_read;
|
||||
sound_write_delegate m_sound_write;
|
||||
|
||||
// internal state
|
||||
m68000_device * m_cpu;
|
||||
address_space * m_space;
|
||||
UINT8 m_regs[0x20];
|
||||
UINT8 m_curregion;
|
||||
decrypt_bank m_banks[8];
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type SEGA_MEM_MAPPER;
|
||||
|
||||
|
||||
|
||||
|
||||
#include "devlegcy.h"
|
||||
|
||||
/* open bus read helpers */
|
||||
READ16_HANDLER( segaic16_open_bus_r );
|
||||
|
||||
/* memory mapping chip */
|
||||
typedef struct _segaic16_memory_map_entry segaic16_memory_map_entry;
|
||||
struct _segaic16_memory_map_entry
|
||||
{
|
||||
UINT8 regbase; /* register offset for this region */
|
||||
offs_t regoffs; /* offset within the region for this entry */
|
||||
offs_t length; /* length in bytes of this entry */
|
||||
offs_t mirror; /* maximal mirror values (will be truncated) */
|
||||
offs_t romoffset; /* offset within REGION_CPU0, or ~0 for independent entries */
|
||||
read16_space_func read; /* read handler */
|
||||
const char * readname;
|
||||
const char * readbank; /* bank for reading */
|
||||
write16_space_func write; /* write handler */
|
||||
const char * writename;
|
||||
const char * writebank; /* bank for writing */
|
||||
UINT16 ** base; /* pointer to memory base */
|
||||
const char * name; /* friendly name for debugging */
|
||||
};
|
||||
|
||||
void segaic16_memory_mapper_init(device_t *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine &, UINT8), UINT8 (*sound_r_callback)(running_machine &));
|
||||
void segaic16_memory_mapper_reset(running_machine &machine);
|
||||
void segaic16_memory_mapper_config(running_machine &machine, const UINT8 *map_data);
|
||||
void segaic16_memory_mapper_set_decrypted(running_machine &machine, UINT8 *decrypted);
|
||||
READ8_HANDLER( segaic16_memory_mapper_r );
|
||||
WRITE8_HANDLER( segaic16_memory_mapper_w );
|
||||
READ16_HANDLER( segaic16_memory_mapper_lsb_r );
|
||||
WRITE16_HANDLER( segaic16_memory_mapper_lsb_w );
|
||||
|
||||
/*** Sega 16-bit Devices ***/
|
||||
|
||||
#include "devcb.h"
|
||||
@ -91,3 +222,6 @@ WRITE16_DEVICE_HANDLER( segaic16_divide_w );
|
||||
int segaic16_compare_timer_clock( device_t *device );
|
||||
READ16_DEVICE_HANDLER( segaic16_compare_timer_r );
|
||||
WRITE16_DEVICE_HANDLER( segaic16_compare_timer_w );
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -4341,7 +4341,7 @@ aburner // 1987.07 After Burner (Japan)
|
||||
aburner2 // 1987.09 After Burner II (Japan)
|
||||
thndrbld1 // 1987.12 Thunder Blade (Japan, deluxe/standard)
|
||||
thndrbld // 1988.02 Thunder Blade (US?, upright, FD1094, decrypted)
|
||||
// 1989.01 Last Survivor (Japan)
|
||||
lastsurv // 1989.01 Last Survivor (Japan)
|
||||
smgpj // 1989.06 Super Monaco GP (Japan, FD1094, decrypted)
|
||||
smgpja // 1989.06 Super Monaco GP (Japan, FD1094, decrypted)
|
||||
smgp // 1989.?? Super Monaco GP (World, FD1094, decrypted)
|
||||
@ -4360,6 +4360,7 @@ abcop // 1990.?? A.B.Cop (World, FD1094, decrypted)
|
||||
// 1990.10 GP Rider (Japan)
|
||||
gprider // 1990.?? GP Rider (World, FD1094, decrypted)
|
||||
gprideru // 1990.12 GP Rider (US, FD1094, decrypted)
|
||||
gpriderj // 1990.12 GP Rider (Japan, FD1094, decrypted)
|
||||
rascot // 1991.?? Royal Ascot (Japan)
|
||||
|
||||
|
||||
|
@ -1262,8 +1262,6 @@ $(MAMEOBJ)/sega.a: \
|
||||
$(MACHINE)/fd1094.o \
|
||||
$(MACHINE)/fddebug.o \
|
||||
$(MACHINE)/mc8123.o \
|
||||
$(MACHINE)/s16fd.o \
|
||||
$(MACHINE)/s24fd.o \
|
||||
$(MACHINE)/scudsp.o \
|
||||
$(MACHINE)/segaic16.o \
|
||||
$(AUDIO)/carnival.o \
|
||||
|
@ -2,6 +2,37 @@
|
||||
|
||||
Atari "Stella on Steroids" hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
@ -2,10 +2,40 @@
|
||||
|
||||
Sega Hang On hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segas16.h"
|
||||
|
||||
|
||||
|
@ -2,115 +2,139 @@
|
||||
|
||||
Sega Outrun hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segas16.h"
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video startup
|
||||
*
|
||||
*************************************/
|
||||
//**************************************************************************
|
||||
// VIDEO STARTUP
|
||||
//**************************************************************************
|
||||
|
||||
VIDEO_START( shangon )
|
||||
void segaorun_state::video_start()
|
||||
{
|
||||
/* compute palette info */
|
||||
// compute palette info
|
||||
segaic16_palette_init(0x1000);
|
||||
|
||||
if (m_is_shangon)
|
||||
{
|
||||
// initialize the tile/text layers
|
||||
segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B_ALT, 0x000, 0, 2);
|
||||
|
||||
/* initialize the tile/text layers */
|
||||
segaic16_tilemap_init(machine, 0, SEGAIC16_TILEMAP_16B_ALT, 0x000, 0, 2);
|
||||
// initialize the road
|
||||
segaic16_road_init(machine(), 0, SEGAIC16_ROAD_OUTRUN, 0x7f6, 0x7c0, 0x7c0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// initialize the tile/text layers
|
||||
segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 2);
|
||||
|
||||
/* initialize the road */
|
||||
segaic16_road_init(machine, 0, SEGAIC16_ROAD_OUTRUN, 0x7f6, 0x7c0, 0x7c0, 0);
|
||||
}
|
||||
|
||||
|
||||
VIDEO_START( outrun )
|
||||
{
|
||||
/* compute palette info */
|
||||
segaic16_palette_init(0x1000);
|
||||
|
||||
/* initialize the tile/text layers */
|
||||
segaic16_tilemap_init(machine, 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 2);
|
||||
|
||||
/* initialize the road */
|
||||
segaic16_road_init(machine, 0, SEGAIC16_ROAD_OUTRUN, 0x400, 0x420, 0x780, 0);
|
||||
// initialize the road
|
||||
segaic16_road_init(machine(), 0, SEGAIC16_ROAD_OUTRUN, 0x400, 0x420, 0x780, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video update
|
||||
*
|
||||
*************************************/
|
||||
//**************************************************************************
|
||||
// VIDEO UPDATE
|
||||
//**************************************************************************
|
||||
|
||||
SCREEN_UPDATE_IND16( shangon )
|
||||
UINT32 segaorun_state::screen_update_shangon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
/* reset priorities */
|
||||
screen.machine().priority_bitmap.fill(0, cliprect);
|
||||
// reset priorities
|
||||
machine().priority_bitmap.fill(0, cliprect);
|
||||
|
||||
/* draw the low priority road layer */
|
||||
// draw the low priority road layer
|
||||
segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
|
||||
|
||||
/* draw background */
|
||||
// draw background
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
|
||||
|
||||
/* draw foreground */
|
||||
// draw foreground
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
|
||||
|
||||
/* draw the high priority road */
|
||||
// draw the high priority road
|
||||
segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
|
||||
|
||||
/* text layer */
|
||||
/* note that we inflate the priority of the text layer to prevent sprites */
|
||||
/* from drawing over the high scores */
|
||||
// text layer
|
||||
// note that we inflate the priority of the text layer to prevent sprites
|
||||
// from drawing over the high scores
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
|
||||
|
||||
/* draw the sprites */
|
||||
// draw the sprites
|
||||
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
SCREEN_UPDATE_IND16( outrun )
|
||||
UINT32 segaorun_state::screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
/* if no drawing is happening, fill with black and get out */
|
||||
// if no drawing is happening, fill with black and get out
|
||||
if (!segaic16_display_enable)
|
||||
{
|
||||
bitmap.fill(get_black_pen(screen.machine()), cliprect);
|
||||
bitmap.fill(get_black_pen(machine()), cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* reset priorities */
|
||||
screen.machine().priority_bitmap.fill(0, cliprect);
|
||||
// reset priorities
|
||||
machine().priority_bitmap.fill(0, cliprect);
|
||||
|
||||
/* draw the low priority road layer */
|
||||
// draw the low priority road layer
|
||||
segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
|
||||
|
||||
/* draw background */
|
||||
// draw background
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
|
||||
|
||||
/* draw foreground */
|
||||
// draw foreground
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
|
||||
|
||||
/* draw the high priority road */
|
||||
// draw the high priority road
|
||||
segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
|
||||
|
||||
/* text layer */
|
||||
// text layer
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
|
||||
|
||||
/* draw the sprites */
|
||||
// draw the sprites
|
||||
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2,10 +2,40 @@
|
||||
|
||||
Sega System 16A hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segas16.h"
|
||||
|
||||
|
||||
|
@ -2,79 +2,92 @@
|
||||
|
||||
Sega System 16B hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segas16.h"
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video startup
|
||||
*
|
||||
*************************************/
|
||||
//-------------------------------------------------
|
||||
// video_start - initialize the video system
|
||||
//-------------------------------------------------
|
||||
|
||||
static void video_start_common(running_machine &machine, int type)
|
||||
void segas16b_state::video_start()
|
||||
{
|
||||
/* compute palette info */
|
||||
// compute palette info
|
||||
segaic16_palette_init(0x800);
|
||||
|
||||
/* initialize the tile/text layers */
|
||||
segaic16_tilemap_init(machine, 0, type, 0x000, 0, 2);
|
||||
// initialize the tile/text layers
|
||||
segaic16_tilemap_init(machine(), 0, m_tilemap_type, 0x000, 0, 2);
|
||||
}
|
||||
|
||||
|
||||
VIDEO_START( system16b )
|
||||
//-------------------------------------------------
|
||||
// screen_update - render all graphics
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT32 segas16b_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
video_start_common(machine, SEGAIC16_TILEMAP_16B);
|
||||
}
|
||||
|
||||
|
||||
VIDEO_START( timscanr )
|
||||
{
|
||||
video_start_common(machine, SEGAIC16_TILEMAP_16B_ALT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video update
|
||||
*
|
||||
*************************************/
|
||||
|
||||
SCREEN_UPDATE_IND16( system16b )
|
||||
{
|
||||
/* if no drawing is happening, fill with black and get out */
|
||||
// if no drawing is happening, fill with black and get out
|
||||
if (!segaic16_display_enable)
|
||||
{
|
||||
bitmap.fill(get_black_pen(screen.machine()), cliprect);
|
||||
bitmap.fill(get_black_pen(machine()), cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* reset priorities */
|
||||
screen.machine().priority_bitmap.fill(0, cliprect);
|
||||
// reset priorities
|
||||
machine().priority_bitmap.fill(0, cliprect);
|
||||
|
||||
/* draw background opaquely first, not setting any priorities */
|
||||
// draw background opaquely first, not setting any priorities
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
|
||||
|
||||
/* draw background again, just to set the priorities on non-transparent pixels */
|
||||
// draw background again, just to set the priorities on non-transparent pixels
|
||||
bitmap_ind16 dummy_bitmap;
|
||||
segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
|
||||
segaic16_tilemap_draw(screen, dummy_bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
|
||||
|
||||
/* draw foreground */
|
||||
// draw foreground
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
|
||||
|
||||
/* text layer */
|
||||
// text layer
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
|
||||
|
||||
/* draw the sprites */
|
||||
// draw the sprites
|
||||
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2,10 +2,40 @@
|
||||
|
||||
Sega System 18 hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/genesis.h"
|
||||
#include "includes/segas16.h"
|
||||
|
||||
@ -26,34 +56,26 @@
|
||||
*
|
||||
*************************************/
|
||||
|
||||
VIDEO_START( system18 )
|
||||
void segas18_state::video_start()
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
int width, height;
|
||||
m_temp_bitmap.allocate(machine().primary_screen->width(), machine().primary_screen->height());
|
||||
m_grayscale_enable = false;
|
||||
m_vdp_enable = false;
|
||||
m_vdp_mixing = 0;
|
||||
|
||||
state->m_grayscale_enable = 0;
|
||||
state->m_vdp_enable = 0;
|
||||
state->m_vdp_mixing = 0;
|
||||
|
||||
/* compute palette info */
|
||||
// compute palette info
|
||||
segaic16_palette_init(0x800);
|
||||
|
||||
/* initialize the tile/text layers */
|
||||
segaic16_tilemap_init(machine, 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 8);
|
||||
// initialize the tile/text layers
|
||||
segaic16_tilemap_init(machine(), 0, SEGAIC16_TILEMAP_16B, 0x000, 0, 8);
|
||||
|
||||
/* create the VDP */
|
||||
system18_vdp_start(machine);
|
||||
// create the VDP
|
||||
system18_vdp_start(machine());
|
||||
|
||||
/* create a temp bitmap to draw the VDP data into */
|
||||
width = machine.primary_screen->width();
|
||||
height = machine.primary_screen->height();
|
||||
state->m_tmp_bitmap = auto_bitmap_ind16_alloc(machine, width, height);
|
||||
|
||||
|
||||
state->save_item(NAME(state->m_grayscale_enable));
|
||||
state->save_item(NAME(state->m_vdp_enable));
|
||||
state->save_item(NAME(state->m_vdp_mixing));
|
||||
state->save_item(NAME(*state->m_tmp_bitmap));
|
||||
save_item(NAME(m_grayscale_enable));
|
||||
save_item(NAME(m_vdp_enable));
|
||||
save_item(NAME(m_vdp_mixing));
|
||||
save_item(NAME(m_temp_bitmap));
|
||||
}
|
||||
|
||||
|
||||
@ -64,29 +86,23 @@ VIDEO_START( system18 )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void system18_set_grayscale(running_machine &machine, int enable)
|
||||
void segas18_state::set_grayscale(bool enable)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
|
||||
enable = (enable != 0);
|
||||
if (enable != state->m_grayscale_enable)
|
||||
if (enable != m_grayscale_enable)
|
||||
{
|
||||
machine.primary_screen->update_partial(machine.primary_screen->vpos());
|
||||
state->m_grayscale_enable = enable;
|
||||
machine().primary_screen->update_partial(machine().primary_screen->vpos());
|
||||
m_grayscale_enable = enable;
|
||||
// mame_printf_debug("Grayscale = %02X\n", enable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void system18_set_vdp_enable(running_machine &machine, int enable)
|
||||
void segas18_state::set_vdp_enable(bool enable)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
|
||||
enable = (enable != 0);
|
||||
if (enable != state->m_vdp_enable)
|
||||
if (enable != m_vdp_enable)
|
||||
{
|
||||
machine.primary_screen->update_partial(machine.primary_screen->vpos());
|
||||
state->m_vdp_enable = enable;
|
||||
machine().primary_screen->update_partial(machine().primary_screen->vpos());
|
||||
m_vdp_enable = enable;
|
||||
#if DEBUG_VDP
|
||||
mame_printf_debug("VDP enable = %02X\n", enable);
|
||||
#endif
|
||||
@ -94,14 +110,12 @@ void system18_set_vdp_enable(running_machine &machine, int enable)
|
||||
}
|
||||
|
||||
|
||||
void system18_set_vdp_mixing(running_machine &machine, int mixing)
|
||||
void segas18_state::set_vdp_mixing(UINT8 mixing)
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
|
||||
if (mixing != state->m_vdp_mixing)
|
||||
if (mixing != m_vdp_mixing)
|
||||
{
|
||||
machine.primary_screen->update_partial(machine.primary_screen->vpos());
|
||||
state->m_vdp_mixing = mixing;
|
||||
machine().primary_screen->update_partial(machine().primary_screen->vpos());
|
||||
m_vdp_mixing = mixing;
|
||||
#if DEBUG_VDP
|
||||
mame_printf_debug("VDP mixing = %02X\n", mixing);
|
||||
#endif
|
||||
@ -116,19 +130,15 @@ void system18_set_vdp_mixing(running_machine &machine, int mixing)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void draw_vdp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority)
|
||||
void segas18_state::draw_vdp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority)
|
||||
{
|
||||
segas1x_state *state = screen.machine().driver_data<segas1x_state>();
|
||||
int x, y;
|
||||
bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap;
|
||||
|
||||
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
|
||||
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
|
||||
{
|
||||
UINT16 *src = &state->m_tmp_bitmap->pix16(y);
|
||||
UINT16 *dst = &bitmap.pix16(y);
|
||||
UINT8 *pri = &priority_bitmap.pix8(y);
|
||||
|
||||
for (x = cliprect.min_x; x <= cliprect.max_x; x++)
|
||||
UINT16 *src = &m_temp_bitmap.pix(y);
|
||||
UINT16 *dst = &bitmap.pix(y);
|
||||
UINT8 *pri = &priority_bitmap.pix(y);
|
||||
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
|
||||
{
|
||||
UINT16 pix = src[x];
|
||||
if (pix != 0xffff)
|
||||
@ -148,11 +158,8 @@ static void draw_vdp(screen_device &screen, bitmap_ind16 &bitmap, const rectangl
|
||||
*
|
||||
*************************************/
|
||||
|
||||
SCREEN_UPDATE_IND16( system18 )
|
||||
UINT32 segas18_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
segas1x_state *state = screen.machine().driver_data<segas1x_state>();
|
||||
int vdppri, vdplayer;
|
||||
|
||||
/*
|
||||
Current understanding of VDP mixing:
|
||||
|
||||
@ -184,68 +191,69 @@ SCREEN_UPDATE_IND16( system18 )
|
||||
cltchitr: layer = 1 or 2 or 3, pri = 0x02 or 0x04 or 0x08
|
||||
mwalk: layer = 3, pri = 0x04 or 0x08
|
||||
*/
|
||||
vdplayer = (state->m_vdp_mixing >> 1) & 3;
|
||||
vdppri = (state->m_vdp_mixing & 1) ? (1 << vdplayer) : 0;
|
||||
|
||||
int vdplayer = (m_vdp_mixing >> 1) & 3;
|
||||
int vdppri = (m_vdp_mixing & 1) ? (1 << vdplayer) : 0;
|
||||
|
||||
#if DEBUG_VDP
|
||||
if (screen.machine().input().code_pressed(KEYCODE_Q)) vdplayer = 0;
|
||||
if (screen.machine().input().code_pressed(KEYCODE_W)) vdplayer = 1;
|
||||
if (screen.machine().input().code_pressed(KEYCODE_E)) vdplayer = 2;
|
||||
if (screen.machine().input().code_pressed(KEYCODE_R)) vdplayer = 3;
|
||||
if (screen.machine().input().code_pressed(KEYCODE_A)) vdppri = 0x00;
|
||||
if (screen.machine().input().code_pressed(KEYCODE_S)) vdppri = 0x01;
|
||||
if (screen.machine().input().code_pressed(KEYCODE_D)) vdppri = 0x02;
|
||||
if (screen.machine().input().code_pressed(KEYCODE_F)) vdppri = 0x04;
|
||||
if (screen.machine().input().code_pressed(KEYCODE_G)) vdppri = 0x08;
|
||||
if (machine().input().code_pressed(KEYCODE_Q)) vdplayer = 0;
|
||||
if (machine().input().code_pressed(KEYCODE_W)) vdplayer = 1;
|
||||
if (machine().input().code_pressed(KEYCODE_E)) vdplayer = 2;
|
||||
if (machine().input().code_pressed(KEYCODE_R)) vdplayer = 3;
|
||||
if (machine().input().code_pressed(KEYCODE_A)) vdppri = 0x00;
|
||||
if (machine().input().code_pressed(KEYCODE_S)) vdppri = 0x01;
|
||||
if (machine().input().code_pressed(KEYCODE_D)) vdppri = 0x02;
|
||||
if (machine().input().code_pressed(KEYCODE_F)) vdppri = 0x04;
|
||||
if (machine().input().code_pressed(KEYCODE_G)) vdppri = 0x08;
|
||||
#endif
|
||||
|
||||
/* if no drawing is happening, fill with black and get out */
|
||||
// if no drawing is happening, fill with black and get out
|
||||
if (!segaic16_display_enable)
|
||||
{
|
||||
bitmap.fill(get_black_pen(screen.machine()), cliprect);
|
||||
bitmap.fill(get_black_pen(machine()), cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* if the VDP is enabled, update our tmp_bitmap */
|
||||
if (state->m_vdp_enable)
|
||||
system18_vdp_update(*state->m_tmp_bitmap, cliprect);
|
||||
// if the VDP is enabled, update our tmp_bitmap
|
||||
if (m_vdp_enable)
|
||||
system18_vdp_update(m_temp_bitmap, cliprect);
|
||||
|
||||
/* reset priorities */
|
||||
screen.machine().priority_bitmap.fill(0, cliprect);
|
||||
// reset priorities
|
||||
machine().priority_bitmap.fill(0, cliprect);
|
||||
|
||||
/* draw background opaquely first, not setting any priorities */
|
||||
// draw background opaquely first, not setting any priorities
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
|
||||
if (state->m_vdp_enable && vdplayer == 0) draw_vdp(screen, bitmap, cliprect, vdppri);
|
||||
if (m_vdp_enable && vdplayer == 0) draw_vdp(screen, bitmap, cliprect, vdppri);
|
||||
|
||||
/* draw background again to draw non-transparent pixels over the VDP and set the priority */
|
||||
// draw background again to draw non-transparent pixels over the VDP and set the priority
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
|
||||
if (state->m_vdp_enable && vdplayer == 1) draw_vdp(screen, bitmap, cliprect, vdppri);
|
||||
if (m_vdp_enable && vdplayer == 1) draw_vdp(screen, bitmap, cliprect, vdppri);
|
||||
|
||||
/* draw foreground */
|
||||
// draw foreground
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
|
||||
if (state->m_vdp_enable && vdplayer == 2) draw_vdp(screen, bitmap, cliprect, vdppri);
|
||||
if (m_vdp_enable && vdplayer == 2) draw_vdp(screen, bitmap, cliprect, vdppri);
|
||||
|
||||
/* text layer */
|
||||
// text layer
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
|
||||
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
|
||||
if (state->m_vdp_enable && vdplayer == 3) draw_vdp(screen, bitmap, cliprect, vdppri);
|
||||
if (m_vdp_enable && vdplayer == 3) draw_vdp(screen, bitmap, cliprect, vdppri);
|
||||
|
||||
/* draw the sprites */
|
||||
// draw the sprites
|
||||
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
|
||||
|
||||
#if DEBUG_VDP
|
||||
if (state->m_vdp_enable && screen.machine().input().code_pressed(KEYCODE_V))
|
||||
if (m_vdp_enable && machine().input().code_pressed(KEYCODE_V))
|
||||
{
|
||||
bitmap.fill(get_black_pen(screen.machine()), cliprect);
|
||||
bitmap.fill(get_black_pen(machine()), cliprect);
|
||||
update_system18_vdp(bitmap, cliprect);
|
||||
}
|
||||
if (vdp_enable && screen.machine().input().code_pressed(KEYCODE_B))
|
||||
if (vdp_enable && machine().input().code_pressed(KEYCODE_B))
|
||||
{
|
||||
FILE *f = fopen("vdp.bin", "w");
|
||||
fwrite(state->m_tmp_bitmap->base, 1, state->m_tmp_bitmap->rowpixels * (state->m_tmp_bitmap->bpp / 8) * state->m_tmp_bitmap->height, f);
|
||||
fwrite(m_temp_bitmap->base(), 1, m_temp_bitmap->rowpixels() * (m_temp_bitmap->bpp() / 8) * m_temp_bitmap->height(), f);
|
||||
fclose(f);
|
||||
}
|
||||
#endif
|
||||
|
@ -2,10 +2,40 @@
|
||||
|
||||
Sega X-board hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segas16.h"
|
||||
|
||||
|
||||
@ -36,7 +66,7 @@ VIDEO_START( xboard )
|
||||
|
||||
SCREEN_UPDATE_IND16( xboard )
|
||||
{
|
||||
segas1x_state *state = screen.machine().driver_data<segas1x_state>();
|
||||
segaxbd_state *state = screen.machine().driver_data<segaxbd_state>();
|
||||
|
||||
/* if no drawing is happening, fill with black and get out */
|
||||
if (!segaic16_display_enable)
|
||||
|
@ -2,10 +2,40 @@
|
||||
|
||||
Sega Y-board hardware
|
||||
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/segaic16.h"
|
||||
#include "includes/segas16.h"
|
||||
|
||||
|
||||
@ -17,7 +47,7 @@
|
||||
|
||||
VIDEO_START( yboard )
|
||||
{
|
||||
segas1x_state *state = machine.driver_data<segas1x_state>();
|
||||
segaybd_state *state = machine.driver_data<segaybd_state>();
|
||||
|
||||
/* compute palette info */
|
||||
segaic16_palette_init(0x2000);
|
||||
@ -41,7 +71,7 @@ VIDEO_START( yboard )
|
||||
|
||||
SCREEN_UPDATE_IND16( yboard )
|
||||
{
|
||||
segas1x_state *state = screen.machine().driver_data<segas1x_state>();
|
||||
segaybd_state *state = screen.machine().driver_data<segaybd_state>();
|
||||
rectangle yboard_clip;
|
||||
|
||||
/* if no drawing is happening, fill with black and get out */
|
||||
|
Loading…
Reference in New Issue
Block a user