Description: Disable Glide support
Author: Stephen Kitt <skitt@debian.org>
Forwarded: not-needed

Glide support relies on a proprietary header file which is removed
from the source archive in Debian.

--- a/include/glide.h
+++ b/include/glide.h
@@ -62,7 +62,6 @@
 #define FX_CALL
 #endif
 
-#include <sdk2_glide.h>
 #include "glidedef.h"
 
 // Careful with structures containing pointers
--- a/src/dos/dos.cpp
+++ b/src/dos/dos.cpp
@@ -3543,7 +3543,7 @@
 void INT10_ScrollWindow_viaRealInt(uint8_t rul, uint8_t cul, uint8_t rlr, uint8_t clr, int8_t nlines, uint8_t attr, uint8_t page);
 
 extern bool dos_con_use_int16_to_detect_input;
-extern bool dbg_zero_on_dos_allocmem, addovl;
+extern bool dbg_zero_on_dos_allocmem;
 
 bool set_ver(char *s) {
 	s=trim(s);
@@ -4623,7 +4623,7 @@
 		const char *keepstr = section->Get_string("keep private area on boot");
 		if (!strcasecmp(keepstr, "true")||!strcasecmp(keepstr, "1")) keep_private_area_on_boot = 1;
 		else if (!strcasecmp(keepstr, "false")||!strcasecmp(keepstr, "0")) keep_private_area_on_boot = 0;
-		else keep_private_area_on_boot = addovl;
+		else keep_private_area_on_boot = false;
 		dos.direct_output=false;
 		dos.internal_output=false;
 
--- a/src/dos/dos_programs.cpp
+++ b/src/dos/dos_programs.cpp
@@ -108,7 +108,7 @@
     return CodePageHostToGuestUTF16(d, reinterpret_cast<const uint16_t *>(s));
 }
 extern bool systemmessagebox(char const * aTitle, char const * aMessage, char const * aDialogType, char const * aIconType, int aDefaultButton);
-extern bool addovl, addipx, addne2k, prepared, inshell, usecon, uao, loadlang, morelen, mountfro[26], mountiro[26], resetcolor, staycolors, printfont, notrycp, internal_program;
+extern bool addipx, addne2k, prepared, inshell, usecon, uao, loadlang, morelen, mountfro[26], mountiro[26], resetcolor, staycolors, printfont, notrycp, internal_program;
 extern bool clear_screen(), OpenGL_using(void), DOS_SetAnsiAttr(uint8_t attr), isDBCSCP();
 extern int lastcp, lastmsgcp, tryconvertcp, FileDirExistCP(const char *name), FileDirExistUTF8(std::string &localname, const char *name);
 extern uint8_t DOS_GetAnsiAttr(void);
--- a/src/gui/menu_callback.cpp
+++ b/src/gui/menu_callback.cpp
@@ -56,7 +56,7 @@
 extern SHELL_Cmd cmd_list[];
 extern unsigned int page, hostkeyalt, sendkeymap;
 extern int posx, posy, wheel_key, mbutton, enablelfn, dos_clipboard_device_access, aspect_ratio_x, aspect_ratio_y, disk_data_rate, floppy_data_rate, lastmsgcp;
-extern bool addovl, clearline, pcibus_enable, winrun, window_was_maximized, wheel_guest, clipboard_dosapi, clipboard_biospaste, direct_mouse_clipboard, sync_time, manualtime, pausewithinterrupts_enable, enable_autosave, enable_config_as_shell_commands, noremark_save_state, force_load_state, use_quick_reboot, use_save_file, dpi_aware_enable, pc98_force_ibm_layout, log_int21, log_fileio, x11_on_top, macosx_on_top, rtl, gbk, chinasea, uselangcp;
+extern bool clearline, pcibus_enable, winrun, window_was_maximized, wheel_guest, clipboard_dosapi, clipboard_biospaste, direct_mouse_clipboard, sync_time, manualtime, pausewithinterrupts_enable, enable_autosave, enable_config_as_shell_commands, noremark_save_state, force_load_state, use_quick_reboot, use_save_file, dpi_aware_enable, pc98_force_ibm_layout, log_int21, log_fileio, x11_on_top, macosx_on_top, rtl, gbk, chinasea, uselangcp;
 extern bool mountfro[26], mountiro[26];
 extern struct BuiltinFileBlob bfb_GLIDE2X_OVL;
 extern const char* RunningProgram;
@@ -73,7 +73,6 @@
 void res_init(void), change_output(int output);
 void VFILE_Remove(const char *name,const char *dir = "");
 void VOODOO_Destroy(Section* /*sec*/), VOODOO_OnPowerOn(Section* /*sec*/);
-void GLIDE_ShutDown(Section* sec), GLIDE_PowerOn(Section* sec);
 void DOSBox_ShowConsole(void);
 void Load_Language(std::string name);
 void RebootLanguage(std::string filename, bool confirm=false);
@@ -1930,17 +1929,9 @@
     (void)menuitem;//UNUSED
     Section_prop *section = static_cast<Section_prop *>(control->GetSection("voodoo"));
     if (section == NULL) return false;
-    bool glideon = addovl;
-    SetVal("voodoo", "glide", glideon?"false":"true");
-    addovl=false;
-    GLIDE_ShutDown(section);
-    GLIDE_PowerOn(section);
-    if (addovl) VFILE_RegisterBuiltinFileBlob(bfb_GLIDE2X_OVL, "/SYSTEM/");
-    else {
-        VFILE_Remove("GLIDE2X.OVL","SYSTEM");
-        if (!glideon) systemmessagebox("Warning", "Glide passthrough cannot be enabled. Check the Glide wrapper installation.", "ok","warning", 1);
-    }
-    mainMenu.get_item("3dfx_glide").check(addovl).refresh_item(mainMenu);
+    SetVal("voodoo", "glide", "false");
+    systemmessagebox("Warning", "Glide passthrough cannot be enabled. Check the Glide wrapper installation.", "ok","warning", 1);
+    mainMenu.get_item("3dfx_glide").check(false).refresh_item(mainMenu);
     return true;
 }
 
--- a/src/gui/sdlmain.cpp
+++ b/src/gui/sdlmain.cpp
@@ -430,7 +430,7 @@
 extern int bootdrive, resolveopt;
 extern int dos_clipboard_device_access;
 extern int aspect_ratio_x, aspect_ratio_y;
-extern bool sync_time, loadlang, addovl;
+extern bool sync_time, loadlang;
 extern bool bootguest, bootfast, bootvm;
 
 std::string dosboxpath="";
@@ -1790,10 +1790,6 @@
 
 void GFX_ResetScreen(void) {
     fullscreen_switch=false;
-	if(glide.enabled) {
-		GLIDE_ResetScreen(true);
-		return;
-	}
             SDL_Rect *rect = &sdl.updateRects[0];
             rect->x = 0; rect->y = 0; rect->w = 0; rect->h = 0;
 #if defined(C_SDL2)
@@ -2820,10 +2816,7 @@
     sticky_keys(!full);
 #endif
 
-	if (glide.enabled)
-		GLIDE_ResetScreen();
-	else
-        GFX_ResetScreen();
+    GFX_ResetScreen();
 
     // set vsync to host
     // NOTE why forcing ???
@@ -6138,7 +6131,7 @@
             if (CheckQuit()) throw(0);
             break;
         case SDL_VIDEOEXPOSE:
-            if (sdl.draw.callback && !glide.enabled) sdl.draw.callback( GFX_CallBackRedraw );
+            if (sdl.draw.callback) sdl.draw.callback( GFX_CallBackRedraw );
             break;
         case SDL_KEYDOWN:
         case SDL_KEYUP:
@@ -7725,7 +7718,6 @@
 
 void DISP2_Init(uint8_t color), DISP2_Shut();
 //extern void UI_Init(void);
-void grGlideShutdown(void);
 int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
 #if (defined __i386__ || defined __x86_64__) && (defined BSD || defined LINUX)
     dropPrivilegesTemp();
@@ -8834,7 +8826,6 @@
 
         /* -- -- Initialise Joystick and CD-ROM separately. This way we can warn when it fails instead of exiting the application */
         LOG(LOG_MISC,LOG_DEBUG)("Initializing SDL joystick subsystem...");
-        glide.fullscreen = &sdl.desktop.fullscreen;
         if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) >= 0) {
             sdl.num_joysticks = (Bitu)SDL_NumJoysticks();
             LOG(LOG_MISC,LOG_DEBUG)("SDL reports %u joysticks",(unsigned int)sdl.num_joysticks);
@@ -8989,7 +8980,6 @@
 #endif
         Init_VGABIOS();
         VOODOO_Init();
-        GLIDE_Init();
         PROGRAMS_Init(); /* <- NTS: Does not init programs, it inits the callback used later when creating the .COM programs on drive Z: */
         PCSPEAKER_Init();
         TANDYSOUND_Init();
@@ -9156,7 +9146,7 @@
 
         mainMenu.get_item("mapper_fscaler").check(render.scale.forced).refresh_item(mainMenu);
         mainMenu.get_item("3dfx_voodoo").check(strcasecmp(static_cast<Section_prop *>(control->GetSection("voodoo"))->Get_string("voodoo_card"), "false")).refresh_item(mainMenu);
-        mainMenu.get_item("3dfx_glide").check(addovl).refresh_item(mainMenu);
+        mainMenu.get_item("3dfx_glide").check(false).refresh_item(mainMenu);
 
         mainMenu.get_item("debug_logint21").check(log_int21).refresh_item(mainMenu);
         mainMenu.get_item("debug_logfileio").check(log_fileio).refresh_item(mainMenu);
@@ -9523,8 +9513,6 @@
             if (Voodoo_OGL_Active())
                 Voodoo_Output_Enable(false);
 
-            grGlideShutdown();
-
             /* shutdown DOSBox-X's virtual drive Z */
             VFILE_Shutdown();
             /* shutdown the programs */
--- a/src/hardware/Makefile.am
+++ b/src/hardware/Makefile.am
@@ -14,7 +14,7 @@
 			cmos.cpp disney.cpp gus.cpp mpu401.cpp ipx.cpp ipxserver.cpp ne2000.cpp hardopl.cpp dbopl.cpp innova.cpp dongle.cpp \
 			voodoo.cpp voodoo_interface.cpp voodoo_emu.cpp ps1_sound.cpp sn76496.h ide.cpp floppy.cpp voodoo_vogl.cpp voodoo_opengl.cpp \
 			nukedopl.cpp pc98.cpp vga_pc98_gdc.cpp vga_pc98_gdc_draw.cpp vga_pc98_dac.cpp vga_pc98_crtc.cpp vga_pc98_cg.cpp \
-			vga_pc98_egc.cpp pc98_fm.cpp glide.cpp vga_ati.cpp pc98_artic.cpp \
+			vga_pc98_egc.cpp pc98_fm.cpp vga_ati.cpp pc98_artic.cpp \
 			snd_pc98/sound/opngenc.c snd_pc98/sound/opngeng.c snd_pc98/sound/pcm86c.c snd_pc98/sound/pcm86g.c \
 			snd_pc98/sound/tms3631c.c snd_pc98/sound/tms3631g.c snd_pc98/sound/psggenc.c snd_pc98/sound/psggeng.c \
 			snd_pc98/common/parts.c snd_pc98/generic/keydisp.c snd_pc98/sound/adpcmc.c snd_pc98/sound/adpcmg.c \
--- a/src/hardware/memory.cpp
+++ b/src/hardware/memory.cpp
@@ -845,9 +845,7 @@
 
 PageHandler * MEM_GetPageHandler(Bitu phys_page) {
 	phys_page &= memory.mem_alias_pagemask_active;
-	if (glide.enabled && (phys_page>=(GLIDE_LFB>>12)) && (phys_page<(GLIDE_LFB>>12)+GLIDE_PAGES))
-		return (PageHandler*)glide.lfb_pagehandler;
-	else if (phys_page<memory.handler_pages) {
+	if (phys_page<memory.handler_pages) {
 		if (memory.phandlers[phys_page] != NULL) /*likely*/
 			return memory.phandlers[phys_page];
 
--- a/src/shell/shell.cpp
+++ b/src/shell/shell.cpp
@@ -54,7 +54,7 @@
 extern bool shell_keyboard_flush;
 extern bool dos_shell_running_program, mountwarning, winautorun;
 extern bool startcmd, startwait, startquiet, internal_program;
-extern bool addovl, addipx, addne2k, enableime, showdbcs;
+extern bool addipx, addne2k, enableime, showdbcs;
 extern bool halfwidthkana, force_conversion, gbk, uselangcp, chinasea;
 extern const char* RunningProgram;
 extern int enablelfn, msgcodepage, lastmsgcp;
