mirror of
https://github.com/holub/mame
synced 2025-04-19 07:00:31 +03:00
remove all drivers by 'insideoutboy' due to unresolved licensing, replaced with skeleton drivers (rom loading only)
This commit is contained in:
parent
ccc12869fd
commit
4fbd1d7bab
@ -2823,11 +2823,7 @@ files {
|
||||
MAME_DIR .. "src/mame/includes/battlex.h",
|
||||
MAME_DIR .. "src/mame/video/battlex.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/carjmbre.cpp",
|
||||
MAME_DIR .. "src/mame/includes/carjmbre.h",
|
||||
MAME_DIR .. "src/mame/video/carjmbre.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/popper.cpp",
|
||||
MAME_DIR .. "src/mame/includes/popper.h",
|
||||
MAME_DIR .. "src/mame/video/popper.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/spaceg.cpp",
|
||||
}
|
||||
|
||||
@ -4293,9 +4289,6 @@ files {
|
||||
MAME_DIR .. "src/mame/drivers/fireball.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/flipjack.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/flower.cpp",
|
||||
MAME_DIR .. "src/mame/includes/flower.h",
|
||||
MAME_DIR .. "src/mame/audio/flower.cpp",
|
||||
MAME_DIR .. "src/mame/video/flower.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/fortecar.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/fresh.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/freekick.cpp",
|
||||
|
@ -1,337 +0,0 @@
|
||||
// license:???
|
||||
// copyright-holders:hap, insideoutboy
|
||||
/* Clarue Flower sound driver.
|
||||
Initial version was based on the Wiping sound driver, which was based on the old namco.c sound driver.
|
||||
|
||||
TODO:
|
||||
- timing (see main driver file), but also of samplerate and effects counter
|
||||
- what do the unknown bits in soundregs do?
|
||||
- Are channel effects correct? It's currently mostly guesswork, the pitch effects sound pretty convincing though.
|
||||
Considering that the game sound hardware isn't complicated (no dedicated soundchip) these bits are possibly
|
||||
for something way simpler, such as a length counter. PCB sound recordings would be useful!
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/flower.h"
|
||||
|
||||
#define FLOWER_VERBOSE 0 // show register writes
|
||||
|
||||
#define MIXER_SAMPLERATE 48000 /* ? (native freq is probably in the MHz range) */
|
||||
#define MIXER_DEFGAIN 48
|
||||
|
||||
|
||||
const device_type FLOWER = &device_creator<flower_sound_device>;
|
||||
|
||||
flower_sound_device::flower_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, FLOWER, "Flower Audio Custom", tag, owner, clock, "flower_sound", __FILE__),
|
||||
device_sound_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_config_complete - perform any
|
||||
// operations now that the configuration is
|
||||
// complete
|
||||
//-------------------------------------------------
|
||||
|
||||
void flower_sound_device::device_config_complete()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void flower_sound_device::device_start()
|
||||
{
|
||||
flower_sound_channel *voice;
|
||||
|
||||
m_effect_timer = timer_alloc(TIMER_CLOCK_EFFECT);
|
||||
m_stream = machine().sound().stream_alloc(*this, 0, 1, MIXER_SAMPLERATE);
|
||||
m_mixer_buffer = std::make_unique<short[]>(MIXER_SAMPLERATE);
|
||||
make_mixer_table(8, MIXER_DEFGAIN);
|
||||
|
||||
/* extract globals from the interface */
|
||||
m_last_channel = m_channel_list + 8;
|
||||
|
||||
m_sample_rom = machine().root_device().memregion("sound1")->base();
|
||||
m_volume_rom = machine().root_device().memregion("sound2")->base();
|
||||
|
||||
/* register for savestates */
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
voice = &m_channel_list[i];
|
||||
|
||||
save_item(NAME(voice->freq), i+1);
|
||||
save_item(NAME(voice->pos), i+1);
|
||||
save_item(NAME(voice->volume), i+1);
|
||||
save_item(NAME(voice->voltab), i+1);
|
||||
save_item(NAME(voice->effect), i+1);
|
||||
save_item(NAME(voice->ecount), i+1);
|
||||
save_item(NAME(voice->oneshot), i+1);
|
||||
save_item(NAME(voice->active), i+1);
|
||||
save_item(NAME(voice->start), i+1);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void flower_sound_device::device_reset()
|
||||
{
|
||||
flower_sound_channel *voice;
|
||||
attotime period;
|
||||
|
||||
/* reset effect timer, period is unknown/guessed */
|
||||
period = attotime::from_hz(MIXER_SAMPLERATE / 256);
|
||||
m_effect_timer->adjust(period, 0, period);
|
||||
|
||||
/* reset all the voices */
|
||||
for (auto & elem : m_channel_list)
|
||||
{
|
||||
voice = &elem;
|
||||
|
||||
voice->freq = 0;
|
||||
voice->pos = 0;
|
||||
voice->volume = 0;
|
||||
voice->voltab = 0;
|
||||
voice->effect = 0;
|
||||
voice->ecount = 0;
|
||||
voice->oneshot = 1;
|
||||
voice->active = 0;
|
||||
voice->start = 0;
|
||||
}
|
||||
|
||||
memset(m_soundregs1, 0, 0x40);
|
||||
memset(m_soundregs2, 0, 0x40);
|
||||
}
|
||||
|
||||
/* build a table to divide by the number of voices; gain is specified as gain*16 */
|
||||
void flower_sound_device::make_mixer_table(int voices, int gain)
|
||||
{
|
||||
int count = voices * 128;
|
||||
|
||||
/* allocate memory */
|
||||
m_mixer_table = std::make_unique<INT16[]>(256 * voices);
|
||||
|
||||
/* find the middle of the table */
|
||||
m_mixer_lookup = m_mixer_table.get() + (128 * voices);
|
||||
|
||||
/* fill in the table - 16 bit case */
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
int val = i * gain * 16 / voices;
|
||||
if (val > 32767) val = 32767;
|
||||
m_mixer_lookup[ i] = val;
|
||||
m_mixer_lookup[-i] =-val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* clock sound channel effect counters */
|
||||
void flower_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_CLOCK_EFFECT:
|
||||
flower_sound_channel *voice;
|
||||
m_stream->update();
|
||||
|
||||
for (voice = m_channel_list; voice < m_last_channel; voice++)
|
||||
voice->ecount += (voice->ecount < (1<<22));
|
||||
break;
|
||||
|
||||
default:
|
||||
assert_always(FALSE, "Unknown id in flower_sound_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
/********************************************************************************/
|
||||
|
||||
#if FLOWER_VERBOSE
|
||||
static int r_numwrites[2][8] = {{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0}};
|
||||
void flower_sound_device::show_soundregs()
|
||||
{
|
||||
int set,reg,chan;
|
||||
char text[0x100];
|
||||
char message[0x1000] = {0};
|
||||
UINT8 *base = m_soundregs1;
|
||||
|
||||
for (set=0;set<2;set++)
|
||||
{
|
||||
for (reg=0;reg<8;reg++)
|
||||
{
|
||||
sprintf(text,"R%d%d:",set+1,reg);
|
||||
strcat(message,text);
|
||||
|
||||
for (chan=0;chan<8;chan++)
|
||||
{
|
||||
sprintf(text," %02X",base[reg + 8*chan]);
|
||||
strcat(message,text);
|
||||
}
|
||||
sprintf(text," - %07d\n",r_numwrites[set][reg]);
|
||||
strcat(message,text);
|
||||
}
|
||||
strcat(message,"\n");
|
||||
base = m_soundregs2;
|
||||
}
|
||||
popmessage("%s",message);
|
||||
}
|
||||
#endif // FLOWER_VERBOSE
|
||||
|
||||
|
||||
/* register functions (preliminary):
|
||||
offset: cccrrr c=channel, r=register
|
||||
|
||||
set 1:
|
||||
R 76543210
|
||||
0 xxxxxxxx frequency (which nibble?)
|
||||
1 xxxxxxxx *
|
||||
2 xxxxxxxx *
|
||||
3 xxxxxxxx *
|
||||
4 ...x.... one-shot sample
|
||||
5 ...x.... ??? same as R4?
|
||||
6 ........ unused
|
||||
7 xxxx.... volume
|
||||
|
||||
set 2:
|
||||
R 76543210
|
||||
0 ....xxxx start address
|
||||
1 ....xxxx *
|
||||
2 ....xxxx *
|
||||
3 ....xxxx *
|
||||
4 xxxx assume it's channel pitch/volume effects
|
||||
xxxx start address
|
||||
5 x... ???
|
||||
xxxx start address
|
||||
6 ........ unused
|
||||
7 ......xx volume table + start trigger
|
||||
|
||||
*/
|
||||
|
||||
WRITE8_MEMBER( flower_sound_device::sound1_w )
|
||||
{
|
||||
flower_sound_channel *voice = &m_channel_list[offset >> 3 & 7];
|
||||
int c = offset & 0xf8;
|
||||
UINT8 *base1 = m_soundregs1;
|
||||
// UINT8 *base2 = m_soundregs2;
|
||||
|
||||
m_stream->update();
|
||||
base1[offset] = data;
|
||||
#if FLOWER_VERBOSE
|
||||
r_numwrites[0][offset & 7]++;
|
||||
show_soundregs();
|
||||
#endif
|
||||
|
||||
// recompute voice parameters
|
||||
voice->freq = (base1[c+2] & 0xf) << 12 | (base1[c+3] & 0xf) << 8 | (base1[c+0] & 0xf) << 4 | (base1[c+1] & 0xf);
|
||||
voice->volume = base1[c+7] >> 4;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( flower_sound_device::sound2_w )
|
||||
{
|
||||
flower_sound_channel *voice = &m_channel_list[offset >> 3 & 7];
|
||||
int i, c = offset & 0xf8;
|
||||
UINT8 *base1 = m_soundregs1;
|
||||
UINT8 *base2 = m_soundregs2;
|
||||
|
||||
m_stream->update();
|
||||
base2[offset] = data;
|
||||
#if FLOWER_VERBOSE
|
||||
r_numwrites[1][offset & 7]++;
|
||||
show_soundregs();
|
||||
#endif
|
||||
|
||||
// reg 7 is start trigger!
|
||||
if ((offset & 7) != 7)
|
||||
return;
|
||||
|
||||
voice->voltab = (base2[c+7] & 3) << 4;
|
||||
voice->oneshot = (~base1[c+4] & 0x10) >> 4;
|
||||
voice->effect = base2[c+4] >> 4;
|
||||
voice->ecount = 0;
|
||||
voice->pos = 0;
|
||||
voice->active = 1;
|
||||
|
||||
// full start address is 6 nibbles
|
||||
voice->start = 0;
|
||||
for (i = 5; i >= 0; i--)
|
||||
voice->start = (voice->start << 4) | (base2[c+i] & 0xf);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void flower_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
{
|
||||
stream_sample_t *buffer = outputs[0];
|
||||
flower_sound_channel *voice;
|
||||
short *mix;
|
||||
int i;
|
||||
|
||||
/* zap the contents of the mixer buffer */
|
||||
memset(m_mixer_buffer.get(), 0, samples * sizeof(short));
|
||||
|
||||
/* loop over each voice and add its contribution */
|
||||
for (voice = m_channel_list; voice < m_last_channel; voice++)
|
||||
{
|
||||
int f = voice->freq;
|
||||
int v = voice->volume;
|
||||
|
||||
if (!voice->active)
|
||||
continue;
|
||||
|
||||
// effects
|
||||
// bit 0: volume slide down?
|
||||
if (voice->effect & 1 && !voice->oneshot)
|
||||
{
|
||||
// note: one-shot samples are fixed volume
|
||||
v -= (voice->ecount >> 4);
|
||||
if (v < 0) v = 0;
|
||||
}
|
||||
// bit 1: used often, but hard to figure out what for
|
||||
// bit 2: probably pitch slide
|
||||
if (voice->effect & 4)
|
||||
{
|
||||
f -= (voice->ecount << 7);
|
||||
if (f < 0) f = 0;
|
||||
}
|
||||
// bit 3: not used much, maybe pitch slide the other way?
|
||||
|
||||
v |= voice->voltab;
|
||||
mix = m_mixer_buffer.get();
|
||||
|
||||
for (i = 0; i < samples; i++)
|
||||
{
|
||||
// add sample
|
||||
if (voice->oneshot)
|
||||
{
|
||||
UINT8 sample = m_sample_rom[(voice->start + voice->pos) >> 7 & 0x7fff];
|
||||
if (sample == 0xff)
|
||||
{
|
||||
voice->active = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
*mix++ += m_volume_rom[v << 8 | sample] - 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 sample = m_sample_rom[(voice->start >> 7 & 0x7e00) | (voice->pos >> 7 & 0x1ff)];
|
||||
*mix++ += m_volume_rom[v << 8 | sample] - 0x80;
|
||||
}
|
||||
|
||||
// update counter
|
||||
voice->pos += f;
|
||||
}
|
||||
}
|
||||
|
||||
/* mix it down */
|
||||
mix = m_mixer_buffer.get();
|
||||
for (i = 0; i < samples; i++)
|
||||
*buffer++ = m_mixer_lookup[*mix++];
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
// license:???
|
||||
// copyright-holders:insideoutboy, Nicola Salmoria
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
// **** SKELETON DRIVER **** original removed due to unresolved licensing.
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Car Jamboree
|
||||
@ -28,216 +31,25 @@
|
||||
8910 SW
|
||||
8910
|
||||
|
||||
Notes:
|
||||
|
||||
- some sprite glitches from sprite number/colour changes happening on
|
||||
different frames, possibly original behaviour. eg cars changing colour
|
||||
just before exploding, animals displaying as the wrong sprite for one
|
||||
frame when entering the arena
|
||||
|
||||
- colours look wrong, maybe address bitswap?
|
||||
|
||||
- background colour calculation is a guess
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "includes/carjmbre.h"
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Memory maps
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_MEMBER(carjmbre_state::nmi_mask_w)
|
||||
class carjmbre_state : public driver_device
|
||||
{
|
||||
m_nmi_mask = data & 1;
|
||||
}
|
||||
public:
|
||||
carjmbre_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( carjmbre_map, AS_PROGRAM, 8, carjmbre_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
// AM_RANGE(0x8800, 0x8800) AM_READNOP // watchdog?
|
||||
AM_RANGE(0x8803, 0x8803) AM_WRITE(nmi_mask_w)
|
||||
AM_RANGE(0x8805, 0x8805) AM_WRITE(carjmbre_bgcolor_w) // guessed
|
||||
AM_RANGE(0x8806, 0x8806) AM_WRITE(carjmbre_8806_w) // video related?
|
||||
AM_RANGE(0x8807, 0x8807) AM_WRITE(carjmbre_flipscreen_w)
|
||||
// AM_RANGE(0x8fc1, 0x8fc1) AM_WRITENOP // overrun during initial screen clear
|
||||
// AM_RANGE(0x8fe1, 0x8fe1) AM_WRITENOP // overrun during initial screen clear
|
||||
AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(carjmbre_videoram_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0x9800, 0x985f) AM_MIRROR(0x80) AM_WRITEONLY AM_SHARE("spriteram")
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ_PORT("P1")
|
||||
AM_RANGE(0xa800, 0xa800) AM_READ_PORT("P2")
|
||||
AM_RANGE(0xb800, 0xb800) AM_READ_PORT("DSW") AM_WRITE(soundlatch_byte_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( carjmbre_sound_map, AS_PROGRAM, 8, carjmbre_state )
|
||||
AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x1000) AM_ROM
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( carjmbre_sound_io_map, AS_IO, 8, carjmbre_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x10, 0x10) AM_WRITENOP //?? written on init/0xff sound command reset
|
||||
AM_RANGE(0x20, 0x21) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
|
||||
AM_RANGE(0x22, 0x22) AM_WRITENOP //?? written before and after 0x21 with same value
|
||||
AM_RANGE(0x24, 0x24) AM_READNOP //??
|
||||
AM_RANGE(0x30, 0x31) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
|
||||
AM_RANGE(0x32, 0x32) AM_WRITENOP //?? written before and after 0x31 with same value
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Input ports
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static INPUT_PORTS_START( carjmbre )
|
||||
PORT_START("P1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) //coin error if held high for 1s
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) //or if many coins inserted quickly
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
|
||||
|
||||
PORT_START("P2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
|
||||
|
||||
PORT_START("DSW")
|
||||
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( Free_Play ) )
|
||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:3")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
|
||||
PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4,5")
|
||||
PORT_DIPSETTING( 0x00, "3" )
|
||||
PORT_DIPSETTING( 0x08, "4" )
|
||||
PORT_DIPSETTING( 0x10, "5" )
|
||||
PORT_DIPSETTING( 0x18, "Free") // 250 (cheat)
|
||||
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:6")
|
||||
PORT_DIPSETTING( 0x00, "10k, then every 100k" )
|
||||
PORT_DIPSETTING( 0x20, "20k, then every 100k" )
|
||||
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:7")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Graphics definitions
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const gfx_layout carjmbre_charlayout =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(2,4),
|
||||
2,
|
||||
{ RGN_FRAC(0,4), RGN_FRAC(2,4) },
|
||||
{ STEP8(0,1) },
|
||||
{ STEP8(0,8) },
|
||||
8*8
|
||||
};
|
||||
|
||||
static const gfx_layout carjmbre_spritelayout =
|
||||
{
|
||||
16,16,
|
||||
RGN_FRAC(1,4),
|
||||
2,
|
||||
{ RGN_FRAC(2,4), RGN_FRAC(0,4) },
|
||||
{ STEP8(0,1), STEP8(256*16*8,1) },
|
||||
{ STEP16(0,8) },
|
||||
16*8
|
||||
};
|
||||
|
||||
static GFXDECODE_START( carjmbre )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, carjmbre_charlayout, 0, 16 )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, carjmbre_spritelayout, 0, 16 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Machine driver
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void carjmbre_state::machine_reset()
|
||||
{
|
||||
m_flipscreen = 0;
|
||||
m_bgcolor = 0;
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(carjmbre_state::vblank_irq)
|
||||
{
|
||||
if(m_nmi_mask)
|
||||
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( carjmbre, carjmbre_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
|
||||
MCFG_CPU_PROGRAM_MAP(carjmbre_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", carjmbre_state, vblank_irq)
|
||||
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/6/2)
|
||||
MCFG_CPU_PROGRAM_MAP(carjmbre_sound_map)
|
||||
MCFG_CPU_IO_MAP(carjmbre_sound_io_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", carjmbre_state, irq0_line_hold)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
|
||||
MCFG_SCREEN_SIZE(32*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(carjmbre_state, screen_update_carjmbre)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", carjmbre)
|
||||
MCFG_PALETTE_ADD("palette", 64)
|
||||
MCFG_PALETTE_INIT_OWNER(carjmbre_state, carjmbre)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
|
||||
|
||||
MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* ROM definition
|
||||
*
|
||||
*************************************/
|
||||
|
||||
ROM_START( carjmbre )
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
ROM_LOAD( "c1", 0x0000, 0x1000, CRC(62b21739) SHA1(710e5c52f27603aa8f864f6f28d7272f21271d60) )
|
||||
@ -267,10 +79,4 @@ ROM_START( carjmbre )
|
||||
ROM_LOAD( "c.d18", 0x0020, 0x0020, CRC(7b9ed1b0) SHA1(ec5e1f56e5a2fc726083866c08ac0e1de0ed6ace) )
|
||||
ROM_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Game driver
|
||||
*
|
||||
*************************************/
|
||||
|
||||
GAME( 1983, carjmbre, 0, carjmbre, carjmbre, driver_device, 0, ROT90, "Omori Electric Co., Ltd.", "Car Jamboree", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1983, carjmbre, 0, carjmbre, carjmbre, driver_device, 0, ROT90, "Omori Electric Co., Ltd.", "Car Jamboree", MACHINE_IS_SKELETON )
|
||||
|
@ -1,12 +1,13 @@
|
||||
// license:???
|
||||
// copyright-holders:insideoutboy, David Haywood, Stephh
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
// **** SKELETON DRIVER **** original removed due to unresolved licensing.
|
||||
|
||||
/*
|
||||
|
||||
Flower (c)1986 Komax (USA license)
|
||||
(c)1986 Sega/Alpha (Sega game number 834-5998)
|
||||
|
||||
- Driver by InsideOutBoy, further improvements by MAME team
|
||||
|
||||
There is a PCB picture that shows two stickers, the first says
|
||||
"Flower (c) 1986 Clarue" while the second one is an original
|
||||
serial number tag also showing "Clarue". GFX ROM contents also
|
||||
@ -74,215 +75,22 @@ CHIP # POSITION TYPE
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "includes/flower.h"
|
||||
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_maincpu_irq_ack)
|
||||
class flower_state : public driver_device
|
||||
{
|
||||
m_maincpu->set_input_line(0, CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_subcpu_irq_ack)
|
||||
{
|
||||
m_subcpu->set_input_line(0, CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_soundcpu_irq_ack)
|
||||
{
|
||||
m_audiocpu->set_input_line(0, CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_coin_counter_w)
|
||||
{
|
||||
machine().bookkeeping().coin_counter_w(0, data & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_coin_lockout_w)
|
||||
{
|
||||
machine().bookkeeping().coin_lockout_global_w(~data & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::sound_command_w)
|
||||
{
|
||||
soundlatch_byte_w(space, 0, data);
|
||||
|
||||
if (*m_sn_nmi_enable & 1)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( flower_cpu1_2, AS_PROGRAM, 8, flower_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0xa000, 0xa000) AM_WRITE(flower_coin_lockout_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_WRITE(flower_flipscreen_w)
|
||||
AM_RANGE(0xa002, 0xa002) AM_WRITE(flower_maincpu_irq_ack)
|
||||
AM_RANGE(0xa003, 0xa003) AM_WRITE(flower_subcpu_irq_ack)
|
||||
AM_RANGE(0xa004, 0xa004) AM_WRITE(flower_coin_counter_w)
|
||||
AM_RANGE(0xa005, 0xa005) AM_WRITENOP // subcpu nmi (unused)
|
||||
AM_RANGE(0xa100, 0xa100) AM_READ_PORT("IN0CPU1")
|
||||
AM_RANGE(0xa101, 0xa101) AM_READ_PORT("IN1CPU1")
|
||||
AM_RANGE(0xa102, 0xa102) AM_READ_PORT("IN0CPU0")
|
||||
AM_RANGE(0xa103, 0xa103) AM_READ_PORT("IN1CPU0")
|
||||
AM_RANGE(0xa400, 0xa400) AM_WRITE(sound_command_w)
|
||||
AM_RANGE(0xc000, 0xddff) AM_RAM AM_SHARE("mainram1")
|
||||
AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(flower_textram_w) AM_SHARE("textram")
|
||||
AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("mainram2") // only cleared?
|
||||
AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(flower_bg0ram_w) AM_SHARE("bg0ram")
|
||||
AM_RANGE(0xf200, 0xf200) AM_RAM AM_SHARE("bg0_scroll")
|
||||
AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(flower_bg1ram_w) AM_SHARE("bg1ram")
|
||||
AM_RANGE(0xfa00, 0xfa00) AM_RAM AM_SHARE("bg1_scroll")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( flower_sound_cpu, AS_PROGRAM, 8, flower_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x4000) AM_WRITE(flower_soundcpu_irq_ack)
|
||||
AM_RANGE(0x4001, 0x4001) AM_WRITEONLY AM_SHARE("sn_nmi_enable")
|
||||
AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(0x8000, 0x803f) AM_DEVWRITE("flower", flower_sound_device, sound1_w)
|
||||
AM_RANGE(0xa000, 0xa03f) AM_DEVWRITE("flower", flower_sound_device, sound2_w)
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
public:
|
||||
flower_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
|
||||
INPUT_CHANGED_MEMBER(flower_state::coin_inserted)
|
||||
{
|
||||
m_maincpu->set_input_line(INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( flower )
|
||||
PORT_START("IN0CPU0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, flower_state,coin_inserted, 0)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_DIPNAME( 0x08, 0x08, "Energy Decrease" ) PORT_DIPLOCATION("SW2:4")
|
||||
PORT_DIPSETTING( 0x08, "Slow" )
|
||||
PORT_DIPSETTING( 0x00, "Fast" )
|
||||
PORT_DIPNAME( 0x10, 0x10, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW2:5")
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x20, 0x20, "Keep Weapons When Destroyed" ) PORT_DIPLOCATION("SW2:6") // check code at 0x74a2
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( No ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7") // "Enemy Bullets"
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Normal ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, "Shot Range" ) PORT_DIPLOCATION("SW2:8") // check code at 0x75f9
|
||||
PORT_DIPSETTING( 0x80, "Short" )
|
||||
PORT_DIPSETTING( 0x00, "Long" )
|
||||
|
||||
PORT_START("IN1CPU0")
|
||||
PORT_DIPNAME( 0x07, 0x05, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2,3")
|
||||
PORT_DIPSETTING( 0x07, "1" )
|
||||
PORT_DIPSETTING( 0x06, "2" )
|
||||
PORT_DIPSETTING( 0x05, "3" )
|
||||
PORT_DIPSETTING( 0x04, "4" )
|
||||
PORT_DIPSETTING( 0x03, "5" )
|
||||
PORT_DIPSETTING( 0x02, "6" )
|
||||
PORT_DIPSETTING( 0x01, "7" )
|
||||
PORT_DIPSETTING( 0x00, "Infinite (Cheat)")
|
||||
PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:4,5")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:6") // check code at 0x759f
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) )
|
||||
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7")
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:8")
|
||||
PORT_DIPSETTING( 0x80, "30k, then every 50k" )
|
||||
PORT_DIPSETTING( 0x00, "50k, then every 80k" )
|
||||
|
||||
PORT_START("IN0CPU1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Laser")
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Missile")
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Cutter")
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("IN1CPU1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_NAME("P2 Laser")
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_NAME("P2 Missile")
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL PORT_NAME("P2 Cutter")
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static const gfx_layout flower_charlayout =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(1,1),
|
||||
2,
|
||||
{ 0, 4 },
|
||||
{ STEP4(0,1), STEP4(8,1) },
|
||||
{ STEP8(0,16) },
|
||||
8*8*2
|
||||
};
|
||||
|
||||
static const gfx_layout flower_tilelayout =
|
||||
{
|
||||
16,16,
|
||||
RGN_FRAC(1,2),
|
||||
4,
|
||||
{ 0, 4, RGN_FRAC(1,2), RGN_FRAC(1,2)+4 },
|
||||
{ STEP4(0,1), STEP4(8,1), STEP4(8*8*2,1), STEP4(8*8*2+8,1) },
|
||||
{ STEP8(0,16), STEP8(8*8*4,16) },
|
||||
16*16*2
|
||||
};
|
||||
|
||||
static GFXDECODE_START( flower )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, flower_charlayout, 0, 64 )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, flower_tilelayout, 0, 16 )
|
||||
GFXDECODE_ENTRY( "gfx3", 0, flower_tilelayout, 0, 16 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static MACHINE_CONFIG_START( flower, flower_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
// clock divider (of all cpus) is unknown. /6 (3.072 MHz) is too slow
|
||||
// cpus are Z80 "A" type, official maximum speed of 4 MHz, but 4.6 MHz has been proven to work in practice
|
||||
MCFG_CPU_ADD("maincpu", Z80,XTAL_18_432MHz/4)
|
||||
MCFG_CPU_PROGRAM_MAP(flower_cpu1_2)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", flower_state, irq0_line_hold)
|
||||
|
||||
MCFG_CPU_ADD("subcpu", Z80,XTAL_18_432MHz/4)
|
||||
MCFG_CPU_PROGRAM_MAP(flower_cpu1_2)
|
||||
MCFG_CPU_PERIODIC_INT_DRIVER(flower_state, irq0_line_hold, 120) // controls game speed? irqsource and frequency unknown
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80,XTAL_18_432MHz/4)
|
||||
MCFG_CPU_PROGRAM_MAP(flower_sound_cpu)
|
||||
MCFG_CPU_PERIODIC_INT_DRIVER(flower_state, irq0_line_hold, 90) // controls music speed. irqsource and frequency unknown, same as subcpu perhaps?
|
||||
|
||||
// tight sync, slowdowns otherwise
|
||||
// MCFG_QUANTUM_PERFECT_CPU("maincpu")
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60) // ?
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(34*8, 33*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0*8, 28*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(flower_state, screen_update_flower)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", flower)
|
||||
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", 256)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("flower", FLOWER, 0)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -373,5 +181,5 @@ ROM_START( flowerj ) /* Sega/Alpha version. Sega game number 834-5998 */
|
||||
ROM_END
|
||||
|
||||
|
||||
GAME( 1986, flower, 0, flower, flower, driver_device, 0, ROT0, "Clarue (Komax license)", "Flower (US)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1986, flowerj, flower, flower, flower, driver_device, 0, ROT0, "Clarue (Sega / Alpha Denshi Co. license)", "Flower (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE)
|
||||
GAME( 1986, flower, 0, flower, flower, driver_device, 0, ROT0, "Clarue (Komax license)", "Flower (US)", MACHINE_IS_SKELETON )
|
||||
GAME( 1986, flowerj, flower, flower, flower, driver_device, 0, ROT0, "Clarue (Sega / Alpha Denshi Co. license)", "Flower (Japan)", MACHINE_IS_SKELETON )
|
||||
|
@ -1,22 +1,9 @@
|
||||
// license:???
|
||||
// copyright-holders:insideoutboy
|
||||
/*
|
||||
---------------------------
|
||||
Marine Date by TAITO (1981)
|
||||
MAME driver by insideoutboy
|
||||
---------------------------
|
||||
a static underwater scene with obstacles in it, like seaweed,
|
||||
crabs and other stuff. You have a limited number of "strokes"
|
||||
per screen as well as a timer to work against. Your goal is
|
||||
to *bounce* yourself around the screen using *Strokes* on the
|
||||
trackball to try to reach a *female* octopus before you run out
|
||||
of strokes or time. You sort of bounce yourself around the screen
|
||||
like a billiard ball would bounce, but once in a while bubbles
|
||||
and other stuff will come up from underneath you and carry you
|
||||
away from where you are trying to get. When you reach your goal
|
||||
you get another more difficult screen, etc.
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
// **** SKELETON DRIVER **** original removed due to unresolved licensing.
|
||||
|
||||
/*
|
||||
|
||||
Marine Date
|
||||
Taito 1981
|
||||
@ -108,657 +95,26 @@ Notes:
|
||||
Top and Middle PCBs are plugged in with the solder-sides together.
|
||||
Lower PCB is plugged in with components facing up.
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
todo:
|
||||
in cocktail mopde p1 is flipped
|
||||
after inking the shark on the far right octi was moved to goal?
|
||||
for the colours, goal has to be black otherwise it would register
|
||||
as a hit, is goal pen 0 or 6?
|
||||
rom writes when finishing a game
|
||||
worth looking at before the collision is correct?
|
||||
playing dot hit when eaten by a shark?
|
||||
dont use any ints, s/b UINT8?
|
||||
enemy sprite not disabled at end of game
|
||||
tilemap
|
||||
palette may only be around 4 colours
|
||||
is 14 the palette?
|
||||
how do you know if you've got any ink left?
|
||||
prom 14 is the top bits? 4 bpp? or so?
|
||||
why is level 37 chosen?
|
||||
should it be 30fps?
|
||||
check other taito games of the time
|
||||
look at other taito 1981 games for ideas on the ports
|
||||
bking
|
||||
jhunt?
|
||||
"Marine Deto" or "Marine Date"
|
||||
look in the roms for all the text
|
||||
simplify gfx decode
|
||||
why does the player sprite need 4 colours?
|
||||
check if more than 1 are used
|
||||
check service test ram wipes for confirmation of ram spots
|
||||
anything after trackball test?
|
||||
obj1 to obj2 draw order
|
||||
2nd trackball
|
||||
flip/cocktail issues
|
||||
|
||||
done:
|
||||
timer?
|
||||
you get 200 for each shot, don't think it's actually a timer
|
||||
have I been using x/y consistently, i.e. non rotated or rotated origin?
|
||||
yes, seems to be best using xy raw (i.e. non-rotated)
|
||||
p2 ink doesn't always light up in test mode
|
||||
after p1 ink pressed, p2 ink doesn't light up
|
||||
this is correct behavior if DSW set as Upright mode
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
|
||||
class marinedt_state : public driver_device
|
||||
{
|
||||
public:
|
||||
marinedt_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_tx_tileram(*this, "tx_tileram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_tx_tileram;
|
||||
|
||||
/* video-related */
|
||||
std::unique_ptr<bitmap_ind16> m_tile;
|
||||
std::unique_ptr<bitmap_ind16> m_obj1;
|
||||
std::unique_ptr<bitmap_ind16> m_obj2;
|
||||
tilemap_t *m_tx_tilemap;
|
||||
|
||||
UINT8 m_obj1_a;
|
||||
UINT8 m_obj1_x;
|
||||
UINT8 m_obj1_y;
|
||||
UINT8 m_obj2_a;
|
||||
UINT8 m_obj2_x;
|
||||
UINT8 m_obj2_y;
|
||||
UINT8 m_pd;
|
||||
UINT8 m_pf;
|
||||
UINT8 m_music;
|
||||
UINT8 m_sound;
|
||||
UINT8 m_coll;
|
||||
UINT8 m_cx;
|
||||
UINT8 m_cyr;
|
||||
UINT8 m_cyq;
|
||||
UINT8 m_collh;
|
||||
UINT8 m_cxh;
|
||||
UINT8 m_cyrh;
|
||||
UINT8 m_cyqh;
|
||||
DECLARE_WRITE8_MEMBER(tx_tileram_w);
|
||||
DECLARE_READ8_MEMBER(marinedt_port1_r);
|
||||
DECLARE_READ8_MEMBER(marinedt_coll_r);
|
||||
DECLARE_READ8_MEMBER(marinedt_obj1_x_r);
|
||||
DECLARE_READ8_MEMBER(marinedt_obj1_yr_r);
|
||||
DECLARE_READ8_MEMBER(marinedt_obj1_yq_r);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_obj1_a_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_obj1_x_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_obj1_y_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_obj2_a_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_obj2_x_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_obj2_y_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_music_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_sound_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_pd_w);
|
||||
DECLARE_WRITE8_MEMBER(marinedt_pf_w);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
DECLARE_PALETTE_INIT(marinedt);
|
||||
UINT32 screen_update_marinedt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
: driver_device(mconfig, type, tag)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
WRITE8_MEMBER(marinedt_state::tx_tileram_w)
|
||||
{
|
||||
m_tx_tileram[offset] = data;
|
||||
m_tx_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
READ8_MEMBER(marinedt_state::marinedt_port1_r)
|
||||
{
|
||||
//might need to be reversed for cocktail stuff
|
||||
|
||||
/* x/y multiplexed */
|
||||
return ioport(((m_pf & 0x08) >> 3) ? "TRACKY" : "TRACKX")->read();
|
||||
}
|
||||
|
||||
READ8_MEMBER(marinedt_state::marinedt_coll_r)
|
||||
{
|
||||
//76543210
|
||||
//x------- obj1 to obj2 collision
|
||||
//-xxx---- unused
|
||||
//----x--- obj1 to playfield collision
|
||||
//-----xxx unused
|
||||
|
||||
return m_coll | m_collh;
|
||||
}
|
||||
|
||||
//are these returning only during a collision?
|
||||
//I'd imagine they are returning the pf char where the collision took place?
|
||||
//what about where there is lots of collisions?
|
||||
//maybe the first on a scanline basis
|
||||
READ8_MEMBER(marinedt_state::marinedt_obj1_x_r)
|
||||
{
|
||||
//76543210
|
||||
//xxxx---- unknown
|
||||
//----xxxx x pos in tile ram
|
||||
|
||||
UINT8 *RAM = memregion("maincpu")->base();
|
||||
|
||||
if (RAM[0x430e])
|
||||
--m_cx;
|
||||
else
|
||||
++m_cx;
|
||||
|
||||
//figure out why inc/dec based on 430e?
|
||||
return m_cx | (m_cxh << 4);
|
||||
}
|
||||
|
||||
READ8_MEMBER(marinedt_state::marinedt_obj1_yr_r)
|
||||
{
|
||||
//76543210
|
||||
//xxxx---- unknown
|
||||
//----xxxx row in current screen quarter
|
||||
|
||||
|
||||
//has to be +1 if cx went over?
|
||||
if (m_cx == 0x10)
|
||||
m_cyr++;
|
||||
|
||||
return m_cyr | (m_cyrh << 4);
|
||||
}
|
||||
|
||||
READ8_MEMBER(marinedt_state::marinedt_obj1_yq_r)
|
||||
{
|
||||
//76543210
|
||||
//xx------ unknown
|
||||
//--xx---- screen quarter when flipped?
|
||||
//----xx-- unknown
|
||||
//------xx screen quarter
|
||||
|
||||
return m_cyq | (m_cyqh << 4);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_obj1_a_w){ m_obj1_a = data; }
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_obj1_x_w){ m_obj1_x = data; }
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_obj1_y_w){ m_obj1_y = data; }
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_obj2_a_w){ m_obj2_a = data; }
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_obj2_x_w){ m_obj2_x = data; }
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_obj2_y_w){ m_obj2_y = data; }
|
||||
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_music_w){ m_music = data; }
|
||||
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_sound_w)
|
||||
{
|
||||
//76543210
|
||||
//xx------ ??
|
||||
//--x----- jet sound
|
||||
//---x---- foam
|
||||
//----x--- ink
|
||||
//-----x-- collision
|
||||
//------x- dots hit
|
||||
//-------x ??
|
||||
|
||||
m_sound = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_pd_w)
|
||||
{
|
||||
//76543210
|
||||
//xxx----- ?? unused
|
||||
//---x---- ?? the rest should be used based on the table
|
||||
//----x--- ??
|
||||
//-----x-- ??
|
||||
//------x- obj2 enable
|
||||
//-------x obj1 enable
|
||||
|
||||
m_pd = data;
|
||||
}
|
||||
|
||||
/*
|
||||
upright
|
||||
marinedt_pf_w: 00 // upright
|
||||
marinedt_pf_w: 01 // ??
|
||||
|
||||
cocktail
|
||||
marinedt_pf_w: 02 // cocktail
|
||||
marinedt_pf_w: 03 // ??
|
||||
|
||||
marinedt_pf_w: 01 // upright
|
||||
marinedt_pf_w: 05 // flip sprite?
|
||||
|
||||
marinedt_pf_w: 07 // cocktail
|
||||
marinedt_pf_w: 03 // non-flip sprite?
|
||||
*/
|
||||
WRITE8_MEMBER(marinedt_state::marinedt_pf_w)
|
||||
{
|
||||
//76543210
|
||||
//xxxx---- ?? unused (will need to understand table of written values)
|
||||
//----x--- xy trackball select
|
||||
//-----x-- ?? flip screen/controls
|
||||
//------x- ?? upright/cocktail
|
||||
//-------x ?? service mode (coin lockout??)
|
||||
|
||||
|
||||
//if ((m_pf & 0x07) != (data & 0x07))
|
||||
// osd_printf_debug("marinedt_pf_w: %02x\n", data & 0x07);
|
||||
|
||||
if ((m_pf & 0x02) != (data & 0x02))
|
||||
{
|
||||
if (data & 0x02)
|
||||
osd_printf_debug("tile flip\n");
|
||||
else
|
||||
osd_printf_debug("tile non-flip\n");
|
||||
|
||||
if (data & 0x02)
|
||||
m_tx_tilemap->set_flip(TILEMAP_FLIPX | TILEMAP_FLIPY);
|
||||
else
|
||||
m_tx_tilemap->set_flip(0);
|
||||
}
|
||||
|
||||
m_pf = data;
|
||||
|
||||
//if (data & 0xf0)
|
||||
// logerror("pf:%02x %d\n", m_pf);
|
||||
//logerror("pd:%02x %d\n", m_pd, m_screen->frame_number());
|
||||
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( marinedt_map, AS_PROGRAM, 8, marinedt_state )
|
||||
AM_RANGE(0x0000, 0x37ff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x43ff) AM_RAM
|
||||
AM_RANGE(0x4400, 0x47ff) AM_RAM //unused, vram mirror?
|
||||
AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(tx_tileram_w) AM_SHARE("tx_tileram")
|
||||
AM_RANGE(0x4c00, 0x4c00) AM_WRITENOP //?? maybe off by one error
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( marinedt_io_map, AS_IO, 8, marinedt_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW0") //dips coinage
|
||||
AM_RANGE(0x01, 0x01) AM_READ(marinedt_port1_r) //trackball xy muxed
|
||||
AM_RANGE(0x02, 0x02) AM_READWRITE(marinedt_obj1_x_r, marinedt_obj1_a_w)
|
||||
AM_RANGE(0x03, 0x03) AM_READ_PORT("IN0") AM_WRITE(marinedt_obj1_x_w)
|
||||
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1") AM_WRITE(marinedt_obj1_y_w)
|
||||
AM_RANGE(0x05, 0x05) AM_WRITE(marinedt_music_w)
|
||||
AM_RANGE(0x06, 0x06) AM_READWRITE(marinedt_obj1_yr_r, marinedt_sound_w)
|
||||
AM_RANGE(0x08, 0x08) AM_WRITE(marinedt_obj2_a_w)
|
||||
AM_RANGE(0x09, 0x09) AM_WRITE(marinedt_obj2_x_w)
|
||||
AM_RANGE(0x0a, 0x0a) AM_READWRITE(marinedt_obj1_yq_r, marinedt_obj2_y_w)
|
||||
AM_RANGE(0x0d, 0x0d) AM_WRITE(marinedt_pd_w)
|
||||
AM_RANGE(0x0e, 0x0e) AM_READWRITE(marinedt_coll_r, watchdog_reset_w)
|
||||
AM_RANGE(0x0f, 0x0f) AM_WRITE(marinedt_pf_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( marinedt )
|
||||
PORT_START("DSW0")
|
||||
PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
|
||||
PORT_DIPSETTING( 0x0f, DEF_STR( 9C_1C ) )
|
||||
PORT_DIPSETTING( 0x0e, DEF_STR( 8C_1C ) )
|
||||
PORT_DIPSETTING( 0x0d, DEF_STR( 7C_1C ) )
|
||||
PORT_DIPSETTING( 0x0c, DEF_STR( 6C_1C ) )
|
||||
PORT_DIPSETTING( 0x0b, DEF_STR( 5C_1C ) )
|
||||
PORT_DIPSETTING( 0x0a, DEF_STR( 4C_1C ) )
|
||||
PORT_DIPSETTING( 0x09, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( 1C_4C ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) )
|
||||
PORT_DIPSETTING( 0x05, DEF_STR( 1C_6C ) )
|
||||
PORT_DIPSETTING( 0x06, DEF_STR( 1C_7C ) )
|
||||
PORT_DIPSETTING( 0x07, DEF_STR( 1C_8C ) )
|
||||
PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
|
||||
PORT_DIPSETTING( 0xf0, DEF_STR( 9C_1C ) )
|
||||
PORT_DIPSETTING( 0xe0, DEF_STR( 8C_1C ) )
|
||||
PORT_DIPSETTING( 0xd0, DEF_STR( 7C_1C ) )
|
||||
PORT_DIPSETTING( 0xc0, DEF_STR( 6C_1C ) )
|
||||
PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) )
|
||||
PORT_DIPSETTING( 0xa0, DEF_STR( 4C_1C ) )
|
||||
PORT_DIPSETTING( 0x90, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( 1C_3C ) )
|
||||
PORT_DIPSETTING( 0x30, DEF_STR( 1C_4C ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) )
|
||||
PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) )
|
||||
PORT_DIPSETTING( 0x60, DEF_STR( 1C_7C ) )
|
||||
PORT_DIPSETTING( 0x70, DEF_STR( 1C_8C ) )
|
||||
|
||||
PORT_START("IN0")
|
||||
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_HIGH, IPT_TILT )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
|
||||
|
||||
PORT_START("DSW1")
|
||||
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
|
||||
PORT_DIPSETTING( 0x01, "5000" )
|
||||
PORT_DIPSETTING( 0x00, "10000" )
|
||||
//cheat?
|
||||
PORT_DIPNAME( 0x02, 0x00, "ignore internal bounce?" ) //maybe die / bounce off rocks & coral?
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
|
||||
//freezes the game before the reset
|
||||
//doesn't seem to be done as a dip, but what about mixing with dips like this?
|
||||
PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
|
||||
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
|
||||
PORT_DIPNAME( 0x10, 0x00, "Coin Chutes" )
|
||||
PORT_DIPSETTING( 0x00, "Common" )
|
||||
PORT_DIPSETTING( 0x10, "Individual" )
|
||||
PORT_DIPNAME( 0x20, 0x00, "Year Display" )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )
|
||||
PORT_DIPSETTING( 0x00, "3" )
|
||||
PORT_DIPSETTING( 0x40, "4" )
|
||||
PORT_DIPSETTING( 0x80, "5" )
|
||||
PORT_DIPSETTING( 0xc0, "6" )
|
||||
|
||||
PORT_START("TRACKX") /* FAKE MUXED */
|
||||
//check all bits are used
|
||||
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_REVERSE
|
||||
|
||||
PORT_START("TRACKY") /* FAKE MUXED */
|
||||
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)
|
||||
INPUT_PORTS_END
|
||||
|
||||
static const gfx_layout marinedt_charlayout =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(1,3),
|
||||
3,
|
||||
{ RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, //maybe 120
|
||||
{ STEP8(0,1) },
|
||||
{ STEP8(0,8) },
|
||||
8*8
|
||||
};
|
||||
|
||||
static const gfx_layout marinedt_objlayout =
|
||||
{
|
||||
32,32,
|
||||
RGN_FRAC(1,1),
|
||||
2,
|
||||
{ 0, 4 },
|
||||
{ STEP4(32*8*7,1), STEP4(32*8*6,1), STEP4(32*8*5,1), STEP4(32*8*4,1), STEP4(32*8*3,1), STEP4(32*8*2,1), STEP4(32*8*1,1), STEP4(32*8*0,1) },
|
||||
{ STEP16(0,8), STEP16(16*8,8) },
|
||||
32*32*2
|
||||
};
|
||||
|
||||
static GFXDECODE_START( marinedt )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, marinedt_charlayout, 0, 4 ) //really only 1 colour set?
|
||||
GFXDECODE_ENTRY( "gfx2", 0, marinedt_objlayout, 48, 4 )
|
||||
GFXDECODE_ENTRY( "gfx3", 0, marinedt_objlayout, 32, 4 )
|
||||
GFXDECODE_END
|
||||
|
||||
PALETTE_INIT_MEMBER(marinedt_state, marinedt)
|
||||
{
|
||||
const UINT8 *color_prom = memregion("proms")->base();
|
||||
int i,r,b,g;
|
||||
|
||||
for (i = 0; i < palette.entries(); i++)
|
||||
{
|
||||
int bit0, bit1, bit2;
|
||||
|
||||
/* red component */
|
||||
bit0 = (~color_prom[i] >> 0) & 0x01;
|
||||
bit1 = (~color_prom[i] >> 1) & 0x01;
|
||||
bit2 = (~color_prom[i] >> 2) & 0x01;
|
||||
// *(palette++) = 0x92 * bit0 + 0x46 * bit1 + 0x27 * bit2;
|
||||
r = 0x27 * bit0 + 0x46 * bit1 + 0x92 * bit2;
|
||||
/* green component */
|
||||
bit0 = (~color_prom[i] >> 3) & 0x01;
|
||||
bit1 = (~color_prom[i] >> 4) & 0x01;
|
||||
bit2 = (~color_prom[i] >> 5) & 0x01;
|
||||
// *(palette++) = 0x92 * bit0 + 0x46 * bit1 + 0x27 * bit2;
|
||||
g = 0x27 * bit0 + 0x46 * bit1 + 0x92 * bit2;
|
||||
/* blue component */
|
||||
bit0 = (~color_prom[i] >> 5) & 0x01;
|
||||
bit1 = (~color_prom[i] >> 6) & 0x01;
|
||||
bit2 = (~color_prom[i] >> 7) & 0x01;
|
||||
bit0 = 0;
|
||||
// *(palette++) = 0x92 * bit0 + 0x46 * bit1 + 0x27 * bit2;
|
||||
b = 0x27 * bit0 + 0x46 * bit1 + 0x92 * bit2;
|
||||
|
||||
palette.set_pen_color(i, rgb_t(r, g, b));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(marinedt_state::get_tile_info)
|
||||
{
|
||||
int code = m_tx_tileram[tile_index];
|
||||
int color = 0;
|
||||
int flags = TILE_FLIPX;
|
||||
|
||||
SET_TILE_INFO_MEMBER(0, code, color, flags);
|
||||
}
|
||||
|
||||
void marinedt_state::video_start()
|
||||
{
|
||||
m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(marinedt_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
|
||||
|
||||
m_tx_tilemap->set_transparent_pen(0);
|
||||
m_tx_tilemap->set_scrolldx(0, 4*8);
|
||||
m_tx_tilemap->set_scrolldy(0, -4*8);
|
||||
|
||||
m_tile = std::make_unique<bitmap_ind16>(32 * 8, 32 * 8);
|
||||
m_obj1 = std::make_unique<bitmap_ind16>(32, 32);
|
||||
m_obj2 = std::make_unique<bitmap_ind16>(32, 32);
|
||||
}
|
||||
|
||||
|
||||
// x------- flipy
|
||||
// -x------ unused ??
|
||||
// --xxx--- sprite code
|
||||
// -----x-- bank
|
||||
// ------xx colour
|
||||
|
||||
#define OBJ_CODE(a) ((((a) & 0x04) << 1) + (((a) & 0x38) >> 3))
|
||||
#define OBJ_COLOR(a) ((a) & 0x03)
|
||||
#define OBJ_X(x) (256 - 32 - (x))
|
||||
#define OBJ_Y(y) (256 - 1 - (y))
|
||||
#define OBJ_FLIPX(a) ((m_pf & 0x02) == 0)
|
||||
#define OBJ_FLIPY(a) ((a) & 0x80)
|
||||
|
||||
UINT32 marinedt_state::screen_update_marinedt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int sx, sy;
|
||||
|
||||
m_tile->fill(0);
|
||||
m_tx_tilemap->draw(screen, *m_tile, cliprect, 0, 0);
|
||||
|
||||
m_obj1->fill(0);
|
||||
m_gfxdecode->gfx(1)->transpen(*m_obj1,m_obj1->cliprect(),
|
||||
OBJ_CODE(m_obj1_a),
|
||||
OBJ_COLOR(m_obj1_a),
|
||||
OBJ_FLIPX(m_obj1_a), OBJ_FLIPY(m_obj1_a),
|
||||
0, 0, 0);
|
||||
|
||||
m_obj2->fill(0);
|
||||
m_gfxdecode->gfx(2)->transpen(*m_obj2,m_obj2->cliprect(),
|
||||
OBJ_CODE(m_obj2_a),
|
||||
OBJ_COLOR(m_obj2_a),
|
||||
OBJ_FLIPX(m_obj2_a), OBJ_FLIPY(m_obj2_a),
|
||||
0, 0, 0);
|
||||
|
||||
bitmap.fill(0);
|
||||
|
||||
if (m_pd & 0x02)
|
||||
copybitmap_trans(bitmap, *m_obj2, 0, 0, OBJ_X(m_obj2_x), OBJ_Y(m_obj2_y), cliprect, 0);
|
||||
|
||||
if (m_pd & 0x01)
|
||||
copybitmap_trans(bitmap, *m_obj1, 0, 0, OBJ_X(m_obj1_x), OBJ_Y(m_obj1_y), cliprect, 0);
|
||||
|
||||
copybitmap_trans(bitmap, *m_tile, 0, 0, 0, 0, cliprect, 0);
|
||||
|
||||
m_coll = m_cx = m_cyr = m_cyq = 0;
|
||||
if (m_pd & 0x01)
|
||||
{
|
||||
for (sx = 0; sx < 32; sx++)
|
||||
for (sy = 0; sy < 32; sy++)
|
||||
{
|
||||
int x = OBJ_X(m_obj1_x) + sx;
|
||||
int y = OBJ_Y(m_obj1_y) + sy;
|
||||
|
||||
if (!cliprect.contains(x, y))
|
||||
continue;
|
||||
|
||||
if (m_obj1->pix16(sy, sx) == 0)
|
||||
continue;
|
||||
|
||||
if (m_tile->pix16(y, x) != 0)
|
||||
{
|
||||
m_coll = 0x08;
|
||||
|
||||
m_cx = (x % 128) / 8;
|
||||
m_cx &= 0x0f;
|
||||
|
||||
m_cyr = ((y % 64) / 8) * 2 + (x > 127 ? 1 : 0);
|
||||
m_cyr &= 0x0f;
|
||||
|
||||
m_cyq = y / 64;
|
||||
m_cyq &= 0x0f;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_collh = m_cxh = m_cyrh = m_cyqh = 0;
|
||||
if ((m_pd & 0x03) == 0x03)
|
||||
{
|
||||
for (sx = 0; sx < 32; sx++)
|
||||
for (sy = 0; sy < 32; sy++)
|
||||
{
|
||||
int x = OBJ_X(m_obj1_x + sx);
|
||||
int y = OBJ_Y(m_obj1_y + sy);
|
||||
|
||||
int xx = OBJ_X(m_obj2_x) - x;
|
||||
int yy = OBJ_Y(m_obj2_y) - y;
|
||||
|
||||
if (xx < 0 || xx >= 32 || yy < 0 || yy >= 32)
|
||||
continue;
|
||||
|
||||
if (m_obj1->pix16(sy, sx) == 0)
|
||||
continue;
|
||||
|
||||
if (m_obj2->pix16(yy, xx) != 0)
|
||||
{
|
||||
m_collh = 0x80;
|
||||
|
||||
m_cxh = (x % 128) / 8;
|
||||
m_cxh &= 0x0f;
|
||||
|
||||
m_cyrh = ((y % 64) / 8) * 2 + (x > 127 ? 1 : 0);
|
||||
m_cyrh &= 0x0f;
|
||||
|
||||
m_cyqh= y / 64;
|
||||
m_cyqh &= 0x0f;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void marinedt_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_obj1_a));
|
||||
save_item(NAME(m_obj1_x));
|
||||
save_item(NAME(m_obj1_y));
|
||||
save_item(NAME(m_obj2_a));
|
||||
save_item(NAME(m_obj2_x));
|
||||
save_item(NAME(m_obj2_y));
|
||||
save_item(NAME(m_pd));
|
||||
save_item(NAME(m_pf));
|
||||
save_item(NAME(m_music));
|
||||
save_item(NAME(m_sound));
|
||||
save_item(NAME(m_coll));
|
||||
save_item(NAME(m_cx));
|
||||
save_item(NAME(m_cyr));
|
||||
save_item(NAME(m_cyq));
|
||||
save_item(NAME(m_collh));
|
||||
save_item(NAME(m_cxh));
|
||||
save_item(NAME(m_cyrh));
|
||||
save_item(NAME(m_cyqh));
|
||||
}
|
||||
|
||||
void marinedt_state::machine_reset()
|
||||
{
|
||||
m_obj1_a = 0;
|
||||
m_obj1_x = 0;
|
||||
m_obj1_y = 0;
|
||||
m_obj2_a = 0;
|
||||
m_obj2_x = 0;
|
||||
m_obj2_y = 0;
|
||||
m_pd = 0;
|
||||
m_pf = 0;
|
||||
m_music = 0;
|
||||
m_sound = 0;
|
||||
m_coll = 0;
|
||||
m_cx = 0;
|
||||
m_cyr = 0;
|
||||
m_cyq = 0;
|
||||
m_collh = 0;
|
||||
m_cxh = 0;
|
||||
m_cyrh = 0;
|
||||
m_cyqh = 0;
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( marinedt, marinedt_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", Z80,10000000/4)
|
||||
MCFG_CPU_PROGRAM_MAP(marinedt_map)
|
||||
MCFG_CPU_IO_MAP(marinedt_io_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", marinedt_state, irq0_line_hold)
|
||||
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(4*8+32*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 32*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(marinedt_state, screen_update_marinedt)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", marinedt)
|
||||
MCFG_PALETTE_ADD("palette", 64)
|
||||
MCFG_PALETTE_INIT_OWNER(marinedt_state, marinedt)
|
||||
|
||||
/* sound hardware */
|
||||
//discrete sound
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Game driver(s)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( marinedt )
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
ROM_LOAD( "mg01.3d", 0x0000, 0x0800, CRC(ad09f04d) SHA1(932fc973b4a2fbbebd7e6437ed30c8444e3d4afb))
|
||||
@ -781,10 +137,10 @@ ROM_START( marinedt )
|
||||
ROM_LOAD( "mg13.6h", 0x0000, 0x1000, CRC(17817044) SHA1(8c9b96620e3c414952e6d85c6e81b0df85c88e7a) )
|
||||
|
||||
ROM_REGION( 0x0080, "proms", 0 )
|
||||
ROM_LOAD( "mg14.2a", 0x0000, 0x0020, CRC(f75f4e3a) SHA1(36e665987f475c57435fa8c224a2a3ce0c5e672b) ) //char clr
|
||||
ROM_LOAD( "mg15.1a", 0x0020, 0x0020, CRC(cd3ab489) SHA1(a77478fb94d0cf8f4317f89cc9579def7c294b4f) ) //obj clr
|
||||
ROM_LOAD( "mg16.4e", 0x0040, 0x0020, CRC(92c868bc) SHA1(483ae6f47845ddacb701528e82bd388d7d66a0fb) ) //?? collisions
|
||||
ROM_LOAD( "mg17.bpr", 0x0060, 0x0020, CRC(13261a02) SHA1(050edd18e4f79d19d5206f55f329340432fd4099) ) //?? table of increasing values
|
||||
ROM_LOAD( "mg14.2a", 0x0000, 0x0020, CRC(f75f4e3a) SHA1(36e665987f475c57435fa8c224a2a3ce0c5e672b) )
|
||||
ROM_LOAD( "mg15.1a", 0x0020, 0x0020, CRC(cd3ab489) SHA1(a77478fb94d0cf8f4317f89cc9579def7c294b4f) )
|
||||
ROM_LOAD( "mg16.4e", 0x0040, 0x0020, CRC(92c868bc) SHA1(483ae6f47845ddacb701528e82bd388d7d66a0fb) )
|
||||
ROM_LOAD( "mg17.bpr", 0x0060, 0x0020, CRC(13261a02) SHA1(050edd18e4f79d19d5206f55f329340432fd4099) )
|
||||
ROM_END
|
||||
|
||||
GAME( 1981, marinedt, 0, marinedt, marinedt, driver_device, 0, ROT270, "Taito", "Marine Date", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1981, marinedt, 0, marinedt, marinedt, driver_device, 0, ROT270, "Taito", "Marine Date", MACHINE_IS_SKELETON )
|
||||
|
@ -1,5 +1,8 @@
|
||||
// license:???
|
||||
// copyright-holders:David Haywood,insideoutboy, Pierpaolo Prazzoli
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
// **** SKELETON DRIVER **** original removed due to unresolved licensing.
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Popper
|
||||
@ -24,358 +27,26 @@
|
||||
8910 SW2 SW1 p.m4 p.m3
|
||||
|
||||
|
||||
Notes:
|
||||
|
||||
- a lower interleave causes some sounds to miss, different interleave values
|
||||
change random elements eg position of falling logs, it may be enough to
|
||||
synchronise the cpus on read/writes to the 0xdd00/0f range
|
||||
|
||||
- it's possible that the two score rows shouldn't be overlaid or shouldn't be
|
||||
drawn at all times, the only time there is anything underneath is the colour
|
||||
bars on the startup screen
|
||||
|
||||
- on odd/bonus levels the chars are not aligned with the sprites when the pylons
|
||||
are initially drawn (too low) resulting in the top 3 pylons being black, as
|
||||
the pylons move up the screen the chars go out of alignment again (this time
|
||||
too high) for a single frame to show another glitch
|
||||
|
||||
- front to back ordering of object/enemy sprites appears wrong
|
||||
|
||||
- on even levels the front most balloon carrying new enemies swaps between the
|
||||
left and middle one, clipping to 16 pixel strips solves this but causes other
|
||||
obvious sprite drawing errors
|
||||
|
||||
- balloon sprites not displayed on high score entry due to the way videoram is
|
||||
being drawn, possibly trying to create a stencil effect
|
||||
|
||||
- bursting a balloon on bonus levels just before dying from a log causes a
|
||||
sprite glitch for a few frames and then a 9999 point bonus
|
||||
|
||||
- reads from 0xffff appear to be a harmless bug in the code that initialises
|
||||
memory blocks for enemies on odd levels, it goes on to read from 0x001f,
|
||||
0x003f, 0x005f, 0x007f in the rom before giving up
|
||||
|
||||
- a reset while a game is in progress or with credits inserted shows a
|
||||
"sorry!! over run" message instead of the test screen during startup,
|
||||
looks like the game assumes the reset was caused by the watchdog after a
|
||||
hang/crash and is apologising to the player for the loss of their game
|
||||
|
||||
- title screen sprite colour glitch in lower right corner of the large pylon
|
||||
when an even level was shown before, caused by the game trying to colour
|
||||
the top of the pylon in the same way as for odd levels
|
||||
|
||||
- enemies stop moving on even levels on rare occasions
|
||||
|
||||
- enemy sprites entering from the bridges on odd levels are clipped by a
|
||||
few pixels at the top, this would happen even without the overlay as the
|
||||
first few rows of videoram are high priority solid chars most of the time
|
||||
|
||||
- unknown 0xe002 writes, on for title and level 2 off for all else, looks
|
||||
to be graphic related
|
||||
|
||||
- bottom of screen is scrappy on odd levels, amongst other things the sprites
|
||||
leave early, screen size could be clipped tighter or there could be some
|
||||
special handling needed, possibly tied to the 0xe002 writes
|
||||
|
||||
- the game freezes in much the same way as the stop dip switch when the coin
|
||||
inputs are high (a short PORT_IMPULSE duration will still cause a hitch),
|
||||
so potentially there's a coin lockout mechanism
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "includes/popper.h"
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Memory handlers
|
||||
*
|
||||
*************************************/
|
||||
|
||||
//e000 e001 e002 e003
|
||||
//76543210 76543210 76543210 76543210
|
||||
//x------- unused x------- unused x------- unused x------- unused
|
||||
//-x------ dsw1:1 -x------ dsw1:2 -x------ dsw1:3 -x------ dsw1:4
|
||||
//--x----- unused --x----- unused --x----- unused --x----- unused
|
||||
//---x---- dsw2:1 ---x---- dsw2:2 ---x---- dsw2:3 ---x---- dsw2:4
|
||||
//----x--- service ----xxxx p1 udlr ----x--- unused ----xxxx p2 udlr
|
||||
//-----x-- coin a -----x-- coin b
|
||||
//------x- start 1 ------x- start 2
|
||||
//-------x p1 b1 -------x p2 b1
|
||||
//
|
||||
//e004 e005 e006 e007
|
||||
//x------- dsw1:5 x------- dsw1:6 x------- dsw1:7 x------- dsw1:8
|
||||
//-x------ unused -x------ unused -x------ unused -x------ unused
|
||||
//--x----- dsw2:5 --x----- dsw2:6 --x----- dsw2:7 --x----- dsw2:8
|
||||
//---xxxxx unused ---xxxxx unused ---xxxxx unused ---xxxxx unused
|
||||
//
|
||||
//dsw1 dsw2
|
||||
//87654321 87654321
|
||||
//xx------ extra x------- stop
|
||||
//--xx---- poppers -x------ clear (current level)
|
||||
//----xx-- coin b --x----- upright (cabinet)
|
||||
//------xx coin a ---x---- crt dir. (flip screen)
|
||||
// ----x--- pass (unlimited lives)
|
||||
// -----x-- free play
|
||||
// ------x- continue
|
||||
// -------x sound
|
||||
READ8_MEMBER(popper_state::popper_input_ports_r)
|
||||
class popper_state : public driver_device
|
||||
{
|
||||
UINT8 data = 0;
|
||||
switch (offset)
|
||||
{
|
||||
// player inputs dsw1 dsw2
|
||||
case 0: data = ioport("IN0")->read() | ((ioport("DSW1")->read() & 0x02) << 5) | ((ioport("DSW2")->read() & 0x01) << 4); break;
|
||||
case 1: data = ioport("IN1")->read() | ((ioport("DSW1")->read() & 0x01) << 6) | ((ioport("DSW2")->read() & 0x02) << 3); break;
|
||||
case 2: data = ioport("IN2")->read() | ((ioport("DSW1")->read() & 0x08) << 3) | ((ioport("DSW2")->read() & 0x04) << 2); break;
|
||||
case 3: data = ioport("IN3")->read() | ((ioport("DSW1")->read() & 0x04) << 4) | ((ioport("DSW2")->read() & 0x08) << 1); break;
|
||||
case 4: data = ((ioport("DSW1")->read() & 0x20) << 2) | ((ioport("DSW2")->read() & 0x10) << 1); break;
|
||||
case 5: data = ((ioport("DSW1")->read() & 0x10) << 3) | ((ioport("DSW2")->read() & 0x20) << 0); break;
|
||||
case 6: data = ((ioport("DSW1")->read() & 0x80) << 0) | ((ioport("DSW2")->read() & 0x40) >> 1); break;
|
||||
case 7: data = ((ioport("DSW1")->read() & 0x40) << 1) | ((ioport("DSW2")->read() & 0x80) >> 2); break;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
public:
|
||||
popper_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
{ }
|
||||
};
|
||||
|
||||
READ8_MEMBER(popper_state::popper_soundcpu_nmi_r)
|
||||
{
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(popper_state::nmi_mask_w)
|
||||
{
|
||||
m_nmi_mask = data & 1;
|
||||
}
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Memory maps
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static ADDRESS_MAP_START( popper_map, AS_PROGRAM, 8, popper_state )
|
||||
AM_RANGE(0x0000, 0x5fff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xc1bf) AM_RAM
|
||||
AM_RANGE(0xc1c0, 0xc1ff) AM_RAM_WRITE(popper_ol_videoram_w) AM_SHARE("ol_videoram")
|
||||
AM_RANGE(0xc200, 0xc61f) AM_RAM_WRITE(popper_videoram_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0xc620, 0xc9bf) AM_RAM
|
||||
AM_RANGE(0xc9c0, 0xc9ff) AM_RAM_WRITE(popper_ol_attribram_w) AM_SHARE("ol_attribram")
|
||||
AM_RANGE(0xca00, 0xce1f) AM_RAM_WRITE(popper_attribram_w) AM_SHARE("attribram")
|
||||
AM_RANGE(0xce20, 0xcfff) AM_RAM
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE("share1")
|
||||
AM_RANGE(0xe000, 0xe007) AM_READ(popper_input_ports_r)
|
||||
AM_RANGE(0xe000, 0xe000) AM_WRITE(nmi_mask_w)
|
||||
AM_RANGE(0xe001, 0xe001) AM_WRITE(popper_flipscreen_w)
|
||||
AM_RANGE(0xe002, 0xe002) AM_WRITE(popper_e002_w) //?? seems to be graphic related
|
||||
AM_RANGE(0xe003, 0xe003) AM_WRITE(popper_gfx_bank_w)
|
||||
AM_RANGE(0xe004, 0xe007) AM_WRITENOP //?? range cleared once when the SP is set
|
||||
AM_RANGE(0xe400, 0xe400) AM_READ(popper_soundcpu_nmi_r)
|
||||
AM_RANGE(0xf800, 0xf800) AM_READNOP //?? read once at startup
|
||||
AM_RANGE(0xfc00, 0xfc00) AM_READNOP //?? possibly watchdog
|
||||
AM_RANGE(0xffff, 0xffff) AM_READNOP
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( popper_sound_map, AS_PROGRAM, 8, popper_state )
|
||||
AM_RANGE(0x0000, 0x0fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
|
||||
AM_RANGE(0x8002, 0x8002) AM_READNOP //?? all read once at startup and the
|
||||
AM_RANGE(0x8002, 0x8002) AM_WRITENOP //?? same writes as 0x8000 (mostly)
|
||||
AM_RANGE(0x8003, 0x8003) AM_READNOP //?? result ignored, looks like part
|
||||
AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
|
||||
AM_RANGE(0xa002, 0xa002) AM_READNOP //?? of AY8910 initialisation
|
||||
AM_RANGE(0xa002, 0xa002) AM_WRITENOP //?? same writes as 0xa000
|
||||
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE("share1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Input ports
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static INPUT_PORTS_START( popper )
|
||||
PORT_START("IN0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 ) //ignored if held for 12 or more frames
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 )
|
||||
|
||||
PORT_START("IN1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
|
||||
|
||||
PORT_START("IN2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) //ignored if held for 12 or more frames
|
||||
|
||||
PORT_START("IN3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
|
||||
|
||||
PORT_START("DSW1") /* FAKE DSW1 */
|
||||
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) //SW1:1-2
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Coin_B ) ) //SW1:3-4
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_3C ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
|
||||
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_6C ) )
|
||||
PORT_DIPNAME( 0x30, 0x10, DEF_STR( Lives ) ) //SW1:5-6
|
||||
PORT_DIPSETTING( 0x00, "2" )
|
||||
PORT_DIPSETTING( 0x10, "3" )
|
||||
PORT_DIPSETTING( 0x20, "4" )
|
||||
PORT_DIPSETTING( 0x30, "5" )
|
||||
PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) ) //SW1:7-8
|
||||
PORT_DIPSETTING( 0x00, "20k, then every 70k" )
|
||||
PORT_DIPSETTING( 0x40, "30k, then every 70k" )
|
||||
PORT_DIPSETTING( 0x80, "40k, then every 70k" )
|
||||
PORT_DIPSETTING( 0xc0, "50k, then every 70k" )
|
||||
|
||||
PORT_START("DSW2") /* FAKE DSW2 */
|
||||
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) //SW2:1
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Allow_Continue ) ) //SW2:2 (stored in 0xd987, never read)
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Free_Play ) ) //SW2:3
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x08, 0x00, "Pass (Unlimited Lives) (Cheat)") //SW2:4
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Flip_Screen ) ) //SW2:5
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) ) //SW2:6
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
|
||||
PORT_DIPNAME( 0x40, 0x00, "Clear (Current Level) (Cheat)") //SW2:7
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x00, "Stop" ) //SW2:8
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Graphics definitions
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const gfx_layout popper_charlayout =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(2,2),
|
||||
2,
|
||||
{ 0, 4 },
|
||||
{ STEP4(8,1), STEP4(0,1) },
|
||||
{ STEP8(0,16) },
|
||||
16*8
|
||||
};
|
||||
|
||||
static const gfx_layout popper_spritelayout =
|
||||
{
|
||||
16,16,
|
||||
RGN_FRAC(1,2),
|
||||
2,
|
||||
{ 0, RGN_FRAC(1,2) },
|
||||
{ STEP8(8,1), STEP8(0,1) },
|
||||
{ STEP16(0, 16) },
|
||||
16*2*8
|
||||
};
|
||||
|
||||
static GFXDECODE_START( popper )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, popper_charlayout, 0, 16 )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, popper_spritelayout, 0, 16 )
|
||||
GFXDECODE_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Machine driver
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void popper_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_flipscreen));
|
||||
save_item(NAME(m_e002));
|
||||
save_item(NAME(m_gfx_bank));
|
||||
}
|
||||
|
||||
void popper_state::machine_reset()
|
||||
{
|
||||
m_flipscreen = 0;
|
||||
m_e002 = 0;
|
||||
m_gfx_bank = 0;
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(popper_state::vblank_irq)
|
||||
{
|
||||
if(m_nmi_mask)
|
||||
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
|
||||
static MACHINE_CONFIG_START( popper, popper_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", Z80,18432000/6)
|
||||
MCFG_CPU_PROGRAM_MAP(popper_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", popper_state, vblank_irq)
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80,18432000/12)
|
||||
MCFG_CPU_PROGRAM_MAP(popper_sound_map)
|
||||
MCFG_CPU_PERIODIC_INT_DRIVER(popper_state, irq0_line_hold, 4*60) //NMIs caused by the main CPU
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(1800))
|
||||
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(33*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 33*8-1, 2*8, 30*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(popper_state, screen_update_popper)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", popper)
|
||||
MCFG_PALETTE_ADD("palette", 64)
|
||||
MCFG_PALETTE_INIT_OWNER(popper_state, popper)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ay1", AY8910, 18432000/12)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
|
||||
MCFG_SOUND_ADD("ay2", AY8910, 18432000/12)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* ROM definition
|
||||
*
|
||||
*************************************/
|
||||
|
||||
ROM_START( popper )
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
ROM_LOAD( "p1", 0x0000, 0x2000, CRC(56881b70) SHA1(d3ade7a54a6cb8a0babf0d667a6b27f492a739dc) )
|
||||
@ -397,11 +68,4 @@ ROM_START( popper )
|
||||
ROM_LOAD( "p.m4", 0x0020, 0x0020, CRC(384de5c1) SHA1(892c89a01c11671c5708113b4e4c27b84be37ea6) )
|
||||
ROM_END
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Game driver
|
||||
*
|
||||
*************************************/
|
||||
|
||||
GAME( 1983, popper, 0, popper, popper, driver_device, 0, ROT90, "Omori Electric Co., Ltd.", "Popper", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1983, popper, 0, popper, popper, driver_device, 0, ROT90, "Omori Electric Co., Ltd.", "Popper", MACHINE_IS_SKELETON )
|
||||
|
@ -1,5 +1,8 @@
|
||||
// license:???
|
||||
// copyright-holders:insideoutboy
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
// **** SKELETON DRIVER **** original removed due to unresolved licensing.
|
||||
|
||||
/*
|
||||
Super Cross II (JPN Ver.)
|
||||
(c)1986 GM Shoji
|
||||
@ -36,266 +39,25 @@ SCM-23.5B
|
||||
SC-60.4K
|
||||
SC-61.5A
|
||||
|
||||
Notes:
|
||||
|
||||
- sprites pop in at the wrong place sometimes before entering the screen
|
||||
|
||||
- correct drawing/animation of bg is very sensitive to cpu speed/interrupts/
|
||||
interleave, current settings aren't correct but don't think there's any
|
||||
visible problems
|
||||
|
||||
- engine rev sound may not be completely correct
|
||||
|
||||
- bg not using second half of prom, of interest is this half is identical to
|
||||
the second half of a bankp/appoooh prom, hardware is similar to bankp/appoooh
|
||||
in a few ways, there's also an unused SEGA logo in the bg graphics
|
||||
|
||||
- fg not using odd colours, shouldn't matter as the colours are duplicated
|
||||
|
||||
- sprite priorities are wrong when bikes are jumping as they are ordered on
|
||||
vertical position only, assume this is original behaviour
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "sound/sn76496.h"
|
||||
#include "includes/sprcros2.h"
|
||||
|
||||
|
||||
|
||||
|
||||
WRITE8_MEMBER(sprcros2_state::m_port7_w)
|
||||
class sprcros2_state : public driver_device
|
||||
{
|
||||
//76543210
|
||||
//x------- unused
|
||||
//-x------ bankswitch halves of scm-01.10k into c000-dfff
|
||||
//--xx---- unused
|
||||
//----x--- irq enable
|
||||
//-----x-- ?? off with title flash and screen clears, possibly layer/sprite enable
|
||||
//------x- flip screen
|
||||
//-------x nmi enable
|
||||
public:
|
||||
sprcros2_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
{ }
|
||||
|
||||
if((m_port7^data)&0x40)
|
||||
membank("masterbank")->set_entry((data&0x40)>>6);
|
||||
};
|
||||
|
||||
machine().tilemap().set_flip_all(data&0x02?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 );
|
||||
|
||||
m_port7 = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sprcros2_state::s_port3_w)
|
||||
{
|
||||
//76543210
|
||||
//xxxx---- unused
|
||||
//----x--- bankswitch halves of scs-27.5k into c000-dfff
|
||||
//-----xx- unused
|
||||
//-------x nmi enable
|
||||
|
||||
if((m_s_port3^data)&0x08)
|
||||
membank("slavebank")->set_entry((data&0x08)>>3);
|
||||
|
||||
m_s_port3 = data;
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( sprcros2_master_map, AS_PROGRAM, 8, sprcros2_state )
|
||||
AM_RANGE(0x0000, 0xbfff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("masterbank")
|
||||
AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram")
|
||||
AM_RANGE(0xe800, 0xe817) AM_RAM //always zero
|
||||
AM_RANGE(0xe818, 0xe83f) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0xe840, 0xefff) AM_RAM //always zero
|
||||
AM_RANGE(0xf000, 0xf7ff) AM_RAM
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1") //shared with slave cpu
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sprcros2_master_io_map, AS_IO, 8, sprcros2_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_DEVWRITE("sn1", sn76489_device, write)
|
||||
AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") AM_DEVWRITE("sn2", sn76489_device, write)
|
||||
AM_RANGE(0x02, 0x02) AM_READ_PORT("EXTRA") AM_DEVWRITE("sn3", sn76489_device, write)
|
||||
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x05, 0x05) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x07, 0x07) AM_WRITE(m_port7_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sprcros2_slave_map, AS_PROGRAM, 8, sprcros2_state )
|
||||
AM_RANGE(0x0000, 0xbfff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("slavebank")
|
||||
AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram")
|
||||
AM_RANGE(0xe800, 0xefff) AM_RAM //always zero
|
||||
AM_RANGE(0xf000, 0xf7ff) AM_RAM
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sprcros2_slave_io_map, AS_IO, 8, sprcros2_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x00) AM_WRITE(bgscrollx_w)
|
||||
AM_RANGE(0x01, 0x01) AM_WRITE(bgscrolly_w)
|
||||
AM_RANGE(0x03, 0x03) AM_WRITE(s_port3_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static INPUT_PORTS_START( sprcros2 )
|
||||
PORT_START("P1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("P2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("EXTRA")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("DSW1")
|
||||
PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
|
||||
PORT_DIPSETTING( 0x07, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( 1C_4C ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) )
|
||||
PORT_DIPSETTING( 0x05, DEF_STR( 1C_6C ) )
|
||||
PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("DSW2")
|
||||
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
|
||||
PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_UNUSED ) //unused coinage bits
|
||||
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Flip_Screen ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static const gfx_layout sprcros2_bglayout =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(1,3),
|
||||
3,
|
||||
{ RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
|
||||
{ STEP8(0,1) },
|
||||
{ STEP8(0,8) },
|
||||
8*8
|
||||
};
|
||||
|
||||
static const gfx_layout sprcros2_spritelayout =
|
||||
{
|
||||
32,32,
|
||||
RGN_FRAC(1,3),
|
||||
3,
|
||||
{ RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
|
||||
{ STEP8(0,1), STEP8(256,1), STEP8(512,1), STEP8(768,1) },
|
||||
{ STEP16(0,8), STEP16(128,8) },
|
||||
32*32
|
||||
};
|
||||
|
||||
static const gfx_layout sprcros2_fglayout =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(1,1),
|
||||
2,
|
||||
{ 0, 4 },
|
||||
{ STEP4(64,1), STEP4(0,1) },
|
||||
{ STEP8(0,8) },
|
||||
8*8*2
|
||||
};
|
||||
|
||||
static GFXDECODE_START( sprcros2 )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, sprcros2_bglayout, 0, 16 )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, sprcros2_spritelayout, 256, 6 )
|
||||
GFXDECODE_ENTRY( "gfx3", 0, sprcros2_fglayout, 512, 64 )
|
||||
GFXDECODE_END
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::m_interrupt)
|
||||
{
|
||||
int scanline = param;
|
||||
|
||||
if (scanline == 240)
|
||||
{
|
||||
if(m_port7&0x01)
|
||||
m_master->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
else if(scanline == 0)
|
||||
{
|
||||
if(m_port7&0x08)
|
||||
m_master->set_input_line(0, HOLD_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(sprcros2_state::s_interrupt)
|
||||
{
|
||||
if(m_s_port3&0x01)
|
||||
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
void sprcros2_state::machine_start()
|
||||
{
|
||||
membank("masterbank")->configure_entries(0, 2, memregion("master")->base() + 0x10000, 0x2000);
|
||||
membank("slavebank")->configure_entries(0, 2, memregion("slave")->base() + 0x10000, 0x2000);
|
||||
|
||||
save_item(NAME(m_port7));
|
||||
save_item(NAME(m_s_port3));
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( sprcros2, sprcros2_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("master", Z80,10000000/2)
|
||||
MCFG_CPU_PROGRAM_MAP(sprcros2_master_map)
|
||||
MCFG_CPU_IO_MAP(sprcros2_master_io_map)
|
||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sprcros2_state, m_interrupt, "screen", 0, 1)
|
||||
|
||||
MCFG_CPU_ADD("slave", Z80,10000000/2)
|
||||
MCFG_CPU_PROGRAM_MAP(sprcros2_slave_map)
|
||||
MCFG_CPU_IO_MAP(sprcros2_slave_io_map)
|
||||
MCFG_CPU_PERIODIC_INT_DRIVER(sprcros2_state, s_interrupt, 2*60) //2 nmis
|
||||
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(32*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(sprcros2_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", sprcros2)
|
||||
MCFG_PALETTE_ADD("palette", 768)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(32)
|
||||
MCFG_PALETTE_INIT_OWNER(sprcros2_state, sprcros2)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("sn1", SN76489, 10000000/4)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("sn2", SN76489, 10000000/4)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("sn3", SN76489, 10000000/4)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
ROM_START( sprcros2 )
|
||||
@ -303,15 +65,13 @@ ROM_START( sprcros2 )
|
||||
ROM_LOAD( "scm-03.10g", 0x00000, 0x4000, CRC(b9757908) SHA1(d59cb2aac1b6268fc766306850f5711d4a12d897) )
|
||||
ROM_LOAD( "scm-02.10j", 0x04000, 0x4000, CRC(849c5c87) SHA1(0e02c4990e371d6a290efa53301818e769648945) )
|
||||
ROM_LOAD( "scm-01.10k", 0x08000, 0x4000, CRC(385a62de) SHA1(847bf9d97ab3fa8949d9198e4e509948a940d6aa) )
|
||||
|
||||
ROM_LOAD( "scm-00.10l", 0x10000, 0x4000, CRC(13fa3684) SHA1(611b7a237e394f285dcc5beb027dacdbdd58a7a0) ) //banked into c000-dfff
|
||||
ROM_LOAD( "scm-00.10l", 0x10000, 0x4000, CRC(13fa3684) SHA1(611b7a237e394f285dcc5beb027dacdbdd58a7a0) )
|
||||
|
||||
ROM_REGION( 0x14000, "slave", 0 )
|
||||
ROM_LOAD( "scs-30.5f", 0x00000, 0x4000, CRC(c0a40e41) SHA1(e74131b353855749258dffa45091c825ccdbf05a) )
|
||||
ROM_LOAD( "scs-29.5h", 0x04000, 0x4000, CRC(83d49fa5) SHA1(7112110df2f382bbc0e651adcec975054a485b9b) )
|
||||
ROM_LOAD( "scs-28.5j", 0x08000, 0x4000, CRC(480d351f) SHA1(d1b86f441ae0e58b30e0f089ab25de219d5f30e3) )
|
||||
|
||||
ROM_LOAD( "scs-27.5k", 0x10000, 0x4000, CRC(2cf720cb) SHA1(a95c5b8c88371cf597bb7d80afeca6a48c7b74e6) ) //banked into c000-dfff
|
||||
ROM_LOAD( "scs-27.5k", 0x10000, 0x4000, CRC(2cf720cb) SHA1(a95c5b8c88371cf597bb7d80afeca6a48c7b74e6) )
|
||||
|
||||
ROM_REGION( 0xc000, "gfx1", 0 ) //bg
|
||||
ROM_LOAD( "scs-26.4b", 0x0000, 0x4000, CRC(f958b56d) SHA1(a1973179d336d2ba57294155550515f2b8a33a09) )
|
||||
@ -319,7 +79,7 @@ ROM_START( sprcros2 )
|
||||
ROM_LOAD( "scs-24.4e", 0x8000, 0x4000, CRC(87783c36) SHA1(7102be795afcddd76b4d41823e95c65fe1ffbca0) )
|
||||
|
||||
ROM_REGION( 0xc000, "gfx2", 0 )
|
||||
ROM_LOAD( "scm-23.5b", 0x0000, 0x4000, CRC(ab42f8e3) SHA1(8c2213b7c47a48e223fc3f7d323d16c0e4cd0457) ) //sprites
|
||||
ROM_LOAD( "scm-23.5b", 0x0000, 0x4000, CRC(ab42f8e3) SHA1(8c2213b7c47a48e223fc3f7d323d16c0e4cd0457) )
|
||||
ROM_LOAD( "scm-22.5e", 0x4000, 0x4000, CRC(0cad254c) SHA1(36e30e30b652b3a388a3c4a82251196f79368f59) )
|
||||
ROM_LOAD( "scm-21.5g", 0x8000, 0x4000, CRC(b6b68998) SHA1(cc3c6d996beeedcc7e5199f10d65c5b1d3c6e666) )
|
||||
|
||||
@ -327,28 +87,25 @@ ROM_START( sprcros2 )
|
||||
ROM_LOAD( "scm-20.5k", 0x0000, 0x4000, CRC(67a099a6) SHA1(43981abdcaa0ff36183027a3c691ce2df7f06ec7) )
|
||||
|
||||
ROM_REGION( 0x0420, "proms", 0 )
|
||||
ROM_LOAD( "sc-64.6a", 0x0000, 0x0020, CRC(336dd1c0) SHA1(f0a0d2c13617fd84ee55c0cb96643761a8735147) ) //palette
|
||||
ROM_LOAD( "sc-63.3b", 0x0020, 0x0100, CRC(9034a059) SHA1(1801965b4f0f3e04ca4b3faf0ba3a27dbb008474) ) //bg clut lo nibble
|
||||
ROM_LOAD( "sc-62.3a", 0x0120, 0x0100, CRC(3c78a14f) SHA1(8f9c196a3e18bdce2d4855bc285bd5bde534bf09) ) //bg clut hi nibble
|
||||
ROM_LOAD( "sc-61.5a", 0x0220, 0x0100, CRC(2f71185d) SHA1(974fbb52285f01f4353e9acb1992dcd6fdefedcb) ) //sprite clut
|
||||
ROM_LOAD( "sc-60.4k", 0x0320, 0x0100, CRC(d7a4e57d) SHA1(6db02ec6aa55b05422cb505e63c71e36b4b11b4a) ) //fg clut
|
||||
ROM_LOAD( "sc-64.6a", 0x0000, 0x0020, CRC(336dd1c0) SHA1(f0a0d2c13617fd84ee55c0cb96643761a8735147) )
|
||||
ROM_LOAD( "sc-63.3b", 0x0020, 0x0100, CRC(9034a059) SHA1(1801965b4f0f3e04ca4b3faf0ba3a27dbb008474) )
|
||||
ROM_LOAD( "sc-62.3a", 0x0120, 0x0100, CRC(3c78a14f) SHA1(8f9c196a3e18bdce2d4855bc285bd5bde534bf09) )
|
||||
ROM_LOAD( "sc-61.5a", 0x0220, 0x0100, CRC(2f71185d) SHA1(974fbb52285f01f4353e9acb1992dcd6fdefedcb) )
|
||||
ROM_LOAD( "sc-60.4k", 0x0320, 0x0100, CRC(d7a4e57d) SHA1(6db02ec6aa55b05422cb505e63c71e36b4b11b4a) )
|
||||
ROM_END
|
||||
|
||||
/* this is probably an old revision */
|
||||
ROM_START( sprcros2a )
|
||||
ROM_REGION( 0x14000, "master", 0 )
|
||||
ROM_LOAD( "15.bin", 0x00000, 0x4000, CRC(b9d02558) SHA1(775404c6c7648d9dab02b496541739ea700cd481) )
|
||||
ROM_LOAD( "scm-02.10j", 0x04000, 0x4000, CRC(849c5c87) SHA1(0e02c4990e371d6a290efa53301818e769648945) )
|
||||
ROM_LOAD( "scm-01.10k", 0x08000, 0x4000, CRC(385a62de) SHA1(847bf9d97ab3fa8949d9198e4e509948a940d6aa) )
|
||||
|
||||
ROM_LOAD( "scm-00.10l", 0x10000, 0x4000, CRC(13fa3684) SHA1(611b7a237e394f285dcc5beb027dacdbdd58a7a0) ) //banked into c000-dfff
|
||||
ROM_LOAD( "scm-00.10l", 0x10000, 0x4000, CRC(13fa3684) SHA1(611b7a237e394f285dcc5beb027dacdbdd58a7a0) )
|
||||
|
||||
ROM_REGION( 0x14000, "slave", 0 )
|
||||
ROM_LOAD( "scs-30.5f", 0x00000, 0x4000, CRC(c0a40e41) SHA1(e74131b353855749258dffa45091c825ccdbf05a) )
|
||||
ROM_LOAD( "scs-29.5h", 0x04000, 0x4000, CRC(83d49fa5) SHA1(7112110df2f382bbc0e651adcec975054a485b9b) )
|
||||
ROM_LOAD( "scs-28.5j", 0x08000, 0x4000, CRC(480d351f) SHA1(d1b86f441ae0e58b30e0f089ab25de219d5f30e3) )
|
||||
|
||||
ROM_LOAD( "scs-27.5k", 0x10000, 0x4000, CRC(2cf720cb) SHA1(a95c5b8c88371cf597bb7d80afeca6a48c7b74e6) ) //banked into c000-dfff
|
||||
ROM_LOAD( "scs-27.5k", 0x10000, 0x4000, CRC(2cf720cb) SHA1(a95c5b8c88371cf597bb7d80afeca6a48c7b74e6) )
|
||||
|
||||
ROM_REGION( 0xc000, "gfx1", 0 ) //bg
|
||||
ROM_LOAD( "scs-26.4b", 0x0000, 0x4000, CRC(f958b56d) SHA1(a1973179d336d2ba57294155550515f2b8a33a09) )
|
||||
@ -356,7 +113,7 @@ ROM_START( sprcros2a )
|
||||
ROM_LOAD( "scs-24.4e", 0x8000, 0x4000, CRC(87783c36) SHA1(7102be795afcddd76b4d41823e95c65fe1ffbca0) )
|
||||
|
||||
ROM_REGION( 0xc000, "gfx2", 0 )
|
||||
ROM_LOAD( "scm-23.5b", 0x0000, 0x4000, CRC(ab42f8e3) SHA1(8c2213b7c47a48e223fc3f7d323d16c0e4cd0457) ) //sprites
|
||||
ROM_LOAD( "scm-23.5b", 0x0000, 0x4000, CRC(ab42f8e3) SHA1(8c2213b7c47a48e223fc3f7d323d16c0e4cd0457) )
|
||||
ROM_LOAD( "scm-22.5e", 0x4000, 0x4000, CRC(0cad254c) SHA1(36e30e30b652b3a388a3c4a82251196f79368f59) )
|
||||
ROM_LOAD( "scm-21.5g", 0x8000, 0x4000, CRC(b6b68998) SHA1(cc3c6d996beeedcc7e5199f10d65c5b1d3c6e666) )
|
||||
|
||||
@ -364,12 +121,12 @@ ROM_START( sprcros2a )
|
||||
ROM_LOAD( "scm-20.5k", 0x0000, 0x4000, CRC(67a099a6) SHA1(43981abdcaa0ff36183027a3c691ce2df7f06ec7) )
|
||||
|
||||
ROM_REGION( 0x0420, "proms", 0 )
|
||||
ROM_LOAD( "sc-64.6a", 0x0000, 0x0020, CRC(336dd1c0) SHA1(f0a0d2c13617fd84ee55c0cb96643761a8735147) ) //palette
|
||||
ROM_LOAD( "sc-63.3b", 0x0020, 0x0100, CRC(9034a059) SHA1(1801965b4f0f3e04ca4b3faf0ba3a27dbb008474) ) //bg clut lo nibble
|
||||
ROM_LOAD( "sc-62.3a", 0x0120, 0x0100, CRC(3c78a14f) SHA1(8f9c196a3e18bdce2d4855bc285bd5bde534bf09) ) //bg clut hi nibble
|
||||
ROM_LOAD( "sc-61.5a", 0x0220, 0x0100, CRC(2f71185d) SHA1(974fbb52285f01f4353e9acb1992dcd6fdefedcb) ) //sprite clut
|
||||
ROM_LOAD( "sc-60.4k", 0x0320, 0x0100, CRC(d7a4e57d) SHA1(6db02ec6aa55b05422cb505e63c71e36b4b11b4a) ) //fg clut
|
||||
ROM_LOAD( "sc-64.6a", 0x0000, 0x0020, CRC(336dd1c0) SHA1(f0a0d2c13617fd84ee55c0cb96643761a8735147) )
|
||||
ROM_LOAD( "sc-63.3b", 0x0020, 0x0100, CRC(9034a059) SHA1(1801965b4f0f3e04ca4b3faf0ba3a27dbb008474) )
|
||||
ROM_LOAD( "sc-62.3a", 0x0120, 0x0100, CRC(3c78a14f) SHA1(8f9c196a3e18bdce2d4855bc285bd5bde534bf09) )
|
||||
ROM_LOAD( "sc-61.5a", 0x0220, 0x0100, CRC(2f71185d) SHA1(974fbb52285f01f4353e9acb1992dcd6fdefedcb) )
|
||||
ROM_LOAD( "sc-60.4k", 0x0320, 0x0100, CRC(d7a4e57d) SHA1(6db02ec6aa55b05422cb505e63c71e36b4b11b4a) )
|
||||
ROM_END
|
||||
|
||||
GAME( 1986, sprcros2, 0, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1986, sprcros2a,sprcros2, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1986, sprcros2, 0, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 1)", MACHINE_IS_SKELETON )
|
||||
GAME( 1986, sprcros2a,sprcros2, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 2)", MACHINE_IS_SKELETON )
|
||||
|
@ -1,44 +0,0 @@
|
||||
// license:???
|
||||
// copyright-holders:insideoutboy, Nicola Salmoria
|
||||
/***************************************************************************
|
||||
|
||||
Car Jamboree
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
class carjmbre_state : public driver_device
|
||||
{
|
||||
public:
|
||||
carjmbre_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
required_shared_ptr<UINT8> m_spriteram;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_cj_tilemap;
|
||||
UINT8 m_flipscreen;
|
||||
UINT16 m_bgcolor;
|
||||
|
||||
UINT8 m_nmi_mask;
|
||||
DECLARE_WRITE8_MEMBER(nmi_mask_w);
|
||||
DECLARE_WRITE8_MEMBER(carjmbre_flipscreen_w);
|
||||
DECLARE_WRITE8_MEMBER(carjmbre_bgcolor_w);
|
||||
DECLARE_WRITE8_MEMBER(carjmbre_8806_w);
|
||||
DECLARE_WRITE8_MEMBER(carjmbre_videoram_w);
|
||||
TILE_GET_INFO_MEMBER(get_carjmbre_tile_info);
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
DECLARE_PALETTE_INIT(carjmbre);
|
||||
UINT32 screen_update_carjmbre(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(vblank_irq);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
@ -1,126 +0,0 @@
|
||||
// license:???
|
||||
// copyright-holders:insideoutboy, David Haywood, Stephh
|
||||
class flower_state : public driver_device
|
||||
{
|
||||
public:
|
||||
flower_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_sn_nmi_enable(*this, "sn_nmi_enable"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_textram(*this, "textram"),
|
||||
m_bg0ram(*this, "bg0ram"),
|
||||
m_bg1ram(*this, "bg1ram"),
|
||||
m_bg0_scroll(*this, "bg0_scroll"),
|
||||
m_bg1_scroll(*this, "bg1_scroll"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_subcpu(*this, "subcpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
|
||||
required_shared_ptr<UINT8> m_sn_nmi_enable;
|
||||
required_shared_ptr<UINT8> m_spriteram;
|
||||
required_shared_ptr<UINT8> m_textram;
|
||||
required_shared_ptr<UINT8> m_bg0ram;
|
||||
required_shared_ptr<UINT8> m_bg1ram;
|
||||
required_shared_ptr<UINT8> m_bg0_scroll;
|
||||
required_shared_ptr<UINT8> m_bg1_scroll;
|
||||
tilemap_t *m_bg0_tilemap;
|
||||
tilemap_t *m_bg1_tilemap;
|
||||
tilemap_t *m_text_tilemap;
|
||||
tilemap_t *m_text_right_tilemap;
|
||||
DECLARE_WRITE8_MEMBER(flower_maincpu_irq_ack);
|
||||
DECLARE_WRITE8_MEMBER(flower_subcpu_irq_ack);
|
||||
DECLARE_WRITE8_MEMBER(flower_soundcpu_irq_ack);
|
||||
DECLARE_WRITE8_MEMBER(flower_coin_counter_w);
|
||||
DECLARE_WRITE8_MEMBER(flower_coin_lockout_w);
|
||||
DECLARE_WRITE8_MEMBER(sound_command_w);
|
||||
DECLARE_WRITE8_MEMBER(flower_textram_w);
|
||||
DECLARE_WRITE8_MEMBER(flower_bg0ram_w);
|
||||
DECLARE_WRITE8_MEMBER(flower_bg1ram_w);
|
||||
DECLARE_WRITE8_MEMBER(flower_flipscreen_w);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
|
||||
TILE_GET_INFO_MEMBER(get_bg0_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg1_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_text_tile_info);
|
||||
virtual void video_start() override;
|
||||
UINT32 screen_update_flower(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<cpu_device> m_subcpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
||||
|
||||
// ======================> flower_sound_device
|
||||
|
||||
|
||||
/* this structure defines the parameters for a channel */
|
||||
struct flower_sound_channel
|
||||
{
|
||||
UINT32 start;
|
||||
UINT32 pos;
|
||||
UINT16 freq;
|
||||
UINT8 volume;
|
||||
UINT8 voltab;
|
||||
UINT8 oneshot;
|
||||
UINT8 active;
|
||||
UINT8 effect;
|
||||
UINT32 ecount;
|
||||
|
||||
};
|
||||
|
||||
class flower_sound_device : public device_t,
|
||||
public device_sound_interface
|
||||
{
|
||||
public:
|
||||
flower_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
~flower_sound_device() {}
|
||||
|
||||
enum
|
||||
{
|
||||
TIMER_CLOCK_EFFECT
|
||||
};
|
||||
|
||||
DECLARE_WRITE8_MEMBER( sound1_w );
|
||||
DECLARE_WRITE8_MEMBER( sound2_w );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
|
||||
|
||||
private:
|
||||
void make_mixer_table(int voices, int gain);
|
||||
|
||||
// internal state
|
||||
emu_timer *m_effect_timer;
|
||||
|
||||
/* data about the sound system */
|
||||
flower_sound_channel m_channel_list[8];
|
||||
flower_sound_channel *m_last_channel;
|
||||
|
||||
/* global sound parameters */
|
||||
const UINT8 *m_sample_rom;
|
||||
const UINT8 *m_volume_rom;
|
||||
sound_stream * m_stream;
|
||||
|
||||
/* mixer tables and internal buffers */
|
||||
std::unique_ptr<INT16[]> m_mixer_table;
|
||||
INT16 *m_mixer_lookup;
|
||||
std::unique_ptr<short[]> m_mixer_buffer;
|
||||
|
||||
UINT8 m_soundregs1[0x40];
|
||||
UINT8 m_soundregs2[0x40];
|
||||
|
||||
};
|
||||
|
||||
extern const device_type FLOWER;
|
@ -1,71 +0,0 @@
|
||||
// license:???
|
||||
// copyright-holders:David Haywood,insideoutboy, Pierpaolo Prazzoli
|
||||
/***************************************************************************
|
||||
|
||||
Popper
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
class popper_state : public driver_device
|
||||
{
|
||||
public:
|
||||
popper_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_ol_videoram(*this, "ol_videoram"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_ol_attribram(*this, "ol_attribram"),
|
||||
m_attribram(*this, "attribram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_palette(*this, "palette") { }
|
||||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_ol_videoram;
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
required_shared_ptr<UINT8> m_ol_attribram;
|
||||
required_shared_ptr<UINT8> m_attribram;
|
||||
required_shared_ptr<UINT8> m_spriteram;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_p123_tilemap;
|
||||
tilemap_t *m_p0_tilemap;
|
||||
tilemap_t *m_ol_p123_tilemap;
|
||||
tilemap_t *m_ol_p0_tilemap;
|
||||
INT32 m_flipscreen;
|
||||
INT32 m_e002;
|
||||
INT32 m_gfx_bank;
|
||||
rectangle m_tilemap_clip;
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
|
||||
UINT8 m_nmi_mask;
|
||||
DECLARE_READ8_MEMBER(popper_input_ports_r);
|
||||
DECLARE_READ8_MEMBER(popper_soundcpu_nmi_r);
|
||||
DECLARE_WRITE8_MEMBER(nmi_mask_w);
|
||||
DECLARE_WRITE8_MEMBER(popper_ol_videoram_w);
|
||||
DECLARE_WRITE8_MEMBER(popper_videoram_w);
|
||||
DECLARE_WRITE8_MEMBER(popper_ol_attribram_w);
|
||||
DECLARE_WRITE8_MEMBER(popper_attribram_w);
|
||||
DECLARE_WRITE8_MEMBER(popper_flipscreen_w);
|
||||
DECLARE_WRITE8_MEMBER(popper_e002_w);
|
||||
DECLARE_WRITE8_MEMBER(popper_gfx_bank_w);
|
||||
TILE_GET_INFO_MEMBER(get_popper_p123_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_popper_p0_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_popper_ol_p123_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_popper_ol_p0_tile_info);
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
DECLARE_PALETTE_INIT(popper);
|
||||
UINT32 screen_update_popper(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(vblank_irq);
|
||||
void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
@ -1,156 +0,0 @@
|
||||
// license:???
|
||||
// copyright-holders:insideoutboy, Nicola Salmoria
|
||||
/***************************************************************************
|
||||
|
||||
Car Jamboree
|
||||
Omori Electric CAD (OEC) 1983
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/resnet.h"
|
||||
#include "includes/carjmbre.h"
|
||||
|
||||
// palette info from Popper (OEC 1983, very similar video hw)
|
||||
static const res_net_decode_info carjmbre_decode_info =
|
||||
{
|
||||
1, // there may be two proms needed to construct color
|
||||
0, 63, // start/end
|
||||
// R, G, B,
|
||||
{ 0, 0, 0, }, // offsets
|
||||
{ 0, 3, 6, }, // shifts
|
||||
{0x07,0x07,0x03, } // masks
|
||||
};
|
||||
|
||||
static const res_net_info carjmbre_net_info =
|
||||
{
|
||||
RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_TTL_OUT,
|
||||
{
|
||||
{ RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } },
|
||||
{ RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } },
|
||||
{ RES_NET_AMP_NONE, 0, 0, 2, { 470, 220, 0 } }
|
||||
}
|
||||
};
|
||||
|
||||
PALETTE_INIT_MEMBER(carjmbre_state, carjmbre)
|
||||
{
|
||||
const UINT8 *color_prom = memregion("proms")->base();
|
||||
std::vector<rgb_t> rgb;
|
||||
|
||||
compute_res_net_all(rgb, color_prom, carjmbre_decode_info, carjmbre_net_info);
|
||||
palette.set_pen_colors(0, rgb);
|
||||
palette.palette()->normalize_range(0, 63);
|
||||
}
|
||||
|
||||
|
||||
|
||||
WRITE8_MEMBER(carjmbre_state::carjmbre_flipscreen_w)
|
||||
{
|
||||
m_flipscreen = (data & 1) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
|
||||
machine().tilemap().set_flip_all(m_flipscreen);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(carjmbre_state::carjmbre_bgcolor_w)
|
||||
{
|
||||
data = ~data & 0x3f;
|
||||
|
||||
if (data != m_bgcolor)
|
||||
{
|
||||
int i;
|
||||
|
||||
m_bgcolor = data;
|
||||
if (data & 3)
|
||||
for (i = 0; i < 64; i += 4)
|
||||
m_palette->set_pen_color(i, data);
|
||||
else
|
||||
// restore to initial state (black)
|
||||
for (i = 0; i < 64; i += 4)
|
||||
m_palette->set_pen_color(i, rgb_t::black);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(carjmbre_state::carjmbre_8806_w)
|
||||
{
|
||||
// unknown, gets updated at same time as carjmbre_bgcolor_w
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(carjmbre_state::carjmbre_videoram_w)
|
||||
{
|
||||
m_videoram[offset] = data;
|
||||
m_cj_tilemap->mark_tile_dirty(offset & 0x3ff);
|
||||
}
|
||||
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(carjmbre_state::get_carjmbre_tile_info)
|
||||
{
|
||||
UINT32 tile_number = m_videoram[tile_index] & 0xff;
|
||||
UINT8 attr = m_videoram[tile_index + 0x400];
|
||||
tile_number += (attr & 0x80) << 1; /* bank */
|
||||
|
||||
SET_TILE_INFO_MEMBER(0,
|
||||
tile_number,
|
||||
attr & 0xf,
|
||||
0);
|
||||
}
|
||||
|
||||
void carjmbre_state::video_start()
|
||||
{
|
||||
m_cj_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(carjmbre_state::get_carjmbre_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
|
||||
save_item(NAME(m_flipscreen));
|
||||
save_item(NAME(m_bgcolor));
|
||||
}
|
||||
|
||||
UINT32 carjmbre_state::screen_update_carjmbre(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int offs, troffs, sx, sy, flipx, flipy;
|
||||
|
||||
//colorram
|
||||
//76543210
|
||||
//x------- graphic bank
|
||||
//-xxx---- unused
|
||||
//----xxxx colour
|
||||
|
||||
m_cj_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
|
||||
//spriteram[offs]
|
||||
//+0 y pos
|
||||
//+1 sprite number
|
||||
//+2
|
||||
//76543210
|
||||
//x------- flipy
|
||||
//-x------ flipx
|
||||
//--xx---- unused
|
||||
//----xxxx colour
|
||||
//+3 x pos
|
||||
for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
|
||||
{
|
||||
//before copying the sprites to spriteram the game reorders the first
|
||||
//sprite to last, sprite ordering is incorrect if this isn't undone
|
||||
troffs = (offs - 4 + m_spriteram.bytes()) % m_spriteram.bytes();
|
||||
|
||||
//unused sprites are marked with ypos <= 0x02 (or >= 0xfd if screen flipped)
|
||||
if (m_spriteram[troffs] > 0x02 && m_spriteram[troffs] < 0xfd)
|
||||
{
|
||||
sx = m_spriteram[troffs + 3] - 7;
|
||||
sy = 241 - m_spriteram[troffs];
|
||||
flipx = (m_spriteram[troffs + 2] & 0x40) >> 6;
|
||||
flipy = (m_spriteram[troffs + 2] & 0x80) >> 7;
|
||||
|
||||
if (m_flipscreen)
|
||||
{
|
||||
sx = (256 + (226 - sx)) % 256;
|
||||
sy = 242 - sy;
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
|
||||
m_spriteram[troffs + 1],
|
||||
m_spriteram[troffs + 2] & 0xf,
|
||||
flipx,flipy,
|
||||
sx,sy,0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,192 +0,0 @@
|
||||
// license:???
|
||||
// copyright-holders:insideoutboy, David Haywood, Stephh
|
||||
/* Flower Video Hardware */
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/flower.h"
|
||||
|
||||
|
||||
void flower_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
gfx_element *gfx = m_gfxdecode->gfx(1);
|
||||
UINT8 *source = m_spriteram + 0x200;
|
||||
UINT8 *finish = source - 0x200;
|
||||
|
||||
source -= 8;
|
||||
|
||||
while( source>=finish )
|
||||
{
|
||||
int xblock,yblock;
|
||||
int sy = 256-32-source[0]+1;
|
||||
int sx = (source[4]|(source[5]<<8))-55;
|
||||
int code = source[1] & 0x3f;
|
||||
int color = (source[6]>>4);
|
||||
|
||||
/*
|
||||
Byte 0: Y
|
||||
Byte 1:
|
||||
0x80 - FlipY
|
||||
0x40 - FlipX
|
||||
0x3f - Tile
|
||||
Byte 2:
|
||||
0x08 - Tile MSB
|
||||
0x01 - Tile MSB
|
||||
Byte 3:
|
||||
0x07 - X Zoom
|
||||
0x08 - X Size
|
||||
0x70 - Y Zoom
|
||||
0x80 - Y Size
|
||||
Byte 4: X LSB
|
||||
Byte 5: X MSB
|
||||
Byte 6:
|
||||
0xf0 - Colour
|
||||
*/
|
||||
|
||||
int flipy = source[1] & 0x80;
|
||||
int flipx = source[1] & 0x40;
|
||||
|
||||
int size = source[3];
|
||||
|
||||
int xsize = ((size & 0x08)>>3);
|
||||
int ysize = ((size & 0x80)>>7);
|
||||
|
||||
xsize++;
|
||||
ysize++;
|
||||
|
||||
if (ysize==2) sy -= 16;
|
||||
|
||||
code |= ((source[2] & 0x01) << 6);
|
||||
code |= ((source[2] & 0x08) << 4);
|
||||
|
||||
if(flip_screen())
|
||||
{
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
sx = sx+16;
|
||||
sy = 250-sy;
|
||||
|
||||
if (ysize==2) sy += 16;
|
||||
}
|
||||
|
||||
for (xblock = 0; xblock<xsize; xblock++)
|
||||
{
|
||||
int xoffs=!flipx ? (xblock*8) : ((xsize-xblock-1)*8);
|
||||
int zoomx=((size&7)+1)<<13;
|
||||
int zoomy=((size&0x70)+0x10)<<9;
|
||||
int xblocksizeinpixels=(zoomx*16)>>16;
|
||||
int yblocksizeinpixels=(zoomy*16)>>16;
|
||||
|
||||
for (yblock = 0; yblock<ysize; yblock++)
|
||||
{
|
||||
int yoffs=!flipy ? yblock : (ysize-yblock-1);
|
||||
int sxoffs=(16-xblocksizeinpixels)/2;
|
||||
int syoffs=(16-yblocksizeinpixels)/2;
|
||||
if (xblock) sxoffs+=xblocksizeinpixels;
|
||||
if (yblock) syoffs+=yblocksizeinpixels;
|
||||
|
||||
gfx->zoom_transpen(bitmap,cliprect,
|
||||
code+yoffs+xoffs,
|
||||
color,
|
||||
flipx,flipy,
|
||||
sx+sxoffs,sy+syoffs,
|
||||
zoomx,zoomy,15);
|
||||
}
|
||||
}
|
||||
source -= 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(flower_state::get_bg0_tile_info)
|
||||
{
|
||||
int code = m_bg0ram[tile_index];
|
||||
int color = m_bg0ram[tile_index+0x100];
|
||||
/* Todo - may be tile flip bits? */
|
||||
|
||||
SET_TILE_INFO_MEMBER(2, code, color>>4, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(flower_state::get_bg1_tile_info)
|
||||
{
|
||||
int code = m_bg1ram[tile_index];
|
||||
int color = m_bg1ram[tile_index+0x100];
|
||||
/* Todo - may be tile flip bits? */
|
||||
|
||||
SET_TILE_INFO_MEMBER(2, code, color>>4, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(flower_state::get_text_tile_info)
|
||||
{
|
||||
int code = m_textram[tile_index];
|
||||
int color = m_textram[tile_index+0x400];
|
||||
/* Todo - may be tile flip bits? */
|
||||
|
||||
SET_TILE_INFO_MEMBER(0, code, color>>2, 0);
|
||||
}
|
||||
|
||||
void flower_state::video_start()
|
||||
{
|
||||
m_bg0_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(flower_state::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS,16,16,16,16);
|
||||
m_bg1_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(flower_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS,16,16,16,16);
|
||||
m_text_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(flower_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
|
||||
m_text_right_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(flower_state::get_text_tile_info),this),TILEMAP_SCAN_COLS, 8, 8, 2,32);
|
||||
|
||||
m_bg1_tilemap->set_transparent_pen(15);
|
||||
m_text_tilemap->set_transparent_pen(3);
|
||||
m_text_right_tilemap->set_transparent_pen(3);
|
||||
|
||||
m_text_tilemap->set_scrolly(0, 16);
|
||||
m_text_right_tilemap->set_scrolly(0, 16);
|
||||
}
|
||||
|
||||
UINT32 flower_state::screen_update_flower(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
rectangle myclip = cliprect;
|
||||
|
||||
m_bg0_tilemap->set_scrolly(0, m_bg0_scroll[0]+16);
|
||||
m_bg1_tilemap->set_scrolly(0, m_bg1_scroll[0]+16);
|
||||
|
||||
m_bg0_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_bg1_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
|
||||
draw_sprites(bitmap,cliprect);
|
||||
|
||||
if(flip_screen())
|
||||
{
|
||||
myclip.min_x = cliprect.min_x;
|
||||
myclip.max_x = cliprect.min_x + 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
myclip.min_x = cliprect.max_x - 15;
|
||||
myclip.max_x = cliprect.max_x;
|
||||
}
|
||||
|
||||
m_text_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
m_text_right_tilemap->draw(screen, bitmap, myclip, 0,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_textram_w)
|
||||
{
|
||||
m_textram[offset] = data;
|
||||
m_text_tilemap->mark_tile_dirty(offset);
|
||||
m_text_right_tilemap->mark_all_dirty();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_bg0ram_w)
|
||||
{
|
||||
m_bg0ram[offset] = data;
|
||||
m_bg0_tilemap->mark_tile_dirty(offset & 0x1ff);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_bg1ram_w)
|
||||
{
|
||||
m_bg1ram[offset] = data;
|
||||
m_bg1_tilemap->mark_tile_dirty(offset & 0x1ff);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(flower_state::flower_flipscreen_w)
|
||||
{
|
||||
flip_screen_set(data);
|
||||
}
|
@ -1,245 +0,0 @@
|
||||
// license:???
|
||||
// copyright-holders:David Haywood,insideoutboy, Pierpaolo Prazzoli
|
||||
/***************************************************************************
|
||||
|
||||
Popper
|
||||
|
||||
Omori Electric CAD (OEC) 1983
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/resnet.h"
|
||||
#include "includes/popper.h"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* Color guns - from schematics
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static const res_net_decode_info popper_decode_info =
|
||||
{
|
||||
1, // there may be two proms needed to construct color
|
||||
0, // start at 0
|
||||
63, // end at 255
|
||||
// R, G, B,
|
||||
{ 0, 0, 0, }, // offsets
|
||||
{ 0, 3, 6, }, // shifts
|
||||
{0x07,0x07,0x03, } // masks
|
||||
};
|
||||
|
||||
static const res_net_info popper_net_info =
|
||||
{
|
||||
RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_TTL_OUT,
|
||||
{
|
||||
{ RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } },
|
||||
{ RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } },
|
||||
{ RES_NET_AMP_NONE, 0, 0, 2, { 470, 220, 0 } }
|
||||
}
|
||||
};
|
||||
|
||||
PALETTE_INIT_MEMBER(popper_state, popper)
|
||||
{
|
||||
const UINT8 *color_prom = memregion("proms")->base();
|
||||
std::vector<rgb_t> rgb;
|
||||
|
||||
compute_res_net_all(rgb, color_prom, popper_decode_info, popper_net_info);
|
||||
palette.set_pen_colors(0, rgb);
|
||||
palette.palette()->normalize_range(0, 63);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(popper_state::popper_ol_videoram_w)
|
||||
{
|
||||
m_ol_videoram[offset] = data;
|
||||
m_ol_p123_tilemap->mark_tile_dirty(offset);
|
||||
m_ol_p0_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(popper_state::popper_videoram_w)
|
||||
{
|
||||
m_videoram[offset] = data;
|
||||
m_p123_tilemap->mark_tile_dirty(offset);
|
||||
m_p0_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(popper_state::popper_ol_attribram_w)
|
||||
{
|
||||
m_ol_attribram[offset] = data;
|
||||
m_ol_p123_tilemap->mark_tile_dirty(offset);
|
||||
m_ol_p0_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(popper_state::popper_attribram_w)
|
||||
{
|
||||
m_attribram[offset] = data;
|
||||
m_p123_tilemap->mark_tile_dirty(offset);
|
||||
m_p0_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(popper_state::popper_flipscreen_w)
|
||||
{
|
||||
m_flipscreen = data;
|
||||
machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
|
||||
|
||||
if (m_flipscreen)
|
||||
m_tilemap_clip.min_x = m_tilemap_clip.max_x - 15;
|
||||
else
|
||||
m_tilemap_clip.max_x = 15;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(popper_state::popper_e002_w)
|
||||
{
|
||||
m_e002 = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(popper_state::popper_gfx_bank_w)
|
||||
{
|
||||
if (m_gfx_bank != data)
|
||||
{
|
||||
m_gfx_bank = data;
|
||||
machine().tilemap().mark_all_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(popper_state::get_popper_p123_tile_info)
|
||||
{
|
||||
UINT32 tile_number = m_videoram[tile_index];
|
||||
UINT8 attr = m_attribram[tile_index];
|
||||
tile_number += m_gfx_bank << 8;
|
||||
|
||||
SET_TILE_INFO_MEMBER(0,
|
||||
tile_number,
|
||||
(attr & 0xf),
|
||||
0);
|
||||
tileinfo.group = (attr & 0x80) >> 7;
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(popper_state::get_popper_p0_tile_info)
|
||||
{
|
||||
UINT32 tile_number = m_videoram[tile_index];
|
||||
UINT8 attr = m_attribram[tile_index];
|
||||
tile_number += m_gfx_bank << 8;
|
||||
|
||||
//pen 0 only in front if colour set as well
|
||||
tileinfo.group = (attr & 0x70) ? ((attr & 0x80) >> 7) : 0;
|
||||
|
||||
SET_TILE_INFO_MEMBER(0,
|
||||
tile_number,
|
||||
((attr & 0x70) >> 4) + 8,
|
||||
0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(popper_state::get_popper_ol_p123_tile_info)
|
||||
{
|
||||
UINT32 tile_number = m_ol_videoram[tile_index];
|
||||
UINT8 attr = m_ol_attribram[tile_index];
|
||||
tile_number += m_gfx_bank << 8;
|
||||
|
||||
SET_TILE_INFO_MEMBER(0,
|
||||
tile_number,
|
||||
(attr & 0xf),
|
||||
0);
|
||||
tileinfo.group = (attr & 0x80) >> 7;
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(popper_state::get_popper_ol_p0_tile_info)
|
||||
{
|
||||
UINT32 tile_number = m_ol_videoram[tile_index];
|
||||
UINT8 attr = m_ol_attribram[tile_index];
|
||||
tile_number += m_gfx_bank << 8;
|
||||
|
||||
//pen 0 only in front if colour set as well
|
||||
tileinfo.group = (attr & 0x70) ? ((attr & 0x80) >> 7) : 0;
|
||||
|
||||
SET_TILE_INFO_MEMBER(0,
|
||||
tile_number,
|
||||
((attr & 0x70) >> 4) + 8,
|
||||
0);
|
||||
}
|
||||
|
||||
void popper_state::video_start()
|
||||
{
|
||||
m_p123_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(popper_state::get_popper_p123_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 33, 32 );
|
||||
m_p0_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(popper_state::get_popper_p0_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 33, 32);
|
||||
m_ol_p123_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(popper_state::get_popper_ol_p123_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 2, 32);
|
||||
m_ol_p0_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(popper_state::get_popper_ol_p0_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 2, 32);
|
||||
|
||||
m_p123_tilemap->set_transmask(0, 0x0f, 0x01);
|
||||
m_p123_tilemap->set_transmask(1, 0x01, 0x0f);
|
||||
m_p0_tilemap->set_transmask(0, 0x0f, 0x0e);
|
||||
m_p0_tilemap->set_transmask(1, 0x0e, 0x0f);
|
||||
m_ol_p123_tilemap->set_transmask(0, 0x0f, 0x01);
|
||||
m_ol_p123_tilemap->set_transmask(1, 0x01, 0x0f);
|
||||
m_ol_p0_tilemap->set_transmask(0, 0x0f, 0x0e);
|
||||
m_ol_p0_tilemap->set_transmask(1, 0x0e, 0x0f);
|
||||
|
||||
m_tilemap_clip = m_screen->visible_area();
|
||||
}
|
||||
|
||||
void popper_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect )
|
||||
{
|
||||
int offs, sx, sy, flipx, flipy;
|
||||
|
||||
for (offs = 0; offs < m_spriteram.bytes() - 4; offs += 4)
|
||||
{
|
||||
//if y position is in the current strip
|
||||
if (m_spriteram[offs + 1] && (((m_spriteram[offs] + (m_flipscreen ? 2 : 0)) & 0xf0) == (0x0f - offs / 0x80) << 4))
|
||||
{
|
||||
//offs y pos
|
||||
//offs+1 sprite number
|
||||
//offs+2
|
||||
//76543210
|
||||
//x------- flipy
|
||||
//-x------ flipx
|
||||
//--xx---- unused
|
||||
//----xxxx colour
|
||||
//offs+3 x pos
|
||||
|
||||
sx = m_spriteram[offs + 3];
|
||||
sy = 240 - m_spriteram[offs];
|
||||
flipx = (m_spriteram[offs + 2] & 0x40) >> 6;
|
||||
flipy = (m_spriteram[offs + 2] & 0x80) >> 7;
|
||||
|
||||
if (m_flipscreen)
|
||||
{
|
||||
sx = 248 - sx;
|
||||
sy = 242 - sy;
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
|
||||
m_spriteram[offs + 1],
|
||||
(m_spriteram[offs + 2] & 0x0f),
|
||||
flipx,flipy,
|
||||
sx,sy,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 popper_state::screen_update_popper(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
rectangle finalclip = m_tilemap_clip;
|
||||
finalclip &= cliprect;
|
||||
|
||||
//attribram
|
||||
//76543210
|
||||
//x------- draw over sprites
|
||||
//-xxx---- colour for pen 0 (from second prom?)
|
||||
//----xxxx colour for pens 1,2,3
|
||||
|
||||
m_p123_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
|
||||
m_p0_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
|
||||
m_ol_p123_tilemap->draw(screen, bitmap, finalclip, TILEMAP_DRAW_LAYER1, 0);
|
||||
m_ol_p0_tilemap->draw(screen, bitmap, finalclip, TILEMAP_DRAW_LAYER1, 0);
|
||||
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
||||
m_p123_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
|
||||
m_p0_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
|
||||
m_ol_p123_tilemap->draw(screen, bitmap, finalclip, TILEMAP_DRAW_LAYER0, 0);
|
||||
m_ol_p0_tilemap->draw(screen, bitmap, finalclip, TILEMAP_DRAW_LAYER0, 0);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user