From 45171214edd2741e00206df93799a649dcc71384 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 15 Aug 2015 16:42:52 +0100 Subject: [PATCH] Add an option to toggle usage of a friend BitMap for our off-screen rendering buffer (OS3 only). Defaults to OFF, which works everywhere, but can be switched on for performance benefits when using RTG. --- amiga/options.h | 4 ++++ amiga/plotters.c | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/amiga/options.h b/amiga/options.h index a98b1e81d..b28a4f0a2 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -88,4 +88,8 @@ NSOPTION_INTEGER(redraw_tile_size_y, 0) NSOPTION_INTEGER(monitor_aspect_x, 0) NSOPTION_INTEGER(monitor_aspect_y, 0) NSOPTION_BOOL(accept_lang_locale, true) +/* Options relevant for OS3 only */ +#ifndef __amigaos4__ +NSOPTION_BOOL(friend_bitmap, false) +#endif diff --git a/amiga/plotters.c b/amiga/plotters.c index 202d1b879..09b08354c 100644 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -122,9 +122,15 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) gg->areabuf = AllocVecTagList(AREA_SIZE, NULL); gg->tmprasbuf = AllocVecTagList(width * height, NULL); + /* Friend BitMaps are weird. + * For OS4, we shouldn't use a friend BitMap here (see below). + * For OS3 AGA, we get no display blitted if we use a friend BitMap, + * however on RTG it seems to be a benefit. Hence this user-adjustable option. + */ #ifndef __amigaos4__ - /* If you're wondering why this is #ifdeffed, see the note about OS4 friend bitmaps below */ - friend = scrn->RastPort.BitMap; + if(nsoption_bool(friend_bitmap) == true) { + friend = scrn->RastPort.BitMap; + } #endif if(palette_mapped == true) { @@ -133,7 +139,9 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) #ifdef __amigaos4__ /* Screen depth is reported as 24 even when it's actually 32-bit. * We get freezes and other problems on OS4 if we befriend at any - * other depths, hence this check. */ + * other depths, hence this check. + * Note that this is forced on, the option is only used under OS3. + */ if(depth >= 24) friend = scrn->RastPort.BitMap; #endif gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8);