diff --git a/src_rebuild/Game/C/E3stuff.c b/src_rebuild/Game/C/E3stuff.c index 99814055..93d43913 100644 --- a/src_rebuild/Game/C/E3stuff.c +++ b/src_rebuild/Game/C/E3stuff.c @@ -130,7 +130,7 @@ void FadeInHiresScreen(char *filename) PutDispEnv(&disp); PutDrawEnv(&draw); - LoadfileSeg(filename, _overlay_buffer, 20, 0x4ff80); + LoadfileSeg(filename, (char*)_overlay_buffer, 20, 0x4ff80); LoadClut((u_long*)_overlay_buffer, 640, 511); DrawSync(0); @@ -259,7 +259,7 @@ void ShowBonusGallery() else sprintf(filename, "GFX\\GAL\\IMG%d.TIM", currentImage-1); - LoadfileSeg(filename, _other_buffer, 20, 0x4ff80); + LoadfileSeg(filename, (char*)_other_buffer, 20, 0x4ff80); LoadClut((u_long*)_other_buffer, 640, 511); DrawSync(0); diff --git a/src_rebuild/Game/C/ai.c b/src_rebuild/Game/C/ai.c index 035a0600..36dca672 100644 --- a/src_rebuild/Game/C/ai.c +++ b/src_rebuild/Game/C/ai.c @@ -42,7 +42,7 @@ int TannerCanEnterCar(CAR_DATA *cp, int distToCarSq) return 0; } -// [D] +// [D] [T] int TannerStuckInCar(int doSpeedCheck, int player_id) { short *playerFelony; diff --git a/src_rebuild/Game/C/cars.c b/src_rebuild/Game/C/cars.c index 2865fd6a..cd703a11 100644 --- a/src_rebuild/Game/C/cars.c +++ b/src_rebuild/Game/C/cars.c @@ -1159,7 +1159,7 @@ void MangleWheelModels(void) } } -// [D] +// [D] [T] void ProcessPalletLump(char *lump_ptr, int lump_size) { ushort clutValue; diff --git a/src_rebuild/Game/C/cosmetic.c b/src_rebuild/Game/C/cosmetic.c index e2fd3a9e..3cc7d87f 100644 --- a/src_rebuild/Game/C/cosmetic.c +++ b/src_rebuild/Game/C/cosmetic.c @@ -65,8 +65,8 @@ void ProcessCosmeticsLump(char *lump_ptr, int lump_size) // [D] [T] void LoadCosmetics(int level) { - LoadfileSeg(CosmeticFiles[level], _other_buffer, 0, 3120); - ProcessCosmeticsLump(_other_buffer, 0); + LoadfileSeg(CosmeticFiles[level], (char*)_other_buffer, 0, 3120); + ProcessCosmeticsLump((char*)_other_buffer, 0); } #define REVERSELIGHT_SIZE 14 @@ -117,10 +117,10 @@ void SetupSpecCosmetics(char *loadbuffer) // [A] always load cosmetics from file // fixes limo cosmetics as well - LoadfileSeg(CosmeticFiles[GameLevel], _other_buffer, 0, 3120); + LoadfileSeg(CosmeticFiles[GameLevel], (char*)_other_buffer, 0, 3120); offset = *(int*)(_other_buffer + model * sizeof(int)); - memcpy((char*)&car_cosmetics[4], _other_buffer + offset, sizeof(CAR_COSMETICS)); + memcpy((char*)&car_cosmetics[4], (char*)_other_buffer + offset, sizeof(CAR_COSMETICS)); #else memcpy((char*)&car_cosmetics[4], loadbuffer, sizeof(CAR_COSMETICS)); #endif diff --git a/src_rebuild/Game/C/cutscene.c b/src_rebuild/Game/C/cutscene.c index 279265a0..86b894f4 100644 --- a/src_rebuild/Game/C/cutscene.c +++ b/src_rebuild/Game/C/cutscene.c @@ -971,7 +971,7 @@ int LoadCutsceneToBuffer(int subindex) leadAILoaded = 0; pathAILoaded = 0; - CutsceneBuffer.currentPointer = _other_buffer2; + CutsceneBuffer.currentPointer = (char*)_other_buffer2; CutsceneBuffer.bytesFree = 0xC000; } @@ -1065,7 +1065,7 @@ void FreeCutsceneBuffer(void) ClearMem(CutsceneBuffer.buffer, sizeof(CutsceneBuffer.buffer)); #ifndef PSX - gCustomCutsceneBuffer = _other_buffer2; + gCustomCutsceneBuffer = (char*)_other_buffer2; #endif } diff --git a/src_rebuild/Game/C/denting.c b/src_rebuild/Game/C/denting.c index c7109610..981220ef 100644 --- a/src_rebuild/Game/C/denting.c +++ b/src_rebuild/Game/C/denting.c @@ -430,7 +430,7 @@ char* LoadCarDentingFromFile(char* dest, int modelNumber) sprintf(filename, "LEVELS\\%s\\CARMODEL_%d.DEN", LevelNames[GameLevel], modelNumber); if(FileExists(filename)) { - mem = dest ? dest : (_other_buffer + modelNumber * 0x1000); + mem = dest ? dest : ((char*)_other_buffer + modelNumber * 4096); // get model from file Loadfile(filename, mem); @@ -510,8 +510,8 @@ void SetupSpecDenting(char *loadbuffer) // [D] [T] void LoadDenting(int level) { - LoadfileSeg(DentingFiles[level], _other_buffer, 0, 12727); - ProcessDentLump(_other_buffer, 0); + LoadfileSeg(DentingFiles[level], (char*)_other_buffer, 0, 12727); + ProcessDentLump((char*)_other_buffer, 0); } diff --git a/src_rebuild/Game/C/drivinggames.c b/src_rebuild/Game/C/drivinggames.c index 75d67681..cb652aa0 100644 --- a/src_rebuild/Game/C/drivinggames.c +++ b/src_rebuild/Game/C/drivinggames.c @@ -171,7 +171,7 @@ void SetSmashedCone(int cone, VECTOR *velocity, int player, int side) } -// [D] +// [D] [T] void MoveSmashedCones(void) { TRAILBLAZER_DATA *tbd; diff --git a/src_rebuild/Game/C/felony.c b/src_rebuild/Game/C/felony.c index 6df89cc0..78d9045b 100644 --- a/src_rebuild/Game/C/felony.c +++ b/src_rebuild/Game/C/felony.c @@ -87,7 +87,7 @@ char GetCarDirectionOfTravel(CAR_DATA *cp) return direction; } -// [D] +// [D] [T] void NoteFelony(FELONY_DATA *pFelonyData, char type, short scale) { int felonyTooLowForRoadblocks; diff --git a/src_rebuild/Game/C/gamesnd.c b/src_rebuild/Game/C/gamesnd.c index 8c31ac65..037c25b1 100644 --- a/src_rebuild/Game/C/gamesnd.c +++ b/src_rebuild/Game/C/gamesnd.c @@ -890,7 +890,7 @@ void ControlSpeech(SPEECH_QUEUE* pSpeechQueue) } } -// [D] +// [D] [T] void CopSay(int phrase, int direction) { if (!gDoCopSpeech) @@ -2243,7 +2243,7 @@ void IdentifyZone(envsound* ep, envsoundinfo* E, int pl) } -// [D] [A] unprocessed arrays +// [D] [T] void CalcEffPos(envsound* ep, envsoundinfo* E, int pl) { int minX, maxX; @@ -2331,7 +2331,7 @@ void CalcEffPos(envsound* ep, envsoundinfo* E, int pl) } } -// [D] [A] unprocessed arrays +// [D] [T] void CalcEffPos2(envsound* ep, envsoundinfo* E, int pl) { int snd; diff --git a/src_rebuild/Game/C/loadsave.c b/src_rebuild/Game/C/loadsave.c index 83a1de34..24a13b61 100644 --- a/src_rebuild/Game/C/loadsave.c +++ b/src_rebuild/Game/C/loadsave.c @@ -127,13 +127,13 @@ void LoadCurrentProfile() fileSize = ftell(fp); fseek(fp, 0, SEEK_SET); - fread(_other_buffer, 1, fileSize, fp); + fread((char*)_other_buffer, 1, fileSize, fp); fclose(fp); if (fileSize <= CalcConfigDataSize()) { - LoadConfigData(_other_buffer); + LoadConfigData((char*)_other_buffer); error = 0; } } @@ -171,7 +171,7 @@ void SaveCurrentProfile() ShowSavingWaitMessage(G_LTXT(GTXT_SavingConfiguration), 0); dataSize = 0; - if (SaveConfigData(_other_buffer)) + if (SaveConfigData((char*)_other_buffer)) dataSize = CalcConfigDataSize(); error = 1; @@ -180,7 +180,7 @@ void SaveCurrentProfile() FILE* fp = fopen(filePath, "wb"); if (fp) { - fwrite(_other_buffer, 1, dataSize, fp); + fwrite((char*)_other_buffer, 1, dataSize, fp); fclose(fp); error = 0; @@ -218,13 +218,13 @@ int LoadCurrentGame() fileSize = ftell(fp); fseek(fp, 0, SEEK_SET); - fread(_other_buffer, 1, fileSize, fp); + fread((char*)_other_buffer, 1, fileSize, fp); fclose(fp); if (fileSize <= CalcGameDataSize()) { - LoadGameData(_other_buffer); + LoadGameData((char*)_other_buffer); return 1; } } @@ -246,14 +246,14 @@ void SaveCurrentGame() ShowSavingWaitMessage(G_LTXT(GTXT_SavingProgress), 0); dataSize = 0; - if (SaveGameData(_other_buffer)) + if (SaveGameData((char*)_other_buffer)) dataSize = CalcGameDataSize(); // load config FILE* fp = fopen(filePath, "wb"); if (fp) { - fwrite(_other_buffer, 1, dataSize, fp); + fwrite((char*)_other_buffer, 1, dataSize, fp); fclose(fp); } } @@ -270,10 +270,10 @@ int LoadReplayFromFile(char* fileName) replay_size = ftell(fp); fseek(fp, 0, SEEK_SET); - fread(_other_buffer, replay_size, 1, fp); + fread((char*)_other_buffer, replay_size, 1, fp); fclose(fp); - if (LoadReplayFromBuffer(_other_buffer)) + if (LoadReplayFromBuffer((char*)_other_buffer)) { char* sub, *tmp; @@ -310,12 +310,12 @@ int LoadReplayFromFile(char* fileName) int SaveReplayToFile(char* filename) { - int size = SaveReplayToBuffer(_other_buffer); + int size = SaveReplayToBuffer((char*)_other_buffer); FILE* fp = fopen(filename, "wb"); if (fp) { - fwrite(_other_buffer, 1, size, fp); + fwrite((char*)_other_buffer, 1, size, fp); fclose(fp); return 1; } diff --git a/src_rebuild/Game/C/loadview.c b/src_rebuild/Game/C/loadview.c index b945b5bc..cb179922 100644 --- a/src_rebuild/Game/C/loadview.c +++ b/src_rebuild/Game/C/loadview.c @@ -172,7 +172,7 @@ void ShowLoadingScreen(char *screen_name, int effect, int loading_steps) PutDispEnv(&load_disp); PutDrawEnv(&load_draw); - Loadfile(screen_name, _frontend_buffer); + Loadfile(screen_name, (char*)_frontend_buffer); LoadClut((u_long*)&_frontend_buffer[20], 320, 511); DrawSync(0); diff --git a/src_rebuild/Game/C/main.c b/src_rebuild/Game/C/main.c index 33e0dad5..78bb4fa3 100644 --- a/src_rebuild/Game/C/main.c +++ b/src_rebuild/Game/C/main.c @@ -418,13 +418,13 @@ void LoadGameLevel(void) loadsectors(_frontend_buffer, sector, nsectors); #else extern char g_CurrentLevelFileName[64]; - loadsectorsPC(g_CurrentLevelFileName, _frontend_buffer, sector, nsectors); + loadsectorsPC(g_CurrentLevelFileName, (char*)_frontend_buffer, sector, nsectors); #endif // PSX sector += nsectors; // CITYLUMP_DATA1 - load-time lump - ProcessLumps(_frontend_buffer + 8, nsectors * CDSECTOR_SIZE); + ProcessLumps((char*)_frontend_buffer + 8, nsectors * CDSECTOR_SIZE); // CITYLUMP_TPAGE is right next after DATA1 LoadPermanentTPages(§or); @@ -816,7 +816,7 @@ int leadCarId = 0; VECTOR leadcar_pos; -// [D] +// [D] [T] void StepSim(void) { static u_int t0; // offset 0x0 @@ -1697,7 +1697,7 @@ void EndGame(GAMEMODE mode) } -// [D] +// [D] [T] void EnablePause(PAUSEMODE mode) { if (quick_replay == 0 && NoPlayerControl && mode == PAUSEMODE_GAMEOVER) @@ -1999,10 +1999,10 @@ int redriver2_main(int argc, char** argv) replay_size = ftell(fp); fseek(fp, 0, SEEK_SET); - fread(_other_buffer, replay_size, 1, fp); + fread((char*)_other_buffer, replay_size, 1, fp); fclose(fp); - if (LoadReplayFromBuffer(_other_buffer)) + if (LoadReplayFromBuffer((char*)_other_buffer)) { CurrentGameMode = GAMEMODE_REPLAY; gLoadedReplay = 1; diff --git a/src_rebuild/Game/C/mc_snd.c b/src_rebuild/Game/C/mc_snd.c index 658fdb2e..47474071 100644 --- a/src_rebuild/Game/C/mc_snd.c +++ b/src_rebuild/Game/C/mc_snd.c @@ -761,7 +761,7 @@ void SetMSoundVar(intptr_t var, VECTOR* V) bodgevar = var; } -// [D] +// [D] [T] char SilenceThisCar(int car) { if (gInGameCutsceneActive == 0) @@ -926,7 +926,7 @@ char SilenceThisCar(int car) } -// [D] +// [D] [T] void AdjustPlayerCarVolume(void) { if (gInGameCutsceneID != 0) diff --git a/src_rebuild/Game/C/mdraw.c b/src_rebuild/Game/C/mdraw.c index 396b54ea..7a2e35af 100644 --- a/src_rebuild/Game/C/mdraw.c +++ b/src_rebuild/Game/C/mdraw.c @@ -206,7 +206,7 @@ void DrawFullscreenTarget(MS_TARGET *target) DrawTargetArrow(&tv, 4); } -// [D] +// [D] [T] void DrawWorldTarget(MS_TARGET *target) { uint flags; diff --git a/src_rebuild/Game/C/mission.c b/src_rebuild/Game/C/mission.c index cfef1562..8b4264fd 100644 --- a/src_rebuild/Game/C/mission.c +++ b/src_rebuild/Game/C/mission.c @@ -3080,7 +3080,7 @@ void SetMissionOver(PAUSEMODE mode) Mission.ChaseTarget = NULL; } -// [D] +// [D] [T] void ActivateNextFlag(void) { int j; @@ -3128,7 +3128,7 @@ int CalcLapTime(int player, int time, int lap) return time - ptime; } -// [D] +// [D] [T] void MakePhantomCarEqualPlayerCar(void) { // store player car id @@ -3136,7 +3136,7 @@ void MakePhantomCarEqualPlayerCar(void) Mission.PhantomCarId = player[0].playerCarId; } -// [D] +// [D] [T] void SetCarToBeStolen(MS_TARGET *target, int player) { if (target->car.flags & CARTARGET_FLAG_SET_PLAYERCAR) diff --git a/src_rebuild/Game/C/models.c b/src_rebuild/Game/C/models.c index 7a95b5a0..5a480ecb 100644 --- a/src_rebuild/Game/C/models.c +++ b/src_rebuild/Game/C/models.c @@ -196,7 +196,7 @@ int ProcessCarModelLump(char *lump_ptr, int lump_size) gCarLowModelPtr[i] = NULL; if (i == 4) - specmallocptr = mallocptr; + specmallocptr = (char*)mallocptr; model_number = MissionHeader->residentModels[i]; @@ -221,7 +221,7 @@ int ProcessCarModelLump(char *lump_ptr, int lump_size) if (cleanOfs != -1) { D_MALLOC_BEGIN(); - model = GetCarModel(models_offset + cleanOfs, &mallocptr, 1, model_number, CAR_MODEL_CLEAN); + model = GetCarModel(models_offset + cleanOfs, (char**)&mallocptr, 1, model_number, CAR_MODEL_CLEAN); gCarCleanModelPtr[i] = model; D_MALLOC_END(); } @@ -229,7 +229,7 @@ int ProcessCarModelLump(char *lump_ptr, int lump_size) if (damOfs != -1) { D_MALLOC_BEGIN(); - model = GetCarModel(models_offset + damOfs, &mallocptr, 0, model_number, CAR_MODEL_DAMAGED); + model = GetCarModel(models_offset + damOfs, (char**)&mallocptr, 0, model_number, CAR_MODEL_DAMAGED); gCarDamModelPtr[i] = model; D_MALLOC_END(); } @@ -237,7 +237,7 @@ int ProcessCarModelLump(char *lump_ptr, int lump_size) if (lowOfs != -1) { D_MALLOC_BEGIN(); - model = GetCarModel(models_offset + lowOfs, &mallocptr, 1, model_number, CAR_MODEL_LOWDETAIL); + model = GetCarModel(models_offset + lowOfs, (char**)&mallocptr, 1, model_number, CAR_MODEL_LOWDETAIL); gCarLowModelPtr[i] = model; D_MALLOC_END(); } @@ -271,7 +271,7 @@ char* LoadCarModelFromFile(char* dest, int modelNumber, int type) sprintf(filename, "LEVELS\\%s\\CARMODEL_%d_%s.DMODEL", LevelNames[GameLevel], modelNumber, CarModelTypeNames[type-1]); if(FileExists(filename)) { - mem = dest ? dest : (_other_buffer + modelNumber * 0x10000 + (type-1) * 0x4000); + mem = (char*)(dest ? dest : (_other_buffer + modelNumber * 0x10000 + (type-1) * 0x4000)); // get model from file Loadfile(filename, mem); diff --git a/src_rebuild/Game/C/pad.c b/src_rebuild/Game/C/pad.c index 7d5062b6..f8e133ea 100644 --- a/src_rebuild/Game/C/pad.c +++ b/src_rebuild/Game/C/pad.c @@ -232,7 +232,7 @@ void ClearPad(int pad) Pads[pad].mapnew = 0; } -// [D] +// [D] [T] void HandleDualShock(void) { PAD* pPad; @@ -363,7 +363,7 @@ void HandleDualShock(void) } } -// [D] +// [D] [T] void HandlePadVibration(int pad) { int speed; @@ -372,7 +372,7 @@ void HandlePadVibration(int pad) pPad = &Pads[pad]; speed = 0; - if (NoPlayerControl != 0 || gDualShockMax == 0 || gDrawPauseMenus != 0 || (game_over != 0 || gInGameCutsceneActive != 0)) + if (NoPlayerControl || gDualShockMax == 0 || gDrawPauseMenus || (game_over || gInGameCutsceneActive)) { StopPadVibration(pad); return; diff --git a/src_rebuild/Game/C/pause.c b/src_rebuild/Game/C/pause.c index 9f1781c2..59f0bccc 100644 --- a/src_rebuild/Game/C/pause.c +++ b/src_rebuild/Game/C/pause.c @@ -503,7 +503,7 @@ char* WaitForTextEntry(char* textBufPtr, int maxLength) char* username; unsigned short npad, dpad; - username = textBufPtr ? textBufPtr : _overlay_buffer; + username = textBufPtr ? textBufPtr : (char*)_overlay_buffer; delay = 0; toggle = 0; co = 1; diff --git a/src_rebuild/Game/C/pedest.c b/src_rebuild/Game/C/pedest.c index df020309..7cbc660f 100644 --- a/src_rebuild/Game/C/pedest.c +++ b/src_rebuild/Game/C/pedest.c @@ -2287,7 +2287,7 @@ void add_seated(SEATED_PEDESTRIANS* seatedptr, int seat_index) CAR_COLLISION_BOX collision_box[8]; CAR_DATA* collision_car_ptr[8]; -// [D] +// [D] [T] void set_coll_box(int index, CAR_DATA* cp, int offset) { int isPlayerCar; diff --git a/src_rebuild/Game/C/pres.c b/src_rebuild/Game/C/pres.c index 44760710..c9da6d73 100644 --- a/src_rebuild/Game/C/pres.c +++ b/src_rebuild/Game/C/pres.c @@ -109,7 +109,7 @@ int PrintStringRightAligned(char *pString, int x, int y) return PrintString(pString, x - StringWidth(pString), y); } -// [D] [T +// [D] [T] void PrintStringCentred(char *pString, short y) { PrintString(pString, (320 - StringWidth(pString)) / 2, y); @@ -132,7 +132,7 @@ void LoadFont(char *buffer) if (buffer != NULL) file = buffer; else - file = _frontend_buffer; // 0x11b400; // [A] FIXME: this font address might be used somewhere else + file = (char*)_frontend_buffer; // 0x11b400; // [A] FIXME: this font address might be used somewhere else Loadfile("GFX\\FONT2.FNT",file); diff --git a/src_rebuild/Game/C/replays.c b/src_rebuild/Game/C/replays.c index ca04aed2..a0410787 100644 --- a/src_rebuild/Game/C/replays.c +++ b/src_rebuild/Game/C/replays.c @@ -60,7 +60,7 @@ void InitPadRecording(void) { NumReplayStreams = 0; - ReplayStart = _replay_buffer; + ReplayStart = (char*)_replay_buffer; ReplayParameterPtr = (REPLAY_PARAMETER_BLOCK *)ReplayStart; PlayerWayRecordPtr = (SXYPAIR *)(ReplayParameterPtr + 1); @@ -275,9 +275,9 @@ int LoadCutsceneAsReplay(int subindex) printWarning("cutscene size: %d\n", size); - LoadfileSeg(filename, _other_buffer, offset, size); + LoadfileSeg(filename, (char*)_other_buffer, offset, size); - int result = LoadReplayFromBuffer(_other_buffer); + int result = LoadReplayFromBuffer((char*)_other_buffer); return result; } @@ -384,7 +384,7 @@ int LoadReplayFromBuffer(char *buffer) if (header->magic != DRIVER2_REPLAY_MAGIC) return 0; - ReplayStart = replayptr = _replay_buffer; + ReplayStart = replayptr = (char*)_replay_buffer; GameLevel = header->GameLevel; GameType = (GAMETYPE)header->GameType; @@ -512,8 +512,8 @@ int LoadUserAttractReplay(int mission, int userId) if (FileExists(customFilename)) { - if (Loadfile(customFilename, _other_buffer)) - return LoadReplayFromBuffer(_other_buffer); + if (Loadfile(customFilename, (char*)_other_buffer)) + return LoadReplayFromBuffer((char*)_other_buffer); } } @@ -550,10 +550,10 @@ int LoadAttractReplay(int mission) if (!FileExists(filename)) return 0; - if (!Loadfile(filename, _other_buffer)) + if (!Loadfile(filename, (char*)_other_buffer)) return 0; - return LoadReplayFromBuffer(_other_buffer); + return LoadReplayFromBuffer((char*)_other_buffer); } // [D] [T] diff --git a/src_rebuild/Game/C/sky.c b/src_rebuild/Game/C/sky.c index c2cca249..1bd29dfc 100644 --- a/src_rebuild/Game/C/sky.c +++ b/src_rebuild/Game/C/sky.c @@ -278,7 +278,7 @@ void LoadSky(void) } sprintf(name, "DATA\\SKY%d.RAW", skyNum); - LoadfileSeg(name, _frontend_buffer, offset, 0x10000); + LoadfileSeg(name, (char*)_frontend_buffer, offset, 0x10000); rect.x = 320; rect.y = 0; diff --git a/src_rebuild/Game/C/sound.c b/src_rebuild/Game/C/sound.c index 47ce89e5..ca0fe5e4 100644 --- a/src_rebuild/Game/C/sound.c +++ b/src_rebuild/Game/C/sound.c @@ -323,7 +323,7 @@ int CalculateVolume(int channel) int gSurround = 0; -// [D] +// [D] [T] void UpdateVolumeAttributesS(int channel, int proximity) { int volume; @@ -575,7 +575,7 @@ int Start3DTrackingSound(int channel, int bank, int sample, VECTOR *position, LO return channel; } -// [D] +// [D] [T] int Start3DSoundVolPitch(int channel, int bank, int sample, int x, int y, int z, int volume, int pitch) { if (channel < 0) diff --git a/src_rebuild/Game/C/system.c b/src_rebuild/Game/C/system.c index 81bb34bb..a2ff6d5f 100644 --- a/src_rebuild/Game/C/system.c +++ b/src_rebuild/Game/C/system.c @@ -22,28 +22,28 @@ #ifdef PSX -char* _overlay_buffer = 0x801C0000; -char* _frontend_buffer = 0x800FB400; -char* _other_buffer = 0x800F3000; -char* _other_buffer2 = 0x800E7000; -OTTYPE* _OT1 = 0x800F3000; -OTTYPE* _OT2 = 0x800F7200; -char* _primTab1 = 0x800FB400; -char* _primTab2 = 0x80119400; -char* _replay_buffer = 0x801FABBC; +volatile char* _frontend_buffer = 0x800FB400; +volatile char* _other_buffer = 0x800F3000; +volatile char* _other_buffer2 = 0x800E7000; +volatile OTTYPE* _OT1 = 0x800F3000; +volatile OTTYPE* _OT2 = 0x800F7200; +volatile char* _primTab1 = 0x800FB400; +volatile char* _primTab2 = 0x80119400; +volatile char* _overlay_buffer = 0x801C0000; +volatile char* _replay_buffer = 0x801FABBC; #else // Initialized in redriver2_main -char* _overlay_buffer = NULL; // 0x1C0000 -char* _frontend_buffer = NULL; // 0xFB400 -char* _other_buffer = NULL; // 0xF3000 -char* _other_buffer2 = NULL; // 0xE7000 -OTTYPE* _OT1 = NULL; // 0xF3000 -OTTYPE* _OT2 = NULL; // 0xF7200 -char* _primTab1 = NULL; // 0xFB400 -char* _primTab2 = NULL; // 0x119400 -char* _replay_buffer = NULL; // 0x1FABBC +volatile char* _frontend_buffer = NULL; // 0xFB400 +volatile char* _other_buffer = NULL; // 0xF3000 +volatile char* _other_buffer2 = NULL; // 0xE7000 +volatile OTTYPE* _OT1 = NULL; // 0xF3000 +volatile OTTYPE* _OT2 = NULL; // 0xF7200 +volatile char* _primTab1 = NULL; // 0xFB400 +volatile char* _primTab2 = NULL; // 0x119400 +volatile char* _overlay_buffer = NULL; // 0x1C0000 +volatile char* _replay_buffer = NULL; // 0x1FABBC #endif @@ -52,7 +52,7 @@ char gDataFolder[32] = "DRIVER2\\"; #ifdef USE_CRT_MALLOC char* mallocptr = NULL; -const char* malloctab = NULL; +volatile const char* malloctab = NULL; void* g_dynamicAllocs[1024] = { 0 }; int g_numDynamicAllocs = 0; @@ -110,14 +110,14 @@ void sys_tempfree() } #elif defined(PSX) -char* mallocptr; -const char* malloctab = 0x800137400; +volatile char* mallocptr; +volatile const char* malloctab = 0x800137400; #else char g_allocatedMem[0x200000]; // 0x137400 (_ramsize). TODO: use real malloc size: 870332 -char* mallocptr = g_allocatedMem; -const char* malloctab = g_allocatedMem; +volatile char* mallocptr = g_allocatedMem; +volatile const char* malloctab = g_allocatedMem; #endif diff --git a/src_rebuild/Game/C/system.h b/src_rebuild/Game/C/system.h index beb86e00..b941313f 100644 --- a/src_rebuild/Game/C/system.h +++ b/src_rebuild/Game/C/system.h @@ -1,24 +1,24 @@ #ifndef SYSTEM_H #define SYSTEM_H -extern char* _overlay_buffer; // 0x1C0000 -extern char* _frontend_buffer; // 0xFB400 -extern char* _other_buffer; // 0xF3000 -extern char* _other_buffer2; // 0xE7000 +extern volatile char* _overlay_buffer; // 0x1C0000 +extern volatile char* _frontend_buffer; // 0xFB400 +extern volatile char* _other_buffer; // 0xF3000 +extern volatile char* _other_buffer2; // 0xE7000 -extern OTTYPE* _OT1; // 0xF3000 -extern OTTYPE* _OT2; // 0xF7200 +extern volatile OTTYPE* _OT1; // 0xF3000 +extern volatile OTTYPE* _OT2; // 0xF7200 -extern char* _primTab1; // 0xFB400 -extern char* _primTab2; // 0x119400 -extern char* _replay_buffer; // 0x1FABBC +extern volatile char* _primTab1; // 0xFB400 +extern volatile char* _primTab2; // 0x119400 +extern volatile char* _replay_buffer; // 0x1FABBC extern char gDataFolder[32]; #define PSX_MALLOC_SIZE 870332 -extern const char* malloctab; -extern char* mallocptr; +extern volatile const char* malloctab; +extern volatile char* mallocptr; #ifdef USE_CRT_MALLOC @@ -39,14 +39,14 @@ extern void sys_freeall(); #endif #else -#define D_MALLOC(size) mallocptr; mallocptr += (size) -#define D_TEMPALLOC(size) mallocptr +#define D_MALLOC(size) (char*)mallocptr; mallocptr += (size) +#define D_TEMPALLOC(size) (char*)mallocptr #define D_TEMPFREE() #endif #define D_MALLOC_BEGIN() \ { \ - const char* _oldmalloc = mallocptr; + volatile const char* _oldmalloc = mallocptr; #ifdef __GNUC__ #define D_MALLOC_END() \ diff --git a/src_rebuild/Game/C/texture.c b/src_rebuild/Game/C/texture.c index 3d641ff2..af5fed0f 100644 --- a/src_rebuild/Game/C/texture.c +++ b/src_rebuild/Game/C/texture.c @@ -182,7 +182,7 @@ void LoadTPageFromTIMs(int tpage2send) if(!FileExists(filename)) continue; - Loadfile(filename, _other_buffer); + Loadfile(filename, (char*)_other_buffer); // get TIM data timClut = (TIMIMAGEHDR*)(_other_buffer + sizeof(TIMHDR)); @@ -258,7 +258,7 @@ int LoadTPageAndCluts(RECT16 *tpage, RECT16 *cluts, int tpage2send, char *tpagea temptpage.w = tpage->w; temptpage.h = 256; - decomp_asm(_other_buffer, tpageaddress); + decomp_asm((char*)_other_buffer, tpageaddress); LoadImage(&temptpage, (u_long *)_other_buffer); texture_pages[tpage2send] = GetTPage(0, 0, tpage->x, tpage->y); @@ -428,7 +428,7 @@ void load_civ_palettes(RECT16 *cluts) return; } -// [D] +// [D] [T] void LoadPermanentTPages(int *sector) { int nsectors; @@ -475,7 +475,7 @@ void LoadPermanentTPages(int *sector) load_civ_palettes(&clutpos); - tpagebuffer = mallocptr; + tpagebuffer = (char*)mallocptr; nsectors = 0; for (i = 0; i < nperms; i++) @@ -501,7 +501,7 @@ void LoadPermanentTPages(int *sector) tpagebuffer += (permlist[i].y + 2047) & -CDSECTOR_SIZE; } - tpagebuffer = mallocptr; + tpagebuffer = (char*)mallocptr; slot_clutpos[slotsused].vx = clutpos.x; slot_clutpos[slotsused].vy = clutpos.y; diff --git a/src_rebuild/Game/C/xmplay.c b/src_rebuild/Game/C/xmplay.c index 20c7d387..1df2b6fa 100644 --- a/src_rebuild/Game/C/xmplay.c +++ b/src_rebuild/Game/C/xmplay.c @@ -2311,7 +2311,7 @@ void DoDolbySS(void) int dd = 0; int de = 0; -// [D] +// [D] [T] int GetEmpty(int old) { unsigned char bVar1; @@ -2781,7 +2781,7 @@ CurrentKeyStat Stops processing of any dead channels *****************************************************************************/ -// [D] +// [D] [T] void CurrentKeyStat(void) { int t; diff --git a/src_rebuild/Game/Frontend/FEmain.c b/src_rebuild/Game/Frontend/FEmain.c index 0446fdc8..18d2247c 100644 --- a/src_rebuild/Game/Frontend/FEmain.c +++ b/src_rebuild/Game/Frontend/FEmain.c @@ -991,7 +991,7 @@ void SetupExtraPoly(char *fileName, int offset, int offset2) RECT16 rect = extraRect; FEDrawCDicon(); - Loadfile(fileName, _frontend_buffer + offset2); + Loadfile(fileName, (char*)_frontend_buffer + offset2); rect.x = 896; rect.y = 256; @@ -1064,7 +1064,7 @@ void LoadBackgroundFile(char* name) { FEDrawCDicon(); - LoadfileSeg(name, _overlay_buffer, i * 0x8000, 0x8000); + LoadfileSeg(name, (char*)_overlay_buffer, i * 0x8000, 0x8000); FEDrawCDicon(); rect.y = (i / 6); @@ -1075,7 +1075,7 @@ void LoadBackgroundFile(char* name) FEDrawCDicon(); } - LoadfileSeg(name, _overlay_buffer, iTpage * 0x8000, 0x800); + LoadfileSeg(name, (char*)_overlay_buffer, iTpage * 0x8000, 0x800); FEDrawCDicon(); rect.h = 1; @@ -1103,9 +1103,9 @@ void LoadFrontendScreens(int full) #ifndef USE_EMBEDDED_FRONTEND_SCREENS if (full) { - Loadfile("DATA\\SCRS.BIN", _frontend_buffer); + Loadfile("DATA\\SCRS.BIN", (char*)_frontend_buffer); - ptr = _frontend_buffer + 20; // skip header and number of screens + ptr = (char*)_frontend_buffer + 20; // skip header and number of screens iNumScreens = (int)_frontend_buffer[16]; for (int i = 0; i < iNumScreens; i++) @@ -1143,7 +1143,7 @@ void LoadFrontendScreens(int full) for (int i = 0; i < 2; i++) { ShowLoading(); - LoadfileSeg("DATA\\GFX.RAW", _frontend_buffer, 0x30000 + (i * 0x8000), 0x8000); + LoadfileSeg("DATA\\GFX.RAW", (char*)_frontend_buffer, 0x30000 + (i * 0x8000), 0x8000); rect.x = 640 + (i * 64); rect.y = 256; @@ -1153,7 +1153,7 @@ void LoadFrontendScreens(int full) } ShowLoading(); - LoadfileSeg("DATA\\GFX.RAW", _frontend_buffer, 0x58000, 0x8000); + LoadfileSeg("DATA\\GFX.RAW", (char*)_frontend_buffer, 0x58000, 0x8000); rect.x = 960; rect.y = 256; @@ -1164,7 +1164,7 @@ void LoadFrontendScreens(int full) if (full) { - Loadfile("DATA\\FEFONT.BNK", _frontend_buffer); + Loadfile("DATA\\FEFONT.BNK", (char*)_frontend_buffer); memcpy((u_char*)&feFont, (u_char*)_frontend_buffer, sizeof(feFont)); } } @@ -1573,17 +1573,17 @@ void SetFEDrawMode(void) MPBuff[0][0].disp.isinter = 1; MPBuff[0][0].draw.dfe = 1; MPBuff[0][0].disp.screen.h = 256; - MPBuff[0][0].primtab = _primTab1; - MPBuff[0][0].primptr = _primTab1; - MPBuff[0][0].ot = _OT1; + MPBuff[0][0].primtab = (char*)_primTab1; + MPBuff[0][0].primptr = (char*)_primTab1; + MPBuff[0][0].ot = (OTTYPE*)_OT1; MPBuff[0][1].draw.isbg = 0; MPBuff[0][1].disp.isinter = 1; MPBuff[0][1].draw.dfe = 1; MPBuff[0][1].disp.screen.h = 256; - MPBuff[0][1].primtab = _primTab2; - MPBuff[0][1].primptr = _primTab2; - MPBuff[0][1].ot = _OT2; + MPBuff[0][1].primtab = (char*)_primTab2; + MPBuff[0][1].primptr = (char*)_primTab2; + MPBuff[0][1].ot = (OTTYPE*)_OT2; last = &MPBuff[0][1]; current = &MPBuff[0][0]; diff --git a/src_rebuild/Game/dr2locale.c b/src_rebuild/Game/dr2locale.c index 1b7597c1..eb628409 100644 --- a/src_rebuild/Game/dr2locale.c +++ b/src_rebuild/Game/dr2locale.c @@ -52,7 +52,7 @@ int InitStringMng() char table[256]; char* file; - file = _frontend_buffer; + file = (char*)_frontend_buffer; Loadfile("GFX\\FONT2.FNT", file);