Implement Wiimm's SZS Tools Into the Script Language #7
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#2 Implement the Core}
Atlas/Atlas-Launcher
#8 Implement Wiimm's WIT Tools Into the Script Language
Atlas/Atlas-Launcher
Reference: Atlas/Atlas-Launcher#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wiimm's SZS Tools in the Script Language
The script language shall be able to modify games files for Wii games since its main purpose is to mod Mario Kart Wii.
Most of the files to patch are
szs
files, which are archive equivalent to the more commonszip
files,bmg
files, which hold texts and translations for the games,tpl
files, which hold the images and textures of the game, and some others tools that allow for patching the binary files of the games to install LE-CODE, allowing for the support of more tracks.In the original MKWF-Install project, theses tools were called thanks to the python
subprocess
module, running theses tools with system calls to their executable form, alongside threads to parallelize many conversions (especially wbz files to szs files).This process was nevertheless incredibly heavy because of all the system calls to the OS to loading and opening the executable files, initializing the tools, process the command line and finally process the data while displaying information in the standard output.
Theses functionalities will then be implemented by modifying the source of the original tools to turn them into libraries that will be loaded only once by the project, leaving only the essentials conversions by removing all the systems calls.
Note that this library shall NOT be modified directly to allow forward compatibility with newer version of the tools, but instead wrap it and only use the original objects defined in the source.
Spotting
After some research in the source code of this tools, some functions seem interesting to expose in our new library.
SZS
An SZS file is represented with the
szs_file_t
structure. It can be manipulated with theses functions :LoadSZS
-> load an SZS file from diskSaveSZS
-> save an SZS file from memoryCopySZS
-> copy an SZS file in memoryExtractSZS
-> extract an SZS fileCreateSZS
-> create a new SZS from a directory on diskFindFileSZS
-> create a new iterator through SZS subfileFindSubFileSZS
-> search through an SZS iteratorInsertSubfileSZS
-> insert a new subfile in the SZS fileAppendSubfileSZS
-> apprend a new subfile in the SZS filePrintFileSZS
-> print an SZS iterator (?)IterateFilesSZS
-> iterate through an SZS iterator (?)Image
An image file is represented with the
Image_t
structure. It can be manipulated with theses functions :LoadIMG
: Load an image from diskSaveIMG
: Save an image to diskSaveTPL
: Save a TPL image to diskBMG
A bmg file is represented with the
bmg_t
structure. It can be manipulated with theses functions :FindItemBMG
FindAnyItemBMG
InsertItemBMG
DeleteItemBMG
LoadBMG
SaveTextBMG
SaveRawFileBMG
LoadXBMG
SaveRawXBMG
SaveTextXBMG
Others