trunk/src/mame/drivers/gunpey.c
| r21507 | r21508 | |
| 236 | 236 | //UINT16 *blit_buffer = m_blit_buffer; |
| 237 | 237 | int x,y; |
| 238 | 238 | int count; |
| 239 | int bpp_sel; |
| 240 | int height; |
| 241 | int width; |
| 239 | 242 | UINT16 vram_bank = m_vram_bank & 0x7fff; |
| 240 | 243 | UINT8 *vram = memregion("vram")->base(); |
| 241 | 244 | |
| r21507 | r21508 | |
| 243 | 246 | |
| 244 | 247 | vram_bank ^= 0x2000; |
| 245 | 248 | |
| 246 | | for(count = vram_bank/2;count<(vram_bank+0x2000)/2;count+=0x10/2) |
| 249 | /* last 4 entries are special, skip them for now. */ |
| 250 | for(count = vram_bank/2;count<(vram_bank+0x2000-0x40)/2;count+=0x10/2) |
| 247 | 251 | { |
| 248 | 252 | if(!(m_wram[count+0] & 1)) |
| 249 | 253 | { |
| 250 | 254 | x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0x03) << 8); |
| 251 | 255 | y = (m_wram[count+4] >> 8) | ((m_wram[count+4] & 0x30) << 4); |
| 256 | width = (m_wram[count+5] >> 8); |
| 257 | height = (m_wram[count+5] & 0xff); |
| 258 | bpp_sel = (m_wram[count+0] & 0x18); |
| 252 | 259 | |
| 253 | 260 | x-=0x160; |
| 254 | 261 | y-=0x188; |
| r21507 | r21508 | |
| 321 | 328 | drawgfx_opaque(bitmap,cliprect,machine().gfx[1],letter,1,0,0,x,y); |
| 322 | 329 | else |
| 323 | 330 | #endif |
| 331 | if(bpp_sel == 0x00) |
| 324 | 332 | { |
| 325 | | for(int yi=0;yi<8;yi++) |
| 333 | for(int yi=0;yi<height;yi++) |
| 326 | 334 | { |
| 327 | | for(int xi=0;xi<4;xi++) |
| 335 | for(int xi=0;xi<width/2;xi++) |
| 328 | 336 | { |
| 329 | 337 | UINT8 data = vram[((((ysource+yi)&0x7ff)*0x400) + ((xsource+xi)&0x3ff))]; |
| 330 | 338 | |
| r21507 | r21508 | |
| 339 | 347 | |
| 340 | 348 | if(cliprect.contains(x+1+(xi*2), y+yi)) |
| 341 | 349 | bitmap.pix16(y+yi, x+1+(xi*2)) = pix; |
| 342 | | |
| 343 | | |
| 344 | 350 | } |
| 345 | 351 | } |
| 346 | 352 | } |
| 353 | |
| 347 | 354 | } |
| 348 | 355 | } |
| 349 | 356 | |
| r21507 | r21508 | |
| 446 | 453 | int ysize = blit_ram[0x0e]+1; |
| 447 | 454 | // int color,color_offs; |
| 448 | 455 | |
| 456 | printf("%04x %04x %04x %04x\n",srcx,srcy,dstx,dsty); |
| 457 | |
| 449 | 458 | /* |
| 450 | 459 | printf("%02x %02x %02x %02x| (X SRC 4: %02x 5: %02x (val %04x)) (Y SRC 6: %02x 7: %02x (val %04x)) | (X DEST 8: %02x 9: %02x (val %04x)) (Y DEST a: %02x b: %02x (val %04x)) | %02x %02x %02x %02x\n" |
| 451 | 460 | ,blit_ram[0],blit_ram[1],blit_ram[2],blit_ram[3] |
| r21507 | r21508 | |
| 468 | 477 | { |
| 469 | 478 | for (int x=0;x<xsize;x++) |
| 470 | 479 | { |
| 471 | | vram[(((dsty+y)&0x7ff)*0x400)+((dstx+x)&0x3ff)] = blit_rom[(((srcy+y)&0x7ff)*0x800)+((srcx+x)&0x7ff)]; |
| 480 | vram[(((dsty+y)&0x3ff)*0x400)+((dstx+x)&0x3ff)] = blit_rom[(((srcy+y)&0x7ff)*0x800)+((srcx+x)&0x7ff)]; |
| 472 | 481 | } |
| 473 | 482 | } |
| 474 | 483 | |