redclash: let's rename driver to zerohour

This commit is contained in:
hap 2022-08-28 14:59:42 +02:00
parent 179afe2036
commit 45a99ad00e
9 changed files with 145 additions and 134 deletions

View File

@ -1494,8 +1494,8 @@ universal/docastle.cpp
universal/getaway.cpp
universal/ladybug.cpp
universal/mrdo.cpp
universal/redclash.cpp
universal/superdq.cpp
universal/zerohour.cpp
upl/mouser.cpp
upl/ninjakd2.cpp
upl/nova2001.cpp

View File

@ -36794,7 +36794,7 @@ panther // M27 no copyright notice
redalert // M27 (c) 1981 + "GDI presents"
ww3 // M27 (c) 1981
@source:universal/redclash.cpp
@source:universal/zerohour.cpp
redclash // (c) Kaneko
redclasht // (c) 1981 Tehkan
redclashta // (c) 1981 Tehkan

View File

@ -929,7 +929,7 @@ void sraider_state::sraider(machine_config &config)
PALETTE(config, m_palette, FUNC(sraider_state::sraider_palette), 4*8 + 4*16 + 32 + 2, 32 + 32 + 1);
LADYBUG_VIDEO(config, m_video, 4000000).set_gfxdecode_tag(m_gfxdecode);
ZEROHOUR_STARS(config, m_stars, 0);
ZEROHOUR_STARS(config, m_stars).has_va_bit(false);
/* sound hardware */
SPEAKER(config, "mono").front_center();

View File

@ -344,10 +344,19 @@ uint32_t sraider_state::screen_update_sraider(screen_device &screen, bitmap_ind1
bitmap.fill(0, cliprect);
// draw the stars
rectangle stars_clip = cliprect;
if (flip_screen())
m_stars->draw(bitmap, cliprect, 0x60, false, 0x27, 0xff);
{
stars_clip.min_x = 0x27;
stars_clip.max_x = 0xff;
}
else
m_stars->draw(bitmap, cliprect, 0x60, false, 0x00, 0xd8);
{
stars_clip.min_x = 0x00;
stars_clip.max_x = 0xd8;
}
stars_clip &= cliprect;
m_stars->draw(bitmap, stars_clip);
// draw the gridlines
m_palette->set_indirect_color(0x40, rgb_t(

View File

@ -27,7 +27,7 @@ TODO:
***************************************************************************/
#include "emu.h"
#include "redclash.h"
#include "zerohour.h"
#include "cpu/z80/z80.h"
#include "machine/74259.h"
@ -36,38 +36,38 @@ TODO:
#include "speaker.h"
void redclash_state::irqack_w(uint8_t data)
void zerohour_state::irqack_w(uint8_t data)
{
m_maincpu->set_input_line(0, CLEAR_LINE);
}
template <unsigned B> WRITE_LINE_MEMBER(redclash_state::star_w)
template <unsigned B> WRITE_LINE_MEMBER(zerohour_state::star_w)
{
m_stars->set_speed(state ? 1 << B : 0, 1U << B);
}
void redclash_state::zerohour_map(address_map &map)
void zerohour_state::zerohour_map(address_map &map)
{
map(0x0000, 0x2fff).rom();
map(0x3000, 0x37ff).ram();
map(0x3800, 0x3bff).ram().share(m_spriteram);
map(0x4000, 0x43ff).ram().w(FUNC(redclash_state::videoram_w)).share(m_videoram);
map(0x4000, 0x43ff).ram().w(FUNC(zerohour_state::videoram_w)).share(m_videoram);
map(0x4800, 0x4800).portr("IN0"); /* IN0 */
map(0x4801, 0x4801).portr("IN1"); /* IN1 */
map(0x4802, 0x4802).portr("DSW1"); /* DSW0 */
map(0x4803, 0x4803).portr("DSW2"); /* DSW1 */
map(0x5000, 0x5007).w("outlatch1", FUNC(ls259_device::write_d0)); /* to sound board */
map(0x5800, 0x5807).w("outlatch2", FUNC(ls259_device::write_d0)); /* to sound board */
map(0x7000, 0x7000).w(FUNC(redclash_state::star_reset_w));
map(0x7800, 0x7800).w(FUNC(redclash_state::irqack_w));
map(0x7000, 0x7000).w(FUNC(zerohour_state::star_reset_w));
map(0x7800, 0x7800).w(FUNC(zerohour_state::irqack_w));
}
void redclash_state::redclash_map(address_map &map)
void zerohour_state::redclash_map(address_map &map)
{
map(0x0000, 0x2fff).rom();
// map(0x3000, 0x3000).set_nopw();
// map(0x3800, 0x3800).set_nopw();
map(0x4000, 0x43ff).ram().w(FUNC(redclash_state::videoram_w)).share(m_videoram);
map(0x4000, 0x43ff).ram().w(FUNC(zerohour_state::videoram_w)).share(m_videoram);
map(0x4800, 0x4800).portr("IN0"); /* IN0 */
map(0x4801, 0x4801).portr("IN1"); /* IN1 */
map(0x4802, 0x4802).portr("DSW1"); /* DSW0 */
@ -76,8 +76,8 @@ void redclash_state::redclash_map(address_map &map)
map(0x5800, 0x5807).w("outlatch2", FUNC(ls259_device::write_d0)); /* to sound board */
map(0x6000, 0x67ff).ram();
map(0x6800, 0x6bff).ram().share(m_spriteram);
map(0x7000, 0x7000).w(FUNC(redclash_state::star_reset_w));
map(0x7800, 0x7800).w(FUNC(redclash_state::irqack_w));
map(0x7000, 0x7000).w(FUNC(zerohour_state::star_reset_w));
map(0x7800, 0x7800).w(FUNC(zerohour_state::irqack_w));
}
/*
@ -85,19 +85,19 @@ void redclash_state::redclash_map(address_map &map)
Interrupts are still used, but they are related to coin
slots. Left slot generates an IRQ, Right slot a NMI.
*/
INPUT_CHANGED_MEMBER( redclash_state::left_coin_inserted )
INPUT_CHANGED_MEMBER( zerohour_state::left_coin_inserted )
{
if(newval)
m_maincpu->set_input_line(0, ASSERT_LINE);
}
INPUT_CHANGED_MEMBER( redclash_state::right_coin_inserted )
INPUT_CHANGED_MEMBER( zerohour_state::right_coin_inserted )
{
if(newval)
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
static INPUT_PORTS_START( redclash )
static INPUT_PORTS_START( zerohour )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
@ -122,6 +122,59 @@ static INPUT_PORTS_START( redclash )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:8" ) /* Switches 6-8 are not used */
PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:7" )
PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:6" )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,3") /* Also determines the default topscore, 0 for "No Bonus" */
PORT_DIPSETTING( 0x00, "No Bonus" )
PORT_DIPSETTING( 0x30, "5000" )
PORT_DIPSETTING( 0x20, "8000" )
PORT_DIPSETTING( 0x10, "10000" )
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0xc0, "3" )
PORT_DIPSETTING( 0x80, "4" )
PORT_DIPSETTING( 0x40, "5" )
PORT_START("DSW2")
PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:4,3,2,1")
PORT_DIPSETTING( 0x06, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 3C_2C ) )
PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) /* all other combinations give 1C_1C */
PORT_DIPSETTING( 0x09, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) )
PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:8,7,6,5")
PORT_DIPSETTING( 0x60, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0xa0, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x70, DEF_STR( 3C_2C ) )
PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) /* all other combinations give 1C_1C */
PORT_DIPSETTING( 0x90, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) )
PORT_START("FAKE")
/* The coin slots are not memory mapped. Coin Left causes a NMI, */
/* Coin Right an IRQ. This fake input port is used by the interrupt */
/* handler to be notified of coin insertions. */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, zerohour_state, left_coin_inserted, 0)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, zerohour_state, right_coin_inserted, 0)
INPUT_PORTS_END
static INPUT_PORTS_START( redclash )
PORT_INCLUDE( zerohour )
PORT_MODIFY("DSW1")
PORT_DIPNAME( 0x03, 0x03, "Difficulty?" )
PORT_DIPSETTING( 0x03, "Easy?" )
PORT_DIPSETTING( 0x02, "Medium?" )
@ -145,7 +198,7 @@ static INPUT_PORTS_START( redclash )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "7" )
PORT_START("DSW2")
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
PORT_DIPSETTING( 0x04, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 5C_1C ) )
@ -180,61 +233,6 @@ static INPUT_PORTS_START( redclash )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_7C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_8C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_9C ) )
PORT_START("FAKE")
/* The coin slots are not memory mapped. Coin Left causes a NMI, */
/* Coin Right an IRQ. This fake input port is used by the interrupt */
/* handler to be notified of coin insertions. We use IMPULSE to */
/* trigger exactly one interrupt, without having to check when the */
/* user releases the key. */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, redclash_state, left_coin_inserted, 0)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, redclash_state, right_coin_inserted, 0)
INPUT_PORTS_END
static INPUT_PORTS_START( zerohour )
PORT_INCLUDE( redclash )
PORT_MODIFY("DSW1")
PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:8" ) /* Switches 6-8 are not used */
PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:7" )
PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:6" )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,3") /* Also determines the default topscore, 0 for "No Bonus" */
PORT_DIPSETTING( 0x00, "No Bonus" )
PORT_DIPSETTING( 0x30, "5000" )
PORT_DIPSETTING( 0x20, "8000" )
PORT_DIPSETTING( 0x10, "10000" )
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0xc0, "3" )
PORT_DIPSETTING( 0x80, "4" )
PORT_DIPSETTING( 0x40, "5" )
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:4,3,2,1")
PORT_DIPSETTING( 0x06, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 3C_2C ) )
PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) /* all other combinations give 1C_1C */
PORT_DIPSETTING( 0x09, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) )
PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:8,7,6,5")
PORT_DIPSETTING( 0x60, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0xa0, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x70, DEF_STR( 3C_2C ) )
PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) /* all other combinations give 1C_1C */
PORT_DIPSETTING( 0x90, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) )
INPUT_PORTS_END
static const gfx_layout charlayout =
@ -292,7 +290,7 @@ static const gfx_layout spritelayout16x16bis =
32*32
};
static GFXDECODE_START( gfx_redclash )
static GFXDECODE_START( gfx_zerohour )
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 8 )
GFXDECODE_ENTRY( "gfx3", 0x0000, spritelayout8x8, 4*8, 16 )
GFXDECODE_ENTRY( "gfx2", 0x0000, spritelayout16x16, 4*8, 16 )
@ -302,50 +300,48 @@ static GFXDECODE_START( gfx_redclash )
GFXDECODE_END
void redclash_state::machine_start()
void zerohour_state::machine_start()
{
save_item(NAME(m_gfxbank));
m_gfxbank = 0;
}
void redclash_state::zerohour(machine_config &config)
void zerohour_state::zerohour(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 4_MHz_XTAL); /* 4 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &redclash_state::zerohour_map);
m_maincpu->set_addrmap(AS_PROGRAM, &zerohour_state::zerohour_map);
LS259(config, "outlatch1"); // C1 (CS10 decode)
ls259_device &outlatch2(LS259(config, "outlatch2")); // C2 (CS11 decode)
outlatch2.q_out_cb<0>().set(FUNC(redclash_state::star_w<0>));
outlatch2.q_out_cb<5>().set(FUNC(redclash_state::star_w<1>));
outlatch2.q_out_cb<6>().set(FUNC(redclash_state::star_w<2>));
outlatch2.q_out_cb<7>().set(FUNC(redclash_state::flipscreen_w));
outlatch2.q_out_cb<0>().set(FUNC(zerohour_state::star_w<0>));
outlatch2.q_out_cb<5>().set(FUNC(zerohour_state::star_w<1>));
outlatch2.q_out_cb<6>().set(FUNC(zerohour_state::star_w<2>));
outlatch2.q_out_cb<7>().set(FUNC(zerohour_state::flipscreen_w));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(9.828_MHz_XTAL / 2, 312, 8, 248, 262, 32, 224);
screen.set_screen_update(FUNC(redclash_state::screen_update));
screen.screen_vblank().set(FUNC(redclash_state::screen_vblank));
screen.set_screen_update(FUNC(zerohour_state::screen_update));
screen.screen_vblank().set(FUNC(zerohour_state::screen_vblank));
screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_redclash);
PALETTE(config, m_palette, FUNC(redclash_state::palette), 4*8 + 4*16 + 32, 32 + 32);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_zerohour);
PALETTE(config, m_palette, FUNC(zerohour_state::palette), 4*8 + 4*16 + 32, 32 + 32);
ZEROHOUR_STARS(config, m_stars, 0);
ZEROHOUR_STARS(config, m_stars);
/* sound hardware */
}
void redclash_state::redclash(machine_config &config)
void zerohour_state::redclash(machine_config &config)
{
zerohour(config);
m_maincpu->set_addrmap(AS_PROGRAM, &redclash_state::redclash_map);
m_maincpu->set_addrmap(AS_PROGRAM, &zerohour_state::redclash_map);
subdevice<addressable_latch_device>("outlatch2")->q_out_cb<1>().set(FUNC(redclash_state::gfxbank_w));
subdevice<addressable_latch_device>("outlatch2")->q_out_cb<1>().set(FUNC(zerohour_state::gfxbank_w));
}
@ -538,7 +534,7 @@ ROM_START( redclashs )
ROM_LOAD( "3.11e", 0x0040, 0x0020, CRC(27fa3a50) SHA1(7cf59b7a37c156640d6ea91554d1c4276c1780e0) ) /* ?? */
ROM_END
void redclash_state::init_redclash()
void zerohour_state::init_zerohour()
{
uint8_t const *const src = memregion("gfx2")->base();
uint8_t *const dst = memregion("gfx3")->base();
@ -553,11 +549,11 @@ void redclash_state::init_redclash()
}
GAME( 1980, zerohour, 0, zerohour, zerohour, redclash_state, init_redclash, ROT270, "Universal", "Zero Hour (set 1)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1980, zerohoura, zerohour, zerohour, zerohour, redclash_state, init_redclash, ROT270, "Universal", "Zero Hour (set 2)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1980, zerohouri, zerohour, zerohour, zerohour, redclash_state, init_redclash, ROT270, "bootleg (Inder SA)", "Zero Hour (Inder)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1980, zerohour, 0, zerohour, zerohour, zerohour_state, init_zerohour, ROT270, "Universal", "Zero Hour (set 1)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1980, zerohoura, zerohour, zerohour, zerohour, zerohour_state, init_zerohour, ROT270, "Universal", "Zero Hour (set 2)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1980, zerohouri, zerohour, zerohour, zerohour, zerohour_state, init_zerohour, ROT270, "bootleg (Inder SA)", "Zero Hour (Inder)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1981, redclash, 0, redclash, redclash, redclash_state, init_redclash, ROT270, "Kaneko", "Red Clash", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1981, redclasht, redclash, redclash, redclash, redclash_state, init_redclash, ROT270, "Kaneko (Tehkan license)", "Red Clash (Tehkan, set 1)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1981, redclashta, redclash, redclash, redclash, redclash_state, init_redclash, ROT270, "Kaneko (Tehkan license)", "Red Clash (Tehkan, set 2)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1982, redclashs, redclash, redclash, redclash, redclash_state, init_redclash, ROT270, "Kaneko (Suntronics license)", "Red Clash (Suntronics)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1981, redclash, 0, redclash, redclash, zerohour_state, init_zerohour, ROT270, "Kaneko", "Red Clash", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1981, redclasht, redclash, redclash, redclash, zerohour_state, init_zerohour, ROT270, "Kaneko (Tehkan license)", "Red Clash (Tehkan, set 1)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1981, redclashta, redclash, redclash, redclash, zerohour_state, init_zerohour, ROT270, "Kaneko (Tehkan license)", "Red Clash (Tehkan, set 2)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1982, redclashs, redclash, redclash, redclash, zerohour_state, init_zerohour, ROT270, "Kaneko (Suntronics license)", "Red Clash (Suntronics)", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )

View File

@ -1,12 +1,12 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
// copyright-holders:David Haywood
/*************************************************************************
Zero Hour / Red Clash
*************************************************************************/
#ifndef MAME_INCLUDES_REDCLASH_H
#define MAME_INCLUDES_REDCLASH_H
#ifndef MAME_INCLUDES_ZEROHOUR_H
#define MAME_INCLUDES_ZEROHOUR_H
#pragma once
@ -15,11 +15,10 @@
#include "tilemap.h"
// redclash/zerohour
class redclash_state : public driver_device
class zerohour_state : public driver_device
{
public:
redclash_state(const machine_config &mconfig, device_type type, const char *tag)
zerohour_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_videoram(*this, "videoram")
, m_spriteram(*this, "spriteram")
@ -32,7 +31,7 @@ public:
void redclash(machine_config &config);
void zerohour(machine_config &config);
void init_redclash();
void init_zerohour();
DECLARE_INPUT_CHANGED_MEMBER(left_coin_inserted);
DECLARE_INPUT_CHANGED_MEMBER(right_coin_inserted);
@ -70,4 +69,4 @@ private:
int m_gfxbank = 0; // redclash only
};
#endif // MAME_INCLUDES_REDCLASH_H
#endif // MAME_INCLUDES_ZEROHOUR_H

View File

@ -32,6 +32,9 @@ zerohour_stars_device::zerohour_stars_device(machine_config const &mconfig, char
, m_offset(0)
, m_count(0)
{
// set default configuration
m_pal_offset = 0x60;
m_has_va_bit = true;
}
void zerohour_stars_device::device_start()
@ -95,8 +98,7 @@ void zerohour_stars_device::set_speed(u8 speed, u8 mask)
}
// Draw the stars
// Space Raider doesn't use the Va bit, and it is also set up to window the stars to a certain x range
void zerohour_stars_device::draw(bitmap_ind16 &bitmap, rectangle const &cliprect, u8 pal_offs, bool has_va, u8 firstx, u8 lastx)
void zerohour_stars_device::draw(bitmap_ind16 &bitmap, rectangle const &cliprect)
{
if (m_enable)
{
@ -110,12 +112,12 @@ void zerohour_stars_device::draw(bitmap_ind16 &bitmap, rectangle const &cliprect
bool const feedback((state & 0x00020) ? !tempbit : tempbit);
bool const hcond(BIT(xloc + 8, 4));
bool const vcond(!has_va || BIT(yloc, 0));
bool const vcond(!m_has_va_bit || BIT(yloc, 0));
if (cliprect.contains(xloc, yloc) && (hcond == vcond))
{
if (((state & 0x000ff) == 0x000ff) && !feedback && (xloc >= firstx) && (xloc <= lastx))
bitmap.pix(yloc, xloc) = pal_offs + ((state >> 9) & 0x1f);
if (((state & 0x000ff) == 0x000ff) && !feedback)
bitmap.pix(yloc, xloc) = m_pal_offset + ((state >> 9) & 0x1f);
}
// update LFSR state

View File

@ -10,12 +10,16 @@
class zerohour_stars_device : public device_t
{
public:
zerohour_stars_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
zerohour_stars_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
// configuration helpers
zerohour_stars_device &has_va_bit(bool va) { m_has_va_bit = va; return *this; } // default yes (sraider does not)
// public interface
void set_enable(bool on);
void update_state();
void set_speed(u8 speed, u8 mask);
void draw(bitmap_ind16 &bitmap, rectangle const &cliprect, u8 pal_offs, bool has_va, u8 firstx, u8 lastx);
void draw(bitmap_ind16 &bitmap, rectangle const &cliprect);
protected:
virtual void device_start() override;
@ -27,6 +31,9 @@ private:
u32 m_state;
u16 m_offset;
u8 m_count;
u16 m_pal_offset;
bool m_has_va_bit;
};

View File

@ -2,14 +2,12 @@
// copyright-holders:David Haywood
/***************************************************************************
redclash.cpp
Functions to emulate the video hardware of the machine.
***************************************************************************/
#include "emu.h"
#include "redclash.h"
#include "zerohour.h"
#include "video/resnet.h"
/***************************************************************************
@ -21,7 +19,7 @@
***************************************************************************/
void redclash_state::palette(palette_device &palette) const
void zerohour_state::palette(palette_device &palette) const
{
const uint8_t *color_prom = memregion("proms")->base();
@ -98,13 +96,13 @@ void redclash_state::palette(palette_device &palette) const
}
void redclash_state::videoram_w(offs_t offset, uint8_t data)
void zerohour_state::videoram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
m_fg_tilemap->mark_tile_dirty(offset);
}
WRITE_LINE_MEMBER(redclash_state::gfxbank_w)
WRITE_LINE_MEMBER(zerohour_state::gfxbank_w)
{
if (m_gfxbank != state)
{
@ -113,17 +111,17 @@ WRITE_LINE_MEMBER(redclash_state::gfxbank_w)
}
}
WRITE_LINE_MEMBER(redclash_state::flipscreen_w)
WRITE_LINE_MEMBER(zerohour_state::flipscreen_w)
{
flip_screen_set(state);
}
void redclash_state::star_reset_w(uint8_t data)
void zerohour_state::star_reset_w(uint8_t data)
{
m_stars->set_enable(true);
}
TILE_GET_INFO_MEMBER(redclash_state::get_fg_tile_info)
TILE_GET_INFO_MEMBER(zerohour_state::get_fg_tile_info)
{
int code = m_videoram[tile_index];
int color = (m_videoram[tile_index] & 0x70) >> 4; // ??
@ -132,13 +130,13 @@ TILE_GET_INFO_MEMBER(redclash_state::get_fg_tile_info)
}
void redclash_state::video_start()
void zerohour_state::video_start()
{
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(redclash_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(zerohour_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_fg_tilemap->set_transparent_pen(0);
}
void redclash_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
void zerohour_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = m_spriteram.bytes() - 0x20; offs >= 0; offs -= 0x20)
{
@ -218,7 +216,7 @@ void redclash_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
}
}
void redclash_state::draw_bullets( bitmap_ind16 &bitmap, const rectangle &cliprect )
void zerohour_state::draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = 0; offs < 0x20; offs++)
{
@ -229,7 +227,7 @@ void redclash_state::draw_bullets( bitmap_ind16 &bitmap, const rectangle &clipre
sx = 264 - sx;
int fine_x = m_videoram[offs] >> 3 & 7;
sx = sx - fine_x;
sx -= fine_x;
for (int y = 0; y < 2; y++)
for (int x = 0; x < 8; x++)
@ -241,19 +239,19 @@ void redclash_state::draw_bullets( bitmap_ind16 &bitmap, const rectangle &clipre
}
}
WRITE_LINE_MEMBER(redclash_state::screen_vblank)
WRITE_LINE_MEMBER(zerohour_state::screen_vblank)
{
// falling edge
if (!state)
m_stars->update_state();
}
uint32_t redclash_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t zerohour_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(m_palette->black_pen(), cliprect);
m_stars->draw(bitmap, cliprect, 0x60, true, 0x00, 0xff);
m_stars->draw(bitmap, cliprect);
draw_bullets(bitmap, cliprect);
draw_sprites(bitmap, cliprect);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_fg_tilemap->draw(screen, bitmap, cliprect);
return 0;
}