mirror of
https://github.com/holub/mame
synced 2025-04-09 18:17:44 +03:00
- hash/kpython2.xml: updated the cdrom references to dvdrom (interface, diskarea and part names)
- atari/cyberbal.cpp, atari/dragrace.cpp: consolidated drivers in single files
This commit is contained in:
parent
afae86e180
commit
e975a64abb
@ -12,8 +12,8 @@ license:CC0-1.0
|
||||
<description>GuitarFreaks V2 (JAA/AAA)</description>
|
||||
<year>2005</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="f03jaa03" sha1="4efd2b6cc771ce2ccb3f266803f1c71e804f793f" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -23,8 +23,8 @@ license:CC0-1.0
|
||||
<description>DrumMania V2 (JAA/AAA)</description>
|
||||
<year>2005</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="f02jaa03" sha1="f2d05ca3e1b6bedf528fe1b79cd180de319d90a1" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -34,8 +34,8 @@ license:CC0-1.0
|
||||
<description>GuitarFreaks V2 Version 1.01 (JAA/AAA)</description>
|
||||
<year>2005</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="f03jab03" sha1="bf751781d64f561ce5e7b8a5be5974b299301c14" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -45,8 +45,8 @@ license:CC0-1.0
|
||||
<description>DrumMania V2 Version 1.01 (JAA/AAA)</description>
|
||||
<year>2005</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="f02jab03" sha1="e925fc7439386f317749adf8100b56c4e2f8125d" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -56,8 +56,8 @@ license:CC0-1.0
|
||||
<description>GuitarFreaks V3 (JAA/AAA)</description>
|
||||
<year>2006</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="f33jaa03" sha1="58cd27f49dbdf9fd449adf1d8bc8ec99ea8f03e7" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -67,8 +67,8 @@ license:CC0-1.0
|
||||
<description>DrumMania V3 (JAA/AAA)</description>
|
||||
<year>2006</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="f32jaa03" sha1="f8162037cf7645d1e9787636ce2b583176e920df" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -78,8 +78,8 @@ license:CC0-1.0
|
||||
<description>Dance Dance Revolution SuperNOVA Install Disk (UAA)</description>
|
||||
<year>2006</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="fdhuaa03" sha1="476bd58f4d68d2d14568d24d2d3ee1a67a04576d" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -89,8 +89,8 @@ license:CC0-1.0
|
||||
<description>Dancing Stage SuperNOVA Install Disk (EAA)</description>
|
||||
<year>2006</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="fdheaa03" sha1="b2cb31716bf98b09cdef4dae99658b43e7e53dd5" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -100,8 +100,8 @@ license:CC0-1.0
|
||||
<description>Dance Dance Revolution SuperNOVA 2 Install Disk (JAA/AAA)</description>
|
||||
<year>2007</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="gdjjaa03" sha1="3ccf04f254df88b9aed8c1ef4214cd62a1927f97" />
|
||||
</diskarea>
|
||||
</part>
|
||||
@ -111,8 +111,8 @@ license:CC0-1.0
|
||||
<description>Dance Dance Revolution SuperNOVA 2 Install Disk (UAA)</description>
|
||||
<year>2007</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cdrom1" interface="cdrom">
|
||||
<diskarea name="cdrom">
|
||||
<part name="dvdrom1" interface="dvdrom">
|
||||
<diskarea name="dvdrom">
|
||||
<disk name="gdjuaa03" sha1="67d93c426d60b042432440cb5ac076987f73dbf5" />
|
||||
</diskarea>
|
||||
</part>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,148 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
/*************************************************************************
|
||||
|
||||
Atari Cyberball hardware
|
||||
|
||||
*************************************************************************/
|
||||
#ifndef MAME_ATARI_CYBERBAL_H
|
||||
#define MAME_ATARI_CYBERBAL_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "slapstic.h"
|
||||
#include "atarijsa.h"
|
||||
#include "atarisac.h"
|
||||
#include "atarimo.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/timer.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
class cyberbal_base_state : public driver_device
|
||||
{
|
||||
protected:
|
||||
cyberbal_base_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_playfield(*this, "playfield"),
|
||||
m_alpha(*this, "alpha"),
|
||||
m_mob(*this, "mob")
|
||||
{ }
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_alpha_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_playfield_tile_info);
|
||||
|
||||
virtual void video_start() override;
|
||||
|
||||
void scanline_update_one(screen_device &screen, int scanline, int i, tilemap_t &curplayfield, tilemap_device &curalpha);
|
||||
uint32_t update_one_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, atari_motion_objects_device &curmob, tilemap_t &curplayfield, tilemap_t &curalpha);
|
||||
|
||||
static const atari_motion_objects_config s_mob_config;
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<tilemap_device> m_playfield;
|
||||
required_device<tilemap_device> m_alpha;
|
||||
required_device<atari_motion_objects_device> m_mob;
|
||||
|
||||
uint16_t m_current_slip[2]{};
|
||||
|
||||
private:
|
||||
uint8_t m_playfield_palette_bank[2]{};
|
||||
uint16_t m_playfield_xscroll[2]{};
|
||||
uint16_t m_playfield_yscroll[2]{};
|
||||
};
|
||||
|
||||
|
||||
class cyberbal2p_state : public cyberbal_base_state
|
||||
{
|
||||
public:
|
||||
cyberbal2p_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
cyberbal_base_state(mconfig, type, tag),
|
||||
m_screen(*this, "screen"),
|
||||
m_jsa(*this, "jsa")
|
||||
{ }
|
||||
|
||||
void cyberbal2p(machine_config &config);
|
||||
|
||||
protected:
|
||||
uint16_t sound_state_r();
|
||||
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
uint32_t screen_update_cyberbal2p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
// memory maps
|
||||
void cyberbal2p_map(address_map &map);
|
||||
|
||||
private:
|
||||
DECLARE_WRITE_LINE_MEMBER(video_int_write_line);
|
||||
void video_int_ack_w(uint16_t data = 0);
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline_update);
|
||||
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<atari_jsa_ii_device> m_jsa;
|
||||
};
|
||||
|
||||
|
||||
class cyberbal_state : public cyberbal_base_state
|
||||
{
|
||||
public:
|
||||
cyberbal_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
cyberbal_base_state(mconfig, type, tag),
|
||||
m_slapstic(*this, "slapstic"),
|
||||
m_slapstic_bank(*this, "slapstic_bank"),
|
||||
m_extracpu(*this, "extra"),
|
||||
m_sac(*this, "sac"),
|
||||
m_playfield2(*this, "playfield2"),
|
||||
m_alpha2(*this, "alpha2"),
|
||||
m_mob2(*this, "mob2"),
|
||||
m_rpalette(*this, "rpalette"),
|
||||
m_lscreen(*this, "lscreen"),
|
||||
m_rscreen(*this, "rscreen")
|
||||
{ }
|
||||
|
||||
void init_cyberbalt();
|
||||
void cyberbal(machine_config &config);
|
||||
void cyberbalt(machine_config &config);
|
||||
|
||||
protected:
|
||||
void p2_reset_w(uint16_t data);
|
||||
TILE_GET_INFO_MEMBER(get_alpha2_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_playfield2_tile_info);
|
||||
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
uint32_t screen_update_cyberbal_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_cyberbal_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
// memory maps
|
||||
void main_map(address_map &map);
|
||||
void tournament_map(address_map &map);
|
||||
void extra_map(address_map &map);
|
||||
|
||||
private:
|
||||
DECLARE_WRITE_LINE_MEMBER(video_int_write_line);
|
||||
void video_int_ack_w(uint16_t data = 0);
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline_update);
|
||||
|
||||
optional_device<atari_slapstic_device> m_slapstic;
|
||||
optional_memory_bank m_slapstic_bank;
|
||||
required_device<cpu_device> m_extracpu;
|
||||
required_device<atari_sac_device> m_sac;
|
||||
required_device<tilemap_device> m_playfield2;
|
||||
required_device<tilemap_device> m_alpha2;
|
||||
required_device<atari_motion_objects_device> m_mob2;
|
||||
required_device<palette_device> m_rpalette;
|
||||
required_device<screen_device> m_lscreen;
|
||||
required_device<screen_device> m_rscreen;
|
||||
|
||||
};
|
||||
|
||||
#endif // MAME_ATARI_CYBERBAL_H
|
@ -1,265 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
/***************************************************************************
|
||||
|
||||
Atari Cyberball hardware
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cyberbal.h"
|
||||
|
||||
|
||||
#define SCREEN_WIDTH (42*16)
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Tilemap callbacks
|
||||
*
|
||||
*************************************/
|
||||
|
||||
TILE_GET_INFO_MEMBER(cyberbal_base_state::get_alpha_tile_info)
|
||||
{
|
||||
uint16_t data = m_alpha->basemem_read(tile_index);
|
||||
int code = data & 0xfff;
|
||||
int color = (data >> 12) & 0x07;
|
||||
tileinfo.set(2, code, color, (data >> 15) & 1);
|
||||
}
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(cyberbal_state::get_alpha2_tile_info)
|
||||
{
|
||||
uint16_t data = m_alpha2->basemem_read(tile_index);
|
||||
int code = data & 0xfff;
|
||||
int color = (data >> 12) & 0x07;
|
||||
tileinfo.set(2, code, color, (data >> 15) & 1);
|
||||
}
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(cyberbal_base_state::get_playfield_tile_info)
|
||||
{
|
||||
uint16_t data = m_playfield->basemem_read(tile_index);
|
||||
int code = data & 0x1fff;
|
||||
int color = (data >> 11) & 0x0f;
|
||||
tileinfo.set(0, code, color, (data >> 15) & 1);
|
||||
}
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(cyberbal_state::get_playfield2_tile_info)
|
||||
{
|
||||
uint16_t data = m_playfield2->basemem_read(tile_index);
|
||||
int code = data & 0x1fff;
|
||||
int color = (data >> 11) & 0x0f;
|
||||
tileinfo.set(0, code, color, (data >> 15) & 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video system start
|
||||
*
|
||||
*************************************/
|
||||
|
||||
const atari_motion_objects_config cyberbal_base_state::s_mob_config =
|
||||
{
|
||||
1, /* index to which gfx system */
|
||||
1, /* number of motion object banks */
|
||||
1, /* are the entries linked? */
|
||||
0, /* are the entries split? */
|
||||
0, /* render in reverse order? */
|
||||
0, /* render in swapped X/Y order? */
|
||||
1, /* does the neighbor bit affect the next object? */
|
||||
1024, /* pixels per SLIP entry (0 for no-slip) */
|
||||
0, /* pixel offset for SLIPs */
|
||||
0, /* maximum number of links to visit/scanline (0=all) */
|
||||
|
||||
0x600, /* base palette entry */
|
||||
0x100, /* maximum number of colors */
|
||||
0, /* transparent pen index */
|
||||
|
||||
{{ 0,0,0x07f8,0 }}, /* mask for the link */
|
||||
{{ 0x7fff,0,0,0 }}, /* mask for the code index */
|
||||
{{ 0,0,0,0x000f }}, /* mask for the color */
|
||||
{{ 0,0,0,0xffc0 }}, /* mask for the X position */
|
||||
{{ 0,0xff80,0,0 }}, /* mask for the Y position */
|
||||
{{ 0 }}, /* mask for the width, in tiles*/
|
||||
{{ 0,0x000f,0,0 }}, /* mask for the height, in tiles */
|
||||
{{ 0x8000,0,0,0 }}, /* mask for the horizontal flip */
|
||||
{{ 0 }}, /* mask for the vertical flip */
|
||||
{{ 0 }}, /* mask for the priority */
|
||||
{{ 0,0,0,0x0010 }}, /* mask for the neighbor */
|
||||
{{ 0 }}, /* mask for absolute coordinates */
|
||||
|
||||
{{ 0 }}, /* mask for the special value */
|
||||
0, /* resulting value to indicate "special" */
|
||||
};
|
||||
|
||||
void cyberbal_base_state::video_start()
|
||||
{
|
||||
/* initialize the motion objects */
|
||||
m_mob->set_slipram(&m_current_slip[0]);
|
||||
|
||||
/* save states */
|
||||
save_item(NAME(m_current_slip));
|
||||
save_item(NAME(m_playfield_palette_bank));
|
||||
save_item(NAME(m_playfield_xscroll));
|
||||
save_item(NAME(m_playfield_yscroll));
|
||||
}
|
||||
|
||||
|
||||
void cyberbal_state::video_start()
|
||||
{
|
||||
m_playfield2->set_palette(*m_rpalette);
|
||||
m_alpha2->set_palette(*m_rpalette);
|
||||
|
||||
cyberbal_base_state::video_start();
|
||||
|
||||
m_mob2->set_slipram(&m_current_slip[1]);
|
||||
|
||||
/* adjust the sprite positions */
|
||||
m_mob->set_xscroll(4);
|
||||
m_mob2->set_xscroll(4);
|
||||
}
|
||||
|
||||
|
||||
void cyberbal2p_state::video_start()
|
||||
{
|
||||
cyberbal_base_state::video_start();
|
||||
|
||||
/* adjust the sprite positions */
|
||||
m_mob->set_xscroll(5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Periodic scanline updater
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void cyberbal_base_state::scanline_update_one(screen_device &screen, int scanline, int i, tilemap_t &curplayfield, tilemap_device &curalpha)
|
||||
{
|
||||
/* keep in range */
|
||||
int offset = ((scanline - 8) / 8) * 64 + 47;
|
||||
if (offset < 0)
|
||||
offset += 0x800;
|
||||
else if (offset >= 0x800)
|
||||
return;
|
||||
|
||||
/* update the current parameters */
|
||||
uint16_t word = curalpha.basemem_read(offset + 3);
|
||||
if (!(word & 1))
|
||||
{
|
||||
if (((word >> 1) & 7) != m_playfield_palette_bank[i])
|
||||
{
|
||||
if (scanline > 0)
|
||||
screen.update_partial(scanline - 1);
|
||||
m_playfield_palette_bank[i] = (word >> 1) & 7;
|
||||
curplayfield.set_palette_offset(m_playfield_palette_bank[i] << 8);
|
||||
}
|
||||
}
|
||||
word = curalpha.basemem_read(offset + 4);
|
||||
if (!(word & 1))
|
||||
{
|
||||
int newscroll = 2 * (((word >> 7) + 4) & 0x1ff);
|
||||
if (newscroll != m_playfield_xscroll[i])
|
||||
{
|
||||
if (scanline > 0)
|
||||
screen.update_partial(scanline - 1);
|
||||
curplayfield.set_scrollx(0, newscroll);
|
||||
m_playfield_xscroll[i] = newscroll;
|
||||
}
|
||||
}
|
||||
word = curalpha.basemem_read(offset + 5);
|
||||
if (!(word & 1))
|
||||
{
|
||||
/* a new vscroll latches the offset into a counter; we must adjust for this */
|
||||
int newscroll = ((word >> 7) - (scanline)) & 0x1ff;
|
||||
if (newscroll != m_playfield_yscroll[i])
|
||||
{
|
||||
if (scanline > 0)
|
||||
screen.update_partial(scanline - 1);
|
||||
curplayfield.set_scrolly(0, newscroll);
|
||||
m_playfield_yscroll[i] = newscroll;
|
||||
}
|
||||
}
|
||||
word = curalpha.basemem_read(offset + 7);
|
||||
if (!(word & 1))
|
||||
{
|
||||
if (m_current_slip[i] != word)
|
||||
{
|
||||
if (scanline > 0)
|
||||
screen.update_partial(scanline - 1);
|
||||
m_current_slip[i] = word;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(cyberbal_state::scanline_update)
|
||||
{
|
||||
scanline_update_one(*m_lscreen, param, 0, *m_playfield, *m_alpha);
|
||||
scanline_update_one(*m_rscreen, param, 1, *m_playfield2, *m_alpha2);
|
||||
}
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(cyberbal2p_state::scanline_update)
|
||||
{
|
||||
scanline_update_one(*m_screen, param, 0, *m_playfield, *m_alpha);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Main refresh
|
||||
*
|
||||
*************************************/
|
||||
|
||||
uint32_t cyberbal_base_state::update_one_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, atari_motion_objects_device &curmob, tilemap_t &curplayfield, tilemap_t &curalpha)
|
||||
{
|
||||
// start drawing
|
||||
curmob.draw_async(cliprect);
|
||||
|
||||
/* draw the playfield */
|
||||
curplayfield.draw(screen, bitmap, cliprect, 0, 0);
|
||||
|
||||
/* draw and merge the MO */
|
||||
bitmap_ind16 &mobitmap = curmob.bitmap();
|
||||
for (const sparse_dirty_rect *rect = curmob.first_dirty_rect(cliprect); rect != nullptr; rect = rect->next())
|
||||
for (int y = rect->top(); y <= rect->bottom(); y++)
|
||||
{
|
||||
uint16_t const *const mo = &mobitmap.pix(y);
|
||||
uint16_t *const pf = &bitmap.pix(y);
|
||||
for (int x = rect->left(); x <= rect->right(); x++)
|
||||
if (mo[x] != 0xffff)
|
||||
{
|
||||
// not verified: logic is all controlled in a PAL
|
||||
pf[x] = mo[x];
|
||||
}
|
||||
}
|
||||
|
||||
/* add the alpha on top */
|
||||
curalpha.draw(screen, bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint32_t cyberbal_state::screen_update_cyberbal_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
return update_one_screen(screen, bitmap, cliprect, *m_mob, *m_playfield, *m_alpha);
|
||||
}
|
||||
|
||||
uint32_t cyberbal_state::screen_update_cyberbal_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
return update_one_screen(screen, bitmap, cliprect, *m_mob2, *m_playfield2, *m_alpha2);
|
||||
}
|
||||
|
||||
uint32_t cyberbal2p_state::screen_update_cyberbal2p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
return update_one_screen(screen, bitmap, cliprect, *m_mob, *m_playfield, *m_alpha);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Stefan Jokisch
|
||||
// copyright-holders: Stefan Jokisch
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Atari Drag Race Driver
|
||||
@ -7,16 +8,159 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "dragrace.h"
|
||||
|
||||
#include "dragrace_a.h"
|
||||
|
||||
#include "cpu/m6800/m6800.h"
|
||||
#include "machine/74259.h"
|
||||
#include "machine/timer.h"
|
||||
#include "machine/watchdog.h"
|
||||
#include "sound/discrete.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
#include "dragrace.lh"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class dragrace_state : public driver_device
|
||||
{
|
||||
public:
|
||||
dragrace_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_watchdog(*this, "watchdog"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_discrete(*this, "discrete"),
|
||||
m_playfield_ram(*this, "playfield_ram"),
|
||||
m_position_ram(*this, "position_ram"),
|
||||
m_p(*this, "P%u", 1U),
|
||||
m_dial(*this, "DIAL%u", 1U),
|
||||
m_in(*this, "IN%u", 0U),
|
||||
m_gear_sel(*this, "P%ugear", 1U),
|
||||
m_tacho_sel(*this, "tachometer%u", 1U)
|
||||
{
|
||||
}
|
||||
|
||||
void dragrace(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<watchdog_timer_device> m_watchdog;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<discrete_sound_device> m_discrete;
|
||||
|
||||
// memory pointers
|
||||
required_shared_ptr<uint8_t> m_playfield_ram;
|
||||
required_shared_ptr<uint8_t> m_position_ram;
|
||||
|
||||
// inputs
|
||||
required_ioport_array<2> m_p, m_dial;
|
||||
required_ioport_array<3> m_in;
|
||||
|
||||
// outputs
|
||||
output_finder<2> m_gear_sel, m_tacho_sel;
|
||||
|
||||
// video-related
|
||||
tilemap_t *m_bg_tilemap = nullptr;
|
||||
|
||||
// misc
|
||||
uint8_t m_gear[2]{};
|
||||
emu_timer *m_scan_timer;
|
||||
emu_timer *m_irq_off_timer;
|
||||
|
||||
void speed1_w(uint8_t data);
|
||||
void speed2_w(uint8_t data);
|
||||
uint8_t input_r(offs_t offset);
|
||||
uint8_t steering_r();
|
||||
uint8_t scanline_r();
|
||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
void palette(palette_device &palette) const;
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(frame_callback);
|
||||
TIMER_CALLBACK_MEMBER(scanline_irq);
|
||||
TIMER_CALLBACK_MEMBER(irq_off);
|
||||
|
||||
void main_map(address_map &map);
|
||||
};
|
||||
|
||||
|
||||
// video
|
||||
|
||||
TILE_GET_INFO_MEMBER(dragrace_state::get_tile_info)
|
||||
{
|
||||
uint8_t code = m_playfield_ram[tile_index];
|
||||
int num = code & 0x1f;
|
||||
int col = 0;
|
||||
|
||||
if ((code & 0xc0) == 0x40)
|
||||
num |= 0x20;
|
||||
|
||||
switch (code & 0xa0)
|
||||
{
|
||||
case 0x00:
|
||||
col = 0;
|
||||
break;
|
||||
case 0x20:
|
||||
col = 1;
|
||||
break;
|
||||
case 0x80:
|
||||
col = (code & 0x40) ? 1 : 0;
|
||||
break;
|
||||
case 0xa0:
|
||||
col = (code & 0x40) ? 3 : 2;
|
||||
break;
|
||||
}
|
||||
|
||||
tileinfo.set(((code & 0xa0) == 0x80) ? 1 : 0, num, col, 0);
|
||||
}
|
||||
|
||||
|
||||
void dragrace_state::video_start()
|
||||
{
|
||||
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dragrace_state::get_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
|
||||
}
|
||||
|
||||
|
||||
uint32_t dragrace_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_bg_tilemap->mark_all_dirty();
|
||||
|
||||
for (int y = 0; y < 256; y += 4)
|
||||
{
|
||||
rectangle rect = cliprect;
|
||||
|
||||
int const xl = m_position_ram[y + 0] & 15;
|
||||
int const xh = m_position_ram[y + 1] & 15;
|
||||
int const yl = m_position_ram[y + 2] & 15;
|
||||
int const yh = m_position_ram[y + 3] & 15;
|
||||
|
||||
m_bg_tilemap->set_scrollx(0, 16 * xh + xl - 8);
|
||||
m_bg_tilemap->set_scrolly(0, 16 * yh + yl);
|
||||
|
||||
rect.sety((std::max)(rect.top(), y + 0), (std::min)(rect.bottom(), y + 3));
|
||||
|
||||
m_bg_tilemap->draw(screen, bitmap, rect, 0, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// machine
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(dragrace_state::frame_callback)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
@ -32,7 +176,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(dragrace_state::frame_callback)
|
||||
}
|
||||
|
||||
m_gear_sel[0] = m_gear[0];
|
||||
m_gear_sel[1] = m_gear[1];
|
||||
m_gear_sel[1] = m_gear[1];
|
||||
|
||||
// watchdog is disabled during service mode
|
||||
m_watchdog->watchdog_enable(m_in[0]->read() & 0x20);
|
||||
@ -44,7 +188,7 @@ TIMER_CALLBACK_MEMBER(dragrace_state::scanline_irq)
|
||||
m_irq_off_timer->adjust(m_screen->scan_period() * 3);
|
||||
|
||||
// Four IRQs per frame (vpos = 64, 128, 192, 240)
|
||||
int scanline = m_screen->vpos();
|
||||
int const scanline = m_screen->vpos();
|
||||
m_scan_timer->adjust(m_screen->time_until_pos(scanline < 240 ? std::min(scanline + 64, 240) : 64));
|
||||
}
|
||||
|
||||
@ -76,8 +220,8 @@ uint8_t dragrace_state::input_r(offs_t offset)
|
||||
{
|
||||
int val = m_in[2]->read();
|
||||
|
||||
uint8_t maskA = 1 << (offset % 8);
|
||||
uint8_t maskB = 1 << (offset / 8);
|
||||
uint8_t const maskA = 1 << (offset % 8);
|
||||
uint8_t const maskB = 1 << (offset / 8);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -101,7 +245,7 @@ uint8_t dragrace_state::steering_r()
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int dial = m_dial[i]->read();
|
||||
int const dial = m_dial[i]->read();
|
||||
|
||||
bitA[i] = ((dial + 1) / 2) & 1;
|
||||
bitB[i] = ((dial + 0) / 2) & 1;
|
||||
@ -247,8 +391,8 @@ static const gfx_layout dragrace_tile_layout2 =
|
||||
|
||||
|
||||
static GFXDECODE_START( gfx_dragrace )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, dragrace_tile_layout1, 0, 4 )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, dragrace_tile_layout2, 8, 2 )
|
||||
GFXDECODE_ENTRY( "tiles_2c", 0, dragrace_tile_layout1, 0, 4 )
|
||||
GFXDECODE_ENTRY( "tiles_4c", 0, dragrace_tile_layout2, 8, 2 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
@ -349,12 +493,12 @@ ROM_START( dragrace )
|
||||
ROM_LOAD( "8514.a1", 0x1800, 0x0800, CRC(ad218690) SHA1(08ba5f4fa4c75d8dad1a7162888d44b3349cbbe4) )
|
||||
ROM_RELOAD( 0xf800, 0x0800 )
|
||||
|
||||
ROM_REGION( 0x800, "gfx1", 0 ) // 2 color tiles
|
||||
ROM_REGION( 0x800, "tiles_2c", 0 ) // 2 color tiles
|
||||
ROM_LOAD( "8519dr.j0", 0x000, 0x200, CRC(aa221ba0) SHA1(450acbf349d77a790a25f3e303c31b38cc426a38) )
|
||||
ROM_LOAD( "8521dr.k0", 0x200, 0x200, CRC(0cb33f12) SHA1(d50cb55391aec03e064eecad1624d50d4c30ccab) )
|
||||
ROM_LOAD( "8520dr.r0", 0x400, 0x200, CRC(ee1ae6a7) SHA1(83491095260c8b7c616ff17ec1e888d05620f166) )
|
||||
|
||||
ROM_REGION( 0x800, "gfx2", 0 ) // 4 color tiles
|
||||
ROM_REGION( 0x800, "tiles_4c", 0 ) // 4 color tiles
|
||||
ROM_LOAD( "8515dr.e0", 0x000, 0x200, CRC(9510a59e) SHA1(aea0782b919279efe55a07007bd55a16f7f59239) )
|
||||
ROM_LOAD( "8517dr.h0", 0x200, 0x200, CRC(8b5bff1f) SHA1(fdcd719c66bff7c4b9f3d56d1e635259dd8add61) )
|
||||
ROM_LOAD( "8516dr.l0", 0x400, 0x200, CRC(d1e74af1) SHA1(f55a3bfd7d152ac9af128697f55c9a0c417779f5) )
|
||||
@ -364,5 +508,7 @@ ROM_START( dragrace )
|
||||
ROM_LOAD( "l8.bin", 0x000, 0x100, CRC(3610b453) SHA1(9e33ee04f22a9174c29fafb8e71781fa330a7a08) )
|
||||
ROM_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
GAMEL( 1977, dragrace, 0, dragrace, dragrace, dragrace_state, empty_init, 0, "Atari (Kee Games)", "Drag Race", MACHINE_SUPPORTS_SAVE, layout_dragrace )
|
||||
|
@ -1,108 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Stefan Jokisch
|
||||
/*************************************************************************
|
||||
|
||||
Atari Drag Race hardware
|
||||
|
||||
*************************************************************************/
|
||||
#ifndef MAME_ATARI_DRAGRACE_H
|
||||
#define MAME_ATARI_DRAGRACE_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "machine/timer.h"
|
||||
#include "machine/watchdog.h"
|
||||
#include "sound/discrete.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
// Discrete Sound Input Nodes
|
||||
#define DRAGRACE_SCREECH1_EN NODE_01
|
||||
#define DRAGRACE_SCREECH2_EN NODE_02
|
||||
#define DRAGRACE_LOTONE_EN NODE_03
|
||||
#define DRAGRACE_HITONE_EN NODE_04
|
||||
#define DRAGRACE_EXPLODE1_EN NODE_05
|
||||
#define DRAGRACE_EXPLODE2_EN NODE_06
|
||||
#define DRAGRACE_MOTOR1_DATA NODE_07
|
||||
#define DRAGRACE_MOTOR2_DATA NODE_08
|
||||
#define DRAGRACE_MOTOR1_EN NODE_80
|
||||
#define DRAGRACE_MOTOR2_EN NODE_81
|
||||
#define DRAGRACE_KLEXPL1_EN NODE_82
|
||||
#define DRAGRACE_KLEXPL2_EN NODE_83
|
||||
#define DRAGRACE_ATTRACT_EN NODE_09
|
||||
|
||||
|
||||
class dragrace_state : public driver_device
|
||||
{
|
||||
public:
|
||||
dragrace_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_watchdog(*this, "watchdog"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_discrete(*this, "discrete"),
|
||||
m_playfield_ram(*this, "playfield_ram"),
|
||||
m_position_ram(*this, "position_ram"),
|
||||
m_p(*this, "P%u", 1U),
|
||||
m_dial(*this, "DIAL%u", 1U),
|
||||
m_in(*this, "IN%u", 0U),
|
||||
m_gear_sel(*this, "P%ugear", 1U),
|
||||
m_tacho_sel(*this, "tachometer%u", 1U)
|
||||
{
|
||||
}
|
||||
|
||||
void dragrace(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
void speed1_w(uint8_t data);
|
||||
void speed2_w(uint8_t data);
|
||||
uint8_t input_r(offs_t offset);
|
||||
uint8_t steering_r();
|
||||
uint8_t scanline_r();
|
||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
void palette(palette_device &palette) const;
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(frame_callback);
|
||||
TIMER_CALLBACK_MEMBER(scanline_irq);
|
||||
TIMER_CALLBACK_MEMBER(irq_off);
|
||||
|
||||
void main_map(address_map &map);
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<watchdog_timer_device> m_watchdog;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<discrete_sound_device> m_discrete;
|
||||
|
||||
// memory pointers
|
||||
required_shared_ptr<uint8_t> m_playfield_ram;
|
||||
required_shared_ptr<uint8_t> m_position_ram;
|
||||
|
||||
// inputs
|
||||
required_ioport_array<2> m_p, m_dial;
|
||||
required_ioport_array<3> m_in;
|
||||
|
||||
// outputs
|
||||
output_finder<2> m_gear_sel, m_tacho_sel;
|
||||
|
||||
// video-related
|
||||
tilemap_t *m_bg_tilemap = nullptr;
|
||||
|
||||
// misc
|
||||
uint8_t m_gear[2]{};
|
||||
emu_timer *m_scan_timer;
|
||||
emu_timer *m_irq_off_timer;
|
||||
};
|
||||
|
||||
//----------- defined in audio/dragrace.cpp -----------
|
||||
DISCRETE_SOUND_EXTERN( dragrace_discrete );
|
||||
|
||||
#endif // MAME_ATARI_DRAGRACE_H
|
@ -1,13 +1,14 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Derrick Renaud
|
||||
// copyright-holders: Derrick Renaud
|
||||
|
||||
/*************************************************************************
|
||||
|
||||
audio\dragrace.cpp
|
||||
atari\dragrace_a.cpp
|
||||
|
||||
*************************************************************************/
|
||||
#include "emu.h"
|
||||
#include "dragrace.h"
|
||||
#include "sound/discrete.h"
|
||||
|
||||
#include "dragrace_a.h"
|
||||
|
||||
/************************************************************************/
|
||||
/* dragrace Sound System Analog emulation */
|
||||
|
36
src/mame/atari/dragrace_a.h
Normal file
36
src/mame/atari/dragrace_a.h
Normal file
@ -0,0 +1,36 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders: Derrick Renaud
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Drag Race audio
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_ATARI_DRAGRACE_A_H
|
||||
#define MAME_ATARI_DRAGRACE_A_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sound/discrete.h"
|
||||
|
||||
// discrete sound input nodes
|
||||
|
||||
#define DRAGRACE_SCREECH1_EN NODE_01
|
||||
#define DRAGRACE_SCREECH2_EN NODE_02
|
||||
#define DRAGRACE_LOTONE_EN NODE_03
|
||||
#define DRAGRACE_HITONE_EN NODE_04
|
||||
#define DRAGRACE_EXPLODE1_EN NODE_05
|
||||
#define DRAGRACE_EXPLODE2_EN NODE_06
|
||||
#define DRAGRACE_MOTOR1_DATA NODE_07
|
||||
#define DRAGRACE_MOTOR2_DATA NODE_08
|
||||
#define DRAGRACE_MOTOR1_EN NODE_80
|
||||
#define DRAGRACE_MOTOR2_EN NODE_81
|
||||
#define DRAGRACE_KLEXPL1_EN NODE_82
|
||||
#define DRAGRACE_KLEXPL2_EN NODE_83
|
||||
#define DRAGRACE_ATTRACT_EN NODE_09
|
||||
|
||||
|
||||
DISCRETE_SOUND_EXTERN( dragrace_discrete );
|
||||
|
||||
#endif // MAME_ATARI_DRAGRACE_A_H
|
@ -1,70 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Stefan Jokisch
|
||||
/***************************************************************************
|
||||
|
||||
Atari Drag Race video emulation
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "dragrace.h"
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(dragrace_state::get_tile_info)
|
||||
{
|
||||
uint8_t code = m_playfield_ram[tile_index];
|
||||
int num = code & 0x1f;
|
||||
int col = 0;
|
||||
|
||||
if ((code & 0xc0) == 0x40)
|
||||
num |= 0x20;
|
||||
|
||||
switch (code & 0xa0)
|
||||
{
|
||||
case 0x00:
|
||||
col = 0;
|
||||
break;
|
||||
case 0x20:
|
||||
col = 1;
|
||||
break;
|
||||
case 0x80:
|
||||
col = (code & 0x40) ? 1 : 0;
|
||||
break;
|
||||
case 0xa0:
|
||||
col = (code & 0x40) ? 3 : 2;
|
||||
break;
|
||||
}
|
||||
|
||||
tileinfo.set(((code & 0xa0) == 0x80) ? 1 : 0, num, col, 0);
|
||||
}
|
||||
|
||||
|
||||
void dragrace_state::video_start()
|
||||
{
|
||||
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dragrace_state::get_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
|
||||
}
|
||||
|
||||
|
||||
uint32_t dragrace_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_bg_tilemap->mark_all_dirty();
|
||||
|
||||
for (int y = 0; y < 256; y += 4)
|
||||
{
|
||||
rectangle rect = cliprect;
|
||||
|
||||
int xl = m_position_ram[y + 0] & 15;
|
||||
int xh = m_position_ram[y + 1] & 15;
|
||||
int yl = m_position_ram[y + 2] & 15;
|
||||
int yh = m_position_ram[y + 3] & 15;
|
||||
|
||||
m_bg_tilemap->set_scrollx(0, 16 * xh + xl - 8);
|
||||
m_bg_tilemap->set_scrolly(0, 16 * yh + yl);
|
||||
|
||||
rect.sety((std::max)(rect.top(), y + 0), (std::min)(rect.bottom(), y + 3));
|
||||
|
||||
m_bg_tilemap->draw(screen, bitmap, rect, 0, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user