src/mess/drivers/mz2500.c
| r9028 | r9029 | |
| 105 | 105 | [2] xx-- ---- kanji select |
| 106 | 106 | */ |
| 107 | 107 | |
| 108 | /* helper function, to draw stuff without getting crazy with height / width conditions :) */ |
| 109 | static void mz2500_draw_pixel(running_machine *machine, bitmap_t *bitmap,int x,int y,UINT16 pen,UINT8 width,UINT8 height) |
| 110 | { |
| 111 | if(width && height) |
| 112 | { |
| 113 | *BITMAP_ADDR16(bitmap, y*2+0, x*2+0) = machine->pens[pen]; |
| 114 | *BITMAP_ADDR16(bitmap, y*2+0, x*2+1) = machine->pens[pen]; |
| 115 | *BITMAP_ADDR16(bitmap, y*2+1, x*2+0) = machine->pens[pen]; |
| 116 | *BITMAP_ADDR16(bitmap, y*2+1, x*2+1) = machine->pens[pen]; |
| 117 | } |
| 118 | else if(width) |
| 119 | { |
| 120 | *BITMAP_ADDR16(bitmap, y, x*2+0) = machine->pens[pen]; |
| 121 | *BITMAP_ADDR16(bitmap, y, x*2+1) = machine->pens[pen]; |
| 122 | } |
| 123 | else if(height) |
| 124 | { |
| 125 | *BITMAP_ADDR16(bitmap, y*2+0, x) = machine->pens[pen]; |
| 126 | *BITMAP_ADDR16(bitmap, y*2+1, x) = machine->pens[pen]; |
| 127 | } |
| 128 | else |
| 129 | *BITMAP_ADDR16(bitmap, y, x) = machine->pens[pen]; |
| 130 | } |
| 131 | |
| 108 | 132 | static void draw_80x25(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 map_addr) |
| 109 | 133 | { |
| 110 | 134 | UINT8 *vram = memory_region(machine, "maincpu"); |
| r9028 | r9029 | |
| 175 | 199 | if(pen) |
| 176 | 200 | { |
| 177 | 201 | if((y*8+yi-s_y) >= 0 && (y*8+yi-s_y) < 200*y_step) |
| 178 | | *BITMAP_ADDR16(bitmap, (y*8+yi-s_y), x*8+xi) = machine->pens[pen+(pal_select ? 0x000 : 0x208)]; |
| 202 | mz2500_draw_pixel(machine,bitmap,x*8+xi,y*8+yi-s_y,pen+(pal_select ? 0x000 : 0x208),0,0); |
| 179 | 203 | } |
| 180 | 204 | } |
| 181 | 205 | } |
| 182 | | //drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfx_num],tile,color,0,0,x*8,(y)*8); |
| 183 | 206 | |
| 184 | 207 | count++; |
| 185 | 208 | count&=0x7ff; |
| r9028 | r9029 | |
| 258 | 281 | if(wid_40) // 640 x 200 with 40 x 25, double x size |
| 259 | 282 | { |
| 260 | 283 | if((y*8+yi-s_y) >= 0 && (y*8+yi-s_y) < 200*y_step) |
| 261 | | { |
| 262 | | *BITMAP_ADDR16(bitmap, (y*8+yi-s_y), (x*8+xi)*2+0) = machine->pens[pen+(pal_select ? 0x000 : 0x208)]; |
| 263 | | *BITMAP_ADDR16(bitmap, (y*8+yi-s_y), (x*8+xi)*2+1) = machine->pens[pen+(pal_select ? 0x000 : 0x208)]; |
| 264 | | } |
| 284 | mz2500_draw_pixel(machine,bitmap,x*8+xi,y*8+yi-s_y,pen+(pal_select ? 0x000 : 0x208),1,0); |
| 265 | 285 | } |
| 266 | 286 | else |
| 267 | 287 | { |
| 268 | 288 | if((y*8+yi-s_y) >= 0 && (y*8+yi-s_y) < 200*y_step) |
| 269 | | *BITMAP_ADDR16(bitmap, (y*8+yi-s_y), x*8+xi) = machine->pens[pen+(pal_select ? 0x000 : 0x208)]; |
| 289 | mz2500_draw_pixel(machine,bitmap,x*8+xi,y*8+yi-s_y,pen+(pal_select ? 0x000 : 0x208),0,0); |
| 270 | 290 | } |
| 271 | 291 | } |
| 272 | 292 | } |
| r9028 | r9029 | |
| 346 | 366 | |
| 347 | 367 | { |
| 348 | 368 | //if(pri == ((clut256[pen] & 0x100) >> 8)) |
| 349 | | *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[pen]; |
| 369 | mz2500_draw_pixel(machine,bitmap,res_x,res_y,pen,0,0); |
| 350 | 370 | } |
| 351 | 371 | } |
| 352 | 372 | count++; |
| r9028 | r9029 | |
| 401 | 421 | if(cg_interlace == 2) |
| 402 | 422 | { |
| 403 | 423 | if(pri == ((clut16[pen] & 0x10) >> 4)) |
| 404 | | { |
| 405 | | *BITMAP_ADDR16(bitmap, res_y*2+0, res_x) = machine->pens[(clut16[pen] & 0x0f)+0x200]; |
| 406 | | *BITMAP_ADDR16(bitmap, res_y*2+1, res_x) = machine->pens[(clut16[pen] & 0x0f)+0x200]; |
| 407 | | } |
| 424 | mz2500_draw_pixel(machine,bitmap,res_x,res_y,(clut16[pen] & 0x0f)+0x200,0,1); |
| 425 | |
| 408 | 426 | } |
| 409 | 427 | else |
| 410 | 428 | { |
| 411 | 429 | if(pri == ((clut16[pen] & 0x10) >> 4)) |
| 412 | | *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[(clut16[pen] & 0x0f)+0x200]; |
| 430 | mz2500_draw_pixel(machine,bitmap,res_x,res_y,(clut16[pen] & 0x0f)+0x200,0,0); |
| 413 | 431 | } |
| 414 | 432 | } |
| 415 | 433 | count++; |
| r9028 | r9029 | |
| 461 | 479 | if(cg_interlace == 2) |
| 462 | 480 | { |
| 463 | 481 | if(pri == ((clut256[pen] & 0x100) >> 8)) |
| 464 | | { |
| 465 | | *BITMAP_ADDR16(bitmap, res_y*2+0, res_x) = machine->pens[(clut256[pen] & 0xff)+0x100]; |
| 466 | | *BITMAP_ADDR16(bitmap, res_y*2+1, res_x) = machine->pens[(clut256[pen] & 0xff)+0x100]; |
| 467 | | } |
| 482 | mz2500_draw_pixel(machine,bitmap,res_x,res_y,(clut256[pen] & 0xff)+0x100,0,1); |
| 468 | 483 | } |
| 469 | 484 | else |
| 470 | 485 | { |
| 471 | 486 | if(pri == ((clut256[pen] & 0x100) >> 8)) |
| 472 | | *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[(clut256[pen] & 0xff)+0x100]; |
| 487 | mz2500_draw_pixel(machine,bitmap,res_x,res_y,(clut256[pen] & 0xff)+0x100,0,0); |
| 473 | 488 | } |
| 474 | 489 | } |
| 475 | 490 | count++; |