From 7c27283a81cd226eff02101b66d913c220f33f60 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Tue, 15 Dec 2020 21:26:00 +0100 Subject: [PATCH] Say replay, not restart --- Changelog.md | 2 +- GME-Format.md | 2 +- book/erste-schritte.rst | 2 +- book/tttool-referenz.rst | 4 ++-- book/yaml-referenz.rst | 6 +++--- src/Commands.hs | 4 ++-- src/GMEWriter.hs | 4 ++-- src/TipToiYaml.hs | 20 +++++++++---------- .../Alle meine Tiere.gme.yaml.md5sum | 2 +- .../Dein Koerper und Du.gme.yaml.md5sum | 2 +- .../Duell-der-Superquizzer.gme.yaml.md5sum | 2 +- ...pedition Wissen - Aegypten.gme.yaml.md5sum | 2 +- .../Leserabe Drache.gme.yaml.md5sum | 2 +- ...ssen - Baustellenfahrzeuge.gme.yaml.md5sum | 2 +- .../Sprichst_Du_Englisch.gme.yaml.md5sum | 2 +- .../downloaded/WWW Ritter.gme.yaml.md5sum | 2 +- .../downloaded/WWW Weltatlas.gme.yaml.md5sum | 2 +- testsuite/expected/example.rexport.yaml | 2 +- 18 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Changelog.md b/Changelog.md index f38e5c03..59369032 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,7 +5,7 @@ * Audio filenames can now be quoted, to support filenames with characters outside the range `a-zA-Z0-9_`. Audio files can also be given including their extension. - * Support for the `stop` and `restart` codes (generated by default) + * Support for the `stop` and `replay` codes (generated by default) * The `set-language` command truncates long language names (like `ITALIAN`) automatically. * The output of `tttool export` has the YAML fields in a more sensible order diff --git a/GME-Format.md b/GME-Format.md index 77cf7c3e..bbd0f8b7 100644 --- a/GME-Format.md +++ b/GME-Format.md @@ -186,7 +186,7 @@ Example from Puzzle Ponyhof: 0x00F05E60: 00 00 00 00 00 00 00 00 01 00 66 18 pp pp pp pp pp pp pp pp ff ff gg gg -a: OID for the Restart symbol +a: OID for the Replay symbol b: OID for the Stop symbol c: unknown, seems to be the OID for Skip symbol (needs to be confirmed) d: unknown diff --git a/book/erste-schritte.rst b/book/erste-schritte.rst index feb81a10..270d420d 100644 --- a/book/erste-schritte.rst +++ b/book/erste-schritte.rst @@ -125,7 +125,7 @@ Nun brauchst du noch den zugehörigen Ausdruck mit den Punktmustern. Auch hier m erstellt dir das ``tttool`` die Datei ``tic-tac-tiptoi.pdf``, die alle Punktmuster für dein Werk in einer nüchternen, aber praktischen Tabelle -enthält. Du siehst dort neben dem Feld für ``feldOL`` auch eines mit der Beschriftung ``START``, dem Anschaltzeichen für dein Produkt, sowie ``RESTART`` und ``STOP``, die man erstmal ignorieren darf. +enthält. Du siehst dort neben dem Feld für ``feldOL`` auch eines mit der Beschriftung ``START``, dem Anschaltzeichen für dein Produkt, sowie ``REPLAY`` und ``STOP``, die man erstmal ignorieren darf. Wenn du diese Datei nun ausdruckst, mit dem Stift auf das Anschaltzeichen gehst, und danach auf das andere Feld, solltest du eine Roboterstimme hören, die „Du hast oben links hingetippt.“ sagt. diff --git a/book/tttool-referenz.rst b/book/tttool-referenz.rst index 06c3c51a..60eaac41 100644 --- a/book/tttool-referenz.rst +++ b/book/tttool-referenz.rst @@ -84,7 +84,7 @@ Aber oft willst du einfach alle Codes eines GME-Projektes erzeugen. Dazu kannst $ tttool oid-codes example.yaml Writing oid-42-START.png.. (Code 42, raw code 272) - Writing oid-42-RESTART.png.. (Code 13445, raw code 9250) + Writing oid-42-REPLAY.png.. (Code 13445, raw code 9250) Writing oid-42-STOP.png.. (Code 13446, raw code 9251) Writing oid-42-8065.png.. (Code 8065, raw code 3700) Writing oid-42-8066.png.. (Code 8066, raw code 3701) @@ -94,7 +94,7 @@ Die erste Zahl im Dateinamen ist die Produkt-ID des Projekts, was dir helfen sol $ tttool oid-codes example2.yaml Writing oid-42-START.png.. (Code 42, raw code 272) - Writing oid-42-RESTART.png.. (Code 13445, raw code 9250) + Writing oid-42-REPLAY.png.. (Code 13445, raw code 9250) Writing oid-42-STOP.png.. (Code 13446, raw code 9251) Writing oid-42-conditional.png.. (Code 13447, raw code 9252) Writing oid-42-hello.png.. (Code 13448, raw code 9253) diff --git a/book/yaml-referenz.rst b/book/yaml-referenz.rst index fc884b23..fd5e8b1e 100644 --- a/book/yaml-referenz.rst +++ b/book/yaml-referenz.rst @@ -263,7 +263,7 @@ eigentliche YAML-Datei zu übernehmen. die beiden Varianten nicht mischen. -``restart`` +``replay`` ^^^^^^^^^^^ Format: @@ -272,13 +272,13 @@ Format: Beispiel: .. code:: yaml - restart: 12159 + replay: 12159 Zweck: Beim Tippen auf diesen Code wird das zuletzt ausgegebene Audio nochmal ausgegeben. -Auch wenn man diesen dies nicht explizit in der .yaml-Datei notiert, weist das ``tttool`` einen solchen Code zu, und erzeugt ein ``RESTART``-Muster aus. +Auch wenn man diesen dies nicht explizit in der .yaml-Datei notiert, weist das ``tttool`` einen solchen Code zu, und erzeugt ein ``REPLAY``-Muster aus. ``stop`` ^^^^^^^^^^^ diff --git a/src/Commands.hs b/src/Commands.hs index 1732ac9a..ced9eef6 100644 --- a/src/Commands.hs +++ b/src/Commands.hs @@ -292,8 +292,8 @@ codesOfFile inf = do writeTipToiCodeYaml inf tty codeMap totalMap return $ (ttProductId tt, [ ("START", fromIntegral (ttProductId tt)) ] ++ - [ ("RESTART", fromIntegral id) | Just id <- pure $ ttcRestart totalMap ] ++ - [ ("STOP", fromIntegral id) | Just id <- pure $ ttcStop totalMap ] ++ + [ ("REPLAY", fromIntegral id) | Just id <- pure $ ttcReplay totalMap ] ++ + [ ("STOP", fromIntegral id) | Just id <- pure $ ttcStop totalMap ] ++ sort (M.toList (ttcScriptCodes totalMap)) ) where diff --git a/src/GMEWriter.hs b/src/GMEWriter.hs index 81ab4ec1..5b3f9ec1 100644 --- a/src/GMEWriter.hs +++ b/src/GMEWriter.hs @@ -368,8 +368,8 @@ putAudioTable x as = mapFstMapSnd putSpecialSymbols :: Maybe (Word16, Word16) -> SPut putSpecialSymbols Nothing = replicateM_ 20 $ putWord16 0 -putSpecialSymbols (Just (restart, stop)) = do - putWord16 restart +putSpecialSymbols (Just (replay, stop)) = do + putWord16 replay putWord16 stop replicateM_ 20 $ putWord16 0 diff --git a/src/TipToiYaml.hs b/src/TipToiYaml.hs index 8939fe8e..12e50ddf 100644 --- a/src/TipToiYaml.hs +++ b/src/TipToiYaml.hs @@ -66,14 +66,14 @@ data TipToiYAML = TipToiYAML , ttySpeak :: Maybe (OptArray SpeakSpec) , ttyLanguage :: Maybe Language , ttyGames :: Maybe [GameYaml] - , ttyRestart :: Maybe Word16 + , ttyReplay :: Maybe Word16 , ttyStop :: Maybe Word16 } deriving Generic data TipToiCodesYAML = TipToiCodesYAML { ttcScriptCodes :: CodeMap - , ttcRestart :: Maybe Word16 + , ttcReplay :: Maybe Word16 , ttcStop :: Maybe Word16 } deriving (Eq, Generic) @@ -314,7 +314,7 @@ tt2ttYaml path TipToiFile{..} = TipToiYAML , ttySpeak = Nothing , ttyLanguage = Nothing , ttyGames = list2Maybe $ map game2gameYaml ttGames - , ttyRestart = fmap fst ttSpecialOIDs + , ttyReplay = fmap fst ttSpecialOIDs , ttyStop = fmap snd ttSpecialOIDs } @@ -695,7 +695,7 @@ scriptCodes codes givenCodes productId (strs, nums) = partitionEithers $ map f codes newStrs = filter (`M.notMember` ttcScriptCodes givenCodes) strs usedCodes = S.fromList $ - maybeToList (ttcRestart givenCodes) ++ + maybeToList (ttcReplay givenCodes) ++ maybeToList (ttcStop givenCodes) ++ M.elems (ttcScriptCodes givenCodes) @@ -703,7 +703,7 @@ scriptCodes codes givenCodes productId Nothing -> Left s Just n -> Right (n::Word16) - restartCode : stopCode : availableCodes = + replayCode : stopCode : availableCodes = filter (`S.notMember` usedCodes) $ codesFor productId @@ -719,7 +719,7 @@ scriptCodes codes givenCodes productId allCodes = TipToiCodesYAML { ttcScriptCodes = totalMap - , ttcRestart = ttcRestart givenCodes `mplus` Just restartCode + , ttcReplay = ttcReplay givenCodes `mplus` Just replayCode , ttcStop = ttcStop givenCodes `mplus` Just stopCode } @@ -785,7 +785,7 @@ ttYaml2tt no_date dir (TipToiYAML {..}) extCodes = do let givenCodes = TipToiCodesYAML { ttcScriptCodes = M.unionWithKey mergeOnlyEqual (ttcScriptCodes extCodes) (fromMaybe M.empty ttyScriptCodes) - , ttcRestart = mergeEqualMaybe "restart" (ttcRestart extCodes) ttyRestart + , ttcReplay = mergeEqualMaybe "replay" (ttcReplay extCodes) ttyReplay , ttcStop = mergeEqualMaybe "stop" (ttcStop extCodes) ttyStop } @@ -893,7 +893,7 @@ ttYaml2tt no_date dir (TipToiYAML {..}) extCodes = do , ttBinaries5 = [] , ttBinaries6 = [] , ttSpecialOIDs = Just - ( fromMaybe 0 (ttcRestart assignedCodes) + ( fromMaybe 0 (ttcReplay assignedCodes) , fromMaybe 0 (ttcStop assignedCodes) ) -- a bit fishy, this juggling of maybes }, assignedCodes) @@ -1109,7 +1109,7 @@ writeTipToiCodeYaml inf tty oldCodeYaml allCodes = do let newCodeYaml = TipToiCodesYAML { ttcScriptCodes = newCodeMap - , ttcRestart = if isJust (ttcRestart allCodes) && ttcRestart allCodes /= ttyRestart tty then ttcRestart allCodes else Nothing + , ttcReplay = if isJust (ttcReplay allCodes) && ttcReplay allCodes /= ttyReplay tty then ttcReplay allCodes else Nothing , ttcStop = if isJust (ttcStop allCodes) && ttcStop allCodes /= ttyStop tty then ttcStop allCodes else Nothing } @@ -1162,7 +1162,7 @@ debugGame productID = do ] , ttyLanguage = Nothing , ttyGames = Nothing - , ttyRestart = Nothing + , ttyReplay = Nothing , ttyStop = Nothing } where diff --git a/testsuite/expected/downloaded/Alle meine Tiere.gme.yaml.md5sum b/testsuite/expected/downloaded/Alle meine Tiere.gme.yaml.md5sum index bbbec404..4b1440f0 100644 --- a/testsuite/expected/downloaded/Alle meine Tiere.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/Alle meine Tiere.gme.yaml.md5sum @@ -1 +1 @@ -0fd54c3bbb1a88b494972a2547b08f9f output/downloaded/Alle meine Tiere.gme.yaml +b8d364d85b18b7af68537782f90b5dad output/downloaded/Alle meine Tiere.gme.yaml diff --git a/testsuite/expected/downloaded/Dein Koerper und Du.gme.yaml.md5sum b/testsuite/expected/downloaded/Dein Koerper und Du.gme.yaml.md5sum index 4fa03407..76bc8372 100644 --- a/testsuite/expected/downloaded/Dein Koerper und Du.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/Dein Koerper und Du.gme.yaml.md5sum @@ -1 +1 @@ -e2f933effc132ed235888e4f0bf22e8f output/downloaded/Dein Koerper und Du.gme.yaml +6145ef87ab3ed2c21bfdb7acff9d6554 output/downloaded/Dein Koerper und Du.gme.yaml diff --git a/testsuite/expected/downloaded/Duell-der-Superquizzer.gme.yaml.md5sum b/testsuite/expected/downloaded/Duell-der-Superquizzer.gme.yaml.md5sum index dbb2f9fa..93ec79a5 100644 --- a/testsuite/expected/downloaded/Duell-der-Superquizzer.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/Duell-der-Superquizzer.gme.yaml.md5sum @@ -1 +1 @@ -61a09460d93d53c8c5383248973bf1a7 output/downloaded/Duell-der-Superquizzer.gme.yaml +35cc30d987a9794f9f6d6af839caf457 output/downloaded/Duell-der-Superquizzer.gme.yaml diff --git a/testsuite/expected/downloaded/Expedition Wissen - Aegypten.gme.yaml.md5sum b/testsuite/expected/downloaded/Expedition Wissen - Aegypten.gme.yaml.md5sum index 0f1ef1bf..80643614 100644 --- a/testsuite/expected/downloaded/Expedition Wissen - Aegypten.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/Expedition Wissen - Aegypten.gme.yaml.md5sum @@ -1 +1 @@ -0a99dc6315e77ff0efb0c91928480327 output/downloaded/Expedition Wissen - Aegypten.gme.yaml +3f5955cbcf2a9ab1cd08b775fc3b4698 output/downloaded/Expedition Wissen - Aegypten.gme.yaml diff --git a/testsuite/expected/downloaded/Leserabe Drache.gme.yaml.md5sum b/testsuite/expected/downloaded/Leserabe Drache.gme.yaml.md5sum index 4d965665..ef841e6a 100644 --- a/testsuite/expected/downloaded/Leserabe Drache.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/Leserabe Drache.gme.yaml.md5sum @@ -1 +1 @@ -dafec43004052b310638581994076b1a output/downloaded/Leserabe Drache.gme.yaml +1ecc247aa79e0f300ca3b482ef7b8a89 output/downloaded/Leserabe Drache.gme.yaml diff --git a/testsuite/expected/downloaded/Pocket Wissen - Baustellenfahrzeuge.gme.yaml.md5sum b/testsuite/expected/downloaded/Pocket Wissen - Baustellenfahrzeuge.gme.yaml.md5sum index 7ea57fcc..b84da73b 100644 --- a/testsuite/expected/downloaded/Pocket Wissen - Baustellenfahrzeuge.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/Pocket Wissen - Baustellenfahrzeuge.gme.yaml.md5sum @@ -1 +1 @@ -d07aa7d8a23e0c44434ef65480a2cdc2 output/downloaded/Pocket Wissen - Baustellenfahrzeuge.gme.yaml +15b6e65429c2880108cd12642b3a418d output/downloaded/Pocket Wissen - Baustellenfahrzeuge.gme.yaml diff --git a/testsuite/expected/downloaded/Sprichst_Du_Englisch.gme.yaml.md5sum b/testsuite/expected/downloaded/Sprichst_Du_Englisch.gme.yaml.md5sum index fb55e1e2..96c40d12 100644 --- a/testsuite/expected/downloaded/Sprichst_Du_Englisch.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/Sprichst_Du_Englisch.gme.yaml.md5sum @@ -1 +1 @@ -f5e67b74de9ab84284e8774c18f8676b output/downloaded/Sprichst_Du_Englisch.gme.yaml +f3b669b4c86292c5d312888ada77c034 output/downloaded/Sprichst_Du_Englisch.gme.yaml diff --git a/testsuite/expected/downloaded/WWW Ritter.gme.yaml.md5sum b/testsuite/expected/downloaded/WWW Ritter.gme.yaml.md5sum index 96096640..24a0d84c 100644 --- a/testsuite/expected/downloaded/WWW Ritter.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/WWW Ritter.gme.yaml.md5sum @@ -1 +1 @@ -6f5bf51d420207eab67410815c9e0040 output/downloaded/WWW Ritter.gme.yaml +4f6157b8fd374361e54ff617868db893 output/downloaded/WWW Ritter.gme.yaml diff --git a/testsuite/expected/downloaded/WWW Weltatlas.gme.yaml.md5sum b/testsuite/expected/downloaded/WWW Weltatlas.gme.yaml.md5sum index 68c28b90..795c84dd 100644 --- a/testsuite/expected/downloaded/WWW Weltatlas.gme.yaml.md5sum +++ b/testsuite/expected/downloaded/WWW Weltatlas.gme.yaml.md5sum @@ -1 +1 @@ -b249ea76eb99cb6871e94c560b029e54 output/downloaded/WWW Weltatlas.gme.yaml +a76a350d385c46f1e835b3ba0fdd546a output/downloaded/WWW Weltatlas.gme.yaml diff --git a/testsuite/expected/example.rexport.yaml b/testsuite/expected/example.rexport.yaml index 7186a6e8..e360755c 100644 --- a/testsuite/expected/example.rexport.yaml +++ b/testsuite/expected/example.rexport.yaml @@ -15,5 +15,5 @@ scripts: - $1==2? P(5) - $1==3? P(4) - $1!=1? $1!=2? $1!=3? $1:=0 P(0) -restart: 13445 +replay: 13445 stop: 13446