summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Roberto Fresca <robbie@robertofresca.com>2022-04-23 02:56:02 +0200
committer Roberto Fresca <robbie@robertofresca.com>2022-04-23 02:56:02 +0200
commit229c0352e0b332b5b6d6cc6c7ec350ae34aa8edb (patch)
tree0709f7d67b12a10cf4cc607d2b130162a00e1b38
parent923bb87dccfd3eb155b88ac58723c075c20820fa (diff)
New working machines
-------------------- Bowmen [Roberto Fresca, Mirko Buffoni, Daniel Carmona, Museoarcadevintage.com, Recreativas.org]
-rw-r--r--src/mame/drivers/vigilant.cpp254
-rw-r--r--src/mame/includes/vigilant.h10
-rw-r--r--src/mame/mame.lst1
-rw-r--r--src/mame/video/vigilant.cpp299
4 files changed, 490 insertions, 74 deletions
diff --git a/src/mame/drivers/vigilant.cpp b/src/mame/drivers/vigilant.cpp
index 7abbd42299a..7471b7d72b8 100644
--- a/src/mame/drivers/vigilant.cpp
+++ b/src/mame/drivers/vigilant.cpp
@@ -19,6 +19,17 @@ Irem board numbers for Vigilante sets:
Top board - M75-A-B (up to Rev A), M75-A-C (Rev B onwards)
Bottom board - M75-B-A (all versions regardless of mask ROM/EPROM)
+****************************************************************************
+
+Roberto Fresca 2022.04.23:
+Added Bowmen, from Ten-Level. Very rare and bizarre game.
+The kid peeks the girl's ass and get fulminated with a lightning bolt thrown by god.
+
+The game uses a derivative hardware and have some odd things, like lack of
+some music codes or some clipped sample codes that make me think that they
+finished the development abruptly, without a final polish. Also seems to
+finish in level 10 (30 stages), but the game is so hard to test it.
+
***************************************************************************/
#include "emu.h"
@@ -118,6 +129,27 @@ void vigilant_state::kikcubic_io_map(address_map &map)
// map(0x07, 0x07).nopw(); /* ?? */
}
+void vigilant_state::bowmen_io_map(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x00, 0x00).portr("IN0").w("soundlatch", FUNC(generic_latch_8_device::write)); // SD seems BAD
+ map(0x01, 0x01).portr("IN1").w(FUNC(vigilant_state::vigilant_out2_w)); // OUT2?
+ map(0x02, 0x02).portr("IN2");
+ map(0x03, 0x03).portr("DSW2");
+ map(0x04, 0x04).portr("DSW1").w(FUNC(vigilant_state::bank_select_w)); // PBANK?
+// map(0x10, 0x11).w(FUNC(vigilant_state::vigilant_horiz_scroll_w)); // HSPL, HSPH
+ map(0x12, 0x13).w(FUNC(vigilant_state::bowmen_rear_horiz_scroll_w)); // RHSPL, RHSPH
+ map(0x14, 0x14).w(FUNC(vigilant_state::bowmen_rear_color_w)); // RCOD
+/*
+ 02; w
+ 10; w
+ 11; w
+ 12; w
+ 13; w
+ 14; w
+*/
+}
+
void vigilant_state::sound_map(address_map &map)
{
map(0x0000, 0xbfff).rom();
@@ -377,6 +409,95 @@ static INPUT_PORTS_START( buccanra )
INPUT_PORTS_END
+static INPUT_PORTS_START( bowmen )
+ PORT_START("IN0")
+ PORT_SERVICE( 0x2f, IP_ACTIVE_LOW )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
+
+ PORT_START("IN1")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) // checked in the test mode.
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
+
+ PORT_START("IN2")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN2 )
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL // checked in the test mode.
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
+
+ PORT_START("DSW1")
+ PORT_DIPNAME( 0x01, 0x01, "Screen Orientation" ) PORT_DIPLOCATION("SW1:1")
+ PORT_DIPSETTING( 0x01, "Normal Screen" )
+ PORT_DIPSETTING( 0x00, "Inverted Screen" )
+ PORT_DIPNAME( 0x02, 0x02, "Players" ) PORT_DIPLOCATION("SW1:2")
+ PORT_DIPSETTING( 0x02, "Two Players" )
+ PORT_DIPSETTING( 0x00, "One Player" )
+ PORT_DIPNAME( 0x0c, 0x0c, "Time for Round" ) PORT_DIPLOCATION("SW1:3,4")
+ PORT_DIPSETTING( 0x00, "Free Time per Round" )
+ PORT_DIPSETTING( 0x04, "30 Seconds per Round" )
+ PORT_DIPSETTING( 0x08, "50 Seconds per Round" )
+ PORT_DIPSETTING( 0x0c, "60 Seconds per Round" )
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,6")
+ PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( Very_Easy ) )
+ PORT_DIPSETTING( 0x30, DEF_STR( Normal ) )
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7")
+ PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPNAME( 0x80, 0x80, "Test Type" ) PORT_DIPLOCATION("SW1:8")
+ PORT_DIPSETTING( 0x80, "Easy Test" )
+ PORT_DIPSETTING( 0x00, "Advanced Test" )
+
+ PORT_START("DSW2")
+ PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3,4")
+ PORT_DIPSETTING( 0x00, DEF_STR( 5C_2C ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( 5C_1C ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( 4C_5C ) )
+ PORT_DIPSETTING( 0x03, DEF_STR( 4C_3C ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) )
+ PORT_DIPSETTING( 0x05, DEF_STR( 3C_5C ) )
+ PORT_DIPSETTING( 0x06, DEF_STR( 3C_2C ) )
+ PORT_DIPSETTING( 0x07, DEF_STR( 3C_1C ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( 2C_5C ) )
+ PORT_DIPSETTING( 0x09, DEF_STR( 2C_3C ) )
+ PORT_DIPSETTING( 0x0a, DEF_STR( 2C_1C ) )
+ PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) )
+ PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
+ PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) )
+ PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) )
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,6,7,8")
+ PORT_DIPSETTING( 0x00, DEF_STR( 5C_2C ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( 5C_1C ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( 4C_5C ) )
+ PORT_DIPSETTING( 0x30, DEF_STR( 4C_3C ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( 4C_1C ) )
+ PORT_DIPSETTING( 0x50, DEF_STR( 3C_5C ) )
+ PORT_DIPSETTING( 0x60, DEF_STR( 3C_2C ) )
+ PORT_DIPSETTING( 0x70, DEF_STR( 3C_1C ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( 2C_5C ) )
+ PORT_DIPSETTING( 0x90, DEF_STR( 2C_3C ) )
+ PORT_DIPSETTING( 0xa0, DEF_STR( 2C_1C ) )
+ PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) )
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) )
+ PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) )
+ PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) )
+INPUT_PORTS_END
+
+
static const gfx_layout text_layout =
{
8,8, /* tile size */
@@ -473,6 +594,13 @@ static GFXDECODE_START( gfx_buccanrs )
/* pens we can handle it more easily. */
GFXDECODE_END
+static GFXDECODE_START( gfx_bowmen )
+ GFXDECODE_ENTRY( "gfx1", 0, text_layout, 256, 16 )
+ GFXDECODE_ENTRY( "gfx2", 0, sprite_layout_buccanrs, 0, 16 )
+ GFXDECODE_ENTRY( "gfx3", 0, buccaneer_back_layout, 512, 2 )
+
+GFXDECODE_END
+
static GFXDECODE_START( gfx_kikcubic )
GFXDECODE_ENTRY( "gfx1", 0, text_layout, 0, 16 )
GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 0, 16 )
@@ -646,6 +774,73 @@ void vigilant_state::kikcubic(machine_config &config)
}
+void vigilant_state::bowmen(machine_config &config)
+{
+ // basic machine hardware
+ Z80(config, m_maincpu, 18_MHz_XTAL / 3); // 5.99538 Mhz verified
+ m_maincpu->set_addrmap(AS_PROGRAM, &vigilant_state::vigilant_map);
+ m_maincpu->set_addrmap(AS_IO, &vigilant_state::bowmen_io_map);
+ m_maincpu->set_vblank_int("screen", FUNC(vigilant_state::irq0_line_hold));
+
+ z80_device &soundcpu(Z80(config, "soundcpu", 18_MHz_XTAL / 3)); // 5.99528 Mhz verified
+ soundcpu.set_addrmap(AS_PROGRAM, &vigilant_state::sound_map);
+ soundcpu.set_addrmap(AS_IO, &vigilant_state::buccanrs_sound_io_map);
+ soundcpu.set_periodic_int(FUNC(vigilant_state::nmi_line_pulse), attotime::from_hz(7806.5)); // 7.80650 KHz. measured
+
+ soundcpu.set_irq_acknowledge_callback("soundirq", FUNC(rst_neg_buffer_device::inta_cb));
+
+ // video hardware
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(55); // 54.9752 Hz. Verified
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));
+ screen.set_size(64 * 8, 32 * 8);
+ screen.set_visarea(16 * 8, (64 - 16) * 8 - 1, 0 * 8, 32 * 8 - 1);
+ screen.set_screen_update(FUNC(vigilant_state::screen_update_bowmen));
+ screen.set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_bowmen);
+ PALETTE(config, m_palette).set_entries(512 + 32); // 512 real palette, 32 virtual palette
+
+ // sound hardware
+ SPEAKER(config, "lspeaker").front_left();
+ SPEAKER(config, "rspeaker").front_right();
+
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set("soundirq", FUNC(rst_neg_buffer_device::rst18_w));
+ soundlatch.set_separate_acknowledge(true);
+
+ RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline("soundcpu", 0);
+
+ IREM_M72_AUDIO(config, m_audio);
+ m_audio->set_dac_tag("dac");
+
+ ym2203_device &ym1(YM2203(config, "ym1", 18_MHz_XTAL / 6));
+ ym1.irq_handler().set("soundirq", FUNC(rst_neg_buffer_device::rst28_w));
+ ym1.add_route(0, "lspeaker", 0.35);
+ ym1.add_route(0, "rspeaker", 0.35);
+ ym1.add_route(1, "lspeaker", 0.35);
+ ym1.add_route(1, "rspeaker", 0.35);
+ ym1.add_route(2, "lspeaker", 0.35);
+ ym1.add_route(2, "rspeaker", 0.35);
+ ym1.add_route(3, "lspeaker", 0.50);
+ ym1.add_route(3, "rspeaker", 0.50);
+
+ ym2203_device &ym2(YM2203(config, "ym2", 18_MHz_XTAL / 6));
+ ym2.add_route(0, "lspeaker", 0.35);
+ ym2.add_route(0, "rspeaker", 0.35);
+ ym2.add_route(1, "lspeaker", 0.35);
+ ym2.add_route(1, "rspeaker", 0.35);
+ ym2.add_route(2, "lspeaker", 0.35);
+ ym2.add_route(2, "rspeaker", 0.35);
+ ym2.add_route(3, "lspeaker", 0.50);
+ ym2.add_route(3, "rspeaker", 0.50);
+
+ dac_8bit_r2r_device &dac(DAC_8BIT_R2R(config, "dac", 0)); // unknown DAC
+ dac.add_route(ALL_OUTPUTS, "lspeaker", 0.35);
+ dac.add_route(ALL_OUTPUTS, "rspeaker", 0.35);
+}
+
+
/***************************************************************************
Game ROMs
@@ -1161,6 +1356,63 @@ ROM_START( buccanrsb )
ROM_LOAD( "prom2.u99", 0x0300, 0x0100, CRC(e0aa8869) SHA1(ac8bdfeba69420ba56ec561bf3d0f1229d02cea2) )
ROM_END
+
+ROM_START( bowmen )
+ ROM_REGION( 0x30000, "maincpu", 0 ) // 64k for code (+ 128k for bankswitching?)
+ ROM_LOAD( "4_27256.bin", 0x00000, 0x08000, CRC(e8dcabb6) SHA1(d6baf9af0ebdced8b73a36486ffd9b48b0d446ca) )
+ ROM_LOAD( "3_27c512.bin", 0x10000, 0x10000, CRC(9c8af1eb) SHA1(e36efb2b6d1df4b313bf81c083df64ccf6764bbc) )
+
+ ROM_REGION( 0x10000, "soundcpu", 0 ) // 64k for sound
+ ROM_LOAD( "2_27c512.bin", 0x00000, 0x10000, CRC(477a5756) SHA1(675e066adec5fa34c491d71520827d568a5f8d7a) )
+
+ ROM_REGION( 0x20000, "gfx1", 0 ) // chars
+ ROM_LOAD( "8_27c512.bin", 0x00000, 0x10000, CRC(782b0b7f) SHA1(35eef9bd32ca2063c730026a71300a7cf2e55778) )
+ ROM_LOAD( "7_27c512.bin", 0x10000, 0x10000, CRC(449720ea) SHA1(aa52ea17293ab86c87eeb04c0c4172001ec56379) )
+
+ ROM_REGION( 0x20000, "gfx2", 0 ) // sprites
+ ROM_LOAD( "10_27c512.bin", 0x00000, 0x10000, CRC(8cf4e040) SHA1(641a5d13a63ca0dc56fef42ea1ada3b5b28ca864) )
+ ROM_LOAD( "9_27c512.bin", 0x10000, 0x10000, CRC(3c06fdf7) SHA1(cfce7eda1e6353b850777c38cabc304e1b123ea0) )
+
+ ROM_REGION( 0x100000, "gfx3", 0 ) // bitmaps
+ ROM_LOAD( "5_27c040.bin", 0x00000, 0x80000, CRC(5bac2567) SHA1(bd773761ce31192efc69d031fee13a95ab13b2fd) )
+ ROM_LOAD( "6_27c4001.bin", 0x80000, 0x80000, CRC(35b3b7bc) SHA1(2b7dc0606deb52e5ac725cd63cd56e1e2ef040f8) )
+
+ ROM_REGION( 0x10000, "m72", 0 ) // samples
+ ROM_LOAD( "1_27c512.bin", 0x00000, 0x10000, CRC(456c478b) SHA1(c8c8bf682dcc2b3a28ffbadcfaaba524141f792b) )
+
+ ROM_REGION( 0x400, "proms", 0 )
+ ROM_LOAD( "prom_4_82s129.bin", 0x0000, 0x0100, CRC(c324835e) SHA1(cf6ffe38523badfda211d341410e93e647de87a9) ) // video timing prom
+ ROM_LOAD( "prom_3_82s129.bin", 0x0100, 0x0100, CRC(e6506ef4) SHA1(079841da7640b14d94aaaeb572bf018932b58293) ) // unknown
+ ROM_LOAD( "prom_2_82s129.bin", 0x0200, 0x0100, CRC(b43d094f) SHA1(2bed4892d8a91d7faac5a07bf858d9294eb30606) ) // unknown
+ ROM_LOAD( "prom_1_82s129.bin", 0x0300, 0x0100, CRC(e0aa8869) SHA1(ac8bdfeba69420ba56ec561bf3d0f1229d02cea2) ) // unknown
+
+ ROM_REGION( 0x2000, "plds", 0 )
+ ROM_LOAD( "1_16v8.bin", 0x0000, 0x0117, NO_DUMP ) // PLD is read protected
+ ROM_LOAD( "2_22v10.bin", 0x0200, 0x0200, NO_DUMP ) // PLD is read protected
+ ROM_LOAD( "3_20v8.bin", 0x0400, 0x0157, NO_DUMP ) // PLD is read protected
+ ROM_LOAD( "4_16v8.bin", 0x0600, 0x0117, NO_DUMP ) // PLD is read protected
+ ROM_LOAD( "5_22v10.bin", 0x0800, 0x0200, NO_DUMP ) // PLD is read protected
+ ROM_LOAD( "6_16v8.bin", 0x0a00, 0x0117, NO_DUMP ) // PLD is read protected
+ ROM_LOAD( "7_22v10.bin", 0x0c00, 0x0200, NO_DUMP ) // PLD is read protected
+ ROM_LOAD( "8_16v8.bin", 0x0e00, 0x0117, NO_DUMP ) // PLD is read protected
+ ROM_LOAD( "9_16v8.bin", 0x1000, 0x0117, NO_DUMP ) // PLD is read protected
+ROM_END
+
+
+void vigilant_state::init_bowmen()
+{
+ uint8_t *ROM = memregion("maincpu")->base();
+ int size = memregion("maincpu")->bytes();
+
+ m_rear_pages = 16;
+
+ for (int i = 0x0000; i < size; i++)
+ {
+ ROM[i]= bitswap(ROM[i], 2, 5, 0, 7, 6, 1, 4, 3); // 0->5, 1->2, 2->7, 3->0, 4->1, 5->6, 6->3, 7->4
+ }
+}
+
+
GAME( 1988, vigilant, 0, vigilant, vigilant, vigilant_state, empty_init, ROT0, "Irem", "Vigilante (World, Rev E)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
GAME( 1988, vigilantg, vigilant, vigilant, vigilant, vigilant_state, empty_init, ROT0, "Irem (Data East license)", "Vigilante (US, Rev G)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
GAME( 1988, vigilanto, vigilant, vigilant, vigilant, vigilant_state, empty_init, ROT0, "Irem (Data East license)", "Vigilante (US)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
@@ -1176,3 +1428,5 @@ GAME( 1988, kikcubicb, kikcubic, kikcubic, kikcubic, vigilant_state, empty_in
GAME( 1989, buccanrs, 0, buccanrs, buccanrs, vigilant_state, empty_init, ROT0, "Duintronic", "Buccaneers (set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
GAME( 1989, buccanrsa, buccanrs, buccanrs, buccanra, vigilant_state, empty_init, ROT0, "Duintronic", "Buccaneers (set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
GAME( 1989, buccanrsb, buccanrs, buccanrs, buccanrs, vigilant_state, empty_init, ROT0, "Duintronic", "Buccaneers (set 3, harder)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
+
+GAME( 1994, bowmen, 0, bowmen, bowmen, vigilant_state, init_bowmen, ROT0, "Ten-Level", "Bowmen", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/includes/vigilant.h b/src/mame/includes/vigilant.h
index 975d5ad34e9..ca7de429a81 100644
--- a/src/mame/includes/vigilant.h
+++ b/src/mame/includes/vigilant.h
@@ -25,6 +25,8 @@ public:
void vigilant(machine_config &config);
void kikcubic(machine_config &config);
void buccanrs(machine_config &config);
+ void bowmen(machine_config &config);
+ void init_bowmen();
private:
required_device<cpu_device> m_maincpu;
@@ -43,6 +45,7 @@ private:
int m_rear_color = 0;
int m_rear_disable = 0;
int m_rear_refresh = 0;
+ int m_rear_pages = 4;
std::unique_ptr<bitmap_ind16> m_bg_bitmap;
// common
@@ -54,6 +57,8 @@ private:
void vigilant_horiz_scroll_w(offs_t offset, uint8_t data);
void vigilant_rear_horiz_scroll_w(offs_t offset, uint8_t data);
void vigilant_rear_color_w(uint8_t data);
+ void bowmen_rear_horiz_scroll_w(offs_t offset, uint8_t data);
+ void bowmen_rear_color_w(uint8_t data);
// kikcubic
void kikcubic_coin_w(uint8_t data);
@@ -64,9 +69,13 @@ private:
uint32_t screen_update_vigilant(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_kikcubic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update_bowmen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void update_background();
+ void update_background_bowmen();
void draw_foreground(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int opaque );
+ void draw_foreground_bowmen(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int opaque );
void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_background_bowmen(bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
void vigilant_postload();
@@ -77,6 +86,7 @@ private:
void sound_map(address_map &map);
void vigilant_io_map(address_map &map);
void vigilant_map(address_map &map);
+ void bowmen_io_map(address_map &map);
};
#endif // MAME_INCLUDES_VIGILANT_H
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 12005368d9e..29108dc0752 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -42672,6 +42672,7 @@ toureiff //
winner //
@source:vigilant.cpp
+bowmen // (c) 1994 Ten-Level
buccanrs // (c) 1989 Duintronic
buccanrsa // (c) 1989 Duintronic
buccanrsb // (c) 1989 Duintronic
diff --git a/src/mame/video/vigilant.cpp b/src/mame/video/vigilant.cpp
index 53fcfc60a8e..dffb29c8885 100644
--- a/src/mame/video/vigilant.cpp
+++ b/src/mame/video/vigilant.cpp
@@ -17,11 +17,12 @@
static const rectangle bottomvisiblearea(16*8, 48*8-1, 6*8, 32*8-1);
+static const rectangle bowmenvisiblearea(16*8, 48*8-1, 0*8, 32*8-1);
void vigilant_state::video_start()
{
- m_bg_bitmap = std::make_unique<bitmap_ind16>(512*4,256);
+ m_bg_bitmap = std::make_unique<bitmap_ind16>(512 * m_rear_pages, 256);
save_item(NAME(m_horiz_scroll_low));
save_item(NAME(m_horiz_scroll_high));
@@ -57,25 +58,57 @@ void vigilant_state::video_reset()
**************************************************************************/
void vigilant_state::update_background()
{
- int row,col,page;
+ int row, col, page;
int charcode;
- charcode=0;
+ charcode = 0;
- /* There are only three background ROMs (4 on bunccaneers!) */
- for (page=0; page<4; page++)
+ // There are only three background ROMs (4 on bunccaneers!)
+ for (page = 0; page < 4; page++)
{
- for( row=0; row<256; row++ )
+ for( row = 0; row < 256; row++ )
{
- for( col=0; col<512; col+=32 )
+ for( col = 0; col < 512; col += 32 )
{
m_gfxdecode->gfx(2)->opaque(*m_bg_bitmap,
m_bg_bitmap->cliprect(),
charcode,
row < 128 ? 0 : 1,
- 0,0,
- 512*page + col,row);
+ 0, 0,
+ 512 * page + col, row);
+ charcode++;
+ }
+ }
+ }
+}
+
+/***************************************************************************
+ update_background
+
+ There are three background ROMs, each one contains a 512x256 picture.
+ **************************************************************************/
+void vigilant_state::update_background_bowmen()
+{
+ int row, col, page;
+ int charcode;
+
+
+ charcode = 0;
+
+ // There are 16 backgrounds
+ for (page = 0; page < 16; page++)
+ {
+ for( row = 0; row < 256; row++ )
+ {
+ for( col = 0; col < 512; col += 32 )
+ {
+ m_gfxdecode->gfx(2)->opaque(*m_bg_bitmap,
+ m_bg_bitmap->cliprect(),
+ charcode,
+ 0,
+ 0, 0,
+ 512 * page + col, row);
charcode++;
}
}
@@ -100,7 +133,7 @@ void vigilant_state::update_background()
**************************************************************************/
void vigilant_state::paletteram_w(offs_t offset, uint8_t data)
{
- int bank,r,g,b;
+ int bank, r, g, b;
m_generic_paletteram_8[offset] = data;
@@ -112,7 +145,7 @@ void vigilant_state::paletteram_w(offs_t offset, uint8_t data)
g = (m_generic_paletteram_8[bank + offset + 0x100] << 3) & 0xFF;
b = (m_generic_paletteram_8[bank + offset + 0x200] << 3) & 0xFF;
- m_palette->set_pen_color((bank >> 2) + offset,rgb_t(r,g,b));
+ m_palette->set_pen_color((bank >> 2) + offset, rgb_t(r, g, b));
}
@@ -125,10 +158,10 @@ void vigilant_state::paletteram_w(offs_t offset, uint8_t data)
**************************************************************************/
void vigilant_state::vigilant_horiz_scroll_w(offs_t offset, uint8_t data)
{
- if (offset==0)
+ if (offset == 0)
m_horiz_scroll_low = data;
else
- m_horiz_scroll_high = (data & 0x01) * 256;
+ m_horiz_scroll_high = (data & 0xff) * 256;
}
/***************************************************************************
@@ -139,7 +172,7 @@ void vigilant_state::vigilant_horiz_scroll_w(offs_t offset, uint8_t data)
***************************************************************************/
void vigilant_state::vigilant_rear_horiz_scroll_w(offs_t offset, uint8_t data)
{
- if (offset==0)
+ if (offset == 0)
m_rear_horiz_scroll_low = data;
else
m_rear_horiz_scroll_high = (data & 0x07) * 256;
@@ -167,6 +200,42 @@ void vigilant_state::vigilant_rear_color_w(uint8_t data)
}
/***************************************************************************
+ bowmen_rear_horiz_scroll_w
+
+ rear_horiz_scroll_low = RHSPL, an 8-bit register
+ rear_horiz_scroll_high = RHSPH, an 8-bit register
+***************************************************************************/
+void vigilant_state::bowmen_rear_horiz_scroll_w(offs_t offset, uint8_t data)
+{
+ if (offset == 0)
+ m_rear_horiz_scroll_low = data;
+ else
+ m_rear_horiz_scroll_high = (data & 0x1f) * 256;
+}
+
+/***************************************************************************
+ bowmen_rear_color_w
+
+ This is an 8-bit register labelled RCOD.
+ D6 is hooked to !ROME (rear_disable)
+ D3 = RCC2 (rear color bit 2)
+ D2 = RCC1 (rear color bit 1)
+ D0 = RCC0 (rear color bit 0)
+
+ I know it looks odd, but D1, D4, D5, and D7 are empty.
+
+ What makes this extremely odd is that RCC is supposed to hook up to the
+ palette. However, the top four bits of the palette inputs are labelled:
+ "RCC3", "RCC2", "V256E", "RCC0". Methinks there's a typo.
+ **************************************************************************/
+void vigilant_state::bowmen_rear_color_w(uint8_t data)
+{
+ m_rear_disable = data & 0x40;
+ m_rear_color = (data & 0x0f);
+}
+
+
+/***************************************************************************
draw_foreground
???
@@ -179,38 +248,38 @@ void vigilant_state::draw_foreground(bitmap_ind16 &bitmap, const rectangle &clip
for (int offs = 0; offs < 0x1000; offs += 2)
{
- int sy = 8 * ((offs/2) / 64);
- int sx = 8 * ((offs/2) % 64);
- int attributes = m_videoram[offs+1];
- int color = attributes & 0x0F;
- int tile_number = m_videoram[offs] | ((attributes & 0xF0) << 4);
+ int sy = 8 * ((offs / 2) / 64);
+ int sx = 8 * ((offs / 2) % 64);
+ int attributes = m_videoram[offs + 1];
+ int color = attributes & 0x0f;
+ int tile_number = m_videoram[offs] | ((attributes & 0xf0) << 4);
- if (priority) /* foreground */
+ if (priority) // foreground
{
- if ((color & 0x0c) == 0x0c) /* mask sprites */
+ if ((color & 0x0c) == 0x0c) // mask sprites
{
if (sy >= 48)
{
sx = (sx + scroll) & 0x1ff;
- m_gfxdecode->gfx(0)->transmask(bitmap,bottomvisiblearea,
+ m_gfxdecode->gfx(0)->transmask(bitmap, bottomvisiblearea,
tile_number,
color,
- 0,0,
- sx,sy,0x00ff);
+ 0, 0,
+ sx, sy, 0x00ff);
}
}
}
- else /* background */
+ else // background
{
if (sy >= 48)
sx = (sx + scroll) & 0x1ff;
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
tile_number,
color,
- 0,0,
- sx,sy,
+ 0, 0,
+ sx, sy,
(opaque || color >= 4) ? -1 : 0);
}
}
@@ -220,48 +289,48 @@ void vigilant_state::draw_foreground(bitmap_ind16 &bitmap, const rectangle &clip
void vigilant_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int scrollx = 0x17a + 16*8 - (m_rear_horiz_scroll_low + m_rear_horiz_scroll_high);
+ int scrollx = 0x17a + 16 * 8 - (m_rear_horiz_scroll_low + m_rear_horiz_scroll_high);
if (m_rear_refresh)
{
update_background();
- m_rear_refresh=0;
+ m_rear_refresh = 0;
}
- copyscrollbitmap(bitmap,*m_bg_bitmap,1,&scrollx,0,nullptr,bottomvisiblearea);
+ copyscrollbitmap(bitmap, *m_bg_bitmap, 1, &scrollx, 0, nullptr, bottomvisiblearea);
}
-void vigilant_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
+void vigilant_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- for (int offs = 0;offs < m_spriteram.bytes();offs += 8)
+ for (int offs = 0; offs < m_spriteram.bytes(); offs += 8)
{
- int code,color,sx,sy,flipx,flipy,h,y;
-
- code = m_spriteram[offs+4] | ((m_spriteram[offs+5] & 0x0f) << 8);
- color = m_spriteram[offs+0] & 0x0f;
- sx = (m_spriteram[offs+6] | ((m_spriteram[offs+7] & 0x01) << 8));
- sy = 256+128 - (m_spriteram[offs+2] | ((m_spriteram[offs+3] & 0x01) << 8));
- flipx = m_spriteram[offs+5] & 0x40;
- flipy = m_spriteram[offs+5] & 0x80;
- h = 1 << ((m_spriteram[offs+5] & 0x30) >> 4);
+ int code, color, sx, sy, flipx, flipy, h, y;
+
+ code = m_spriteram[offs + 4] | ((m_spriteram[offs + 5] & 0x0f) << 8);
+ color = m_spriteram[offs + 0] & 0x0f;
+ sx = (m_spriteram[offs + 6] | ((m_spriteram[offs + 7] & 0x01) << 8));
+ sy = 256 + 128 - (m_spriteram[offs + 2] | ((m_spriteram[offs + 3] & 0x01) << 8));
+ flipx = m_spriteram[offs + 5] & 0x40;
+ flipy = m_spriteram[offs + 5] & 0x80;
+ h = 1 << ((m_spriteram[offs + 5] & 0x30) >> 4);
sy -= 16 * h;
code &= ~(h - 1);
- for (y = 0;y < h;y++)
+ for (y = 0; y < h; y++)
{
int c = code;
- if (flipy) c += h-1-y;
+ if (flipy) c += h - 1 - y;
else c += y;
- m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(1)->transpen(bitmap, cliprect,
c,
color,
- flipx,flipy,
- sx,sy + 16*y,0);
+ flipx, flipy,
+ sx, sy + 16 * y, 0);
}
}
}
@@ -270,17 +339,17 @@ uint32_t vigilant_state::screen_update_kikcubic(screen_device &screen, bitmap_in
{
for (int offs = 0; offs < 0x1000; offs += 2)
{
- int sy = 8 * ((offs/2) / 64);
- int sx = 8 * ((offs/2) % 64);
- int attributes = m_videoram[offs+1];
- int color = (attributes & 0xF0) >> 4;
- int tile_number = m_videoram[offs] | ((attributes & 0x0F) << 8);
+ int sy = 8 * ((offs / 2) / 64);
+ int sx = 8 * ((offs / 2) % 64);
+ int attributes = m_videoram[offs + 1];
+ int color = (attributes & 0xf0) >> 4;
+ int tile_number = m_videoram[offs] | ((attributes & 0x0f) << 8);
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect,
+ m_gfxdecode->gfx(0)->opaque(bitmap, cliprect,
tile_number,
color,
- 0,0,
- sx,sy);
+ 0, 0,
+ sx, sy);
}
draw_sprites(bitmap,cliprect);
@@ -289,37 +358,119 @@ uint32_t vigilant_state::screen_update_kikcubic(screen_device &screen, bitmap_in
uint32_t vigilant_state::screen_update_vigilant(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- /* copy the background palette */
- for (int i = 0;i < 16;i++)
+ // copy the background palette
+ for (int i = 0; i < 16; i++)
+ {
+ int r, g, b;
+
+
+ r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + i] << 3) & 0xff;
+ g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + i] << 3) & 0xff;
+ b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + i] << 3) & 0xff;
+
+ m_palette->set_pen_color(512 + i, rgb_t(r, g, b));
+
+ r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + 32 + i] << 3) & 0xff;
+ g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + 32 + i] << 3) & 0xff;
+ b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + 32 + i] << 3) & 0xff;
+
+ m_palette->set_pen_color(512 + 16 + i, rgb_t(r, g, b));
+ }
+
+ if (m_rear_disable) // opaque foreground
+ {
+ draw_foreground(bitmap, cliprect, 0, 1);
+ draw_sprites(bitmap, bottomvisiblearea);
+ draw_foreground(bitmap, cliprect, 1, 0);
+ }
+ else
+ {
+ draw_background(bitmap, cliprect);
+ draw_foreground(bitmap, cliprect, 0, 0);
+ draw_sprites(bitmap, bottomvisiblearea);
+ draw_foreground(bitmap, cliprect, 1, 0); // priority tiles
+ }
+ return 0;
+}
+
+void vigilant_state::draw_foreground_bowmen(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int opaque )
+{
+ for (int offs = 0; offs < 0x1000; offs += 2)
+ {
+ int sy = 8 * ((offs / 2) / 64);
+ int sx = 8 * ((offs / 2) % 64);
+ int attributes = m_videoram[offs + 1];
+ int color = attributes & 0x0f;
+ int tile_number = m_videoram[offs] | ((attributes & 0xf0) << 4);
+
+ if (priority) // foreground
+ {
+ if ((color & 0x0f) == 0x0f) // mask sprites
+ {
+ m_gfxdecode->gfx(0)->transmask(bitmap, bowmenvisiblearea,
+ tile_number,
+ color,
+ 0, 0,
+ sx, sy, 0x00ff);
+ }
+ }
+ else // background
+ {
+ m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
+ tile_number,
+ color,
+ 0, 0,
+ sx, sy,
+ (opaque) ? -1 : 0);
+ }
+ }
+}
+
+void vigilant_state::draw_background_bowmen(bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ int scrollx = 0x179 + 16 * 8 - (m_rear_horiz_scroll_low + m_rear_horiz_scroll_high);
+
+
+ if (m_rear_refresh)
+ {
+ update_background_bowmen();
+ m_rear_refresh = 0;
+ }
+
+ copyscrollbitmap(bitmap, *m_bg_bitmap, 1, &scrollx, 0, nullptr, bowmenvisiblearea);
+}
+
+uint32_t vigilant_state::screen_update_bowmen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ // copy the background palette
+ for (int i = 0; i < 16; i++)
{
- int r,g,b;
+ int r, g, b;
- r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + i] << 3) & 0xFF;
- g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + i] << 3) & 0xFF;
- b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + i] << 3) & 0xFF;
+ r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + i] << 3) & 0xff;
+ g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + i] << 3) & 0xff;
+ b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + i] << 3) & 0xff;
- m_palette->set_pen_color(512 + i,rgb_t(r,g,b));
+ m_palette->set_pen_color(512 + i, rgb_t(r, g, b));
- r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + 32 + i] << 3) & 0xFF;
- g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + 32 + i] << 3) & 0xFF;
- b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + 32 + i] << 3) & 0xFF;
+ r = (m_generic_paletteram_8[0x400 + 16 * m_rear_color + 32 + i] << 3) & 0xff;
+ g = (m_generic_paletteram_8[0x500 + 16 * m_rear_color + 32 + i] << 3) & 0xff;
+ b = (m_generic_paletteram_8[0x600 + 16 * m_rear_color + 32 + i] << 3) & 0xff;
- m_palette->set_pen_color(512 + 16 + i,rgb_t(r,g,b));
+ m_palette->set_pen_color(512 + 16 + i, rgb_t(r, g, b));
}
- if (m_rear_disable) /* opaque foreground */
+ if (m_rear_disable) // opaque foreground
{
- draw_foreground(bitmap,cliprect,0,1);
- draw_sprites(bitmap,bottomvisiblearea);
- draw_foreground(bitmap,cliprect,1,0);
+ draw_foreground_bowmen(bitmap, cliprect, 0, 1);
}
else
{
- draw_background(bitmap,cliprect);
- draw_foreground(bitmap,cliprect,0,0);
- draw_sprites(bitmap,bottomvisiblearea);
- draw_foreground(bitmap,cliprect,1,0); // priority tiles
+ draw_background_bowmen(bitmap, cliprect);
+ draw_foreground_bowmen(bitmap, cliprect, 0, 0);
}
+ draw_sprites(bitmap, bowmenvisiblearea);
+// draw_foreground_bowmen(bitmap, cliprect, 1, 0); // priority tiles
return 0;
}