src/mess/drivers/x1.c
| r5611 | r5612 | |
| 162 | 162 | { |
| 163 | 163 | UINT8 gfx_bank; |
| 164 | 164 | UINT8 pcg_mode; |
| 165 | UINT8 v400_mode; |
| 165 | 166 | |
| 166 | 167 | UINT8 ply; |
| 167 | 168 | UINT8 blackclip; // x1 turbo specific |
| r5611 | r5612 | |
| 232 | 233 | pcg_pen^=7; |
| 233 | 234 | |
| 234 | 235 | if((scrn_reg.blackclip & 8) && (color == (scrn_reg.blackclip & 7))) |
| 235 | | pcg_pen = 8; // clip the pen to black |
| 236 | pcg_pen = 0; // clip the pen to black |
| 236 | 237 | |
| 237 | 238 | if((res_x+xi)>video_screen_get_visible_area(machine->primary_screen)->max_x && (res_y+yi)>video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 238 | 239 | continue; |
| 239 | 240 | |
| 240 | | *BITMAP_ADDR16(bitmap, res_y+yi, res_x+xi) = machine->pens[pcg_pen]; |
| 241 | | if(width) |
| 242 | | *BITMAP_ADDR16(bitmap, res_y+yi, res_x+xi+1) = machine->pens[pcg_pen]; |
| 243 | | if(height) |
| 244 | | *BITMAP_ADDR16(bitmap, res_y+yi+1, res_x+xi) = machine->pens[pcg_pen]; |
| 245 | | if(width && height) |
| 241 | if(scrn_reg.v400_mode) |
| 242 | { |
| 243 | *BITMAP_ADDR16(bitmap, (res_y+yi)*2+0, res_x+xi) = machine->pens[pcg_pen]; |
| 244 | *BITMAP_ADDR16(bitmap, (res_y+yi)*2+1, res_x+xi) = machine->pens[pcg_pen]; |
| 245 | if(width) |
| 246 | { |
| 247 | *BITMAP_ADDR16(bitmap, (res_y+yi)*2+0, res_x+xi+1) = machine->pens[pcg_pen]; |
| 248 | *BITMAP_ADDR16(bitmap, (res_y+yi)*2+1, res_x+xi+1) = machine->pens[pcg_pen]; |
| 249 | } |
| 250 | if(height) |
| 251 | { |
| 252 | *BITMAP_ADDR16(bitmap, (res_y+yi+1)*2+0, res_x+xi) = machine->pens[pcg_pen]; |
| 253 | *BITMAP_ADDR16(bitmap, (res_y+yi+1)*2+1, res_x+xi) = machine->pens[pcg_pen]; |
| 254 | } |
| 255 | if(width && height) |
| 256 | { |
| 257 | *BITMAP_ADDR16(bitmap, (res_y+yi+1)*2+0, res_x+xi+1) = machine->pens[pcg_pen]; |
| 258 | *BITMAP_ADDR16(bitmap, (res_y+yi+1)*2+1, res_x+xi+1) = machine->pens[pcg_pen]; |
| 259 | } |
| 260 | } |
| 261 | else |
| 262 | { |
| 263 | *BITMAP_ADDR16(bitmap, res_y+yi, res_x+xi) = machine->pens[pcg_pen]; |
| 264 | if(width) |
| 265 | *BITMAP_ADDR16(bitmap, res_y+yi, res_x+xi+1) = machine->pens[pcg_pen]; |
| 266 | if(height) |
| 267 | *BITMAP_ADDR16(bitmap, res_y+yi+1, res_x+xi) = machine->pens[pcg_pen]; |
| 268 | if(width && height) |
| 246 | 269 | *BITMAP_ADDR16(bitmap, res_y+yi+1, res_x+xi+1) = machine->pens[pcg_pen]; |
| 270 | } |
| 247 | 271 | } |
| 248 | 272 | } |
| 249 | 273 | } |
| r5611 | r5612 | |
| 311 | 335 | { |
| 312 | 336 | if(yi & 1) |
| 313 | 337 | continue; |
| 314 | | if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && (y+(yi >> 1))<=video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 315 | | *BITMAP_ADDR16(bitmap, y+(yi >> 1), x+xi) = machine->pens[color+0x100]; |
| 338 | |
| 339 | if(scrn_reg.v400_mode) |
| 340 | { |
| 341 | if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && (y+(yi >> 1)*2+0)<=video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 342 | *BITMAP_ADDR16(bitmap, (y+(yi >> 1))*2+0, x+xi) = machine->pens[color+0x100]; |
| 343 | if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && (y+(yi >> 1)*2+1)<=video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 344 | *BITMAP_ADDR16(bitmap, (y+(yi >> 1))*2+1, x+xi) = machine->pens[color+0x100]; |
| 345 | } |
| 346 | else |
| 347 | { |
| 348 | if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && (y+(yi >> 1))<=video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 349 | *BITMAP_ADDR16(bitmap, y+(yi >> 1), x+xi) = machine->pens[color+0x100]; |
| 350 | } |
| 316 | 351 | } |
| 317 | 352 | else |
| 318 | 353 | { |
| 319 | | if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && (y+yi)<=video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 320 | | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = machine->pens[color+0x100]; |
| 354 | if(scrn_reg.v400_mode) |
| 355 | { |
| 356 | if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && ((y+yi)*2+0)<=video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 357 | *BITMAP_ADDR16(bitmap, (y+yi)*2+0, x+xi) = machine->pens[color+0x100]; |
| 358 | if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && ((y+yi)*2+1)<=video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 359 | *BITMAP_ADDR16(bitmap, (y+yi)*2+1, x+xi) = machine->pens[color+0x100]; |
| 360 | } |
| 361 | else |
| 362 | { |
| 363 | if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && (y+yi)<=video_screen_get_visible_area(machine->primary_screen)->max_y) |
| 364 | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = machine->pens[color+0x100]; |
| 365 | } |
| 321 | 366 | } |
| 322 | 367 | } |
| 323 | 368 | count++; |
| r5611 | r5612 | |
| 883 | 928 | if(ex_mask & 4) { gfx_bitmap_ram[(offset & 0x3fff)+0x8000] = data; } |
| 884 | 929 | } |
| 885 | 930 | |
| 931 | /* |
| 932 | SCRN flags |
| 933 | |
| 934 | d0(01) = 0:low res 1:high res |
| 935 | d1(02) = 0:1 raster 1:2 raster <- 0=400-line mode, legal when 'd0=1' |
| 936 | d2(04) = 0:25(20) lines 1:12(10) lines |
| 937 | d3(08) = 0:bank 0 0:bank 1 <- display |
| 938 | d4(10) = 0:bank 0 0:bank 1 <- access |
| 939 | d5(20) = 0:compatibility 1:high speed <- define PCG mode |
| 940 | d6(40) = 0:8-raster graphics 1:16-raster graphics |
| 941 | d7(80) = 0:don't display 1:display <- underline (when 1, graphics are not displayed) |
| 942 | |
| 943 | The value output by the X1turbo's IOCS at 0x1fd* |
| 944 | is stored in memory at 0xf8d6 |
| 945 | */ |
| 886 | 946 | static WRITE8_HANDLER( x1_scrn_w ) |
| 887 | 947 | { |
| 888 | 948 | scrn_reg.pcg_mode = (data & 0x20)>>5; |
| 889 | 949 | scrn_reg.gfx_bank = (data & 0x10)>>4; |
| 950 | scrn_reg.v400_mode = ((data & 0x03) == 3) ? 1 : 0; |
| 890 | 951 | printf("SCRN = %02x\n",data); |
| 891 | 952 | } |
| 892 | 953 | |