src/mess/video/saa505x.c
| r1944 | r1945 | |
| 83 | 83 | |
| 84 | 84 | */ |
| 85 | 85 | |
| 86 | #include "driver.h" |
| 86 | 87 | #include "saa505x.h" |
| 87 | 88 | |
| 88 | 89 | |
| r1944 | r1945 | |
| 3440 | 3441 | } |
| 3441 | 3442 | |
| 3442 | 3443 | |
| 3443 | | void teletext_F1(void) |
| 3444 | void teletext_F1(running_machine *machine) |
| 3444 | 3445 | { |
| 3445 | 3446 | int sc1; |
| 3446 | 3447 | int code; |
| r1944 | r1945 | |
| 3532 | 3533 | code=(code-0x20)*60+(6*((tt_linecount+tt_start_line)>>tt_double_height)); |
| 3533 | 3534 | for(sc1=0;sc1<6;sc1++) |
| 3534 | 3535 | { |
| 3535 | | (saa505x_calls.out_Pixel_func)(0,tt_lookup[code++]?tt_rcolour:tt_bgcolour); |
| 3536 | (saa505x_calls.out_Pixel_func)(machine,0,tt_lookup[code++]?tt_rcolour:tt_bgcolour); |
| 3536 | 3537 | } |
| 3537 | 3538 | } else { |
| 3538 | 3539 | |
| 3539 | | (saa505x_calls.out_Pixel_func)(0,0); |
| 3540 | | (saa505x_calls.out_Pixel_func)(0,0); |
| 3541 | | (saa505x_calls.out_Pixel_func)(0,0); |
| 3542 | | (saa505x_calls.out_Pixel_func)(0,0); |
| 3543 | | (saa505x_calls.out_Pixel_func)(0,0); |
| 3544 | | (saa505x_calls.out_Pixel_func)(0,0); |
| 3540 | (saa505x_calls.out_Pixel_func)(machine,0,0); |
| 3541 | (saa505x_calls.out_Pixel_func)(machine,0,0); |
| 3542 | (saa505x_calls.out_Pixel_func)(machine,0,0); |
| 3543 | (saa505x_calls.out_Pixel_func)(machine,0,0); |
| 3544 | (saa505x_calls.out_Pixel_func)(machine,0,0); |
| 3545 | (saa505x_calls.out_Pixel_func)(machine,0,0); |
| 3545 | 3546 | } |
| 3546 | 3547 | } |
src/mess/video/bbc.c
| r1944 | r1945 | |
| 9 | 9 | ******************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | | #include "deprecat.h" |
| 13 | 12 | #include "includes/bbc.h" |
| 14 | 13 | #include "video/m6845.h" |
| 15 | 14 | #include "saa505x.h" |
| 16 | 15 | |
| 17 | 16 | |
| 18 | | static void BBC_draw_hi_res(void); |
| 19 | | static void BBC_draw_teletext(void); |
| 17 | static void BBC_draw_hi_res(running_machine *machine); |
| 18 | static void BBC_draw_teletext(running_machine *machine); |
| 20 | 19 | |
| 21 | | static void (*draw_function)(void); |
| 20 | static void (*draw_function)(running_machine *machine); |
| 22 | 21 | |
| 23 | | static void BBC_draw_RGB_in(int offset,int data); |
| 22 | static void BBC_draw_RGB_in(running_machine *machine, int offset,int data); |
| 24 | 23 | |
| 25 | 24 | /************************************************************************ |
| 26 | 25 | * video_refresh flag is used in optimising the screen redrawing |
| r1944 | r1945 | |
| 205 | 204 | BBC_draw_RGB_in, |
| 206 | 205 | }; |
| 207 | 206 | |
| 208 | | static void BBC_draw_teletext(void) |
| 207 | static void BBC_draw_teletext(running_machine *machine) |
| 209 | 208 | { |
| 210 | 209 | |
| 211 | 210 | //Teletext Latch bits 0 to 5 go to bits 0 to 5 on the Teletext chip |
| r1944 | r1945 | |
| 216 | 215 | |
| 217 | 216 | teletext_LOSE_w(0,(Teletext_Latch>>7)&1); |
| 218 | 217 | |
| 219 | | teletext_F1(); |
| 218 | teletext_F1(machine); |
| 220 | 219 | |
| 221 | 220 | teletext_data_w(0,(Teletext_Latch&0x3f)|((Teletext_Latch&0x40)|(BBC_DE?0:0x40))); |
| 222 | 221 | |
| r1944 | r1945 | |
| 360 | 359 | |
| 361 | 360 | // This is the actual output of the Video ULA this fuction does all the output to the screen in the BBC emulator |
| 362 | 361 | |
| 363 | | static void BBC_ula_drawpixel(int col,int number_of_pixels) |
| 362 | static void BBC_ula_drawpixel(running_machine *machine, int col,int number_of_pixels) |
| 364 | 363 | { |
| 365 | 364 | int pixel_count; |
| 366 | 365 | int pixel_temp; |
| 367 | 366 | if ((BBC_display>=BBC_display_left) && ((BBC_display+number_of_pixels)<BBC_display_right)) |
| 368 | 367 | { |
| 369 | 368 | |
| 370 | | pixel_temp=Machine->pens[col^cursor_state]; |
| 369 | pixel_temp=machine->pens[col^cursor_state]; |
| 371 | 370 | for(pixel_count=0;pixel_count<number_of_pixels;pixel_count++) |
| 372 | 371 | { |
| 373 | 372 | *(BBC_display++) = pixel_temp; |
| r1944 | r1945 | |
| 380 | 379 | |
| 381 | 380 | // the Video ULA hi-res shift registers, pallette lookup and display enabled circuits |
| 382 | 381 | |
| 383 | | static void BBC_draw_hi_res(void) |
| 382 | static void BBC_draw_hi_res(running_machine *machine) |
| 384 | 383 | { |
| 385 | 384 | int meml; |
| 386 | 385 | unsigned char i=0; |
| r1944 | r1945 | |
| 402 | 401 | |
| 403 | 402 | for(sc1=0;sc1<pixels_per_byte;sc1++) |
| 404 | 403 | { |
| 405 | | BBC_ula_drawpixel(videoULA_pallet_lookup[pixel_bits[i]],emulation_pixels_per_real_pixel); |
| 404 | BBC_ula_drawpixel(machine, videoULA_pallet_lookup[pixel_bits[i]],emulation_pixels_per_real_pixel); |
| 406 | 405 | i=(i<<1)|1; |
| 407 | 406 | } |
| 408 | 407 | } else { |
| r1944 | r1945 | |
| 412 | 411 | if (video_refresh) |
| 413 | 412 | { |
| 414 | 413 | // if the display is not enable, just draw a blank area. |
| 415 | | BBC_ula_drawpixel(0, emulation_pixels_per_byte); |
| 414 | BBC_ula_drawpixel(machine, 0, emulation_pixels_per_byte); |
| 416 | 415 | } else { |
| 417 | 416 | BBC_display += emulation_pixels_per_byte; |
| 418 | 417 | } |
| r1944 | r1945 | |
| 422 | 421 | |
| 423 | 422 | // RGB input to the Video ULA from the Teletext IC |
| 424 | 423 | // Just pass on the output at the correct pixel size. |
| 425 | | static void BBC_draw_RGB_in(int offset,int data) |
| 424 | static void BBC_draw_RGB_in(running_machine *machine, int offset,int data) |
| 426 | 425 | { |
| 427 | | BBC_ula_drawpixel(data,emulation_pixels_per_real_pixel); |
| 426 | BBC_ula_drawpixel(machine, data,emulation_pixels_per_real_pixel); |
| 428 | 427 | } |
| 429 | 428 | |
| 430 | 429 | |
| r1944 | r1945 | |
| 625 | 624 | // or until a timeout (this catches the 6845 with silly register values that would not give a VSYNC signal) |
| 626 | 625 | while((!BBC_VSync)&&(c<60000)) |
| 627 | 626 | { |
| 628 | | if ((y_screen_pos>=cliprect->min_y) && (y_screen_pos<=cliprect->max_y)) (draw_function)(); |
| 627 | if ((y_screen_pos>=cliprect->min_y) && (y_screen_pos<=cliprect->max_y)) (draw_function)(machine); |
| 629 | 628 | |
| 630 | 629 | // and check the cursor |
| 631 | 630 | if (VideoULA_CR) BBC_Clock_CR(); |