src/mess/drivers/x1.c
| r5509 | r5510 | |
| 146 | 146 | { |
| 147 | 147 | int count,xi,yi; |
| 148 | 148 | int pen_r,pen_g,pen_b,color; |
| 149 | int yi_size; |
| 149 | 150 | |
| 150 | 151 | count = 0; |
| 151 | 152 | |
| 152 | | for(yi=0;yi<8;yi++) |
| 153 | yi_size = (w == 1) ? 16 : 8; |
| 154 | |
| 155 | for(yi=0;yi<yi_size;yi++) |
| 153 | 156 | { |
| 154 | 157 | for(y=0;y<200;y+=8) |
| 155 | 158 | { |
| r5509 | r5510 | |
| 163 | 166 | |
| 164 | 167 | color = pen_r<<2 | pen_g<<1 | pen_b<<0; |
| 165 | 168 | |
| 166 | | if((x+xi)<=video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y) |
| 167 | | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = screen->machine->pens[color+0x100]; |
| 169 | if(w == 1) |
| 170 | { |
| 171 | if(yi & 1) |
| 172 | continue; |
| 168 | 173 | |
| 174 | if((x+xi)<=video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y) |
| 175 | *BITMAP_ADDR16(bitmap, y+(yi >> 1), x+xi) = screen->machine->pens[color+0x100]; |
| 176 | } |
| 177 | else |
| 178 | { |
| 179 | if((x+xi)<=video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y) |
| 180 | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = screen->machine->pens[color+0x100]; |
| 181 | } |
| 169 | 182 | } |
| 170 | 183 | count++; |
| 171 | 184 | } |
| r5509 | r5510 | |
| 181 | 194 | int tile = videoram[x+(y*40*w)]; |
| 182 | 195 | int color = colorram[x+(y*40*w)] & 0x1f; |
| 183 | 196 | int width = (colorram[x+(y*40*w)] & 0x80)>>7; |
| 184 | | int bank = (colorram[x+(y*40*w)] & 0x20)>>4; |
| 197 | int height = (colorram[x+(y*40*w)] & 0x40)>>6; |
| 198 | int pcg_bank = (colorram[x+(y*40*w)] & 0x20)>>4; |
| 199 | int region = (width+(height<<1)) & 3; |
| 185 | 200 | |
| 186 | | if(tile == 0) continue; //<- correct? |
| 201 | if(pcg_bank) |
| 202 | { |
| 203 | region = 4; |
| 204 | width = 0; |
| 205 | height = 0; |
| 206 | } |
| 207 | else if(tile == 0) continue; //<- correct? |
| 187 | 208 | |
| 188 | 209 | if(color & 0x38) |
| 189 | | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[width+bank],tile,color,0,0,(x/(width+1))*8*(width+1),y*8); |
| 210 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[region],tile,color,0,0,(x/(width+1))*8*(width+1),(y/(height+1))*8*(height+1)); |
| 190 | 211 | else |
| 191 | | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[width+bank],tile,color,0,0,(x/(width+1))*8*(width+1),y*8,0); |
| 212 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[region],tile,color,0,0,(x/(width+1))*8*(width+1),(y/(height+1))*8*(height+1),0); |
| 192 | 213 | } |
| 193 | 214 | } |
| 194 | 215 | |
| r5509 | r5510 | |
| 521 | 542 | 8*8 |
| 522 | 543 | }; |
| 523 | 544 | |
| 545 | static const gfx_layout x1_chars_8x8w = |
| 546 | { |
| 547 | 8,16, |
| 548 | RGN_FRAC(1,1), |
| 549 | 1, |
| 550 | { 0 }, |
| 551 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 552 | { 0*8, 0*8, 1*8, 1*8, 2*8, 2*8, 3*8, 3*8, 4*8, 4*8, 5*8, 5*8, 6*8, 6*8, 7*8, 7*8 }, |
| 553 | 8*8 |
| 554 | }; |
| 555 | |
| 556 | static const gfx_layout x1_chars_8wx8w = |
| 557 | { |
| 558 | 16,16, |
| 559 | RGN_FRAC(1,1), |
| 560 | 1, |
| 561 | { 0 }, |
| 562 | { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7 }, |
| 563 | { 0*8, 0*8, 1*8, 1*8, 2*8, 2*8, 3*8, 3*8, 4*8, 4*8, 5*8, 5*8, 6*8, 6*8, 7*8, 7*8 }, |
| 564 | 8*8 |
| 565 | }; |
| 566 | |
| 524 | 567 | static const gfx_layout x1_chars_16x16 = |
| 525 | 568 | { |
| 526 | 569 | 16,16, |
| r5509 | r5510 | |
| 547 | 590 | static GFXDECODE_START( x1 ) |
| 548 | 591 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8, 0, 0x40 ) |
| 549 | 592 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8wx8, 0, 0x40 ) |
| 593 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8w, 0, 0x40 ) |
| 594 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8wx8w, 0, 0x40 ) |
| 550 | 595 | GFXDECODE_ENTRY( "pcg", 0x00000, x1_pcg_8x8, 0x80, 1 ) |
| 551 | 596 | GFXDECODE_ENTRY( "cgrom", 0x01800, x1_chars_16x16, 0, 0x40 ) //only x1turboz uses this so far |
| 552 | 597 | GFXDECODE_ENTRY( "kanji", 0x27000, x1_chars_16x16, 0, 0x40 ) //needs to be checked when the ROM will be redumped |