99 |
|
static SDL_Thread *redraw_thread = NULL; // Redraw thread |
100 |
|
|
101 |
|
#ifdef ENABLE_VOSF |
102 |
< |
static bool use_vosf = true; // Flag: VOSF enabled |
102 |
> |
static bool use_vosf = false; // Flag: VOSF enabled |
103 |
|
#else |
104 |
|
static const bool use_vosf = false; // VOSF not possible |
105 |
|
#endif |
260 |
|
{ |
261 |
|
ErrorAlert(GetString(error)); |
262 |
|
} |
263 |
+ |
|
264 |
+ |
// Display warning alert |
265 |
+ |
static void WarningAlert(int warning) |
266 |
+ |
{ |
267 |
+ |
WarningAlert(GetString(warning)); |
268 |
+ |
} |
269 |
|
#endif |
270 |
|
|
271 |
|
|
630 |
|
the_buffer = (uint8 *)vm_acquire(the_buffer_size); |
631 |
|
the_buffer_copy = (uint8 *)malloc(the_buffer_size); |
632 |
|
D(bug("the_buffer = %p, the_buffer_copy = %p, the_host_buffer = %p\n", the_buffer, the_buffer_copy, the_host_buffer)); |
627 |
– |
#else |
628 |
– |
// Allocate memory for frame buffer |
629 |
– |
the_buffer_size = (aligned_height + 2) * s->pitch; |
630 |
– |
the_buffer_copy = (uint8 *)calloc(1, the_buffer_size); |
631 |
– |
the_buffer = (uint8 *)calloc(1, the_buffer_size); |
632 |
– |
D(bug("the_buffer = %p, the_buffer_copy = %p\n", the_buffer, the_buffer_copy)); |
633 |
– |
#endif |
633 |
|
|
634 |
+ |
// Check whether we can initialize the VOSF subsystem and it's profitable |
635 |
+ |
if (!video_vosf_init(m)) { |
636 |
+ |
WarningAlert(STR_VOSF_INIT_ERR); |
637 |
+ |
use_vosf = false; |
638 |
+ |
} |
639 |
+ |
else if (!video_vosf_profitable()) { |
640 |
+ |
video_vosf_exit(); |
641 |
+ |
// WarningAlert(STR_VOSF_NOT_PROFITABLE_WARN); |
642 |
+ |
printf("VOSF acceleration is not profitable on this platform\n"); |
643 |
+ |
use_vosf = false; |
644 |
+ |
} |
645 |
+ |
if (!use_vosf) { |
646 |
+ |
free(the_buffer_copy); |
647 |
+ |
vm_release(the_buffer, the_buffer_size); |
648 |
+ |
the_host_buffer = NULL; |
649 |
+ |
} |
650 |
+ |
#endif |
651 |
+ |
if (!use_vosf) { |
652 |
+ |
// Allocate memory for frame buffer |
653 |
+ |
the_buffer_size = (aligned_height + 2) * s->pitch; |
654 |
+ |
the_buffer_copy = (uint8 *)calloc(1, the_buffer_size); |
655 |
+ |
the_buffer = (uint8 *)calloc(1, the_buffer_size); |
656 |
+ |
D(bug("the_buffer = %p, the_buffer_copy = %p\n", the_buffer, the_buffer_copy)); |
657 |
+ |
} |
658 |
+ |
|
659 |
|
#ifdef SHEEPSHAVER |
660 |
|
// Create cursor |
661 |
|
if ((sdl_cursor = SDL_CreateCursor(MacCursor + 4, MacCursor + 36, 16, 16, 0, 0)) != NULL) { |
847 |
|
return false; |
848 |
|
} |
849 |
|
|
826 |
– |
#ifdef ENABLE_VOSF |
827 |
– |
if (use_vosf) { |
828 |
– |
// Initialize the VOSF system |
829 |
– |
if (!video_vosf_init(*this)) { |
830 |
– |
ErrorAlert(STR_VOSF_INIT_ERR); |
831 |
– |
return false; |
832 |
– |
} |
833 |
– |
} |
834 |
– |
#endif |
835 |
– |
|
850 |
|
// Initialize VideoRefresh function |
851 |
|
VideoRefreshInit(); |
852 |
|
|
1173 |
|
} |
1174 |
|
|
1175 |
|
#ifdef ENABLE_VOSF |
1176 |
< |
// We have to redraw everything because the interpretation of pixel values changed |
1177 |
< |
LOCK_VOSF; |
1178 |
< |
PFLAG_SET_ALL; |
1179 |
< |
UNLOCK_VOSF; |
1180 |
< |
memset(the_buffer_copy, 0, VIDEO_MODE_ROW_BYTES * VIDEO_MODE_Y); |
1176 |
> |
if (use_vosf) { |
1177 |
> |
// We have to redraw everything because the interpretation of pixel values changed |
1178 |
> |
LOCK_VOSF; |
1179 |
> |
PFLAG_SET_ALL; |
1180 |
> |
UNLOCK_VOSF; |
1181 |
> |
memset(the_buffer_copy, 0, VIDEO_MODE_ROW_BYTES * VIDEO_MODE_Y); |
1182 |
> |
} |
1183 |
|
#endif |
1184 |
|
} |
1185 |
|
|