trunk/src/mame/drivers/gunpey.c
| r21502 | r21503 | |
| 216 | 216 | DECLARE_DRIVER_INIT(gunpey); |
| 217 | 217 | virtual void video_start(); |
| 218 | 218 | virtual void palette_init(); |
| 219 | | UINT32 screen_update_gunpey(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 219 | UINT32 screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 220 | 220 | TIMER_DEVICE_CALLBACK_MEMBER(gunpey_scanline); |
| 221 | 221 | void gunpey_irq_check(UINT8 irq_type); |
| 222 | 222 | UINT16 m_vram_bank; |
| 223 | 223 | |
| 224 | | UINT16 main_vram[0x800][0x800]; |
| 224 | //UINT16 main_vram[0x800][0x800]; |
| 225 | 225 | }; |
| 226 | 226 | |
| 227 | 227 | |
| r21502 | r21503 | |
| 230 | 230 | m_blit_buffer = auto_alloc_array(machine(), UINT16, 512*512); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | | UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 233 | UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 234 | 234 | { |
| 235 | 235 | //UINT16 *blit_buffer = m_blit_buffer; |
| 236 | 236 | int x,y; |
| 237 | 237 | int count; |
| 238 | 238 | UINT16 vram_bank = m_vram_bank & 0x7fff; |
| 239 | UINT8 *vram = memregion("vram")->base(); |
| 239 | 240 | |
| 240 | 241 | bitmap.fill(machine().pens[0], cliprect); //black pen |
| 241 | 242 | |
| r21502 | r21503 | |
| 251 | 252 | x-=0x100; |
| 252 | 253 | y-=0x100; |
| 253 | 254 | |
| 254 | | UINT32 col = 0xffffff; |
| 255 | //UINT32 col = 0xffffff; |
| 255 | 256 | |
| 256 | 257 | UINT32 val = (m_wram[count+1] << 16) | ((m_wram[count+2])); |
| 258 | |
| 259 | #ifdef USE_FAKE_ROM |
| 257 | 260 | int letter = -1; |
| 261 | |
| 258 | 262 | /* |
| 259 | 263 | -- TEST MODE -- |
| 260 | 264 | I/O TEST |
| r21502 | r21503 | |
| 305 | 309 | if (val == 0x8080e03a) { letter = 'Y'; } |
| 306 | 310 | if (val == 0xa080e03a) { letter = 'Z'; } |
| 307 | 311 | |
| 308 | | #ifndef USE_FAKE_ROM |
| 309 | | letter = -1; |
| 310 | 312 | #endif |
| 313 | int xsource = ((val & 0x000000ff) << 4) | ((val & 0xf0000000) >> 28); |
| 314 | int ysource = ((val & 0x0000f000) >> 10); |
| 311 | 315 | |
| 316 | |
| 317 | |
| 318 | #ifdef USE_FAKE_ROM |
| 312 | 319 | if (letter != -1) |
| 313 | 320 | drawgfx_opaque(bitmap,cliprect,machine().gfx[1],letter,1,0,0,x,y); |
| 314 | 321 | else |
| 322 | #endif |
| 315 | 323 | { |
| 316 | 324 | for(int yi=0;yi<8;yi++) |
| 317 | 325 | { |
| 318 | | for(int xi=0;xi<8;xi++) |
| 326 | for(int xi=0;xi<4;xi++) |
| 319 | 327 | { |
| 320 | | if(cliprect.contains(x+xi, y+yi)) |
| 321 | | bitmap.pix32(y+yi, x+xi) = col; |
| 328 | UINT8 data = vram[((((ysource+yi)&0x7ff)*0x400) + ((xsource+xi)&0x3ff))]; |
| 329 | |
| 330 | UINT8 pix; |
| 331 | |
| 332 | pix = (data & 0x0f); |
| 333 | |
| 334 | if(cliprect.contains(x+(xi*2), y+yi)) |
| 335 | bitmap.pix16(y+yi, x+(xi*2)) = pix; |
| 336 | |
| 337 | pix = (data & 0xf0)>>4; |
| 338 | |
| 339 | if(cliprect.contains(x+1+(xi*2), y+yi)) |
| 340 | bitmap.pix16(y+yi, x+1+(xi*2)) = pix; |
| 341 | |
| 342 | |
| 322 | 343 | } |
| 323 | 344 | } |
| 324 | 345 | } |
| r21502 | r21503 | |
| 443 | 464 | { |
| 444 | 465 | for (int x=0;x<xsize;x++) |
| 445 | 466 | { |
| 446 | | vram[(((dsty+y)&0x7ff)*0x800)+((dstx+x)&0x7ff)] = blit_rom[(((srcy+y)&0x7ff)*0x800)+((srcx+x)&0x7ff)]; |
| 467 | vram[(((dsty+y)&0x7ff)*0x400)+((dstx+x)&0x3ff)] = blit_rom[(((srcy+y)&0x7ff)*0x800)+((srcx+x)&0x7ff)]; |
| 447 | 468 | } |
| 448 | 469 | } |
| 449 | 470 | |
| r21502 | r21503 | |
| 654 | 675 | // 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 |
| 655 | 676 | // palette data is in here too, the blocks at the bottom right of all this? |
| 656 | 677 | static GFXLAYOUT_RAW( gunpey, 2048, 1, 2048*8, 2048*8 ) |
| 678 | static GFXLAYOUT_RAW( gunpey1024, 1024, 1, 1024*8, 1024*8 ) |
| 679 | |
| 657 | 680 | static GFXDECODE_START( gunpey ) |
| 658 | 681 | GFXDECODE_ENTRY( "blit_data", 0, gunpey, 0x0000, 0x1 ) |
| 659 | 682 | GFXDECODE_ENTRY( "fakerom", 0x18000, fake_layout, 0x0, 2 ) |
| 660 | | GFXDECODE_ENTRY( "vram", 0, gunpey, 0x0000, 0x1 ) |
| 683 | GFXDECODE_ENTRY( "vram", 0, gunpey1024, 0x0000, 0x1 ) |
| 661 | 684 | |
| 662 | 685 | GFXDECODE_END |
| 663 | 686 | |
| r21502 | r21503 | |
| 706 | 729 | |
| 707 | 730 | ROM_REGION( 0x400000, "blit_data", 0 ) |
| 708 | 731 | ROM_LOAD( "gp_rom3.025", 0x00000, 0x400000, CRC(f2d1f9f0) SHA1(0d20301fd33892074508b9d127456eae80cc3a1c) ) |
| 709 | | ROM_REGION( 0x400000, "vram", ROMREGION_ERASEFF ) |
| 732 | ROM_REGION( 0x200000, "vram", ROMREGION_ERASEFF ) |
| 710 | 733 | |
| 711 | 734 | ROM_REGION( 0x400000, "ymz", 0 ) |
| 712 | 735 | ROM_LOAD( "gp_rom4.525", 0x000000, 0x400000, CRC(78dd1521) SHA1(91d2046c60e3db348f29f776def02e3ef889f2c1) ) // 11xxxxxxxxxxxxxxxxxxxx = 0xFF |