trunk/src/mame/drivers/stuntair.c
| r22899 | r22900 | |
| 371 | 371 | |
| 372 | 372 | |
| 373 | 373 | static 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 ) |
| 377 | 377 | GFXDECODE_END |
| 378 | 378 | |
| 379 | 379 | |
| r22899 | r22900 | |
| 392 | 392 | int tileno = m_fgram[tile_index]; |
| 393 | 393 | int opaque = tileno & 0x80; |
| 394 | 394 | |
| 395 | // where does the FG palette come from? it's a 1bpp layer.. |
| 395 | 396 | |
| 396 | 397 | SET_TILE_INFO_MEMBER(0, tileno&0x7f, 0, opaque?TILE_FORCE_LAYER0 : TILE_FORCE_LAYER1); |
| 397 | 398 | } |
| r22899 | r22900 | |
| 419 | 420 | { |
| 420 | 421 | int tileno = m_bgram[tile_index]; |
| 421 | 422 | tileno |= (m_bgattrram[tile_index] & 0x08)<<5; |
| 423 | int colour = (m_bgattrram[tile_index] & 0x07); |
| 422 | 424 | |
| 423 | | SET_TILE_INFO_MEMBER(1, tileno, 0, 0); |
| 425 | SET_TILE_INFO_MEMBER(1, tileno, colour, 0); |
| 424 | 426 | } |
| 425 | 427 | |
| 426 | 428 | |
| r22899 | r22900 | |
| 453 | 455 | /* there seem to be 2 spritelists with something else (fixed values) between them.. is that significant? */ |
| 454 | 456 | for (int i=0;i<0x400/16;i++) |
| 455 | 457 | { |
| 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; |
| 458 | 465 | |
| 459 | | int tile; |
| 460 | | |
| 461 | | tile = m_sprram[(i*16)+1] & 0x3f; |
| 462 | | |
| 463 | 466 | if (m_spritebank1) tile |= 0x40; |
| 464 | | if (m_spritebank0) tile |= 0x80; |
| 467 | if (m_spritebank0) tile |= 0x80; |
| 465 | 468 | |
| 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; |
| 469 | 470 | |
| 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); |
| 471 | 472 | } |
| 472 | 473 | |
| 473 | 474 | m_fg_tilemap->draw(bitmap, cliprect, 0, TILEMAP_PIXEL_LAYER1|TILEMAP_DRAW_OPAQUE); |
| r22899 | r22900 | |
| 507 | 508 | DEVCB_NULL |
| 508 | 509 | }; |
| 509 | 510 | |
| 511 | PALETTE_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(); |
| 510 | 516 | |
| 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 | |
| 511 | 539 | static MACHINE_CONFIG_START( stuntair, stuntair_state ) |
| 512 | 540 | |
| 513 | 541 | /* basic machine hardware */ |
| r22899 | r22900 | |
| 529 | 557 | MCFG_SCREEN_UPDATE_DRIVER(stuntair_state, screen_update_stuntair) |
| 530 | 558 | |
| 531 | 559 | MCFG_GFXDECODE(stuntair) |
| 532 | | MCFG_PALETTE_LENGTH(0x100) |
| 560 | MCFG_PALETTE_LENGTH(0x100+2) |
| 533 | 561 | |
| 562 | MCFG_PALETTE_INIT(stuntair) |
| 534 | 563 | |
| 535 | 564 | /* sound hardware */ |
| 536 | 565 | MCFG_SPEAKER_STANDARD_MONO("mono") // stereo? |
| r22899 | r22900 | |
| 568 | 597 | ROM_LOAD( "stuntair.a13", 0x0000, 0x2000, CRC(bfdc0d38) SHA1(ea0a22971e9cf1b1682c35facc9c4e30607faed7) ) |
| 569 | 598 | ROM_LOAD( "stuntair.a15", 0x2000, 0x2000, CRC(4531cab5) SHA1(35271555377ec3454a5d74bf8c21d7e8acc05782) ) |
| 570 | 599 | |
| 571 | | ROM_REGION( 0x04000, "proms", 0 ) |
| 600 | ROM_REGION( 0x200, "proms", 0 ) // only the last few entries are used? |
| 572 | 601 | 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 ) |
| 574 | 605 | ROM_LOAD( "dm74s288n.7a", 0x000, 0x020, CRC(5779e751) SHA1(89c955ef8635ad3e9d699f33ec0e4d6c9205d01c) ) |
| 575 | 606 | ROM_END |
| 576 | 607 | |