src/mess/video/spectrum.c
| r1928 | r1929 | |
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | | #include "deprecat.h" |
| 18 | 17 | #include "includes/spectrum.h" |
| 19 | 18 | #include "eventlst.h" |
| 20 | 19 | #include "video/border.h" |
| r1928 | r1929 | |
| 342 | 341 | *******************************************************************/ |
| 343 | 342 | |
| 344 | 343 | /* Draw a scanline in TS2068/TC2048 hires mode (code modified from COUPE.C) */ |
| 345 | | static void ts2068_hires_scanline(bitmap_t *bitmap, int y, int borderlines) |
| 344 | static void ts2068_hires_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines) |
| 346 | 345 | { |
| 347 | 346 | int x,b,scrx,scry; |
| 348 | 347 | unsigned short ink,pap; |
| r1928 | r1929 | |
| 372 | 371 | { |
| 373 | 372 | if (*scr&b) |
| 374 | 373 | { |
| 375 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[ink]); |
| 376 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[ink]); |
| 374 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]); |
| 375 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]); |
| 377 | 376 | } |
| 378 | 377 | else |
| 379 | 378 | { |
| 380 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[pap]); |
| 381 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[pap]); |
| 379 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]); |
| 380 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]); |
| 382 | 381 | } |
| 383 | 382 | } |
| 384 | 383 | scr++; |
| r1928 | r1929 | |
| 387 | 386 | } |
| 388 | 387 | |
| 389 | 388 | /* Draw a scanline in TS2068/TC2048 64-column mode */ |
| 390 | | static void ts2068_64col_scanline(bitmap_t *bitmap, int y, int borderlines, unsigned short inkcolor) |
| 389 | static void ts2068_64col_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines, unsigned short inkcolor) |
| 391 | 390 | { |
| 392 | 391 | int x,b,scrx,scry; |
| 393 | 392 | unsigned char *scr1, *scr2; |
| r1928 | r1929 | |
| 403 | 402 | for (b=0x80;b!=0;b>>=1) |
| 404 | 403 | { |
| 405 | 404 | if (*scr1&b) |
| 406 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[inkcolor]); |
| 405 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[inkcolor]); |
| 407 | 406 | else |
| 408 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[7-inkcolor]); |
| 407 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[7-inkcolor]); |
| 409 | 408 | } |
| 410 | 409 | scr1++; |
| 411 | 410 | |
| 412 | 411 | for (b=0x80;b!=0;b>>=1) |
| 413 | 412 | { |
| 414 | 413 | if (*scr2&b) |
| 415 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[inkcolor]); |
| 414 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[inkcolor]); |
| 416 | 415 | else |
| 417 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[7-inkcolor]); |
| 416 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[7-inkcolor]); |
| 418 | 417 | } |
| 419 | 418 | scr2++; |
| 420 | 419 | } |
| 421 | 420 | } |
| 422 | 421 | |
| 423 | 422 | /* Draw a scanline in TS2068/TC2048 lores (normal Spectrum) mode */ |
| 424 | | static void ts2068_lores_scanline(bitmap_t *bitmap, int y, int borderlines, int screen) |
| 423 | static void ts2068_lores_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines, int screen) |
| 425 | 424 | { |
| 426 | 425 | int x,b,scrx,scry; |
| 427 | 426 | unsigned short ink,pap; |
| r1928 | r1929 | |
| 451 | 450 | { |
| 452 | 451 | if (*scr&b) |
| 453 | 452 | { |
| 454 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[ink]); |
| 455 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[ink]); |
| 453 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]); |
| 454 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]); |
| 456 | 455 | } |
| 457 | 456 | else |
| 458 | 457 | { |
| 459 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[pap]); |
| 460 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,Machine->pens[pap]); |
| 458 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]); |
| 459 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]); |
| 461 | 460 | } |
| 462 | 461 | } |
| 463 | 462 | scr++; |
| r1928 | r1929 | |
| 476 | 475 | /* 64 Column mode */ |
| 477 | 476 | unsigned short inkcolor = (ts2068_port_ff_data & 0x38) >> 3; |
| 478 | 477 | for (count = 0; count < 192; count++) |
| 479 | | ts2068_64col_scanline(bitmap, count, TS2068_TOP_BORDER, inkcolor); |
| 478 | ts2068_64col_scanline(machine, bitmap, count, TS2068_TOP_BORDER, inkcolor); |
| 480 | 479 | } |
| 481 | 480 | else if ((ts2068_port_ff_data & 7) == 2) |
| 482 | 481 | { |
| 483 | 482 | /* Extended Color mode */ |
| 484 | 483 | for (count = 0; count < 192; count++) |
| 485 | | ts2068_hires_scanline(bitmap, count, TS2068_TOP_BORDER); |
| 484 | ts2068_hires_scanline(machine, bitmap, count, TS2068_TOP_BORDER); |
| 486 | 485 | } |
| 487 | 486 | else if ((ts2068_port_ff_data & 7) == 1) |
| 488 | 487 | { |
| 489 | 488 | /* Screen 6000-7aff */ |
| 490 | 489 | for (count = 0; count < 192; count++) |
| 491 | | ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 1); |
| 490 | ts2068_lores_scanline(machine, bitmap, count, TS2068_TOP_BORDER, 1); |
| 492 | 491 | } |
| 493 | 492 | else |
| 494 | 493 | { |
| 495 | 494 | /* Screen 4000-5aff */ |
| 496 | 495 | for (count = 0; count < 192; count++) |
| 497 | | ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 0); |
| 496 | ts2068_lores_scanline(machine, bitmap, count, TS2068_TOP_BORDER, 0); |
| 498 | 497 | } |
| 499 | 498 | |
| 500 | 499 | draw_border(bitmap, full_refresh, |
| r1928 | r1929 | |
| 516 | 515 | /* 64 Column mode */ |
| 517 | 516 | unsigned short inkcolor = (ts2068_port_ff_data & 0x38) >> 3; |
| 518 | 517 | for (count = 0; count < 192; count++) |
| 519 | | ts2068_64col_scanline(bitmap, count, SPEC_TOP_BORDER, inkcolor); |
| 518 | ts2068_64col_scanline(machine, bitmap, count, SPEC_TOP_BORDER, inkcolor); |
| 520 | 519 | } |
| 521 | 520 | else if ((ts2068_port_ff_data & 7) == 2) |
| 522 | 521 | { |
| 523 | 522 | /* Extended Color mode */ |
| 524 | 523 | for (count = 0; count < 192; count++) |
| 525 | | ts2068_hires_scanline(bitmap, count, SPEC_TOP_BORDER); |
| 524 | ts2068_hires_scanline(machine, bitmap, count, SPEC_TOP_BORDER); |
| 526 | 525 | } |
| 527 | 526 | else if ((ts2068_port_ff_data & 7) == 1) |
| 528 | 527 | { |
| 529 | 528 | /* Screen 6000-7aff */ |
| 530 | 529 | for (count = 0; count < 192; count++) |
| 531 | | ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 1); |
| 530 | ts2068_lores_scanline(machine, bitmap, count, SPEC_TOP_BORDER, 1); |
| 532 | 531 | } |
| 533 | 532 | else |
| 534 | 533 | { |
| 535 | 534 | /* Screen 4000-5aff */ |
| 536 | 535 | for (count = 0; count < 192; count++) |
| 537 | | ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 0); |
| 536 | ts2068_lores_scanline(machine, bitmap, count, SPEC_TOP_BORDER, 0); |
| 538 | 537 | } |
| 539 | 538 | |
| 540 | 539 | draw_border(bitmap, full_refresh, |