Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //BRSTM to BCSTM by froggestspirit
- //infile is brstm, outfile is bcstm. both start at position 0
- chr aaaa; //temporary variables
- chr bbbb;
- chr cccc;
- chr dddd;
- file_bin_write_long($4353544D);//CSTM
- file_bin_write_long($FFFE4000);
- file_bin_write_long($00000002);
- file_bin_seek(infile,8);
- file_bin_convert_long();//size Convert long/short swaps the endian-ness so $4312 becomes $1243
- file_bin_write_long($03000000);//0x10
- file_bin_write_long($00400000);
- file_bin_write_long($40000000);
- file_bin_write_long($00010000);
- file_bin_write_long($01400000);//0x20
- file_bin_write_long($40010000);
- file_bin_seek(infile,$1C);
- file_bin_convert_long();//loop?
- file_bin_write_long($02400000);
- dataSection=file_bin_convert_long();//0x30
- file_bin_convert_long();
- file_bin_write_long($00000000);
- file_bin_write_long($00000000);
- file_bin_write_long($494E464F);
- file_bin_write_long($00010000);
- file_bin_write_long($00410000);
- file_bin_write_long($18000000);
- file_bin_write_long($01010000);
- file_bin_write_long($50000000);
- file_bin_write_long($01010000);
- file_bin_write_long($5C000000);
- file_bin_write_long($02010200);
- file_bin_seek(infile,$64);
- file_bin_convert_short();//frequency?
- file_bin_write_byte(outfile,0);
- file_bin_write_byte(outfile,0);
- file_bin_seek(infile,$68);
- file_bin_convert_long();
- file_bin_convert_long();
- file_bin_seek(infile,$74);
- file_bin_convert_long();
- file_bin_write_long($00200000);
- file_bin_write_long($00380000);
- file_bin_seek(infile,$80);
- file_bin_convert_long();
- file_bin_convert_long();
- file_bin_convert_long();
- file_bin_write_long($04000000);
- file_bin_write_long($00380000);
- file_bin_write_long($001F0000);
- file_bin_write_long($18000000);
- file_bin_write_long($01000000);
- file_bin_write_long($01410000);
- file_bin_write_long($20000000);
- file_bin_write_long($02000000);
- file_bin_write_long($02410000);
- file_bin_write_long($28000000);
- file_bin_write_long($02410000);
- file_bin_write_long($30000000);
- file_bin_write_long($7F400000);
- file_bin_write_long($00010000);
- file_bin_write_long($0C000000);
- file_bin_write_long($02000000);
- file_bin_write_long($00010000);
- file_bin_write_long($00030000);
- file_bin_write_long($10000000);
- file_bin_write_long($00030000);
- file_bin_write_long($36000000);
- file_bin_seek(infile,$C0);
- while(file_bin_position(outfile)<$FB) file_bin_convert_short();
- file_bin_convert_long();
- file_bin_seek(infile,$E6);
- while(file_bin_position(outfile)<$109) file_bin_convert_short();
- file_bin_seek(infile,$F8);
- while(file_bin_position(outfile)<$129) file_bin_convert_short();
- file_bin_seek(infile,$11A);
- file_bin_convert_short();
- file_bin_write_long($00000000);
- file_bin_seek(infile,$120);
- while(file_bin_position(outfile)<$13F) file_bin_convert_short();
- file_bin_write_long($5345454B);
- file_bin_seek(infile,$144);
- file_bin_convert_long();
- file_bin_write_long($00000000);
- file_bin_write_long($00000000);
- file_bin_seek(infile,$150);
- while(file_bin_position(outfile)<dataSection){
- aaaa=file_bin_read_byte(infile);
- bbbb=file_bin_read_byte(infile);
- cccc=file_bin_read_byte(infile);
- dddd=file_bin_read_byte(infile);
- file_bin_write_byte(outfile,bbbb);
- file_bin_write_byte(outfile,aaaa);
- file_bin_write_byte(outfile,dddd);
- file_bin_write_byte(outfile,cccc);
- }
- file_bin_write_long($44415441);//DATA
- file_bin_seek(infile,file_bin_position(outfile));
- file_bin_convert_long();
- file_bin_convert_long();
- file_bin_convert_long();
- file_bin_close(infile);
- file_bin_close(outfile);
- game_end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement