Advertisement
Guest User

BRSTM2BCSTM

a guest
Aug 7th, 2015
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. //BRSTM to BCSTM by froggestspirit
  2. //infile is brstm, outfile is bcstm. both start at position 0
  3. chr aaaa; //temporary variables
  4. chr bbbb;
  5. chr cccc;
  6. chr dddd;
  7. file_bin_write_long($4353544D);//CSTM
  8. file_bin_write_long($FFFE4000);
  9. file_bin_write_long($00000002);
  10. file_bin_seek(infile,8);
  11. file_bin_convert_long();//size Convert long/short swaps the endian-ness so $4312 becomes $1243
  12. file_bin_write_long($03000000);//0x10
  13. file_bin_write_long($00400000);
  14. file_bin_write_long($40000000);
  15. file_bin_write_long($00010000);
  16. file_bin_write_long($01400000);//0x20
  17. file_bin_write_long($40010000);
  18. file_bin_seek(infile,$1C);
  19. file_bin_convert_long();//loop?
  20. file_bin_write_long($02400000);
  21. dataSection=file_bin_convert_long();//0x30
  22. file_bin_convert_long();
  23. file_bin_write_long($00000000);
  24. file_bin_write_long($00000000);
  25. file_bin_write_long($494E464F);
  26. file_bin_write_long($00010000);
  27. file_bin_write_long($00410000);
  28. file_bin_write_long($18000000);
  29. file_bin_write_long($01010000);
  30. file_bin_write_long($50000000);
  31. file_bin_write_long($01010000);
  32. file_bin_write_long($5C000000);
  33. file_bin_write_long($02010200);
  34. file_bin_seek(infile,$64);
  35. file_bin_convert_short();//frequency?
  36. file_bin_write_byte(outfile,0);
  37. file_bin_write_byte(outfile,0);
  38. file_bin_seek(infile,$68);
  39. file_bin_convert_long();
  40. file_bin_convert_long();
  41. file_bin_seek(infile,$74);
  42. file_bin_convert_long();
  43. file_bin_write_long($00200000);
  44. file_bin_write_long($00380000);
  45. file_bin_seek(infile,$80);
  46. file_bin_convert_long();
  47. file_bin_convert_long();
  48. file_bin_convert_long();
  49. file_bin_write_long($04000000);
  50. file_bin_write_long($00380000);
  51. file_bin_write_long($001F0000);
  52. file_bin_write_long($18000000);
  53. file_bin_write_long($01000000);
  54. file_bin_write_long($01410000);
  55. file_bin_write_long($20000000);
  56. file_bin_write_long($02000000);
  57. file_bin_write_long($02410000);
  58. file_bin_write_long($28000000);
  59. file_bin_write_long($02410000);
  60. file_bin_write_long($30000000);
  61. file_bin_write_long($7F400000);
  62. file_bin_write_long($00010000);
  63. file_bin_write_long($0C000000);
  64. file_bin_write_long($02000000);
  65. file_bin_write_long($00010000);
  66. file_bin_write_long($00030000);
  67. file_bin_write_long($10000000);
  68. file_bin_write_long($00030000);
  69. file_bin_write_long($36000000);
  70. file_bin_seek(infile,$C0);
  71. while(file_bin_position(outfile)<$FB) file_bin_convert_short();
  72. file_bin_convert_long();
  73. file_bin_seek(infile,$E6);
  74. while(file_bin_position(outfile)<$109) file_bin_convert_short();
  75. file_bin_seek(infile,$F8);
  76. while(file_bin_position(outfile)<$129) file_bin_convert_short();
  77. file_bin_seek(infile,$11A);
  78. file_bin_convert_short();
  79. file_bin_write_long($00000000);
  80. file_bin_seek(infile,$120);
  81. while(file_bin_position(outfile)<$13F) file_bin_convert_short();
  82. file_bin_write_long($5345454B);
  83. file_bin_seek(infile,$144);
  84. file_bin_convert_long();
  85. file_bin_write_long($00000000);
  86. file_bin_write_long($00000000);
  87. file_bin_seek(infile,$150);
  88. while(file_bin_position(outfile)<dataSection){
  89. aaaa=file_bin_read_byte(infile);
  90. bbbb=file_bin_read_byte(infile);
  91. cccc=file_bin_read_byte(infile);
  92. dddd=file_bin_read_byte(infile);
  93.  
  94. file_bin_write_byte(outfile,bbbb);
  95. file_bin_write_byte(outfile,aaaa);
  96. file_bin_write_byte(outfile,dddd);
  97. file_bin_write_byte(outfile,cccc);
  98. }
  99. file_bin_write_long($44415441);//DATA
  100. file_bin_seek(infile,file_bin_position(outfile));
  101. file_bin_convert_long();
  102. file_bin_convert_long();
  103. file_bin_convert_long();
  104.  
  105. file_bin_close(infile);
  106. file_bin_close(outfile);
  107. game_end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement