Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Convert old MexScript to BMSScript ?

Featured Replies

  • Replies 51
  • Views 2
  • Created
  • Last Reply

Top Posters In This Topic

  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 12:36 am (46608)


Hi,

I would like to know if a tutorial or a converter exist to port old MexScript to BMS ?

I would like to port them myself to learn the BMS Scripts in order to make new scripts myself.

Like this MexScript :

Spider-Man PC PKR3 Files (The only Script who works with theses files, not the case of the BMScripts on the website).
Code:
ImpType StandardTail;
Get MW Long 0;
SavePos TailOffOff 0;
Get TailOff Long 0;
GoTo TailOff 0;
Get U1 Long 0;
Get Folders Long 0;
Get Files Long 0;
SavePos FolderStart 0;
Set D Long Folders;
Math D *= 40;
Math D = FolderStart;
For T = 1 To Folders;
GoTo FolderStart 0;
GetDString FoN 32 0;
Get TPF Long 0;
Get CurFiles Long 0;
SavePos FolderStart 0;
GoTo D 0;
Set A Long 0 ;
Do ;
Math A = 1 ;
GetDString FiN 32 0;
Get U2 Long 0;
Get ComBool Long 0;
SavePos FOO 0;
Get FO Long 0;
SavePos USO 0;
Get USize Long 0;
SavePos CSO 0;
Get CSize Long 0;
Set Name String FoN;
String Name = FiN;
If ComBool < 2;
Log Name FO CSize FOO CSO ;
EndIf;
While A < CurFiles;
SavePos D 0;
Next T;


or even this one (Same, the Atlantis The Lost Tales BMSScript is broken, only this following MexScript works fine) :

Code:
IDString 0 "BigFile 1.00" ;
SavePos S 0 ;
Math S = 4 ;
GoTo S 0 ;
Get FileNum Long 0 ;
Get DataSize Long 0 ;
Get DataStartL Long 0 ;
Get DataStartH Long 0 ;
For T = 1 to FileNum ;
Get StringSize Long 0 ;
Get U1 Long 0 ;
Get Size1 Long 0 ;
Get Size2 Long 0 ;
Get Size3 Long 0 ;
Get R1 Long 0 ;
Get ROff Long 0 ;
Get U2 Long 0 ;
GetDString FN StringSize 0 ;
Math ROff = DataStartL ;
Log FN ROff Size1 0 0 ;
Next T ;
  • Author
  • Localization

Acewell, posted Mon Apr 08, 2019 5:03 am (46614)


this will replace that spider man script and will extract all files as opposed
to just uncompressed wav and bik files, at least from my tests. :)
Code:
idstring "PKR3"
get INFO_OFF long
goto INFO_OFF
get UKN long
get NUM_FOLDERS long
get TOTAL_FILES long
savepos FOLDERSTART
math TMP = NUM_FOLDERS
math TMP * 40
math TMP FOLDERSTART
for i = 0     goto FOLDERSTART
    getdstring FOLDERNAME 0x20
    get TPF long
    get FILES long
    savepos FOLDERSTART
    goto TMP
    for j = 0         getdstring FNAME 0x20
        get UKN2 long
        get FLAG long
        get OFFSET long
        get SIZE long
        get ZSIZE long
        string NAME p "%s%s" FOLDERNAME FNAME
        if FLAG             log NAME OFFSET ZSIZE
        else
            clog NAME OFFSET ZSIZE SIZE
        endif
    next j
    savepos TMP
next i
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 8:54 am (46618)


MexScript and BMS script are compatible, no need to edit them.

BMS simply makes the filenumber field optional and doesn't need the ';' delimiter.
  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 9:43 am (46620)


Hi aLuigi.

Not the case here, theses 2 scripts doesn't work on QuickBMS ! QuickBMS extract 0% of archive.
But works fine on MultiEX Commander. MultiEX Commander extract 100% of the archive.

Why ? Maybe a bug on QuickBMS ?
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 9:48 am (46622)


Please upload the two sample files and I will check what's wrong.
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 11:02 am (46628)


In the first script the problem is the following line:
Code:
Log Name FO CSize FOO CSO ;

which must be fixed with:
Code:
Log Name FO CSize # FOO CSO ;

The reason is that quickbms doesn't need those two fields for reimporting the file and they collide with the syntax of the optional arguments.

All the multiex scripts on my website have these additional fields fixed.

Where did you find these scripts?
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 11:09 am (46629)


I don't see any problem with the second script.
  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 11:17 am (46631)


Thanks for the fix for the first script aLuigi !
I found theses scripts on old Zenhax posts when searching for scripts.
Because you don't have working scripts for theses games on your website.

For the second script i talked about this one :

https://aluigi.altervista.org/bms/atlan ... _tales.bms

Who doesn't work and only the MexScript works fine.
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 11:20 am (46632)


It's a completely different format.
  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 11:22 am (46634)


Ah okay, because the BIGCD1.BIG i send you it's Atlantis The Lost Tales game ^^

So what format this script on your website extract ?
  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 11:27 am (46636)


Ahhhh okay for the Sega Saturn version !!

Good to know !

Do you have a Versailles 2 ( *.bf ) script ? It's written supported but i can't found anywhere the script on your website.

http://wiki.xentax.com/index.php/CyroBF
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 11:42 am (46637)


If you have a sample file I can support it on the fly

P.S.: I have now added Sega Saturn in the title of the Atlantis script
  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 12:24 pm (46640)


Thanks aLuigi !

Do you know if .SPW and .SPR used in every Cryo Games are extractable by a BMS Script ?
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 12:29 pm (46641)


I have only SPR in that archive and it's just data, I bet SPW is the same.
  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 12:37 pm (46642)


So they are not extractable ?

https://we.tl/t-h6XhkZ59Dg

Like i know thanks to your scripts and lot of researcher we have almost every files supported of Cryo Games, except SPR/SPW.
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 12:50 pm (46644)


No idea, maybe they are sprites or something like that... not my field
  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 12:59 pm (46645)


No problem ;)

Here a C code i have adapted to work to extract every voices from Dune (Mega CD Version).

Code:
#include "stdio.h"

int ConvertToWav()
{
    FILE    *file, *wav;
    int     read = EOF, write, i = 0;
    int    wavheader[] = {
        0x52, 0x49, 0x46, 0x46, 0x04, 0x09, 0x42, 0x13, 0x57, 0x41,
      0x56, 0x45, 0x66, 0x6D, 0x74, 0x20, 0x10, 0x00, 0x00, 0x00,
      0x01, 0x00, 0x01, 0x00, 0xCE, 0x56, 0x00, 0x00, 0x9C, 0xAD,
      0x00, 0x00, 0x02, 0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61,
      0xE0, 0x08, 0x42, 0x13, 0x00
            };

    printf("Dune PCM Dumper to Wav Converted Modified by Tgames V1.0\n");
    file = fopen("DUNE.DAT", "r");
    if(!file)
    {
        printf("Could not open DUNE.DAT, please copy it in this folder and restart\n");
        return(0);
    }
    wav = fopen("DUNEMGCD_PCM.wav", "w");
    if(!wav)
    {
        fclose(file);
        printf("Could not create output file\n");
        return(0);
    }

    do
    {
        write = wavheader[i ];
        if(write != 0xFF)
            fputc(write, wav);
    }
    while(write != 0xFF);

    printf("Writing to DUNEMGCD_PCM.wav\n");
    do
    {
        read = fgetc(file);
        if(read != EOF)
        {
            if(read                 write = 0x80 - read;
            else
                write = read;

            if(write == 0xFF)       
            {
                int skip = 0;

                do
                {
                    read = fgetc(file);
                    skip ;
                }
                while(skip             }
            else
                    fputc(write, wav);
        }
    }
    while(read != EOF);

    fclose(wav);
    fclose(file);
    printf("Conversion complete\n");
    return(1);
}

int main()
{
    if(!ConvertToWav())
        return(1);

    return(0);
}


But it just make a full WAV file and not cut every voices one by one (like a BMS Script do)

Theses Voices (after the C Script) are :

Encoding: Unsigned 8-bit PCM
Bytes order : "Endianness"
22222Hz Mono

Are you sure Dune Mega CD have no header ? It can helps us, because it's really painful to cut every voices in my export xD.
We have everything thanks to this C code, but really really long to cut every voices one by one :mrgreen:

Dune Mega CD : https://we.tl/t-AC7iGRP2Ew
  • Author
  • Localization

aluigi, posted Mon Apr 08, 2019 1:07 pm (46646)


There are only zeroes at the beginning and 'P's at the end.
No structure.
  • Author
  • Localization

Tgames, posted Mon Apr 08, 2019 1:09 pm (46647)


Arf bad :(

And in my export, can a BMS Script auto split each voices ?

Here is my full export of all voices :

https://we.tl/t-Fq7MHjODmG

There is a separator sound between each voices.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.