Previous 199869 Revisions Next

r22900 Saturday 18th May, 2013 at 15:48:08 UTC by David Haywood
stuntair - not quite right colour prom decoding
[src/mame/drivers]stuntair.c

trunk/src/mame/drivers/stuntair.c
r22899r22900
371371
372372
373373static GFXDECODE_START( stuntair )
374   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 )
375   GFXDECODE_ENTRY( "gfx2", 0, tiles8x8x2_layout, 0, 16 )
376   GFXDECODE_ENTRY( "gfx3", 0, tiles16x8x2_layout, 0, 16 )
374   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0x100, 1 )
375   GFXDECODE_ENTRY( "gfx2", 0, tiles8x8x2_layout, 0xe0, 8 )
376   GFXDECODE_ENTRY( "gfx3", 0, tiles16x8x2_layout, 0xe0, 8 )
377377GFXDECODE_END
378378
379379
r22899r22900
392392   int tileno = m_fgram[tile_index];
393393   int opaque = tileno & 0x80;
394394
395   // where does the FG palette come from? it's a 1bpp layer..
395396   
396397   SET_TILE_INFO_MEMBER(0, tileno&0x7f, 0, opaque?TILE_FORCE_LAYER0 : TILE_FORCE_LAYER1);
397398}
r22899r22900
419420{
420421   int tileno = m_bgram[tile_index];
421422   tileno |= (m_bgattrram[tile_index] & 0x08)<<5;
423   int colour = (m_bgattrram[tile_index] & 0x07);
422424
423   SET_TILE_INFO_MEMBER(1, tileno, 0, 0);
425   SET_TILE_INFO_MEMBER(1, tileno, colour, 0);
424426}
425427
426428
r22899r22900
453455   /* there seem to be 2 spritelists with something else (fixed values) between them.. is that significant? */
454456   for (int i=0;i<0x400/16;i++)
455457   {
456      int x = m_sprram[(i*16)+5];
457      int y = 240-m_sprram[(i*16)+0];
458      int x      = m_sprram[(i*16)+5];
459      int y      = m_sprram[(i*16)+0];
460      int colour = m_sprram[(i*16)+4] & 0x7;
461      int tile   = m_sprram[(i*16)+1] & 0x3f;
462      int flipy = (m_sprram[(i*16)+1] & 0x80)>>7; // used
463//       int flipx = (m_sprram[(i*16)+1] & 0x40)>>6; // guessed , wrong
464      int flipx = 0;
458465   
459      int tile;
460
461      tile = m_sprram[(i*16)+1] & 0x3f;
462
463466      if (m_spritebank1) tile |= 0x40;
464      if (m_spritebank0) tile |= 0x80;
467      if (m_spritebank0) tile |= 0x80;     
465468
466      int flipy = (m_sprram[(i*16)+1] & 0x80)>>7; // used
467   //   int flipx = (m_sprram[(i*16)+1] & 0x40)>>6; // guessed , wrong
468      int flipx = 0;
469      y = 240 - y;
469470
470      drawgfx_transpen(bitmap,cliprect,gfx,tile,0,flipx,flipy,x,y,0);
471      drawgfx_transpen(bitmap,cliprect,gfx,tile,colour,flipx,flipy,x,y,0);
471472   }
472473
473474   m_fg_tilemap->draw(bitmap, cliprect, 0, TILEMAP_PIXEL_LAYER1|TILEMAP_DRAW_OPAQUE);
r22899r22900
507508   DEVCB_NULL
508509};
509510
511PALETTE_INIT( stuntair )
512{
513   /* need resistor weights etc. */
514   const UINT8 *color_prom = machine.root_device().memregion("proms")->base()+0x100;
515   const UINT8 *color_prom2 = machine.root_device().memregion("proms")->base();
510516
517   int i;
518
519   for (i = 0; i < 0x100; i++)
520   {
521      UINT8 data = color_prom[i] | (color_prom2[i]<<4);
522
523
524      int b = (data&0xc0)>>6;
525      int g = (data&0x38)>>2;
526      int r = (data&0x07)>>0;
527
528
529      palette_set_color(machine,i,MAKE_RGB(r<<5,g<<5,b<<6));
530   }
531
532   // just set the FG layer to black and white
533   palette_set_color(machine,0x100,MAKE_RGB(0x00,0x00,0x00));
534   palette_set_color(machine,0x101,MAKE_RGB(0xff,0xff,0xff));
535
536}
537
538
511539static MACHINE_CONFIG_START( stuntair, stuntair_state )
512540
513541   /* basic machine hardware */
r22899r22900
529557   MCFG_SCREEN_UPDATE_DRIVER(stuntair_state, screen_update_stuntair)
530558
531559   MCFG_GFXDECODE(stuntair)
532   MCFG_PALETTE_LENGTH(0x100)
560   MCFG_PALETTE_LENGTH(0x100+2)
533561
562   MCFG_PALETTE_INIT(stuntair)
534563
535564   /* sound hardware */
536565   MCFG_SPEAKER_STANDARD_MONO("mono") // stereo?
r22899r22900
568597   ROM_LOAD( "stuntair.a13", 0x0000, 0x2000, CRC(bfdc0d38) SHA1(ea0a22971e9cf1b1682c35facc9c4e30607faed7) )
569598   ROM_LOAD( "stuntair.a15", 0x2000, 0x2000, CRC(4531cab5) SHA1(35271555377ec3454a5d74bf8c21d7e8acc05782) )
570599
571   ROM_REGION( 0x04000, "proms", 0 )
600   ROM_REGION( 0x200, "proms", 0 ) // only the last few entries are used?
572601   ROM_LOAD( "dm74s287n.11l", 0x000, 0x100, CRC(6c98f964) SHA1(abf7bdeccd33e62fa106d2056d1949cf278483a7) )
573   ROM_LOAD( "dm74s287n.11m", 0x000, 0x100, CRC(d330ff90) SHA1(e223935464109a3c4c7b29641b3736484c22c47a) )
602   ROM_LOAD( "dm74s287n.11m", 0x100, 0x100, CRC(d330ff90) SHA1(e223935464109a3c4c7b29641b3736484c22c47a) )
603
604   ROM_REGION( 0x020, "miscprom", 0 )
574605   ROM_LOAD( "dm74s288n.7a",  0x000, 0x020, CRC(5779e751) SHA1(89c955ef8635ad3e9d699f33ec0e4d6c9205d01c) )
575606ROM_END
576607

Previous 199869 Revisions Next


© 1997-2024 The MAME Team