April 2017

Romset DAT Tools

Years ago I had downloaded several romset, and now I wanted to cross-match the files with current romset DATs available (mostly Nointro and Advanscene).

Unfortunately Clrmame seems is too sophisticated for me, and Rom Vault is ok, but it renames the files, while I wanted to check via torrent… Also after I would need to download missing files from some other source, so… I made these tools, I doubt they would be useful for anyone, but if yes - good for you :)

Quick description what each one does:

advanscene_datxml_parser - parses Advanscene DAT into simple text format for future cross-checks
nointro_datxml_parser - parses Nointro DAT XML format into simple text for future use
old_dat_parser - parses Nointro DAT old format (Clrmame) into simple text for future use
cross_check_advancene-nointro - does a cross check for files missing in Nointro and Advancene DAT files (skips [b] files)

crc32_from_zip, md5_from_zip - generate text file with a list of files in a directory and crc32/md5/both for them
cross_check_md5 - does a cross check for files in a folder and compares with DAT text and moves files into Good/Bad directories accordingly

ndsdec_parser - parser for files in this topic on Romshepherd, useful for downloading only missing files
cross_check_my_links - does a cross check for missing files with the above file, and generate a list to download

rename_zip - renames zip files using content inside (means if inside is XXX.nds and ZIP is named YYY.zip it would be renamed to XXX.zip)

That’s it :) Hope it could be useful for somebody.

 

Files: DAT Tools for No-Intro/ADVANsCEne (ZIP)

Buriko/Ethornell - Inside

Time ago I told that I will check the possibility to apply old Hirameki translation to new Eve Remake by El Dia. When I told that I did not though that there could be any problems - Buriko is used by game developers for years, there are lot of conversions by MG, so all the tools should be ready and I just need to extract data from both releases and mix them together, right? Wrong.

After checking the web I found out, that there are just a few tools - by xupefei and by kingshriek, which deal with the scripts. I extracted data from .arc files using the script I wrote (you can see the link in downloads or in this post in the bottom), but after that I saw that there files inside are compressed, so instead of writing a new depack tool I just used arc_unpacker by rr- (great all-purpose extract tool, probably I could extract from arc files with it as well, but as I already wrote my own…).

My extracted packed files (titled as DSC Format 1.00 inside) were successfully extracted and revealed, that script files are BurikoCompiledScriptVer1.00. Basically I supposed that everything will go smoothly from here, but unfortunately I did not have anything to compile xupefei tools and kingshriek tool did not worked here.

After that I had no other choice but to start digging into file format… Yeah… Well, what can say - each Buriko game have its own set of unique bytecodes, which seems could be added or removed. So all you can do is to write a depacker for script of some particular game only. Another game, made in Buriko, most likely would have all the commands coded with different bytecode.

So only way is to depack bytecode the way kingshriek does - so not in real commands, but like:

Position D:\BURIKOScriptSystem\EVE_burst_error_A\Script\100_kojiroh\a01.bsb 194
PushDword 1
PushDword 1
PushDword 0
PushDword 0
PushString ドテッ。
call OutputLine
Position D:\BURIKOScriptSystem\EVE_burst_error_A\Script\100_kojiroh\a01.bsb 196
PushString eve_21
PushDword 0
PushDword 0
PushString bgmPlay
_function_1C
Position D:\BURIKOScriptSystem\EVE_burst_error_A\Script\100_kojiroh\a01.bsb 198
PushDword 1
PushDword 1
PushDword 0
PushString 小次郎KojirohAmagi
PushString んくっ‥‥ん‥‥。
call OutputLine

That’s not very good-looking, but enough for me to figure out the flow of the game.

Another problem here is that I do not really need to redo whole script - I just need to change the textes. Unfortunately, Buriko author decided to completely skip the offset table, pointing to text placement and instead just encoded the text line numbers. This is probably okay for him, but not good for me as a reverser, because to find all the pointers to text I would have first to extract whole script file :)  As you can see on previous example, I already did that, so now I need to create a tool which would extract that file into something editable and after combine it back into a file, which the game can read.

…

Probably someone could ask - you just speak about extraction, what about putting it back? Yes, indeed, it is required to write a compressor into that DSC format and after an .arc file creator from these files… But, after some code checks I found out, that Buriko first checks the current directory, if it could find a file there, and if yes - it loads it directly. So there is actually no need to put all these files into .arc or compress them - engine loads them right from the game directory :) At least one less hassle.

So, that’s how it goes with Eve and Buriko. Lets see, if I can put this for some use later…

 

Files: BGI ARC extract (ZIP)