MobyGamer / total-dos-launcher

A system for easily loading and running thousands of DOS programs on vintage hardware
MIT License
109 stars 10 forks source link

TDLIndexer bug with short filenames that include (199X) date in file #46

Closed flynnsbit closed 7 months ago

flynnsbit commented 3 years ago

In the TDLIndexer.py, when it finds a game that is short enough it will include the "(1996)" in the short file name when it converts. This breaks the dos folders as it will create a dos conversion of the file. Example output of the TDLIndexer 8.3 file it creates.

Long Filename that is passed to the Indexer: "D (1996).Zip" Short name it creates: "D (1996).ZIP" DOS see's it as: "D(1996~1.ZIP"

This prevents the TDL interface from finding the zip file to launch the game.

Here are the dos games that do that: D (1996).zip K (1996).zip P (2013).zip Y (1994).zip Z (1996).zip

flynnsbit commented 3 years ago

In addition to this, there is also an issue with TDL not being able to handle having the filename in the index be shorter than 8 characters. The way you generate the index using your TDLIndexer.py the shortname (base_name) allways ends up with 8 characters. We've switched the TDLIndexer to utilize a set define database of short and long filenames which allows for games to have the exact same folder structure across TDL packs. If the basename is shorter than 8 characters, then the TDL Index passes the path of the file to pkunzip with the .zip extension in the folder name..

Example: Wolfenstein 3d(1992) -- Long name TDL Converter folder reference old way: Wolfenste TDL Converter new way (using CSV reference): Wolf3d Expected: E:\games\wolf3d\ Result: E:\games\wolf3d.zip\

Any game that does in fact have 8 characters as its short name works fine with the indexer, anything shorter than that will always append the .zip to the folder name when extracting which breaks the flow.

We thought this was in this function and maybe it isn't firing if less than 8 characters? basename

For now, we are adding underscores to the paths of the folders before the TDLIndexer gets ahold of it to prevent the folders with .zip in them like this: adding underscores

And here is what it does if you pass it a game with a shorter name: Note that is not a zip file but a folder and the pre-extracted cache folder is supposed to be /DOOM/ but instead is /DOOM.ZIP/ doomzip

flynnsbit commented 3 years ago

Here is the fix for this. In TDL_CACH.PAS. This will allow for any char length of base_name below 8 characters without TDL appending .ZIP to the folder name:

`Function TFileCache.cDir(tf:PFileStruct):PathStr; begin {must NOT have trailing slash due to chdir() assumption/limitation} {cDir:=path+basename(tf^.name)}

cDir:=path+basename(StrPas(tf^.name)) end;`

MobyGamer commented 5 months ago

FYI, I also addressed the short name, spaces, etc. issues with the indexer script about a month ago, so that's fixed too.