Previous 199869 Revisions Next

r26301 Wednesday 20th November, 2013 at 05:47:19 UTC by David Haywood
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
[src/mame/drivers]1942.c
[src/mame/includes]1942.h
[src/mame/video]1942.c

trunk/src/mame/includes/1942.h
r26300r26301
1212      m_spriteram(*this, "spriteram"),
1313      m_fg_videoram(*this, "fg_videoram"),
1414      m_bg_videoram(*this, "bg_videoram"),
15      m_protopal(*this, "protopal"),
1516      m_audiocpu(*this, "audiocpu"),
1617      m_maincpu(*this, "maincpu") { }
1718
r26300r26301
1920   required_shared_ptr<UINT8> m_spriteram;
2021   required_shared_ptr<UINT8> m_fg_videoram;
2122   required_shared_ptr<UINT8> m_bg_videoram;
23   optional_shared_ptr<UINT8> m_protopal;
2224
2325   /* video-related */
2426   tilemap_t *m_fg_tilemap;
2527   tilemap_t *m_bg_tilemap;
2628   int m_palette_bank;
2729   UINT8 m_scroll[2];
30   rgb_t palette[256];
31   void create_palette();
32   void palette_init_1942p();
33   DECLARE_WRITE8_MEMBER(c1942p_palette_w);
2834
2935   /* devices */
3036   required_device<cpu_device> m_audiocpu;
r26300r26301
3440   DECLARE_WRITE8_MEMBER(c1942_palette_bank_w);
3541   DECLARE_WRITE8_MEMBER(c1942_scroll_w);
3642   DECLARE_WRITE8_MEMBER(c1942_c804_w);
43   DECLARE_WRITE8_MEMBER(c1942p_f600_w);
3744   DECLARE_DRIVER_INIT(1942);
3845   TILE_GET_INFO_MEMBER(get_fg_tile_info);
3946   TILE_GET_INFO_MEMBER(get_bg_tile_info);
4047   virtual void machine_start();
4148   virtual void machine_reset();
4249   virtual void video_start();
50   void video_start_c1942p();
4351   virtual void palette_init();
4452   UINT32 screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4553   UINT32 screen_update_1942p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
trunk/src/mame/video/1942.c
r26300r26301
2424
2525***************************************************************************/
2626
27void _1942_state::palette_init()
27void _1942_state::create_palette()
2828{
29
30
2931   const UINT8 *color_prom = memregion("proms")->base();
30   rgb_t palette[256];
31   int i, colorbase;
32   int i;
3233
3334   for (i = 0; i < 256; i++)
3435   {
r26300r26301
5556
5657      palette[i] = MAKE_RGB(r,g,b);
5758   }
59}
5860
61void _1942_state::palette_init()
62{
63   machine().colortable = colortable_alloc(machine(), 0x600);
64
65   create_palette();
66   
67   const UINT8 *color_prom = memregion("proms")->base();
68   int i, colorbase;
5969   color_prom += 3 * 256;
6070   /* color_prom now points to the beginning of the lookup table */
6171
r26300r26301
6373   /* characters use palette entries 128-143 */
6474   colorbase = 0;
6575   for (i = 0; i < 64 * 4; i++)
66      palette_set_color(machine(), colorbase + i, palette[0x80 | *color_prom++]);
76   {
77      colortable_palette_set_color(machine().colortable, colorbase + i, palette[0x80 | *color_prom++]);
78   }
6779   colorbase += 64 * 4;
6880
6981   /* background tiles use palette entries 0-63 in four banks */
7082   for (i = 0; i < 32 * 8; i++)
7183   {
72      palette_set_color(machine(), colorbase + 0 * 32 * 8 + i, palette[0x00 | *color_prom]);
73      palette_set_color(machine(), colorbase + 1 * 32 * 8 + i, palette[0x10 | *color_prom]);
74      palette_set_color(machine(), colorbase + 2 * 32 * 8 + i, palette[0x20 | *color_prom]);
75      palette_set_color(machine(), colorbase + 3 * 32 * 8 + i, palette[0x30 | *color_prom]);
84      colortable_palette_set_color(machine().colortable, colorbase + 0 * 32 * 8 + i, palette[0x00 | *color_prom]);
85      colortable_palette_set_color(machine().colortable, colorbase + 1 * 32 * 8 + i, palette[0x10 | *color_prom]);
86      colortable_palette_set_color(machine().colortable, colorbase + 2 * 32 * 8 + i, palette[0x20 | *color_prom]);
87      colortable_palette_set_color(machine().colortable, colorbase + 3 * 32 * 8 + i, palette[0x30 | *color_prom]);
7688      color_prom++;
7789   }
7890   colorbase += 4 * 32 * 8;
7991
8092   /* sprites use palette entries 64-79 */
8193   for (i = 0; i < 16 * 16; i++)
82      palette_set_color(machine(), colorbase + i, palette[0x40 | *color_prom++]);
94      colortable_palette_set_color(machine().colortable, colorbase + i, palette[0x40 | *color_prom++]);
95
96   for (i = 0; i < 0x600; i++)
97   {
98      colortable_entry_set_value(machine().colortable, i, i);
99   }
100     
83101}
84102
103void _1942_state::palette_init_1942p()
104{
105   machine().colortable = colortable_alloc(machine(), 0x500);
106   
107   for (int i = 0; i < 0x400; i++)
108   {
109      colortable_entry_set_value(machine().colortable, i, i);
110   }
85111
112   const UINT8 *color_prom = memregion("proms")->base();
113   for (int i = 0; i < 0x100; i++)
114   {
115      colortable_entry_set_value(machine().colortable, i+0x400, color_prom[i]| 0x240);
116   }
117}
118
119
120
86121/***************************************************************************
87122
88123  Callbacks for the TileMap code
r26300r26301
131166   m_fg_tilemap->set_transparent_pen(0);
132167}
133168
169void _1942_state::video_start_c1942p()
170{
171   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);
172   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);
134173
174   m_fg_tilemap->set_transparent_pen(3);
175}
176
177
135178/***************************************************************************
136179
137180  Memory handlers
r26300r26301
247290
248291      code = (m_spriteram[offs] & 0x7f) + 4 * (m_spriteram[offs + 3] & 0x20)
249292            + 2 * (m_spriteram[offs] & 0x80);
250      col = m_spriteram[offs + 1] & 0x0f;
293      col = m_spriteram[offs + 3] & 0x0f;
251294     
252295     
253      sx = m_spriteram[offs + 2];
296      sx = m_spriteram[offs + 2] - 0x10 * (m_spriteram[offs + 3] & 0x10);
254297      sy = m_spriteram[offs + 1];
255      dir = 1;
256298
299
300
257301      if (flip_screen())
258302      {
259303         sx = 240 - sx;
260         sy = 240 - sy;
261304         dir = -1;
262305      }
306      else
307      {
308         sy = 240 - sy;
309         dir = 1;
310      }
263311
264312      /* handle double / quadruple height */
265      i = (m_spriteram[offs + 1] & 0xc0) >> 6;
313      i = (m_spriteram[offs + 3] & 0xc0) >> 6;
266314      if (i == 2)
267315         i = 3;
268316
317      i = 0;
318
269319      do
270320      {
271321         drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
trunk/src/mame/drivers/1942.c
r26300r26301
105105   AM_RANGE(0xe000, 0xefff) AM_RAM
106106ADDRESS_MAP_END
107107
108WRITE8_MEMBER(_1942_state::c1942p_f600_w)
109{
110//   printf("c1942p_f600_w %02x\n", data);
111}
112
113WRITE8_MEMBER(_1942_state::c1942p_palette_w)
114{
115   m_protopal[offset] = data;
116
117   int r = (data & 0x07) >> 0;
118   int g = (data & 0x38) >> 3;
119   int b = (data & 0xc0) >> 6;
120
121   colortable_palette_set_color(machine().colortable, offset, MAKE_RGB(r<<5,g<<5,b<<6));
122}
123
108124static ADDRESS_MAP_START( c1942p_map, AS_PROGRAM, 8, _1942_state )
109125   AM_RANGE(0x0000, 0x7fff) AM_ROM
110126   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
r26300r26301
120136   AM_RANGE(0xc804, 0xc804) AM_WRITE(c1942_c804_w)
121137   AM_RANGE(0xc805, 0xc805) AM_WRITE(c1942_palette_bank_w)
122138
123   AM_RANGE(0xf000, 0xf3ff) AM_RAM
139   AM_RANGE(0xf000, 0xf3ff) AM_RAM AM_WRITE(c1942p_palette_w)  AM_SHARE("protopal")
124140
125141   AM_RANGE(0xf400, 0xf400) AM_WRITE(c1942_bankswitch_w)
126142   AM_RANGE(0xf500, 0xf500) AM_WRITE(soundlatch_byte_w)
143   AM_RANGE(0xf600, 0xf600) AM_WRITE(c1942p_f600_w)
127144
128145   AM_RANGE(0xf700, 0xf700) AM_READ_PORT("DSWA")
129146   AM_RANGE(0xf701, 0xf701) AM_READ_PORT("SYSTEM")
r26300r26301
241258
242259
243260   PORT_START("P1")
244   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
245   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
261   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
262   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
246263   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
247264   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
248265   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
r26300r26301
369386   GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 64*4+4*32*8, 16 )
370387GFXDECODE_END
371388
389
390static const gfx_layout charlayout_p =
391{
392   8,8,
393   RGN_FRAC(1,1),
394   2,
395   { 0, 4 },
396   { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
397   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
398   16*8
399};
400
372401static const gfx_layout tilelayout_p =
373402{
374403   16,16,
375404   RGN_FRAC(1,12),
376405   3,
377   { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
406   { RGN_FRAC(1,3), RGN_FRAC(2,3), RGN_FRAC(0,3) },
378407   { 0, 1, 2, 3, 4, 5, 6, 7,
379408         0x2000*8, 0x2000*8 +1, 0x2000*8 +2, 0x2000*8 +3, 0x2000*8 +4, 0x2000*8 +5, 0x2000*8 + 6, 0x2000*8 +7 },
380409   { 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     },
r26300r26301
395424};
396425
397426static GFXDECODE_START( 1942p )
398   GFXDECODE_ENTRY( "gfx1", 0, charlayout,             0, 64 )
399   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_p,          64*4, 4*32 )
400   GFXDECODE_ENTRY( "gfx3", 0, spritelayout_p, 64*4+4*32*8, 16 )
427   GFXDECODE_ENTRY( "gfx1", 0, charlayout_p,             0x000, 64 )
428   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_p,          0x300, 32 )
429   GFXDECODE_ENTRY( "gfx3", 0, spritelayout_p, 0x400, 16 )
401430GFXDECODE_END
402431
403432
r26300r26301
463492
464493   /* video hardware */
465494   MCFG_GFXDECODE(1942p)
466   MCFG_PALETTE_LENGTH(64*4+4*32*8+16*16)
495   MCFG_PALETTE_LENGTH(0x500)
496   MCFG_PALETTE_INIT_OVERRIDE(_1942_state, 1942p)
497   MCFG_VIDEO_START_OVERRIDE(_1942_state,c1942p)
467498
468499   MCFG_SCREEN_ADD("screen", RASTER)
469500   MCFG_SCREEN_REFRESH_RATE(60)
r26300r26301
701732   ROM_LOAD( "(__1942p)3.bin", 0x14000, 0x4000, CRC(108fda63) SHA1(6ffdf57a04bcfae9fdb2343f30cff50926188cbf) )//
702733
703734   ROM_REGION( 0x10000, "audiocpu", 0 )
704   ROM_LOAD( "(__1942p)snd.bin", 0x0000, 0x4000, CRC(43d6df9f) SHA1(c34579c73faa7e9552a6721ef8050b33ca158588) )//
735   ROM_LOAD( "(__1942p)snd.bin", 0x0000, 0x4000, BAD_DUMP CRC(43d6df9f) SHA1(c34579c73faa7e9552a6721ef8050b33ca158588) )// looks bad
736   ROM_LOAD( "sr-01.c11", 0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) ) // unlikely to be the same..
705737
706   ROM_REGION( 0x2000, "gfx1", 0 )
738   ROM_REGION( 0x2000, "gfx1", ROMREGION_INVERT )
707739   ROM_LOAD( "(__1942p)8.bin", 0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) )   /* characters */ //
708740
709   ROM_REGION( 0xc000, "gfx2", 0 )
741   ROM_REGION( 0xc000, "gfx2", ROMREGION_INVERT )
710742   ROM_LOAD( "(__1942p)5.bin", 0x0000, 0x4000, CRC(1081b88c) SHA1(f3026e72206c96573fd6ba28d15e865b51735004) )  /* tiles */
711743   ROM_LOAD( "(__1942p)6.bin", 0x4000, 0x4000, CRC(2d6acd8c) SHA1(914bb971c8f1364d0c44bd11f5f7e8da1f4953bb) )
712744   ROM_LOAD( "(__1942p)7.bin", 0x8000, 0x4000, CRC(30f13e78) SHA1(51b9c0dfc53db705b75dd7ce643cec807533af5a) )
r26300r26301
717749   ROM_LOAD( "(__1942p)11.bin", 0x8000, 0x4000, CRC(d2ce3eb6) SHA1(ebe71bd413b169ff2cea6973faf48527a8283eef) )
718750   ROM_LOAD( "(__1942p)12.bin", 0xc000, 0x4000, CRC(aaa86493) SHA1(b0f6c59b5369b565bf863544a26cde2105aa35be) )
719751
720   ROM_REGION( 0x0a00, "proms", 0 ) // only one prom was in the dump
721   ROM_LOAD( "sb-5.e8",  0x0000, 0x0100, BAD_DUMP CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) )    /* red component */
722   ROM_LOAD( "sb-6.e9",  0x0100, 0x0100, BAD_DUMP CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) )    /* green component */
723   ROM_LOAD( "sb-7.e10", 0x0200, 0x0100, BAD_DUMP CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) )    /* blue component */
724   ROM_LOAD( "sb-0.f1",  0x0300, 0x0100, BAD_DUMP CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) )    /* char lookup table */
725   ROM_LOAD( "sb-4.d6",  0x0400, 0x0100, BAD_DUMP CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) )    /* tile lookup table */
726   ROM_LOAD( "(__1942p)ic22.bin",  0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )    /* sprite lookup table */ //
727   ROM_LOAD( "sb-2.d1",  0x0600, 0x0100, BAD_DUMP CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) )    /* tile palette selector? (not used) */
728   ROM_LOAD( "sb-3.d2",  0x0700, 0x0100, BAD_DUMP CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) )    /* tile palette selector? (not used) */
729   ROM_LOAD( "sb-1.k6",  0x0800, 0x0100, BAD_DUMP CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) )    /* interrupt timing (not used) */
730   ROM_LOAD( "sb-9.m11", 0x0900, 0x0100, BAD_DUMP CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) )    /* video timing? (not used) */
752   ROM_REGION( 0x0100, "proms", 0 ) // only one prom was in the dump - uses paletteram instead of proms
753   ROM_LOAD( "(__1942p)ic22.bin",  0x0000, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )    /* sprite lookup table */ //
731754ROM_END
732755
733756
r26300r26301
743766GAME( 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
744767GAME( 1984, 1942b,    1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom", "1942 (First Version)", GAME_SUPPORTS_SAVE )
745768GAME( 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) */
746GAME( 1984, 1942p,    1942, 1942p,1942p,_1942_state, 1942, ROT270, "Capcom", "1942 (prototype?)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // possibly bootleg of prototype
769GAME( 1984, 1942p,    1942, 1942p,1942p,_1942_state, 1942, ROT270, "Capcom", "1942 (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team