tugboat.c: correct AY chip type and clock, some cleanups [Alex Jackson]

This commit is contained in:
Alex W. Jackson 2014-01-31 08:03:45 +00:00
parent af484162db
commit 4b75237697

View File

@ -52,9 +52,9 @@ public:
DECLARE_WRITE8_MEMBER(tugboat_hd46505_1_w);
DECLARE_WRITE8_MEMBER(tugboat_score_w);
DECLARE_READ8_MEMBER(tugboat_input_r);
DECLARE_READ8_MEMBER(tugboat_ctrl_r);
DECLARE_WRITE8_MEMBER(tugboat_ctrl_w);
virtual void machine_start();
virtual void video_start();
virtual void machine_reset();
virtual void palette_init();
UINT32 screen_update_tugboat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -75,6 +75,12 @@ void tugboat_state::machine_start()
save_item(NAME(m_ctrl));*/
}
void tugboat_state::video_start()
{
machine().gfx[0]->set_granularity(8);
machine().gfx[2]->set_granularity(8);
}
/* there isn't the usual resistor array anywhere near the color prom,
just four 1k resistors. */
void tugboat_state::palette_init()
@ -82,12 +88,10 @@ void tugboat_state::palette_init()
const UINT8 *color_prom = memregion("proms")->base();
int i;
for (i = 0;i < machine().total_colors();i++)
{
int r,g,b,brt;
brt = ((color_prom[i] >> 3) & 0x01) ? 0xff : 0x80;
r = brt * ((color_prom[i] >> 0) & 0x01);
@ -129,17 +133,20 @@ void tugboat_state::draw_tilemap(bitmap_ind16 &bitmap,const rectangle &cliprect,
{
for (x = 0;x < 32;x++)
{
int code = (m_ram[addr + 0x400] << 8) | m_ram[addr];
int color = (code & 0x3c00) >> 10;
int rgn;
int attr = m_ram[addr + 0x400];
int code = ((attr & 0x01) << 8) | m_ram[addr];
int color = (attr & 0x3c) >> 2;
int rgn, transpen;
code &=0x3ff;
rgn = gfx0;
if (code > 0x1ff)
if (attr & 0x02)
{
code &= 0x1ff;
rgn = gfx1;
transpen = 7;
}
else
{
rgn = gfx0;
transpen = 1;
}
drawgfx_transpen(bitmap,cliprect,machine().gfx[rgn],
@ -147,7 +154,7 @@ void tugboat_state::draw_tilemap(bitmap_ind16 &bitmap,const rectangle &cliprect,
color,
0,0,
8*x,8*y,
transparency ? 7 : -1);
transparency ? transpen : -1);
addr = (addr & 0xfc00) | ((addr + 1) & 0x03ff);
}
@ -181,11 +188,6 @@ READ8_MEMBER(tugboat_state::tugboat_input_r)
return ioport("IN4")->read();
}
READ8_MEMBER(tugboat_state::tugboat_ctrl_r)
{
return m_ctrl;
}
WRITE8_MEMBER(tugboat_state::tugboat_ctrl_w)
{
m_ctrl = data;
@ -211,6 +213,7 @@ void tugboat_state::machine_reset()
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tugboat_state )
ADDRESS_MAP_GLOBAL_MASK(0x7fff)
AM_RANGE(0x0000, 0x01ff) AM_RAM AM_SHARE("ram")
AM_RANGE(0x1060, 0x1061) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
AM_RANGE(0x10a0, 0x10a1) AM_WRITE(tugboat_hd46505_0_w) /* scrolling is performed changing the start_addr register (0C/0D) */
@ -221,7 +224,6 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tugboat_state )
AM_RANGE(0x18e0, 0x18ef) AM_WRITE(tugboat_score_w)
AM_RANGE(0x2000, 0x2fff) AM_RAM /* tilemap RAM */
AM_RANGE(0x4000, 0x7fff) AM_ROM
AM_RANGE(0xfff0, 0xffff) AM_ROM /* vectors */
ADDRESS_MAP_END
@ -308,6 +310,17 @@ INPUT_PORTS_END
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,1),
1,
{ 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
};
static const gfx_layout tilelayout =
{
8,8,
RGN_FRAC(1,3),
@ -320,9 +333,9 @@ static const gfx_layout charlayout =
static GFXDECODE_START( tugboat )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x80, 16 )
GFXDECODE_ENTRY( "gfx2", 0, charlayout, 0x80, 16 )
GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0x80, 16 )
GFXDECODE_ENTRY( "gfx3", 0, charlayout, 0x00, 16 )
GFXDECODE_ENTRY( "gfx4", 0, charlayout, 0x00, 16 )
GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 0x00, 16 )
GFXDECODE_END
@ -336,7 +349,6 @@ static MACHINE_CONFIG_START( tugboat, tugboat_state )
MCFG_DEVICE_ADD("pia1", PIA6821, 0)
MCFG_PIA_READPA_HANDLER(IOPORT("DSW"))
MCFG_PIA_READPB_HANDLER(READ8(tugboat_state, tugboat_ctrl_r))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(tugboat_state, tugboat_ctrl_w))
MCFG_SCREEN_ADD("screen", RASTER)
@ -348,11 +360,10 @@ static MACHINE_CONFIG_START( tugboat, tugboat_state )
MCFG_GFXDECODE(tugboat)
MCFG_PALETTE_LENGTH(256)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
MCFG_SOUND_ADD("aysnd", AY8912, XTAL_10MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
MACHINE_CONFIG_END
@ -362,22 +373,17 @@ ROM_START( tugboat )
ROM_LOAD( "u7.bin", 0x5000, 0x1000, CRC(e81d7581) SHA1(c76327e3b027a5a2af69f8cfafa1f828ad0ebdb1) )
ROM_LOAD( "u8.bin", 0x6000, 0x1000, CRC(7525de06) SHA1(0722c7a0b89c55162227173679ffbe398ca350a2) )
ROM_LOAD( "u9.bin", 0x7000, 0x1000, CRC(aa4ae687) SHA1(a212eed5d04d6197aa3484ff36059fd7998604a6) )
ROM_RELOAD( 0xf000, 0x1000 ) /* for the vectors */
ROM_REGION( 0x1800, "gfx1", ROMREGION_INVERT )
ROM_REGION( 0x0800, "gfx1", ROMREGION_INVERT )
ROM_LOAD( "u67.bin", 0x0000, 0x0800, CRC(601c425b) SHA1(13ed54ba1307ba3f779293d88c19d0c0f2d91a96) )
ROM_FILL( 0x0800, 0x0800, 0xff )
ROM_FILL( 0x1000, 0x0800, 0xff )
ROM_REGION( 0x3000, "gfx2", ROMREGION_INVERT )
ROM_LOAD( "u68.bin", 0x0000, 0x1000, CRC(d5835182) SHA1(f67c8f93e0d7dd1bf8e3a98756719d386c133d1c) )
ROM_LOAD( "u69.bin", 0x1000, 0x1000, CRC(e6d25878) SHA1(de9096ef3108d031049be1e7f2c5e346d0bc0df1) )
ROM_LOAD( "u70.bin", 0x2000, 0x1000, CRC(34ce2850) SHA1(8883126627ed8a1d2c3bed2a3d169ce35eafc8a3) )
ROM_REGION( 0x1800, "gfx3", 0 )
ROM_REGION( 0x0800, "gfx3", 0 )
ROM_LOAD( "u168.bin", 0x0000, 0x0800, CRC(279042fd) SHA1(1361fff1bc532251bbd36b7b60776c2cc137cfba) ) /* labeled u-167 */
ROM_RELOAD( 0x0800, 0x0800 )
ROM_RELOAD( 0x1000, 0x0800 )
ROM_REGION( 0x1800, "gfx4", 0 )
ROM_LOAD( "u170.bin", 0x0000, 0x0800, CRC(64d9f4d7) SHA1(3ff7fc099023512c33ec4583e91e6cbab903e7a8) ) /* labeled u-168 */
@ -395,22 +401,17 @@ ROM_START( noahsark )
ROM_LOAD( "u7.bin", 0x5000, 0x1000, CRC(64b0afae) SHA1(1fcc17490d1290565be38a817f783604bcefb8be) )
ROM_LOAD( "u8.bin", 0x6000, 0x1000, CRC(02d53f62) SHA1(e51a583a548b4bdaf43d376d5d276325ee448d49) )
ROM_LOAD( "u9.bin", 0x7000, 0x1000, CRC(d425b61c) SHA1(a8d9562435cc910916df4cd7e958468d88ff92e7) )
ROM_RELOAD( 0xf000, 0x1000 ) /* for the vectors */
ROM_REGION( 0x1800, "gfx1", ROMREGION_INVERT )
ROM_REGION( 0x0800, "gfx1", ROMREGION_INVERT )
ROM_LOAD( "u67.bin", 0x0000, 0x0800, CRC(1a77605b) SHA1(8c25750f94895f5820ad4f1fa4ae1ea70ee0aee2) )
ROM_FILL( 0x0800, 0x0800, 0xff )
ROM_FILL( 0x1000, 0x0800, 0xff )
ROM_REGION( 0x3000, "gfx2", ROMREGION_INVERT )
ROM_LOAD( "u68.bin", 0x0000, 0x1000, CRC(6a66eac8) SHA1(3a13c2f5ef45cdd8b8b5db07d8c1417a3304723a) )
ROM_LOAD( "u69.bin", 0x1000, 0x1000, CRC(fa2c279c) SHA1(332fcfcfe605c4132114399c32932507b16752e5) )
ROM_LOAD( "u70.bin", 0x2000, 0x1000, CRC(dcabc7c5) SHA1(68abfdedea518e3a5c90f9f72173e8c05e190535) )
ROM_REGION( 0x1800, "gfx3", 0 )
ROM_REGION( 0x0800, "gfx3", 0 )
ROM_LOAD( "u168.bin", 0x0000, 0x0800, CRC(7fc7280f) SHA1(93bf46e421b580edf81177db85cb220073761c57) ) /* labeled u-167 */
ROM_RELOAD( 0x0800, 0x0800 )
ROM_RELOAD( 0x1000, 0x0800 )
ROM_REGION( 0x3000, "gfx4", 0 )
ROM_LOAD( "u170.bin", 0x0000, 0x1000, CRC(ba36641c) SHA1(df206dc4b6f2da7b60bdaa72c8175de928a630a4) ) /* labeled u-168 */
@ -428,22 +429,17 @@ ROM_START( berenstn )
ROM_LOAD( "u7.bin", 0x5000, 0x1000, CRC(1984d787) SHA1(c13959c9be075400e9d1668b5404bc73f6db5fe4) )
ROM_LOAD( "u8.bin", 0x6000, 0x1000, CRC(0c4d53b7) SHA1(45bd847fdb7bbfbe53d750003024ef3454faa6e6) )
ROM_LOAD( "u9.bin", 0x7000, 0x1000, CRC(7e058e57) SHA1(e9506fa4ec693abf0dc4e4cbfd4b93bdbcfc9ba4) )
ROM_RELOAD( 0xf000, 0x1000 ) /* for the vectors */
ROM_REGION( 0x1800, "gfx1", ROMREGION_INVERT )
ROM_REGION( 0x0800, "gfx1", ROMREGION_INVERT )
ROM_LOAD( "u67.bin", 0x0000, 0x0800, CRC(1a77605b) SHA1(8c25750f94895f5820ad4f1fa4ae1ea70ee0aee2) )
ROM_FILL( 0x0800, 0x0800, 0xff )
ROM_FILL( 0x1000, 0x0800, 0xff )
ROM_REGION( 0x3000, "gfx2", ROMREGION_INVERT )
ROM_LOAD( "u68.bin", 0x0000, 0x1000, CRC(21bf375f) SHA1(52bc81a4f289a96edfab034445bcf639b1524ada) )
ROM_LOAD( "u69.bin", 0x1000, 0x1000, CRC(9dc770f6) SHA1(5dc16fac72d68b521dbb415935f5e7f682c26d7f) )
ROM_LOAD( "u70.bin", 0x2000, 0x1000, CRC(a810bd45) SHA1(8be531529174c5d4b4f164bd2397116b9d5350db) )
ROM_REGION( 0x1800, "gfx3", 0 )
ROM_REGION( 0x0800, "gfx3", 0 )
ROM_LOAD( "u167.bin", 0x0000, 0x0800, CRC(7fc7280f) SHA1(93bf46e421b580edf81177db85cb220073761c57) )
ROM_RELOAD( 0x0800, 0x0800 )
ROM_RELOAD( 0x1000, 0x0800 )
ROM_REGION( 0x3000, "gfx4", 0 )
ROM_LOAD( "u168.bin", 0x0000, 0x0800, CRC(af532ba3) SHA1(b196e294eaf4c25549278fd040b1dad2799e18d5) )
@ -457,4 +453,4 @@ ROM_END
GAME( 1982, tugboat, 0, tugboat, tugboat, driver_device, 0, ROT90, "Enter-Tech, Ltd.", "Tugboat", GAME_IMPERFECT_GRAPHICS )
GAME( 1983, noahsark, 0, tugboat, noahsark, driver_device, 0, ROT90, "Enter-Tech, Ltd.", "Noah's Ark", GAME_IMPERFECT_GRAPHICS )
GAME( 1984, berenstn, 0, tugboat, noahsark, driver_device, 0, ROT90, "Enter-Tech, Ltd.", "The Berenstain Bears in Big Paw's Cave", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS )
GAME( 1984, berenstn, 0, tugboat, noahsark, driver_device, 0, ROT90, "Enter-Tech, Ltd.", "The Berenstain Bears in Big Paw's Cave", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS )