Kill last of DJGPP, WATTCP, _WINDOWS (ol' DirectDraw)

This commit is contained in:
James R 2022-09-24 19:43:44 -07:00
parent f6a5ed9c6c
commit 89abbd33b4
15 changed files with 10 additions and 195 deletions

View file

@ -6,7 +6,6 @@
PANDORA\ PANDORA\
HAIKU\ HAIKU\
DUMMY\ DUMMY\
DJGPPDOS\
SOLARIS\ SOLARIS\
MACOSX\ MACOSX\

View file

@ -35,10 +35,6 @@
#include "filesrch.h" #include "filesrch.h"
#include "m_misc.h" #include "m_misc.h"
#ifdef _WINDOWS
#include "win32/win_main.h"
#endif
#ifdef HWRENDER #ifdef HWRENDER
#include "hardware/hw_main.h" #include "hardware/hw_main.h"
#endif #endif
@ -1550,13 +1546,6 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...)
// //
void CONS_Error(const char *msg) void CONS_Error(const char *msg)
{ {
#if defined(RPC_NO_WINDOWS_H) && defined(_WINDOWS)
if (!graphics_started)
{
MessageBoxA(vid.WndParent, msg, "Dr. Robotnik's Ring Racers Warning", MB_OK);
return;
}
#endif
CONS_Printf("\x82%s", msg); // write error msg in different colour CONS_Printf("\x82%s", msg); // write error msg in different colour
CONS_Printf(M_GetText("Press ENTER to continue\n")); CONS_Printf(M_GetText("Press ENTER to continue\n"));

View file

@ -85,10 +85,6 @@
#include "hardware/hw_main.h" // 3D View Rendering #include "hardware/hw_main.h" // 3D View Rendering
#endif #endif
#ifdef _WINDOWS
#include "win32/win_main.h" // I_DoStartupMouse
#endif
#ifdef HW3SOUND #ifdef HW3SOUND
#include "hardware/hw3sound.h" #include "hardware/hw3sound.h"
#endif #endif
@ -714,11 +710,6 @@ void D_SRB2Loop(void)
// Pushing of + parameters is now done back in D_SRB2Main, not here. // Pushing of + parameters is now done back in D_SRB2Main, not here.
#ifdef _WINDOWS
CONS_Printf("I_StartupMouse()...\n");
I_DoStartupMouse();
#endif
I_UpdateTime(cv_timescale.value); I_UpdateTime(cv_timescale.value);
oldentertics = I_GetTime(); oldentertics = I_GetTime();
@ -1258,9 +1249,7 @@ void D_SRB2Main(void)
#endif #endif
// for dedicated server // for dedicated server
#if !defined (_WINDOWS) //already check in win_main.c
dedicated = M_CheckParm("-dedicated") != 0; dedicated = M_CheckParm("-dedicated") != 0;
#endif
if (devparm) if (devparm)
CONS_Printf(M_GetText("Development mode ON.\n")); CONS_Printf(M_GetText("Development mode ON.\n"));

View file

@ -4708,8 +4708,6 @@ static void Command_Version_f(void)
// Base library // Base library
#if defined( HAVE_SDL) #if defined( HAVE_SDL)
CONS_Printf("SDL "); CONS_Printf("SDL ");
#elif defined(_WINDOWS)
CONS_Printf("DD ");
#endif #endif
// OS // OS

View file

@ -15,7 +15,7 @@
#include <time.h> #include <time.h>
#if defined (_WIN32) || defined (__DJGPP__) #ifdef _WIN32
#include <io.h> #include <io.h>
#include <direct.h> #include <direct.h>
#else #else
@ -30,10 +30,6 @@
#elif defined (_WIN32) #elif defined (_WIN32)
#include <sys/utime.h> #include <sys/utime.h>
#endif #endif
#ifdef __DJGPP__
#include <dir.h>
#include <utime.h>
#endif
#ifdef HAVE_CURL #ifdef HAVE_CURL
#include "curl/curl.h" #include "curl/curl.h"

View file

@ -55,12 +55,6 @@
#endif #endif
#endif #endif
#ifdef _WINDOWS
#if !defined (HWRENDER) && !defined (NOHW)
#define HWRENDER
#endif
#endif
#ifdef _WIN32 #ifdef _WIN32
#define ASMCALL __cdecl #define ASMCALL __cdecl
#else #else
@ -99,7 +93,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <ctype.h> #include <ctype.h>
#if defined (_WIN32) || defined (__DJGPP__) #ifdef _WIN32
#include <io.h> #include <io.h>
#endif #endif

View file

@ -54,17 +54,6 @@ typedef long ssize_t;
#define PDWORD_PTR PDWORD #define PDWORD_PTR PDWORD
#endif #endif
#endif #endif
#elif defined (__DJGPP__)
#define UINT8 unsigned char
#define SINT8 signed char
#define UINT16 unsigned short int
#define INT16 signed short int
#define INT32 signed long
#define UINT32 unsigned long
#define INT64 signed long long
#define UINT64 unsigned long long
#else #else
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#include <stdint.h> #include <stdint.h>

View file

@ -20,18 +20,10 @@
// __declspec(dllexport) <return->type> (WINAPI *<function-name>) (<arguments>); // __declspec(dllexport) <return->type> (WINAPI *<function-name>) (<arguments>);
#ifdef _CREATE_DLL_ #ifdef _CREATE_DLL_
#ifdef _WINDOWS #ifdef __cplusplus
#ifdef __cplusplus #define EXPORT extern "C"
#define EXPORT extern "C" __declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
#else #else
#ifdef __cplusplus #define EXPORT
#define EXPORT extern "C"
#else
#define EXPORT
#endif
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
#define HWRAPI(fn) WINAPI fn #define HWRAPI(fn) WINAPI fn
@ -56,9 +48,7 @@
void GL_DBG_Printf(const char *format, ...) /*FUNCPRINTF*/; void GL_DBG_Printf(const char *format, ...) /*FUNCPRINTF*/;
#ifdef _WINDOWS #ifdef __CYGWIN__
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
#elif defined (__CYGWIN__)
void _init() __attribute__((constructor)); void _init() __attribute__((constructor));
void _fini() __attribute__((destructor)); void _fini() __attribute__((destructor));
#else #else

View file

@ -29,9 +29,6 @@ EXPORT boolean HWRAPI(Init) (void);
#ifndef HAVE_SDL #ifndef HAVE_SDL
EXPORT void HWRAPI(Shutdown) (void); EXPORT void HWRAPI(Shutdown) (void);
#endif #endif
#ifdef _WINDOWS
EXPORT void HWRAPI(GetModeList) (vmode_t **pvidmodes, INT32 *numvidmodes);
#endif
EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal); EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal);
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl); EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color); EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
@ -104,9 +101,6 @@ struct hwdriver_s
CreateModelVBOs pfnCreateModelVBOs; CreateModelVBOs pfnCreateModelVBOs;
SetTransform pfnSetTransform; SetTransform pfnSetTransform;
GetTextureUsed pfnGetTextureUsed; GetTextureUsed pfnGetTextureUsed;
#ifdef _WINDOWS
GetModeList pfnGetModeList;
#endif
#ifndef HAVE_SDL #ifndef HAVE_SDL
Shutdown pfnShutdown; Shutdown pfnShutdown;
#endif #endif

View file

@ -20,10 +20,6 @@
#else #else
#include <winsock.h> #include <winsock.h>
#endif #endif
#elif !defined (__DJGPP__)
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif #endif
#include "i_addrinfo.h" #include "i_addrinfo.h"

View file

@ -100,15 +100,6 @@
#endif #endif
#endif // USE_WINSOCK #endif // USE_WINSOCK
#ifdef __DJGPP__
#ifdef WATTCP // Alam_GBC: Wattcp may need this
#include <tcp.h>
#define strerror strerror_s
#else // wattcp
#include <lsck/lsck.h>
#endif // libsocket
#endif // djgpp
typedef union typedef union
{ {
struct sockaddr any; struct sockaddr any;
@ -142,7 +133,7 @@ typedef union
#include "doomstat.h" #include "doomstat.h"
// win32 or djgpp // win32 or djgpp
#if defined (USE_WINSOCK) || defined (__DJGPP__) #ifdef USE_WINSOCK
// winsock stuff (in winsock a socket is not a file) // winsock stuff (in winsock a socket is not a file)
#define ioctl ioctlsocket #define ioctl ioctlsocket
#define close closesocket #define close closesocket
@ -150,15 +141,7 @@ typedef union
#include "i_addrinfo.h" #include "i_addrinfo.h"
#ifdef __DJGPP__
#ifdef WATTCP
#define SELECTTEST #define SELECTTEST
#endif
#else
#define SELECTTEST
#endif
#define DEFAULTPORT "5029" #define DEFAULTPORT "5029"
@ -174,8 +157,8 @@ typedef union
#define ERRSOCKET (-1) #define ERRSOCKET (-1)
#endif #endif
// define socklen_t in DOS/Windows if it is not already defined // define socklen_t in Windows if it is not already defined
#if (defined (WATTCP) && !defined (__libsocket_socklen_t)) || defined (USE_WINSOCK1) #ifdef USE_WINSOCK1
typedef int socklen_t; typedef int socklen_t;
#endif #endif
@ -208,18 +191,6 @@ static boolean init_tcp_driver = false;
static const char *serverport_name = DEFAULTPORT; static const char *serverport_name = DEFAULTPORT;
static const char *clientport_name;/* any port */ static const char *clientport_name;/* any port */
#ifdef WATTCP
static void wattcp_outch(char s)
{
static char old = '\0';
char pr[2] = {s,0};
if (s == old && old == ' ') return;
else old = s;
if (s == '\r') CONS_Printf("\n");
else if (s != '\n') CONS_Printf(pr);
}
#endif
#ifdef USE_WINSOCK #ifdef USE_WINSOCK
// stupid microsoft makes things complicated // stupid microsoft makes things complicated
static char *get_WSAErrorStr(int e) static char *get_WSAErrorStr(int e)
@ -820,11 +791,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
int opt; int opt;
socklen_t opts; socklen_t opts;
#ifdef FIONBIO #ifdef FIONBIO
#ifdef WATTCP
char trueval = true;
#else
unsigned long trueval = true; unsigned long trueval = true;
#endif
#endif #endif
mysockaddr_t straddr; mysockaddr_t straddr;
struct sockaddr_in sin; struct sockaddr_in sin;
@ -1192,61 +1159,7 @@ boolean I_InitTcpDriver(void)
CONS_Debug(DBG_NETPLAY, "WinSock description: %s\n",WSAData.szDescription); CONS_Debug(DBG_NETPLAY, "WinSock description: %s\n",WSAData.szDescription);
CONS_Debug(DBG_NETPLAY, "WinSock System Status: %s\n",WSAData.szSystemStatus); CONS_Debug(DBG_NETPLAY, "WinSock System Status: %s\n",WSAData.szSystemStatus);
#endif #endif
#ifdef __DJGPP__
#ifdef WATTCP // Alam_GBC: survive bootp, dhcp, rarp and wattcp/pktdrv from failing to load
survive_eth = 1; // would be needed to not exit if pkt_eth_init() fails
survive_bootp = 1; // ditto for BOOTP
survive_dhcp = 1; // ditto for DHCP/RARP
survive_rarp = 1;
//_watt_do_exit = false;
//_watt_handle_cbreak = false;
//_watt_no_config = true;
_outch = wattcp_outch;
init_misc();
//#ifdef DEBUGFILE
dbug_init();
//#endif
switch (sock_init())
{
case 0:
init_tcp_driver = true;
break;
case 3:
CONS_Debug(DBG_NETPLAY, "No packet driver detected\n");
break;
case 4:
CONS_Debug(DBG_NETPLAY, "Error while talking to packet driver\n");
break;
case 5:
CONS_Debug(DBG_NETPLAY, "BOOTP failed\n");
break;
case 6:
CONS_Debug(DBG_NETPLAY, "DHCP failed\n");
break;
case 7:
CONS_Debug(DBG_NETPLAY, "RARP failed\n");
break;
case 8:
CONS_Debug(DBG_NETPLAY, "TCP/IP failed\n");
break;
case 9:
CONS_Debug(DBG_NETPLAY, "PPPoE login/discovery failed\n");
break;
default:
CONS_Debug(DBG_NETPLAY, "Unknown error with TCP/IP stack\n");
break;
}
hires_timer(0);
#else // wattcp
if (__lsck_init())
init_tcp_driver = true;
else
CONS_Debug(DBG_NETPLAY, "No TCP/IP driver detected\n");
#endif // libsocket
#endif // __DJGPP__
#ifndef __DJGPP__
init_tcp_driver = true; init_tcp_driver = true;
#endif
} }
if (!tcp_was_up && init_tcp_driver) if (!tcp_was_up && init_tcp_driver)
{ {
@ -1269,10 +1182,8 @@ static void SOCK_CloseSocket(void)
if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET
&& FD_ISSET(mysockets[i], &masterset)) && FD_ISSET(mysockets[i], &masterset))
{ {
#if !defined (__DJGPP__) || defined (WATTCP)
FD_CLR(mysockets[i], &masterset); FD_CLR(mysockets[i], &masterset);
close(mysockets[i]); close(mysockets[i]);
#endif
} }
mysockets[i] = ERRSOCKET; mysockets[i] = ERRSOCKET;
} }
@ -1287,14 +1198,6 @@ void I_ShutdownTcpDriver(void)
WS_addrinfocleanup(); WS_addrinfocleanup();
WSACleanup(); WSACleanup();
#endif #endif
#ifdef __DJGPP__
#ifdef WATTCP // wattcp
//_outch = NULL;
sock_exit();
#else
__lsck_uninit();
#endif // libsocket
#endif // __DJGPP__
CONS_Printf("shut down\n"); CONS_Printf("shut down\n");
init_tcp_driver = false; init_tcp_driver = false;
} }

View file

@ -4581,16 +4581,8 @@ void M_VideoModeMenu(INT32 choice)
optionsmenu.vidm_selected = 0; optionsmenu.vidm_selected = 0;
nummodes = VID_NumModes(); nummodes = VID_NumModes();
#ifdef _WINDOWS
// clean that later: skip windowed mode 0, video modes menu only shows FULL SCREEN modes
if (nummodes <= NUMSPECIALMODES)
i = 0; // unless we have nothing
else
i = NUMSPECIALMODES;
#else
// DOS does not skip mode 0, because mode 0 is ALWAYS present // DOS does not skip mode 0, because mode 0 is ALWAYS present
i = 0; i = 0;
#endif
for (; i < nummodes && optionsmenu.vidm_nummodes < MAXMODEDESCS; i++) for (; i < nummodes && optionsmenu.vidm_nummodes < MAXMODEDESCS; i++)
{ {
desc = VID_GetModeName(i); desc = VID_GetModeName(i);

View file

@ -77,7 +77,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FloatToFixed(float f)
value [eax] \ value [eax] \
modify exact [eax edx] modify exact [eax edx]
#elif defined (__GNUC__) && defined (__i386__) && !defined (NOASM) #elif defined (__GNUC__) && defined (__i386__) && !defined (NOASM)
// DJGPP, i386 linux, cygwin or mingw // i386 linux, cygwin or mingw
FUNCMATH FUNCINLINE static inline fixed_t FixedMul(fixed_t a, fixed_t b) // asm FUNCMATH FUNCINLINE static inline fixed_t FixedMul(fixed_t a, fixed_t b) // asm
{ {
fixed_t ret; fixed_t ret;

View file

@ -72,8 +72,6 @@ typedef off_t off64_t;
#else #else
#define PRIdS "u" #define PRIdS "u"
#endif #endif
#elif defined (DJGPP)
#define PRIdS "u"
#else #else
#define PRIdS "zu" #define PRIdS "zu"
#endif #endif
@ -930,8 +928,6 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
char interfacetxt[] = char interfacetxt[] =
#ifdef HAVE_SDL #ifdef HAVE_SDL
"SDL"; "SDL";
#elif defined (_WINDOWS)
"DirectX";
#else #else
"Unknown"; "Unknown";
#endif #endif

View file

@ -62,15 +62,7 @@ static lumpnum_t S_GetMusicLumpNum(const char *mname);
static boolean S_CheckQueue(void); static boolean S_CheckQueue(void);
#if defined (_WINDOWS) && !defined (SURROUND) //&& defined (_X86_)
#define SURROUND
#endif
#ifdef _WINDOWS
consvar_t cv_samplerate = CVAR_INIT ("samplerate", "44100", 0, CV_Unsigned, NULL); //Alam: For easy hacking?
#else
consvar_t cv_samplerate = CVAR_INIT ("samplerate", "22050", 0, CV_Unsigned, NULL); //Alam: For easy hacking? consvar_t cv_samplerate = CVAR_INIT ("samplerate", "22050", 0, CV_Unsigned, NULL); //Alam: For easy hacking?
#endif
// stereo reverse // stereo reverse
consvar_t stereoreverse = CVAR_INIT ("stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL); consvar_t stereoreverse = CVAR_INIT ("stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL);
@ -996,11 +988,9 @@ void S_SetSfxVolume(INT32 volume)
void S_ClearSfx(void) void S_ClearSfx(void)
{ {
#ifndef DJGPPDOS
size_t i; size_t i;
for (i = 1; i < NUMSFX; i++) for (i = 1; i < NUMSFX; i++)
I_FreeSfx(S_sfx + i); I_FreeSfx(S_sfx + i);
#endif
} }
static void S_StopChannel(INT32 cnum) static void S_StopChannel(INT32 cnum)