comparison render_sdl.c @ 1398:08116cb5ffaa

Fix absolute mouse mode when non-default overscan settings are used
author Michael Pavone <pavone@retrodev.com>
date Wed, 14 Jun 2017 20:46:11 -0700
parents 89eb967fed72
children 458df351af06
comparison
equal deleted inserted replaced
1397:89eb967fed72 1398:08116cb5ffaa
565 #define FPS_INTERVAL 10000 565 #define FPS_INTERVAL 10000
566 #else 566 #else
567 #define FPS_INTERVAL 1000 567 #define FPS_INTERVAL 1000
568 #endif 568 #endif
569 569
570 static uint32_t last_width;
570 void render_framebuffer_updated(uint8_t which, int width) 571 void render_framebuffer_updated(uint8_t which, int width)
571 { 572 {
572 static uint8_t last; 573 static uint8_t last;
574 last_width = width;
573 uint32_t height = which <= FRAMEBUFFER_EVEN 575 uint32_t height = which <= FRAMEBUFFER_EVEN
574 ? (video_standard == VID_NTSC ? 243 : 294) - (overscan_top[video_standard] + overscan_bot[video_standard]) 576 ? (video_standard == VID_NTSC ? 243 : 294) - (overscan_top[video_standard] + overscan_bot[video_standard])
575 : 240; 577 : 240;
576 FILE *screenshot_file = NULL; 578 FILE *screenshot_file = NULL;
577 uint32_t shot_height, shot_width; 579 uint32_t shot_height, shot_width;
688 } 690 }
689 if (!events_processed) { 691 if (!events_processed) {
690 process_events(); 692 process_events();
691 } 693 }
692 events_processed = 0; 694 events_processed = 0;
695 }
696
697 uint32_t render_emulated_width()
698 {
699 return last_width - overscan_left[video_standard] - overscan_right[video_standard];
700 }
701
702 uint32_t render_emulated_height()
703 {
704 return (video_standard == VID_NTSC ? 243 : 294) - overscan_top[video_standard] - overscan_bot[video_standard];
705 }
706
707 uint32_t render_overscan_left()
708 {
709 return overscan_left[video_standard];
710 }
711
712 uint32_t render_overscan_top()
713 {
714 return overscan_top[video_standard];
693 } 715 }
694 716
695 void render_wait_quit(vdp_context * context) 717 void render_wait_quit(vdp_context * context)
696 { 718 {
697 SDL_Event event; 719 SDL_Event event;