improvements to the 1942 prototype

- marked sound rom as bad (looks like it needs a redump)
 - hooked up paletteram fixing bg colours etc. (yes, paletteram.. the release version uses proms)
 - fixed sprites
This commit is contained in:
David Haywood 2013-11-20 05:47:19 +00:00
parent e00343d627
commit c99179d822
3 changed files with 118 additions and 37 deletions

View File

@ -105,6 +105,22 @@ static ADDRESS_MAP_START( c1942_map, AS_PROGRAM, 8, _1942_state )
AM_RANGE(0xe000, 0xefff) AM_RAM
ADDRESS_MAP_END
WRITE8_MEMBER(_1942_state::c1942p_f600_w)
{
// printf("c1942p_f600_w %02x\n", data);
}
WRITE8_MEMBER(_1942_state::c1942p_palette_w)
{
m_protopal[offset] = data;
int r = (data & 0x07) >> 0;
int g = (data & 0x38) >> 3;
int b = (data & 0xc0) >> 6;
colortable_palette_set_color(machine().colortable, offset, MAKE_RGB(r<<5,g<<5,b<<6));
}
static ADDRESS_MAP_START( c1942p_map, AS_PROGRAM, 8, _1942_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
@ -120,10 +136,11 @@ static ADDRESS_MAP_START( c1942p_map, AS_PROGRAM, 8, _1942_state )
AM_RANGE(0xc804, 0xc804) AM_WRITE(c1942_c804_w)
AM_RANGE(0xc805, 0xc805) AM_WRITE(c1942_palette_bank_w)
AM_RANGE(0xf000, 0xf3ff) AM_RAM
AM_RANGE(0xf000, 0xf3ff) AM_RAM AM_WRITE(c1942p_palette_w) AM_SHARE("protopal")
AM_RANGE(0xf400, 0xf400) AM_WRITE(c1942_bankswitch_w)
AM_RANGE(0xf500, 0xf500) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xf600, 0xf600) AM_WRITE(c1942p_f600_w)
AM_RANGE(0xf700, 0xf700) AM_READ_PORT("DSWA")
AM_RANGE(0xf701, 0xf701) AM_READ_PORT("SYSTEM")
@ -241,8 +258,8 @@ static INPUT_PORTS_START( 1942p )
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
@ -369,12 +386,24 @@ static GFXDECODE_START( 1942 )
GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 64*4+4*32*8, 16 )
GFXDECODE_END
static const gfx_layout charlayout_p =
{
8,8,
RGN_FRAC(1,1),
2,
{ 0, 4 },
{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
16*8
};
static const gfx_layout tilelayout_p =
{
16,16,
RGN_FRAC(1,12),
3,
{ RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
{ RGN_FRAC(1,3), RGN_FRAC(2,3), RGN_FRAC(0,3) },
{ 0, 1, 2, 3, 4, 5, 6, 7,
0x2000*8, 0x2000*8 +1, 0x2000*8 +2, 0x2000*8 +3, 0x2000*8 +4, 0x2000*8 +5, 0x2000*8 + 6, 0x2000*8 +7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 0x1000*8 + 0*8, 0x1000*8 + 1*8, 0x1000*8 + 2*8, 0x1000*8 + 3*8, 0x1000*8 + 4*8, 0x1000*8 + 5*8, 0x1000*8 + 6*8, 0x1000*8 + 7*8 },
@ -395,9 +424,9 @@ static const gfx_layout spritelayout_p =
};
static GFXDECODE_START( 1942p )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 64 )
GFXDECODE_ENTRY( "gfx2", 0, tilelayout_p, 64*4, 4*32 )
GFXDECODE_ENTRY( "gfx3", 0, spritelayout_p, 64*4+4*32*8, 16 )
GFXDECODE_ENTRY( "gfx1", 0, charlayout_p, 0x000, 64 )
GFXDECODE_ENTRY( "gfx2", 0, tilelayout_p, 0x300, 32 )
GFXDECODE_ENTRY( "gfx3", 0, spritelayout_p, 0x400, 16 )
GFXDECODE_END
@ -463,7 +492,9 @@ static MACHINE_CONFIG_START( 1942p, _1942_state )
/* video hardware */
MCFG_GFXDECODE(1942p)
MCFG_PALETTE_LENGTH(64*4+4*32*8+16*16)
MCFG_PALETTE_LENGTH(0x500)
MCFG_PALETTE_INIT_OVERRIDE(_1942_state, 1942p)
MCFG_VIDEO_START_OVERRIDE(_1942_state,c1942p)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@ -701,12 +732,13 @@ ROM_START( 1942p )
ROM_LOAD( "(__1942p)3.bin", 0x14000, 0x4000, CRC(108fda63) SHA1(6ffdf57a04bcfae9fdb2343f30cff50926188cbf) )//
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "(__1942p)snd.bin", 0x0000, 0x4000, CRC(43d6df9f) SHA1(c34579c73faa7e9552a6721ef8050b33ca158588) )//
ROM_LOAD( "(__1942p)snd.bin", 0x0000, 0x4000, BAD_DUMP CRC(43d6df9f) SHA1(c34579c73faa7e9552a6721ef8050b33ca158588) )// looks bad
ROM_LOAD( "sr-01.c11", 0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) ) // unlikely to be the same..
ROM_REGION( 0x2000, "gfx1", 0 )
ROM_REGION( 0x2000, "gfx1", ROMREGION_INVERT )
ROM_LOAD( "(__1942p)8.bin", 0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) ) /* characters */ //
ROM_REGION( 0xc000, "gfx2", 0 )
ROM_REGION( 0xc000, "gfx2", ROMREGION_INVERT )
ROM_LOAD( "(__1942p)5.bin", 0x0000, 0x4000, CRC(1081b88c) SHA1(f3026e72206c96573fd6ba28d15e865b51735004) ) /* tiles */
ROM_LOAD( "(__1942p)6.bin", 0x4000, 0x4000, CRC(2d6acd8c) SHA1(914bb971c8f1364d0c44bd11f5f7e8da1f4953bb) )
ROM_LOAD( "(__1942p)7.bin", 0x8000, 0x4000, CRC(30f13e78) SHA1(51b9c0dfc53db705b75dd7ce643cec807533af5a) )
@ -717,17 +749,8 @@ ROM_START( 1942p )
ROM_LOAD( "(__1942p)11.bin", 0x8000, 0x4000, CRC(d2ce3eb6) SHA1(ebe71bd413b169ff2cea6973faf48527a8283eef) )
ROM_LOAD( "(__1942p)12.bin", 0xc000, 0x4000, CRC(aaa86493) SHA1(b0f6c59b5369b565bf863544a26cde2105aa35be) )
ROM_REGION( 0x0a00, "proms", 0 ) // only one prom was in the dump
ROM_LOAD( "sb-5.e8", 0x0000, 0x0100, BAD_DUMP CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) ) /* red component */
ROM_LOAD( "sb-6.e9", 0x0100, 0x0100, BAD_DUMP CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) ) /* green component */
ROM_LOAD( "sb-7.e10", 0x0200, 0x0100, BAD_DUMP CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) ) /* blue component */
ROM_LOAD( "sb-0.f1", 0x0300, 0x0100, BAD_DUMP CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) ) /* char lookup table */
ROM_LOAD( "sb-4.d6", 0x0400, 0x0100, BAD_DUMP CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) ) /* tile lookup table */
ROM_LOAD( "(__1942p)ic22.bin", 0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) ) /* sprite lookup table */ //
ROM_LOAD( "sb-2.d1", 0x0600, 0x0100, BAD_DUMP CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) ) /* tile palette selector? (not used) */
ROM_LOAD( "sb-3.d2", 0x0700, 0x0100, BAD_DUMP CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) ) /* tile palette selector? (not used) */
ROM_LOAD( "sb-1.k6", 0x0800, 0x0100, BAD_DUMP CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) ) /* interrupt timing (not used) */
ROM_LOAD( "sb-9.m11", 0x0900, 0x0100, BAD_DUMP CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) ) /* video timing? (not used) */
ROM_REGION( 0x0100, "proms", 0 ) // only one prom was in the dump - uses paletteram instead of proms
ROM_LOAD( "(__1942p)ic22.bin", 0x0000, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) ) /* sprite lookup table */ //
ROM_END
@ -743,4 +766,4 @@ GAME( 1984, 1942a, 1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom", "19
GAME( 1984, 1942abl, 1942, 1942, 1942, _1942_state, 1942, ROT270, "bootleg", "1942 (Revision A, bootleg)", GAME_SUPPORTS_SAVE ) // data is the same as 1942a set, different rom format
GAME( 1984, 1942b, 1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom", "1942 (First Version)", GAME_SUPPORTS_SAVE )
GAME( 1985, 1942w, 1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom (Williams Electronics license)", "1942 (Williams Electronics license)", GAME_SUPPORTS_SAVE ) /* Based on 1942 (Revision B) */
GAME( 1984, 1942p, 1942, 1942p,1942p,_1942_state, 1942, ROT270, "Capcom", "1942 (prototype?)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // possibly bootleg of prototype
GAME( 1984, 1942p, 1942, 1942p,1942p,_1942_state, 1942, ROT270, "Capcom", "1942 (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )

View File

@ -12,6 +12,7 @@ public:
m_spriteram(*this, "spriteram"),
m_fg_videoram(*this, "fg_videoram"),
m_bg_videoram(*this, "bg_videoram"),
m_protopal(*this, "protopal"),
m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu") { }
@ -19,12 +20,17 @@ public:
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_fg_videoram;
required_shared_ptr<UINT8> m_bg_videoram;
optional_shared_ptr<UINT8> m_protopal;
/* video-related */
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
int m_palette_bank;
UINT8 m_scroll[2];
rgb_t palette[256];
void create_palette();
void palette_init_1942p();
DECLARE_WRITE8_MEMBER(c1942p_palette_w);
/* devices */
required_device<cpu_device> m_audiocpu;
@ -34,12 +40,14 @@ public:
DECLARE_WRITE8_MEMBER(c1942_palette_bank_w);
DECLARE_WRITE8_MEMBER(c1942_scroll_w);
DECLARE_WRITE8_MEMBER(c1942_c804_w);
DECLARE_WRITE8_MEMBER(c1942p_f600_w);
DECLARE_DRIVER_INIT(1942);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
void video_start_c1942p();
virtual void palette_init();
UINT32 screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_1942p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);

View File

@ -24,11 +24,12 @@
***************************************************************************/
void _1942_state::palette_init()
void _1942_state::create_palette()
{
const UINT8 *color_prom = memregion("proms")->base();
rgb_t palette[256];
int i, colorbase;
int i;
for (i = 0; i < 256; i++)
{
@ -55,7 +56,16 @@ void _1942_state::palette_init()
palette[i] = MAKE_RGB(r,g,b);
}
}
void _1942_state::palette_init()
{
machine().colortable = colortable_alloc(machine(), 0x600);
create_palette();
const UINT8 *color_prom = memregion("proms")->base();
int i, colorbase;
color_prom += 3 * 256;
/* color_prom now points to the beginning of the lookup table */
@ -63,25 +73,50 @@ void _1942_state::palette_init()
/* characters use palette entries 128-143 */
colorbase = 0;
for (i = 0; i < 64 * 4; i++)
palette_set_color(machine(), colorbase + i, palette[0x80 | *color_prom++]);
{
colortable_palette_set_color(machine().colortable, colorbase + i, palette[0x80 | *color_prom++]);
}
colorbase += 64 * 4;
/* background tiles use palette entries 0-63 in four banks */
for (i = 0; i < 32 * 8; i++)
{
palette_set_color(machine(), colorbase + 0 * 32 * 8 + i, palette[0x00 | *color_prom]);
palette_set_color(machine(), colorbase + 1 * 32 * 8 + i, palette[0x10 | *color_prom]);
palette_set_color(machine(), colorbase + 2 * 32 * 8 + i, palette[0x20 | *color_prom]);
palette_set_color(machine(), colorbase + 3 * 32 * 8 + i, palette[0x30 | *color_prom]);
colortable_palette_set_color(machine().colortable, colorbase + 0 * 32 * 8 + i, palette[0x00 | *color_prom]);
colortable_palette_set_color(machine().colortable, colorbase + 1 * 32 * 8 + i, palette[0x10 | *color_prom]);
colortable_palette_set_color(machine().colortable, colorbase + 2 * 32 * 8 + i, palette[0x20 | *color_prom]);
colortable_palette_set_color(machine().colortable, colorbase + 3 * 32 * 8 + i, palette[0x30 | *color_prom]);
color_prom++;
}
colorbase += 4 * 32 * 8;
/* sprites use palette entries 64-79 */
for (i = 0; i < 16 * 16; i++)
palette_set_color(machine(), colorbase + i, palette[0x40 | *color_prom++]);
colortable_palette_set_color(machine().colortable, colorbase + i, palette[0x40 | *color_prom++]);
for (i = 0; i < 0x600; i++)
{
colortable_entry_set_value(machine().colortable, i, i);
}
}
void _1942_state::palette_init_1942p()
{
machine().colortable = colortable_alloc(machine(), 0x500);
for (int i = 0; i < 0x400; i++)
{
colortable_entry_set_value(machine().colortable, i, i);
}
const UINT8 *color_prom = memregion("proms")->base();
for (int i = 0; i < 0x100; i++)
{
colortable_entry_set_value(machine().colortable, i+0x400, color_prom[i]| 0x240);
}
}
/***************************************************************************
@ -131,6 +166,14 @@ void _1942_state::video_start()
m_fg_tilemap->set_transparent_pen(0);
}
void _1942_state::video_start_c1942p()
{
m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(_1942_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(_1942_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 16);
m_fg_tilemap->set_transparent_pen(3);
}
/***************************************************************************
@ -247,25 +290,32 @@ void _1942_state::draw_sprites_p( bitmap_ind16 &bitmap, const rectangle &cliprec
code = (m_spriteram[offs] & 0x7f) + 4 * (m_spriteram[offs + 3] & 0x20)
+ 2 * (m_spriteram[offs] & 0x80);
col = m_spriteram[offs + 1] & 0x0f;
col = m_spriteram[offs + 3] & 0x0f;
sx = m_spriteram[offs + 2];
sx = m_spriteram[offs + 2] - 0x10 * (m_spriteram[offs + 3] & 0x10);
sy = m_spriteram[offs + 1];
dir = 1;
if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
dir = -1;
}
else
{
sy = 240 - sy;
dir = 1;
}
/* handle double / quadruple height */
i = (m_spriteram[offs + 1] & 0xc0) >> 6;
i = (m_spriteram[offs + 3] & 0xc0) >> 6;
if (i == 2)
i = 3;
i = 0;
do
{
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],