From 1470a8af135cf9b37fec063c512d0e36c9b3eba2 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Sat, 13 May 2006 16:58:44 +0000 Subject: [PATCH] NQD dirty boxes, SDL backend. This reduces the number of Screen_fault_handler() calls by 80%. i.e. VOSF is now viable on this turtle MacOS X. Besides, since there is no buffer comparison, idle sleep can really be effective. SheepShaver in idle mode on my PBG4 now goes below 8% of CPU resources instead of 70-80% with bounding boxes based video refreshes. Caveat: if your program doesn't use standard MacOS routines that call NQD, then you can expect slower (visual) performance. However, I do think the new default behavior (VOSF+NQD) is the most common. --- BasiliskII/src/SDL/video_sdl.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/BasiliskII/src/SDL/video_sdl.cpp b/BasiliskII/src/SDL/video_sdl.cpp index 5435fbf7..5a3b9ded 100644 --- a/BasiliskII/src/SDL/video_sdl.cpp +++ b/BasiliskII/src/SDL/video_sdl.cpp @@ -2246,3 +2246,27 @@ static int redraw_func(void *arg) return 0; } #endif + + +/* + * Record dirty area from NQD + */ + +#ifdef SHEEPSHAVER +void video_set_dirty_area(int x, int y, int w, int h) +{ + const VIDEO_MODE &mode = drv->mode; + const int screen_width = VIDEO_MODE_X; + const int screen_height = VIDEO_MODE_Y; + const int bytes_per_row = VIDEO_MODE_ROW_BYTES; + +#ifdef ENABLE_VOSF + if (use_vosf) { + vosf_set_dirty_area(x, y, w, h, screen_width, bytes_per_row); + return; + } +#endif + + // XXX handle dirty bounding boxes for non-VOSF modes +} +#endif