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\
HAIKU\
DUMMY\
DJGPPDOS\
SOLARIS\
MACOSX\

View file

@ -35,10 +35,6 @@
#include "filesrch.h"
#include "m_misc.h"
#ifdef _WINDOWS
#include "win32/win_main.h"
#endif
#ifdef HWRENDER
#include "hardware/hw_main.h"
#endif
@ -1550,13 +1546,6 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...)
//
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(M_GetText("Press ENTER to continue\n"));

View file

@ -85,10 +85,6 @@
#include "hardware/hw_main.h" // 3D View Rendering
#endif
#ifdef _WINDOWS
#include "win32/win_main.h" // I_DoStartupMouse
#endif
#ifdef HW3SOUND
#include "hardware/hw3sound.h"
#endif
@ -714,11 +710,6 @@ void D_SRB2Loop(void)
// 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);
oldentertics = I_GetTime();
@ -1258,9 +1249,7 @@ void D_SRB2Main(void)
#endif
// for dedicated server
#if !defined (_WINDOWS) //already check in win_main.c
dedicated = M_CheckParm("-dedicated") != 0;
#endif
if (devparm)
CONS_Printf(M_GetText("Development mode ON.\n"));

View file

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

View file

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

View file

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

View file

@ -54,17 +54,6 @@ typedef long ssize_t;
#define PDWORD_PTR PDWORD
#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
#define __STDC_LIMIT_MACROS
#include <stdint.h>

View file

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

View file

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

View file

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

View file

@ -100,15 +100,6 @@
#endif
#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
{
struct sockaddr any;
@ -142,7 +133,7 @@ typedef union
#include "doomstat.h"
// win32 or djgpp
#if defined (USE_WINSOCK) || defined (__DJGPP__)
#ifdef USE_WINSOCK
// winsock stuff (in winsock a socket is not a file)
#define ioctl ioctlsocket
#define close closesocket
@ -150,15 +141,7 @@ typedef union
#include "i_addrinfo.h"
#ifdef __DJGPP__
#ifdef WATTCP
#define SELECTTEST
#endif
#else
#define SELECTTEST
#endif
#define DEFAULTPORT "5029"
@ -174,8 +157,8 @@ typedef union
#define ERRSOCKET (-1)
#endif
// define socklen_t in DOS/Windows if it is not already defined
#if (defined (WATTCP) && !defined (__libsocket_socklen_t)) || defined (USE_WINSOCK1)
// define socklen_t in Windows if it is not already defined
#ifdef USE_WINSOCK1
typedef int socklen_t;
#endif
@ -208,18 +191,6 @@ static boolean init_tcp_driver = false;
static const char *serverport_name = DEFAULTPORT;
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
// stupid microsoft makes things complicated
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;
socklen_t opts;
#ifdef FIONBIO
#ifdef WATTCP
char trueval = true;
#else
unsigned long trueval = true;
#endif
#endif
mysockaddr_t straddr;
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 System Status: %s\n",WSAData.szSystemStatus);
#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;
#endif
}
if (!tcp_was_up && init_tcp_driver)
{
@ -1269,10 +1182,8 @@ static void SOCK_CloseSocket(void)
if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET
&& FD_ISSET(mysockets[i], &masterset))
{
#if !defined (__DJGPP__) || defined (WATTCP)
FD_CLR(mysockets[i], &masterset);
close(mysockets[i]);
#endif
}
mysockets[i] = ERRSOCKET;
}
@ -1287,14 +1198,6 @@ void I_ShutdownTcpDriver(void)
WS_addrinfocleanup();
WSACleanup();
#endif
#ifdef __DJGPP__
#ifdef WATTCP // wattcp
//_outch = NULL;
sock_exit();
#else
__lsck_uninit();
#endif // libsocket
#endif // __DJGPP__
CONS_Printf("shut down\n");
init_tcp_driver = false;
}

View file

@ -4581,16 +4581,8 @@ void M_VideoModeMenu(INT32 choice)
optionsmenu.vidm_selected = 0;
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
i = 0;
#endif
for (; i < nummodes && optionsmenu.vidm_nummodes < MAXMODEDESCS; i++)
{
desc = VID_GetModeName(i);

View file

@ -77,7 +77,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FloatToFixed(float f)
value [eax] \
modify exact [eax edx]
#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
{
fixed_t ret;

View file

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

View file

@ -62,15 +62,7 @@ static lumpnum_t S_GetMusicLumpNum(const char *mname);
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?
#endif
// stereo reverse
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)
{
#ifndef DJGPPDOS
size_t i;
for (i = 1; i < NUMSFX; i++)
I_FreeSfx(S_sfx + i);
#endif
}
static void S_StopChannel(INT32 cnum)