src/mess/drivers/mz2500.c
| r8981 | r8982 | |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | static void draw_cg4_screen(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri) |
| 318 | { |
| 319 | static UINT32 count; |
| 320 | UINT8 *vram = memory_region(machine, "maincpu"); |
| 321 | UINT8 pen,pen_bit[2]; |
| 322 | int x,y,xi,pen_i; |
| 323 | int res_x,res_y; |
| 324 | |
| 325 | count = 0x40000; |
| 326 | |
| 327 | for(y=0;y<400;y++) |
| 328 | { |
| 329 | for(x=0;x<640;x+=8) |
| 330 | { |
| 331 | for(xi=0;xi<8;xi++) |
| 332 | { |
| 333 | res_x = x+xi; |
| 334 | res_y = y; |
| 335 | |
| 336 | /* check window boundaries */ |
| 337 | //if(res_x < cg_hs || res_x >= cg_he || res_y < cg_vs || res_y >= cg_ve) |
| 338 | // continue; |
| 339 | |
| 340 | /* TODO: very preliminary, just Yukar K2 uses this so far*/ |
| 341 | pen_bit[0] = (vram[count + 0x00000]>>(xi)) & 1 ? 7 : 0; // B |
| 342 | pen_bit[1] = (vram[count + 0x0c000]>>(xi)) & 1 ? 7 : 0; // R |
| 343 | |
| 344 | pen = 0; |
| 345 | for(pen_i=0;pen_i<2;pen_i++) |
| 346 | pen |= pen_bit[pen_i]; |
| 347 | |
| 348 | { |
| 349 | //if(pri == ((clut256[pen] & 0x100) >> 8)) |
| 350 | *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[pen]; |
| 351 | } |
| 352 | } |
| 353 | count++; |
| 354 | } |
| 355 | } |
| 356 | } |
| 357 | |
| 317 | 358 | static void draw_cg16_screen(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int plane,int x_size,int pri) |
| 318 | 359 | { |
| 319 | 360 | static UINT32 count; |
| r8981 | r8982 | |
| 443 | 484 | { |
| 444 | 485 | case 0x00: |
| 445 | 486 | break; |
| 487 | case 0x03: |
| 488 | draw_cg4_screen(machine,bitmap,cliprect,0); |
| 489 | break; |
| 446 | 490 | case 0x14: |
| 447 | 491 | draw_cg16_screen(machine,bitmap,cliprect,0,320,pri); |
| 448 | 492 | draw_cg16_screen(machine,bitmap,cliprect,1,320,pri); |