Launcher : version du jeu reconnue, compilée et lancée dans build_xx
- src/version.rs : version reconnue par l'empreinte MD5 de TUCKER.EXE et INTRO.EXE (mêmes valeurs que tools/version.py), MD5 sans dépendance ; test sur les jeux extraits s'ils sont là. - Carte Compilation : la version s'affiche (drapeau, « reconnue ») au lieu du choix inactif ; TUCKER.EXE inconnu ou INTRO.EXE d'un autre CD en rouge ; avertissement pour l'espagnol sans voix. - Compilation dans build\ (FR) ou build_xx\ ; « Recompiler seulement » passe la version à build.bat nogen ; JOUER lance build_xx\tucker.exe. - Le dossier ..\Install\C\TUCKER (installation DOS française) n'est plus deviné pour les autres versions. - .\build.bat : cmd ne trouvait pas le script si NoDefaultCurrentDirectoryInExePath est réglé. - README et guides (5 langues) : versions reconnues, en test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
abcc4a554d
commit
37f1e1edaa
13 files changed
+261
-69
No files matched your search
+1
-1
@@ -12,7 +12,7 @@ verändern oder weiterzugeben.
|
||||
> ⚠️ In Arbeit. **Sie müssen das Originalspiel besitzen**: Dieses Repository enthält keine
|
||||
> Spieldateien und keinen aus seinen ausführbaren Dateien erzeugten Code.
|
||||
|
||||
> 💿 **Derzeit unterstützte Version: die französische CD als ISO-Abbild**, die auf [dieser Abandonware-France-Seite](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (Abschnitt „Version ISO“, dort ist alles erklärt). So prüfen Sie es: `TUCKER\TUCKER.EXE` ist **284 677 Bytes** groß. Die englische, deutsche, spanische und polnische Version werden noch nicht unterstützt: Ihre ausführbare Datei ist anders ([Details, auf Englisch](docs/TECHNIQUE.en.md#7-game-versions)).
|
||||
> 💿 **Derzeit unterstützte Version: die französische CD als ISO-Abbild**, die auf [dieser Abandonware-France-Seite](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (Abschnitt „Version ISO“, dort ist alles erklärt). So prüfen Sie es: `TUCKER\TUCKER.EXE` ist **284 677 Bytes** groß. Die englische, deutsche, spanische und polnische Version erkennt der Launcher und kompiliert sie, sie sind aber noch im Test (die spanische hat keine Sprachausgabe: Derzeit laufen die Dialogzeilen zu schnell vorbei) ([Details, auf Englisch](docs/TECHNIQUE.en.md#7-game-versions)).
|
||||
|
||||
> ⚠️ **Derzeit: HD-Hintergründe ja, HD-Sprites nein.** Die HD-Hintergründe sehen gut aus, aber
|
||||
> HD-Figuren und -Objekte (Sprites) sind noch fehlerhaft: abgeschnittene Bilder, manche Figuren
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ SDL2. The goal is to bring the game back to life: sharp and smooth on big screen
|
||||
> ⚠️ Work in progress. **You must own the original game**: this repository contains no game files
|
||||
> and no code generated from its executables.
|
||||
|
||||
> 💿 **Supported version for now: the French CD, as an ISO image**, the one on [this Abandonware France page](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) ("ISO version" section, everything is explained there). How to check: `TUCKER\TUCKER.EXE` is **284,677 bytes**. The English, German, Spanish and Polish versions are not supported yet: their executable is different ([details](docs/TECHNIQUE.en.md#7-game-versions)).
|
||||
> 💿 **Supported version for now: the French CD, as an ISO image**, the one on [this Abandonware France page](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) ("ISO version" section, everything is explained there). How to check: `TUCKER\TUCKER.EXE` is **284,677 bytes**. The English, German, Spanish and Polish versions are recognised by the launcher and can be built, but are still being tested (the Spanish one has no voices: for now, lines go by too fast) ([details](docs/TECHNIQUE.en.md#7-game-versions)).
|
||||
|
||||
> ⚠️ **For now: HD backgrounds yes, HD sprites no.** HD backgrounds look good, but HD characters
|
||||
> and objects (sprites) are still buggy: cut-off pictures, some characters don't show up. It is
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ abierto a los mods, sin modificar ni redistribuir nunca los archivos originales
|
||||
> ⚠️ En desarrollo. **Necesitas tener el juego original**: este repositorio no contiene ningún
|
||||
> archivo del juego ni código generado a partir de sus ejecutables.
|
||||
|
||||
> 💿 **Versión compatible por ahora: el CD francés, como imagen ISO**, la de [esta página de Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (sección «Version ISO», allí se explica todo). Cómo comprobarlo: `TUCKER\TUCKER.EXE` ocupa **284 677 bytes**. Las versiones inglesa, alemana, española y polaca aún no son compatibles: su ejecutable es distinto ([detalles, en inglés](docs/TECHNIQUE.en.md#7-game-versions)).
|
||||
> 💿 **Versión compatible por ahora: el CD francés, como imagen ISO**, la de [esta página de Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (sección «Version ISO», allí se explica todo). Cómo comprobarlo: `TUCKER\TUCKER.EXE` ocupa **284 677 bytes**. Las versiones inglesa, alemana, española y polaca las reconoce el launcher y se compilan, pero aún están en pruebas (la española no tiene voces: por ahora, las frases pasan demasiado rápido) ([detalles, en inglés](docs/TECHNIQUE.en.md#7-game-versions)).
|
||||
|
||||
> ⚠️ **Por ahora: fondos HD sí, sprites HD no.** Los fondos HD se ven bien, pero los personajes y
|
||||
> objetos HD (sprites) todavía fallan: imágenes cortadas, algunos personajes no aparecen. Se
|
||||
|
||||
@@ -11,7 +11,7 @@ mods, sans jamais modifier ni redistribuer les fichiers originaux.
|
||||
> ⚠️ Projet en cours de développement. **Vous devez posséder le jeu original** : ce dépôt ne
|
||||
> contient aucun fichier du jeu, ni aucun code généré à partir de ses exécutables.
|
||||
|
||||
> 💿 **Version compatible pour le moment : la version française du CD, en image ISO**, celle de [cette fiche Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (partie « version ISO », tout y est expliqué). Repère : `TUCKER\TUCKER.EXE` fait **284 677 octets**. Les versions anglaise, allemande, espagnole et polonaise ne sont pas encore prises en charge : leur exécutable est différent ([détails](docs/TECHNIQUE.md#7-les-versions-du-jeu)).
|
||||
> 💿 **Version compatible pour le moment : la version française du CD, en image ISO**, celle de [cette fiche Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (partie « version ISO », tout y est expliqué). Repère : `TUCKER\TUCKER.EXE` fait **284 677 octets**. Les versions anglaise, allemande, espagnole et polonaise sont reconnues par le launcher et se compilent, mais sont encore en test (l'espagnole n'a pas de voix : pour l'instant, les répliques passent trop vite) ([détails](docs/TECHNIQUE.md#7-les-versions-du-jeu)).
|
||||
|
||||
> ⚠️ **Pour le moment : décors HD oui, sprites HD non.** Les décors HD rendent bien, mais les
|
||||
> personnages et objets HD (sprites) sont encore bogués : images coupées, certains personnages
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ na mody, bez modyfikowania i rozpowszechniania oryginalnych plików gry.
|
||||
> ⚠️ Prace w toku. **Musisz mieć oryginalną grę**: to repozytorium nie zawiera żadnych plików gry
|
||||
> ani kodu wygenerowanego z jej plików wykonywalnych.
|
||||
|
||||
> 💿 **Obecnie obsługiwana wersja: francuskie CD jako obraz ISO**, ta z [tej strony Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (sekcja „Version ISO”, tam wszystko jest wyjaśnione). Jak sprawdzić: `TUCKER\TUCKER.EXE` ma **284 677 bajtów**. Wersje angielska, niemiecka, hiszpańska i polska nie są jeszcze obsługiwane: ich plik wykonywalny jest inny ([szczegóły, po angielsku](docs/TECHNIQUE.en.md#7-game-versions)).
|
||||
> 💿 **Obecnie obsługiwana wersja: francuskie CD jako obraz ISO**, ta z [tej strony Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (sekcja „Version ISO”, tam wszystko jest wyjaśnione). Jak sprawdzić: `TUCKER\TUCKER.EXE` ma **284 677 bajtów**. Wersje angielską, niemiecką, hiszpańską i polską launcher rozpoznaje i kompiluje, ale są jeszcze w testach (hiszpańska nie ma głosów: na razie kwestie znikają zbyt szybko) ([szczegóły, po angielsku](docs/TECHNIQUE.en.md#7-game-versions)).
|
||||
|
||||
> ⚠️ **Na razie: tła HD tak, sprite'y HD nie.** Tła HD wyglądają dobrze, ale postacie i przedmioty HD
|
||||
> (sprite'y) wciąż mają błędy: ucięte obrazki, niektóre postacie się nie pojawiają. Zalecamy grać
|
||||
|
||||
+6
-4
@@ -95,7 +95,7 @@ ist dort langsam.
|
||||
|
||||
## 4. Das Originalspiel vorbereiten
|
||||
|
||||
> 💿 **Derzeit unterstützte Version: die französische CD als ISO-Abbild**, die auf [dieser Abandonware-France-Seite](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (Abschnitt „Version ISO“, dort ist alles erklärt). So prüfen Sie es: `TUCKER\TUCKER.EXE` ist **284 677 Bytes** groß. Die englische, deutsche, spanische und polnische Version werden noch nicht unterstützt: Ihre ausführbare Datei ist anders ([Details](TECHNIQUE.en.md#7-game-versions)).
|
||||
> 💿 **Derzeit unterstützte Version: die französische CD als ISO-Abbild**, die auf [dieser Abandonware-France-Seite](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (Abschnitt „Version ISO“, dort ist alles erklärt). So prüfen Sie es: `TUCKER\TUCKER.EXE` ist **284 677 Bytes** groß. Die englische, deutsche, spanische und polnische Version erkennt der Launcher und kompiliert sie, sie sind aber noch im Test (die spanische hat keine Sprachausgabe: Derzeit laufen die Dialogzeilen zu schnell vorbei) ([Details](TECHNIQUE.en.md#7-game-versions)).
|
||||
|
||||
Das Projekt braucht den Ordner, der **`TUCKER.EXE`** und **`INTRO.EXE`** enthält, zusammen mit den
|
||||
übrigen Dateien der CD (Bilder, Töne, Videos). Drei Möglichkeiten:
|
||||
@@ -145,9 +145,11 @@ Spiel, das sich noch nicht starten lässt:
|
||||
- SDL2 fehlt: **Herunterladen** (offizielles Archiv SDL 2.32.10, entpackt nach `third_party\`);
|
||||
- Python oder MSVC nicht gefunden: Zurück zu [Schritt 2](#2-die-werkzeuge-installieren), dann **Prüfen**.
|
||||
3. **Kompilierung**:
|
||||
- **Spielversion**: die Sprache Ihrer CD. Derzeit lässt sich nur die **französische** Version
|
||||
kompilieren; die anderen (Englisch, Deutsch, Spanisch, Polnisch) sind schon in der Liste, mit
|
||||
dem Vermerk „bald“, und kommen später.
|
||||
- **Spielversion**: die Sprache Ihrer CD, automatisch erkannt anhand von `TUCKER.EXE` und
|
||||
`INTRO.EXE` (Französisch, Englisch, Deutsch, Spanisch oder Polnisch). Jede Version wird in
|
||||
einem eigenen Ordner kompiliert: `build\` für die französische, `build_en\`, `build_de\`…
|
||||
für die anderen, und **SPIELEN** startet die des gewählten Spiels. Eine unbekannte
|
||||
`TUCKER.EXE` wird rot angezeigt.
|
||||
- **Erzeugen und kompilieren**: Der Launcher übersetzt `TUCKER.EXE` und `INTRO.EXE` in C (etwa
|
||||
1 500 Funktionen) und kompiliert dann. Das dauert eine bis fünf Minuten; das **Protokoll**
|
||||
zeigt den Fortschritt. Am Ende: „Spiel kompiliert“.
|
||||
|
||||
+5
-4
@@ -88,7 +88,7 @@ archive. Avoid synced folders (OneDrive): building there is slow.
|
||||
|
||||
## 4. Prepare the original game
|
||||
|
||||
> 💿 **Supported version for now: the French CD, as an ISO image**, the one on [this Abandonware France page](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) ("ISO version" section, everything is explained there). How to check: `TUCKER\TUCKER.EXE` is **284,677 bytes**. The English, German, Spanish and Polish versions are not supported yet: their executable is different ([details](TECHNIQUE.en.md#7-game-versions)).
|
||||
> 💿 **Supported version for now: the French CD, as an ISO image**, the one on [this Abandonware France page](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) ("ISO version" section, everything is explained there). How to check: `TUCKER\TUCKER.EXE` is **284,677 bytes**. The English, German, Spanish and Polish versions are recognised by the launcher and can be built, but are still being tested (the Spanish one has no voices: for now, lines go by too fast) ([details](TECHNIQUE.en.md#7-game-versions)).
|
||||
|
||||
The project needs the folder that contains **`TUCKER.EXE`** and **`INTRO.EXE`**, along with the
|
||||
other CD files (pictures, sounds, videos). Three options:
|
||||
@@ -137,9 +137,10 @@ cannot be started yet:
|
||||
- SDL2 missing: **Download** (official SDL 2.32.10 archive, unzipped into `third_party\`);
|
||||
- Python or MSVC not found: go back to [step 2](#2-install-the-tools), then **Check**.
|
||||
3. **Build**:
|
||||
- **Game version**: the language of your CD. For now only the **French** version can be built;
|
||||
the others (English, German, Spanish, Polish) are already in the list, marked "coming soon",
|
||||
and will come later.
|
||||
- **Game version**: the language of your CD, detected by itself from `TUCKER.EXE` and
|
||||
`INTRO.EXE` (French, English, German, Spanish or Polish). Each version is built in its own
|
||||
folder: `build\` for the French one, `build_en\`, `build_de\`… for the others, and **PLAY**
|
||||
starts the one of the chosen game. An unknown `TUCKER.EXE` is flagged in red.
|
||||
- **Generate and build**: the launcher translates `TUCKER.EXE` and `INTRO.EXE` to C
|
||||
(about 1,500 functions), then compiles. It takes one to five minutes; the **Log** shows
|
||||
progress. At the end: "Game built".
|
||||
|
||||
+5
-4
@@ -92,7 +92,7 @@ archivo. Evita las carpetas sincronizadas (OneDrive): allí la compilación es l
|
||||
|
||||
## 4. Preparar el juego original
|
||||
|
||||
> 💿 **Versión compatible por ahora: el CD francés, como imagen ISO**, la de [esta página de Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (sección «Version ISO», allí se explica todo). Cómo comprobarlo: `TUCKER\TUCKER.EXE` ocupa **284 677 bytes**. Las versiones inglesa, alemana, española y polaca aún no son compatibles: su ejecutable es distinto ([detalles](TECHNIQUE.en.md#7-game-versions)).
|
||||
> 💿 **Versión compatible por ahora: el CD francés, como imagen ISO**, la de [esta página de Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (sección «Version ISO», allí se explica todo). Cómo comprobarlo: `TUCKER\TUCKER.EXE` ocupa **284 677 bytes**. Las versiones inglesa, alemana, española y polaca las reconoce el launcher y se compilan, pero aún están en pruebas (la española no tiene voces: por ahora, las frases pasan demasiado rápido) ([detalles](TECHNIQUE.en.md#7-game-versions)).
|
||||
|
||||
El proyecto necesita la carpeta que contiene **`TUCKER.EXE`** e **`INTRO.EXE`**, junto con los
|
||||
demás archivos del CD (imágenes, sonidos, vídeos). Tres opciones:
|
||||
@@ -142,9 +142,10 @@ el juego, que todavía no se puede lanzar:
|
||||
- falta SDL2: **Descargar** (archivo oficial SDL 2.32.10, descomprimido en `third_party\`);
|
||||
- Python o MSVC no encontrado: vuelve al [paso 2](#2-instalar-las-herramientas) y luego **Comprobar**.
|
||||
3. **Compilación**:
|
||||
- **Versión del juego**: el idioma de tu CD. Por ahora solo se puede compilar la versión
|
||||
**francesa**; las demás (inglesa, alemana, española, polaca) ya aparecen en la lista, marcadas
|
||||
«próximamente», y llegarán más adelante.
|
||||
- **Versión del juego**: el idioma de tu CD, detectado solo a partir de `TUCKER.EXE` e
|
||||
`INTRO.EXE` (francesa, inglesa, alemana, española o polaca). Cada versión se compila en su
|
||||
propia carpeta: `build\` para la francesa, `build_en\`, `build_de\`… para las demás, y
|
||||
**JUGAR** lanza la del juego elegido. Un `TUCKER.EXE` desconocido se señala en rojo.
|
||||
- **Generar y compilar**: el launcher traduce `TUCKER.EXE` e `INTRO.EXE` a C (unas 1500
|
||||
funciones) y luego compila. Tarda de uno a cinco minutos; el **Registro** muestra el progreso.
|
||||
Al final: «Juego compilado».
|
||||
|
||||
+5
-4
@@ -90,7 +90,7 @@ l'archive. Évitez les dossiers synchronisés (OneDrive) : la compilation y est
|
||||
|
||||
## 4. Préparer le jeu original
|
||||
|
||||
> 💿 **Version compatible pour le moment : la version française du CD, en image ISO**, celle de [cette fiche Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (partie « version ISO », tout y est expliqué). Repère : `TUCKER\TUCKER.EXE` fait **284 677 octets**. Les versions anglaise, allemande, espagnole et polonaise ne sont pas encore prises en charge : leur exécutable est différent ([détails](TECHNIQUE.md#7-les-versions-du-jeu)).
|
||||
> 💿 **Version compatible pour le moment : la version française du CD, en image ISO**, celle de [cette fiche Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (partie « version ISO », tout y est expliqué). Repère : `TUCKER\TUCKER.EXE` fait **284 677 octets**. Les versions anglaise, allemande, espagnole et polonaise sont reconnues par le launcher et se compilent, mais sont encore en test (l'espagnole n'a pas de voix : pour l'instant, les répliques passent trop vite) ([détails](TECHNIQUE.md#7-les-versions-du-jeu)).
|
||||
|
||||
Le projet a besoin du dossier qui contient **`TUCKER.EXE`** et **`INTRO.EXE`**, avec les autres
|
||||
fichiers du CD (images, sons, vidéos). Trois possibilités :
|
||||
@@ -141,9 +141,10 @@ le jeu, qui ne peut pas encore être lancé :
|
||||
`third_party\`) ;
|
||||
- Python ou MSVC introuvable : revenez à l'[étape 2](#2-installer-les-outils), puis **Vérifier**.
|
||||
3. **Compilation** :
|
||||
- **Version du jeu** : la langue de votre CD. Pour l'instant, seule la version **française** se
|
||||
compile ; les autres (anglaise, allemande, espagnole, polonaise) figurent déjà dans la liste,
|
||||
marquées « bientôt », et arriveront plus tard.
|
||||
- **Version du jeu** : la langue de votre CD, reconnue toute seule d'après `TUCKER.EXE` et
|
||||
`INTRO.EXE` (française, anglaise, allemande, espagnole ou polonaise). Chaque version se compile
|
||||
dans son propre dossier : `build\` pour la française, `build_en\`, `build_de\`… pour les
|
||||
autres, et **JOUER** lance celle du jeu choisi. Un `TUCKER.EXE` inconnu est signalé en rouge.
|
||||
- **Générer et compiler** : le launcher traduit `TUCKER.EXE` et `INTRO.EXE` en C
|
||||
(environ 1 500 fonctions), puis compile. Comptez de une à cinq minutes ; le **Journal**
|
||||
affiche l'avancement. À la fin : « Jeu compilé ».
|
||||
|
||||
+6
-4
@@ -93,7 +93,7 @@ Unikaj folderów synchronizowanych (OneDrive): kompilacja jest tam powolna.
|
||||
|
||||
## 4. Przygotowanie oryginalnej gry
|
||||
|
||||
> 💿 **Obecnie obsługiwana wersja: francuskie CD jako obraz ISO**, ta z [tej strony Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (sekcja „Version ISO”, tam wszystko jest wyjaśnione). Jak sprawdzić: `TUCKER\TUCKER.EXE` ma **284 677 bajtów**. Wersje angielska, niemiecka, hiszpańska i polska nie są jeszcze obsługiwane: ich plik wykonywalny jest inny ([szczegóły](TECHNIQUE.en.md#7-game-versions)).
|
||||
> 💿 **Obecnie obsługiwana wersja: francuskie CD jako obraz ISO**, ta z [tej strony Abandonware France](https://www.abandonware-france.org/ltf_abandon/ltf_jeu.php?id=662&fic=liens) (sekcja „Version ISO”, tam wszystko jest wyjaśnione). Jak sprawdzić: `TUCKER\TUCKER.EXE` ma **284 677 bajtów**. Wersje angielską, niemiecką, hiszpańską i polską launcher rozpoznaje i kompiluje, ale są jeszcze w testach (hiszpańska nie ma głosów: na razie kwestie znikają zbyt szybko) ([szczegóły](TECHNIQUE.en.md#7-game-versions)).
|
||||
|
||||
Projekt potrzebuje folderu zawierającego **`TUCKER.EXE`** i **`INTRO.EXE`** razem z pozostałymi
|
||||
plikami z CD (obrazy, dźwięki, filmy). Trzy możliwości:
|
||||
@@ -142,9 +142,11 @@ gra, której nie da się jeszcze uruchomić:
|
||||
- brak SDL2: **Pobierz** (oficjalne archiwum SDL 2.32.10, rozpakowane do `third_party\`);
|
||||
- nie znaleziono Pythona lub MSVC: wróć do [kroku 2](#2-instalacja-narzędzi), potem **Sprawdź**.
|
||||
3. **Kompilacja**:
|
||||
- **Wersja gry**: język twojej płyty. Na razie da się skompilować tylko wersję **francuską**;
|
||||
pozostałe (angielska, niemiecka, hiszpańska, polska) są już na liście z dopiskiem „wkrótce”
|
||||
i pojawią się później.
|
||||
- **Wersja gry**: język twojej płyty, rozpoznawany automatycznie na podstawie `TUCKER.EXE`
|
||||
i `INTRO.EXE` (francuska, angielska, niemiecka, hiszpańska lub polska). Każda wersja jest
|
||||
kompilowana we własnym folderze: `build\` dla francuskiej, `build_en\`, `build_de\`… dla
|
||||
pozostałych, a **GRAJ** uruchamia wersję wybranej gry. Nieznany `TUCKER.EXE` jest oznaczany
|
||||
na czerwono.
|
||||
- **Wygeneruj i skompiluj**: launcher tłumaczy `TUCKER.EXE` i `INTRO.EXE` na C (około 1500
|
||||
funkcji), a potem kompiluje. Trwa to od jednej do pięciu minut; **Dziennik** pokazuje postęp.
|
||||
Na koniec: „Gra skompilowana”.
|
||||
|
||||
@@ -167,8 +167,6 @@ Télécharger Download Herunterladen Descargar Pobierz
|
||||
3. Compilation 3. Build 3. Kompilierung 3. Compilación 3. Kompilacja
|
||||
Traduit TUCKER.EXE et INTRO.EXE en C, puis compile. Quelques minutes la première fois. Translates TUCKER.EXE and INTRO.EXE to C, then compiles. Takes a few minutes the first time. Übersetzt TUCKER.EXE und INTRO.EXE nach C und kompiliert dann. Beim ersten Mal ein paar Minuten. Traduce TUCKER.EXE e INTRO.EXE a C y luego compila. Unos minutos la primera vez. Tłumaczy TUCKER.EXE i INTRO.EXE na C, a potem kompiluje. Za pierwszym razem kilka minut.
|
||||
Version du jeu Game version Spielversion Versión del juego Wersja gry
|
||||
bientôt coming soon bald próximamente wkrótce
|
||||
Langue de votre CD. Pour l'instant, seule la version française du jeu se compile : les autres versions (anglaise, allemande, espagnole, polonaise) arriveront plus tard. Language of your CD. For now, only the French version of the game can be built: the other versions (English, German, Spanish, Polish) will come later. Sprache Ihrer CD. Derzeit lässt sich nur die französische Version des Spiels kompilieren: Die anderen Versionen (Englisch, Deutsch, Spanisch, Polnisch) folgen später. Idioma de tu CD. Por ahora solo se puede compilar la versión francesa del juego: las demás versiones (inglesa, alemana, española, polaca) llegarán más adelante. Język twojej płyty CD. Na razie da się skompilować tylko francuską wersję gry: pozostałe wersje (angielska, niemiecka, hiszpańska, polska) pojawią się później.
|
||||
Générer et compiler Generate and build Erzeugen und kompilieren Generar y compilar Wygeneruj i skompiluj
|
||||
Recompiler seulement Rebuild only Nur neu kompilieren Solo recompilar Tylko skompiluj ponownie
|
||||
Terminé Done Fertig Terminado Gotowe
|
||||
@@ -215,3 +213,9 @@ En jeu : F12 réglages · F11 plein écran. In game: F12 settings · F11 fullscr
|
||||
Dossier du projet introuvable : placez le launcher dans DoubleTroubleRecomp (à côté de build.bat). Project folder not found: put the launcher inside DoubleTroubleRecomp (next to build.bat). Projektordner nicht gefunden: Legen Sie den Launcher in DoubleTroubleRecomp ab (neben build.bat). No se encuentra la carpeta del proyecto: coloca el launcher en DoubleTroubleRecomp (junto a build.bat). Nie znaleziono folderu projektu: umieść launcher w DoubleTroubleRecomp (obok build.bat).
|
||||
Décors (122) Backgrounds (122) Hintergründe (122) Fondos (122) Tła (122)
|
||||
Cinématiques (24) Cutscenes (24) Zwischensequenzen (24) Cinemáticas (24) Przerywniki (24)
|
||||
(reconnue) (detected) (erkannt) (detectada) (rozpoznana)
|
||||
non reconnue not recognised nicht erkannt no reconocida nierozpoznana
|
||||
INTRO.EXE ne correspond pas à cette version : prenez les fichiers d'un même CD. INTRO.EXE does not match this version: use files from a single CD. INTRO.EXE passt nicht zu dieser Version: Verwenden Sie die Dateien einer einzigen CD. INTRO.EXE no corresponde a esta versión: usa los archivos de un mismo CD. INTRO.EXE nie pasuje do tej wersji: użyj plików z jednej płyty CD.
|
||||
Reconnue d'après TUCKER.EXE et INTRO.EXE. Chaque version se compile dans son propre dossier : build pour la française, build_en, build_de, build_es ou build_pl pour les autres. Detected from TUCKER.EXE and INTRO.EXE. Each version is built in its own folder: build for the French one, build_en, build_de, build_es or build_pl for the others. Erkannt anhand von TUCKER.EXE und INTRO.EXE. Jede Version wird in einem eigenen Ordner kompiliert: build für die französische, build_en, build_de, build_es oder build_pl für die anderen. Detectada a partir de TUCKER.EXE e INTRO.EXE. Cada versión se compila en su propia carpeta: build para la francesa, build_en, build_de, build_es o build_pl para las demás. Rozpoznana na podstawie TUCKER.EXE i INTRO.EXE. Każda wersja jest kompilowana we własnym folderze: build dla francuskiej, build_en, build_de, build_es lub build_pl dla pozostałych.
|
||||
Ce TUCKER.EXE n'est pas connu : versions prises en charge, française, anglaise, allemande, espagnole et polonaise. This TUCKER.EXE is unknown: supported versions are French, English, German, Spanish and Polish. Diese TUCKER.EXE ist unbekannt: Unterstützt werden die französische, englische, deutsche, spanische und polnische Version. Este TUCKER.EXE no se conoce: las versiones compatibles son la francesa, inglesa, alemana, española y polaca. Ten TUCKER.EXE jest nieznany: obsługiwane wersje to francuska, angielska, niemiecka, hiszpańska i polska.
|
||||
La version espagnole n'a pas de voix : pour l'instant, les répliques ne restent affichées qu'un instant. The Spanish version has no voices: for now, lines only stay on screen for a moment. Die spanische Version hat keine Sprachausgabe: Derzeit bleiben die Dialogzeilen nur einen Augenblick sichtbar. La versión española no tiene voces: por ahora, las frases solo se muestran un instante. Wersja hiszpańska nie ma głosów: na razie kwestie wyświetlają się tylko przez chwilę.
|
||||
|
+102
-42
@@ -18,6 +18,7 @@ mod preview;
|
||||
mod reports;
|
||||
mod saves;
|
||||
mod settings;
|
||||
mod version;
|
||||
|
||||
use eframe::egui::{self, Color32, CornerRadius, Rect, RichText, Stroke};
|
||||
use std::io::{BufRead, BufReader, Read};
|
||||
@@ -38,7 +39,7 @@ const MAX_LOG: usize = 5000;
|
||||
|
||||
// ------------------------------------------------------------------ langue
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
enum Lang {
|
||||
Fr,
|
||||
En,
|
||||
@@ -207,6 +208,10 @@ struct Checks {
|
||||
/// dossier qui contient TUCKER.EXE et INTRO.EXE
|
||||
game_dir: Option<PathBuf>,
|
||||
game_error: Option<String>,
|
||||
/// version du jeu choisi (empreinte de TUCKER.EXE et INTRO.EXE)
|
||||
version: Option<version::Detect>,
|
||||
/// dossier de compilation de cette version : build\ (FR) ou build_xx\
|
||||
build_dir: PathBuf,
|
||||
built: bool,
|
||||
/// tucker.exe accepte --charger N (moteur assez récent)
|
||||
can_load: bool,
|
||||
@@ -214,7 +219,21 @@ struct Checks {
|
||||
|
||||
impl Checks {
|
||||
fn can_build(&self) -> bool {
|
||||
self.python.is_some() && self.capstone.is_some() && self.vcvars.is_some() && self.sdl && self.game_dir.is_some()
|
||||
self.python.is_some() && self.capstone.is_some() && self.vcvars.is_some() && self.sdl && self.game_version().is_some()
|
||||
}
|
||||
|
||||
/// version reconnue du jeu choisi (None : pas de jeu, ou version inconnue)
|
||||
fn game_version(&self) -> Option<Lang> {
|
||||
match self.version {
|
||||
Some(version::Detect::Ok(v)) => Some(v),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// chemin de l'exécutable compilé, relatif au projet (build\tucker.exe, build_en\tucker.exe…)
|
||||
fn exe_label(&self) -> String {
|
||||
let d = self.build_dir.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| "build".into());
|
||||
format!("{d}\\tucker.exe")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,6 +345,14 @@ fn run_checks(root: &Path, cfg: &Config) -> Checks {
|
||||
Ok(d) => (Some(d), None),
|
||||
Err(e) => (None, Some(e)),
|
||||
};
|
||||
let version = game_dir.as_deref().map(version::detect);
|
||||
let build_dir = version::build_dir(
|
||||
root,
|
||||
match version {
|
||||
Some(version::Detect::Ok(v)) => v,
|
||||
_ => Lang::Fr,
|
||||
},
|
||||
);
|
||||
Checks {
|
||||
done: true,
|
||||
python,
|
||||
@@ -334,8 +361,10 @@ fn run_checks(root: &Path, cfg: &Config) -> Checks {
|
||||
sdl: root.join("third_party").join(format!("SDL2-{SDL_VER}")).join("include").join("SDL.h").is_file(),
|
||||
game_dir,
|
||||
game_error,
|
||||
built: root.join("build").join("tucker.exe").is_file(),
|
||||
can_load: engine_can_load(&root.join("build").join("tucker.exe")),
|
||||
version,
|
||||
built: build_dir.join("tucker.exe").is_file(),
|
||||
can_load: engine_can_load(&build_dir.join("tucker.exe")),
|
||||
build_dir,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2361,8 +2390,11 @@ impl App {
|
||||
fn build(&mut self, regenerate: bool) {
|
||||
let (Some(dir), Some(vc)) = (self.checks.game_dir.clone(), self.checks.vcvars.clone()) else { return };
|
||||
// build.bat DOSSIER régénère le C depuis le jeu choisi, build.bat nogen recompile seulement
|
||||
let arg = if regenerate { format!("\"{}\"", dir.display()) } else { "nogen".to_string() };
|
||||
let steps = vec![format!("call \"{}\" >nul && build.bat {arg}", vc.display())];
|
||||
// (avec nogen, la version est donnée : build.bat ne relit pas le jeu)
|
||||
let Some(v) = self.checks.game_version() else { return };
|
||||
let arg = if regenerate { format!("\"{}\"", dir.display()) } else { format!("nogen {}", v.code()) };
|
||||
// .\ : sans lui, cmd ne cherche pas dans le dossier courant si NoDefaultCurrentDirectoryInExePath est réglé
|
||||
let steps = vec![format!("call \"{}\" >nul && .\\build.bat {arg}", vc.display())];
|
||||
self.start_task(if regenerate { "build" } else { "build-nogen" }, steps);
|
||||
}
|
||||
|
||||
@@ -2386,7 +2418,8 @@ impl App {
|
||||
if !self.cfg.install_dir.trim().is_empty() {
|
||||
return PathBuf::from(self.cfg.install_dir.trim());
|
||||
}
|
||||
if let Some(r) = &self.root {
|
||||
// ..\Install\C\TUCKER : installation DOS du CD français, sans objet pour les autres versions
|
||||
if let (Some(r), Some(Lang::Fr)) = (&self.root, self.checks.game_version()) {
|
||||
let d = r.join("..").join("Install").join("C").join("TUCKER");
|
||||
if d.is_dir() {
|
||||
return d;
|
||||
@@ -2444,7 +2477,7 @@ impl App {
|
||||
let hd_root = hd.parent().map(Path::to_path_buf).unwrap_or_else(|| hd.clone());
|
||||
let saves = root.join("saves");
|
||||
let _ = std::fs::create_dir_all(&saves);
|
||||
let mut cmd = hidden(&root.join("build").join("tucker.exe").to_string_lossy());
|
||||
let mut cmd = hidden(&self.checks.build_dir.join("tucker.exe").to_string_lossy());
|
||||
cmd.current_dir(&root)
|
||||
.arg("--cd").arg(&dir)
|
||||
.arg("--exe").arg(dir.join("TUCKER.EXE"))
|
||||
@@ -2859,7 +2892,7 @@ impl App {
|
||||
});
|
||||
}
|
||||
|
||||
fn setup_column(&mut self, ui: &mut egui::Ui, root: &Path) {
|
||||
fn setup_column(&mut self, ui: &mut egui::Ui) {
|
||||
let busy = self.busy != Busy::No;
|
||||
let c = self.checks.clone();
|
||||
if self.config_open == Some(false) {
|
||||
@@ -2869,7 +2902,7 @@ impl App {
|
||||
ui.horizontal(|ui| status(ui, c.game_dir.is_some(), self.t("Jeu original", "Original game"),
|
||||
&c.game_dir.as_ref().map(|d| d.display().to_string()).unwrap_or_default()));
|
||||
ui.horizontal(|ui| status(ui, self.prereqs_ok(), self.t("Prérequis", "Requirements"), "Python · capstone · MSVC · SDL2"));
|
||||
ui.horizontal(|ui| status(ui, c.built, self.t("Jeu compilé", "Game built"), "build\\tucker.exe"));
|
||||
ui.horizontal(|ui| status(ui, c.built, self.t("Jeu compilé", "Game built"), &c.exe_label()));
|
||||
ui.add_space(6.0);
|
||||
if ui.button(self.t("Configurer / recompiler…", "Setup / rebuild…")).clicked() {
|
||||
self.config_open = Some(true);
|
||||
@@ -2979,40 +3012,14 @@ impl App {
|
||||
"Traduit TUCKER.EXE et INTRO.EXE en C, puis compile. Quelques minutes la première fois.",
|
||||
"Translates TUCKER.EXE and INTRO.EXE to C, then compiles. Takes a few minutes the first time.",
|
||||
)).weak());
|
||||
// version du jeu à compiler : seule la française est prise en charge pour l'instant (adresses du moteur
|
||||
// dans runtime/addr_fr.h) ; les autres sont montrées pour la suite, sans effet
|
||||
ui.horizontal(|ui| {
|
||||
let lang = self.cfg.lang;
|
||||
ui.label(i18n::tr(lang, "Version du jeu", "Game version"));
|
||||
egui::ComboBox::from_id_salt("game_version").selected_text(Lang::Fr.name()).show_ui(ui, |ui| {
|
||||
for l in Lang::ALL {
|
||||
let ok = l == Lang::Fr;
|
||||
ui.add_enabled_ui(ok, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
let (r, _) = ui.allocate_exact_size(egui::vec2(22.0, 14.0), egui::Sense::hover());
|
||||
paint_flag(ui.painter(), r, l.index());
|
||||
let text = if ok {
|
||||
l.name().to_string()
|
||||
} else {
|
||||
format!("{} ({})", l.name(), i18n::tr(lang, "bientôt", "coming soon"))
|
||||
};
|
||||
let _ = ui.selectable_label(ok, text);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.response
|
||||
.on_hover_text(self.t(
|
||||
"Langue de votre CD. Pour l'instant, seule la version française du jeu se compile : les autres versions (anglaise, allemande, espagnole, polonaise) arriveront plus tard.",
|
||||
"Language of your CD. For now, only the French version of the game can be built: the other versions (English, German, Spanish, Polish) will come later.",
|
||||
));
|
||||
// version du jeu : reconnue d'après ses exécutables, chacune compilée dans son dossier
|
||||
self.version_row(ui, &c);
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
let can = !busy && c.can_build();
|
||||
if ui.add_enabled(can, egui::Button::new(RichText::new(self.t("Générer et compiler", "Generate and build")).strong())).clicked() {
|
||||
self.build(true);
|
||||
}
|
||||
if ui.add_enabled(can && root.join("build").join("gen_tucker").is_dir(), egui::Button::new(self.t("Recompiler seulement", "Rebuild only"))).clicked() {
|
||||
if ui.add_enabled(can && c.build_dir.join("gen_tucker").is_dir(), egui::Button::new(self.t("Recompiler seulement", "Rebuild only"))).clicked() {
|
||||
self.build(false);
|
||||
}
|
||||
if let Busy::Task(_) = self.busy {
|
||||
@@ -3022,10 +3029,63 @@ impl App {
|
||||
.color(if ok { OK } else { BAD }));
|
||||
}
|
||||
});
|
||||
ui.horizontal(|ui| status(ui, c.built, self.t("Jeu compilé", "Game built"), "build\\tucker.exe"));
|
||||
ui.horizontal(|ui| status(ui, c.built, self.t("Jeu compilé", "Game built"), &c.exe_label()));
|
||||
});
|
||||
}
|
||||
|
||||
/// carte Compilation : version du jeu choisi, reconnue d'après TUCKER.EXE et INTRO.EXE
|
||||
fn version_row(&self, ui: &mut egui::Ui, c: &Checks) {
|
||||
let lang = self.cfg.lang;
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(i18n::tr(lang, "Version du jeu", "Game version"));
|
||||
match &c.version {
|
||||
None => {
|
||||
ui.label(RichText::new("—").weak());
|
||||
}
|
||||
Some(version::Detect::Ok(v)) => {
|
||||
let (r, _) = ui.allocate_exact_size(egui::vec2(22.0, 14.0), egui::Sense::hover());
|
||||
paint_flag(ui.painter(), r, v.index());
|
||||
ui.label(RichText::new(v.name()).strong());
|
||||
ui.label(RichText::new(i18n::tr(lang, "(reconnue)", "(detected)")).weak());
|
||||
}
|
||||
Some(version::Detect::Unknown(sum)) => {
|
||||
ui.label(RichText::new(i18n::tr(lang, "non reconnue", "not recognised")).color(BAD))
|
||||
.on_hover_text(format!("TUCKER.EXE : MD5 {sum}"));
|
||||
}
|
||||
Some(version::Detect::BadIntro(v)) => {
|
||||
ui.label(RichText::new(i18n::tr(
|
||||
lang,
|
||||
"INTRO.EXE ne correspond pas à cette version : prenez les fichiers d'un même CD.",
|
||||
"INTRO.EXE does not match this version: use files from a single CD.",
|
||||
).to_string() + " (" + v.name() + ")").color(BAD));
|
||||
}
|
||||
}
|
||||
})
|
||||
.response
|
||||
.on_hover_text(i18n::tr(
|
||||
lang,
|
||||
"Reconnue d'après TUCKER.EXE et INTRO.EXE. Chaque version se compile dans son propre dossier : build pour la française, build_en, build_de, build_es ou build_pl pour les autres.",
|
||||
"Detected from TUCKER.EXE and INTRO.EXE. Each version is built in its own folder: build for the French one, build_en, build_de, build_es or build_pl for the others.",
|
||||
));
|
||||
match c.version {
|
||||
Some(version::Detect::Unknown(_)) => {
|
||||
ui.label(RichText::new(i18n::tr(
|
||||
lang,
|
||||
"Ce TUCKER.EXE n'est pas connu : versions prises en charge, française, anglaise, allemande, espagnole et polonaise.",
|
||||
"This TUCKER.EXE is unknown: supported versions are French, English, German, Spanish and Polish.",
|
||||
)).weak());
|
||||
}
|
||||
Some(version::Detect::Ok(Lang::Es)) => {
|
||||
ui.label(RichText::new(i18n::tr(
|
||||
lang,
|
||||
"La version espagnole n'a pas de voix : pour l'instant, les répliques ne restent affichées qu'un instant.",
|
||||
"The Spanish version has no voices: for now, lines only stay on screen for a moment.",
|
||||
)).color(ACCENT));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
/// ligne sous « Reprendre ma partie » : quelle sauvegarde, avec sa vignette
|
||||
fn resume_row(&mut self, ui: &mut egui::Ui) {
|
||||
let lang = self.cfg.lang;
|
||||
@@ -3257,7 +3317,7 @@ impl eframe::App for App {
|
||||
egui::CentralPanel::default()
|
||||
.frame(egui::Frame::NONE.fill(BG).inner_margin(egui::Margin::symmetric(16, 10)))
|
||||
.show(ui, |ui| {
|
||||
let Some(root) = self.root.clone() else {
|
||||
if self.root.is_none() {
|
||||
ui.label(RichText::new(self.t(
|
||||
"Dossier du projet introuvable : placez le launcher dans DoubleTroubleRecomp (à côté de build.bat).",
|
||||
"Project folder not found: put the launcher inside DoubleTroubleRecomp (next to build.bat).",
|
||||
@@ -3266,7 +3326,7 @@ impl eframe::App for App {
|
||||
};
|
||||
egui::ScrollArea::vertical().auto_shrink([false, false]).show(ui, |ui| {
|
||||
ui.columns(2, |cols| {
|
||||
self.setup_column(&mut cols[0], &root);
|
||||
self.setup_column(&mut cols[0]);
|
||||
self.play_column(&mut cols[1]);
|
||||
cols[1].add_space(10.0);
|
||||
self.mods_card(&mut cols[1]);
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
//! Version du jeu choisi (FR, EN, DE, ES, PL), reconnue par l'empreinte MD5 de TUCKER.EXE et de
|
||||
//! INTRO.EXE, comme tools/version.py. Chaque version se compile à part : build\ pour la française,
|
||||
//! build_xx\ pour les autres (voir build.bat et docs/VERSIONS.md).
|
||||
|
||||
use crate::Lang;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
/// TUCKER.EXE -> version (mêmes empreintes que tools/version.py)
|
||||
const TUCKER: [(&str, Lang); 5] = [
|
||||
("27e2fc60dc9ee161ebeb65ac14b7f145", Lang::Fr), // CD français (26/11/1996)
|
||||
("4fd8130f0416b06eba817cc20f5bc1d2", Lang::En), // version anglaise (07/06/1996)
|
||||
("986be438689b790880be5e0c7012a658", Lang::Es), // version espagnole (28/01/1997)
|
||||
("1a7682b53f4541ac478a96948537be49", Lang::Pl), // réédition polonaise (code espagnol)
|
||||
("5942bae6977bebfd74ee284f3d54bec3", Lang::De), // version allemande (12/01/1997)
|
||||
];
|
||||
const INTRO_FR: &str = "056db10c9e41b1eb2ee6e1f7efe96fce";
|
||||
const INTRO_DE: &str = "a5fc4e800af8a29242ad55b01aa54242";
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Detect {
|
||||
Ok(Lang),
|
||||
/// TUCKER.EXE inconnu : ses adresses ne sont pas connues (empreinte)
|
||||
Unknown(String),
|
||||
/// INTRO.EXE ne correspond pas à la version de TUCKER.EXE
|
||||
BadIntro(Lang),
|
||||
}
|
||||
|
||||
pub fn detect(game_dir: &Path) -> Detect {
|
||||
let Ok(t) = std::fs::read(game_dir.join("TUCKER.EXE")) else { return Detect::Unknown(String::new()) };
|
||||
let sum = hex(&md5(&t));
|
||||
let Some(&(_, v)) = TUCKER.iter().find(|(h, _)| *h == sum) else { return Detect::Unknown(sum) };
|
||||
if let Ok(i) = std::fs::read(game_dir.join("INTRO.EXE")) {
|
||||
let want = if v == Lang::De { INTRO_DE } else { INTRO_FR };
|
||||
if hex(&md5(&i)) != want {
|
||||
return Detect::BadIntro(v);
|
||||
}
|
||||
}
|
||||
Detect::Ok(v)
|
||||
}
|
||||
|
||||
/// dossier de compilation de la version : build pour la française, build_xx pour les autres
|
||||
pub fn build_dir(root: &Path, v: Lang) -> PathBuf {
|
||||
root.join(if v == Lang::Fr { "build".to_string() } else { format!("build_{}", v.code()) })
|
||||
}
|
||||
|
||||
fn hex(d: &[u8; 16]) -> String {
|
||||
d.iter().map(|b| format!("{b:02x}")).collect()
|
||||
}
|
||||
|
||||
/// MD5 (RFC 1321), pour reconnaître les exécutables sans dépendance de plus
|
||||
pub fn md5(data: &[u8]) -> [u8; 16] {
|
||||
const S: [u32; 64] = [
|
||||
7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
|
||||
4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21,
|
||||
];
|
||||
let k: Vec<u32> = (0..64).map(|i| ((i as f64 + 1.0).sin().abs() * 4294967296.0) as u32).collect();
|
||||
let mut msg = data.to_vec();
|
||||
msg.push(0x80);
|
||||
while msg.len() % 64 != 56 {
|
||||
msg.push(0);
|
||||
}
|
||||
msg.extend_from_slice(&((data.len() as u64).wrapping_mul(8)).to_le_bytes());
|
||||
let (mut a0, mut b0, mut c0, mut d0) = (0x67452301u32, 0xefcdab89u32, 0x98badcfeu32, 0x10325476u32);
|
||||
for chunk in msg.chunks(64) {
|
||||
let m: Vec<u32> = chunk.chunks(4).map(|w| u32::from_le_bytes([w[0], w[1], w[2], w[3]])).collect();
|
||||
let (mut a, mut b, mut c, mut d) = (a0, b0, c0, d0);
|
||||
for i in 0..64 {
|
||||
let (f, g) = match i / 16 {
|
||||
0 => ((b & c) | (!b & d), i),
|
||||
1 => ((d & b) | (!d & c), (5 * i + 1) % 16),
|
||||
2 => (b ^ c ^ d, (3 * i + 5) % 16),
|
||||
_ => (c ^ (b | !d), (7 * i) % 16),
|
||||
};
|
||||
let f = f.wrapping_add(a).wrapping_add(k[i]).wrapping_add(m[g]);
|
||||
a = d;
|
||||
d = c;
|
||||
c = b;
|
||||
b = b.wrapping_add(f.rotate_left(S[i]));
|
||||
}
|
||||
a0 = a0.wrapping_add(a);
|
||||
b0 = b0.wrapping_add(b);
|
||||
c0 = c0.wrapping_add(c);
|
||||
d0 = d0.wrapping_add(d);
|
||||
}
|
||||
let mut out = [0u8; 16];
|
||||
for (i, v) in [a0, b0, c0, d0].iter().enumerate() {
|
||||
out[i * 4..i * 4 + 4].copy_from_slice(&v.to_le_bytes());
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn md5_vectors() {
|
||||
assert_eq!(hex(&md5(b"")), "d41d8cd98f00b204e9800998ecf8427e");
|
||||
assert_eq!(hex(&md5(b"The quick brown fox jumps over the lazy dog")), "9e107d9d372bb6826bd81d3542a419d6");
|
||||
assert_eq!(hex(&md5(&[b'a'; 1000])), "cabe45dcc9ae5b66ba86600cca6b8ba8");
|
||||
}
|
||||
|
||||
/// avec les jeux extraits à côté du projet (..\extracted\xx\TUCKER), comme dans docs/VERSIONS.md
|
||||
#[test]
|
||||
fn detects_extracted_games() {
|
||||
let base = Path::new(env!("CARGO_MANIFEST_DIR")).join("..").join("..").join("extracted");
|
||||
for (dir, want) in [("iso", Lang::Fr), ("en", Lang::En), ("de", Lang::De), ("es", Lang::Es), ("pl", Lang::Pl)] {
|
||||
let d = base.join(dir).join("TUCKER");
|
||||
if d.join("TUCKER.EXE").is_file() {
|
||||
assert_eq!(detect(&d), Detect::Ok(want), "{}", d.display());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_dirs() {
|
||||
let r = Path::new("R");
|
||||
assert_eq!(build_dir(r, Lang::Fr), Path::new("R").join("build"));
|
||||
assert_eq!(build_dir(r, Lang::Pl), Path::new("R").join("build_pl"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user