Skip to content
Closed
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 data/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ freeCamera=1 # Press F7 in game to enable
fastLoadingScreens=1
widescreenOverlays=1 # set 1 to see map, bars and stats aligned to screen corners
driver1music=0 # put Driver 1's MUSIC.BIN as D1MUSIC.BIN to DRIVER2\SOUND folder
amberTurnSignals=0
overrideContent=0 # this enables texture and car model modding
userChases=RacingFreak,Snoopi,Olanov,Vortex,Fireboyd78
4 changes: 2 additions & 2 deletions src_rebuild/Game/ASM/asmtest.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef ASMTEST_H
#define ASMTEST_H

extern void Asm_PlotSprite() ; // 0x0001BEE4
extern void Asm_PlotSprite(); // 0x0001BEE4

#endif
#endif // ASMTEST_H
2 changes: 1 addition & 1 deletion src_rebuild/Game/ASM/compres.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ char* decomp_asm(char* dest, char* src)
} while (ptr >= dest);

return src;
}
}
2 changes: 1 addition & 1 deletion src_rebuild/Game/ASM/compres.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

extern char* decomp_asm(char* dest, char* src); // 0x0002D298

#endif
#endif // COMPRES_H
27 changes: 14 additions & 13 deletions src_rebuild/Game/ASM/d2mapasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ sdPlane* sdGetCell_alpha16(VECTOR* pos)

// Alpha 1.6 code, works too; not widely tested yet
//buffer = *(short**)((int)RoadMapDataRegions + (cellPos.x >> 14 & 4 ^ cellPos.y >> 13 & 8 ^ sdSelfModifyingCode));

plane = NULL;

if (*buffer == 2)
Expand Down Expand Up @@ -169,31 +169,31 @@ int RoadInCell_alpha16(VECTOR *pos)
{
int cellPos_x;
int cellPos_z;

short* check;

sdPlane* plane;
short* buffer;
bool moreLevels;

cellPos_x = pos->vx - 512;
cellPos_z = pos->vz - 512;

buffer = RoadMapDataRegions[(cellPos_x >> 16 & 1U) ^ (regions_across / 2 & 1) +
(cellPos_z >> 15 & 2U) ^ (regions_down & 2)];
if (*buffer == 2)

if (*buffer == 2)
{
sdPlane* planeData = (sdPlane*)((char*)buffer + buffer[1]);
short* bspData = (short*)((char*)buffer + buffer[2]);
sdNode* nodeData = (sdNode*)((char*)buffer + buffer[3]);
check = &buffer[(cellPos_x >> 10 & 0x3fU) +

check = &buffer[(cellPos_x >> 10 & 0x3fU) +
(cellPos_z >> 10 & 0x3fU) * MAP_REGION_SIZE * 2 + 4];

if (*check == -1)
return -1;

if (*check & 0xE000)
{
if (*check & 0x2000)
Expand Down Expand Up @@ -244,19 +244,20 @@ int RoadInCell_alpha16(VECTOR *pos)
plane = NULL;
}
}
else
else
{
plane = &planeData[*check];
}

if (plane == NULL)
return -1;

if (plane->surface >= 32)
if (plane->surface >= 32)
{
pos->vy = sdHeightOnPlane(pos, plane) + 256;
return plane->surface - 32;
}
}

return -1;
}
}
2 changes: 1 addition & 1 deletion src_rebuild/Game/ASM/d2mapasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ extern sdPlane* sdGetCell_asm(int param_2, short** roadMapData, int pos_x, int p
extern sdPlane* sdGetCell_alpha16(VECTOR* pos);
extern int RoadInCell_alpha16(VECTOR* pos);

#endif
#endif // D2MAPASM_H
2 changes: 1 addition & 1 deletion src_rebuild/Game/ASM/rnc_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ void UnpackRNC(char* src, char* dest)
RNCunpack2((unsigned char*)src + RNC_HEADER_LENGTH, hdr->packSize, (unsigned char*)dest, hdr->unpackSize);
else
printError("UnpackRNC error - unsupported method %d\n", method);
}
}
2 changes: 1 addition & 1 deletion src_rebuild/Game/ASM/rnc_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

extern void UnpackRNC(char* src, char* dest) ; // 0x0001B434

#endif
#endif // RNC_2_H
4 changes: 2 additions & 2 deletions src_rebuild/Game/ASM/rndrasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int FrustrumCheck16(PACKED_CELL_OBJECT* pcop, int bounding_sphere)

ang = FRUSTUM_THRESHOLD - bounding_sphere;

if (ang <= result.vx && ang <= result.vy && ang <= result.vz)
if (ang <= result.vx && ang <= result.vy && ang <= result.vz)
{
return 0;
}
Expand All @@ -130,7 +130,7 @@ int FrustrumCheck(VECTOR* pos, int bounding_sphere)

ang = FRUSTUM_THRESHOLD - bounding_sphere;

if (ang <= result.vx && ang <= result.vy && ang <= result.vz)
if (ang <= result.vx && ang <= result.vy && ang <= result.vz)
{
return 0;
}
Expand Down
5 changes: 1 addition & 4 deletions src_rebuild/Game/ASM/rndrasm.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef RNDRASM_H
#define RNDRASM_H


extern void SetCameraVector(); // 0x0001BCD4

extern void Apply_Inv_CameraMatrix(VECTOR* v); // 0x0001BCFC
Expand All @@ -12,6 +11,4 @@ extern int FrustrumCheck16(PACKED_CELL_OBJECT* pcop, int bounding_sphere); // 0x

extern int FrustrumCheck(VECTOR* pos, int bounding_sphere); // 0x0001BDEC



#endif
#endif // RNDRASM_H
57 changes: 25 additions & 32 deletions src_rebuild/Game/C/E3stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ POLYCOORD polycoords[6] =
{ 512, 256, 896, 256, 128, 256 }
};


// [D] [T]
void ShowHiresScreens(char **names, int delay, int wait)
{
Expand Down Expand Up @@ -62,7 +61,7 @@ void ShowHiresScreens(char **names, int delay, int wait)
void FadeInHiresScreen(char *filename)
{
int col;

DISPENV disp;
DRAWENV draw;
SPRT prims[6];
Expand Down Expand Up @@ -93,7 +92,7 @@ void FadeInHiresScreen(char *filename)
prim = prims;

// prepare polygons
for(int i = 0; i < 6; i++)
for (int i = 0; i < 6; i++)
{
// set primitive
setSprt(prim);
Expand All @@ -119,9 +118,9 @@ void FadeInHiresScreen(char *filename)
SetupDefDispEnv(&disp, 0, 0, 640, 512);

draw.dfe = 1;

VSync(0);

PutDispEnv(&disp);
PutDrawEnv(&draw);

Expand All @@ -144,17 +143,17 @@ void FadeInHiresScreen(char *filename)
PutDispEnv(&disp);
PutDrawEnv(&draw);
ClearOTagR((u_long*)&ot, 1);

poly = nulls;
prim = prims;

for (int i = 0; i < 6; i++)
{
if (col < 129)
if (col < 129)
{
setRGB0(prim, col, col, col);
}
else
else
{
setRGB0(prim, 128, 128, 128);
}
Expand Down Expand Up @@ -214,7 +213,7 @@ void ShowBonusGallery()
prim = prims;

// prepare polygons
for(int i = 0; i < 6; i++)
for (int i = 0; i < 6; i++)
{
// set primitive
setSprt(prim);
Expand Down Expand Up @@ -247,13 +246,13 @@ void ShowBonusGallery()
currentImage = 0;

// draw image cycle
while(currentImage <= GALLERY_IMAGES)
while (currentImage <= GALLERY_IMAGES)
{
if(currentImage == 0)
if (currentImage == 0)
sprintf(filename, "GFX\\GAL\\INTRO.TIM");
else
sprintf(filename, "GFX\\GAL\\IMG%d.TIM", currentImage-1);

LoadfileSeg(filename, (char*)_other_buffer, 20, 0x4ff80);
LoadClut((u_long*)_other_buffer, 640, 511);

Expand Down Expand Up @@ -301,7 +300,7 @@ void ShowBonusGallery()
emscripten_sleep(0);
#endif

if(Pads[0].dirnew & 0x8000)
if (Pads[0].dirnew & 0x8000)
{
currentImage--;
if (currentImage < 0)
Expand All @@ -316,14 +315,14 @@ void ShowBonusGallery()
}
}

if(Pads[0].dirnew & 0x2000)
if (Pads[0].dirnew & 0x2000)
{
FESound(3);
currentImage++;
break;
}

if(Pads[0].dirnew & 0x10)
if (Pads[0].dirnew & 0x10)
{
FESound(0);
currentImage = GALLERY_IMAGES+1; // quit
Expand Down Expand Up @@ -383,7 +382,7 @@ void FadeOutHiresScreen(void)
SetupDefDispEnv(&disp, 0, 0, 640, 512);
draw.dfe = 1;

VSync(0);
VSync(0);
PutDispEnv(&disp);
PutDrawEnv(&draw);

Expand Down Expand Up @@ -441,7 +440,7 @@ void SetupDefDrawEnv(DRAWENV *env, int x, int y, int w, int h)
// [D] [T]
void SetupDefDispEnv(DISPENV *env, int x, int y, int w, int h)
{
if (h < 257)
if (h < 257)
{
SetDefDispEnv(env, x, y, w, 256);

Expand Down Expand Up @@ -476,8 +475,8 @@ void SetPleaseWait(char *buffer)
DrawSync(0);
VSync(0);
SetDispMask(0);
SetupDefDrawEnv(&draw,0,0,320,256);
SetupDefDispEnv(&disp,0,0, 320, 256);
SetupDefDrawEnv(&draw, 0, 0, 320, 256);
SetupDefDispEnv(&disp, 0, 0, 320, 256);

draw.dfe = 1;

Expand All @@ -496,7 +495,7 @@ void SetPleaseWait(char *buffer)
rect.w = 320;
rect.h = 512;

ClearImage(&rect,0,0,0);
ClearImage(&rect, 0, 0, 0);
DrawSync(0);

#ifndef PSX
Expand All @@ -506,11 +505,10 @@ void SetPleaseWait(char *buffer)

gShowMap = 1;
SetTextColour(128, 128, 128);
PrintStringCentred(G_LTXT(GTXT_PleaseWait),128);
PrintStringCentred(G_LTXT(GTXT_PleaseWait), 128);
gShowMap = 0;

VSync(0);


#ifdef PSX
if (lastrequesteddisc == 0)
Expand All @@ -524,7 +522,7 @@ void SetPleaseWait(char *buffer)
#else
PsyX_EndScene();
#endif // PSX

}

// [D] [T]
Expand All @@ -541,7 +539,7 @@ void CheckForCorrectDisc(int disc)

discerror = 0;

if (lastrequesteddisc != disc)
if (lastrequesteddisc != disc)
{
lastrequesteddisc = disc;
ResetCityType();
Expand All @@ -552,7 +550,7 @@ void CheckForCorrectDisc(int disc)
mess = G_LTXT(GTXT_PleaseinsertDISC1);
exe = ".\\SLES_029.96;1";
}
else
else
{
mess = G_LTXT(GTXT_PleaseinsertDISC2);
exe = ".\\SLES_129.96;1";
Expand Down Expand Up @@ -589,7 +587,7 @@ void CheckForCorrectDisc(int disc)

ret = DiscSwapped(exe);

switch (ret)
switch (ret)
{
case CDTYPE_NODISC:
discerror = 0;
Expand Down Expand Up @@ -620,7 +618,7 @@ void CheckForCorrectDisc(int disc)
rect.x = 0;
rect.w = 320;
rect.h = 60;

ClearImage(&rect, 0, 0, 0);
DrawSync(0);
gShowMap = 1;
Expand All @@ -645,8 +643,3 @@ void CheckForCorrectDisc(int disc)
ClearImage(&rect, 0, 0, 0);
DrawSync(0);
}





2 changes: 1 addition & 1 deletion src_rebuild/Game/C/E3stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ extern void CheckForCorrectDisc(int disc); // 0x00044A40

extern void ShowBonusGallery();

#endif
#endif // E3STUFF_H
Loading