mastboyo.cpp updates: Changed IN0 to DSW, IN1 to IN0, added remaining

DIP switches allowing the initial test mode. Added new set as parent
due to be consistent with the schematics from the manual, and has ex-
tra banks of questions. Cleaned-up the driver. [Roberto Fresca]

New working machines
--------------------
Master Boy (1987, Z80 hardware, set 1) [Roberto Fresca, ClawGrip, recreativas.org]
This commit is contained in:
Roberto Fresca 2018-08-16 23:38:05 +02:00
parent 84a1500026
commit 13f0d4521d
2 changed files with 117 additions and 53 deletions

View File

@ -2,9 +2,10 @@
// copyright-holders:David Haywood
/*
Master Boy, Z80 hardware version
Master Boy, Z80 hardware version.
this is Gaelco's first game, although there should be a 1986 release too, likely on the same hardware
This is Gaelco's first game, although there should be a 1986 release too,
likely on the same hardware.
*/
@ -16,6 +17,7 @@ this is Gaelco's first game, although there should be a 1986 release too, likely
#include "speaker.h"
#include "machine/nvram.h"
class mastboyo_state : public driver_device
{
public:
@ -58,13 +60,14 @@ private:
DECLARE_PALETTE_INIT(mastboyo);
};
TILE_GET_INFO_MEMBER(mastboyo_state::get_fg_tile_info)
{
int code = m_fgram[tile_index];
int attr = m_fgram2[tile_index];
SET_TILE_INFO_MEMBER(0,
code,
attr&0xf,
attr & 0x0f,
0);
}
@ -73,6 +76,12 @@ void mastboyo_state::video_start()
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(mastboyo_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
uint32_t mastboyo_state::screen_update_mastboyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
WRITE8_MEMBER(mastboyo_state::fgram_w)
{
m_fgram[offset] = data;
@ -85,22 +94,23 @@ WRITE8_MEMBER(mastboyo_state::fgram2_w)
m_fg_tilemap->mark_tile_dirty(offset);
}
PALETTE_INIT_MEMBER(mastboyo_state, mastboyo)
{
for (int i = 0; i < palette.entries(); i++)
{
const int pal = (m_paletterom[i] & 0x0f) | ((m_paletterom[palette.entries() + i] & 0x0f) << 4);
const int green = (pal & 0x07);
const int red = (pal & 0x38) >> 3;
const int blue = (pal & 0xc0) >> 6;
palette.set_pen_color(i, pal3bit(red), pal3bit(green), pal2bit(blue));
}
}
WRITE8_MEMBER(mastboyo_state::rombank_w)
{
m_bank1->set_entry(data&0xf);
}
uint32_t mastboyo_state::screen_update_mastboyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
void mastboyo_state::mastboyo_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x01).w("aysnd", FUNC(ym2149_device::address_data_w));
map(0x00, 0x00).r("aysnd", FUNC(ym2149_device::data_r));
m_bank1->set_entry(data & 0x0f);
}
@ -115,9 +125,28 @@ void mastboyo_state::mastboyo_map(address_map &map)
map(0x8000, 0xffff).bankr("bank1");
}
void mastboyo_state::mastboyo_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x01).w("aysnd", FUNC(ym2149_device::address_data_w));
map(0x00, 0x00).r("aysnd", FUNC(ym2149_device::data_r));
}
static INPUT_PORTS_START( mastboyo )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
// note, Player 2 buttons must be used when entering name, and can be used for answering questions even in single player mode
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Red / Enter Initial")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Green / Delete Initial")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Red / <<")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Green / >>")
PORT_START("DSW")
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coin_A ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) )
@ -133,23 +162,16 @@ static INPUT_PORTS_START( mastboyo )
PORT_DIPSETTING( 0x10, "3" )
PORT_DIPSETTING( 0x20, "4" )
PORT_DIPSETTING( 0x30, "6" )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPNAME( 0x40, 0x40, "Con Reclamo" )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
// note, Player 2 buttons must be used when entering name, and can be used for answering questions even in single player mode
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Red / Enter Initial")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Green / Delete Initial")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Red / <<")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Green / >>")
PORT_DIPNAME( 0x80, 0x80, "Test Inicial" )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
// PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) <--- Why to mask and hide the test mode???
INPUT_PORTS_END
static const gfx_layout tiles8x8_layout =
{
8,8,
@ -161,36 +183,26 @@ static const gfx_layout tiles8x8_layout =
32*8
};
static GFXDECODE_START( gfx_mastboyo )
GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 )
GFXDECODE_END
void mastboyo_state::machine_start()
{
m_bank1->configure_entries(0, 0x10, &m_questionrom[0x00000], 0x08000);
m_bank1->set_entry(1);
}
PALETTE_INIT_MEMBER(mastboyo_state, mastboyo)
{
for (int i = 0; i < palette.entries(); i++)
{
const int pal = (m_paletterom[i]&0x0f) | ((m_paletterom[palette.entries() + i]&0x0f) << 4);
const int green = (pal & 0x07);
const int red = (pal & 0x38) >> 3;
const int blue = (pal & 0xc0) >> 6;
palette.set_pen_color(i, pal3bit(red), pal3bit(green), pal2bit(blue));
}
}
MACHINE_CONFIG_START(mastboyo_state::mastboyo)
/* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", Z80, 20_MHz_XTAL/6)
MCFG_DEVICE_ADD("maincpu", Z80, 20_MHz_XTAL / 6)
MCFG_DEVICE_PROGRAM_MAP(mastboyo_map)
MCFG_DEVICE_IO_MAP(mastboyo_portmap)
MCFG_DEVICE_PERIODIC_INT_DRIVER(mastboyo_state, irq0_line_hold, 256.244f) // not sure, INT0 pin was measured at 256.244Hz
MCFG_DEVICE_PERIODIC_INT_DRIVER(mastboyo_state, irq0_line_hold, 256.244f) // not sure, INT0 pin was measured at 256.244Hz
MCFG_NVRAM_ADD_0FILL("nvram")
@ -211,14 +223,63 @@ MACHINE_CONFIG_START(mastboyo_state::mastboyo)
/* sound hardware */
SPEAKER(config, "mono").front_center();
MCFG_DEVICE_ADD("aysnd", AY8910, 20_MHz_XTAL/4)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("IN0")) // DSW
MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN1")) // player inputs
MCFG_DEVICE_ADD("aysnd", AY8910, 20_MHz_XTAL / 4)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW")) // DSW
MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN0")) // player inputs
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
/*
Master Boy.
Gaelco (Covielsa license)
This set is similar to the other, but with different addressing ROMs.
The ROMs scheme matches the schematics in the manual.
Also has a totally different device for questions: mastboy_27256.ic11,
which is mapped at 0x78000 (all 0xff in the other set)
Due to device addressing and the extra questions device, this dump was
set as parent.
*/
ROM_START( mastboyo )
ROM_REGION( 0x4000, "maincpu", 0 )
ROM_LOAD( "mastboy_27256.ic14", 0x0000, 0x4000, CRC(a212ff85) SHA1(08ff0f401e479cbe83012b62ef9307bc33ebabaa) )
ROM_CONTINUE( 0x0000, 0x4000) // Data is in the 2nd half. First one is filled with 0xff's...
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "mastboy_27256.ic36", 0x0000, 0x4000, CRC(d862ca23) SHA1(887487601bee2195d6cde0304190277ed358d563) )
ROM_CONTINUE( 0x0000, 0x4000) // Data is in the 2nd half. First one is filled with 0xff's...
ROM_REGION( 0x80000, "questions", ROMREGION_ERASEFF )
ROM_LOAD( "mastboy_27256.ic7", 0x40000, 0x08000, CRC(3a214efd) SHA1(752fe28a70dc01b5d4ec38c4751e609c690eed71) )
ROM_LOAD( "mastboy_27256.ic6", 0x48000, 0x08000, CRC(4d682cfb) SHA1(7939cbc72f20c1e930b0a91ac164c7c8b3d8cb34) )
ROM_LOAD( "mastboy_27256.ic8", 0x50000, 0x08000, CRC(40b07eeb) SHA1(93f62e0a2a330f7ff1041eaa7cba3ef42121b1a8) )
ROM_LOAD( "mastboy_27256.ic10", 0x60000, 0x08000, CRC(b92ffd4f) SHA1(34431d6771e58f2ec083756f07e8b2a02bdb0e5a) )
ROM_LOAD( "mastboy_27256.ic9", 0x68000, 0x08000, CRC(266e7d37) SHA1(39b5e4ff4475393126a97c8b51980bfc1b7b2627) )
ROM_LOAD( "mastboy_27256.ic12", 0x70000, 0x08000, CRC(efb4b2f9) SHA1(c68f7d83549b554d25f7404a758f48f962622a2d) )
ROM_LOAD( "mastboy_27256.ic11", 0x78000, 0x08000, CRC(f2611186) SHA1(05860fecc23014c39cb28762763e94bc91412b34) )
ROM_REGION( 0x100, "proms", 0 ) // timing or memory mapping?
ROM_LOAD( "d_82s129.ic23", 0x000, 0x100, CRC(d5fd2dfd) SHA1(66e3afa9e73507db0647d125c0be992b27d08adc) )
ROM_REGION( 0x200, "palette", 0 )
ROM_LOAD( "h_82s129.ic39", 0x100, 0x100, CRC(8e965fc3) SHA1(b52c8e505438937c7a5d3e1393d54f0ad0425e78) )
ROM_LOAD( "l_82s129.ic40", 0x000, 0x100, CRC(4d061216) SHA1(1abf9320da75a3fd23c6bdbcc4088d18e133c4e5) )
ROM_END
/*
This set has the 78000-80000 range filled with 0xFF's.
There are more questions banks inside this range in
the parent set.
*/
ROM_START( mastboyoa )
ROM_REGION( 0x04000, "maincpu", 0 )
ROM_LOAD( "masterboy-1987-27128-ic14.bin", 0x00000, 0x04000, CRC(d05a22eb) SHA1(528eb27622d28d098ceefc6a6fb43bb1a527444d) )
@ -228,16 +289,18 @@ ROM_START( mastboyo )
ROM_REGION( 0x80000, "questions", ROMREGION_ERASEFF )
/* IC6 - IC9 empty */
ROM_LOAD( "masterboy-1987-27c512-ic10.bin", 0x40000, 0x10000, CRC(66da2826) SHA1(ef86efbfa251fc7cf62fe99b26551203fd599294) )
ROM_LOAD( "masterboy-1987-27256-ic11.bin", 0x50000, 0x08000, CRC(40b07eeb) SHA1(93f62e0a2a330f7ff1041eaa7cba3ef42121b1a8) )
ROM_LOAD( "masterboy-1987-27256-ic11.bin", 0x50000, 0x08000, CRC(40b07eeb) SHA1(93f62e0a2a330f7ff1041eaa7cba3ef42121b1a8) ) // Identical to ic8 from the parent.
ROM_LOAD( "masterboy-1987-27c512-ic12.bin", 0x60000, 0x10000, CRC(b2819e38) SHA1(e4dd036747221926d0f9f86e00e28f578decc942) )
ROM_LOAD( "masterboy-1987-27c512-ic13.bin", 0x70000, 0x10000, CRC(71df82e9) SHA1(a0d75ec1181094e39d2246805e4dac5a621daa1a) )
ROM_LOAD( "masterboy-1987-27c512-ic13.bin", 0x70000, 0x10000, CRC(71df82e9) SHA1(a0d75ec1181094e39d2246805e4dac5a621daa1a) ) // Second half is filled with 0xff's.
ROM_REGION( 0x100, "proms", 0 ) // timing or memory mapping?
ROM_LOAD( "masterboy-1987-82s129-d-ic23.bin", 0x000, 0x100, CRC(d5fd2dfd) SHA1(66e3afa9e73507db0647d125c0be992b27d08adc) )
ROM_LOAD( "masterboy-1987-82s129-d-ic23.bin", 0x000, 0x100, CRC(d5fd2dfd) SHA1(66e3afa9e73507db0647d125c0be992b27d08adc) ) // Identical to the parent set.
ROM_REGION( 0x200, "palette", 0 )
ROM_LOAD( "masterboy-1987-82s129-h-ic39.bin", 0x100, 0x100, CRC(8e965fc3) SHA1(b52c8e505438937c7a5d3e1393d54f0ad0425e78) )
ROM_LOAD( "masterboy-1987-82s129-l-ic40.bin", 0x000, 0x100, CRC(4d061216) SHA1(1abf9320da75a3fd23c6bdbcc4088d18e133c4e5) )
ROM_LOAD( "masterboy-1987-82s129-h-ic39.bin", 0x100, 0x100, CRC(8e965fc3) SHA1(b52c8e505438937c7a5d3e1393d54f0ad0425e78) ) // Identical to the parent set.
ROM_LOAD( "masterboy-1987-82s129-l-ic40.bin", 0x000, 0x100, CRC(4d061216) SHA1(1abf9320da75a3fd23c6bdbcc4088d18e133c4e5) ) // Identical to the parent set.
ROM_END
GAME( 1987, mastboyo, 0, mastboyo, mastboyo, mastboyo_state, empty_init, ROT0, "Gaelco (Covielsa license)", "Master Boy (1987, Z80 hardware)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, mastboyo, 0, mastboyo, mastboyo, mastboyo_state, empty_init, ROT0, "Gaelco (Covielsa license)", "Master Boy (1987, Z80 hardware, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, mastboyoa, mastboyo, mastboyo, mastboyo, mastboyo_state, empty_init, ROT0, "Gaelco (Covielsa license)", "Master Boy (1987, Z80 hardware, set 2)", MACHINE_SUPPORTS_SAVE )

View File

@ -18645,6 +18645,7 @@ mastboyia // (c) 1991 - No Ref on the PCB
@source:mastboyo.cpp
mastboyo // (c) 1987 - No Ref on the PCB
mastboyoa // (c) 1987 - No Ref on the PCB
@source:matmania.cpp
excthour // TA-0015 (c) 1985 + Taito license