diff --git a/engines/chamber/cga.cpp b/engines/chamber/cga.cpp index 87b2d3d88ac..37878849416 100644 --- a/engines/chamber/cga.cpp +++ b/engines/chamber/cga.cpp @@ -1332,11 +1332,11 @@ void CGA_ZoomImage(byte *pixels, byte w, byte h, byte nw, byte nh, byte *target, zoom.oh = h; zoom.ew = (w * 4) - 1; zoom.eh = h - 1; -#ifdef VERSION_USA - zoom.xbase = 0; -#else - zoom.xbase = ((w * 4 / 2) - 1) % 4; -#endif + + if (g_vm->getLanguage() == Common::EN_USA) + zoom.xbase = 0; + else + zoom.xbase = ((w * 4 / 2) - 1) % 4; /*TODO: why this nw/nh order? maybe bug*/ #if 0 diff --git a/engines/chamber/common.h b/engines/chamber/common.h index bd330bff9c1..4f9d4d1ffc4 100644 --- a/engines/chamber/common.h +++ b/engines/chamber/common.h @@ -25,8 +25,6 @@ namespace Chamber { -#define VERSION_USA - #define BE(x) ((((x) >> 8) | ((x) << 8)) & 0xffff) #define LE16(x) (x) diff --git a/engines/chamber/detection.cpp b/engines/chamber/detection.cpp index bb4bd7ba76d..9f060e2f9bb 100644 --- a/engines/chamber/detection.cpp +++ b/engines/chamber/detection.cpp @@ -34,7 +34,7 @@ static const ADGameDescription gameDescriptions[] = { { "chamber", "", - AD_ENTRY1s("kult1.pxi", "fc0bd31a3c380338f76ff53e421e47b6", 140537), + AD_ENTRY1s("ere.pxi", "5aa5bd2d79eefde70675b0b6734944f2", 134358), Common::UNK_LANG, // EN/FR/DE Common::kPlatformDOS, ADGF_UNSTABLE, @@ -44,7 +44,7 @@ static const ADGameDescription gameDescriptions[] = { { "chamber", "", - AD_ENTRY1s("ere.pxi", "5aa5bd2d79eefde70675b0b6734944f2", 134358), + AD_ENTRY1s("kult1.pxi", "fc0bd31a3c380338f76ff53e421e47b6", 140537), Common::EN_USA, Common::kPlatformDOS, ADGF_UNSTABLE, diff --git a/engines/chamber/dialog.cpp b/engines/chamber/dialog.cpp index 2a3fcd061b6..ad2eaefa25a 100644 --- a/engines/chamber/dialog.cpp +++ b/engines/chamber/dialog.cpp @@ -117,11 +117,11 @@ void DrawPersonBubble(byte x, byte y, byte flags, byte *msg) { char_draw_max_width = flags & 0x1F; char_xlat_table = chars_color_bonw; -#ifdef VERSION_USA - CalcStringSize(msg, &ww, &nw); - if (ww >= char_draw_max_width) - char_draw_max_width = ww; -#endif + if (g_vm->getLanguage() == Common::EN_USA) { + CalcStringSize(msg, &ww, &nw); + if (ww >= char_draw_max_width) + char_draw_max_width = ww; + } /*upper border*/ ofs = CGA_CalcXY_p(x, y); diff --git a/engines/chamber/ifgm.cpp b/engines/chamber/ifgm.cpp index b0142a025c3..0b63039d4a0 100644 --- a/engines/chamber/ifgm.cpp +++ b/engines/chamber/ifgm.cpp @@ -32,11 +32,12 @@ byte ifgm_loaded = 0; byte ifgm_flag2; void IFGM_Init(void) { -#ifdef VERSION_USA - /*TODO*/ -#else - ifgm_loaded = 0; -#endif + if (g_vm->getLanguage() == Common::EN_USA) { + /*TODO*/ + } else { + ifgm_loaded = 0; + } + } void IFGM_Shutdown(void) { diff --git a/engines/chamber/input.cpp b/engines/chamber/input.cpp index 7545fe7aaa5..1c4eec27e4c 100644 --- a/engines/chamber/input.cpp +++ b/engines/chamber/input.cpp @@ -84,10 +84,6 @@ byte ChamberEngine::readKeyboardChar() { void ClearKeyboard(void) { } -#ifdef VERSION_USA -extern int16 AskQuitGame(void); -#endif - void SetInputButtons(byte keys) { if (keys & 2) right_button = ~0; @@ -147,8 +143,12 @@ byte PollKeyboard(void) { Show game exit confirmation dialog and get user's input */ int16 AskQuitGame(void) { + /*EU version comes without requited text string*/ + if (g_vm->getLanguage() != Common::EN_USA) + return 0; + int16 quit = -1; -#ifdef VERSION_USA + byte *msg = SeekToString(desci_data, 411); /*DO YOU WANT TO QUIT ? (Y OR N).*/ char_draw_max_width = 32; draw_x = 1; @@ -177,9 +177,8 @@ int16 AskQuitGame(void) { } } CGA_CopyScreenBlock(backbuffer, char_draw_max_width + 2, char_draw_coords_y - draw_y + 8, frontbuffer, CGA_CalcXY_p(draw_x, draw_y)); -#endif - /*EU version comes without requited text string*/ - return quit == 1; + + return quit; } void PollInputButtonsOnly() { @@ -194,10 +193,10 @@ void PollInput(void) { if (event.kbd.keycode == Common::KEYCODE_SPACE) mouseButtons |= 1; else if (event.kbd.keycode == Common::KEYCODE_ESCAPE) { -#ifdef VERSION_USA - if (AskQuitGame() != 0) - g_vm->_shouldQuit = true; -#endif + if (g_vm->getLanguage() == Common::EN_USA) { + if (AskQuitGame() != 0) + g_vm->_shouldQuit = true; + } } break; diff --git a/engines/chamber/kult.cpp b/engines/chamber/kult.cpp index 44b338061cd..deceb0d7da8 100644 --- a/engines/chamber/kult.cpp +++ b/engines/chamber/kult.cpp @@ -217,19 +217,19 @@ Common::Error ChamberEngine::run() { /* Install timer callback */ InitTimer(); -#ifdef VERSION_USA - /* Load title screen */ - if (!LoadSplash("PRESCGA.BIN")) - ExitGame(); + if (g_vm->getLanguage() == Common::EN_USA) { + /* Load title screen */ + if (!LoadSplash("PRESCGA.BIN")) + ExitGame(); - if (ifgm_loaded) { - /*TODO*/ + if (ifgm_loaded) { + /*TODO*/ + } + } else { + /* Load title screen */ + if (!LoadSplash("PRES.BIN")) + ExitGame(); } -#else - /* Load title screen */ - if (!LoadSplash("PRES.BIN")) - ExitGame(); -#endif /* Select intense cyan-mageta palette */ CGA_ColorSelect(0x30); @@ -237,36 +237,36 @@ Common::Error ChamberEngine::run() { /* Show the title screen */ CGA_BackBufferToRealFull(); -#ifdef VERSION_USA - if (ifgm_loaded) { - /*TODO*/ + if (g_vm->getLanguage() == Common::EN_USA) { + if (ifgm_loaded) { + /*TODO*/ + } + + /* Force English language */ + c = 'E'; + } else { + /* Load language selection screen */ + if (!LoadSplash("DRAP.BIN")) + ExitGame(); + + /* Wait for a keypress and show the language selection screen */ + ClearKeyboard(); + readKeyboardChar(); + + if (_shouldQuit) + return Common::kNoError; + + CGA_BackBufferToRealFull(); + ClearKeyboard(); + + /* Wait for a valid language choice */ + do { + c = readKeyboardChar(); + if (c > 'F') + c -= ' '; + } while (c < 'D' || c > 'F'); } - /* Force English language */ - c = 'E'; -#else - /* Load language selection screen */ - if (!LoadSplash("DRAP.BIN")) - ExitGame(); - - /* Wait for a keypress and show the language selection screen */ - ClearKeyboard(); - readKeyboardChar(); - - if (_shouldQuit) - return Common::kNoError; - - CGA_BackBufferToRealFull(); - ClearKeyboard(); - - /* Wait for a valid language choice */ - do { - c = readKeyboardChar(); - if (c > 'F') - c -= ' '; - } while (c < 'D' || c > 'F'); -#endif - if (_shouldQuit) return Common::kNoError; @@ -276,9 +276,8 @@ Common::Error ChamberEngine::run() { res_desci[0].name[4] = c; res_diali[0].name[4] = c; -#ifndef VERSION_USA - CGA_BackBufferToRealFull(); -#endif + if (g_vm->getLanguage() != Common::EN_USA) + CGA_BackBufferToRealFull(); /* Load script and other static resources */ /* Those are normally embedded in the executable, but here we load extracted ones*/ @@ -305,11 +304,11 @@ Common::Error ChamberEngine::run() { /* Detect CPU speed for delay routines */ cpu_speed_delay = BenchmarkCpu() / 8; -#ifdef VERSION_USA - if (ifgm_loaded) { - /*TODO*/ + if (g_vm->getLanguage() == Common::EN_USA) { + if (ifgm_loaded) { + /*TODO*/ + } } -#endif /*restart game from here*/ restart:; diff --git a/engines/chamber/portrait.cpp b/engines/chamber/portrait.cpp index f1053a0fa1d..791445409ea 100644 --- a/engines/chamber/portrait.cpp +++ b/engines/chamber/portrait.cpp @@ -311,20 +311,20 @@ void BlinkToRed(void) { } void BlinkToWhite(void) { -#ifdef VERSION_USA - PlayHurtSound(); /*TODO: play here and later? looks like a bug, original code will trash palette selection if pcspeaker is used*/ -#endif + if (g_vm->getLanguage() == Common::EN_USA) + PlayHurtSound(); /*TODO: play here and later? looks like a bug, original code will trash palette selection if pcspeaker is used*/ + BlinkWithSound(0x3F); } volatile byte vblank_ticks; void WaitVBlankTimer(void) { -#ifdef VERSION_USA - /*A crude attempt to fix the animation speed...*/ - while (vblank_ticks < 3) ; - vblank_ticks = 0; -#endif + if (g_vm->getLanguage() == Common::EN_USA) { + /*A crude attempt to fix the animation speed...*/ + while (vblank_ticks < 3) ; + vblank_ticks = 0; + } WaitVBlank(); } diff --git a/engines/chamber/print.cpp b/engines/chamber/print.cpp index d31c8c0f553..0458c862710 100644 --- a/engines/chamber/print.cpp +++ b/engines/chamber/print.cpp @@ -163,12 +163,14 @@ byte *PrintStringLine(byte *str, uint16 *left, byte *target) { byte *PrintStringPadded(byte *str, byte *target) { uint16 w; -#ifndef VERSION_USA - uint16 n; - CalcStringSize(str, &w, &n); - if (w + 2 >= char_draw_max_width) - char_draw_max_width = w + 2; -#endif + + if (g_vm->getLanguage() != Common::EN_USA) { + uint16 n; + CalcStringSize(str, &w, &n); + if (w + 2 >= char_draw_max_width) + char_draw_max_width = w + 2; + } + str = PrintStringLine(str, &w, target); if (w != 0) PrintStringPad(w, target); @@ -199,11 +201,11 @@ void CGA_DrawTextBox(byte *msg, byte *target) { char_xlat_table = chars_color_bonc; -#ifdef VERSION_USA - CalcStringSize(msg, &ww, &nw); - if (ww >= char_draw_max_width) - char_draw_max_width = ww; -#endif + if (g_vm->getLanguage() == Common::EN_USA) { + CalcStringSize(msg, &ww, &nw); + if (ww >= char_draw_max_width) + char_draw_max_width = ww; + } x = draw_x * 4; y = draw_y; diff --git a/engines/chamber/resdata.cpp b/engines/chamber/resdata.cpp index b8bbcd0b6f4..91cfd6b5441 100644 --- a/engines/chamber/resdata.cpp +++ b/engines/chamber/resdata.cpp @@ -138,7 +138,10 @@ NB! Static data includes the font file, don't use any text print routines before int16 LoadStaticData() { Common::File pxi; - pxi.open("ere.pxi"); + if (g_vm->getLanguage() == Common::EN_USA) + pxi.open("kult1.pxi"); + else + pxi.open("ere.pxi"); uint numMods = pxi.readUint16BE(); uint modBase = 2 + numMods * 4; diff --git a/engines/chamber/resdata.h b/engines/chamber/resdata.h index 72773caedb7..f5adfc91a0a 100644 --- a/engines/chamber/resdata.h +++ b/engines/chamber/resdata.h @@ -36,7 +36,6 @@ typedef struct ResEntry_tp { } ResEntry_tp; /* Max resource file size among all languages */ -#ifdef VERSION_USA #define RES_ALEAT_MAX 256 #define RES_ANICO_MAX 667 #define RES_ANIMA_MAX 2046 @@ -58,29 +57,6 @@ typedef struct ResEntry_tp { #define RES_DIALI_MAX 9636 #define RES_MOTSI_MAX 1082 #define RES_VEPCI_MAX 1345 -#else -#define RES_ALEAT_MAX 256 -#define RES_ANICO_MAX 667 -#define RES_ANIMA_MAX 2046 -#define RES_ARPLA_MAX 7910 -#define RES_CARPC_MAX 384 -#define RES_GAUSS_MAX 1449 -#define RES_ICONE_MAX 2756 -#define RES_LUTIN_MAX 2800 -#define RES_MURSM_MAX 76 -#define RES_SOUCO_MAX 424 -#define RES_SOURI_MAX 1152 -#define RES_TEMPL_MAX 27337 -#define RES_ZONES_MAX 9014 -#define RES_PUZZL_MAX 45671 -#define RES_SPRIT_MAX 23811 -#define RES_PERS1_MAX 14294 -#define RES_PERS2_MAX 10587 -#define RES_DESCI_MAX 10515 -#define RES_DIALI_MAX 9636 -#define RES_MOTSI_MAX 1082 -#define RES_VEPCI_MAX 1345 -#endif extern byte vepci_data[]; extern byte motsi_data[]; diff --git a/engines/chamber/room.cpp b/engines/chamber/room.cpp index ea52c9d0376..7e7b91d932f 100644 --- a/engines/chamber/room.cpp +++ b/engines/chamber/room.cpp @@ -1527,12 +1527,12 @@ void DrawTheWallDoors(void) { case 9: case 102: CGA_Blit(LoadMursmSprite(0) + 10, 20, 10, 59, CGA_SCREENBUFFER, CGA_CalcXY_p(64 / CGA_PIXELS_PER_BYTE, 32)); -#ifdef VERSION_USA - /*This fixes odd black patch on the right gate door*/ - CGA_Blit(LoadMursmSprite(1) , 20, 10, 59, CGA_SCREENBUFFER, CGA_CalcXY_p(184 / CGA_PIXELS_PER_BYTE, 32)); -#else - CGA_Blit(LoadMursmSprite(1) , 20, 10, 59, CGA_SCREENBUFFER, CGA_CalcXY_p(180 / CGA_PIXELS_PER_BYTE, 32)); -#endif + if (g_vm->getLanguage() == Common::EN_USA) { + /*This fixes odd black patch on the right gate door*/ + CGA_Blit(LoadMursmSprite(1) , 20, 10, 59, CGA_SCREENBUFFER, CGA_CalcXY_p(184 / CGA_PIXELS_PER_BYTE, 32)); + } else { + CGA_Blit(LoadMursmSprite(1) , 20, 10, 59, CGA_SCREENBUFFER, CGA_CalcXY_p(180 / CGA_PIXELS_PER_BYTE, 32)); + } break; case 95: case 103: diff --git a/engines/chamber/script.cpp b/engines/chamber/script.cpp index 88f4384a976..4433e92ae5c 100644 --- a/engines/chamber/script.cpp +++ b/engines/chamber/script.cpp @@ -2885,26 +2885,25 @@ void TheEnd(void) { AnimSaucer(); -#ifdef VERSION_USA - DrawPortraitZoomed(&pimage2); + if (g_vm->getLanguage() == Common::EN_USA) { + DrawPortraitZoomed(&pimage2); - script_byte_vars.zone_index = 135; + script_byte_vars.zone_index = 135; - do - { - PollInputButtonsOnly(); + do { + PollInputButtonsOnly(); + } + while(buttons == 0); + + while (!LoadFond()) + AskDisk2(); + JaggedZoom(backbuffer, frontbuffer); + CGA_BackBufferToRealFull(); + } else { + while (!LoadSplash("PRES.BIN")) + AskDisk2(); + CGA_BackBufferToRealFull(); } - while(buttons == 0); - - while (!LoadFond()) - AskDisk2(); - JaggedZoom(backbuffer, frontbuffer); - CGA_BackBufferToRealFull(); -#else - while (!LoadSplash("PRES.BIN")) - AskDisk2(); - CGA_BackBufferToRealFull(); -#endif } uint16 SCR_5B_TheEnd(void) { @@ -2913,11 +2912,11 @@ uint16 SCR_5B_TheEnd(void) { TheEnd(); -#ifdef VERSION_USA - RestartGame(); -#else - for (;;) ; /*HANG*/ -#endif + if (g_vm->getLanguage() == Common::EN_USA) + RestartGame(); + else + for (;;) ; /*HANG*/ + return 0; }