Closed LowLevelMahn closed 1 year ago
What does it do when you copy the dethrace executable to the game data folder, and execute from there?
It must be placed in the same folder as where the original .exe's can be found.
Also, the executable is sensitive to the working directory, so cd to this folder before execution.
You don't need to set the DETHRACE_ROOT_DIR
env variable anymore in this case.
I want to exclude our currently broken error reporting (https://github.com/dethrace-labs/dethrace/issues/312).
What does it do when you copy the dethrace executable to the game data folder, and execute from there?
it happens the same - copied the executable into the folder were the CARMA.EXE was and in the DATA folder for testing
same happens with a VS2022/SDL2-2.26.5 build under Win 10 (exe in CARMA.EXE directory or in DATA directory and with changed working-dir)
D:\temp\dethreace_dev\Carma>Dethrace version: v0.6.0-21-g34a22f2 [INFO] Harness_Init DETHRACE_ROOT_DIR is not set, assuming '.' Game mode: Carmageddon [INFO] GLRenderer_Init OpenGL vendor string: NVIDIA Corporation [INFO] GLRenderer_Init OpenGL renderer string: NVIDIA GeForce GT 1030/PCIe/SSE2 [INFO] GLRenderer_Init OpenGL version string: 3.1.0 NVIDIA 522.25 [INFO] GLRenderer_Init OpenGL shading language version string: 1.40 NVIDIA via Cg compiler D:\temp\dethreace_dev\Carma>
i've added a
int checked_access(const char* filename, int mode) {
int res = access(filename, mode);
printf("checked_access(\"%s\", %i) = %i\n", filename, mode, res);
return res;
}
and replaced all the access(...) calls with checked_access(...) in Harness_DetectGameMode()
this is the output
Dethrace version: v0.6.0-21-g34a22f2
[INFO] Harness_Init DETHRACE_ROOT_DIR is not set, assuming '.'
checked_access("DATA/RACES/CASTLE.TXT", 0) = -1
checked_access("DATA/RACES/CITYB3.TXT", 0) = 0
checked_access("DATA/RACES/CITYA1.TXT", 0) = 0
checked_access("DATA/CUTSCENE/Mix_intr.smk", 0) = 0
Game mode: Carmageddon
checked_access("DATA/TRNSLATE.TXT", 0) = -1
[INFO] GLRenderer_Init OpenGL vendor string: NVIDIA Corporation
[INFO] GLRenderer_Init OpenGL renderer string: NVIDIA GeForce GT 1030/PCIe/SSE2
[INFO] GLRenderer_Init OpenGL version string: 3.1.0 NVIDIA 522.25
[INFO] GLRenderer_Init OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
also extenden PDFatalError(...) with a printf
void PDFatalError(char* pThe_str) {
printf("PDFatalError: %s\n", pThe_str);
LOG_TRACE("(\"%s\")", pThe_str);
dr_dprintf("FATAL ERROR: %s", pThe_str);
Win32FatalError(pThe_str, NULL);
}
now the startup shows
Dethrace version: v0.6.0-21-g34a22f2
[INFO] Harness_Init DETHRACE_ROOT_DIR is not set, assuming '.'
checked_access("DATA/RACES/CASTLE.TXT", 0) = -1
checked_access("DATA/RACES/CITYB3.TXT", 0) = 0
checked_access("DATA/RACES/CITYA1.TXT", 0) = 0
checked_access("DATA/CUTSCENE/Mix_intr.smk", 0) = 0
Game mode: Carmageddon
checked_access("DATA/TRNSLATE.TXT", 0) = -1
[INFO] GLRenderer_Init OpenGL vendor string: NVIDIA Corporation
[INFO] GLRenderer_Init OpenGL renderer string: NVIDIA GeForce GT 1030/PCIe/SSE2
[INFO] GLRenderer_Init OpenGL version string: 3.1.0 NVIDIA 522.25
[INFO] GLRenderer_Init OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
PDFatalError: This .exe must have KEYBOARD.COK in the DATA folder.
so it seems my game version is not the correct one
the only problem seems to be the hidden logging that already explains exactly what the problem is
Works with different game version
Dethrace version: v0.6.0-21-g34a22f2
[INFO] Harness_Init DETHRACE_ROOT_DIR is not set, assuming '.'
checked_access("DATA/RACES/CASTLE.TXT", 0) = -1
checked_access("DATA/RACES/CITYB3.TXT", 0) = 0
checked_access("DATA/RACES/CITYA1.TXT", 0) = 0
checked_access("DATA/CUTSCENE/Mix_intr.smk", 0) = -1
Game mode: Carmageddon
checked_access("DATA/TRNSLATE.TXT", 0) = -1
[INFO] GLRenderer_Init OpenGL vendor string: NVIDIA Corporation
[INFO] GLRenderer_Init OpenGL renderer string: NVIDIA GeForce GT 1030/PCIe/SSE2
[INFO] GLRenderer_Init OpenGL version string: 3.1.0 NVIDIA 522.25
[INFO] GLRenderer_Init OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
[WARN] BrSystemConfigBegin stubbed
[WARN] HostImageLoad stubbed
[WARN] NetService stubbed
[WARN] DefaultNetSettings stubbed
[WARN] BrTokenValueSetMany stubbed
[WARN] BrTokenValueSetMany stubbed
[WARN] BrTokenValueSetMany stubbed
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/PALETTES/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/PALETTES/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/SHADETAB/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/SHADETAB/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/PIXELMAP/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/PIXELMAP/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/MATERIAL/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/MATERIAL/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/MODELS/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/MODELS/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/LIGHTS/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/LIGHTS/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/Evalu01.PIX"
[WARN] S3StopMIDIOutlets stubbed
[WARN] S3StopCDAOutlets stubbed
[WARN] AllocateStandardLamp stubbed
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/OIL.PIX"
[WARN] BrTokenValueSetMany stubbed
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/HANDX.PIX"
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/HANDPX.PIX"
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/CURSGIBX.PIX"
added missing newline to a error output function
FILE* OS_fopen(const char* pathname, const char* mode) {
FILE* f;
errno_t err;
f = NULL;
err = fopen_s(&f, pathname, mode);
if (err != 0) {
fprintf(stderr, "Failed to open \"%s\"\n", pathname); // <--- added missing \n here to get better log output
}
return f;
}
so it seems my game version is not the correct one
What version of the game were you using?
FYI the missing error messages introduced in a recent refactor are now fixed in https://github.com/dethrace-labs/dethrace/pull/316
so it seems my game version is not the correct one
What version of the game were you using?
https://gamesnostalgia.com/game/carmageddon Download for PC: DOS version 1.1 - Language: English - Size: 28.28 Mb
seemed to be a stripped down version
this version works: https://archive.org/download/msdos_Carmageddon_Max_Pack_1998
Carmageddon_Max_Pack_1998.zip (View Contents) 08-Oct-2019 15:14 1.2G
FYI the missing error messages introduced in a recent refactor are now fixed in #316
works on Windows and Linux
still missing \n in OS_fopen(...) fprintf - which only trashes the log output under Windows
to fix log output
The STYLE.EXE
binary, available in the archives in this link embeds the ascii table.
This table is the same as KEYBOARD.COK
, provided by other Carmageddon releases.
So I think we should embed this table too.
Let's make failure to find KEYBOARD.COK
not a fatal anymore.
And use KEYBOARD.COK
when it's available.
Yeah, I took a look at STYLE too :)
Its weird that the embedded gASCII_table
is different between the different demo versions.
Its also really weird that some versions look for keyboard.cok
and some don't. The CARMA.EXE from the GOG release does look for it, but its Date Modified is in 2012, so I can't compare it to the 15/06/1997 date from the gamesnostalgia package to see if it was originally older or newer.
I just extracted the ascii tables from my original 90ies cd (I think it's this one), and it has yet another ascii table.
(They are initialized in KeyBegin
at 0x0048f8b0
):
gASCII_table = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 0, 45, 61, 127, 13, 13, 9, 0, 0, 0, 0, 46, 44, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32]
gASCII_shift_table = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 106, 75, 76, 77, 78, 79, 112, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 0, 45, 61, 127, 13, 13, 9, 0, 0, 0, 0, 46, 44, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32]
Remarkable about this one is that it contains lower case ascii codes in the non-uppercase array.
I think we should interpret the ascii tables as a mapping from scancode to keycode (≈ascii), and thus should expect variation due to localization.
Can we generate the table dynamically by going the "reverse" way? Carmageddon keycode -> DirectInput code -> SDL codes -> ...
Speaking about localization. We're currently using SDL_Keycode
. Shouldn't we use SDL_Scancode
instead?
SDL_Keycode
is already mapped to the current to the current keyboard layout.,
SDL_Scancode
isn't.
its inside a VMWare vm - so no native opengl drivers available (i think)
build with Fedora 38/gcc 13.1.1 without any warning
just gives me that output
SUSE/Tumbleweed