trunk/src/mame/drivers/gunpey.c
| r21491 | r21492 | |
| 1 | |
| 2 | //#define USE_FAKE_ROM |
| 3 | |
| 1 | 4 | /******************************************************************************************** |
| 2 | 5 | |
| 3 | 6 | Gunpey (c) 2000 Banpresto |
| r21491 | r21492 | |
| 235 | 238 | { |
| 236 | 239 | if(!(m_wram[count+0/2] & 1)) |
| 237 | 240 | { |
| 238 | | x = (m_wram[count+6/2] >> 8) | ((m_wram[count+8/2] & 0xff) << 8); |
| 239 | | y = m_wram[count+8/2] >> 8; |
| 241 | x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0xff) << 8); |
| 242 | y = m_wram[count+4] >> 8; |
| 240 | 243 | |
| 244 | UINT32 col = 0xffffff; |
| 245 | |
| 246 | UINT32 val = (m_wram[count+1] << 16) | ((m_wram[count+2])); |
| 247 | int letter = -1; |
| 248 | |
| 249 | // these are going to be co-ordinates in the bitmap, probably not the ROM, but the one the 'blitter' (gfx unpack device?) creates |
| 250 | if (val == 0x8080a03a) { col = 0xffff00; letter ='I'; } // 18d0 - I |
| 251 | if (val == 0x4080a03b) { col = 0xff0000; letter ='O'; } // - O |
| 252 | |
| 253 | #ifndef USE_FAKE_ROM |
| 254 | letter = -1; |
| 255 | #endif |
| 241 | 256 | x-=0x1100; |
| 242 | 257 | |
| 243 | | for(int yi=0;yi<8;yi++) |
| 258 | if (letter != -1) |
| 259 | drawgfx_opaque(bitmap,cliprect,machine().gfx[1],letter,0,0,0,x,y); |
| 260 | else |
| 244 | 261 | { |
| 245 | | for(int xi=0;xi<8;xi++) |
| 262 | for(int yi=0;yi<8;yi++) |
| 246 | 263 | { |
| 247 | | if(cliprect.contains(x+xi, y+yi)) |
| 248 | | bitmap.pix32(y+yi, x+xi) = 0xffffff; |
| 264 | for(int xi=0;xi<8;xi++) |
| 265 | { |
| 266 | if(cliprect.contains(x+xi, y+yi)) |
| 267 | bitmap.pix32(y+yi, x+xi) = col; |
| 268 | } |
| 249 | 269 | } |
| 250 | 270 | } |
| 251 | 271 | } |
| r21491 | r21492 | |
| 405 | 425 | AM_RANGE(0x7f48, 0x7f49) AM_WRITE8(gunpey_output_w,0x00ff) |
| 406 | 426 | AM_RANGE(0x7f80, 0x7f81) AM_DEVREADWRITE8_LEGACY("ymz", ymz280b_r, ymz280b_w, 0xffff) |
| 407 | 427 | |
| 408 | | AM_RANGE(0x7f88, 0x7f89) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00) |
| 428 | AM_RANGE(0x7f88, 0x7f89) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 409 | 429 | |
| 410 | 430 | AM_RANGE(0x7fc8, 0x7fc9) AM_READWRITE8(gunpey_status_r, gunpey_status_w, 0xffff ) |
| 411 | 431 | AM_RANGE(0x7fd0, 0x7fdf) AM_WRITE8(gunpey_blitter_w, 0xffff ) |
| r21491 | r21492 | |
| 555 | 575 | } |
| 556 | 576 | |
| 557 | 577 | |
| 578 | static const gfx_layout fake_layout = |
| 579 | { |
| 580 | 8,8, |
| 581 | RGN_FRAC(1,4), |
| 582 | 4, |
| 583 | { 0,1,2,3 }, |
| 584 | { 0*4,1*4,2*4,3*4,4*4,5*4,6*4,7*4 }, |
| 585 | { 0*32,1*32,2*32,3*32,4*32,5*32,6*32,7*32}, |
| 586 | 8*32 |
| 587 | }; |
| 588 | |
| 589 | |
| 590 | |
| 558 | 591 | // this isn't a real decode as such, but the graphic data is all stored in pages 2048 bytes wide at varying BPP levelsl, some (BG data) compressed with what is likely a lossy scheme |
| 559 | 592 | // palette data is in here too, the blocks at the bottom right of all this? |
| 560 | 593 | static GFXLAYOUT_RAW( gunpey, 2048, 1, 2048*8, 2048*8 ) |
| 561 | 594 | static GFXDECODE_START( gunpey ) |
| 562 | 595 | GFXDECODE_ENTRY( "blit_data", 0, gunpey, 0x0000, 0x1 ) |
| 596 | GFXDECODE_ENTRY( "fakerom", 0x18000, fake_layout, 0x0, 2 ) |
| 597 | |
| 563 | 598 | GFXDECODE_END |
| 564 | 599 | |
| 565 | 600 | |
| r21491 | r21492 | |
| 613 | 648 | |
| 614 | 649 | ROM_REGION( 0x400000, "oki", 0 ) |
| 615 | 650 | ROM_LOAD( "gp_rom5.622", 0x000000, 0x400000, CRC(f79903e0) SHA1(4fd50b4138e64a48ec1504eb8cd172a229e0e965)) // 1xxxxxxxxxxxxxxxxxxxxx = 0xFF |
| 651 | |
| 652 | ROM_REGION( 0x20000, "fakerom", ROMREGION_ERASEFF ) |
| 653 | #ifdef USE_FAKE_ROM |
| 654 | ROM_LOAD( "video", 0x00000, 0x20000, CRC(8857ec5a) SHA1(5bed14933af060cb4a1ce6a961c4ca1467a1cbc2) ) |
| 655 | #endif |
| 616 | 656 | ROM_END |
| 617 | 657 | |
| 658 | |
| 659 | |
| 618 | 660 | DRIVER_INIT_MEMBER(gunpey_state,gunpey) |
| 619 | 661 | { |
| 620 | 662 | // UINT8 *rom = memregion("maincpu")->base(); |