fixed emulation of the "SNK Wave" custom sound used by Marvin's Maze and Vanguard II and made it into a proper sound core

fixed palette decoding of early SNK games (from marvins to athena + fitegolf). The least significan bits were assigned incorrectly.
merged marvins.c into snk.c, with all resulting fixes (removed hacks, correct shadows, scroll offsets etc)
This commit is contained in:
Nicola Salmoria 2008-09-04 08:57:02 +00:00
parent f724e4c6bf
commit 7c90a0cd38
15 changed files with 1131 additions and 1456 deletions

4
.gitattributes vendored
View File

@ -879,6 +879,8 @@ src/emu/sound/sn76477.c svneol=native#text/plain
src/emu/sound/sn76477.h svneol=native#text/plain
src/emu/sound/sn76496.c svneol=native#text/plain
src/emu/sound/sn76496.h svneol=native#text/plain
src/emu/sound/snkwave.c svneol=native#text/plain
src/emu/sound/snkwave.h svneol=native#text/plain
src/emu/sound/sound.mak svneol=native#text/plain
src/emu/sound/sp0250.c svneol=native#text/plain
src/emu/sound/sp0250.h svneol=native#text/plain
@ -1673,7 +1675,6 @@ src/mame/drivers/marineb.c svneol=native#text/plain
src/mame/drivers/marinedt.c svneol=native#text/plain
src/mame/drivers/mario.c svneol=native#text/plain
src/mame/drivers/markham.c svneol=native#text/plain
src/mame/drivers/marvins.c svneol=native#text/plain
src/mame/drivers/mastboy.c svneol=native#text/plain
src/mame/drivers/matmania.c svneol=native#text/plain
src/mame/drivers/maxaflex.c svneol=native#text/plain
@ -3038,7 +3039,6 @@ src/mame/video/mappy.c svneol=native#text/plain
src/mame/video/marineb.c svneol=native#text/plain
src/mame/video/mario.c svneol=native#text/plain
src/mame/video/markham.c svneol=native#text/plain
src/mame/video/marvins.c svneol=native#text/plain
src/mame/video/matmania.c svneol=native#text/plain
src/mame/video/mayumi.c svneol=native#text/plain
src/mame/video/mcatadv.c svneol=native#text/plain

View File

@ -106,6 +106,7 @@ void namco_cus30_get_info(void *token, UINT32 state, sndinfo *info);
void namco_52xx_get_info(void *token, UINT32 state, sndinfo *info);
void namco_63701x_get_info(void *token, UINT32 state, sndinfo *info);
void namcona_get_info(void *token, UINT32 state, sndinfo *info);
void snkwave_get_info(void *token, UINT32 state, sndinfo *info);
void tms36xx_get_info(void *token, UINT32 state, sndinfo *info);
void tms3615_get_info(void *token, UINT32 state, sndinfo *info);
void tms5100_get_info(void *token, UINT32 state, sndinfo *info);
@ -291,6 +292,9 @@ static const struct
#if (HAS_NAMCONA)
{ SOUND_NAMCONA, namcona_get_info },
#endif
#if (HAS_SNKWAVE)
{ SOUND_SNKWAVE, snkwave_get_info },
#endif
#if (HAS_TMS36XX)
{ SOUND_TMS36XX, tms36xx_get_info },
#endif

View File

@ -70,6 +70,7 @@ enum _sound_type
SOUND_NAMCO_52XX,
SOUND_NAMCO_63701X,
SOUND_NAMCONA,
SOUND_SNKWAVE,
SOUND_TMS36XX,
SOUND_TMS3615,
SOUND_TMS5100,

View File

@ -799,29 +799,6 @@ WRITE8_HANDLER( _20pacgal_wavedata_w )
}
}
/********************************************************************************/
WRITE8_HANDLER( snkwave_w )
{
struct namco_sound *chip = sndti_token(SOUND_NAMCO, 0);
static int freq0 = 0xff;
sound_channel *voice = chip->channel_list;
if( offset==0 ) freq0 = data;
if( offset==1 )
{
stream_update(chip->stream);
if( data==0xff || freq0==0 )
{
voice->volume[0] = 0x0;
}
else
{
voice->volume[0] = 0x8;
voice->frequency = (data<<16)/freq0;
}
}
}

View File

@ -10,8 +10,6 @@ struct _namco_interface
int stereo; /* set to 1 to indicate stereo (e.g., System 1) */
};
WRITE8_HANDLER( snkwave_w );
WRITE8_HANDLER( pacman_sound_enable_w );
WRITE8_HANDLER( pacman_sound_w );

194
src/emu/sound/snkwave.c Normal file
View File

@ -0,0 +1,194 @@
/***************************************************************************
SNK Wave sound driver.
This is a very simple single-voice generator with a programmable waveform.
***************************************************************************/
#include "sndintrf.h"
#include "streams.h"
#include "snkwave.h"
#define WAVEFORM_LENGTH 16
#define CLOCK_SHIFT 8
struct snkwave_sound
{
/* global sound parameters */
sound_stream * stream;
int external_clock;
int sample_rate;
/* data about the sound system */
UINT32 frequency;
UINT32 counter;
int waveform_position;
/* decoded waveform table */
INT16 waveform[WAVEFORM_LENGTH];
};
/* update the decoded waveform data */
/* The programmable waveform consists of 8 3-bit nibbles.
The waveform goes to a 4-bit DAC and is played alternatingly forwards and
backwards.
When going forwards, bit 3 is 1. When going backwards, it's 0.
So the sequence 01234567 will play as
89ABCDEF76543210
*/
static void update_waveform(struct snkwave_sound *chip, unsigned int offset, UINT8 data)
{
assert(offset < WAVEFORM_LENGTH/4);
chip->waveform[offset * 2] = ((data & 0x38) >> 3) << (12-CLOCK_SHIFT);
chip->waveform[offset * 2 + 1] = ((data & 0x07) >> 0) << (12-CLOCK_SHIFT);
chip->waveform[WAVEFORM_LENGTH-2 - offset * 2] = ~chip->waveform[offset * 2 + 1];
chip->waveform[WAVEFORM_LENGTH-1 - offset * 2] = ~chip->waveform[offset * 2];
}
/* generate sound to the mix buffer */
static void snkwave_update(void *param, stream_sample_t **inputs, stream_sample_t **_buffer, int length)
{
struct snkwave_sound *chip = param;
stream_sample_t *buffer = _buffer[0];
/* zap the contents of the buffer */
memset(buffer, 0, length * sizeof(*buffer));
assert(chip->counter < 0x1000);
assert(chip->frequency < 0x1000);
/* if no sound, we're done */
if (chip->frequency == 0xfff)
return;
/* generate sound into buffer while updating the counter */
while (length-- > 0)
{
int loops;
INT16 out = 0;
loops = 1 << CLOCK_SHIFT;
while (loops > 0)
{
int steps = 0x1000 - chip->counter;
if (steps <= loops)
{
out += chip->waveform[chip->waveform_position] * steps;
chip->counter = chip->frequency;
chip->waveform_position = (chip->waveform_position + 1) & (WAVEFORM_LENGTH-1);
loops -= steps;
}
else
{
out += chip->waveform[chip->waveform_position] * loops;
chip->counter += loops;
loops = 0;
}
}
*buffer++ = out;
}
}
static void *snkwave_start(const char *tag, int sndindex, int clock, const void *config)
{
struct snkwave_sound *chip;
assert(config == 0);
chip = auto_malloc(sizeof(*chip));
memset(chip, 0, sizeof(*chip));
/* adjust internal clock */
chip->external_clock = clock;
/* adjust output clock */
chip->sample_rate = chip->external_clock >> CLOCK_SHIFT;
/* get stream channels */
chip->stream = stream_create(0, 1, chip->sample_rate, chip, snkwave_update);
/* reset all the voices */
chip->frequency = 0;
chip->counter = 0;
chip->waveform_position = 0;
/* register with the save state system */
state_save_register_item("snkwave", sndindex, chip->frequency);
state_save_register_item("snkwave", sndindex, chip->counter);
state_save_register_item("snkwave", sndindex, chip->waveform_position);
state_save_register_item_pointer("snkwave", sndindex, chip->waveform, WAVEFORM_LENGTH);
return chip;
}
/********************************************************************************/
/* SNK wave register map
all registers are 6-bit
0-1 frequency (12-bit)
2-5 waveform (8 3-bit nibbles)
*/
WRITE8_HANDLER( snkwave_w )
{
struct snkwave_sound *chip = sndti_token(SOUND_SNKWAVE, 0);
stream_update(chip->stream);
// all registers are 6-bit
data &= 0x3f;
if (offset == 0)
chip->frequency = (chip->frequency & 0x03f) | (data << 6);
else if (offset == 1)
chip->frequency = (chip->frequency & 0xfc0) | data;
else if (offset <= 5)
update_waveform(chip, offset - 2, data);
}
/**************************************************************************
* Generic get_info
**************************************************************************/
static void snkwave_set_info(void *token, UINT32 state, sndinfo *info)
{
switch (state)
{
/* no parameters to set */
}
}
void snkwave_get_info(void *token, UINT32 state, sndinfo *info)
{
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
/* --- the following bits of info are returned as pointers to data or functions --- */
case SNDINFO_PTR_SET_INFO: info->set_info = snkwave_set_info; break;
case SNDINFO_PTR_START: info->start = snkwave_start; break;
case SNDINFO_PTR_STOP: /* Nothing */ break;
case SNDINFO_PTR_RESET: /* Nothing */ break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case SNDINFO_STR_NAME: info->s = "SNK Wave"; break;
case SNDINFO_STR_CORE_FAMILY: info->s = "SNK Wave"; break;
case SNDINFO_STR_CORE_VERSION: info->s = "1.0"; break;
case SNDINFO_STR_CORE_FILE: info->s = __FILE__; break;
case SNDINFO_STR_CORE_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
}
}

9
src/emu/sound/snkwave.h Normal file
View File

@ -0,0 +1,9 @@
#pragma once
#ifndef __SNKWAVE_H__
#define __SNKWAVE_H__
WRITE8_HANDLER( snkwave_w );
#endif /* __SNKWAVE_H__ */

View File

@ -492,6 +492,18 @@ endif
#-------------------------------------------------
# SNK custom wave generator
#-------------------------------------------------
SOUNDDEFS += -DHAS_SNKWAVE=$(if $(filter SNKWAVE,$(SOUNDS)),1,0)
ifneq ($(filter SNKWAVE,$(SOUNDS)),)
SOUNDOBJS += $(SOUNDOBJ)/snkwave.o
endif
#-------------------------------------------------
# Sony custom sound chips
#-------------------------------------------------

View File

@ -72,7 +72,7 @@ cc_p14.j2 8192 0xedc6a1eb M5L2764k
#include "driver.h"
#include "sound/ay8910.h"
#include "sound/namco.h"
#include "sound/snkwave.h"
extern UINT8 *mainsnk_fgram;
extern UINT8 *mainsnk_bgram;
@ -135,7 +135,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_BASE(&namco_wavedata)
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0xa000, 0xa000) AM_READ(sound_command_r)
AM_RANGE(0xc000, 0xc000) AM_READ(sound_ack_r)
@ -356,12 +356,6 @@ static const gfx_layout sprite_layout =
256
};
static const namco_interface snkwave_interface =
{
1,
0 /* stereo */
};
static GFXDECODE_START( mainsnk )
GFXDECODE_ENTRY( "gfx1", 0x0, tile_layout, 0, 8 )
@ -400,8 +394,7 @@ static MACHINE_DRIVER_START( mainsnk )
MDRV_SOUND_ADD("ay2", AY8910, 2000000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
MDRV_SOUND_ADD("namco", NAMCO, 24000)
MDRV_SOUND_CONFIG(snkwave_interface)
MDRV_SOUND_ADD("wave", SNKWAVE, 8000000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
MACHINE_DRIVER_END

View File

@ -1,784 +0,0 @@
/*
various early SNK games (1983-1985)
- Marvin's Maze
- Vanguard II
- Mad Crasher
driver by Phil Stroffolino
Known Issues:
Mad Crasher fails the ROM test, but ROMs are verified to be good (reason's unknown)
Mad Crasher sound effects aren't being played (fixed)
Change Log
----------
AT08XX03:
- added shadows
- fixed Mad Crasher bad background, sound effects and foreground priority.
(great now I can fall under the skyway like I did at Chuck'n Cheese;)
- fixed Vanguard2 scroll offsets
- tuned music tempo and wavegen frequency
2008.04.04: Small note regarding DipSwitches. Locations and values have been
verified with the manual for both Marvin's Maze and Mad Crasher. Vanguard II
DIPs have been checked against jammaboards diplist, no manual available ATM.
DSW2:7 in madcrash is listed as Difficulty, but it's not clear how it affects
the gameplay difficulty
*/
#include "driver.h"
#include "deprecat.h"
#include "cpu/z80/z80.h"
#include "snk.h"
#include "sound/ay8910.h"
#include "sound/namco.h"
#define CREDITS "Phil Stroffolino\nTim Lindquist\nCarlos A. Lozano"
extern int marvins_gamegroup;
// FIXME this is definitely wrong, schematics clearly show that vblank triggers interrupt
// on both CPU at the same time.
static int snk_irq_delay = 1500;
// see IRQ notes in drivers\marvins.c
static TIMER_CALLBACK( irq_trigger_callback ) { cpunum_set_input_line(machine, param, 0, HOLD_LINE); }
static INTERRUPT_GEN( snk_irq_BA )
{
cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 0, irq_trigger_callback);
}
/***************************************************************************
**
** CPUA and CPUB communicate through shared RAM.
**
***************************************************************************/
extern WRITE8_HANDLER( marvins_background_ram_w );
extern WRITE8_HANDLER( marvins_foreground_ram_w );
extern WRITE8_HANDLER( marvins_text_ram_w );
extern WRITE8_HANDLER( marvins_spriteram_w );
/***************************************************************************
**
** Video Driver
**
***************************************************************************/
extern VIDEO_START( marvins );
extern VIDEO_UPDATE( marvins );
extern VIDEO_UPDATE( madcrash );
extern WRITE8_HANDLER( marvins_palette_bank_w );
/***************************************************************************
**
** Interrupt Handling
**
** CPUA can trigger an interrupt on CPUB, and CPUB can trigger an interrupt
** on CPUA. Each CPU must re-enable interrupts on itself.
**
***************************************************************************/
// see drivers\snk.c
/***************************************************************************
**
** Sound System
**
** The sound CPU is a slave, with communication.
**
** Sound Chips: PSGX2 + "Wave Generater"
**
** The Custom Wave Generator is controlled by 6 bytes
**
** The first pair of registers (0x8002, 0x8003) appear to define frequency
** as a fraction: RAM[0x8003]/RAM[0x8002].
**
** (0x8004, 0x8005, 0x8006, 0x8007) are currently unmapped. Probably they
** control the shape of the wave being played.
**
** snkwave_interface is currently implemented with the "namco" sound component.
**
***************************************************************************/
static int sound_cpu_busy;
static const namco_interface snkwave_interface =
{
1, /* number of voices */
0 /* stereo */
};
static WRITE8_HANDLER( sound_command_w )
{
sound_cpu_busy = 0x01;
soundlatch_w(machine, 0, data);
cpunum_set_input_line(machine, 2, 0, HOLD_LINE);
}
static READ8_HANDLER( sound_command_r )
{
sound_cpu_busy = 0;
return(soundlatch_r(machine,0));
}
static READ8_HANDLER( sound_nmi_ack_r )
{
cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
return 0;
}
static CUSTOM_INPUT( sound_status_r )
{
return sound_cpu_busy;
}
static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM AM_BASE(&namco_wavedata) /* silly hack - this shouldn't be here */
AM_RANGE(0x4000, 0x4000) AM_READ(sound_command_r)
AM_RANGE(0x8000, 0x8000) AM_WRITE(ay8910_control_port_0_w)
AM_RANGE(0x8001, 0x8001) AM_WRITE(ay8910_write_port_0_w)
AM_RANGE(0x8002, 0x8007) AM_WRITE(snkwave_w)
AM_RANGE(0x8008, 0x8008) AM_WRITE(ay8910_control_port_1_w)
AM_RANGE(0x8009, 0x8009) AM_WRITE(ay8910_write_port_1_w)
AM_RANGE(0xa000, 0xa000) AM_READ(sound_nmi_ack_r)
AM_RANGE(0xe000, 0xe7ff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READNOP
ADDRESS_MAP_END
/***************************************************************************
**
** Memory Maps for CPUA, CPUB
**
** Shared RAM is shuffled in Mad Crasher/Vanguard II compared to
** Marvin's Maze.
**
** A few ports are mapped differently for each game.
**
***************************************************************************/
static ADDRESS_MAP_START( marvins_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x5fff) AM_ROM
AM_RANGE(0x6000, 0x6000) AM_WRITE(marvins_palette_bank_w)
AM_RANGE(0x8000, 0x8000) AM_READ_PORT("SYSTEM")
AM_RANGE(0x8100, 0x8100) AM_READ_PORT("P1")
AM_RANGE(0x8200, 0x8200) AM_READ_PORT("P2")
AM_RANGE(0x8300, 0x8300) AM_WRITE(sound_command_w)
AM_RANGE(0x8400, 0x8400) AM_READ_PORT("DSW1")
AM_RANGE(0x8500, 0x8500) AM_READ_PORT("DSW2")
AM_RANGE(0x8600, 0x8600) AM_RAM /* video attribute */
AM_RANGE(0x8700, 0x8700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1)
AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(marvins_background_ram_w) AM_SHARE(2) AM_BASE(&spriteram_3)
AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(marvins_foreground_ram_w) AM_SHARE(3) AM_BASE(&spriteram_2)
AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(marvins_text_ram_w) AM_SHARE(4) AM_BASE(&videoram)
ADDRESS_MAP_END
static ADDRESS_MAP_START( marvins_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x5fff) AM_ROM
AM_RANGE(0x8700, 0x8700) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE(1)
AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(marvins_background_ram_w) AM_SHARE(2)
AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(marvins_foreground_ram_w) AM_SHARE(3)
AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(marvins_text_ram_w) AM_SHARE(4)
ADDRESS_MAP_END
static ADDRESS_MAP_START( madcrash_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x8000) AM_READ_PORT("SYSTEM")
AM_RANGE(0x8100, 0x8100) AM_READ_PORT("P1")
AM_RANGE(0x8200, 0x8200) AM_READ_PORT("P2")
AM_RANGE(0x8300, 0x8300) AM_WRITE(sound_command_w)
AM_RANGE(0x8400, 0x8400) AM_READ_PORT("DSW1")
AM_RANGE(0x8500, 0x8500) AM_READ_PORT("DSW2")
AM_RANGE(0x8600, 0x86ff) AM_RAM /* video attribute */
AM_RANGE(0x8700, 0x8700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
// AM_RANGE(0xc800, 0xc800) AM_WRITE(marvins_palette_bank_w) // palette bank switch (c8f1 for Vanguard)
AM_RANGE(0xc800, 0xc8ff) AM_RAM
AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1)
AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(marvins_background_ram_w) AM_SHARE(2) AM_BASE(&spriteram_3)
AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(marvins_foreground_ram_w) AM_SHARE(3) AM_BASE(&spriteram_2)
AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(marvins_text_ram_w) AM_SHARE(4) AM_BASE(&videoram)
ADDRESS_MAP_END
static ADDRESS_MAP_START( madcrash_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x8700, 0x8700) AM_WRITE(snk_cpuB_nmi_ack_w) /* Vangaurd II */
AM_RANGE(0x0000, 0x9fff) AM_ROM
AM_RANGE(0xa000, 0xa000) AM_WRITE(snk_cpuB_nmi_ack_w) /* Mad Crasher */
AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(marvins_foreground_ram_w) AM_SHARE(3)
AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(marvins_text_ram_w) AM_SHARE(4)
AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE(1)
AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(marvins_background_ram_w) AM_SHARE(2)
ADDRESS_MAP_END
static INPUT_PORTS_START( marvins )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sound_status_r, NULL) /* sound CPU status */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x01, "2" )
PORT_DIPSETTING( 0x02, "3" )
PORT_DIPSETTING( 0x03, "5" )
PORT_DIPNAME(0x04, 0x04, "Infinite Lives (Cheat)") PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x38, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:4,5,6")
PORT_DIPSETTING( 0x38, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x28, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_6C ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, "Freeze" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW2")
PORT_DIPNAME( 0x07, 0x00, "1st Bonus Life" ) PORT_DIPLOCATION("SW2:1,2,3")
PORT_DIPSETTING( 0x00, "10000" )
PORT_DIPSETTING( 0x01, "20000" )
PORT_DIPSETTING( 0x02, "30000" )
PORT_DIPSETTING( 0x03, "40000" )
PORT_DIPSETTING( 0x04, "50000" )
PORT_DIPSETTING( 0x05, "60000" )
PORT_DIPSETTING( 0x06, "70000" )
PORT_DIPSETTING( 0x07, "80000" )
PORT_DIPNAME( 0x18, 0x08, "2nd Bonus Life" ) PORT_DIPLOCATION("SW2:4,5")
PORT_DIPSETTING( 0x08, "1st bonus*2" )
PORT_DIPSETTING( 0x10, "1st bonus*3" )
PORT_DIPSETTING( 0x18, "1st bonus*4" )
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:6")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( vangrd2 )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sound_status_r, NULL) /* sound CPU status */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) )
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,5,6")
PORT_DIPSETTING( 0x38, "30000" )
PORT_DIPSETTING( 0x30, "40000" )
PORT_DIPSETTING( 0x28, "50000" )
PORT_DIPSETTING( 0x20, "60000" )
PORT_DIPSETTING( 0x18, "70000" )
PORT_DIPSETTING( 0x10, "80000" )
PORT_DIPSETTING( 0x08, "90000" )
PORT_DIPSETTING( 0x00, "100000" )
PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x40, "2" )
PORT_DIPSETTING( 0x80, "3" )
PORT_DIPSETTING( 0xc0, "5" )
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_DIPLOCATION("SW2:2")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x04, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:4")
PORT_DIPSETTING( 0x08, DEF_STR( English ) )
PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) )
PORT_DIPNAME( 0x10, 0x00, "Bonus Life Occurence" ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x00, "Every bonus" )
PORT_DIPSETTING( 0x10, "Bonus only" )
PORT_DIPNAME( 0x20, 0x20, "Infinite Lives (Cheat)") PORT_DIPLOCATION("SW2:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( madcrash )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sound_status_r, NULL) /* sound CPU status */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("DSW1")
PORT_DIPUNUSED_DIPLOC(0x01, IP_ACTIVE_LOW, "SW1:1") /* Listed as Unused */
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, "3" )
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:4,5,6")
// PORT_DIPSETTING( 0x08, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x38, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0xc0, "20000 60000" )
PORT_DIPSETTING( 0x80, "40000 90000" )
PORT_DIPSETTING( 0x40, "50000 120000" )
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x00, "Bonus Life Occurence" ) PORT_DIPLOCATION("SW2:1")
PORT_DIPSETTING( 0x01, "1st, 2nd, then every 2nd" ) /* Check the "Non Bugs" page */
PORT_DIPSETTING( 0x00, "1st and 2nd only" )
PORT_DIPNAME( 0x06, 0x04, "Scroll Speed" ) PORT_DIPLOCATION("SW2:2,3")
PORT_DIPSETTING( 0x06, "Slow" )//DEF_STR( Easy ) )
PORT_DIPSETTING( 0x04, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x02, "Fast" )//DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, "Faster" )
PORT_DIPNAME( 0x18, 0x10, "Game mode" ) PORT_DIPLOCATION("SW2:4,5")
PORT_DIPSETTING( 0x18, "Demo Sounds Off" )
PORT_DIPSETTING( 0x10, "Demo Sounds On" )
PORT_DIPSETTING( 0x08, "Infinite Lives (Cheat)")
PORT_DIPSETTING( 0x00, "Freeze" )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) ) /* Check the "Non Bugs" page */
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x40, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
PORT_DIPUNKNOWN_DIPLOC(0x80, IP_ACTIVE_LOW, "SW2:8") /* Listed as Unused, it is actually tested in many places */
INPUT_PORTS_END
/***************************************************************************
**
** Graphics Layout
**
***************************************************************************/
static const gfx_layout sprite_layout =
{
16,16,
0x100,
3,
{ 0,0x2000*8,0x4000*8 },
{
7,6,5,4,3,2,1,0,
15,14,13,12,11,10,9,8
},
{
0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16
},
256
};
static const gfx_layout tile_layout =
{
8,8,
0x100,
4,
{ 0, 1, 2, 3 },
{ 4, 0, 12, 8, 20, 16, 28, 24},
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
256
};
static GFXDECODE_START( marvins )
GFXDECODE_ENTRY( "gfx1", 0, tile_layout, 0x080, 8 ) /* text layer */
GFXDECODE_ENTRY( "gfx2", 0, tile_layout, 0x110, 1 ) /* background */
GFXDECODE_ENTRY( "gfx3", 0, tile_layout, 0x100, 1 ) /* foreground */
GFXDECODE_ENTRY( "gfx4", 0, sprite_layout, 0x000, 16 ) /* sprites */
GFXDECODE_END
/***************************************************************************
**
** Machine Driver
**
***************************************************************************/
static MACHINE_DRIVER_START( marvins )
/* basic machine hardware */
MDRV_CPU_ADD("main", Z80, 3360000) /* 3.36 MHz */
MDRV_CPU_PROGRAM_MAP(marvins_cpuA_map,0)
MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
MDRV_CPU_ADD("sub", Z80, 3360000) /* 3.36 MHz */
MDRV_CPU_PROGRAM_MAP(marvins_cpuB_map,0)
MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
MDRV_CPU_ADD("audio", Z80, 4000000) /* 4.0 MHz */
MDRV_CPU_PROGRAM_MAP(sound_map,0)
MDRV_CPU_IO_MAP(sound_portmap,0)
MDRV_CPU_PERIODIC_INT(nmi_line_assert, 244) // schematics show a separate 244Hz timer
MDRV_INTERLEAVE(100)
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
MDRV_SCREEN_ADD("main", RASTER)
MDRV_SCREEN_REFRESH_RATE(60.606060)
MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_SIZE(256+32, 224)
MDRV_SCREEN_VISIBLE_AREA(0, 255+32,0, 223)
MDRV_GFXDECODE(marvins)
MDRV_PALETTE_LENGTH((16+2)*16)
MDRV_VIDEO_START(marvins)
MDRV_VIDEO_UPDATE(marvins)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
MDRV_SOUND_ADD("ay1", AY8910, 2000000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MDRV_SOUND_ADD("ay2", AY8910, 2000000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MDRV_SOUND_ADD("namco", NAMCO, 8000000/256)
MDRV_SOUND_CONFIG(snkwave_interface)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( vangrd2 )
/* basic machine hardware */
MDRV_CPU_ADD("main", Z80, 3360000) /* 3.36 MHz */
MDRV_CPU_PROGRAM_MAP(madcrash_cpuA_map,0)
MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
MDRV_CPU_ADD("sub", Z80, 3360000) /* 3.36 MHz */
MDRV_CPU_PROGRAM_MAP(madcrash_cpuB_map,0)
MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
MDRV_CPU_ADD("audio", Z80, 4000000) /* 4.0 MHz */
MDRV_CPU_PROGRAM_MAP(sound_map,0)
MDRV_CPU_IO_MAP(sound_portmap,0)
MDRV_CPU_PERIODIC_INT(nmi_line_assert, 244)
MDRV_INTERLEAVE(100)
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
MDRV_SCREEN_ADD("main", RASTER)
MDRV_SCREEN_REFRESH_RATE(60.606060)
MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_SIZE(256+32, 224)
MDRV_SCREEN_VISIBLE_AREA(0, 255+32,0, 223)
MDRV_GFXDECODE(marvins)
MDRV_PALETTE_LENGTH((16+2)*16)
MDRV_VIDEO_START(marvins)
MDRV_VIDEO_UPDATE(madcrash)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
MDRV_SOUND_ADD("ay1", AY8910, 2000000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MDRV_SOUND_ADD("ay2", AY8910, 2000000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MDRV_SOUND_ADD("namco", NAMCO, 8000000/256)
MDRV_SOUND_CONFIG(snkwave_interface)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( madcrash )
/* basic machine hardware */
MDRV_IMPORT_FROM( vangrd2 )
MDRV_CPU_MODIFY("main")
MDRV_CPU_VBLANK_INT_HACK(0, 0)
MDRV_CPU_MODIFY("sub")
MDRV_CPU_VBLANK_INT("main", snk_irq_BA)
MDRV_INTERLEAVE(300)
/* video hardware */
MDRV_SCREEN_MODIFY("main")
MDRV_SCREEN_VISIBLE_AREA(16, 16+256-1, 0, 0+216-1)
MACHINE_DRIVER_END
/***************************************************************************
**
** ROM Loading
**
** note:
** Mad Crasher doesn't pass its internal checksum
** Also, some of the background graphics look to be incorrect.
**
***************************************************************************/
ROM_START( marvins )
ROM_REGION( 0x10000, "main", 0 ) /* 64k for CPUA code */
ROM_LOAD( "pa1", 0x0000, 0x2000, CRC(0008d791) SHA1(6ffb174b2d680314f74efeef83da9f3ee3e0c753) )
ROM_LOAD( "pa2", 0x2000, 0x2000, CRC(9457003c) SHA1(05ecd5c638a12163e2a65bdfcc09875618f792e1) )
ROM_LOAD( "pa3", 0x4000, 0x2000, CRC(54c33ecb) SHA1(cfbf9ffc125fbc51f2abef180f36781f9e748bbd) )
ROM_REGION( 0x10000, "sub", 0 ) /* 64k for CPUB code */
ROM_LOAD( "pb1", 0x0000, 0x2000, CRC(3b6941a5) SHA1(9c29870196eaed87f34456fdb06bf7b69c8f489d) )
ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound code */
ROM_LOAD( "m1", 0x0000, 0x2000, CRC(2314c696) SHA1(1b84a0c82a4dcff648752f53aa1f0abf5357c5d1) )
ROM_LOAD( "m2", 0x2000, 0x2000, CRC(74ba5799) SHA1(c278b0e5c4134f6077d4ae7b51e3c5cba28af1a8) )
ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
ROM_LOAD( "s1", 0x0000, 0x2000, CRC(327f70f3) SHA1(078dcc6b4697617d4d833ccd59c6a543b2a88d9e) ) /* characters */
ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE )
ROM_LOAD( "b1", 0x0000, 0x2000, CRC(e528bc60) SHA1(3365ac7cbc57739054bc11e68831be87c0c1a97a) ) /* background tiles */
ROM_REGION( 0x2000, "gfx3", ROMREGION_DISPOSE )
ROM_LOAD( "b2", 0x0000, 0x2000, CRC(e528bc60) SHA1(3365ac7cbc57739054bc11e68831be87c0c1a97a) ) /* foreground tiles */
ROM_REGION( 0x6000, "gfx4", ROMREGION_DISPOSE )
ROM_LOAD( "f3", 0x0000, 0x2000, CRC(e55c9b83) SHA1(04b0d99955e4b11820015b7721ac6399a3d5a829) ) /* sprites */
ROM_LOAD( "f2", 0x2000, 0x2000, CRC(8fc2b081) SHA1(fb345965375cb62ec1b947d6c6d071380dc0f395) )
ROM_LOAD( "f1", 0x4000, 0x2000, CRC(0bd6b4e5) SHA1(c56747ff2135db734f1b5f6c2906de5ac8f53bbc) )
ROM_REGION( 0x0c00, "proms", 0 )
ROM_LOAD( "marvmaze.j1", 0x000, 0x400, CRC(92f5b06d) SHA1(97979ffb6fb065d9c99da43173180fefb2de1886) )
ROM_LOAD( "marvmaze.j2", 0x400, 0x400, CRC(d2b25665) SHA1(b913b8b9c5ee0a29b5a115b2432c5706979059cf) )
ROM_LOAD( "marvmaze.j3", 0x800, 0x400, CRC(df9e6005) SHA1(8f633f664c3f8e4f6ca94bee74a68c8fda8873e3) )
ROM_END
ROM_START( madcrash )
ROM_REGION( 0x10000, "main", 0 ) /* 64k for CPUA code */
ROM_LOAD( "p8", 0x0000, 0x2000, CRC(ecb2fdc9) SHA1(7dd79fbbe286a9f18ed2cae45b1bfab765e549a1) )
ROM_LOAD( "p9", 0x2000, 0x2000, CRC(0a87df26) SHA1(327710452bdc5dbb931abc853957225814f224c5) )
ROM_LOAD( "p10", 0x4000, 0x2000, CRC(6eb8a87c) SHA1(375377df22b331175aaf1f9eb8d8ad83e8e146f6) )
ROM_REGION( 0x10000, "sub", 0 ) /* 64k for CPUB code */
ROM_LOAD( "p4", 0x0000, 0x2000, CRC(5664d699) SHA1(5bfa57a0f8d718d522003da6513a70d7ca3a87a3) )
ROM_LOAD( "p5", 0x2000, 0x2000, CRC(dea2865a) SHA1(0807281e35159ee29fbe2d1aa087b57804f1a14f) )
ROM_LOAD( "p6", 0x4000, 0x2000, CRC(e25a9b9c) SHA1(26853611e3898907239e15f1a00f62290889f89b) )
ROM_LOAD( "p7", 0x6000, 0x2000, CRC(55b14a36) SHA1(7d5566a6ba285af92ddf560efda60a79f1da84c2) )
ROM_LOAD( "p3", 0x8000, 0x2000, CRC(e3c8c2cb) SHA1(b3e39eacd2609ff0fa0f511bff0fc83e6b3970d4) )
ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound code */
ROM_LOAD( "p1", 0x0000, 0x2000, CRC(2dcd036d) SHA1(4da42ab1e502fff57f5d5787df406289538fa484) )
ROM_LOAD( "p2", 0x2000, 0x2000, CRC(cc30ae8b) SHA1(ffedc747b9e0b616a163ff8bb1def318e522585b) )
ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
ROM_LOAD( "p13", 0x0000, 0x2000, CRC(48c4ade0) SHA1(3628abb4f425b8c9d8659c8e4082735168b0f3e9) ) /* characters */
ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE )
ROM_LOAD( "p11", 0x0000, 0x2000, CRC(67174956) SHA1(65a921176294212971c748932a9010f45e1fb499) ) /* background tiles */
ROM_REGION( 0x2000, "gfx3", ROMREGION_DISPOSE )
ROM_LOAD( "p12", 0x0000, 0x2000, CRC(085094c1) SHA1(5c5599d1ed7f8a717ada54bbd28383a22e09a8fe) ) /* foreground tiles */
ROM_REGION( 0x6000, "gfx4", ROMREGION_DISPOSE )
ROM_LOAD( "p14", 0x0000, 0x2000, CRC(07e807bc) SHA1(f651d3a5394ced8e0a1b2be3aa52b3e5a5d84c37) ) /* sprites */
ROM_LOAD( "p15", 0x2000, 0x2000, CRC(a74149d4) SHA1(e8011a8d4d1a98a0ffe67fc28ea9fa192ca80321) )
ROM_LOAD( "p16", 0x4000, 0x2000, CRC(6153611a) SHA1(b352f92b233761122f74830e46913cc4df800259) )
ROM_REGION( 0x0c00, "proms", 0 )
ROM_LOAD( "m3-prom.j3", 0x000, 0x400, CRC(d19e8a91) SHA1(b21fbdb8ed8d0b27c3ec78cf2e115624f69c67e0) )
ROM_LOAD( "m2-prom.j4", 0x400, 0x400, CRC(9fc325af) SHA1(a180662f168ba001376f25f5d9205cb119c1ffee) )
ROM_LOAD( "m1-prom.j5", 0x800, 0x400, CRC(07678443) SHA1(267951886d8b031dd633dc4823d9bd862a585437) )
ROM_END
ROM_START( vangrd2 )
ROM_REGION( 0x10000, "main", 0 )
ROM_LOAD( "p1.9a", 0x0000, 0x2000, CRC(bc9eeca5) SHA1(5a737e0f0aa1a3a5296d1e1fec13b34aee970609) )
ROM_LOAD( "p3.11a", 0x2000, 0x2000, CRC(3970f69d) SHA1(b0ef7494888804ab5b4002730fb0232a7fd6797b) )
ROM_LOAD( "p2.12a", 0x4000, 0x2000, CRC(58b08b58) SHA1(eccc85191d678a0115a113002a43203afd857a5b) )
ROM_LOAD( "p4.14a", 0x6000, 0x2000, CRC(a95f11ea) SHA1(8007efb4ad948c8768e474fc77134f3ce52da1d2) )
ROM_REGION( 0x10000, "sub", 0 )
ROM_LOAD( "p5.4a", 0x0000, 0x2000, CRC(e4dfd0ba) SHA1(12d45ff147f3ea9c9e898c3831874cd7c1a071b7) )
ROM_LOAD( "p6.6a", 0x2000, 0x2000, CRC(894ff00d) SHA1(1c66f327d8e94dc6ac386e11fcc5eb17c9081434) )
ROM_LOAD( "p7.7a", 0x4000, 0x2000, CRC(40b4d069) SHA1(56c464bd055125ffc2da02d70137aa5efe5cd8f6) )
ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound code */
ROM_LOAD( "p8.6a", 0x0000, 0x2000, CRC(a3daa438) SHA1(4e659ac7e3ebaf85bc3ce5c9946fcf0af23083b4) )
ROM_LOAD( "p9.8a", 0x2000, 0x2000, CRC(9345101a) SHA1(b99ad1c2a79df50b0a60fdd43ca466f6cb38445b) )
ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
ROM_LOAD( "p15.1e", 0x0000, 0x2000, CRC(85718a41) SHA1(4c9aa1f8b229410414cd67bac8cb10a14bea12f4) ) /* characters */
ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE )
ROM_LOAD( "p13.1a", 0x0000, 0x2000, CRC(912f22c6) SHA1(5042edc80b58f77b3576b5e6eb8c6460c8a35494) ) /* background tiles */
ROM_REGION( 0x2000, "gfx3", ROMREGION_DISPOSE )
ROM_LOAD( "p9", 0x0000, 0x2000, CRC(7aa0b684) SHA1(d52670ec50b1a07d6c2c537f67922063deacdeea) ) /* foreground tiles */
ROM_REGION( 0x6000, "gfx4", ROMREGION_DISPOSE )
ROM_LOAD( "p12.1kl", 0x0000, 0x2000, CRC(8658ea6c) SHA1(d5ea9be2c1776b11abc77c944a653eeb73b27fc8) ) /* sprites */
ROM_LOAD( "p11.3kl", 0x2000, 0x2000, CRC(620cd4ec) SHA1(a2fcc3d24d0d3c7cc601620ae7a709f46b613c0f) )
ROM_LOAD( "p10.4kl", 0x4000, 0x2000, CRC(5bfc04c0) SHA1(4eb152fdf39cb0024f71d5bdf1bfc79c2b8c2329) )
ROM_REGION( 0x0c00, "proms", 0 )
ROM_LOAD( "mb7054.3j", 0x000, 0x400, CRC(506f659a) SHA1(766f1a0dd462eba64546c514004e6542e200d7c3) )
ROM_LOAD( "mb7054.4j", 0x400, 0x400, CRC(222133ce) SHA1(109a63c8c44608a8ad9183e7b5d269765cc5f067) )
ROM_LOAD( "mb7054.5j", 0x800, 0x400, CRC(2e21a79b) SHA1(1956377c799e0bbd127bf4fae016adc148efe007) )
ROM_END
/*******************************************************************************************/
static DRIVER_INIT( marvins )
{
sound_cpu_busy = 0;
marvins_gamegroup = 0;
}
static DRIVER_INIT( madcrash )
{
/*
The following lines patch out the ROM test (which fails - probably
because of bit rot, so the rest of the test mode (what little there
is) can be explored.
UINT8 *mem = memory_region(machine, "main");
mem[0x3a5d] = 0; mem[0x3a5e] = 0; mem[0x3a5f] = 0;
*/
sound_cpu_busy = 0;
marvins_gamegroup = 1;
snk_irq_delay = 1700;
}
static DRIVER_INIT( vangrd2 )
{
sound_cpu_busy = 0;
marvins_gamegroup = 2;
}
GAME( 1983, marvins, 0, marvins, marvins, marvins, ROT270, "SNK", "Marvin's Maze", 0 )
GAME( 1984, madcrash, 0, madcrash, madcrash, madcrash, ROT0, "SNK", "Mad Crasher", GAME_IMPERFECT_GRAPHICS )
GAME( 1984, vangrd2, 0, vangrd2, vangrd2, vangrd2, ROT270, "SNK", "Vanguard II", 0 )

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,8 @@ extern WRITE8_HANDLER( snk_cpuB_nmi_ack_w );
extern PALETTE_INIT( tnk3 );
extern VIDEO_START( marvins );
extern VIDEO_START( madcrash );
extern VIDEO_START( jcross );
extern VIDEO_START( sgladiat );
extern VIDEO_START( hal21 );
@ -28,11 +30,14 @@ extern VIDEO_START( ikari );
extern VIDEO_START( gwar );
extern VIDEO_START( tdfever );
extern VIDEO_UPDATE( marvins );
extern VIDEO_UPDATE( tnk3 );
extern VIDEO_UPDATE( ikari );
extern VIDEO_UPDATE( gwar );
extern VIDEO_UPDATE( tdfever );
extern WRITE8_HANDLER( snk_fg_scrollx_w );
extern WRITE8_HANDLER( snk_fg_scrolly_w );
extern WRITE8_HANDLER( snk_bg_scrollx_w );
extern WRITE8_HANDLER( snk_bg_scrolly_w );
extern WRITE8_HANDLER( snk_sp16_scrollx_w );
@ -40,8 +45,12 @@ extern WRITE8_HANDLER( snk_sp16_scrolly_w );
extern WRITE8_HANDLER( snk_sp32_scrollx_w );
extern WRITE8_HANDLER( snk_sp32_scrolly_w );
extern WRITE8_HANDLER( snk_sprite_split_point_w );
extern WRITE8_HANDLER( marvins_palette_bank_w );
extern WRITE8_HANDLER( marvins_scroll_msb_w );
extern WRITE8_HANDLER( jcross_scroll_msb_w );
extern WRITE8_HANDLER( sgladiat_scroll_msb_w );
extern WRITE8_HANDLER( marvins_flipscreen_w );
extern WRITE8_HANDLER( sgladiat_flipscreen_w );
extern WRITE8_HANDLER( hal21_flipscreen_w );
extern WRITE8_HANDLER( tnk3_videoattrs_w );
@ -50,19 +59,20 @@ extern WRITE8_HANDLER( aso_bg_bank_w );
extern WRITE8_HANDLER( ikari_bg_scroll_msb_w );
extern WRITE8_HANDLER( ikari_sp_scroll_msb_w );
extern WRITE8_HANDLER( ikari_unknown_video_w );
extern WRITE8_HANDLER( gwar_fg_bank_w );
extern WRITE8_HANDLER( gwar_tx_bank_w );
extern WRITE8_HANDLER( gwar_videoattrs_w );
extern WRITE8_HANDLER( gwar_sprite_split_point_w );
extern WRITE8_HANDLER( gwara_videoattrs_w );
extern WRITE8_HANDLER( gwara_sp_scroll_msb_w );
extern WRITE8_HANDLER( tdfever_sp_scroll_msb_w );
extern WRITE8_HANDLER( tdfever_spriteram_w );
extern UINT8 *snk_tx_videoram;
extern UINT8 *snk_fg_videoram;
extern UINT8 *snk_bg_videoram;
extern WRITE8_HANDLER( snk_fg_videoram_w );
extern WRITE8_HANDLER( snk_tx_videoram_w );
extern WRITE8_HANDLER( snk_bg_videoram_w );
extern WRITE8_HANDLER( aso_bg_videoram_w );
extern WRITE8_HANDLER( marvins_fg_videoram_w );
extern WRITE8_HANDLER( marvins_bg_videoram_w );
/*----------- defined in drivers/hal21.c -----------*/

View File

@ -264,6 +264,7 @@ SOUNDS += NAMCO_CUS30
SOUNDS += NAMCO_52XX
SOUNDS += NAMCO_63701X
SOUNDS += NAMCONA
SOUNDS += SNKWAVE
SOUNDS += C140
SOUNDS += C352
SOUNDS += TMS36XX
@ -1266,7 +1267,6 @@ $(MAMEOBJ)/snk.a: \
$(DRIVERS)/hng64.o $(VIDEO)/hng64.o \
$(DRIVERS)/lasso.o $(VIDEO)/lasso.o \
$(DRIVERS)/mainsnk.o $(VIDEO)/mainsnk.o \
$(DRIVERS)/marvins.o $(VIDEO)/marvins.o \
$(DRIVERS)/munchmo.o $(VIDEO)/munchmo.o \
$(DRIVERS)/prehisle.o $(VIDEO)/prehisle.o \
$(DRIVERS)/rockola.o $(AUDIO)/rockola.o $(VIDEO)/rockola.o \

View File

@ -1,476 +0,0 @@
#include "driver.h"
#include "cpu/z80/z80.h"
#include "snk.h"
int marvins_gamegroup;
static int flipscreen, sprite_flip_adjust;
static tilemap *fg_tilemap, *bg_tilemap, *tx_tilemap;
static UINT8 bg_color, fg_color, old_bg_color, old_fg_color;
static rectangle tilemap_clip;
static int video_bank = 0;
/***************************************************************************
**
** Palette Handling:
**
** Each color entry is encoded by 12 bits in color proms
**
** There are sixteen 8-color sprite palettes
** sprite palette is selected by a nibble of spriteram
**
** There are eight 16-color text layer character palettes
** character palette is determined by character_number
**
** Background and Foreground tilemap layers each have eight 16-color
** palettes. A palette bank select register is associated with the whole
** layer.
**
***************************************************************************/
WRITE8_HANDLER( marvins_palette_bank_w )
{
bg_color = data>>4;
fg_color = data&0xf;
}
static void stuff_palette( running_machine *machine, int source_index, int dest_index, int num_colors )
{
UINT8 *color_prom = memory_region(machine, "proms") + source_index;
int i;
for( i=0; i<num_colors; i++ )
{
int bit0=0,bit1,bit2,bit3;
int red, green, blue;
bit0 = (color_prom[0x800] >> 2) & 0x01; // ?
bit1 = (color_prom[0x000] >> 1) & 0x01;
bit2 = (color_prom[0x000] >> 2) & 0x01;
bit3 = (color_prom[0x000] >> 3) & 0x01;
red = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
bit0 = (color_prom[0x800] >> 1) & 0x01; // ?
bit1 = (color_prom[0x400] >> 2) & 0x01;
bit2 = (color_prom[0x400] >> 3) & 0x01;
bit3 = (color_prom[0x000] >> 0) & 0x01;
green = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
bit0 = (color_prom[0x800] >> 0) & 0x01; // ?
bit1 = (color_prom[0x800] >> 3) & 0x01; // ?
bit2 = (color_prom[0x400] >> 0) & 0x01;
bit3 = (color_prom[0x400] >> 1) & 0x01;
blue = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color( machine, dest_index++, MAKE_RGB(red, green, blue) );
color_prom++;
}
for (i=0; i<=5; i++) gfx_drawmode_table[i] = DRAWMODE_SOURCE;
gfx_drawmode_table[6] = DRAWMODE_SHADOW;
gfx_drawmode_table[7] = DRAWMODE_NONE;
}
static void update_palette(running_machine *machine, int type )
{
if( bg_color!=old_bg_color )
{
stuff_palette( machine, 256+16*(bg_color&0x7), (0x11-type)*16, 16 );
old_bg_color = bg_color;
}
if( fg_color!=old_fg_color )
{
stuff_palette( machine, 128+16*(fg_color&0x7), (0x10+type)*16, 16 );
old_fg_color = fg_color;
}
}
/***************************************************************************
**
** Memory Handlers
**
***************************************************************************/
#ifdef UNUSED_FUNCTION
WRITE8_HANDLER( marvins_spriteram_w )
{
spriteram[offset] = data;
}
#endif
WRITE8_HANDLER( marvins_foreground_ram_w )
{
spriteram_2[offset] = data;
if (offset < 0x800 && !video_bank) tilemap_mark_tile_dirty(fg_tilemap,offset);
else if (offset >= 0x800 && video_bank) tilemap_mark_tile_dirty(fg_tilemap,offset - 0x800);
}
WRITE8_HANDLER( marvins_background_ram_w )
{
spriteram_3[offset] = data;
if (offset < 0x800 && !video_bank) tilemap_mark_tile_dirty(bg_tilemap,offset);
else if (offset >= 0x800 && video_bank) tilemap_mark_tile_dirty(bg_tilemap,offset - 0x800);
}
WRITE8_HANDLER( marvins_text_ram_w )
{
videoram[offset] = data;
if (offset < 0x400) tilemap_mark_tile_dirty(tx_tilemap,offset);
}
/***************************************************************************
**
** Callbacks for Tilemap Manager
**
***************************************************************************/
static TILE_GET_INFO( get_bg_tilemap_info )
{
SET_TILE_INFO(
2,
spriteram_3[tile_index + video_bank * 0x800],
0,
0);
}
static TILE_GET_INFO( get_fg_tilemap_info )
{
SET_TILE_INFO(
1,
spriteram_2[tile_index + video_bank * 0x800],
0,
0);
}
static TILE_GET_INFO( get_tx_tilemap_info )
{
int tile_number = videoram[tile_index];
SET_TILE_INFO(
0,
tile_number,
(tile_number>>5),
0);
}
/***************************************************************************
**
** Video Initialization
**
***************************************************************************/
VIDEO_START( marvins )
{
flipscreen = -1; old_bg_color = old_fg_color = -1;
stuff_palette( machine, 0, 0, 16*8 ); /* load sprite colors */
stuff_palette( machine, 16*8*3, 16*8, 16*8 ); /* load text colors */
fg_tilemap = tilemap_create(get_fg_tilemap_info,tilemap_scan_cols,8,8,64,32);
bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,8,8,64,32);
tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,8,8,32,32);
{
tilemap_clip = *video_screen_get_visible_area(machine->primary_screen);
if (marvins_gamegroup != 1) // not Mad Crasher
{
tilemap_clip.max_x-=16;
tilemap_clip.min_x+=16;
}
tilemap_set_transparent_pen(fg_tilemap,0xf);
tilemap_set_transparent_pen(bg_tilemap,0xf);
tilemap_set_transparent_pen(tx_tilemap,0xf);
switch (marvins_gamegroup)
{
case 0: // Marvin's Maze
tilemap_set_scrolldx( bg_tilemap, 271, 287 );
tilemap_set_scrolldy( bg_tilemap, 0, -40 );
tilemap_set_scrolldx( fg_tilemap, 15, 13+18 );
tilemap_set_scrolldy( fg_tilemap, 0, -40 );
tilemap_set_scrolldx( tx_tilemap, 16, 16 );
tilemap_set_scrolldy( tx_tilemap, 0, 0 );
sprite_flip_adjust = 256+182+1;
break;
case 1: // Mad Crasher
tilemap_set_scrolldx( bg_tilemap, 256, 0 );
tilemap_set_scrolldy( bg_tilemap, 12, 0 );
tilemap_set_scrolldx( fg_tilemap, 0, 0 );
tilemap_set_scrolldy( fg_tilemap, 6, -24 );
tilemap_set_scrolldx( tx_tilemap, 16, 16 );
tilemap_set_scrolldy( tx_tilemap, 0, +8 );
break;
case 2: // VanguardII
tilemap_set_scrolldx( bg_tilemap, 7, +14 );
tilemap_set_scrolldy( bg_tilemap, -20, -60 );
tilemap_set_scrolldx( fg_tilemap, 15, +32 );
tilemap_set_scrolldy( fg_tilemap, 0, -40 );
tilemap_set_scrolldx( tx_tilemap, 16, 16 );
tilemap_set_scrolldy( tx_tilemap, 0, 0 );
sprite_flip_adjust = 256+182;
break;
}
}
}
/***************************************************************************
**
** Screen Refresh
**
***************************************************************************/
static void draw_status(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
const UINT8 *base = videoram+0x400;
const gfx_element *gfx = machine->gfx[0];
int row;
if (!flipscreen)
for( row=0; row<4; row++ )
{
int sy,sx = (row&1)*8;
const UINT8 *source = base + (row&1)*32;
if( row>1 )
{
sx+=256+16;
}
else
{
source+=30*32;
}
for( sy=0; sy<256; sy+=8 )
{
int tile_number = *source++;
drawgfx( bitmap, gfx,
tile_number, tile_number>>5,
0,0,
sx,sy,
cliprect,
TRANSPARENCY_NONE, 0xf );
}
}
else
for( row=0; row<4; row++ )
{
int sy,sx = (row&1)*8;
const UINT8 *source = base + 30*32 + 32 - (row&1)*32;
if( row>1 )
{
sx+=256+16;
}
else
{
source-=30*32;
}
for( sy=255; sy>=0; sy-=8 )
{
int tile_number = *source++;
drawgfx( bitmap, gfx,
tile_number, tile_number>>5,
1,1,
sx,sy-5*8,
cliprect,
TRANSPARENCY_NONE, 0xf );
}
}
}
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly,
int priority, UINT8 sprite_partition )
{
const gfx_element *gfx = machine->gfx[3];
const UINT8 *source, *finish;
if( sprite_partition>0x64 ) sprite_partition = 0x64;
if( priority )
{
source = spriteram + sprite_partition;
finish = spriteram + 0x64;
}
else
{
source = spriteram;
finish = spriteram + sprite_partition;
}
while( source<finish )
{
int attributes = source[3]; /* Y?F? CCCC */
int tile_number = source[1];
int sy = source[0] - scrolly;
int sx = source[2] - scrollx + ((attributes&0x80)?256:0);
int color = attributes&0xf;
int flipy = (attributes&0x20);
int flipx = 0;
if( flipscreen )
{
if( flipy )
{
flipx = 1; flipy = 0;
}
else
{
flipx = flipy = 1;
}
sx = sprite_flip_adjust-sx;
sy = 246-sy;
}
sx = (256-sx) & 0x1ff;
sy = sy & 0xff;
if (sx > 512-16) sx -= 512;
if (sy > 256-16) sy -= 256;
drawgfx( bitmap,gfx,
tile_number,
color,
flipx, flipy,
sx, sy,
cliprect,TRANSPARENCY_PEN_TABLE,7);
source+=4;
}
}
VIDEO_UPDATE( marvins )
{
cpuintrf_push_context(0);
{
UINT8 sprite_partition = program_read_byte(0xfe00);
int attributes = program_read_byte(0x8600); /* 0x20: normal, 0xa0: video flipped */
int scroll_attributes = program_read_byte(0xff00);
int sprite_scrolly = program_read_byte(0xf800);
int sprite_scrollx = program_read_byte(0xf900);
int bg_scrolly = program_read_byte(0xfa00);
int bg_scrollx = program_read_byte(0xfb00);
int fg_scrolly = program_read_byte(0xfc00);
int fg_scrollx = program_read_byte(0xfd00);
rectangle finalclip = tilemap_clip;
sect_rect(&finalclip, cliprect);
if(video_bank != ((attributes & 8) >> 3))
{
video_bank = ((attributes & 8) >> 3);
tilemap_mark_all_tiles_dirty(bg_tilemap);
tilemap_mark_all_tiles_dirty(fg_tilemap);
}
if( (scroll_attributes & 4)==0 ) bg_scrollx += 256;
if( scroll_attributes & 1 ) sprite_scrollx += 256;
if( scroll_attributes & 2 ) fg_scrollx += 256;
/* palette bank for background/foreground is set by a memory-write handler */
update_palette(screen->machine, 0);
if( flipscreen != (attributes&0x80) )
{
flipscreen = attributes&0x80;
tilemap_set_flip( ALL_TILEMAPS, flipscreen?TILEMAP_FLIPY|TILEMAP_FLIPX:0);
}
tilemap_set_scrollx( bg_tilemap, 0, bg_scrollx );
tilemap_set_scrolly( bg_tilemap, 0, bg_scrolly );
tilemap_set_scrollx( fg_tilemap, 0, fg_scrollx );
tilemap_set_scrolly( fg_tilemap, 0, fg_scrolly );
tilemap_set_scrollx( tx_tilemap, 0, 0 );
tilemap_set_scrolly( tx_tilemap, 0, 0 );
tilemap_draw(bitmap,&finalclip,fg_tilemap,TILEMAP_DRAW_OPAQUE ,0);
draw_sprites(screen->machine,bitmap,cliprect, sprite_scrollx+29+1, sprite_scrolly+16, 0, sprite_partition );
tilemap_draw(bitmap,&finalclip,bg_tilemap,0 ,0);
draw_sprites(screen->machine,bitmap,cliprect, sprite_scrollx+29+1, sprite_scrolly+16, 1, sprite_partition );
tilemap_draw(bitmap,&finalclip,tx_tilemap,0 ,0);
draw_status(screen->machine,bitmap,cliprect );
}
cpuintrf_pop_context();
return 0;
}
VIDEO_UPDATE( madcrash )
{
/***************************************************************************
**
** Game Specific Initialization
**
** madcrash_vreg defines an offset for the video registers which is
** different in Mad Crasher and Vanguard II.
**
** init_sound defines the location of the polled sound CPU busy bit,
** which also varies across games.
**
***************************************************************************/
cpuintrf_push_context(0);
{
int madcrash_vreg = (marvins_gamegroup == 1) ? 0x00 : 0xf1; // Mad Crasher=0x00, VanguardII=0xf1
UINT8 sprite_partition = program_read_byte(0xfa00);
int attributes = program_read_byte(0x8600+madcrash_vreg); /* 0x20: normal, 0xa0: video flipped */
int bg_scrolly = program_read_byte(0xf800+madcrash_vreg);
int bg_scrollx = program_read_byte(0xf900+madcrash_vreg);
int scroll_attributes = program_read_byte(0xfb00+madcrash_vreg);
int sprite_scrolly = program_read_byte(0xfc00+madcrash_vreg);
int sprite_scrollx = program_read_byte(0xfd00+madcrash_vreg);
int fg_scrolly = program_read_byte(0xfe00+madcrash_vreg);
int fg_scrollx = program_read_byte(0xff00+madcrash_vreg);
rectangle finalclip = tilemap_clip;
sect_rect(&finalclip, cliprect);
if(video_bank != ((attributes & 8) >> 3))
{
video_bank = ((attributes & 8) >> 3);
tilemap_mark_all_tiles_dirty(bg_tilemap);
tilemap_mark_all_tiles_dirty(fg_tilemap);
}
if( (scroll_attributes & 4)==0 ) bg_scrollx += 256;
if( scroll_attributes & 1 ) sprite_scrollx += 256;
if( scroll_attributes & 2 ) fg_scrollx += 256;
marvins_palette_bank_w(screen->machine, 0, program_read_byte(0xc800+madcrash_vreg));
update_palette(screen->machine, 1);
if( flipscreen != (attributes&0x80) )
{
flipscreen = attributes&0x80;
tilemap_set_flip( ALL_TILEMAPS, flipscreen?TILEMAP_FLIPY|TILEMAP_FLIPX:0);
}
tilemap_set_scrollx( bg_tilemap, 0, bg_scrollx );
tilemap_set_scrolly( bg_tilemap, 0, bg_scrolly );
tilemap_set_scrollx( fg_tilemap, 0, fg_scrollx );
tilemap_set_scrolly( fg_tilemap, 0, fg_scrolly );
tilemap_set_scrollx( tx_tilemap, 0, 0 );
tilemap_set_scrolly( tx_tilemap, 0, 0 );
tilemap_draw(bitmap,&finalclip,bg_tilemap,TILEMAP_DRAW_OPAQUE ,0);
draw_sprites(screen->machine,bitmap,cliprect, sprite_scrollx+29, sprite_scrolly+17, 0, sprite_partition );
tilemap_draw(bitmap,&finalclip,fg_tilemap,0 ,0);
draw_sprites(screen->machine,bitmap,cliprect, sprite_scrollx+29, sprite_scrolly+17, 1, sprite_partition );
tilemap_draw(bitmap,&finalclip,tx_tilemap,0 ,0);
draw_status(screen->machine,bitmap,cliprect );
}
cpuintrf_pop_context();
return 0;
}

View File

@ -22,12 +22,15 @@
*******************************************************************************/
UINT8 *snk_tx_videoram;
UINT8 *snk_fg_videoram;
UINT8 *snk_bg_videoram;
static tilemap *tx_tilemap;
static tilemap *fg_tilemap;
static tilemap *bg_tilemap;
static int bg_scrollx, bg_scrolly, sp16_scrollx, sp16_scrolly, sp32_scrollx, sp32_scrolly;
static int fg_scrollx, fg_scrolly, bg_scrollx, bg_scrolly;
static int sp16_scrollx, sp16_scrolly, sp32_scrollx, sp32_scrolly;
static UINT8 sprite_split_point;
static int num_sprites, yscroll_mask;
@ -40,28 +43,24 @@ PALETTE_INIT( tnk3 )
int i;
int num_colors = 0x400;
/*
palette format is RRRG GGBB B??? the three unknown bits are used but
I'm not sure how, I'm currently using them as least significant bit.
*/
for( i=0; i<num_colors; i++ )
{
int bit0=0,bit1,bit2,bit3,r,g,b;
bit0 = (color_prom[i + 2*num_colors] >> 2) & 0x01;
bit0 = (color_prom[i + 2*num_colors] >> 3) & 0x01;
bit1 = (color_prom[i] >> 1) & 0x01;
bit2 = (color_prom[i] >> 2) & 0x01;
bit3 = (color_prom[i] >> 3) & 0x01;
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
bit0 = (color_prom[i + 2*num_colors] >> 1) & 0x01;
bit0 = (color_prom[i + 2*num_colors] >> 2) & 0x01;
bit1 = (color_prom[i + num_colors] >> 2) & 0x01;
bit2 = (color_prom[i + num_colors] >> 3) & 0x01;
bit3 = (color_prom[i] >> 0) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
bit0 = (color_prom[i + 2*num_colors] >> 0) & 0x01;
bit1 = (color_prom[i + 2*num_colors] >> 3) & 0x01;
bit1 = (color_prom[i + 2*num_colors] >> 1) & 0x01;
bit2 = (color_prom[i + num_colors] >> 0) & 0x01;
bit3 = (color_prom[i + num_colors] >> 1) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
@ -72,7 +71,7 @@ PALETTE_INIT( tnk3 )
/**************************************************************************************/
static TILEMAP_MAPPER( tnk3_fg_scan_cols )
static TILEMAP_MAPPER( marvins_tx_scan_cols )
{
// tilemap is 36x28, the central part is from the first RAM page and the
// extra 4 columns are from the second page
@ -83,9 +82,9 @@ static TILEMAP_MAPPER( tnk3_fg_scan_cols )
return row + (col << 5);
}
static TILE_GET_INFO( tnk3_get_fg_tile_info )
static TILE_GET_INFO( marvins_get_tx_tile_info )
{
int code = snk_fg_videoram[tile_index];
int code = snk_tx_videoram[tile_index];
int color = code >> 5;
SET_TILE_INFO(0,
code,
@ -93,19 +92,38 @@ static TILE_GET_INFO( tnk3_get_fg_tile_info )
tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0);
}
static TILE_GET_INFO( ikari_get_fg_tile_info )
static TILE_GET_INFO( ikari_get_tx_tile_info )
{
int code = snk_fg_videoram[tile_index];
int code = snk_tx_videoram[tile_index];
SET_TILE_INFO(0,
code,
0,
tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0);
}
static TILE_GET_INFO( gwar_get_fg_tile_info )
static TILE_GET_INFO( gwar_get_tx_tile_info )
{
int code = snk_tx_videoram[tile_index];
SET_TILE_INFO(0,
code,
0,
0);
}
static TILE_GET_INFO( marvins_get_fg_tile_info )
{
int code = snk_fg_videoram[tile_index];
SET_TILE_INFO(0,
SET_TILE_INFO(1,
code,
0,
0);
}
static TILE_GET_INFO( marvins_get_bg_tile_info )
{
int code = snk_bg_videoram[tile_index];
SET_TILE_INFO(2,
code,
0,
0);
@ -200,15 +218,34 @@ static VIDEO_START( snk_4bpp_shadow )
}
VIDEO_START( marvins )
{
VIDEO_START_CALL(snk_3bpp_shadow);
tx_tilemap = tilemap_create(marvins_get_tx_tile_info, marvins_tx_scan_cols, 8, 8, 36, 28);
fg_tilemap = tilemap_create(marvins_get_fg_tile_info, tilemap_scan_cols, 8, 8, 64, 32);
bg_tilemap = tilemap_create(marvins_get_bg_tile_info, tilemap_scan_cols, 8, 8, 64, 32);
tilemap_set_transparent_pen(tx_tilemap,15);
tilemap_set_scrolldy(tx_tilemap, 8, 8);
tilemap_set_transparent_pen(fg_tilemap,15);
tilemap_set_scrolldx(fg_tilemap, 15, 31);
tilemap_set_scrolldy(fg_tilemap, 8, -32);
tilemap_set_scrolldx(bg_tilemap, 15, 31);
tilemap_set_scrolldy(bg_tilemap, 8, -32);
}
VIDEO_START( jcross )
{
VIDEO_START_CALL(snk_3bpp_shadow);
fg_tilemap = tilemap_create(tnk3_get_fg_tile_info, tnk3_fg_scan_cols, 8, 8, 36, 28);
bg_tilemap = tilemap_create(aso_get_bg_tile_info, tilemap_scan_cols, 8, 8, 64, 64);
tx_tilemap = tilemap_create(marvins_get_tx_tile_info, marvins_tx_scan_cols, 8, 8, 36, 28);
bg_tilemap = tilemap_create(aso_get_bg_tile_info, tilemap_scan_cols, 8, 8, 64, 64);
tilemap_set_transparent_pen(fg_tilemap, 15);
tilemap_set_scrolldy(fg_tilemap, 8, 8);
tilemap_set_transparent_pen(tx_tilemap, 15);
tilemap_set_scrolldy(tx_tilemap, 8, 8);
tilemap_set_scrolldx(bg_tilemap, 15, 24);
tilemap_set_scrolldy(bg_tilemap, 8, -32);
@ -219,7 +256,16 @@ VIDEO_START( jcross )
VIDEO_START( sgladiat )
{
VIDEO_START_CALL(jcross);
VIDEO_START_CALL(snk_3bpp_shadow);
tx_tilemap = tilemap_create(marvins_get_tx_tile_info, marvins_tx_scan_cols, 8, 8, 36, 28);
bg_tilemap = tilemap_create(aso_get_bg_tile_info, tilemap_scan_cols, 8, 8, 64, 32);
tilemap_set_transparent_pen(tx_tilemap, 15);
tilemap_set_scrolldy(tx_tilemap, 8, 8);
tilemap_set_scrolldx(bg_tilemap, 15, 24);
tilemap_set_scrolldy(bg_tilemap, 8, -32);
num_sprites = 25;
yscroll_mask = 0x0ff;
@ -250,11 +296,11 @@ VIDEO_START( tnk3 )
{
VIDEO_START_CALL(snk_3bpp_shadow);
fg_tilemap = tilemap_create(tnk3_get_fg_tile_info, tnk3_fg_scan_cols, 8, 8, 36, 28);
bg_tilemap = tilemap_create(tnk3_get_bg_tile_info, tilemap_scan_cols, 8, 8, 64, 64);
tx_tilemap = tilemap_create(marvins_get_tx_tile_info, marvins_tx_scan_cols, 8, 8, 36, 28);
bg_tilemap = tilemap_create(tnk3_get_bg_tile_info, tilemap_scan_cols, 8, 8, 64, 64);
tilemap_set_transparent_pen(fg_tilemap, 15);
tilemap_set_scrolldy(fg_tilemap, 8, 8);
tilemap_set_transparent_pen(tx_tilemap, 15);
tilemap_set_scrolldy(tx_tilemap, 8, 8);
tilemap_set_scrolldx(bg_tilemap, 15, 24);
tilemap_set_scrolldy(bg_tilemap, 8, -32);
@ -267,11 +313,11 @@ VIDEO_START( ikari )
{
VIDEO_START_CALL(snk_3bpp_shadow);
fg_tilemap = tilemap_create(ikari_get_fg_tile_info, tnk3_fg_scan_cols, 8, 8, 36, 28);
bg_tilemap = tilemap_create(ikari_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
tx_tilemap = tilemap_create(ikari_get_tx_tile_info, marvins_tx_scan_cols, 8, 8, 36, 28);
bg_tilemap = tilemap_create(ikari_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
tilemap_set_transparent_pen(fg_tilemap, 15);
tilemap_set_scrolldy(fg_tilemap, 8, 8);
tilemap_set_transparent_pen(tx_tilemap, 15);
tilemap_set_scrolldy(tx_tilemap, 8, 8);
tilemap_set_scrolldx(bg_tilemap, 15, 24);
tilemap_set_scrolldy(bg_tilemap, 8, -32);
@ -281,10 +327,10 @@ VIDEO_START( gwar )
{
memset(empty_tile,0xf,sizeof(empty_tile));
fg_tilemap = tilemap_create(gwar_get_fg_tile_info, tilemap_scan_cols, 8, 8, 50, 32);
tx_tilemap = tilemap_create(gwar_get_tx_tile_info, tilemap_scan_cols, 8, 8, 50, 32);
bg_tilemap = tilemap_create(gwar_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
tilemap_set_transparent_pen(fg_tilemap, 15);
tilemap_set_transparent_pen(tx_tilemap, 15);
tilemap_set_scrolldx(bg_tilemap, 16, 143);
tilemap_set_scrolldy(bg_tilemap, 0, -32);
@ -299,22 +345,39 @@ VIDEO_START( tdfever )
/**************************************************************************************/
WRITE8_HANDLER( snk_fg_videoram_w )
WRITE8_HANDLER( snk_tx_videoram_w )
{
snk_tx_videoram[offset] = data;
tilemap_mark_tile_dirty(tx_tilemap, offset);
}
WRITE8_HANDLER( marvins_fg_videoram_w )
{
snk_fg_videoram[offset] = data;
tilemap_mark_tile_dirty(fg_tilemap, offset);
}
WRITE8_HANDLER( marvins_bg_videoram_w )
{
snk_bg_videoram[offset] = data;
tilemap_mark_tile_dirty(bg_tilemap, offset);
}
WRITE8_HANDLER( snk_bg_videoram_w )
{
snk_bg_videoram[offset] = data;
tilemap_mark_tile_dirty(bg_tilemap, offset >> 1);
}
WRITE8_HANDLER( aso_bg_videoram_w )
WRITE8_HANDLER( snk_fg_scrollx_w )
{
snk_bg_videoram[offset] = data;
tilemap_mark_tile_dirty(bg_tilemap, offset);
fg_scrollx = (fg_scrollx & ~0xff) | data;
}
WRITE8_HANDLER( snk_fg_scrolly_w )
{
fg_scrolly = (fg_scrolly & ~0xff) | data;
}
WRITE8_HANDLER( snk_bg_scrollx_w )
@ -347,6 +410,24 @@ WRITE8_HANDLER( snk_sp32_scrolly_w )
sp32_scrolly = (sp32_scrolly & ~0xff) | data;
}
WRITE8_HANDLER( snk_sprite_split_point_w )
{
sprite_split_point = data;
}
WRITE8_HANDLER( marvins_palette_bank_w )
{
tilemap_set_palette_offset(bg_tilemap, data & 0x70);
tilemap_set_palette_offset(fg_tilemap, (data & 0x07) << 4);
}
WRITE8_HANDLER( marvins_flipscreen_w )
{
flip_screen_set(data & 0x80);
// other bits unknown
}
WRITE8_HANDLER( sgladiat_flipscreen_w )
{
@ -367,6 +448,13 @@ WRITE8_HANDLER( hal21_flipscreen_w )
// other bits unknown
}
WRITE8_HANDLER( marvins_scroll_msb_w )
{
bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x04) << 6);
fg_scrollx = (fg_scrollx & 0xff) | ((data & 0x02) << 7);
sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8);
}
WRITE8_HANDLER( jcross_scroll_msb_w )
{
bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4);
@ -419,7 +507,7 @@ WRITE8_HANDLER( tnk3_videoattrs_w )
flip_screen_set(data & 0x80);
tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x40) << 2) * machine->gfx[0]->char_modulo);
tilemap_set_pen_data_offset(tx_tilemap, ((data & 0x40) << 2) * machine->gfx[0]->char_modulo);
bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4);
sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5);
@ -460,14 +548,14 @@ if (data != 0x20 && // normal
data != 0xaa) // victroad spurious during boot
popmessage("attrs %02x contact MAMEDEV", data);
tilemap_set_palette_offset(fg_tilemap, (data & 0x01) << 4);
tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x10) << 4) * machine->gfx[0]->char_modulo);
tilemap_set_palette_offset(tx_tilemap, (data & 0x01) << 4);
tilemap_set_pen_data_offset(tx_tilemap, ((data & 0x10) << 4) * machine->gfx[0]->char_modulo);
}
WRITE8_HANDLER( gwar_fg_bank_w )
WRITE8_HANDLER( gwar_tx_bank_w )
{
tilemap_set_palette_offset(fg_tilemap, (data & 0xf) << 4);
tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x30) << 4) * machine->gfx[0]->char_modulo);
tilemap_set_palette_offset(tx_tilemap, (data & 0xf) << 4);
tilemap_set_pen_data_offset(tx_tilemap, ((data & 0x30) << 4) * machine->gfx[0]->char_modulo);
}
WRITE8_HANDLER( gwar_videoattrs_w )
@ -498,11 +586,6 @@ WRITE8_HANDLER( gwara_sp_scroll_msb_w )
sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x04) << 6);
}
WRITE8_HANDLER( gwar_sprite_split_point_w )
{
sprite_split_point = data;
}
WRITE8_HANDLER( tdfever_sp_scroll_msb_w )
{
sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x80) << 1);
@ -525,6 +608,50 @@ WRITE8_HANDLER( tdfever_spriteram_w )
/**************************************************************************************/
static void marvins_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
const int scrollx, const int scrolly, const int from, const int to)
{
const gfx_element *gfx = machine->gfx[3];
const UINT8 *source, *finish;
source = spriteram + from*4;
finish = spriteram + to*4;
while( source<finish )
{
int attributes = source[3]; /* Y?F? CCCC */
int tile_number = source[1];
int sx = scrollx + 301 - 15 - source[2] + ((attributes&0x80)?256:0);
int sy = -scrolly - 8 + source[0];
int color = attributes&0xf;
int flipy = (attributes&0x20);
int flipx = 0;
if (flip_screen_get())
{
sx = 89 - 16 - sx;
sy = 262 - 16 - sy;
flipx = !flipx;
flipy = !flipy;
}
sx &= 0x1ff;
sy &= 0xff;
if (sx > 512-16) sx -= 512;
if (sy > 256-16) sy -= 256;
drawgfx( bitmap,gfx,
tile_number,
color,
flipx, flipy,
sx, sy,
cliprect,TRANSPARENCY_PEN_TABLE,7);
source+=4;
}
}
static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const int xscroll, const int yscroll)
{
const gfx_element *gfx = machine->gfx[2];
@ -535,7 +662,7 @@ static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
/* jcross and sgladiat have only 25 sprites, the others 50 */
/* jcross has 256 tiles, attribute bit 6 MIGHT be x-flip (uncertain) */
/* jcross has 256 tiles, attribute bit 6 is unused and bit 5 is y-flip */
/* sgladiat and tnk3 have 512 tiles, bit 6 is bank and bit 5 is y-flip */
/* athena has 1024 tiles, bit 6 and bit 5 are bank */
@ -555,10 +682,6 @@ static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
{
tile_number |= (attributes & 0x40) << 2;
}
else // jcross
{
xflip = attributes & 0x40; // uncertain (not used?)
}
if (gfx->total_elements > 512) // athena
{
@ -726,6 +849,23 @@ static void tdfever_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
/**************************************************************/
VIDEO_UPDATE( marvins )
{
tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
tilemap_set_scrollx(fg_tilemap, 0, fg_scrollx);
tilemap_set_scrolly(fg_tilemap, 0, fg_scrolly);
tilemap_draw(bitmap,cliprect,bg_tilemap,0 ,0);
marvins_draw_sprites(screen->machine,bitmap,cliprect, sp16_scrollx, sp16_scrolly, 0, sprite_split_point>>2 );
tilemap_draw(bitmap,cliprect,fg_tilemap,0 ,0);
marvins_draw_sprites(screen->machine,bitmap,cliprect, sp16_scrollx, sp16_scrolly, sprite_split_point>>2, 25 );
tilemap_draw(bitmap,cliprect,tx_tilemap,0 ,0);
return 0;
}
VIDEO_UPDATE( tnk3 )
{
tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
@ -733,7 +873,7 @@ VIDEO_UPDATE( tnk3 )
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
tnk3_draw_sprites(screen->machine, bitmap, cliprect, sp16_scrollx, sp16_scrolly);
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0);
return 0;
}
@ -750,7 +890,7 @@ VIDEO_UPDATE( ikari )
ikari_draw_sprites(screen->machine, bitmap, cliprect, 0, sp32_scrollx, sp32_scrolly, spriteram, 3 );
ikari_draw_sprites(screen->machine, bitmap, cliprect, 25, sp16_scrollx, sp16_scrolly, spriteram + 0x800, 2 );
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0);
return 0;
}
@ -766,7 +906,7 @@ VIDEO_UPDATE( gwar )
tdfever_draw_sprites(screen->machine, bitmap, cliprect, sp32_scrollx, sp32_scrolly, spriteram, 3, 0, 0, 32 );
tdfever_draw_sprites(screen->machine, bitmap, cliprect, sp16_scrollx, sp16_scrolly, spriteram + 0x800, 2, 0, sprite_split_point, 64 );
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0);
return 0;
}
@ -781,7 +921,7 @@ VIDEO_UPDATE( tdfever )
tdfever_draw_sprites(screen->machine, bitmap, cliprect, sp32_scrollx, sp32_scrolly, spriteram, 2, 1, 0, 32 );
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0);
return 0;
}