diff --git a/src/DETHRACE/common/input.c b/src/DETHRACE/common/input.c index 7d77892b..db0827a3 100644 --- a/src/DETHRACE/common/input.c +++ b/src/DETHRACE/common/input.c @@ -83,7 +83,7 @@ void ResetPollKeys(void) { void CheckKeysForMouldiness(void) { LOG_TRACE9("()"); - if ((PDGetTotalTime() - gLast_poll_keys) > 500) { + if (PDGetTotalTime() - gLast_poll_keys > 500) { ResetPollKeys(); CyclePollKeys(); PollKeys(); @@ -110,7 +110,7 @@ tKey_down_result PDKeyDown2(int pKey_index) { the_time = PDGetTotalTime(); if (gKey_array[pKey_index]) { if (gLast_key_down == pKey_index) { - if ((the_time - gLast_key_down_time) < 300) { + if (the_time - gLast_key_down_time < 300) { return tKey_down_still; } else { gLast_key_down_time = the_time; @@ -403,13 +403,15 @@ int AddRollingLetter(char pChar, int pX, int pY, tRolling_type rolling_type) { let->current_offset = (gCurrent_graf_data->save_slot_letter_height * let->number_of_letters); for (i = 0; i < let->number_of_letters; i++) { if (rolling_type == eRT_numeric) { - let->letters[i] = pChar; + /* The (tU8) cast makes sure extended ASCII is positive. */ + let->letters[i] = (tU8)pChar; } else { let->letters[i] = IRandomBetween('A', 'Z' + 1); } } if (rolling_type != eRT_looping_random) { - let->letters[0] = pChar; + /* The (tU8) cast makes sure extended ASCII is positive. */ + let->letters[0] = (tU8)pChar; } return 0; @@ -539,7 +541,8 @@ int ChangeCharTo(int pSlot_index, int pChar_index, char pNew_char) { return AddRollingLetter(pNew_char, x_coord, y_coord, new_type); } if (pNew_char != ROLLING_LETTER_LOOP_RANDOM) { - let->letters[0] = pNew_char; + /* The (tU8) cast makes sure extended ASCII is positive. */ + let->letters[0] = (tU8)pNew_char; } if (pNew_char == ' ') { let->letters[0] = ' '; diff --git a/src/DETHRACE/common/pedestrn.c b/src/DETHRACE/common/pedestrn.c index e452ce71..619ea259 100644 --- a/src/DETHRACE/common/pedestrn.c +++ b/src/DETHRACE/common/pedestrn.c @@ -2789,7 +2789,7 @@ void LoadInPedestrians(FILE* pF, int pSubs_count, tPed_subs* pSubs_array) { ped_count = temp_int; } gPedestrian_array = BrMemAllocate(sizeof(tPedestrian_data) * (ped_count + (gAusterity_mode ? 0 : 200)), kMem_ped_array_stain); - if (PDKeyDown(KEY_LCTRL) && PDKeyDown(KEY_LSHIFT) && PDKeyDown(KEY_A)) { + if (PDKeyDown(KEY_CTRL_ANY) && PDKeyDown(KEY_SHIFT_ANY) && PDKeyDown(KEY_A)) { check_for_duplicates = 1; DRS3StartSound(gEffects_outlet, 3202); DRS3StartSound(gEffects_outlet, 3202); diff --git a/src/DETHRACE/pc-dos/dossys.c b/src/DETHRACE/pc-dos/dossys.c index 66309dfc..582581d5 100644 --- a/src/DETHRACE/pc-dos/dossys.c +++ b/src/DETHRACE/pc-dos/dossys.c @@ -488,7 +488,7 @@ int original_main(int pArgc, char** pArgv) { sscanf(pArgv[i], "%d", &arg); gSound_detail_level = arg; - } else if (strcasecmp(pArgv[i], "-robots") == 0) { + } else if (strcasecmp(pArgv[i], "-robots") == 0 || strcasecmp(pArgv[i], "-german") == 0) { gSausage_override = 1; } else if (strcasecmp(pArgv[i], "-lomem") == 0) { gAustere_override = 1; diff --git a/src/DETHRACE/pc-win95/win95sys.c b/src/DETHRACE/pc-win95/win95sys.c index 13d014b8..77175309 100644 --- a/src/DETHRACE/pc-win95/win95sys.c +++ b/src/DETHRACE/pc-win95/win95sys.c @@ -270,7 +270,6 @@ void PDSetKeyArray(int* pKeys, int pMark) { case KEY_ALT_ANY: if (KEYDOWN(keystate, gScan_code[KEY_LALT]) || KEYDOWN(keystate, gScan_code[KEY_RALT])) { pKeys[KEY_ALT_ANY] = pMark; - } else { if (pKeys[KEY_ALT_ANY] == pMark) { pKeys[KEY_ALT_ANY] = 0; @@ -309,7 +308,7 @@ void Win32ReleaseInputDevice(void) { int PDGetASCIIFromKey(int pKey) { LOG_TRACE("(%d)", pKey); - if (PDKeyDown(KEY_LSHIFT)) { + if (PDKeyDown(KEY_SHIFT_ANY)) { return gASCII_shift_table[pKey]; } else { return gASCII_table[pKey]; @@ -368,11 +367,21 @@ void PDInitialiseSystem(void) { ShowCursor_(0); KeyBegin(); - // dethrace: demos do not ship with KEYBOARD.COK file - if (harness_game_info.defines.ascii_table == NULL) { + PathCat(the_path, gApplication_path, "KEYBOARD.COK"); + f = fopen(the_path, "rb"); + if (f == NULL) { + if (harness_game_info.defines.requires_ascii_table) { +#if !defined(DETHRACE_FIX_BUGS) + PDFatalError("This .exe must have KEYBOARD.COK in the DATA folder."); +#endif + } + // dethrace: demos do not ship with KEYBOARD.COK file + memcpy(gASCII_table, harness_game_info.defines.ascii_table, sizeof(gASCII_table)); + memcpy(gASCII_shift_table, harness_game_info.defines.ascii_shift_table, sizeof(gASCII_shift_table)); + } else { PathCat(the_path, gApplication_path, "KEYBOARD.COK"); f = fopen(the_path, "rb"); - if (!f) { + if (f == NULL) { PDFatalError("This .exe must have KEYBOARD.COK in the DATA folder."); } fseek(f, 0, 2); @@ -381,9 +390,6 @@ void PDInitialiseSystem(void) { fread(gASCII_table, len, 1u, f); fread(gASCII_shift_table, len, 1u, f); fclose(f); - } else { - memcpy(gASCII_table, harness_game_info.defines.ascii_table, sizeof(gASCII_table)); - memcpy(gASCII_shift_table, harness_game_info.defines.ascii_shift_table, sizeof(gASCII_shift_table)); } Win32InitInputDevice(); } @@ -915,7 +921,7 @@ int original_main(int pArgc, char** pArgv) { sscanf(pArgv[i], "%d", &arg); gSound_detail_level = arg; - } else if (strcasecmp(pArgv[i], "-robots") == 0) { + } else if (strcasecmp(pArgv[i], "-robots") == 0 || strcasecmp(pArgv[i], "-german") == 0) { gSausage_override = 1; } else if (strcasecmp(pArgv[i], "-lomem") == 0) { gAustere_override = 1; diff --git a/src/harness/CMakeLists.txt b/src/harness/CMakeLists.txt index 9cfb8784..13f08467 100644 --- a/src/harness/CMakeLists.txt +++ b/src/harness/CMakeLists.txt @@ -55,6 +55,7 @@ target_sources(harness PRIVATE include/harness/win95_polyfill_defs.h # cameras/debug_camera.c # cameras/debug_camera.h + ascii_tables.h harness_trace.c harness.c harness.h diff --git a/src/harness/ascii_tables.h b/src/harness/ascii_tables.h new file mode 100644 index 00000000..fc218af7 --- /dev/null +++ b/src/harness/ascii_tables.h @@ -0,0 +1,893 @@ +#ifndef DETHRACE_ASCII_TABLES_H +#define DETHRACE_ASCII_TABLES_H + +typedef struct { + int ascii[128]; + int ascii_shift[128]; +} dethrace_ascii_tables; + +dethrace_ascii_tables carmageddon_ascii_tables = { + { + 0, /* KEY_SHIFT_ANY */ + 0, /* KEY_ALT_ANY */ + 0, /* KEY_CTRL_ANY */ + 0, /* KEY_CTRL_ANY_2 */ + 0, /* KEY_CAPSLOCK */ + 0, /* KEY_RSHIFT */ + 0, /* KEY_RALT */ + 0, /* KEY_RCTRL */ + 0, /* KEY_LSHIFT */ + 0, /* KEY_LALT */ + 0, /* KEY_LCTRL */ + '0', /* KEY_0 */ + '1', /* KEY_1 */ + '2', /* KEY_2 */ + '3', /* KEY_3 */ + '4', /* KEY_4 */ + '5', /* KEY_5 */ + '6', /* KEY_6 */ + '7', /* KEY_7 */ + '8', /* KEY_8 */ + '9', /* KEY_9 */ + 'A', /* KEY_A */ + 'B', /* KEY_B */ + 'C', /* KEY_C */ + 'D', /* KEY_D */ + 'E', /* KEY_E */ + 'F', /* KEY_F */ + 'G', /* KEY_G */ + 'H', /* KEY_H */ + 'I', /* KEY_I */ + 'J', /* KEY_J */ + 'K', /* KEY_K */ + 'L', /* KEY_L */ + 'M', /* KEY_M */ + 'N', /* KEY_N */ + 'O', /* KEY_O */ + 'P', /* KEY_P */ + 'Q', /* KEY_Q */ + 'R', /* KEY_R */ + 'S', /* KEY_S */ + 'T', /* KEY_T */ + 'U', /* KEY_U */ + 'V', /* KEY_V */ + 'W', /* KEY_W */ + 'X', /* KEY_X */ + 'Y', /* KEY_Y */ + 'Z', /* KEY_Z */ + '`', /* KEY_GRAVE */ + '-', /* KEY_MINUS */ + '=', /* KEY_EQUALS */ + '\b', /* KEY_BACKSPACE */ + '\r', /* KEY_RETURN */ + 0x03, /* KEY_KP_ENTER */ + '\t', /* KEY_TAB */ + '/', /* KEY_SLASH */ + '\\', /* KEY_UNKNOWN_55 */ + ';', /* KEY_SEMICOLON */ + '\'', /* KEY_APOSTROPHE */ + '.', /* KEY_PERIOD */ + ',', /* KEY_COMMA */ + '[', /* KEY_LBRACKET */ + ']', /* KEY_RBRACKET */ + '#', /* KEY_BACKSLASH */ + 0x1b, /* KEY_ESCAPE */ + 0, /* KEY_INSERT */ + 0x7f, /* KEY_DELETE */ + 0, /* KEY_HOME */ + 0, /* KEY_END */ + 0, /* KEY_PAGEUP */ + 0, /* KEY_PAGEDOWN */ + 0x1c, /* KEY_LEFT */ + 0x1d, /* KEY_RIGHT */ + 0x1e, /* KEY_UP */ + 0x1f, /* KEY_DOWN */ + 0, /* KEY_KP_NUMLOCK */ + '/', /* KEY_KP_DIVIDE */ + '*', /* KEY_KP_MULTIPLY */ + '-', /* KEY_KP_MINUS */ + '+', /* KEY_KP_PLUS */ + '.', /* KEY_KP_PERIOD */ + '=', /* KEY_KP_EQUALS */ + '0', /* KEY_KP_0 */ + '1', /* KEY_KP_1 */ + '2', /* KEY_KP_2 */ + '3', /* KEY_KP_3 */ + '4', /* KEY_KP_4 */ + '5', /* KEY_KP_5 */ + '6', /* KEY_KP_6 */ + '7', /* KEY_KP_7 */ + '8', /* KEY_KP_8 */ + '9', /* KEY_KP_9 */ + 0, /* KEY_F1 */ + 0, /* KEY_F2 */ + 0, /* KEY_F3 */ + 0, /* KEY_F4 */ + 0, /* KEY_F5 */ + 0, /* KEY_F6 */ + 0, /* KEY_F7 */ + 0, /* KEY_F8 */ + 0, /* KEY_F9 */ + 0, /* KEY_F10 */ + 0, /* KEY_F11 */ + 0, /* KEY_F12 */ + 0, /* KEY_PRTSCN */ + 0, /* KEY_SCRLK */ + 0, /* KEY_PAUSE */ + ' ', /* KEY_SPACE */ + }, + { + 0, /* KEY_SHIFT_ANY */ + 0, /* KEY_ALT_ANY */ + 0, /* KEY_CTRL_ANY */ + 0, /* KEY_CTRL_ANY_2 */ + 0, /* KEY_CAPSLOCK */ + 0, /* KEY_RSHIFT */ + 0, /* KEY_RALT */ + 0, /* KEY_RCTRL */ + 0, /* KEY_LSHIFT */ + 0, /* KEY_LALT */ + 0, /* KEY_LCTRL */ + ')', /* KEY_0 */ + '!', /* KEY_1 */ + '"', /* KEY_2 */ + 0xa3, /* KEY_3 (£) */ + '$', /* KEY_4 */ + '%', /* KEY_5 */ + '^', /* KEY_6 */ + '&', /* KEY_7 */ + '*', /* KEY_8 */ + '(', /* KEY_9 */ + 'A', /* KEY_A */ + 'B', /* KEY_B */ + 'C', /* KEY_C */ + 'D', /* KEY_D */ + 'E', /* KEY_E */ + 'F', /* KEY_F */ + 'G', /* KEY_G */ + 'H', /* KEY_H */ + 'I', /* KEY_I */ + 'J', /* KEY_J */ + 'K', /* KEY_K */ + 'L', /* KEY_L */ + 'M', /* KEY_M */ + 'N', /* KEY_N */ + 'O', /* KEY_O */ + 'P', /* KEY_P */ + 'Q', /* KEY_Q */ + 'R', /* KEY_R */ + 'S', /* KEY_S */ + 'T', /* KEY_T */ + 'U', /* KEY_U */ + 'V', /* KEY_V */ + 'W', /* KEY_W */ + 'X', /* KEY_X */ + 'Y', /* KEY_Y */ + 'Z', /* KEY_Z */ + 0xac, /* KEY_GRAVE (¬) */ + '_', /* KEY_MINUS */ + '+', /* KEY_EQUALS */ + '\b', /* KEY_BACKSPACE */ + '\r', /* KEY_RETURN */ + '\r', /* KEY_KP_ENTER */ + 0, /* KEY_TAB */ + '?', /* KEY_SLASH */ + '|', /* KEY_UNKNOWN_55 */ + ':', /* KEY_SEMICOLON */ + '@', /* KEY_APOSTROPHE */ + '>', /* KEY_PERIOD */ + ',', /* KEY_COMMA */ + '{', /* KEY_LBRACKET */ + '}', /* KEY_RBRACKET */ + '~', /* KEY_BACKSLASH */ + 0x1b, /* KEY_ESCAPE */ + 0, /* KEY_INSERT */ + 0, /* KEY_DELETE */ + 0, /* KEY_HOME */ + 0, /* KEY_END */ + 0, /* KEY_PAGEUP */ + 0, /* KEY_PAGEDOWN */ + 0, /* KEY_LEFT */ + 0, /* KEY_RIGHT */ + 0, /* KEY_UP */ + 0, /* KEY_DOWN */ + 0, /* KEY_KP_NUMLOCK */ + '/', /* KEY_KP_DIVIDE */ + '*', /* KEY_KP_MULTIPLY */ + '-', /* KEY_KP_MINUS */ + '+', /* KEY_KP_PLUS */ + '.', /* KEY_KP_PERIOD */ + 0, /* KEY_KP_EQUALS */ + '0', /* KEY_KP_0 */ + '1', /* KEY_KP_1 */ + '2', /* KEY_KP_2 */ + '3', /* KEY_KP_3 */ + '4', /* KEY_KP_4 */ + '5', /* KEY_KP_5 */ + '6', /* KEY_KP_6 */ + '7', /* KEY_KP_7 */ + '8', /* KEY_KP_8 */ + '9', /* KEY_KP_9 */ + 0, /* KEY_F1 */ + 0, /* KEY_F2 */ + 0, /* KEY_F3 */ + 0, /* KEY_F4 */ + 0, /* KEY_F5 */ + 0, /* KEY_F6 */ + 0, /* KEY_F7 */ + 0, /* KEY_F8 */ + 0, /* KEY_F9 */ + 0, /* KEY_F10 */ + 0, /* KEY_F11 */ + 0, /* KEY_F12 */ + 0, /* KEY_PRTSCN */ + 0, /* KEY_SCRLK */ + 0, /* KEY_PAUSE */ + ' ', /* KEY_SPACE */ + }, +}; + +dethrace_ascii_tables carmageddon_german_ascii_tables = { + { + 0, /* KEY_SHIFT_ANY */ + 0, /* KEY_ALT_ANY */ + 0, /* KEY_CTRL_ANY */ + 0, /* KEY_CTRL_ANY_2 */ + 0, /* KEY_CAPSLOCK */ + 0, /* KEY_RSHIFT */ + 0, /* KEY_RALT */ + 0, /* KEY_RCTRL */ + 0, /* KEY_LSHIFT */ + 0, /* KEY_LALT */ + 0, /* KEY_LCTRL */ + '0', /* KEY_0 */ + '1', /* KEY_1 */ + '2', /* KEY_2 */ + '3', /* KEY_3 */ + '4', /* KEY_4 */ + '5', /* KEY_5 */ + '6', /* KEY_6 */ + '7', /* KEY_7 */ + '8', /* KEY_8 */ + '9', /* KEY_9 */ + 'a', /* KEY_A */ + 'b', /* KEY_B */ + 'c', /* KEY_C */ + 'd', /* KEY_D */ + 'e', /* KEY_E */ + 'f', /* KEY_F */ + 'g', /* KEY_G */ + 'h', /* KEY_H */ + 'i', /* KEY_I */ + 'j', /* KEY_J */ + 'k', /* KEY_K */ + 'l', /* KEY_L */ + 'm', /* KEY_M */ + 'n', /* KEY_N */ + 'o', /* KEY_O */ + 'p', /* KEY_P */ + 'q', /* KEY_Q */ + 'r', /* KEY_R */ + 's', /* KEY_S */ + 't', /* KEY_T */ + 'u', /* KEY_U */ + 'v', /* KEY_V */ + 'w', /* KEY_W */ + 'x', /* KEY_X */ + 'z', /* KEY_Y */ + 'y', /* KEY_Z */ + '^', /* KEY_GRAVE */ + 0xdf, /* KEY_MINUS (ß) */ + 0xb4, /* KEY_EQUALS (´) */ + '\b', /* KEY_BACKSPACE */ + '\r', /* KEY_RETURN */ + '\r', /* KEY_KP_ENTER */ + 0, /* KEY_TAB */ + '-', /* KEY_SLASH */ + '<', /* KEY_UNKNOWN_55 */ + 0xf6, /* KEY_SEMICOLON (ö) */ + 0xe4, /* KEY_APOSTROPHE (ä) */ + '.', /* KEY_PERIOD */ + ',', /* KEY_COMMA */ + 0xfc, /* KEY_LBRACKET (ü) */ + '+', /* KEY_RBRACKET */ + '#', /* KEY_BACKSLASH */ + 0x1b, /* KEY_ESCAPE */ + 0, /* KEY_INSERT */ + 0, /* KEY_DELETE */ + 0, /* KEY_HOME */ + 0, /* KEY_END */ + 0, /* KEY_PAGEUP */ + 0, /* KEY_PAGEDOWN */ + 0, /* KEY_LEFT */ + 0, /* KEY_RIGHT */ + 0, /* KEY_UP */ + 0, /* KEY_DOWN */ + 0, /* KEY_KP_NUMLOCK */ + 0xfc, /* KEY_KP_DIVIDE (ü) */ + '8', /* KEY_KP_MULTIPLY */ + 0xdf, /* KEY_KP_MINUS (ß) */ + 0xb4, /* KEY_KP_PLUS (´) */ + '.', /* KEY_KP_PERIOD */ + 0, /* KEY_KP_EQUALS */ + '0', /* KEY_KP_0 */ + '1', /* KEY_KP_1 */ + '2', /* KEY_KP_2 */ + '3', /* KEY_KP_3 */ + '4', /* KEY_KP_4 */ + '5', /* KEY_KP_5 */ + '6', /* KEY_KP_6 */ + '7', /* KEY_KP_7 */ + '8', /* KEY_KP_8 */ + '9', /* KEY_KP_9 */ + 0, /* KEY_F1 */ + 0, /* KEY_F2 */ + 0, /* KEY_F3 */ + 0, /* KEY_F4 */ + 0, /* KEY_F5 */ + 0, /* KEY_F6 */ + 0, /* KEY_F7 */ + 0, /* KEY_F8 */ + 0, /* KEY_F9 */ + 0, /* KEY_F10 */ + 0, /* KEY_F11 */ + 0, /* KEY_F12 */ + 0, /* KEY_PRTSCN */ + 0, /* KEY_SCRLK */ + 0, /* KEY_PAUSE */ + ' ', /* KEY_SPACE */ + }, + { + 0, /* KEY_SHIFT_ANY */ + 0, /* KEY_ALT_ANY */ + 0, /* KEY_CTRL_ANY */ + 0, /* KEY_CTRL_ANY_2 */ + 0, /* KEY_CAPSLOCK */ + 0, /* KEY_RSHIFT */ + 0, /* KEY_RALT */ + 0, /* KEY_RCTRL */ + 0, /* KEY_LSHIFT */ + 0, /* KEY_LALT */ + 0, /* KEY_LCTRL */ + '=', /* KEY_0 */ + '!', /* KEY_1 */ + '"', /* KEY_2 */ + 0xa7, /* KEY_3 (§) */ + '$', /* KEY_4 */ + '%', /* KEY_5 */ + '&', /* KEY_6 */ + '/', /* KEY_7 */ + '(', /* KEY_8 */ + ')', /* KEY_9 */ + 'A', /* KEY_A */ + 'B', /* KEY_B */ + 'C', /* KEY_C */ + 'D', /* KEY_D */ + 'E', /* KEY_E */ + 'F', /* KEY_F */ + 'G', /* KEY_G */ + 'H', /* KEY_H */ + 'I', /* KEY_I */ + 'J', /* KEY_J */ + 'K', /* KEY_K */ + 'L', /* KEY_L */ + 'M', /* KEY_M */ + 'N', /* KEY_N */ + 'O', /* KEY_O */ + 'P', /* KEY_P */ + 'Q', /* KEY_Q */ + 'R', /* KEY_R */ + 'S', /* KEY_S */ + 'T', /* KEY_T */ + 'U', /* KEY_U */ + 'V', /* KEY_V */ + 'W', /* KEY_W */ + 'X', /* KEY_X */ + 'Z', /* KEY_Y */ + 'Y', /* KEY_Z */ + 0xb0, /* KEY_GRAVE (°) */ + '?', /* KEY_MINUS */ + '`', /* KEY_EQUALS */ + '\b', /* KEY_BACKSPACE */ + '\r', /* KEY_RETURN */ + '\r', /* KEY_KP_ENTER */ + 0, /* KEY_TAB */ + '_', /* KEY_SLASH */ + '>', /* KEY_UNKNOWN_55 */ + 0xd6, /* KEY_SEMICOLON (Ö) */ + 0xc4, /* KEY_APOSTROPHE (Ä) */ + ':', /* KEY_PERIOD */ + ',', /* KEY_COMMA */ + 0xdc, /* KEY_LBRACKET (Ü) */ + '*', /* KEY_RBRACKET */ + '\'', /* KEY_BACKSLASH */ + 0x1b, /* KEY_ESCAPE */ + 0, /* KEY_INSERT */ + 0, /* KEY_DELETE */ + 0, /* KEY_HOME */ + 0, /* KEY_END */ + 0, /* KEY_PAGEUP */ + 0, /* KEY_PAGEDOWN */ + 0, /* KEY_LEFT */ + 0, /* KEY_RIGHT */ + 0, /* KEY_UP */ + 0, /* KEY_DOWN */ + 0, /* KEY_KP_NUMLOCK */ + 0xfc, /* KEY_KP_DIVIDE (ü) */ + '8', /* KEY_KP_MULTIPLY */ + 0xdf, /* KEY_KP_MINUS (ß) */ + 0xb4, /* KEY_KP_PLUS (´) */ + '.', /* KEY_KP_PERIOD */ + 0, /* KEY_KP_EQUALS */ + '0', /* KEY_KP_0 */ + '1', /* KEY_KP_1 */ + '2', /* KEY_KP_2 */ + '3', /* KEY_KP_3 */ + '4', /* KEY_KP_4 */ + '5', /* KEY_KP_5 */ + '6', /* KEY_KP_6 */ + '7', /* KEY_KP_7 */ + '8', /* KEY_KP_8 */ + '9', /* KEY_KP_9 */ + 0, /* KEY_F1 */ + 0, /* KEY_F2 */ + 0, /* KEY_F3 */ + 0, /* KEY_F4 */ + 0, /* KEY_F5 */ + 0, /* KEY_F6 */ + 0, /* KEY_F7 */ + 0, /* KEY_F8 */ + 0, /* KEY_F9 */ + 0, /* KEY_F10 */ + 0, /* KEY_F11 */ + 0, /* KEY_F12 */ + 0, /* KEY_PRTSCN */ + 0, /* KEY_SCRLK */ + 0, /* KEY_PAUSE */ + ' ', /* KEY_SPACE */ + }, +}; + +dethrace_ascii_tables demo_ascii_tables = { + { + 0, /* KEY_SHIFT_ANY */ + 0, /* KEY_ALT_ANY */ + 0, /* KEY_CTRL_ANY */ + 0, /* KEY_CTRL_ANY_2 */ + 0, /* KEY_CAPSLOCK */ + 0, /* KEY_RSHIFT */ + 0, /* KEY_RALT */ + 0, /* KEY_RCTRL */ + 0, /* KEY_LSHIFT */ + 0, /* KEY_LALT */ + 0, /* KEY_LCTRL */ + '0', /* KEY_0 */ + '1', /* KEY_1 */ + '2', /* KEY_2 */ + '3', /* KEY_3 */ + '4', /* KEY_4 */ + '5', /* KEY_5 */ + '6', /* KEY_6 */ + '7', /* KEY_7 */ + '8', /* KEY_8 */ + '9', /* KEY_9 */ + 'A', /* KEY_A */ + 'B', /* KEY_B */ + 'C', /* KEY_C */ + 'D', /* KEY_D */ + 'E', /* KEY_E */ + 'F', /* KEY_F */ + 'G', /* KEY_G */ + 'H', /* KEY_H */ + 'I', /* KEY_I */ + 'J', /* KEY_J */ + 'K', /* KEY_K */ + 'L', /* KEY_L */ + 'M', /* KEY_M */ + 'N', /* KEY_N */ + 'O', /* KEY_O */ + 'P', /* KEY_P */ + 'Q', /* KEY_Q */ + 'R', /* KEY_R */ + 'S', /* KEY_S */ + 'T', /* KEY_T */ + 'U', /* KEY_U */ + 'V', /* KEY_V */ + 'W', /* KEY_W */ + 'X', /* KEY_X */ + 'Y', /* KEY_Y */ + 'Z', /* KEY_Z */ + '`', /* KEY_GRAVE */ + '-', /* KEY_MINUS */ + '=', /* KEY_EQUALS */ + '\b', /* KEY_BACKSPACE */ + '\r', /* KEY_RETURN */ + 0x03, /* KEY_KP_ENTER */ + '\t', /* KEY_TAB */ + '/', /* KEY_SLASH */ + '\\', /* KEY_UNKNOWN_55 */ + ';', /* KEY_SEMICOLON */ + '\'', /* KEY_APOSTROPHE */ + '.', /* KEY_PERIOD */ + ',', /* KEY_COMMA */ + '[', /* KEY_LBRACKET */ + ']', /* KEY_RBRACKET */ + '#', /* KEY_BACKSLASH */ + 0x1b, /* KEY_ESCAPE */ + 0, /* KEY_INSERT */ + 0x7f, /* KEY_DELETE */ + 0, /* KEY_HOME */ + 0, /* KEY_END */ + 0, /* KEY_PAGEUP */ + 0, /* KEY_PAGEDOWN */ + 0x1c, /* KEY_LEFT */ + 0x1d, /* KEY_RIGHT */ + 0x1e, /* KEY_UP */ + 0x1f, /* KEY_DOWN */ + 0, /* KEY_KP_NUMLOCK */ + '/', /* KEY_KP_DIVIDE */ + '*', /* KEY_KP_MULTIPLY */ + '-', /* KEY_KP_MINUS */ + '+', /* KEY_KP_PLUS */ + '.', /* KEY_KP_PERIOD */ + '=', /* KEY_KP_EQUALS */ + '0', /* KEY_KP_0 */ + '1', /* KEY_KP_1 */ + '2', /* KEY_KP_2 */ + '3', /* KEY_KP_3 */ + '4', /* KEY_KP_4 */ + '5', /* KEY_KP_5 */ + '6', /* KEY_KP_6 */ + '7', /* KEY_KP_7 */ + '8', /* KEY_KP_8 */ + '9', /* KEY_KP_9 */ + 0, /* KEY_F1 */ + 0, /* KEY_F2 */ + 0, /* KEY_F3 */ + 0, /* KEY_F4 */ + 0, /* KEY_F5 */ + 0, /* KEY_F6 */ + 0, /* KEY_F7 */ + 0, /* KEY_F8 */ + 0, /* KEY_F9 */ + 0, /* KEY_F10 */ + 0, /* KEY_F11 */ + 0, /* KEY_F12 */ + 0, /* KEY_PRTSCN */ + 0, /* KEY_SCRLK */ + 0, /* KEY_PAUSE */ + ' ', /* KEY_SPACE */ + }, + { + 0, /* KEY_SHIFT_ANY */ + 0, /* KEY_ALT_ANY */ + 0, /* KEY_CTRL_ANY */ + 0, /* KEY_CTRL_ANY_2 */ + 0, /* KEY_CAPSLOCK */ + 0, /* KEY_RSHIFT */ + 0, /* KEY_RALT */ + 0, /* KEY_RCTRL */ + 0, /* KEY_LSHIFT */ + 0, /* KEY_LALT */ + 0, /* KEY_LCTRL */ + ')', /* KEY_0 */ + '!', /* KEY_1 */ + '"', /* KEY_2 */ + 0xa3, /* KEY_3 (£) */ + '$', /* KEY_4 */ + '%', /* KEY_5 */ + '^', /* KEY_6 */ + '&', /* KEY_7 */ + '*', /* KEY_8 */ + '(', /* KEY_9 */ + 'A', /* KEY_A */ + 'B', /* KEY_B */ + 'C', /* KEY_C */ + 'D', /* KEY_D */ + 'E', /* KEY_E */ + 'F', /* KEY_F */ + 'G', /* KEY_G */ + 'H', /* KEY_H */ + 'I', /* KEY_I */ + 'J', /* KEY_J */ + 'K', /* KEY_K */ + 'L', /* KEY_L */ + 'M', /* KEY_M */ + 'N', /* KEY_N */ + 'O', /* KEY_O */ + 'P', /* KEY_P */ + 'Q', /* KEY_Q */ + 'R', /* KEY_R */ + 'S', /* KEY_S */ + 'T', /* KEY_T */ + 'U', /* KEY_U */ + 'V', /* KEY_V */ + 'W', /* KEY_W */ + 'X', /* KEY_X */ + 'Y', /* KEY_Y */ + 'Z', /* KEY_Z */ + 0xac, /* KEY_GRAVE (¬) */ + '_', /* KEY_MINUS */ + '+', /* KEY_EQUALS */ + '\b', /* KEY_BACKSPACE */ + '\r', /* KEY_RETURN */ + '\r', /* KEY_KP_ENTER */ + 0, /* KEY_TAB */ + '?', /* KEY_SLASH */ + '|', /* KEY_UNKNOWN_55 */ + ':', /* KEY_SEMICOLON */ + '@', /* KEY_APOSTROPHE */ + '>', /* KEY_PERIOD */ + ',', /* KEY_COMMA */ + '{', /* KEY_LBRACKET */ + '}', /* KEY_RBRACKET */ + '~', /* KEY_BACKSLASH */ + 0x1b, /* KEY_ESCAPE */ + 0, /* KEY_INSERT */ + 0, /* KEY_DELETE */ + 0, /* KEY_HOME */ + 0, /* KEY_END */ + 0, /* KEY_PAGEUP */ + 0, /* KEY_PAGEDOWN */ + 0, /* KEY_LEFT */ + 0, /* KEY_RIGHT */ + 0, /* KEY_UP */ + 0, /* KEY_DOWN */ + 0, /* KEY_KP_NUMLOCK */ + '/', /* KEY_KP_DIVIDE */ + '*', /* KEY_KP_MULTIPLY */ + '-', /* KEY_KP_MINUS */ + '+', /* KEY_KP_PLUS */ + '.', /* KEY_KP_PERIOD */ + 0, /* KEY_KP_EQUALS */ + '0', /* KEY_KP_0 */ + '1', /* KEY_KP_1 */ + '2', /* KEY_KP_2 */ + '3', /* KEY_KP_3 */ + '4', /* KEY_KP_4 */ + '5', /* KEY_KP_5 */ + '6', /* KEY_KP_6 */ + '7', /* KEY_KP_7 */ + '8', /* KEY_KP_8 */ + '9', /* KEY_KP_9 */ + 0, /* KEY_F1 */ + 0, /* KEY_F2 */ + 0, /* KEY_F3 */ + 0, /* KEY_F4 */ + 0, /* KEY_F5 */ + 0, /* KEY_F6 */ + 0, /* KEY_F7 */ + 0, /* KEY_F8 */ + 0, /* KEY_F9 */ + 0, /* KEY_F10 */ + 0, /* KEY_F11 */ + 0, /* KEY_F12 */ + 0, /* KEY_PRTSCN */ + 0, /* KEY_SCRLK */ + 0, /* KEY_PAUSE */ + ' ', /* KEY_SPACE */ + }, +}; + +dethrace_ascii_tables xmas_ascii_tables = { + { + 0, /* KEY_SHIFT_ANY */ + 0, /* KEY_ALT_ANY */ + 0, /* KEY_CTRL_ANY */ + 0, /* KEY_CTRL_ANY_2 */ + 0, /* KEY_CAPSLOCK */ + 0, /* KEY_RSHIFT */ + 0, /* KEY_RALT */ + 0, /* KEY_RCTRL */ + 0, /* KEY_LSHIFT */ + 0, /* KEY_LALT */ + 0, /* KEY_LCTRL */ + '0', /* KEY_0 */ + '1', /* KEY_1 */ + '2', /* KEY_2 */ + '3', /* KEY_3 */ + '4', /* KEY_4 */ + '5', /* KEY_5 */ + '6', /* KEY_6 */ + '7', /* KEY_7 */ + '8', /* KEY_8 */ + '9', /* KEY_9 */ + 'A', /* KEY_A */ + 'B', /* KEY_B */ + 'C', /* KEY_C */ + 'D', /* KEY_D */ + 'E', /* KEY_E */ + 'F', /* KEY_F */ + 'G', /* KEY_G */ + 'H', /* KEY_H */ + 'I', /* KEY_I */ + 'J', /* KEY_J */ + 'K', /* KEY_K */ + 'L', /* KEY_L */ + 'M', /* KEY_M */ + 'N', /* KEY_N */ + 'O', /* KEY_O */ + 'P', /* KEY_P */ + 'Q', /* KEY_Q */ + 'R', /* KEY_R */ + 'S', /* KEY_S */ + 'T', /* KEY_T */ + 'U', /* KEY_U */ + 'V', /* KEY_V */ + 'W', /* KEY_W */ + 'X', /* KEY_X */ + 'Y', /* KEY_Y */ + 'Z', /* KEY_Z */ + '`', /* KEY_GRAVE */ + '-', /* KEY_MINUS */ + '=', /* KEY_EQUALS */ + '\b', /* KEY_BACKSPACE */ + '\r', /* KEY_RETURN */ + 0x03, /* KEY_KP_ENTER */ + '\t', /* KEY_TAB */ + '/', /* KEY_SLASH */ + '\\', /* KEY_UNKNOWN_55 */ + ';', /* KEY_SEMICOLON */ + '\'', /* KEY_APOSTROPHE */ + '.', /* KEY_PERIOD */ + ',', /* KEY_COMMA */ + '[', /* KEY_LBRACKET */ + ']', /* KEY_RBRACKET */ + '#', /* KEY_BACKSLASH */ + 0x1b, /* KEY_ESCAPE */ + 0, /* KEY_INSERT */ + 0x7f, /* KEY_DELETE */ + 0, /* KEY_HOME */ + 0, /* KEY_END */ + 0, /* KEY_PAGEUP */ + 0, /* KEY_PAGEDOWN */ + 0x1c, /* KEY_LEFT */ + 0x1d, /* KEY_RIGHT */ + 0x1e, /* KEY_UP */ + 0x1f, /* KEY_DOWN */ + 0, /* KEY_KP_NUMLOCK */ + '/', /* KEY_KP_DIVIDE */ + '*', /* KEY_KP_MULTIPLY */ + '-', /* KEY_KP_MINUS */ + '+', /* KEY_KP_PLUS */ + '.', /* KEY_KP_PERIOD */ + '=', /* KEY_KP_EQUALS */ + '0', /* KEY_KP_0 */ + '1', /* KEY_KP_1 */ + '2', /* KEY_KP_2 */ + '3', /* KEY_KP_3 */ + '4', /* KEY_KP_4 */ + '5', /* KEY_KP_5 */ + '6', /* KEY_KP_6 */ + '7', /* KEY_KP_7 */ + '8', /* KEY_KP_8 */ + '9', /* KEY_KP_9 */ + 0, /* KEY_F1 */ + 0, /* KEY_F2 */ + 0, /* KEY_F3 */ + 0, /* KEY_F4 */ + 0, /* KEY_F5 */ + 0, /* KEY_F6 */ + 0, /* KEY_F7 */ + 0, /* KEY_F8 */ + 0, /* KEY_F9 */ + 0, /* KEY_F10 */ + 0, /* KEY_F11 */ + 0, /* KEY_F12 */ + 0, /* KEY_PRTSCN */ + 0, /* KEY_SCRLK */ + 0, /* KEY_PAUSE */ + ' ', /* KEY_SPACE */ + }, + { + 0, /* KEY_SHIFT_ANY */ + 0, /* KEY_ALT_ANY */ + 0, /* KEY_CTRL_ANY */ + 0, /* KEY_CTRL_ANY_2 */ + 0, /* KEY_CAPSLOCK */ + 0, /* KEY_RSHIFT */ + 0, /* KEY_RALT */ + 0, /* KEY_RCTRL */ + 0, /* KEY_LSHIFT */ + 0, /* KEY_LALT */ + 0, /* KEY_LCTRL */ + ')', /* KEY_0 */ + '!', /* KEY_1 */ + '"', /* KEY_2 */ + 0xa3, /* KEY_3 (£) */ + '$', /* KEY_4 */ + '%', /* KEY_5 */ + '^', /* KEY_6 */ + '&', /* KEY_7 */ + '*', /* KEY_8 */ + '(', /* KEY_9 */ + 'A', /* KEY_A */ + 'B', /* KEY_B */ + 'C', /* KEY_C */ + 'D', /* KEY_D */ + 'E', /* KEY_E */ + 'F', /* KEY_F */ + 'G', /* KEY_G */ + 'H', /* KEY_H */ + 'I', /* KEY_I */ + 'J', /* KEY_J */ + 'K', /* KEY_K */ + 'L', /* KEY_L */ + 'M', /* KEY_M */ + 'N', /* KEY_N */ + 'O', /* KEY_O */ + 'P', /* KEY_P */ + 'Q', /* KEY_Q */ + 'R', /* KEY_R */ + 'S', /* KEY_S */ + 'T', /* KEY_T */ + 'U', /* KEY_U */ + 'V', /* KEY_V */ + 'W', /* KEY_W */ + 'X', /* KEY_X */ + 'Y', /* KEY_Y */ + 'Z', /* KEY_Z */ + 0xac, /* KEY_GRAVE (¬) */ + '_', /* KEY_MINUS */ + '+', /* KEY_EQUALS */ + '\b', /* KEY_BACKSPACE */ + '\r', /* KEY_RETURN */ + '\r', /* KEY_KP_ENTER */ + 0, /* KEY_TAB */ + '?', /* KEY_SLASH */ + '|', /* KEY_UNKNOWN_55 */ + ':', /* KEY_SEMICOLON */ + '@', /* KEY_APOSTROPHE */ + '>', /* KEY_PERIOD */ + ',', /* KEY_COMMA */ + '{', /* KEY_LBRACKET */ + '}', /* KEY_RBRACKET */ + '~', /* KEY_BACKSLASH */ + 0x1b, /* KEY_ESCAPE */ + 0, /* KEY_INSERT */ + 0, /* KEY_DELETE */ + 0, /* KEY_HOME */ + 0, /* KEY_END */ + 0, /* KEY_PAGEUP */ + 0, /* KEY_PAGEDOWN */ + 0, /* KEY_LEFT */ + 0, /* KEY_RIGHT */ + 0, /* KEY_UP */ + 0, /* KEY_DOWN */ + 0, /* KEY_KP_NUMLOCK */ + '/', /* KEY_KP_DIVIDE */ + '*', /* KEY_KP_MULTIPLY */ + '-', /* KEY_KP_MINUS */ + '+', /* KEY_KP_PLUS */ + '.', /* KEY_KP_PERIOD */ + 0, /* KEY_KP_EQUALS */ + '0', /* KEY_KP_0 */ + '1', /* KEY_KP_1 */ + '2', /* KEY_KP_2 */ + '3', /* KEY_KP_3 */ + '4', /* KEY_KP_4 */ + '5', /* KEY_KP_5 */ + '6', /* KEY_KP_6 */ + '7', /* KEY_KP_7 */ + '8', /* KEY_KP_8 */ + '9', /* KEY_KP_9 */ + 0, /* KEY_F1 */ + 0, /* KEY_F2 */ + 0, /* KEY_F3 */ + 0, /* KEY_F4 */ + 0, /* KEY_F5 */ + 0, /* KEY_F6 */ + 0, /* KEY_F7 */ + 0, /* KEY_F8 */ + 0, /* KEY_F9 */ + 0, /* KEY_F10 */ + 0, /* KEY_F11 */ + 0, /* KEY_F12 */ + 0, /* KEY_PRTSCN */ + 0, /* KEY_SCRLK */ + 0, /* KEY_PAUSE */ + ' ', /* KEY_SPACE */ + }, +}; + +#endif /* DETHRACE_ASCII_TABLES_H */ diff --git a/src/harness/harness.c b/src/harness/harness.c index ff99379c..b8ea92c1 100644 --- a/src/harness/harness.c +++ b/src/harness/harness.c @@ -5,6 +5,7 @@ #include "include/harness/os.h" #include "platforms/null.h" #include "sound/sound.h" +#include "ascii_tables.h" #include "version.h" #include @@ -36,50 +37,6 @@ tHarness_game_config harness_game_config; // Platform hooks tHarness_platform gHarness_platform; -/* clang-format off */ -// German ASCII codes -static int carmageddon_german_ascii_table[128] = { - 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, 122, 121, 94, -33, -76, 8, 13, 13, 0, 45, 60, -10, -28, 46, 44, -4, 43, 35, 27, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 56, -33, -76, 46, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; -static int carmageddon_german_ascii_shift_table[128] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 33, 34, -89, 36, 37, 38, 47, 40, 41, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 89, -80, 63, 96, 8, 13, 13, 0, 95, 62, -42, -60, 58, 44, -36, 42, 39, 27, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 56, -33, -76, 46, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -// Demo ASCII codes -static int demo_ascii_table[128] = { - 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, 122, 121, 94, -33, -76, 8, 13, 13, 0, 45, 60, -10, -28, 46, 44, -4, 43, 35, 27, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 56, -33, -76, 46, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; -static int demo_ascii_shift_table[128] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 33, 34, -89, 36, 37, 38, 47, 40, 41, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 89, -80, 63, 96, 8, 13, 13, 0, 95, 62, -42, -60, 58, 44, -36, 42, 39, 27, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 56, -33, -76, 46, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -// Splatpack Demo ASCII codes -static int splatpack_xmasdemo_ascii_table[128] = { - 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, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 96, 45, 61, 8, 13, 3, 9, 47, 92, 59, 39, 46, 44, 91, 93, 35, 27, - 0, 127, 0, 0, 0, 0, 28, 29, 30, 31, 0, 47, 42, 45, 43, 46, 61, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, -}; -static int splatpack_xmasdemo_ascii_shift_table[128] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 33, 34, 163, 36, 37, 94, 38, 42, 40, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 172, 95, 43, 8, 13, 13, 0, 63, 124, 58, 64, 62, 44, 123, 125, 126, 27, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 42, 45, 43, 46, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, -}; -/* clang-format on */ - extern void Harness_Platform_Init(tHarness_platform* platform); int Harness_ProcessCommandLine(int* argc, char* argv[]); @@ -155,21 +112,24 @@ static void Harness_DetectGameMode(void) { case eGame_carmageddon: switch (harness_game_info.localization) { case eGameLocalization_german: - harness_game_info.defines.ascii_table = carmageddon_german_ascii_table; - harness_game_info.defines.ascii_shift_table = carmageddon_german_ascii_shift_table; + harness_game_info.defines.requires_ascii_table = 1; + harness_game_info.defines.ascii_table = carmageddon_german_ascii_tables.ascii; + harness_game_info.defines.ascii_shift_table = carmageddon_german_ascii_tables.ascii_shift; break; default: + harness_game_info.defines.ascii_table = carmageddon_ascii_tables.ascii; + harness_game_info.defines.ascii_shift_table = carmageddon_ascii_tables.ascii_shift; break; } break; case eGame_carmageddon_demo: - harness_game_info.defines.ascii_table = demo_ascii_table; - harness_game_info.defines.ascii_shift_table = demo_ascii_shift_table; + harness_game_info.defines.ascii_table = demo_ascii_tables.ascii; + harness_game_info.defines.ascii_shift_table = demo_ascii_tables.ascii_shift; break; case eGame_splatpack_demo: case eGame_splatpack_xmas_demo: - harness_game_info.defines.ascii_table = splatpack_xmasdemo_ascii_table; - harness_game_info.defines.ascii_shift_table = splatpack_xmasdemo_ascii_shift_table; + harness_game_info.defines.ascii_table = xmas_ascii_tables.ascii; + harness_game_info.defines.ascii_shift_table = xmas_ascii_tables.ascii_shift; break; default: break; @@ -181,6 +141,8 @@ void Harness_Init(int* argc, char* argv[]) { printf("Dethrace version: %s\n", DETHRACE_VERSION); + memset(&harness_game_info, 0, sizeof(harness_game_info)); + // disable the original CD check code harness_game_config.enable_cd_check = 0; // original physics time step. Lower values seem to work better at 30+ fps diff --git a/src/harness/include/harness/config.h b/src/harness/include/harness/config.h index 17c74475..db45c7da 100644 --- a/src/harness/include/harness/config.h +++ b/src/harness/include/harness/config.h @@ -23,6 +23,8 @@ typedef struct tHarness_game_info { char* INTRO_SMK_FILE; // different between demo and full game char* GERMAN_LOADSCRN; + // some versions have an ascii table built-in, others provide it through KEYBOARD.COK + int requires_ascii_table; // built-in keyboard look-up table for certain localized Carmageddon releases int* ascii_table; // built-in shifted keyboard look-up table for certain localized Carmageddon releases