diff --git a/Makefile b/Makefile index 7fd2218..163cf3e 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ MSBUILD := MSBuild.exe DEFINES := -DDR_MULTIPLAYER -DIPXNET -DDR_LETTERBOX #-DDR_CDCHECK INCLUDES := -I/usr/include/SDL2 + FLAGS ?= -O3 FLAGS += -Werror -Wno-unused-result LDFLAGS := -lm -lSDL2 -lSDL2_net diff --git a/README.md b/README.md index 7e19555..db08632 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,16 @@ The main goal of this project is to create a port of Death Rally (1996) running ```sh FLAGS="YOUR CFLAGS" make ``` +i.g. for x86_64 non-cross compile + +```sh +FLAGS="-march=native -mfpmath=sse -ftree-vectorize -fopenmp-simd -O3" make +``` #### Installation - needs original game assets -* [Death Rally registered free windows version CHIP](https://www.chip.de/downloads/Death-Rally-Vollversion_38550689.html) +* [Death Rally (Classic) - Steam](https://steamcommunity.com/app/358270) +* [Death Rally (Classic) - CHIP](https://www.chip.de/downloads/Death-Rally-Vollversion_38550689.html) ```sh 7z e -o drally DeathRallyWin_10.exe @@ -44,4 +50,6 @@ Only versions including the DR.IDF file are able to use the `FLAGS += -DDR_CDCHE [1] CDROM.INI contains relative location of CINEM directory (./CINEM) #### Work in progress -* Multiplayer not available + +- Multiplayer not available +- HAF cinematic playing diff --git a/db_ipx.c b/db_ipx.c index 3cc6731..2f67a36 100644 --- a/db_ipx.c +++ b/db_ipx.c @@ -12,10 +12,6 @@ #define CONVIPX(hostvar) hostvar[0], hostvar[1], hostvar[2], hostvar[3], hostvar[4], hostvar[5] -typedef int bool; -#define true 1 -#define false 0 - typedef unsigned char Bit8u; typedef signed short Bit16s; typedef unsigned short Bit16u; @@ -29,7 +25,7 @@ typedef unsigned int Bitu; typedef struct ECBClass { RealPt ECBAddr; - bool isInESRList; + boolean_enum_t isInESRList; struct ECBClass * prevECB; // Linked List struct ECBClass * nextECB; @@ -46,9 +42,9 @@ typedef struct packetBuffer { Bit8u buffer[1024]; Bit16s packetSize; // Packet size remaining in read Bit16s packetRead; // Bytes read of total packet - bool inPacket; // In packet reception flag - bool connected; // Connected flag - bool waitsize; + boolean_enum_t inPacket; // In packet reception flag + boolean_enum_t connected; // Connected flag + boolean_enum_t waitsize; } packetBuffer; #pragma pack(push,1) @@ -87,8 +83,8 @@ int SDLNetInited = 0; int IPX_ClientLoopRunning = 0; Bit32u udpPort; -bool isIpxServer; -bool isIpxConnected; +boolean_enum_t isIpxServer; +boolean_enum_t isIpxConnected; IPaddress ipxServConnIp; // IPAddress for client connection to server UDPsocket ipxClientSocket; int UDPChannel; // Channel used by UDP connection @@ -128,7 +124,7 @@ Bit8u getInUseFlag(ECBClass *); void setInUseFlag(ECBClass *, Bit8u flagval); void setCompletionFlag(ECBClass *, Bit8u flagval); Bit16u getFragCount(ECBClass *); -bool writeData(ECBClass *); +boolean_enum_t writeData(ECBClass *); void writeDataBuffer(ECBClass *, Bit8u* buffer, Bit16u length); void getFragDesc(ECBClass *, Bit16u descNum, IPX_Fragment * fragDesc); RealPt getESRAddr(ECBClass *); @@ -176,7 +172,7 @@ void writeDataBuffer(ECBClass * this, Bit8u* buffer, Bit16u length){ this->buflen=length; } -bool writeData(ECBClass * this){ +boolean_enum_t writeData(ECBClass * this){ Bitu length=this->buflen; Bit8u* buffer = this->databuffer; @@ -359,7 +355,7 @@ void del_ECBClass(ECBClass * this) { -static bool sockInUse(Bit16u sockNum) { +static boolean_enum_t sockInUse(Bit16u sockNum) { for(Bitu i=0;i #include #include +#define __USE_POSIX 1 #include #include #include diff --git a/types.h b/types.h index 81051ac..7198278 100644 --- a/types.h +++ b/types.h @@ -44,7 +44,6 @@ typedef __BYTE__ * __POINTER__; #endif */ -//#include #include #include @@ -62,4 +61,11 @@ typedef int32_t __BOOL__; typedef uintptr_t __UNSIGNED__; // size_t typedef intptr_t __SIGNED__; // ptrdiff_t +typedef enum +{ + DR_FALSE = (const int)0, + DR_TRUE = (const int)1, + DR_BOOLEAN_ENUM_FORCE_SIZE = (const int)0x7fffffff +} boolean_enum_t; + #endif // __TYPES_H