Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
30 changes: 13 additions & 17 deletions db_ipx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 *);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<socketCount;i++) {
if (opensockets[i] == sockNum) return true;
}
Expand Down Expand Up @@ -622,7 +618,7 @@ static void IPX_ClientLoop(void) {
}


void DisconnectFromServer(bool unexpected) {
void DisconnectFromServer(boolean_enum_t unexpected) {
if(unexpected) printf("IPX: Server disconnected unexpectedly\n");
if(incomingPacket.connected) {
incomingPacket.connected = false;
Expand Down Expand Up @@ -702,8 +698,8 @@ static void sendPacket(ECBClass* sendecb) {
// filter out broadcasts and local loopbacks
// Real implementation uses the ImmedAddr to check wether this is a broadcast

bool islocalbroadcast=true;
bool isloopback=true;
boolean_enum_t islocalbroadcast=true;
boolean_enum_t isloopback=true;

Bit8u * addrptr;

Expand Down Expand Up @@ -772,7 +768,7 @@ int IPX_ThreadFunction(__POINTER__ data){
}


bool ConnectToServer(char const *strAddr) {
boolean_enum_t ConnectToServer(char const *strAddr) {

int numsent;
UDPpacket regPacket;
Expand Down
1 change: 1 addition & 0 deletions drally.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define __USE_POSIX 1
#include <time.h>
#include <ctype.h>
#include <SDL2/SDL.h>
Expand Down
8 changes: 7 additions & 1 deletion types.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ typedef __BYTE__ * __POINTER__;
#endif
*/

//#include <stddef.h>
#include <stdio.h>
#include <stdint.h>

Expand All @@ -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