mirror of
https://github.com/holub/mame
synced 2025-07-08 19:31:59 +03:00
safarir: fixed colors and filenames, and added samples [Hau]
This commit is contained in:
parent
adc6b3aa8e
commit
ad6e9746d5
@ -5,13 +5,11 @@
|
||||
driver by Zsolt Vasvari
|
||||
|
||||
Games Supported:
|
||||
* Safari Rally (Japan)
|
||||
* Safari Rally (Japan Ver.)
|
||||
(c)1979 Shin Nihon Kikaku
|
||||
|
||||
Known issues/to-do's:
|
||||
* SN76477 sound
|
||||
* Background colors are wrong.
|
||||
Flyer shows red and perhaps blue,
|
||||
but I don't see an obvious mapping
|
||||
* SN76477 discrete sound
|
||||
|
||||
Notes:
|
||||
* This hardware is a precursor to Phoenix
|
||||
@ -42,10 +40,46 @@
|
||||
|
||||
----------------------------------
|
||||
|
||||
----------------------------------------
|
||||
Safari Rally (Japan Ver.)
|
||||
(c)1979 Shin Nihon Kikaku
|
||||
|
||||
----------------------------------------
|
||||
Top
|
||||
RLO70002
|
||||
RLN00001
|
||||
CPU:M5L8080AP
|
||||
SND:SN76477N
|
||||
18.000MHz
|
||||
----------------------------------------
|
||||
Bottom
|
||||
RLO70003
|
||||
RLN00002
|
||||
11.000MHz
|
||||
----------------------------------------
|
||||
RL-01.9 [cf7703c9]
|
||||
RL-02.1 [1013ecd3]
|
||||
RL-03.10 [84545894]
|
||||
RL-04.2 [5dd12f96]
|
||||
RL-05.11 [935ed469]
|
||||
RL-06.3 [24c1cd42]
|
||||
|
||||
RL-07.40 [ba525203]
|
||||
RL-08.43 [d6a50aac]
|
||||
|
||||
|
||||
|
||||
--- Team Japump!!! ---
|
||||
Dumped by Chack'n
|
||||
27/Jun/2009
|
||||
----------------------------------------
|
||||
modified by Hau
|
||||
07/06/2009
|
||||
****************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "cpu/i8085/i8085.h"
|
||||
#include "sound/samples.h"
|
||||
|
||||
|
||||
static UINT8 *ram_1, *ram_2;
|
||||
@ -129,11 +163,17 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 code = ram_r(space,tile_index | 0x400);
|
||||
|
||||
/* this is wrong */
|
||||
if (code & 0x80)
|
||||
color = 6; /* yellow */
|
||||
else
|
||||
color = 2; /* green */
|
||||
{
|
||||
color = ((~tile_index & 0x04) >> 2) | ((tile_index & 0x04) >> 1);
|
||||
|
||||
if (~tile_index & 0x100)
|
||||
color |= ((tile_index & 0xc0) == 0x80) ? 1 : 0;
|
||||
else
|
||||
color |= (tile_index & 0xc0) ? 1 : 0;
|
||||
}
|
||||
|
||||
SET_TILE_INFO(0, code & 0x7f, color, 0);
|
||||
}
|
||||
@ -176,6 +216,99 @@ static VIDEO_UPDATE( safarir )
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Audio system
|
||||
*
|
||||
*************************************/
|
||||
|
||||
#define SAMPLE_SOUND1_1 0
|
||||
#define SAMPLE_SOUND1_2 1
|
||||
#define SAMPLE_SOUND2 2
|
||||
#define SAMPLE_SOUND3 3
|
||||
#define SAMPLE_SOUND4_1 4
|
||||
#define SAMPLE_SOUND4_2 5
|
||||
#define SAMPLE_SOUND5_1 6
|
||||
#define SAMPLE_SOUND5_2 7
|
||||
#define SAMPLE_SOUND6 8
|
||||
#define SAMPLE_SOUND7 9
|
||||
|
||||
#define CHANNEL_SOUND1 0
|
||||
#define CHANNEL_SOUND2 1
|
||||
#define CHANNEL_SOUND3 2
|
||||
#define CHANNEL_SOUND4 3
|
||||
#define CHANNEL_SOUND5 4
|
||||
|
||||
static UINT8 port_last;
|
||||
static UINT8 port_last2;
|
||||
|
||||
|
||||
static WRITE8_HANDLER( safarir_audio_w )
|
||||
{
|
||||
const device_config *samples = devtag_get_device(space->machine, "samples");
|
||||
UINT8 rising_bits = data & ~port_last;
|
||||
|
||||
if (rising_bits == 0x12) sample_start(samples, CHANNEL_SOUND1, SAMPLE_SOUND1_1, 0);
|
||||
if (rising_bits == 0x02) sample_start(samples, CHANNEL_SOUND1, SAMPLE_SOUND1_2, 0);
|
||||
if (rising_bits == 0x95) sample_start(samples, CHANNEL_SOUND1, SAMPLE_SOUND6, 0);
|
||||
|
||||
if (rising_bits == 0x04 && (data == 0x15 || data ==0x16)) sample_start(samples, CHANNEL_SOUND2, SAMPLE_SOUND2, 0);
|
||||
|
||||
if (data == 0x5f && (rising_bits == 0x49 || rising_bits == 0x5f)) sample_start(samples, CHANNEL_SOUND3, SAMPLE_SOUND3, 1);
|
||||
if (data == 0x00 || rising_bits == 0x01) sample_stop(samples, CHANNEL_SOUND3);
|
||||
|
||||
if (data == 0x13)
|
||||
{
|
||||
if (rising_bits == 0x13 || (rising_bits == 0x01 && port_last == 0x12))
|
||||
{
|
||||
sample_start(samples, CHANNEL_SOUND4, SAMPLE_SOUND7, 0);
|
||||
}
|
||||
else if (rising_bits == 0x03 && port_last2 == 0x15 && !sample_playing(samples, CHANNEL_SOUND4))
|
||||
{
|
||||
sample_start(samples, CHANNEL_SOUND4, SAMPLE_SOUND4_1, 0);
|
||||
}
|
||||
}
|
||||
if (data == 0x53 && port_last == 0x55) sample_start(samples, CHANNEL_SOUND4, SAMPLE_SOUND4_2, 0);
|
||||
|
||||
if (data == 0x1f && rising_bits == 0x1f) sample_start(samples, CHANNEL_SOUND5, SAMPLE_SOUND5_1, 0);
|
||||
if (data == 0x14 && (rising_bits == 0x14 || rising_bits == 0x04)) sample_start(samples, CHANNEL_SOUND5, SAMPLE_SOUND5_2, 0);
|
||||
|
||||
port_last2 = port_last;
|
||||
port_last = data;
|
||||
}
|
||||
|
||||
|
||||
static const char *const safarir_sample_names[] =
|
||||
{
|
||||
"*safarir",
|
||||
"sound1-1.wav",
|
||||
"sound1-2.wav",
|
||||
"sound2.wav",
|
||||
"sound3.wav",
|
||||
"sound4-1.wav",
|
||||
"sound4-2.wav",
|
||||
"sound5-1.wav",
|
||||
"sound5-2.wav",
|
||||
"sound6.wav",
|
||||
"sound7.wav",
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
static const samples_interface safarir_samples_interface =
|
||||
{
|
||||
5, /* 5 channels */
|
||||
safarir_sample_names
|
||||
};
|
||||
|
||||
|
||||
static MACHINE_DRIVER_START( safarir_audio )
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
MDRV_SOUND_ADD("samples", SAMPLES, 0)
|
||||
MDRV_SOUND_CONFIG(safarir_samples_interface)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
@ -188,11 +321,15 @@ static MACHINE_START( safarir )
|
||||
{
|
||||
ram_1 = auto_alloc_array(machine, UINT8, ram_size);
|
||||
ram_2 = auto_alloc_array(machine, UINT8, ram_size);
|
||||
port_last = 0;
|
||||
port_last2 = 0;
|
||||
|
||||
/* setup for save states */
|
||||
state_save_register_global_pointer(machine, ram_1, ram_size);
|
||||
state_save_register_global_pointer(machine, ram_2, ram_size);
|
||||
state_save_register_global(machine, ram_bank);
|
||||
state_save_register_global(machine, port_last);
|
||||
state_save_register_global(machine, port_last2);
|
||||
}
|
||||
|
||||
|
||||
@ -208,7 +345,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x2000, 0x27ff) AM_READWRITE(ram_r, ram_w) AM_SIZE(&ram_size)
|
||||
AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_READWRITE(SMH_NOP, ram_bank_w)
|
||||
AM_RANGE(0x2c00, 0x2cff) AM_MIRROR(0x03ff) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&bg_scroll)
|
||||
AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0x03ff) AM_WRITENOP /* goes to SN76477 */
|
||||
AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0x03ff) AM_WRITE(safarir_audio_w) /* goes to SN76477 */
|
||||
AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITENOP /* cleared at the beginning */
|
||||
AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x03ff) AM_READ_PORT("INPUTS") AM_WRITENOP
|
||||
AM_RANGE(0x3c00, 0x3cff) AM_MIRROR(0x03ff) AM_READ_PORT("DSW") AM_WRITENOP
|
||||
@ -266,7 +403,7 @@ INPUT_PORTS_END
|
||||
static MACHINE_DRIVER_START( safarir )
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", 8085A, 3072000) /* 3 MHz ? */
|
||||
MDRV_CPU_ADD("maincpu", 8085A, 18000000/8) /* 2.25 MHz ? */
|
||||
MDRV_CPU_PROGRAM_MAP(main_map)
|
||||
|
||||
MDRV_MACHINE_START(safarir)
|
||||
@ -285,7 +422,7 @@ static MACHINE_DRIVER_START( safarir )
|
||||
MDRV_SCREEN_REFRESH_RATE(60)
|
||||
|
||||
/* audio hardware */
|
||||
|
||||
MDRV_IMPORT_FROM(safarir_audio)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
|
||||
@ -298,18 +435,18 @@ MACHINE_DRIVER_END
|
||||
|
||||
ROM_START( safarir )
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
ROM_LOAD( "rl01", 0x0000, 0x0400, CRC(cf7703c9) SHA1(b4182df9332b355edaa518462217a6e31e1c07b2) )
|
||||
ROM_LOAD( "rl02", 0x0400, 0x0400, CRC(1013ecd3) SHA1(2fe367db8ca367b36c5378cb7d5ff918db243c78) )
|
||||
ROM_LOAD( "rl03", 0x0800, 0x0400, CRC(84545894) SHA1(377494ceeac5ad58b70f77b2b27b609491cb7ffd) )
|
||||
ROM_LOAD( "rl04", 0x0c00, 0x0400, CRC(5dd12f96) SHA1(a80ac0705648f0807ea33e444fdbea450bf23f85) )
|
||||
ROM_LOAD( "rl05", 0x1000, 0x0400, CRC(935ed469) SHA1(052a59df831dcc2c618e9e5e5fdfa47548550596) )
|
||||
ROM_LOAD( "rl06", 0x1400, 0x0400, CRC(24c1cd42) SHA1(fe32ecea77a3777f8137ca248b8f371db37b8b85) )
|
||||
ROM_LOAD( "rl-01.9", 0x0000, 0x0400, CRC(cf7703c9) SHA1(b4182df9332b355edaa518462217a6e31e1c07b2) )
|
||||
ROM_LOAD( "rl-02.1", 0x0400, 0x0400, CRC(1013ecd3) SHA1(2fe367db8ca367b36c5378cb7d5ff918db243c78) )
|
||||
ROM_LOAD( "rl-03.10", 0x0800, 0x0400, CRC(84545894) SHA1(377494ceeac5ad58b70f77b2b27b609491cb7ffd) )
|
||||
ROM_LOAD( "rl-04.2", 0x0c00, 0x0400, CRC(5dd12f96) SHA1(a80ac0705648f0807ea33e444fdbea450bf23f85) )
|
||||
ROM_LOAD( "rl-05.11", 0x1000, 0x0400, CRC(935ed469) SHA1(052a59df831dcc2c618e9e5e5fdfa47548550596) )
|
||||
ROM_LOAD( "rl-06.3", 0x1400, 0x0400, CRC(24c1cd42) SHA1(fe32ecea77a3777f8137ca248b8f371db37b8b85) )
|
||||
|
||||
ROM_REGION( 0x0400, "gfx1", 0 )
|
||||
ROM_LOAD( "rl08", 0x0000, 0x0400, CRC(d6a50aac) SHA1(0a0c2cefc556e4e15085318fcac485b82bac2416) )
|
||||
ROM_LOAD( "rl-08.43", 0x0000, 0x0400, CRC(d6a50aac) SHA1(0a0c2cefc556e4e15085318fcac485b82bac2416) )
|
||||
|
||||
ROM_REGION( 0x0400, "gfx2", 0 )
|
||||
ROM_LOAD( "rl07", 0x0000, 0x0400, CRC(ba525203) SHA1(1c261cc1259787a7a248766264fefe140226e465) )
|
||||
ROM_LOAD( "rl-07.40", 0x0000, 0x0400, CRC(ba525203) SHA1(1c261cc1259787a7a248766264fefe140226e465) )
|
||||
ROM_END
|
||||
|
||||
|
||||
@ -320,4 +457,4 @@ ROM_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
GAME( 1979, safarir, 0, safarir, safarir, 0, ROT90, "SNK", "Safari Rally (Japan)", GAME_IMPERFECT_COLORS | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1979, safarir, 0, safarir, safarir, 0, ROT90, "SNK", "Safari Rally (Japan)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
|
||||
|
Loading…
Reference in New Issue
Block a user