irem/m10.cpp, irem/m57.cpp, irem/m58.cpp: consolidated drivers in single files

This commit is contained in:
Ivan Vangelista 2024-06-19 06:41:49 +02:00
parent ef8f9d5257
commit 52b7417a1b
9 changed files with 1144 additions and 1228 deletions

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Lee Taylor, Couriersud
// copyright-holders: Lee Taylor, Couriersud
/***************************************************************************
Irem M-10 / M-11 / M-15 hardware
@ -102,35 +103,323 @@ Notes (couriersud)
M10-Board: Has SN76477
ipminva1
ipminvad1
========
This is from an incomplete dump without documentation.
The filename contained m10 and with a hack to work
around the missing rom you get some action.
around the missing ROM you get some action.
The files are all different from ipminvad. Either this has
been a prototype or eventually the famous "capsule invader".
been a prototype or possibly the famous "Capsule Invader".
***************************************************************************/
#include "emu.h"
#include "m10.h"
#include "cpu/m6502/m6502.h"
#include "machine/74123.h"
#include "machine/rescap.h"
#include "sound/samples.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"
/*************************************
*
* Defines
*
*************************************/
// configurable logging
#define LOG_CTRL (1U << 1)
#define M10_DEBUG (0)
//#define VERBOSE (LOG_GENERAL | LOG_CTRL)
#include "logmacro.h"
#define LOGCTRL(...) LOGMASKED(LOG_CTRL, __VA_ARGS__)
namespace {
class m1x_state : public driver_device
{
public:
m1x_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_chargen(*this, "chargen"),
m_maincpu(*this, "maincpu"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_cab(*this, "CAB")
{ }
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_colorram;
required_shared_ptr<uint8_t> m_chargen;
required_device<cpu_device> m_maincpu;
required_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_ioport m_cab;
static constexpr XTAL IREMM10_MASTER_CLOCK = 12.5_MHz_XTAL;
static constexpr XTAL IREMM10_CPU_CLOCK = IREMM10_MASTER_CLOCK / 16;
static constexpr XTAL IREMM10_PIXEL_CLOCK = IREMM10_MASTER_CLOCK / 2;
static constexpr int IREMM10_HTOTAL = 360; // (0x100-0xd3) * 8
static constexpr int IREMM10_HBSTART = 248;
static constexpr int IREMM10_HBEND = 8;
static constexpr int IREMM10_VTOTAL = 281; // (0x200-0xe7)
static constexpr int IREMM10_VBSTART = 240;
static constexpr int IREMM10_VBEND = 16;
static constexpr XTAL IREMM11_MASTER_CLOCK = 11.73_MHz_XTAL;
static constexpr XTAL IREMM11_CPU_CLOCK = IREMM11_MASTER_CLOCK / 16;
static constexpr XTAL IREMM11_PIXEL_CLOCK = IREMM11_MASTER_CLOCK / 2;
static constexpr int IREMM11_HTOTAL = 372;
static constexpr int IREMM11_HBSTART = 256;
static constexpr int IREMM11_HBEND = 0;
static constexpr int IREMM11_VTOTAL = 262;
static constexpr int IREMM11_VBSTART = 240;
static constexpr int IREMM11_VBEND = 16;
// video-related
tilemap_t *m_tx_tilemap;
// video state
uint8_t m_flip = 0;
// misc
uint8_t m_last = 0;
void colorram_w(offs_t offset, uint8_t data);
TILEMAP_MAPPER_MEMBER(tilemap_scan);
TILE_GET_INFO_MEMBER(get_tile_info);
void palette(palette_device &palette) const;
};
class m10_state : public m1x_state
{
public:
m10_state(const machine_config &mconfig, device_type type, const char *tag) :
m1x_state(mconfig, type, tag),
m_ic8j1(*this, "ic8j1"),
m_ic8j2(*this, "ic8j2")
{ }
void m10(machine_config &config);
void m11(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(set_vr1) { m_ic8j2->set_resistor_value(RES_K(10 + newval / 5.0)); }
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
private:
required_device<ttl74123_device> m_ic8j1;
required_device<ttl74123_device> m_ic8j2;
gfx_element *m_back_gfx = nullptr;
uint8_t m_back_color[4]{};
uint8_t m_back_xpos[4]{};
uint8_t m_bottomline = 0;
void m10_ctrl_w(uint8_t data);
void m11_ctrl_w(uint8_t data);
void m10_a500_w(uint8_t data);
void m11_a100_w(uint8_t data);
uint8_t clear_74123_r();
void chargen_w(offs_t offset, uint8_t data);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
inline void plot_pixel(bitmap_ind16 &bm, int x, int y, int col);
void m10_main(address_map &map);
void m11_main(address_map &map);
};
class m15_state : public m1x_state
{
public:
m15_state(const machine_config &mconfig, device_type type, const char *tag) :
m1x_state(mconfig, type, tag)
{ }
void m15(machine_config &config);
protected:
virtual void video_start() override;
private:
void ctrl_w(uint8_t data);
void a100_w(uint8_t data);
void chargen_w(offs_t offset, uint8_t data);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(interrupt);
void main(address_map &map);
};
static const uint32_t extyoffs[] =
{
STEP256(0, 8)
};
static const gfx_layout backlayout =
{
8,8*32, // 8*(8*32) characters
4, // 4 characters
1, // 1 bit per pixel
{ 0 },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
EXTENDED_YOFFS,
32*8*8, // every char takes 8 consecutive bytes
nullptr, extyoffs
};
static const gfx_layout charlayout =
{
8,8, // 8*8 characters
256, // 256 characters
1, // 1 bit per pixel
{ 0 },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 // every char takes 8 consecutive bytes
};
TILEMAP_MAPPER_MEMBER(m1x_state::tilemap_scan)
{
return (31 - col) * 32 + row;
}
TILE_GET_INFO_MEMBER(m1x_state::get_tile_info)
{
tileinfo.set(0, m_videoram[tile_index], m_colorram[tile_index] & 0x07, 0);
}
void m1x_state::colorram_w(offs_t offset, uint8_t data)
{
if (m_colorram[offset] != data)
{
m_tx_tilemap->mark_tile_dirty(offset);
m_colorram[offset] = data;
}
}
void m10_state::chargen_w(offs_t offset, uint8_t data)
{
if (m_chargen[offset] != data)
{
m_chargen[offset] = data;
m_back_gfx->mark_dirty(offset >> (3 + 5));
}
}
void m15_state::chargen_w(offs_t offset, uint8_t data)
{
if (m_chargen[offset] != data)
{
m_chargen[offset] = data;
m_gfxdecode->gfx(0)->mark_dirty(offset >> 3);
}
}
inline void m10_state::plot_pixel(bitmap_ind16 &bm, int x, int y, int col)
{
if (!m_flip)
bm.pix(y, x) = col;
else
bm.pix((IREMM10_VBSTART - 1) - (y - IREMM10_VBEND),
(IREMM10_HBSTART - 1) - (x - IREMM10_HBEND)) = col; // only when flip_screen(?)
}
void m10_state::video_start()
{
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(m10_state::get_tile_info)), tilemap_mapper_delegate(*this, FUNC(m10_state::tilemap_scan)), 8, 8, 32, 32);
m_tx_tilemap->set_transparent_pen(0);
m_gfxdecode->set_gfx(1, std::make_unique<gfx_element>(m_palette, backlayout, m_chargen, 0, 8, 0));
m_back_gfx = m_gfxdecode->gfx(1);
}
void m15_state::video_start()
{
m_gfxdecode->set_gfx(0,std::make_unique<gfx_element>(m_palette, charlayout, m_chargen, 0, 8, 0));
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(m15_state::get_tile_info)), tilemap_mapper_delegate(*this, FUNC(m15_state::tilemap_scan)), 8, 8, 32, 32);
}
/***************************************************************************
Draw the game screen in the given bitmap_ind16.
***************************************************************************/
uint32_t m10_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0, cliprect);
for (int i = 0; i < 4; i++)
if (m_flip)
m_back_gfx->opaque(bitmap,cliprect, i, m_back_color[i], 1, 1, 31 * 8 - m_back_xpos[i], 0);
else
m_back_gfx->opaque(bitmap,cliprect, i, m_back_color[i], 0, 0, m_back_xpos[i], 0);
if (m_bottomline)
{
for (int y = IREMM10_VBEND; y < IREMM10_VBSTART; y++)
plot_pixel(bitmap, 16, y, 1);
}
for (int offs = m_videoram.bytes() - 1; offs >= 0; offs--)
m_tx_tilemap->mark_tile_dirty(offs);
m_tx_tilemap->set_flip(m_flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
/***************************************************************************
Draw the game screen in the given bitmap_ind16.
***************************************************************************/
uint32_t m15_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = m_videoram.bytes() - 1; offs >= 0; offs--)
m_tx_tilemap->mark_tile_dirty(offs);
//m_tx_tilemap->mark_all_dirty();
m_tx_tilemap->set_flip(m_flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
#define LOG(x) do { if (M10_DEBUG) printf x; } while (0)
/*************************************
*
@ -187,7 +476,7 @@ void m10_state::machine_reset()
* -?------ ????
* --b----- ACTIVE LOW Bottom line
* ---f---- ACTIVE LOW Flip screen
* ----u--- ACTIVE LOW Ufo sound enable (SN76477)
* ----u--- ACTIVE LOW UFO sound enable (SN76477)
* -----sss Sound #sss start
* 0x01: MISSILE
* 0x02: EXPLOSION
@ -199,10 +488,8 @@ void m10_state::machine_reset()
void m10_state::m10_ctrl_w(uint8_t data)
{
#if M10_DEBUG
if (data & 0x40)
popmessage("ctrl: %02x",data);
#endif
LOGCTRL("ctrl: %02x",data);
// I have NO IDEA if this is correct or not
m_bottomline = ~data & 0x20;
@ -244,7 +531,7 @@ void m10_state::m10_ctrl_w(uint8_t data)
m_samples->start(2, 7);
break;
default:
popmessage("Unknown sound M10: %02x\n", data & 0x07);
logerror("Unknown sound M10: %02x\n", data & 0x07);
break;
}
// UFO SOUND
@ -274,10 +561,8 @@ void m10_state::m10_ctrl_w(uint8_t data)
void m10_state::m11_ctrl_w(uint8_t data)
{
#if M10_DEBUG
if (data & 0x4c)
popmessage("M11 ctrl: %02x",data);
#endif
LOGCTRL("M11 ctrl: %02x",data);
m_bottomline = ~data & 0x20;
@ -305,10 +590,9 @@ void m10_state::m11_ctrl_w(uint8_t data)
void m15_state::ctrl_w(uint8_t data)
{
#if M10_DEBUG
if (data & 0xf0)
popmessage("M15 ctrl: %02x",data);
#endif
LOGCTRL("M15 ctrl: %02x",data);
if (m_cab->read() & 0x01)
m_flip = ~data & 0x04;
if (!(m_cab->read() & 0x02))
@ -331,23 +615,21 @@ void m15_state::ctrl_w(uint8_t data)
void m10_state::m10_a500_w(uint8_t data)
{
#if M10_DEBUG
if (data & 0xfc)
popmessage("a500: %02x",data);
#endif
LOGCTRL("a500: %02x",data);
}
void m10_state::m11_a100_w(uint8_t data)
{
int raising_bits = data & ~m_last;
//int falling_bits = ~data & m_last;
int const raising_bits = data & ~m_last;
//int const falling_bits = ~data & m_last;
// should a falling bit stop a sample?
// This port is written to about 20x per vblank
#if M10_DEBUG
if ((m_last & 0xe8) != (data & 0xe8))
popmessage("A100: %02x\n", data);
#endif
LOGCTRL("A100: %02x\n", data);
m_last = data;
// audio control!
@ -373,8 +655,8 @@ void m10_state::m11_a100_w(uint8_t data)
void m15_state::a100_w(uint8_t data)
{
//int raising_bits = data & ~m_last;
int falling_bits = ~data & m_last;
//int const raising_bits = data & ~m_last;
int const falling_bits = ~data & m_last;
// should a falling bit stop a sample?
// Bit 4 is used
@ -389,10 +671,9 @@ void m15_state::a100_w(uint8_t data)
// 0x20: computer car changes lane
// 0x40: dot
#if M10_DEBUG
if ((m_last & 0x82) != (data & 0x82))
popmessage("A100: %02x\n", data);
#endif
LOGCTRL("A100: %02x\n", data);
// DOT sound
if (falling_bits & 0x40)
m_samples->start(0, 0);
@ -493,7 +774,7 @@ void m10_state::m11_main(address_map &map)
map(0xfc00, 0xffff).rom(); // for the reset / interrupt vectors
}
void m15_state::m15_main(address_map &map)
void m15_state::main(address_map &map)
{
map(0x0000, 0x02ff).ram(); // scratch ram
map(0x1000, 0x33ff).rom();
@ -572,7 +853,7 @@ static INPUT_PORTS_START( skychut )
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING ( 0x00, "3" )
PORT_DIPSETTING ( 0x01, "4" )
// PORT_DIPSETTING ( 0x03, "4" ) // dupe
PORT_DIPSETTING ( 0x03, "4 (duplicate)" )
PORT_DIPSETTING ( 0x02, "5" )
PORT_DIPUNKNOWN( 0x04, 0x00 )
PORT_DIPUNKNOWN( 0x08, 0x00 )
@ -713,7 +994,7 @@ static INPUT_PORTS_START( greenber )
PORT_START("DSW")
PORT_DIPNAME(0x03, 0x01, DEF_STR( Lives ) )
PORT_DIPSETTING ( 0x03, "2" )
// PORT_DIPSETTING ( 0x02, "3" ) // dupe
PORT_DIPSETTING ( 0x02, "3 (duplicate)" )
PORT_DIPSETTING ( 0x01, "3" )
PORT_DIPSETTING ( 0x00, "4" )
PORT_DIPNAME(0x08, 0x00, "Replay" )
@ -737,20 +1018,8 @@ INPUT_PORTS_END
*************************************/
static const gfx_layout charlayout =
{
8,8, // 8*8 characters
256, // 256 characters
1, // 1 bits per pixel
{ 0 },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 // every char takes 8 consecutive bytes
};
static GFXDECODE_START( gfx_m10 )
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 8 )
GFXDECODE_ENTRY( "tiles", 0x0000, charlayout, 0, 8 )
GFXDECODE_END
/*************************************
@ -847,7 +1116,7 @@ void m15_state::m15(machine_config &config)
{
// basic machine hardware
M6502(config, m_maincpu, IREMM11_CPU_CLOCK);
m_maincpu->set_addrmap(AS_PROGRAM, &m15_state::m15_main);
m_maincpu->set_addrmap(AS_PROGRAM, &m15_state::main);
m_maincpu->set_vblank_int("screen", FUNC(m15_state::interrupt));
// video hardware
@ -886,7 +1155,7 @@ ROM_START( ipminvad )
ROM_LOAD( "b6r", 0x2400, 0x0400, CRC(3d0e7fa6) SHA1(14903bfc9506cb8e37807fb397be79f5eab99e3b) )
ROM_LOAD( "b7r", 0x2800, 0x0400, CRC(cf04864f) SHA1(6fe3ce208334321b63ada779fed69ec7cf4051ad) )
ROM_REGION( 0x0800, "gfx1", 0 )
ROM_REGION( 0x0800, "tiles", 0 )
ROM_LOAD( "b9r", 0x0000, 0x0400, CRC(56942cab) SHA1(ba13a856477fc6cf7fd36996e47a3724f862f888) )
ROM_LOAD( "b10r", 0x0400, 0x0400, CRC(be4b8585) SHA1(0154eae62585e154cf20edcf4599bda8bd333aa9) )
ROM_END
@ -903,7 +1172,7 @@ ROM_START( ipminvad1 )
ROM_FILL( 0x2400, 0x0400, 0x60)
ROM_LOAD( "b7f", 0x2800, 0x0400, CRC(0f5115ab) SHA1(3bdd3fc1cfe6bfacb5820ee12c15f2909d2f58d1) )
ROM_REGION( 0x0800, "gfx1", 0 )
ROM_REGION( 0x0800, "tiles", 0 )
ROM_LOAD( "b9", 0x0000, 0x0400, CRC(f6cfa53c) SHA1(ec1076982edee95efb24a1bb08e733bcccacb922) )
ROM_LOAD( "b10", 0x0400, 0x0400, CRC(63672cd2) SHA1(3d9fa15509a363e1a32e58a2242b266b1162e9a6) )
ROM_END
@ -920,7 +1189,7 @@ ROM_START( andromed )
ROM_LOAD( "am7", 0x2800, 0x0400, CRC(30d3366f) SHA1(aa73bba194fa6d1f3909f8df517a0bff07583ea9) )
ROM_LOAD( "am8", 0x2c00, 0x0400, CRC(57294dff) SHA1(3ef8d561e33434dce6e7d45e4739ca3b333681a8) )
ROM_REGION( 0x0800, "gfx1", 0 )
ROM_REGION( 0x0800, "tiles", 0 )
ROM_LOAD( "am9", 0x0000, 0x0400, CRC(a1c8f4db) SHA1(bedf5d7126c7e9b91ad595188c69aa2c043c71e8) )
ROM_LOAD( "am10", 0x0400, 0x0400, CRC(be2de8f3) SHA1(7eb3d1eb88b4481b0dcb7d001207f516a5db32b3) )
ROM_END
@ -937,7 +1206,7 @@ ROM_START( skychut )
ROM_LOAD( "sc7", 0x2800, 0x0400, CRC(dd4c8e1a) SHA1(b5a141d8ac256ba6522308e5f194bfaf5c75fa5b) )
ROM_LOAD( "sc8d", 0x2c00, 0x0400, CRC(aca8b798) SHA1(d9048d060314d8f20ab1967fee846d35c22ac693) )
ROM_REGION( 0x0800, "gfx1", 0 )
ROM_REGION( 0x0800, "tiles", 0 )
ROM_LOAD( "sc9d", 0x0000, 0x0400, CRC(2101029e) SHA1(34cddf076d3d860aa03043db14837f42449aefe7) )
ROM_LOAD( "sc10d", 0x0400, 0x0400, CRC(2f81c70c) SHA1(504935c89a4158a067cbf1dcdb27f7421678915d) )
ROM_END
@ -978,14 +1247,16 @@ ROM_START( greenber )
ROM_LOAD( "gb9", 0x3000, 0x0400, CRC(c27b9ba3) SHA1(a2f4f0c4b61eb03bba13ae5d25dc01009a4f86ee) )
ROM_END
} // anonymous namespace
// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME, FLAGS
GAME( 1979, ipminvad, 0, m10, ipminvad, m10_state, empty_init, ROT270, "IPM", "IPM Invader (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 1979, ipminvad1, ipminvad, m10, ipminvad, m10_state, empty_init, ROT270, "IPM", "IPM Invader (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // incomplete dump
GAME( 1980, andromed, 0, m11, andromed, m10_state, empty_init, ROT270, "Irem", "Andromeda SS (Japan?)", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) // export version known as simply "Andromeda"
GAME( 1980, skychut, 0, m11, skychut, m10_state, empty_init, ROT270, "Irem", "Sky Chuter", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS
GAME( 1979, ipminvad, 0, m10, ipminvad, m10_state, empty_init, ROT270, "IPM", "IPM Invader (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 1979, ipminvad1, ipminvad, m10, ipminvad, m10_state, empty_init, ROT270, "IPM", "IPM Invader (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // incomplete dump
GAME( 1980, andromed, 0, m11, andromed, m10_state, empty_init, ROT270, "Irem", "Andromeda SS (Japan?)", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) // export version known as simply "Andromeda"
GAME( 1980, skychut, 0, m11, skychut, m10_state, empty_init, ROT270, "Irem", "Sky Chuter", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 1979, headoni, 0, m15, headoni, m15_state, empty_init, ROT270, "Irem", "Head On (Irem, M-15 Hardware)", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 1979, spacbeam, 0, m15, spacbeam, m15_state, empty_init, ROT270, "Irem", "Space Beam", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) // IPM or Irem?
GAME( 1980, greenber, 0, m15, greenber, m15_state, empty_init, ROT270, "Irem", "Green Beret (Irem)", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 1979, spacbeam, 0, m15, spacbeam, m15_state, empty_init, ROT270, "Irem", "Space Beam", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) // IPM or Irem?
GAME( 1980, greenber, 0, m15, greenber, m15_state, empty_init, ROT270, "Irem", "Green Beret (Irem)", MACHINE_NO_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )

View File

@ -1,158 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Lee Taylor, Couriersud
/***************************************************************************
IREM M-10,M-11 and M-15 based hardware
****************************************************************************/
#ifndef MAME_IREM_M10_H
#define MAME_IREM_M10_H
#pragma once
#include "machine/74123.h"
#include "machine/rescap.h"
#include "sound/samples.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
#define IREMM10_MASTER_CLOCK 12.5_MHz_XTAL
#define IREMM10_CPU_CLOCK (IREMM10_MASTER_CLOCK/16)
#define IREMM10_PIXEL_CLOCK (IREMM10_MASTER_CLOCK/2)
#define IREMM10_HTOTAL (360) /* (0x100-0xd3)*8 */
#define IREMM10_HBSTART (248)
#define IREMM10_HBEND (8)
#define IREMM10_VTOTAL (281) /* (0x200-0xe7) */
#define IREMM10_VBSTART (240)
#define IREMM10_VBEND (16)
#define IREMM11_MASTER_CLOCK 11.73_MHz_XTAL
#define IREMM11_CPU_CLOCK (IREMM11_MASTER_CLOCK/16)
#define IREMM11_PIXEL_CLOCK (IREMM11_MASTER_CLOCK/2)
#define IREMM11_HTOTAL (372)
#define IREMM11_HBSTART (256)
#define IREMM11_HBEND (0)
#define IREMM11_VTOTAL (262)
#define IREMM11_VBSTART (240)
#define IREMM11_VBEND (16)
class m1x_state : public driver_device
{
public:
m1x_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_chargen(*this, "chargen"),
m_maincpu(*this, "maincpu"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_cab(*this, "CAB")
{ }
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
void colorram_w(offs_t offset, uint8_t data);
// memory pointers
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_colorram;
required_shared_ptr<uint8_t> m_chargen;
// devices
required_device<cpu_device> m_maincpu;
required_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_ioport m_cab;
// video-related
tilemap_t * m_tx_tilemap;
// video state
uint8_t m_flip = 0;
// misc
int m_last = 0;
TILEMAP_MAPPER_MEMBER(tilemap_scan);
TILE_GET_INFO_MEMBER(get_tile_info);
void palette(palette_device &palette) const;
};
class m10_state : public m1x_state
{
public:
m10_state(const machine_config &mconfig, device_type type, const char *tag) :
m1x_state(mconfig, type, tag),
m_ic8j1(*this, "ic8j1"),
m_ic8j2(*this, "ic8j2")
{ }
void m10(machine_config &config);
void m11(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(set_vr1) { m_ic8j2->set_resistor_value(RES_K(10 + newval / 5.0)); }
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
private:
required_device<ttl74123_device> m_ic8j1;
required_device<ttl74123_device> m_ic8j2;
gfx_element * m_back_gfx = nullptr;
int m_back_color[4];
int m_back_xpos[4];
uint8_t m_bottomline = 0U;
void m10_ctrl_w(uint8_t data);
void m11_ctrl_w(uint8_t data);
void m10_a500_w(uint8_t data);
void m11_a100_w(uint8_t data);
uint8_t clear_74123_r();
void chargen_w(offs_t offset, uint8_t data);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
inline void plot_pixel( bitmap_ind16 &bm, int x, int y, int col );
void m10_main(address_map &map);
void m11_main(address_map &map);
};
class m15_state : public m1x_state
{
public:
m15_state(const machine_config &mconfig, device_type type, const char *tag) :
m1x_state(mconfig, type, tag)
{ }
void m15(machine_config &config);
protected:
virtual void video_start() override;
private:
void ctrl_w(uint8_t data);
void a100_w(uint8_t data);
void chargen_w(offs_t offset, uint8_t data);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(interrupt);
void m15_main(address_map &map);
};
#endif // MAME_IREM_M10_H

View File

@ -1,161 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Lee Taylor, Couriersud
/***************************************************************************
m10.cpp
Functions to emulate the video hardware of the machine.
(c) 12/2/1998 Lee Taylor
2006 - major rewrite by couriersud
***************************************************************************/
#include "emu.h"
#include "m10.h"
static const uint32_t extyoffs[] =
{
STEP256(0, 8)
};
static const gfx_layout backlayout =
{
8,8*32, // 8*(8*32) characters
4, // 4 characters
1, // 1 bit per pixel
{ 0 },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
EXTENDED_YOFFS,
32*8*8, // every char takes 8 consecutive bytes
nullptr, extyoffs
};
static const gfx_layout charlayout =
{
8,8, // 8*8 characters
256, // 256 characters
1, // 1 bit per pixel
{ 0 },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 // every char takes 8 consecutive bytes
};
TILEMAP_MAPPER_MEMBER(m1x_state::tilemap_scan)
{
return (31 - col) * 32 + row;
}
TILE_GET_INFO_MEMBER(m1x_state::get_tile_info)
{
tileinfo.set(0, m_videoram[tile_index], m_colorram[tile_index] & 0x07, 0);
}
void m1x_state::colorram_w(offs_t offset, uint8_t data)
{
if (m_colorram[offset] != data)
{
m_tx_tilemap->mark_tile_dirty(offset);
m_colorram[offset] = data;
}
}
void m10_state::chargen_w(offs_t offset, uint8_t data)
{
if (m_chargen[offset] != data)
{
m_chargen[offset] = data;
m_back_gfx->mark_dirty(offset >> (3 + 5));
}
}
void m15_state::chargen_w(offs_t offset, uint8_t data)
{
if (m_chargen[offset] != data)
{
m_chargen[offset] = data;
m_gfxdecode->gfx(0)->mark_dirty(offset >> 3);
}
}
inline void m10_state::plot_pixel(bitmap_ind16 &bm, int x, int y, int col)
{
if (!m_flip)
bm.pix(y, x) = col;
else
bm.pix((IREMM10_VBSTART - 1) - (y - IREMM10_VBEND),
(IREMM10_HBSTART - 1) - (x - IREMM10_HBEND)) = col; // only when flip_screen(?)
}
void m10_state::video_start()
{
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(m10_state::get_tile_info)), tilemap_mapper_delegate(*this, FUNC(m10_state::tilemap_scan)), 8, 8, 32, 32);
m_tx_tilemap->set_transparent_pen(0);
m_gfxdecode->set_gfx(1, std::make_unique<gfx_element>(m_palette, backlayout, m_chargen, 0, 8, 0));
m_back_gfx = m_gfxdecode->gfx(1);
}
void m15_state::video_start()
{
m_gfxdecode->set_gfx(0,std::make_unique<gfx_element>(m_palette, charlayout, m_chargen, 0, 8, 0));
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(m15_state::get_tile_info)), tilemap_mapper_delegate(*this, FUNC(m15_state::tilemap_scan)), 8, 8, 32, 32);
}
/***************************************************************************
Draw the game screen in the given bitmap_ind16.
***************************************************************************/
uint32_t m10_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0, cliprect);
for (int i = 0; i < 4; i++)
if (m_flip)
m_back_gfx->opaque(bitmap,cliprect, i, m_back_color[i], 1, 1, 31 * 8 - m_back_xpos[i], 0);
else
m_back_gfx->opaque(bitmap,cliprect, i, m_back_color[i], 0, 0, m_back_xpos[i], 0);
if (m_bottomline)
{
for (int y = IREMM10_VBEND; y < IREMM10_VBSTART; y++)
plot_pixel(bitmap, 16, y, 1);
}
for (int offs = m_videoram.bytes() - 1; offs >= 0; offs--)
m_tx_tilemap->mark_tile_dirty(offs);
m_tx_tilemap->set_flip(m_flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
/***************************************************************************
Draw the game screen in the given bitmap_ind16.
***************************************************************************/
uint32_t m15_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = m_videoram.bytes() - 1; offs >= 0; offs--)
m_tx_tilemap->mark_tile_dirty(offs);
//m_tx_tilemap->mark_all_dirty();
m_tx_tilemap->set_flip(m_flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
// copyright-holders: Phil Stroffolino
/****************************************************************************
Irem M57 hardware
@ -13,7 +14,7 @@
IREM M57 board stack with a M52-SOUND-E sound PCB.
M57-A-A:
TA-A-xx roms and proms
TA-A-xx ROMs and PROMs
NEC D780C (Z80) CPU
NANAO KNA6032601 custom chip
NANAO KNA6032701 custom chip
@ -24,7 +25,7 @@
Ribbon cable connector to sound PCB
M57-B-A:
TA-B-xx roms and proms
TA-B-xx ROMs and PROMs
18.432 MHz OSC
CN1 - Ribbon cable connector
CN2 - Ribbon cable connector
@ -34,33 +35,328 @@
AY-3-9810 (x2) sound chips
MSM5205 OKI sound chip (and an unpopulated socket for a second MSM5202)
3.579545 MHz OSC
2764 Program rom labeled "TA S-1A-"
2764 Program ROM labeled "TA S-1A-"
Ribbon cable connector to M57-A-A PCB
New Tropical Angel:
Roms were found on an official IREM board with genuine IREM Tropical Angel
ROMs were found on an official IREM board with genuine IREM Tropical Angel
license seal and genuine IREM serial number sticker.
The "new" roms have hand written labels, while those that match the current
The "new" ROMs have hand written labels, while those that match the current
Tropical Angel set look to be factory labeled chips.
*****************************************************************************
Locations based on m58.c driver
Locations based on m58.cpp driver
****************************************************************************/
#include "emu.h"
#include "m57.h"
#include "irem.h"
#include "iremipt.h"
#include "cpu/z80/z80.h"
#include "irem.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
#define MASTER_CLOCK XTAL(18'432'000)
namespace {
class m57_state : public driver_device
{
public:
m57_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_scrollram(*this, "scrollram"),
m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_dsw2(*this, "DSW2")
{ }
void m57(machine_config &config);
protected:
virtual void video_start() override;
private:
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_scrollram;
required_shared_ptr<uint8_t> m_spriteram;
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_ioport m_dsw2;
tilemap_t * m_bg_tilemap = nullptr;
uint8_t m_flipscreen = 0;
void videoram_w(offs_t offset, uint8_t data);
void flipscreen_w(uint8_t data);
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);
void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
void main_map(address_map &map);
};
/***************************************************************************
Convert the color PROMs into a more useable format.
Tropical Angel has two 256x4 character palette PROMs, one 32x8 sprite
palette PROM, and one 256x4 sprite color lookup table PROM.
I don't know for sure how the palette PROMs are connected to the RGB
output, but it's probably something like this; note that RED and BLUE
are swapped wrt the usual configuration.
bit 7 -- 220 ohm resistor -- RED
-- 470 ohm resistor -- RED
-- 220 ohm resistor -- GREEN
-- 470 ohm resistor -- GREEN
-- 1 kohm resistor -- GREEN
-- 220 ohm resistor -- BLUE
-- 470 ohm resistor -- BLUE
bit 0 -- 1 kohm resistor -- BLUE
***************************************************************************/
void m57_state::palette(palette_device &palette) const
{
const uint8_t *color_prom = memregion("proms")->base();
// character palette
for (int i = 0; i < 256; i++)
{
int bit0, bit1, bit2;
// red component
bit0 = 0;
bit1 = BIT(color_prom[256], 2);
bit2 = BIT(color_prom[256], 3);
int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// green component
bit0 = BIT(color_prom[0], 3);
bit1 = BIT(color_prom[256], 0);
bit2 = BIT(color_prom[256], 1);
int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// blue component
bit0 = BIT(color_prom[0], 0);
bit1 = BIT(color_prom[0], 1);
bit2 = BIT(color_prom[0], 2);
int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
palette.set_indirect_color(i, rgb_t(r, g, b));
palette.set_pen_indirect(i, i);
color_prom++;
}
color_prom += 256;
// color_prom now points to the beginning of the sprite palette
// sprite palette
for (int i = 0; i < 16; i++)
{
int bit0, bit1, bit2;
// red component
bit0 = 0;
bit1 = BIT(*color_prom, 6);
bit2 = BIT(*color_prom, 7);
int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// green component
bit0 = BIT(*color_prom, 3);
bit1 = BIT(*color_prom, 4);
bit2 = BIT(*color_prom, 5);
int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// blue component
bit0 = BIT(*color_prom, 0);
bit1 = BIT(*color_prom, 1);
bit2 = BIT(*color_prom, 2);
int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
palette.set_indirect_color(i + 256, rgb_t(r, g, b));
color_prom++;
}
color_prom += 16;
// color_prom now points to the beginning of the sprite lookup table
// sprite lookup table
for (int i = 0; i < 32 * 8; i++)
{
palette.set_pen_indirect(i + 32 * 8, 256 + (~*color_prom & 0x0f));
color_prom++;
}
}
/*************************************
*
* Tilemap info callback
*
*************************************/
TILE_GET_INFO_MEMBER(m57_state::get_tile_info)
{
uint8_t const attr = m_videoram[tile_index * 2 + 0];
uint16_t const code = m_videoram[tile_index * 2 + 1] | ((attr & 0xc0) << 2);
tileinfo.set(0, code, attr & 0x0f, TILE_FLIPXY(attr >> 4));
}
/*************************************
*
* Video RAM access
*
*************************************/
void m57_state::videoram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset / 2);
}
/*************************************
*
* Video startup
*
*************************************/
void m57_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(m57_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bg_tilemap->set_scroll_rows(256);
save_item(NAME(m_flipscreen));
}
/*************************************
*
* Outputs
*
*************************************/
void m57_state::flipscreen_w(uint8_t data)
{
// screen flip is handled both by software and hardware
m_flipscreen = (data & 0x01) ^ (~m_dsw2->read() & 0x01);
m_bg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
machine().bookkeeping().coin_counter_w(0, data & 0x02);
machine().bookkeeping().coin_counter_w(1, data & 0x20);
}
/*************************************
*
* Background rendering
*
*************************************/
void m57_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// from 64 to 127: not wrapped
for (int y = 64; y < 128; y++)
m_bg_tilemap->set_scrollx(y, m_scrollram[0x40]);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
// from 128 to 255: wrapped
for (int y = 128; y <= cliprect.max_y; y++)
{
int16_t const scrolly = m_scrollram[y] + (m_scrollram[y + 0x100] << 8);
if (scrolly >= 0)
{
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
if ((x + scrolly) <= cliprect.max_x)
bitmap.pix(y, x) = bitmap.pix(y, x + scrolly);
else
bitmap.pix(y, x) = bitmap.pix(y, cliprect.max_x);
}
}
else
{
for (int x = cliprect.max_x; x >= cliprect.min_x; x--)
{
if ((x + scrolly) >= cliprect.min_x)
bitmap.pix(y, x) = bitmap.pix(y, x + scrolly);
else
bitmap.pix(y, x) = bitmap.pix(y, cliprect.min_x);
}
}
}
}
/*************************************
*
* Sprite rendering
*
*************************************/
void m57_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
uint8_t const attributes = m_spriteram[offs + 1];
int sx = m_spriteram[offs + 3];
int sy = ((224 - m_spriteram[offs + 0] - 32) & 0xff) + 32;
int const code = m_spriteram[offs + 2];
int const color = attributes & 0x1f;
int flipy = attributes & 0x80;
int flipx = attributes & 0x40;
int const tile_number = code & 0x3f;
int bank = 0;
if (code & 0x80) bank += 1;
if (attributes & 0x20) bank += 2;
if (m_flipscreen)
{
sx = 240 - sx;
sy = 224 - sy;
flipx = !flipx;
flipy = !flipy;
}
m_gfxdecode->gfx(1 + bank)->transmask(bitmap, cliprect,
tile_number,
color,
flipx, flipy,
sx, sy,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 256 + 15));
}
}
/*************************************
*
* Video update
*
*************************************/
uint32_t m57_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
draw_background(screen, bitmap, cliprect);
draw_sprites(bitmap, cliprect);
return 0;
}
/*************************************
@ -72,11 +368,11 @@
void m57_state::main_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0x87ff).ram().w(FUNC(m57_state::m57_videoram_w)).share("videoram");
map(0x9000, 0x91ff).ram().share("scrollram");
map(0xc820, 0xc8ff).writeonly().share("spriteram");
map(0x8000, 0x87ff).ram().w(FUNC(m57_state::videoram_w)).share(m_videoram);
map(0x9000, 0x91ff).ram().share(m_scrollram);
map(0xc820, 0xc8ff).writeonly().share(m_spriteram);
map(0xd000, 0xd000).w("irem_audio", FUNC(irem_audio_device::cmd_w));
map(0xd001, 0xd001).w(FUNC(m57_state::m57_flipscreen_w)); /* + coin counters */
map(0xd001, 0xd001).w(FUNC(m57_state::flipscreen_w)); // + coin counters
map(0xd000, 0xd000).portr("IN0");
map(0xd001, 0xd001).portr("IN1");
map(0xd002, 0xd002).portr("IN2");
@ -93,14 +389,14 @@ void m57_state::main_map(address_map &map)
*
*************************************/
/* Same as m52, m58 and m62 (IREM Z80 hardware) */
// Same as m52, m58 and m62 (IREM Z80 hardware)
static INPUT_PORTS_START( m57 )
PORT_START("IN0")
/* Start 1 & 2 also restarts and freezes the game with stop mode on
and are used in test mode to enter and esc the various tests */
and are used in test mode to enter and exit the various tests */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
/* coin input must be active for 19 frames to be consistently recognized */
// coin input must be active for 19 frames to be consistently recognized
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(19)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@ -125,7 +421,7 @@ static INPUT_PORTS_START( m57 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
/* DSW1 is so different from game to game that it isn't included here */
// DSW1 is so different from game to game that it isn't included here
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
@ -158,29 +454,29 @@ static INPUT_PORTS_START( troangel )
PORT_MODIFY("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* IPT_JOYSTICK_DOWN */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) /* IPT_JOYSTICK_UP */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_JOYSTICK_DOWN
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_JOYSTICK_UP
PORT_MODIFY("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* IPT_JOYSTICK_DOWN PORT_COCKTAIL */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) /* IPT_JOYSTICK_UP PORT_COCKTAIL */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_JOYSTICK_DOWN PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_JOYSTICK_UP PORT_COCKTAIL
PORT_MODIFY("DSW2")
/* TODO: the following enables an analog accelerator input read from 0xd003 */
/* however that is the DSW1 input so it must be multiplexed some way */
/* TODO: the following enables an analog accelerator input read from 0xd003
however that is the DSW1 input so it must be multiplexed some way */
PORT_DIPNAME( 0x08, 0x08, "Analog Accelerator" ) PORT_DIPLOCATION("SW2:4")
PORT_DIPSETTING( 0x08, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
/* In stop mode, press 2 to stop and 1 to restart */
// In stop mode, press 2 to stop and 1 to restart
PORT_DIPNAME( 0x10, 0x10, "Stop Mode (Cheat)") PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:6" )
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, "Time" ) PORT_DIPLOCATION("SW1:1,2") /* table at 0x6110 - 4 * 8 bytes (B1 B2 bonus A1 A2 bonus M1 M2) */
PORT_DIPNAME( 0x03, 0x03, "Time" ) PORT_DIPLOCATION("SW1:1,2") // table at 0x6110 - 4 * 8 bytes (B1 B2 bonus A1 A2 bonus M1 M2)
PORT_DIPSETTING( 0x03, "B:180/A:160/M:140/BG:120" )
PORT_DIPSETTING( 0x02, "B:160/A:140/M:120/BG:100" )
PORT_DIPSETTING( 0x01, "B:140/A:120/M:100/BG:80" )
@ -214,11 +510,11 @@ static const gfx_layout spritelayout =
};
static GFXDECODE_START( gfx_m57 )
GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x3_planar, 0, 32 )
GFXDECODE_ENTRY( "gfx2", 0x0000, spritelayout, 32*8, 32 )
GFXDECODE_ENTRY( "gfx2", 0x1000, spritelayout, 32*8, 32 )
GFXDECODE_ENTRY( "gfx2", 0x2000, spritelayout, 32*8, 32 )
GFXDECODE_ENTRY( "gfx2", 0x3000, spritelayout, 32*8, 32 )
GFXDECODE_ENTRY( "tiles", 0x0000, gfx_8x8x3_planar, 0, 32 )
GFXDECODE_ENTRY( "sprites", 0x0000, spritelayout, 32*8, 32 )
GFXDECODE_ENTRY( "sprites", 0x1000, spritelayout, 32*8, 32 )
GFXDECODE_ENTRY( "sprites", 0x2000, spritelayout, 32*8, 32 )
GFXDECODE_ENTRY( "sprites", 0x3000, spritelayout, 32*8, 32 )
GFXDECODE_END
@ -231,26 +527,26 @@ GFXDECODE_END
void m57_state::m57(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, XTAL(18'432'000)/6); /* verified on pcb */
// basic machine hardware
Z80(config, m_maincpu, 18.432_MHz_XTAL / 6); // verified on PCB
m_maincpu->set_addrmap(AS_PROGRAM, &m57_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(m57_state::irq0_line_hold));
/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(57);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(1790) /* accurate frequency, measured on a Moon Patrol board, is 56.75Hz. */);
/* the Lode Runner manual (similar but different hardware) */
/* talks about 55Hz and 1790ms vblank duration. */
screen.set_vblank_time(ATTOSECONDS_IN_USEC(1790)); // accurate frequency, measured on a Moon Patrol board, is 56.75Hz.
/* the Lode Runner manual (similar but different hardware)
talks about 55Hz and 1790ms vblank duration. */
screen.set_size(32*8, 32*8);
screen.set_visarea(1*8, 31*8-1, 1*8, 31*8-1);
screen.set_screen_update(FUNC(m57_state::screen_update_m57));
screen.set_screen_update(FUNC(m57_state::screen_update));
screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_m57);
PALETTE(config, m_palette, FUNC(m57_state::m57_palette), 32*8+32*8, 256+16);
PALETTE(config, m_palette, FUNC(m57_state::palette), 32*8+32*8, 256+16);
/* sound hardware */
// sound hardware
IREM_M52_SOUNDC_AUDIO(config, "irem_audio", 0);
}
@ -263,22 +559,22 @@ void m57_state::m57(machine_config &config)
*************************************/
ROM_START( troangel )
ROM_REGION( 0x10000, "maincpu", 0 ) /* main CPU */
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "ta-a-3k", 0x0000, 0x2000, CRC(f21f8196) SHA1(7cbf74b77a559ee70312b799e707394d9b849f5b) )
ROM_LOAD( "ta-a-3m", 0x2000, 0x2000, CRC(58801e55) SHA1(91bdda778f2c4486001bc4ad26d6f21ba275ae08) )
ROM_LOAD( "ta-a-3n", 0x4000, 0x2000, CRC(de3dea44) SHA1(1290755ffc04dc3b3667e063118669a0eab6fb79) )
ROM_LOAD( "ta-a-3q", 0x6000, 0x2000, CRC(fff0fc2a) SHA1(82f3f5a8817e956192323eb555daa85b7766676d) )
ROM_REGION( 0x8000 , "irem_audio:iremsound", 0 ) /* sound CPU */
ROM_REGION( 0x8000 , "irem_audio:iremsound", 0 )
ROM_LOAD( "ta-s-1a", 0x6000, 0x2000, CRC(15a83210) SHA1(8ada510db689ffa372b2f4dc4bd1b1c69a0c5307) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_REGION( 0x06000, "tiles", 0 )
ROM_LOAD( "ta-a-3e", 0x00000, 0x2000, CRC(e49f7ad8) SHA1(915de1084fd3c5fc81dd8c80107c28cc57b33226) )
ROM_LOAD( "ta-a-3d", 0x02000, 0x2000, CRC(06eef241) SHA1(4f327a54169046d8d84b5f5cf5d9f45e1df4dae6) )
ROM_LOAD( "ta-a-3c", 0x04000, 0x2000, CRC(7ff5482f) SHA1(fe8c181fed113007d69d11e8aa467e86a6357ffb) ) /* characters */
ROM_LOAD( "ta-a-3c", 0x04000, 0x2000, CRC(7ff5482f) SHA1(fe8c181fed113007d69d11e8aa467e86a6357ffb) )
ROM_REGION( 0x0c000, "gfx2", 0 )
ROM_LOAD( "ta-b-5j", 0x00000, 0x2000, CRC(86895c0c) SHA1(b42b041e3e20dadd8411805d492133d371426ebf) ) /* sprites */
ROM_REGION( 0x0c000, "sprites", 0 )
ROM_LOAD( "ta-b-5j", 0x00000, 0x2000, CRC(86895c0c) SHA1(b42b041e3e20dadd8411805d492133d371426ebf) )
ROM_LOAD( "ta-b-5h", 0x02000, 0x2000, CRC(f8cff29d) SHA1(dabf3bbf50f73a381056131c2239c84dd966b63e) )
ROM_LOAD( "ta-b-5e", 0x04000, 0x2000, CRC(8b21ee9a) SHA1(1272722211d22d5b153e9415cc189a5aa9028543) )
ROM_LOAD( "ta-b-5d", 0x06000, 0x2000, CRC(cd473d47) SHA1(854cb532bd62851a206da2affd66a1257b7085b6) )
@ -286,29 +582,29 @@ ROM_START( troangel )
ROM_LOAD( "ta-b-5a", 0x0a000, 0x2000, CRC(0012792a) SHA1(b4380f5fbe5e9ce9b44f87ce48a8b402bab58b52) )
ROM_REGION( 0x0320, "proms", 0 )
ROM_LOAD( "ta-a-5a", 0x0000, 0x0100, CRC(01de1167) SHA1(b9070f8c70eb362fc4d6a0a92235ce0a5b2ab858) ) /* chars palette low 4 bits */
ROM_LOAD( "ta-a-5b", 0x0100, 0x0100, CRC(efd11d4b) SHA1(7c7c356063ab35e4ffb8d65cd20c27c2a4b36537) ) /* chars palette high 4 bits */
ROM_LOAD( "ta-b-1b", 0x0200, 0x0020, CRC(f94911ea) SHA1(ad61a323476a97156a255a72048a28477b421284) ) /* sprites palette */
ROM_LOAD( "ta-b-3d", 0x0220, 0x0100, CRC(ed3e2aa4) SHA1(cfdfc151803080d1ecdd04af1bfea3dbdce8dca0) ) /* sprites lookup table */
ROM_LOAD( "ta-a-5a", 0x0000, 0x0100, CRC(01de1167) SHA1(b9070f8c70eb362fc4d6a0a92235ce0a5b2ab858) ) // chars palette low 4 bits
ROM_LOAD( "ta-a-5b", 0x0100, 0x0100, CRC(efd11d4b) SHA1(7c7c356063ab35e4ffb8d65cd20c27c2a4b36537) ) // chars palette high 4 bits
ROM_LOAD( "ta-b-1b", 0x0200, 0x0020, CRC(f94911ea) SHA1(ad61a323476a97156a255a72048a28477b421284) ) // sprites palette
ROM_LOAD( "ta-b-3d", 0x0220, 0x0100, CRC(ed3e2aa4) SHA1(cfdfc151803080d1ecdd04af1bfea3dbdce8dca0) ) // sprites lookup table
ROM_END
ROM_START( newtangl ) /* Offical "upgrade" or hack? */
ROM_REGION( 0x10000, "maincpu", 0 ) /* main CPU */
ROM_START( newtangl ) // Official "upgrade" or hack?
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "3k", 0x0000, 0x2000, CRC(3c6299a8) SHA1(a21a8452b75ce6174076878128d4f20b39b6d69d) )
ROM_LOAD( "3m", 0x2000, 0x2000, CRC(8d09056c) SHA1(4d2585103cc6e6c04015501d3c9e1578a8f9c0f5) )
ROM_LOAD( "3n", 0x4000, 0x2000, CRC(17b5a775) SHA1(d85c3371080bea82f19ac96fa0f1b332e1c86e27) )
ROM_LOAD( "3q", 0x6000, 0x2000, CRC(2e5fa773) SHA1(9a34fa43bde021fc7b00d8c3762c248e7b96dbf1) )
ROM_REGION( 0x8000 , "irem_audio:iremsound", 0 ) /* sound CPU */
ROM_REGION( 0x8000 , "irem_audio:iremsound", 0 )
ROM_LOAD( "ta-s-1a-", 0x6000, 0x2000, CRC(ea8a05cb) SHA1(5683e4dca93066ee788287ab73a766fa303ebe84) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_REGION( 0x06000, "tiles", 0 )
ROM_LOAD( "ta-a-3e", 0x00000, 0x2000, CRC(e49f7ad8) SHA1(915de1084fd3c5fc81dd8c80107c28cc57b33226) )
ROM_LOAD( "ta-a-3d", 0x02000, 0x2000, CRC(06eef241) SHA1(4f327a54169046d8d84b5f5cf5d9f45e1df4dae6) )
ROM_LOAD( "ta-a-3c", 0x04000, 0x2000, CRC(7ff5482f) SHA1(fe8c181fed113007d69d11e8aa467e86a6357ffb) ) /* characters */
ROM_LOAD( "ta-a-3c", 0x04000, 0x2000, CRC(7ff5482f) SHA1(fe8c181fed113007d69d11e8aa467e86a6357ffb) )
ROM_REGION( 0x0c000, "gfx2", 0 )
ROM_LOAD( "5j", 0x00000, 0x2000, CRC(89409130) SHA1(3f37f820b1b86166cde7c039d657ebd036d490dd) ) /* sprites */
ROM_REGION( 0x0c000, "sprites", 0 )
ROM_LOAD( "5j", 0x00000, 0x2000, CRC(89409130) SHA1(3f37f820b1b86166cde7c039d657ebd036d490dd) )
ROM_LOAD( "ta-b-5h", 0x02000, 0x2000, CRC(f8cff29d) SHA1(dabf3bbf50f73a381056131c2239c84dd966b63e) )
ROM_LOAD( "5e", 0x04000, 0x2000, CRC(5460a467) SHA1(505c1d9e69c39a74369da17f354b90486ee6afcd) )
ROM_LOAD( "ta-b-5d", 0x06000, 0x2000, CRC(cd473d47) SHA1(854cb532bd62851a206da2affd66a1257b7085b6) )
@ -316,12 +612,13 @@ ROM_START( newtangl ) /* Offical "upgrade" or hack? */
ROM_LOAD( "ta-b-5a", 0x0a000, 0x2000, CRC(0012792a) SHA1(b4380f5fbe5e9ce9b44f87ce48a8b402bab58b52) )
ROM_REGION( 0x0320, "proms", 0 )
ROM_LOAD( "ta-a-5a", 0x0000, 0x0100, CRC(01de1167) SHA1(b9070f8c70eb362fc4d6a0a92235ce0a5b2ab858) ) /* chars palette low 4 bits */
ROM_LOAD( "ta-a-5b", 0x0100, 0x0100, CRC(efd11d4b) SHA1(7c7c356063ab35e4ffb8d65cd20c27c2a4b36537) ) /* chars palette high 4 bits */
ROM_LOAD( "ta-b-1b", 0x0200, 0x0020, CRC(f94911ea) SHA1(ad61a323476a97156a255a72048a28477b421284) ) /* sprites palette */
ROM_LOAD( "ta-b-3d", 0x0220, 0x0100, CRC(ed3e2aa4) SHA1(cfdfc151803080d1ecdd04af1bfea3dbdce8dca0) ) /* sprites lookup table */
ROM_LOAD( "ta-a-5a", 0x0000, 0x0100, CRC(01de1167) SHA1(b9070f8c70eb362fc4d6a0a92235ce0a5b2ab858) ) // chars palette low 4 bits
ROM_LOAD( "ta-a-5b", 0x0100, 0x0100, CRC(efd11d4b) SHA1(7c7c356063ab35e4ffb8d65cd20c27c2a4b36537) ) // chars palette high 4 bits
ROM_LOAD( "ta-b-1b", 0x0200, 0x0020, CRC(f94911ea) SHA1(ad61a323476a97156a255a72048a28477b421284) ) // sprites palette
ROM_LOAD( "ta-b-3d", 0x0220, 0x0100, CRC(ed3e2aa4) SHA1(cfdfc151803080d1ecdd04af1bfea3dbdce8dca0) ) // sprites lookup table
ROM_END
} // anonymous namespace
/*************************************
@ -330,5 +627,5 @@ ROM_END
*
*************************************/
GAME( 1983, troangel, 0, m57, troangel, m57_state, empty_init, ROT0, "Irem", "Tropical Angel", MACHINE_SUPPORTS_SAVE )
GAME( 1983, troangel, 0, m57, troangel, m57_state, empty_init, ROT0, "Irem", "Tropical Angel", MACHINE_SUPPORTS_SAVE )
GAME( 1983, newtangl, troangel, m57, troangel, m57_state, empty_init, ROT0, "Irem", "New Tropical Angel", MACHINE_SUPPORTS_SAVE )

View File

@ -1,49 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
#ifndef MAME_IREM_M57_H
#define MAME_IREM_M57_H
#pragma once
#include "emupal.h"
#include "tilemap.h"
class m57_state : public driver_device
{
public:
m57_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_scrollram(*this, "scrollram"),
m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette")
{ }
void m57(machine_config &config);
private:
/* memory pointers */
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_scrollram;
required_shared_ptr<uint8_t> m_spriteram;
/* video-related */
tilemap_t* m_bg_tilemap = nullptr;
int m_flipscreen = 0;
void m57_videoram_w(offs_t offset, uint8_t data);
void m57_flipscreen_w(uint8_t data);
TILE_GET_INFO_MEMBER(get_tile_info);
virtual void video_start() override;
void m57_palette(palette_device &palette) const;
uint32_t screen_update_m57(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_background(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<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
void main_map(address_map &map);
};
#endif // MAME_IREM_M57_H

View File

@ -1,263 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
/****************************************************************************
Irem M57 hardware
****************************************************************************/
#include "emu.h"
#include "m57.h"
/***************************************************************************
Convert the color PROMs into a more useable format.
Tropical Angel has two 256x4 character palette PROMs, one 32x8 sprite
palette PROM, and one 256x4 sprite color lookup table PROM.
I don't know for sure how the palette PROMs are connected to the RGB
output, but it's probably something like this; note that RED and BLUE
are swapped wrt the usual configuration.
bit 7 -- 220 ohm resistor -- RED
-- 470 ohm resistor -- RED
-- 220 ohm resistor -- GREEN
-- 470 ohm resistor -- GREEN
-- 1 kohm resistor -- GREEN
-- 220 ohm resistor -- BLUE
-- 470 ohm resistor -- BLUE
bit 0 -- 1 kohm resistor -- BLUE
***************************************************************************/
void m57_state::m57_palette(palette_device &palette) const
{
const uint8_t *color_prom = memregion("proms")->base();
// character palette
for (int i = 0; i < 256; i++)
{
int bit0, bit1, bit2;
// red component
bit0 = 0;
bit1 = BIT(color_prom[256], 2);
bit2 = BIT(color_prom[256], 3);
int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// green component
bit0 = BIT(color_prom[0], 3);
bit1 = BIT(color_prom[256], 0);
bit2 = BIT(color_prom[256], 1);
int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// blue component
bit0 = BIT(color_prom[0], 0);
bit1 = BIT(color_prom[0], 1);
bit2 = BIT(color_prom[0], 2);
int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
palette.set_indirect_color(i, rgb_t(r, g, b));
palette.set_pen_indirect(i, i);
color_prom++;
}
color_prom += 256;
// color_prom now points to the beginning of the sprite palette
// sprite palette
for (int i = 0; i < 16; i++)
{
int bit0, bit1, bit2;
// red component
bit0 = 0;
bit1 = BIT(*color_prom, 6);
bit2 = BIT(*color_prom, 7);
int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// green component
bit0 = BIT(*color_prom, 3);
bit1 = BIT(*color_prom, 4);
bit2 = BIT(*color_prom, 5);
int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// blue component
bit0 = BIT(*color_prom, 0);
bit1 = BIT(*color_prom, 1);
bit2 = BIT(*color_prom, 2);
int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
palette.set_indirect_color(i + 256, rgb_t(r, g, b));
color_prom++;
}
color_prom += 16;
// color_prom now points to the beginning of the sprite lookup table
// sprite lookup table
for (int i = 0; i < 32 * 8; i++)
{
palette.set_pen_indirect(i + 32 * 8, 256 + (~*color_prom & 0x0f));
color_prom++;
}
}
/*************************************
*
* Tilemap info callback
*
*************************************/
TILE_GET_INFO_MEMBER(m57_state::get_tile_info)
{
uint8_t attr = m_videoram[tile_index * 2 + 0];
uint16_t code = m_videoram[tile_index * 2 + 1] | ((attr & 0xc0) << 2);
tileinfo.set(0, code, attr & 0x0f, TILE_FLIPXY(attr >> 4));
}
/*************************************
*
* Video RAM access
*
*************************************/
void m57_state::m57_videoram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset / 2);
}
/*************************************
*
* Video startup
*
*************************************/
void m57_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(m57_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bg_tilemap->set_scroll_rows(256);
save_item(NAME(m_flipscreen));
}
/*************************************
*
* Outputs
*
*************************************/
void m57_state::m57_flipscreen_w(uint8_t data)
{
/* screen flip is handled both by software and hardware */
m_flipscreen = (data & 0x01) ^ (~ioport("DSW2")->read() & 0x01);
m_bg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
machine().bookkeeping().coin_counter_w(0,data & 0x02);
machine().bookkeeping().coin_counter_w(1,data & 0x20);
}
/*************************************
*
* Background rendering
*
*************************************/
void m57_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// from 64 to 127: not wrapped
for (int y = 64; y < 128; y++)
m_bg_tilemap->set_scrollx(y, m_scrollram[0x40]);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
// from 128 to 255: wrapped
for (int y = 128; y <= cliprect.max_y; y++)
{
int16_t const scrolly = m_scrollram[y] + (m_scrollram[y + 0x100] << 8);
if (scrolly >= 0)
{
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
if ((x + scrolly) <= cliprect.max_x)
bitmap.pix(y, x) = bitmap.pix(y, x + scrolly);
else
bitmap.pix(y, x) = bitmap.pix(y, cliprect.max_x);
}
}
else
{
for (int x = cliprect.max_x; x >= cliprect.min_x; x--)
{
if ((x + scrolly) >= cliprect.min_x)
bitmap.pix(y, x) = bitmap.pix(y, x + scrolly);
else
bitmap.pix(y, x) = bitmap.pix(y, cliprect.min_x);
}
}
}
}
/*************************************
*
* Sprite rendering
*
*************************************/
void m57_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int offs;
for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
uint8_t attributes = m_spriteram[offs + 1];
int sx = m_spriteram[offs + 3];
int sy = ((224 - m_spriteram[offs + 0] - 32) & 0xff) + 32;
int code = m_spriteram[offs + 2];
int color = attributes & 0x1f;
int flipy = attributes & 0x80;
int flipx = attributes & 0x40;
int tile_number = code & 0x3f;
int bank = 0;
if (code & 0x80) bank += 1;
if (attributes & 0x20) bank += 2;
if (m_flipscreen)
{
sx = 240 - sx;
sy = 224 - sy;
flipx = !flipx;
flipy = !flipy;
}
m_gfxdecode->gfx(1 + bank)->transmask(bitmap,cliprect,
tile_number,
color,
flipx, flipy,
sx, sy,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 256 + 15));
}
}
/*************************************
*
* Video update
*
*************************************/
uint32_t m57_state::screen_update_m57(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
draw_background(screen, bitmap, cliprect);
draw_sprites(bitmap, cliprect);
return 0;
}

View File

@ -1,6 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Lee Taylor
// thanks-to:John Clegg
// copyright-holders: Lee Taylor
// thanks-to: John Clegg
/****************************************************************************
Irem M58 hardware
@ -13,12 +14,361 @@
****************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
#include "irem.h"
#include "iremipt.h"
#include "m58.h"
#define MASTER_CLOCK XTAL(18'432'000)
#include "cpu/z80/z80.h"
#include "video/resnet.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
namespace {
class m58_state : public driver_device
{
public:
m58_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_screen(*this, "screen"),
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_scroll_x_low(*this, "scroll_x_low"),
m_scroll_x_high(*this, "scroll_x_high"),
m_scroll_y_low(*this, "scroll_y_low"),
m_score_panel_disabled(*this, "score_disable"),
m_dsw2(*this, "DSW2")
{ }
void yard(machine_config &config);
protected:
virtual void video_start() override;
private:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_scroll_x_low;
required_shared_ptr<uint8_t> m_scroll_x_high;
required_shared_ptr<uint8_t> m_scroll_y_low;
required_shared_ptr<uint8_t> m_score_panel_disabled;
required_ioport m_dsw2;
tilemap_t* m_bg_tilemap = nullptr;
bitmap_ind16 m_scroll_panel_bitmap;
void videoram_w(offs_t offset, uint8_t data);
void scroll_panel_w(offs_t offset, uint8_t data);
void flipscreen_w(uint8_t data);
void palette(palette_device &palette) const;
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILEMAP_MAPPER_MEMBER(tilemap_scan_rows);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_panel(bitmap_ind16 &bitmap, const rectangle &cliprect);
void yard_map(address_map &map);
};
/*************************************
*
* Palette configuration
*
*************************************/
void m58_state::palette(palette_device &palette) const
{
uint8_t const *const color_prom = memregion("proms")->base();
uint8_t const *const char_lopal = color_prom + 0x000;
uint8_t const *const char_hipal = color_prom + 0x100;
uint8_t const *const sprite_pal = color_prom + 0x200;
uint8_t const *const sprite_table = color_prom + 0x220;
uint8_t const *const radar_lopal = color_prom + 0x320;
uint8_t const *const radar_hipal = color_prom + 0x420;
static constexpr int resistances_3[3] = { 1000, 470, 220 };
static constexpr int resistances_2[2] = { 470, 220 };
double weights_r[3], weights_g[3], weights_b[3], scale;
// compute palette information for characters/radar
scale = compute_resistor_weights(0, 255, -1.0,
2, resistances_2, weights_r, 0, 0,
3, resistances_3, weights_g, 0, 0,
3, resistances_3, weights_b, 0, 0);
// character palette
for (int i = 0; i < 256; i++)
{
uint8_t const promval = (char_lopal[i] & 0x0f) | (char_hipal[i] << 4);
int const r = combine_weights(weights_r, BIT(promval, 6), BIT(promval, 7));
int const g = combine_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int const b = combine_weights(weights_b, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
palette.set_indirect_color(i, rgb_t(r, g, b));
}
// radar palette
for (int i = 0; i < 256; i++)
{
uint8_t const promval = (radar_lopal[i] & 0x0f) | (radar_hipal[i] << 4);
int const r = combine_weights(weights_r, BIT(promval, 6), BIT(promval, 7));
int const g = combine_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int const b = combine_weights(weights_b, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
palette.set_indirect_color(256 + i, rgb_t(r, g, b));
}
// compute palette information for sprites
scale = compute_resistor_weights(0, 255, scale,
2, resistances_2, weights_r, 470, 0,
3, resistances_3, weights_g, 470, 0,
3, resistances_3, weights_b, 470, 0);
// sprite palette
for (int i = 0; i < 16; i++)
{
uint8_t const promval = sprite_pal[i];
int const r = combine_weights(weights_r, BIT(promval, 6), BIT(promval, 7));
int const g = combine_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int const b = combine_weights(weights_b, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
palette.set_indirect_color(256 + 256 + i, rgb_t(r, g, b));
}
// character lookup table
for (int i = 0; i < 256; i++)
palette.set_pen_indirect(i, i);
// radar lookup table
for (int i = 0; i < 256; i++)
palette.set_pen_indirect(256 + i, 256 + i);
// sprite lookup table
for (int i = 0; i < 256; i++)
{
uint8_t const promval = sprite_table[i] & 0x0f;
palette.set_pen_indirect(256 + 256 + i, 256 + 256 + promval);
}
}
/*************************************
*
* Video RAM access
*
*************************************/
void m58_state::videoram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset / 2);
}
void m58_state::scroll_panel_w(offs_t offset, uint8_t data)
{
int sx = (offset % 16);
int const sy = (offset / 16);
if (sx < 1 || sx > 14)
return;
sx = 4 * (sx - 1);
for (int i = 0; i < 4; i++)
{
int col = (data >> i) & 0x11;
col = ((col >> 3) | col) & 3;
m_scroll_panel_bitmap.pix(sy, sx + i) = 0x100 + (sy & 0xfc) + col;
m_scroll_panel_bitmap.pix(sy, sx + i + 0x2c8) = 0x100 + (sy & 0xfc) + col; // for flipscreen
}
}
/*************************************
*
* Tilemap info callback
*
*************************************/
TILE_GET_INFO_MEMBER(m58_state::get_bg_tile_info)
{
int const offs = tile_index * 2;
int const attr = m_videoram[offs + 1];
int const code = m_videoram[offs] + ((attr & 0xc0) << 2);
int const color = attr & 0x1f;
int const flags = (attr & 0x20) ? TILE_FLIPX : 0;
tileinfo.set(0, code, color, flags);
}
TILEMAP_MAPPER_MEMBER(m58_state::tilemap_scan_rows)
{
// logical (col,row) -> memory offset
if (col >= 32)
return (row + 32) * 32 + col - 32;
else
return row * 32 + col;
}
/*************************************
*
* Video startup
*
*************************************/
void m58_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(m58_state::get_bg_tile_info)), tilemap_mapper_delegate(*this, FUNC(m58_state::tilemap_scan_rows)), 8, 8, 64, 32);
m_bg_tilemap->set_scrolldy(26, 26);
m_screen->register_screen_bitmap(m_scroll_panel_bitmap);
save_item(NAME(m_scroll_panel_bitmap));
}
/*************************************
*
* Outputs
*
*************************************/
void m58_state::flipscreen_w(uint8_t data)
{
// screen flip is handled both by software and hardware
flip_screen_set(BIT(data, 0) ^ BIT(~m_dsw2->read(), 0));
machine().bookkeeping().coin_counter_w(0, data & 0x02);
machine().bookkeeping().coin_counter_w(1, data & 0x20);
}
/*************************************
*
* Sprite rendering
*
*************************************/
void m58_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
const rectangle &visarea = m_screen->visible_area();
for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
int const attr = m_spriteram[offs + 1];
int const bank = (attr & 0x20) >> 5;
int code1 = m_spriteram[offs + 2] & 0xbf;
int code2 = 0;
int const color = attr & 0x1f;
int flipx = attr & 0x40;
int flipy = attr & 0x80;
int sx = m_spriteram[offs + 3];
int sy1 = 210 - m_spriteram[offs];
int sy2 = 0;
if (flipy)
{
code2 = code1;
code1 += 0x40;
}
else
{
code2 = code1 + 0x40;
}
if (flip_screen())
{
sx = 240 - sx;
sy2 = 192 - sy1;
sy1 = sy2 + 0x10;
flipx = !flipx;
flipy = !flipy;
}
else
{
sy2 = sy1 + 0x10;
}
m_gfxdecode->gfx(1)->transmask(bitmap, cliprect,
code1 + 256 * bank, color,
flipx, flipy, sx, visarea.min_y + sy1,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 512)
);
m_gfxdecode->gfx(1)->transmask(bitmap, cliprect,
code2 + 256 * bank, color,
flipx, flipy, sx, visarea.min_y + sy2,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 512)
);
}
}
/*************************************
*
* Radar panel rendering
*
*************************************/
void m58_state::draw_panel(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
if (!*m_score_panel_disabled)
{
const rectangle clippanel(26*8, 32*8-1, 1*8, 31*8-1);
const rectangle clippanelflip(0*8, 6*8-1, 1*8, 31*8-1);
rectangle clip = flip_screen() ? clippanelflip : clippanel;
const rectangle &visarea = m_screen->visible_area();
int const sx = flip_screen() ? cliprect.min_x - 8 : cliprect.max_x + 1 - 14*4;
int const yoffs = flip_screen() ? -40 : -16;
clip.min_y += visarea.min_y + yoffs;
clip.max_y += visarea.max_y + yoffs;
clip &= cliprect;
copybitmap(bitmap, m_scroll_panel_bitmap, flip_screen(), flip_screen(), sx, visarea.min_y + yoffs, clip);
}
}
/*************************************
*
* Video update
*
*************************************/
uint32_t m58_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->set_scrollx(0, (*m_scroll_x_high * 0x100) + *m_scroll_x_low);
m_bg_tilemap->set_scrolly(0, *m_scroll_y_low);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
draw_sprites(bitmap, cliprect);
draw_panel(bitmap, cliprect);
return 0;
}
/*************************************
@ -30,15 +380,15 @@
void m58_state::yard_map(address_map &map)
{
map(0x0000, 0x5fff).rom();
map(0x8000, 0x8fff).ram().w(FUNC(m58_state::videoram_w)).share("videoram");
map(0x8000, 0x8fff).ram().w(FUNC(m58_state::videoram_w)).share(m_videoram);
map(0x9000, 0x9fff).w(FUNC(m58_state::scroll_panel_w));
map(0xc820, 0xc87f).ram().share("spriteram");
map(0xa000, 0xa000).ram().share("scroll_x_low");
map(0xa200, 0xa200).ram().share("scroll_x_high");
map(0xa400, 0xa400).ram().share("scroll_y_low");
map(0xa800, 0xa800).ram().share("score_disable");
map(0xc820, 0xc87f).ram().share(m_spriteram);
map(0xa000, 0xa000).ram().share(m_scroll_x_low);
map(0xa200, 0xa200).ram().share(m_scroll_x_high);
map(0xa400, 0xa400).ram().share(m_scroll_y_low);
map(0xa800, 0xa800).ram().share(m_score_panel_disabled);
map(0xd000, 0xd000).w("irem_audio", FUNC(irem_audio_device::cmd_w));
map(0xd001, 0xd001).w(FUNC(m58_state::flipscreen_w)); /* + coin counters */
map(0xd001, 0xd001).w(FUNC(m58_state::flipscreen_w)); // + coin counters
map(0xd000, 0xd000).portr("IN0");
map(0xd001, 0xd001).portr("IN1");
map(0xd002, 0xd002).portr("IN2");
@ -55,14 +405,14 @@ void m58_state::yard_map(address_map &map)
*
*************************************/
/* Same as m52, m57 and m62 (IREM Z80 hardware) */
// Same as m52, m57 and m62 (IREM Z80 hardware)
static INPUT_PORTS_START( m58 )
PORT_START("IN0")
/* Start 1 & 2 also restarts and freezes the game with stop mode on
and are used in test mode to enter and esc the various tests */
and are used in test mode to enter and exit the various tests */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
/* coin input must be active for 19 frames to be consistently recognized */
// coin input must be active for 19 frames to be consistently recognized
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(19)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@ -87,7 +437,7 @@ static INPUT_PORTS_START( m58 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
/* DSW1 is so different from game to game that it isn't included here */
// DSW1 is so different from game to game that it isn't included here
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
@ -118,14 +468,14 @@ static INPUT_PORTS_START( yard )
PORT_INCLUDE(m58)
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x08, 0x08, "Slow Motion (Cheat)" ) PORT_DIPLOCATION("SW2:4") /* Listed as "Unused" */
PORT_DIPNAME( 0x08, 0x08, "Slow Motion (Cheat)" ) PORT_DIPLOCATION("SW2:4") // Listed as "Unused"
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* In stop mode, press 2 to stop and 1 to restart */
PORT_DIPNAME( 0x10, 0x10, "Stop Mode (Cheat)") PORT_DIPLOCATION("SW2:5") /* Listed as "Unused" */
// In stop mode, press 2 to stop and 1 to restart
PORT_DIPNAME( 0x10, 0x10, "Stop Mode (Cheat)") PORT_DIPLOCATION("SW2:5") // Listed as "Unused"
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, "Level Select (Cheat)" ) PORT_DIPLOCATION("SW2:6") /* Listed as "Unused" */
PORT_DIPNAME( 0x20, 0x20, "Level Select (Cheat)" ) PORT_DIPLOCATION("SW2:6") // Listed as "Unused"
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@ -147,7 +497,7 @@ static INPUT_PORTS_START( vs10yarj )
PORT_DIPNAME( 0x01, 0x01, "Allow Continue (Vs. Mode)" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x01, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
PORT_DIPNAME( 0x02, 0x02, "Defensive Man Pause" ) PORT_DIPLOCATION("SW1:2") /* Listed as "Unused" */
PORT_DIPNAME( 0x02, 0x02, "Defensive Man Pause" ) PORT_DIPLOCATION("SW1:2") // Listed as "Unused"
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@ -156,7 +506,7 @@ static INPUT_PORTS_START( vs10yard )
PORT_INCLUDE(vs10yarj)
PORT_MODIFY("IN1")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* additional test at 0x46e0 on interruption - must be 0 */
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // additional test at 0x46e0 on interruption - must be 0
INPUT_PORTS_END
@ -180,8 +530,8 @@ static const gfx_layout spritelayout =
static GFXDECODE_START( gfx_yard )
GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 )
GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 512, 32 )
GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x3_planar, 0, 32 )
GFXDECODE_ENTRY( "sprites", 0, spritelayout, 512, 32 )
GFXDECODE_END
@ -194,21 +544,21 @@ GFXDECODE_END
void m58_state::yard(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, MASTER_CLOCK/3/2);
// basic machine hardware
Z80(config, m_maincpu, 18.432_MHz_XTAL / 3 / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &m58_state::yard_map);
m_maincpu->set_vblank_int("screen", FUNC(m58_state::irq0_line_hold));
/* video hardware */
// video hardware
GFXDECODE(config, m_gfxdecode, m_palette, gfx_yard);
PALETTE(config, m_palette, FUNC(m58_state::m58_palette), 256+256+256, 256+256+16);
PALETTE(config, m_palette, FUNC(m58_state::palette), 256+256+256, 256+256+16);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(MASTER_CLOCK/3, 384, 0, 256, 282, 42, 266);
m_screen->set_raw(18.432_MHz_XTAL / 3, 384, 0, 256, 282, 42, 266);
m_screen->set_screen_update(FUNC(m58_state::screen_update));
m_screen->set_palette(m_palette);
/* sound hardware */
// sound hardware
IREM_M52_LARGE_AUDIO(config, "irem_audio", 0);
}
@ -232,13 +582,13 @@ ROM_START( 10yard ) // Dumped from an original Irem M52 board. Serial no. 307761
ROM_LOAD( "yf-s.3a", 0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
ROM_LOAD( "yf-s.1a", 0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_LOAD( "yf-a.3e", 0x00000, 0x2000, CRC(77e9e9cc) SHA1(90b0226fc125713dbee2804aeceeb5aa2c8e275e) ) /* chars */
ROM_REGION( 0x06000, "tiles", 0 )
ROM_LOAD( "yf-a.3e", 0x00000, 0x2000, CRC(77e9e9cc) SHA1(90b0226fc125713dbee2804aeceeb5aa2c8e275e) )
ROM_LOAD( "yf-a.3d", 0x02000, 0x2000, CRC(854d5ff4) SHA1(9ba09bfabf159facb57faecfe73a6258fa48d152) )
ROM_LOAD( "yf-a.3c", 0x04000, 0x2000, CRC(0cd8ffad) SHA1(bd1262de3823c34f7394b718477fb5bc58a6e293) )
ROM_REGION( 0x0c000, "gfx2", 0 )
ROM_LOAD( "yf-b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) ) /* sprites */
ROM_REGION( 0x0c000, "sprites", 0 )
ROM_LOAD( "yf-b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )
ROM_LOAD( "yf-b.5c", 0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
ROM_LOAD( "yf-b.5f", 0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
ROM_LOAD( "yf-b.5e", 0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
@ -246,12 +596,12 @@ ROM_START( 10yard ) // Dumped from an original Irem M52 board. Serial no. 307761
ROM_LOAD( "yf-b.5k", 0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
ROM_REGION( 0x0520, "proms", 0 )
ROM_LOAD( "yard.1c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
ROM_LOAD( "yard.1d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
ROM_LOAD( "yard.1f", 0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) /* sprites palette */
ROM_LOAD( "yard.2h", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
ROM_LOAD( "yard.2n", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
ROM_LOAD( "yard.2m", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
ROM_LOAD( "yard.1c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) // chars palette low 4 bits
ROM_LOAD( "yard.1d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) // chars palette high 4 bits
ROM_LOAD( "yard.1f", 0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) // sprites palette
ROM_LOAD( "yard.2h", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) // sprites lookup table
ROM_LOAD( "yard.2n", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) // radar palette low 4 bits
ROM_LOAD( "yard.2m", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) // radar palette high 4 bits
ROM_END
ROM_START( 10yardj )
@ -266,13 +616,13 @@ ROM_START( 10yardj )
ROM_LOAD( "yf-s.3a", 0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
ROM_LOAD( "yf-s.1a", 0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_LOAD( "yf-a.3e", 0x00000, 0x2000, CRC(77e9e9cc) SHA1(90b0226fc125713dbee2804aeceeb5aa2c8e275e) ) /* chars */
ROM_REGION( 0x06000, "tiles", 0 )
ROM_LOAD( "yf-a.3e", 0x00000, 0x2000, CRC(77e9e9cc) SHA1(90b0226fc125713dbee2804aeceeb5aa2c8e275e) )
ROM_LOAD( "yf-a.3d", 0x02000, 0x2000, CRC(854d5ff4) SHA1(9ba09bfabf159facb57faecfe73a6258fa48d152) )
ROM_LOAD( "yf-a.3c", 0x04000, 0x2000, CRC(0cd8ffad) SHA1(bd1262de3823c34f7394b718477fb5bc58a6e293) )
ROM_REGION( 0x0c000, "gfx2", 0 )
ROM_LOAD( "yf-b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) ) /* sprites */
ROM_REGION( 0x0c000, "sprites", 0 )
ROM_LOAD( "yf-b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )
ROM_LOAD( "yf-b.5c", 0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
ROM_LOAD( "yf-b.5f", 0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
ROM_LOAD( "yf-b.5e", 0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
@ -280,12 +630,12 @@ ROM_START( 10yardj )
ROM_LOAD( "yf-b.5k", 0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
ROM_REGION( 0x0520, "proms", 0 )
ROM_LOAD( "yard.1c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
ROM_LOAD( "yard.1d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
ROM_LOAD( "yard.1f", 0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) /* sprites palette */
ROM_LOAD( "yard.2h", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
ROM_LOAD( "yard.2n", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
ROM_LOAD( "yard.2m", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
ROM_LOAD( "yard.1c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) // chars palette low 4 bits
ROM_LOAD( "yard.1d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) // chars palette high 4 bits
ROM_LOAD( "yard.1f", 0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) // sprites palette
ROM_LOAD( "yard.2h", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) // sprites lookup table
ROM_LOAD( "yard.2n", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) // radar palette low 4 bits
ROM_LOAD( "yard.2m", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) // radar palette high 4 bits
ROM_END
ROM_START( vs10yard )
@ -300,13 +650,13 @@ ROM_START( vs10yard )
ROM_LOAD( "yf-s.3a", 0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
ROM_LOAD( "yf-s.1a", 0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_LOAD( "vyf-a.3a", 0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) ) /* chars */
ROM_REGION( 0x06000, "tiles", 0 )
ROM_LOAD( "vyf-a.3a", 0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) )
ROM_LOAD( "vyf-a.3c", 0x02000, 0x2000, CRC(f48eedca) SHA1(6aef3208de8b1dd4078de20c0b5ce96219c79d40) )
ROM_LOAD( "vyf-a.3d", 0x04000, 0x2000, CRC(7d1b4d93) SHA1(9389de1230b93f529c492af6fb911c00280cae8a) )
ROM_REGION( 0x0c000, "gfx2", 0 )
ROM_LOAD( "yf-b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) ) /* sprites */
ROM_REGION( 0x0c000, "sprites", 0 )
ROM_LOAD( "yf-b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )
ROM_LOAD( "yf-b.5c", 0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
ROM_LOAD( "yf-b.5f", 0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
ROM_LOAD( "yf-b.5e", 0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
@ -314,12 +664,12 @@ ROM_START( vs10yard )
ROM_LOAD( "yf-b.5k", 0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
ROM_REGION( 0x0520, "proms", 0 )
ROM_LOAD( "yard.1c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
ROM_LOAD( "yard.1d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
ROM_LOAD( "yard.1f", 0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) /* sprites palette */
ROM_LOAD( "yard.2h", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
ROM_LOAD( "yard.2n", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
ROM_LOAD( "yard.2m", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
ROM_LOAD( "yard.1c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) // chars palette low 4 bits
ROM_LOAD( "yard.1d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) // chars palette high 4 bits
ROM_LOAD( "yard.1f", 0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) // sprites palette
ROM_LOAD( "yard.2h", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) // sprites lookup table
ROM_LOAD( "yard.2n", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) // radar palette low 4 bits
ROM_LOAD( "yard.2m", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) // radar palette high 4 bits
ROM_END
ROM_START( vs10yardj )
@ -334,13 +684,13 @@ ROM_START( vs10yardj )
ROM_LOAD( "yf-s.3a", 0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
ROM_LOAD( "yf-s.1a", 0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_LOAD( "vyf-a.3a", 0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) ) /* chars */
ROM_REGION( 0x06000, "tiles", 0 )
ROM_LOAD( "vyf-a.3a", 0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) )
ROM_LOAD( "vyf-a.3c", 0x02000, 0x2000, CRC(f48eedca) SHA1(6aef3208de8b1dd4078de20c0b5ce96219c79d40) )
ROM_LOAD( "vyf-a.3d", 0x04000, 0x2000, CRC(7d1b4d93) SHA1(9389de1230b93f529c492af6fb911c00280cae8a) )
ROM_REGION( 0x0c000, "gfx2", 0 )
ROM_LOAD( "yf-b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) ) /* sprites */
ROM_REGION( 0x0c000, "sprites", 0 )
ROM_LOAD( "yf-b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )
ROM_LOAD( "yf-b.5c", 0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
ROM_LOAD( "yf-b.5f", 0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
ROM_LOAD( "yf-b.5e", 0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
@ -348,12 +698,12 @@ ROM_START( vs10yardj )
ROM_LOAD( "yf-b.5k", 0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
ROM_REGION( 0x0520, "proms", 0 )
ROM_LOAD( "yard.1c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
ROM_LOAD( "yard.1d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
ROM_LOAD( "yard.1f", 0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) /* sprites palette */
ROM_LOAD( "yard.2h", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
ROM_LOAD( "yard.2n", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
ROM_LOAD( "yard.2m", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
ROM_LOAD( "yard.1c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) // chars palette low 4 bits
ROM_LOAD( "yard.1d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) // chars palette high 4 bits
ROM_LOAD( "yard.1f", 0x0200, 0x0020, CRC(b8554da5) SHA1(963ca815b5f791b8a7b0937a5d392d5203049eb3) ) // sprites palette
ROM_LOAD( "yard.2h", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) // sprites lookup table
ROM_LOAD( "yard.2n", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) // radar palette low 4 bits
ROM_LOAD( "yard.2m", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) // radar palette high 4 bits
ROM_END
ROM_START( vs10yardu )
@ -368,26 +718,26 @@ ROM_START( vs10yardu )
ROM_LOAD( "yf-s-3a.3a", 0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
ROM_LOAD( "yf-s-1a.1a", 0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_LOAD( "yf-a-3e-h-vs.3e", 0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) ) /* chars */
ROM_REGION( 0x06000, "tiles", 0 )
ROM_LOAD( "yf-a-3e-h-vs.3e", 0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) )
ROM_LOAD( "yf-a-3c-h-vs.3c", 0x02000, 0x2000, CRC(f48eedca) SHA1(6aef3208de8b1dd4078de20c0b5ce96219c79d40) )
ROM_LOAD( "yf-a-3d-h-vs.3d", 0x04000, 0x2000, CRC(7d1b4d93) SHA1(9389de1230b93f529c492af6fb911c00280cae8a) )
ROM_REGION( 0x0c000, "gfx2", 0 )
ROM_LOAD( "yf-b-5b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) ) /* sprites */
ROM_REGION( 0x0c000, "sprites", 0 )
ROM_LOAD( "yf-b-5b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )
ROM_LOAD( "yf-b-5c.5c", 0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
ROM_LOAD( "yf-b-5f.5f", 0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
ROM_LOAD( "yf-b-5e.5e", 0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
ROM_LOAD( "yf-b-5j.5j", 0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
ROM_LOAD( "yf-b-5k.5k", 0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
ROM_REGION( 0x0520, "proms", 0 ) // on these sets the content of the sprite color PROM needs reversing - are the proms on the other sets from bootleg boards, or hand modified?
ROM_LOAD( "yf-a-5c.5c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
ROM_LOAD( "yf-a-5d.5d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
ROMX_LOAD( "yf-b-2b.2b", 0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316), ROM_GROUPSIZE(16) | ROM_REVERSE ) /* sprites palette */
ROM_LOAD( "yf-b-3l.3l", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
ROM_LOAD( "yf-b-2r.2r", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
ROM_LOAD( "yf-b-2p.2p", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
ROM_REGION( 0x0520, "proms", 0 ) // on these sets the content of the sprite color PROM needs reversing - are the PROMs on the other sets from bootleg boards, or hand modified?
ROM_LOAD( "yf-a-5c.5c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) // chars palette low 4 bits
ROM_LOAD( "yf-a-5d.5d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) // chars palette high 4 bits
ROMX_LOAD( "yf-b-2b.2b", 0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316), ROM_GROUPSIZE(16) | ROM_REVERSE ) // sprites palette
ROM_LOAD( "yf-b-3l.3l", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) // sprites lookup table
ROM_LOAD( "yf-b-2r.2r", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) // radar palette low 4 bits
ROM_LOAD( "yf-b-2p.2p", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) // radar palette high 4 bits
ROM_END
ROM_START( 10yard85 )
@ -402,33 +752,35 @@ ROM_START( 10yard85 )
ROM_LOAD( "yf-s-3a.3a", 0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
ROM_LOAD( "yf-s-1a.1a", 0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_LOAD( "yf-a-3e-h.3e", 0x00000, 0x2000, CRC(5fba9074) SHA1(aa9881315850e86b49712a4afb551778ee57ae75) ) /* chars */ // this rom changes to give the '85 text
ROM_REGION( 0x06000, "tiles", 0 )
ROM_LOAD( "yf-a-3e-h.3e", 0x00000, 0x2000, CRC(5fba9074) SHA1(aa9881315850e86b49712a4afb551778ee57ae75) ) // this ROM changes to give the '85 text
ROM_LOAD( "yf-a-3c-h.3c", 0x02000, 0x2000, CRC(f48eedca) SHA1(6aef3208de8b1dd4078de20c0b5ce96219c79d40) )
ROM_LOAD( "yf-a-3d-h.3d", 0x04000, 0x2000, CRC(7d1b4d93) SHA1(9389de1230b93f529c492af6fb911c00280cae8a) )
ROM_REGION( 0x0c000, "gfx2", 0 )
ROM_LOAD( "yf-b-5b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) ) /* sprites */
ROM_REGION( 0x0c000, "sprites", 0 )
ROM_LOAD( "yf-b-5b.5b", 0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )
ROM_LOAD( "yf-b-5c.5c", 0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
ROM_LOAD( "yf-b-5f.5f", 0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
ROM_LOAD( "yf-b-5e.5e", 0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
ROM_LOAD( "yf-b-5j.5j", 0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
ROM_LOAD( "yf-b-5k.5k", 0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
ROM_REGION( 0x0520, "proms", 0 ) // on these sets the content of the sprite color PROM needs reversing - are the proms on the other sets from bootleg boards, or hand modified?
ROM_LOAD( "yf-a-5c.5c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
ROM_LOAD( "yf-a-5d.5d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
ROMX_LOAD( "yf-b-2b.2b", 0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316), ROM_GROUPSIZE(16) | ROM_REVERSE ) /* sprites palette */
ROM_LOAD( "yf-b-3l.3l", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
ROM_LOAD( "yf-b-2r.2r", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
ROM_LOAD( "yf-b-2p.2p", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
ROM_REGION( 0x0520, "proms", 0 ) // on these sets the content of the sprite color PROM needs reversing - are the PROMs on the other sets from bootleg boards, or hand modified?
ROM_LOAD( "yf-a-5c.5c", 0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) // chars palette low 4 bits
ROM_LOAD( "yf-a-5d.5d", 0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) // chars palette high 4 bits
ROMX_LOAD( "yf-b-2b.2b", 0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316), ROM_GROUPSIZE(16) | ROM_REVERSE ) // sprites palette
ROM_LOAD( "yf-b-3l.3l", 0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) // sprites lookup table
ROM_LOAD( "yf-b-2r.2r", 0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) // radar palette low 4 bits
ROM_LOAD( "yf-b-2p.2p", 0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) // radar palette high 4 bits
ROM_END
} // anonymous namespace
/* YEAR NAME PARENT MACHINE INPUT STATE INIT MONITOR COMPANY FULLNAME, FLAGS */
GAME( 1983, 10yard, 0, yard, yard, m58_state, empty_init, ROT0, "Irem", "10-Yard Fight (World, set 1)", MACHINE_SUPPORTS_SAVE ) // no copyright
GAME( 1983, 10yardj, 10yard, yard, yard, m58_state, empty_init, ROT0, "Irem", "10-Yard Fight (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, vs10yard, 10yard, yard, vs10yard, m58_state, empty_init, ROT0, "Irem", "Vs 10-Yard Fight (World, 11/05/84)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, vs10yardj, 10yard, yard, vs10yarj, m58_state, empty_init, ROT0, "Irem", "Vs 10-Yard Fight (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, vs10yardu, 10yard, yard, vs10yard, m58_state, empty_init, ROT0, "Irem (Taito license)", "Vs 10-Yard Fight (US, Taito license)", MACHINE_SUPPORTS_SAVE ) // had '85 stickers, but doesn't have '85 on the title screen like the set below
// YEAR NAME PARENT MACHINE INPUT STATE INIT MONITOR COMPANY FULLNAME FLAGS
GAME( 1983, 10yard, 0, yard, yard, m58_state, empty_init, ROT0, "Irem", "10-Yard Fight (World, set 1)", MACHINE_SUPPORTS_SAVE ) // no copyright
GAME( 1983, 10yardj, 10yard, yard, yard, m58_state, empty_init, ROT0, "Irem", "10-Yard Fight (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, vs10yard, 10yard, yard, vs10yard, m58_state, empty_init, ROT0, "Irem", "Vs 10-Yard Fight (World, 11/05/84)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, vs10yardj, 10yard, yard, vs10yarj, m58_state, empty_init, ROT0, "Irem", "Vs 10-Yard Fight (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1984, vs10yardu, 10yard, yard, vs10yard, m58_state, empty_init, ROT0, "Irem (Taito license)", "Vs 10-Yard Fight (US, Taito license)", MACHINE_SUPPORTS_SAVE ) // had '85 stickers, but doesn't have '85 on the title screen like the set below
GAME( 1985, 10yard85, 10yard, yard, yard, m58_state, empty_init, ROT0, "Irem (Taito license)", "10-Yard Fight '85 (US, Taito license)", MACHINE_SUPPORTS_SAVE )

View File

@ -1,72 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Lee Taylor
// thanks-to:John Clegg
/****************************************************************************
Irem M58 hardware
****************************************************************************/
#ifndef MAME_IREM_M58_H
#define MAME_IREM_M58_H
#pragma once
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
class m58_state : public driver_device
{
public:
m58_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_screen(*this, "screen"),
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_scroll_x_low(*this, "scroll_x_low"),
m_scroll_x_high(*this, "scroll_x_high"),
m_scroll_y_low(*this, "scroll_y_low"),
m_score_panel_disabled(*this, "score_disable")
{ }
void yard(machine_config &config);
private:
/* devices */
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
/* memory pointers */
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_scroll_x_low;
required_shared_ptr<uint8_t> m_scroll_x_high;
required_shared_ptr<uint8_t> m_scroll_y_low;
required_shared_ptr<uint8_t> m_score_panel_disabled;
/* video-related */
tilemap_t* m_bg_tilemap = nullptr;
bitmap_ind16 m_scroll_panel_bitmap;
void videoram_w(offs_t offset, uint8_t data);
void scroll_panel_w(offs_t offset, uint8_t data);
void flipscreen_w(uint8_t data);
virtual void video_start() override;
void m58_palette(palette_device &palette) const;
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILEMAP_MAPPER_MEMBER(tilemap_scan_rows);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
void draw_panel( bitmap_ind16 &bitmap, const rectangle &cliprect );
void yard_map(address_map &map);
};
#endif // MAME_IREM_M58_H

View File

@ -1,301 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Lee Taylor
// thanks-to:John Clegg
/***************************************************************************
Irem M58 hardware
***************************************************************************/
#include "emu.h"
#include "video/resnet.h"
#include "m58.h"
/*************************************
*
* Palette configuration
*
*************************************/
void m58_state::m58_palette(palette_device &palette) const
{
uint8_t const *const color_prom = memregion("proms")->base();
uint8_t const *const char_lopal = color_prom + 0x000;
uint8_t const *const char_hipal = color_prom + 0x100;
uint8_t const *const sprite_pal = color_prom + 0x200;
uint8_t const *const sprite_table = color_prom + 0x220;
uint8_t const *const radar_lopal = color_prom + 0x320;
uint8_t const *const radar_hipal = color_prom + 0x420;
static constexpr int resistances_3[3] = { 1000, 470, 220 };
static constexpr int resistances_2[2] = { 470, 220 };
double weights_r[3], weights_g[3], weights_b[3], scale;
// compute palette information for characters/radar
scale = compute_resistor_weights(0, 255, -1.0,
2, resistances_2, weights_r, 0, 0,
3, resistances_3, weights_g, 0, 0,
3, resistances_3, weights_b, 0, 0);
// character palette
for (int i = 0; i < 256; i++)
{
uint8_t const promval = (char_lopal[i] & 0x0f) | (char_hipal[i] << 4);
int const r = combine_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
palette.set_indirect_color(i, rgb_t(r, g, b));
}
// radar palette
for (int i = 0; i < 256; i++)
{
uint8_t const promval = (radar_lopal[i] & 0x0f) | (radar_hipal[i] << 4);
int const r = combine_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
palette.set_indirect_color(256 + i, rgb_t(r, g, b));
}
// compute palette information for sprites
scale = compute_resistor_weights(0, 255, scale,
2, resistances_2, weights_r, 470, 0,
3, resistances_3, weights_g, 470, 0,
3, resistances_3, weights_b, 470, 0);
// sprite palette
for (int i = 0; i < 16; i++)
{
uint8_t const promval = sprite_pal[i];
int const r = combine_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
palette.set_indirect_color(256 + 256 + i, rgb_t(r, g, b));
}
// character lookup table
for (int i = 0; i < 256; i++)
palette.set_pen_indirect(i, i);
// radar lookup table
for (int i = 0; i < 256; i++)
palette.set_pen_indirect(256 + i, 256 + i);
// sprite lookup table
for (int i = 0; i < 256; i++)
{
uint8_t const promval = sprite_table[i] & 0x0f;
palette.set_pen_indirect(256 + 256 + i, 256 + 256 + promval);
}
}
/*************************************
*
* Video RAM access
*
*************************************/
void m58_state::videoram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset / 2);
}
void m58_state::scroll_panel_w(offs_t offset, uint8_t data)
{
int sx = ( offset % 16 );
int sy = ( offset / 16 );
if (sx < 1 || sx > 14)
return;
sx = 4 * (sx - 1);
for (int i = 0;i < 4;i++)
{
int col;
col = (data >> i) & 0x11;
col = ((col >> 3) | col) & 3;
m_scroll_panel_bitmap.pix(sy, sx + i) = 0x100 + (sy & 0xfc) + col;
m_scroll_panel_bitmap.pix(sy, sx + i + 0x2c8) = 0x100 + (sy & 0xfc) + col; // for flipscreen
}
}
/*************************************
*
* Tilemap info callback
*
*************************************/
TILE_GET_INFO_MEMBER(m58_state::get_bg_tile_info)
{
int offs = tile_index * 2;
int attr = m_videoram[offs + 1];
int code = m_videoram[offs] + ((attr & 0xc0) << 2);
int color = attr & 0x1f;
int flags = (attr & 0x20) ? TILE_FLIPX : 0;
tileinfo.set(0, code, color, flags);
}
TILEMAP_MAPPER_MEMBER(m58_state::tilemap_scan_rows)
{
/* logical (col,row) -> memory offset */
if (col >= 32)
return (row + 32) * 32 + col - 32;
else
return row * 32 + col;
}
/*************************************
*
* Video startup
*
*************************************/
void m58_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(m58_state::get_bg_tile_info)), tilemap_mapper_delegate(*this, FUNC(m58_state::tilemap_scan_rows)), 8, 8, 64, 32);
m_bg_tilemap->set_scrolldy(26, 26);
m_screen->register_screen_bitmap(m_scroll_panel_bitmap);
save_item(NAME(m_scroll_panel_bitmap));
}
/*************************************
*
* Outputs
*
*************************************/
void m58_state::flipscreen_w(uint8_t data)
{
/* screen flip is handled both by software and hardware */
flip_screen_set(BIT(data, 0) ^ BIT(~ioport("DSW2")->read(), 0));
machine().bookkeeping().coin_counter_w(0, data & 0x02);
machine().bookkeeping().coin_counter_w(1, data & 0x20);
}
/*************************************
*
* Sprite rendering
*
*************************************/
void m58_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
const rectangle &visarea = m_screen->visible_area();
for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
int attr = m_spriteram[offs + 1];
int bank = (attr & 0x20) >> 5;
int code1 = m_spriteram[offs + 2] & 0xbf;
int code2 = 0;
int color = attr & 0x1f;
int flipx = attr & 0x40;
int flipy = attr & 0x80;
int sx = m_spriteram[offs + 3];
int sy1 = 210 - m_spriteram[offs];
int sy2 = 0;
if (flipy)
{
code2 = code1;
code1 += 0x40;
}
else
{
code2 = code1 + 0x40;
}
if (flip_screen())
{
sx = 240 - sx;
sy2 = 192 - sy1;
sy1 = sy2 + 0x10;
flipx = !flipx;
flipy = !flipy;
}
else
{
sy2 = sy1 + 0x10;
}
m_gfxdecode->gfx(1)->transmask(bitmap, cliprect,
code1 + 256 * bank, color,
flipx, flipy, sx, visarea.min_y + sy1,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 512)
);
m_gfxdecode->gfx(1)->transmask(bitmap, cliprect,
code2 + 256 * bank, color,
flipx, flipy, sx, visarea.min_y + sy2,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, 512)
);
}
}
/*************************************
*
* Radar panel rendering
*
*************************************/
void m58_state::draw_panel( bitmap_ind16 &bitmap, const rectangle &cliprect )
{
if (!*m_score_panel_disabled)
{
const rectangle clippanel(26*8, 32*8-1, 1*8, 31*8-1);
const rectangle clippanelflip(0*8, 6*8-1, 1*8, 31*8-1);
rectangle clip = flip_screen() ? clippanelflip : clippanel;
const rectangle &visarea = m_screen->visible_area();
int sx = flip_screen() ? cliprect.min_x - 8 : cliprect.max_x + 1 - 14*4;
int yoffs = flip_screen() ? -40 : -16;
clip.min_y += visarea.min_y + yoffs;
clip.max_y += visarea.max_y + yoffs;
clip &= cliprect;
copybitmap(bitmap, m_scroll_panel_bitmap, flip_screen(), flip_screen(), sx, visarea.min_y + yoffs, clip);
}
}
/*************************************
*
* Video update
*
*************************************/
uint32_t m58_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->set_scrollx(0, (*m_scroll_x_high * 0x100) + *m_scroll_x_low);
m_bg_tilemap->set_scrolly(0, *m_scroll_y_low);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
draw_sprites(bitmap, cliprect);
draw_panel(bitmap, cliprect);
return 0;
}