Guest User

Mario Mender 64 V0.1b (11H3)

a guest
Oct 28th, 2018
29
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.  
  3. <!-- saved from url=(0014)about:internet -->
  4. <!-- The above line must be followed by a WINDOWS FORMAT line break (so use notepad, not gedit) -->
  5. <!-- Source: https://stackoverflow.com/questions/8146926/why-does-ie-restrict-the-javascript-files-of-local-html-pages -->
  6. <html>
  7. <head>
  8. <meta charset="UTF-8"> <!--Makes "character encoding of the HTML document was not declared" message go away-->
  9. <!-- Source: https://stackoverflow.com/questions/11996257/the-character-encoding-of-the-html-document-was-not-declared#12819926 -->
  10. <style>
  11.  
  12. /*====================================================================*/
  13. /*============================= Styling ==============================*/
  14. /*====================================================================*/
  15.  
  16.  
  17. * {
  18. box-sizing: border-box;
  19. }
  20. body {
  21. background-color: #2d3134; /*Dark Grey*/
  22. width:350px; /*set width narrow to force floating elements to form as a column*/
  23. font-family: verdana
  24. }
  25. .MM64 { /*testing inbuilt splashscreen*/
  26. /*width: -webkit-max-content;*/
  27. /*width: -moz-max-content;*/
  28. /*background-color: #1a1146; Dark blue*/
  29. background-color: black;
  30. font-family: sans-serif;
  31. padding-left: 10px;
  32. /*padding-right: 15px;*/
  33. padding-right: 38px;
  34. padding-bottom: 2px;
  35. /*overflow: scroll;*/
  36. /*display: inline-flex;*/
  37. float: left;
  38. /*position: absolute;*/
  39.  
  40. }
  41. h1 { /*"Mario Mender" Splash Text*/
  42. /*color: #345eb2; Light Blue*/
  43. color: blue;
  44. margin-top: 0px;
  45. margin-left: 0%;
  46. margin-bottom: 0px;
  47. width: auto;
  48. font-family: sans-serif;
  49.  
  50. /*Stetching code https://stackoverflow.com/questions/6351013/css-can-i-stretch-text#12065925*/
  51. transform-origin: left; /*Really awesome bit of code, hang on to this one*/
  52. display:inline-block;
  53. /*letter-spacing: -1.8px;*/
  54. letter-spacing: -0.07em;
  55. -webkit-transform:scale(1.1,1); /* Safari and Chrome */
  56. -moz-transform:scale(1.1,1); /* Firefox */
  57. -ms-transform:scale(1.1,1); /* IE 9 */
  58. -o-transform:scale(1.1,1); /* Opera */
  59. transform:scale(1.1,1); /* W3C */
  60. }
  61.  
  62. h1 .h64 {
  63. color: red;
  64. letter-spacing: 0px;
  65. font-size: x-large;
  66. vertical-align: super;
  67. font-family: sans-serif;
  68. }
  69. #splash {
  70. float: left;
  71. width: 800px;
  72. background-color: #cccccc;
  73. /*background-color: #345eb2; */
  74. font-family: sans-serif;
  75. padding-left: 10px;
  76. padding-right: 10px;
  77. /*border: 2px solid black;*/
  78. }
  79. table, td, th {
  80. border: 1px solid black;
  81. margin-top: 0px;
  82. margin-bottom:0px
  83. }
  84.  
  85. #maincontainer { /*Contains everything that isn't the debug display to the right*/
  86. width: 500px;
  87. float: left; /*added*/
  88. display: none; /*Hide by default*/
  89. }
  90. .header { /*Where the debug button lives*/
  91. background-color: green;
  92. color: white;
  93. padding: 15px;
  94. width: 100%; /*was 100%*/
  95. float: left;
  96. display: none; /*Set to invisible, remove this to make visible again*/
  97. }
  98. .footer { /*To be used for printer (header part obsolete)*/
  99. background-color: black;
  100. color: white;
  101. padding: 15px;
  102. width: 100%; /*was 100%*/
  103. float: left;
  104. font-family: monospace;
  105. }
  106. #videobox { /*instruction box, was blue but isn't anymore*/
  107. /*background-color: grey;*/
  108. color: white;
  109. padding: 15px;
  110. width: 100%; /*was 100%*/
  111. height: 230px;
  112. float: left;
  113. text-align: center;
  114. /*background-image: url("a.gif"); Works fine, but disabling for now*/
  115. /*background-color: #597ce3; (blue)*/
  116. background-color: #cccccc;
  117. font-family: Franklin Gothic Medium,Franklin Gothic,ITC Franklin Gothic,Arial,sans-serif;
  118. background-repeat: no-repeat;
  119. background-size: 100% 100%; /*fill div width 100%, same for height*/
  120. }
  121.  
  122. .vidoverlay { /*For printing text instructions over the videos*/
  123. color: black;
  124. text-align: center;
  125. position: relative;
  126. /*font-family: sans-serif;*/
  127. font-size: large;
  128. /*font-weight: bold;*/
  129. /*bottom: 80px;*/ /*Move up 80px relative to normal location*/
  130. }
  131. .leftrightboxcontainer { /*The container for the input and instruction windows*/
  132. content: "";
  133. clear: both;
  134. display: table; /*Really important! and completely glossed over!*/
  135. height: 100%;
  136. width: 100%; /*New addition as of 9(A)*/
  137. background-color: green;
  138. }
  139. .column { /*Instruction window, below video to the right*/
  140. float: left;
  141. padding: 10px;
  142. /*background-color: yellow;*/
  143. background-color: #f7c50e; /*SM64 yellow*/
  144. font-family: Franklin Gothic Medium,Franklin Gothic,ITC Franklin Gothic,Arial,sans-serif;
  145. }
  146. .leftinput { /*The Input Window*/
  147. width: 50%; /*was 33%*/
  148. background-color: red;
  149. height: 50%; /*added*/
  150. }
  151. .rightinstruction { /*The Instruction Window... again?*/
  152. /*width: 50%;*/ /*was 33%*/
  153. width: 100%;
  154. height: 50%; /*added*/
  155. overflow: auto;
  156. }
  157.  
  158. #debugbox { /*The debug display box*/
  159. background-color: #6efffd;
  160. float: left;
  161. color: black;
  162. padding: 15px;
  163. width: 18%;
  164. display: none; /* Change if you want debug display to be invisible by default*/
  165. /*
  166. display: block; basically means the element will exist
  167. display: none; means the element will not exist
  168. */
  169. }
  170. #FFooter {
  171. display: none; /* Footer invisible by default*/
  172. }
  173. button {
  174. font-family: Franklin Gothic Medium,Franklin Gothic,ITC Franklin Gothic,Arial,sans-serif;*/
  175. /*font-family: impact;*/
  176. /*font-weight: bold;*/
  177. }
  178. select {
  179. font-family: Franklin Gothic Medium,Franklin Gothic,ITC Franklin Gothic,Arial,sans-serif;*/
  180. }
  181. table {
  182. border-radius: 15px;
  183. border-spacing: 0;
  184. }
  185. td, tr {
  186. border: 0px;
  187. padding: 8px;
  188. text-align: left;
  189. }
  190. tr:nth-child(even) { /*table row stripes*/
  191. /*background-color: #f2f2f2;*/
  192. background-color: #c0c0c0;
  193. }
  194. a {
  195. color: #000077; /*Change link colour to a darker blue*/
  196. }
  197.  
  198. </style>
  199.  
  200. <!--=================================================================-->
  201. <!--========================= End Styling ===========================-->
  202. <!--=================================================================-->
  203.  
  204.  
  205. <!--=================================================================-->
  206. <!--=========================== Script ==============================-->
  207. <!--=================================================================-->
  208.  
  209. <!-- activex script bother source: https://stackoverflow.com/questions/8146926/why-does-ie-restrict-the-javascript-files-of-local-html-pages#8146943 -->
  210. <script>
  211.  
  212. // These are pretty much just test variables at this point
  213. var debugdisplay= 0; // 0 for invisible, 1 for visible
  214. var testvar= 12; // Just for debugging
  215. var testvar2= 12; // Just for debugging
  216. var userno= 19; // doesn't seem to do anything? Just for debugging?
  217. var hexstring= 0; // temporary holding var, contents copied to enteredvalue, used for fog detecting
  218.  
  219. var alpha48= 0; // quick hack used to decide if the alpha texture fix for older hacks is to be used
  220.  
  221. //When dealing with arrays, VERY important to declare using square brakets
  222. var lvlswithfog= []; // Array for storing the levels which have fog ()
  223. var lvlstartadd1= []; // Array holds the start address of each level in decimal (48 or 64MB)
  224. var lvlstartaddhex= []; // Array holds the start address of each level in hex (48 or 64MB), used for printing instructions
  225.  
  226. var lvlendaddDEC= []; // Array holds the end address of each level in decimal (48 or 64MB)
  227. var lvlendaddhex= []; // Array holds the end address of each level in hex (48 or 64MB), used for printing instructions
  228.  
  229. var gotoadd= 0; // stores the "goto address" to be shown to the user
  230. var lvlswithfogSTARTADD= []; //the start address in decimal of lvls with fog
  231. var lvlswithfogENDADD= []; //the end address in decimal of lvls with fog
  232. var lvlswithfogSTARThex= []; //the start address in hex of lvls with fog
  233. var lvlswithfogENDhex= []; //the end address in hex of lvls with fog
  234.  
  235. // Start -=- End
  236. //------------------------------------------
  237. // lvlstartadd1 -=- lvlendaddDEC
  238. // lvlstartaddhex -=- lvlendaddhex
  239. // lvlswithfogSTARTADD -=- lvlswithfogENDADD
  240. // lvlswithfogSTARThex -=- lvlswithfogENDhex
  241.  
  242. var FCvalve= 0; // Thing for dealing with finding FCs in the last level slot
  243.  
  244.  
  245. var FCholdingarray= [];
  246. // FC Command 'banks', one for each level
  247. var FClvl00= [];
  248. var FClvl01= [];
  249. var FClvl02= [];
  250. var FClvl03= [];
  251. var FClvl04= [];
  252. var FClvl05= [];
  253. var FClvl06= [];
  254. var FClvl07= [];
  255. var FClvl08= [];
  256. var FClvl09= [];
  257. var FClvl10= [];
  258. var FClvl11= [];
  259. var FClvl12= [];
  260. var FClvl13= [];
  261. var FClvl14= [];
  262. var FClvl15= [];
  263. var FClvl16= [];
  264. var FClvl17= [];
  265. var FClvl18= [];
  266. var FClvl19= [];
  267. var FClvl20= [];
  268. var FClvl21= [];
  269. var FClvl22= [];
  270. var FClvl23= [];
  271. var FClvl24= [];
  272. var FClvl25= [];
  273. var FClvl26= [];
  274. var FClvl27= [];
  275. var FClvl28= [];
  276. var FClvl29= [];
  277. var FClvl30= [];
  278. //var FClvl31= []; // Pointless!
  279.  
  280.  
  281. var foglvlmarker= 0; //To keep track of level we're currently looking at
  282. var FClvlmarker= 0;
  283.  
  284. var selectTitle= 0; // Stores options the user selects
  285. var selectHead= 0;
  286. var selectPeach= 0;
  287. var selectPipe= 0;
  288. var selectCam= 0;
  289. var selectMCam= 0;
  290.  
  291. var sledgeFrom= "1200000"; //Replace all FCs from this location onwards (can be set to A00000 via options)
  292.  
  293. var theDate= 0;
  294. var dateStamp= 0;
  295. var dateStampDest= [];
  296. var testscript= "I'ma script, see?";
  297. var standardScript= "", alphaScript= "", titleScript= "", headScript= "", peachScript= "", pipeScript= "", camScript= "", mcamScript= "", fogScript= "", stampScript= "";
  298.  
  299. /*========================== GUI script ==============================*/
  300. function clearsplash() { // Clears splash screen and reveals main GUI emelments
  301. document.getElementById('splash').style.display = "none"; // Hides splash
  302. document.getElementById('maincontainer').style.display = "block"; // Reveals maincontainer
  303. document.body.scrollTop = 0; // For Safari
  304. document.documentElement.scrollTop = 0; // For others
  305. }
  306.  
  307. function cleargui() {
  308. document.getElementById('gui').innerHTML="";
  309. }
  310. function printromsize() {
  311. document.getElementById('gui').innerHTML='<p></p>Which of these options best describes your rom hack?</p><button onclick="THE48MBbutton()">Rom Size is 48MB / was made prior to 2013</button><br/><button onclick="THE64MBbutton()">Rom Size is 64MB / was made in 2013 or later</button><br/><br/>Rom size is a better guide than the release date - if the there&#39s a clash, go with that. If your rom size is something other than 48MB or 64MB, you are unlikely to get good results.';
  312. }
  313. function printoptions() {
  314. document.getElementById('gui').innerHTML='<h3>Options</h3>If in doubt, stick with the recomended defaults<br/><br/>Title Screen<br/><select id="OptTitle"><option>Do Nothing (recomended)</option><option>Skip</option><option>Restore</option><option>Attempt Repair of Custom Title Screen (experimental)</option></select><br/><br/>Mario Head Screen<br/><select id="OptHead"><option>Restore, then skip using alternative method (recomended)</option><option>Restore</option><option>Skip (WARNING: results in no picture on console!)</option><option>Do Nothing</option></select><br/><br/>Peach Intro<br/><select id="OptPeach"><option>Skip (recomended)</option><option>Do Nothing</option></select><br/><br/>Warp Pipe Behaviour<br/><select id="OptPipe"><option>Change to normal warp behaviour (recomended)</option><option>Do Nothing</option></select><br/><br/>Parallel lakitu patch by aglab2<br/><a href="http://origami64.net/showthread.php?tid=838" target="_new">(http://origami64.net/showthread.php?tid=838)</a><select id="OptCam"><option>Apply Patch (recomended)</option><option>Do Nothing</option></select><br/><br/>Star Road style Mario Cam (Code by Skelux)<br/><a href="https://smwc.me/991239" target="_new">(https://smwc.me/991239)</a><br/><select id="OptMCam"><option>Apply (recomended)</option><option>Do Nothing</option></select><br/><br/><button onclick="grabOptions()">Next</button>';
  315.  
  316. // var x = (document.getElementById("OptTitle")).selectedIndex;
  317.  
  318. /*
  319. <h3>Options</h3>
  320. <br/>
  321. <br/>
  322. Title Screen<br/>
  323. <select id="OptTitle">
  324. <option>Do Nothing (recomended)</option> //0
  325. <option>Skip</option> //1
  326. <option>Restore</option> //2
  327. <option>Attempt Repair of Custom Title Screen (experimental)</option> //3
  328. </select>
  329. <br/>
  330. <br/>
  331. Mario Head Screen<br/>
  332. <select id="OptHead">
  333. <option>Restore, then skip using alternative method (recomended)</option> //0
  334. <option>Restore</option> //1
  335. <option>Skip (WARNING: results in no picture on console!)</option> //2
  336. <option>Do Nothing</option> //3
  337. </select>
  338. <br/>
  339. <br/>
  340. Peach Intro<br/>
  341. <select id="OptPeach">
  342. <option>Skip (recomended)</option> //0
  343. <option>Do Nothing</option> //1
  344. </select>
  345. <br/>
  346. <br/>
  347. Warp Pipe Behaviour<br/>
  348. <select id="OptPipe">
  349. <option>Change to normal wrap behaviour (recomended)</option> //0
  350. <option>Do Nothing</option> //1
  351. </select>
  352. <br/>
  353. <br/>
  354. Parallel lakitu patch by aglab2 (Up2date?)<br/>
  355. <a href="http://origami64.net/showthread.php?tid=838">(http://origami64.net/showthread.php?tid=838)</a>
  356. <select id="OptCam">
  357. <option>Apply Patch (recomended)</option> //0
  358. <option>Do Nothing</option> //1
  359. </select>
  360. <br/>
  361. <br/>
  362. Star Road style Mario Cam (Code by Skelux)<br/>
  363. <a href="https://www.smwcentral.net/?p=viewthread&t=60812">(https://www.smwcentral.net/?p=viewthread&t=60812)</a>
  364. <select id="OptMCam">
  365. <option>Apply (recomended)</option> //0
  366. <option>Do Nothing</option> //1
  367. </select>
  368. <br/>
  369. <br/>
  370. <button onclick="initialisefindfog()">Next</button>';
  371. */
  372.  
  373. } // End printOptions()
  374.  
  375. function grabOptions() {
  376. //var x = (document.getElementById("OptTitle")).selectedIndex;
  377. //initialisefindfog();
  378. selectTitle= (document.getElementById("OptTitle")).selectedIndex;
  379. selectHead= (document.getElementById("OptHead")).selectedIndex;
  380. selectPeach= (document.getElementById("OptPeach")).selectedIndex;
  381. selectPipe= (document.getElementById("OptPipe")).selectedIndex;
  382. selectCam= (document.getElementById("OptCam")).selectedIndex;
  383. selectMCam= (document.getElementById("OptMCam")).selectedIndex;
  384. initialisefindfog();
  385.  
  386. }
  387.  
  388. function initialisefindfog() {
  389. gotoadd= lvlstartaddhex[0];
  390. //printgoto();
  391. FIRSTprintgoto();
  392. }
  393. function initialisefindFC() {
  394. foglvlmarker= 0; //reusingfoglvlmarker,maybe a bad idea, easy enough to make a new one.
  395. //gotoadd= lvlstartaddhex[0]; // I don't like this, generate new array listing only start addresses (decimal) of lvls with fog.
  396. for (foglvlmarker= 0; foglvlmarker < lvlswithfog.length; foglvlmarker++) {
  397. var temphold= 0;
  398. temphold=lvlstartadd1[lvlswithfog[foglvlmarker]]; // temphold= startaddress(decimal) of a level containing fog
  399. lvlswithfogSTARTADD.push(temphold);
  400.  
  401. temphold= 0;
  402. temphold=lvlstartaddhex[lvlswithfog[foglvlmarker]]; // temphold= startaddress(hex) of a level containing fog
  403. lvlswithfogSTARThex.push(temphold);
  404. }
  405.  
  406. foglvlmarker= 0;
  407.  
  408. for (foglvlmarker= 0; foglvlmarker < lvlswithfog.length; foglvlmarker++) {
  409. var temphold= 0;
  410. temphold=lvlendaddDEC[lvlswithfog[foglvlmarker]];
  411. lvlswithfogENDADD.push(temphold);
  412.  
  413. temphold= 0;
  414. temphold=lvlendaddhex[lvlswithfog[foglvlmarker]]; // temphold= startaddress(hex) of a level containing fog
  415. lvlswithfogENDhex.push(temphold);
  416. }
  417.  
  418. foglvlmarker= 0;
  419. gotoadd= lvlswithfogSTARThex[0];
  420.  
  421. printgotoFC();
  422. debugprint();
  423. }
  424. function printfindfog() { // maybe should also be a findNEXTfog like with FC - none found first time round sends you straight to script printing
  425. document.getElementById('gui').innerHTML='Now I want you to search for "B7 00 00 00 00 01 00 00"<br/>(Search > Find...)<br/>(<a href="images/find.png" target="_new">help!</a>)<br/><br/>(Deja vu? Yeah, you&#39ll get alot of that here. Don&#39t worry about being asked to repeat steps, it&#39s supposed to work that way. &#58&#41<br/><br/><button onclick="printfindfoginput()">Ok, Ive done that</button><br/><button onclick="initialisefindFC()">String not found</button>'; //none found button should do initialise FC cataloging
  426. }
  427. function printfindFC() {
  428. document.getElementById('gui').innerHTML='Now I want you to search for "FC 12 7F FF FF FF F8 38"<br/>(Search > Find...)<br/>(<a href="images/find.png" target="_new">help!</a>)<br/><br/>Then enter the address at which you find it (<a href="images/address2.png" target="_new">how?</a>)<br/><br/><input id="userinput2" maxlength="7" placeholder="e.g. 120AC00 or 120ac00"><br/><button onclick="submitFCaddress()">Submit (to FC array)</button><br/><button onclick="FCLooseEnds()">String not found</button>';//
  429. }
  430. function printfindnextFC() {
  431. document.getElementById('gui').innerHTML='Now choose "Find again down".<br/>(<a href="images/findagain.png" target="_new">help!</a>)<br/><br/><button onclick="printfindnextFCpt2()">Ok, done that</button><br/><button onclick="FCLooseEnds()">String not found</button>';//
  432. }
  433. function printfindnextFCpt2() {
  434. document.getElementById('gui').innerHTML='Enter the address you&#39ve arrived at: (<a href="images/address2.png" target="_new">how?</a>)<br/><br/><input id="userinput2" maxlength="7" placeholder="e.g. 120AC00 or 120ac00"><br/><button onclick="submitFCaddress()">Submit (to FC array)</button><br/><button onclick="FCLooseEnds()">String not found</button>';//
  435. }
  436. function printgoto() {
  437. //document.getElementById('searchfor').innerHTML='Search for ' + gotoadd; <- I've nerfed this for the "sort-of release"
  438. document.getElementById('gui').innerHTML='Go to: $' + gotoadd + '<br/>(Address > Goto...)<br/>(<a href="images/goto2.png" target="_new">help!</a>)<br/><br/><button onclick="printfindfog()">Ok, I&#39ve done that</button><br/><button onclick="FCLooseEnds()">String not found</button>';
  439. }
  440. function FIRSTprintgoto() {
  441. //document.getElementById('searchfor').innerHTML='Search for ' + gotoadd; <- I've nerfed this for the "sort-of release"
  442. document.getElementById('searchfor').innerHTML='';
  443. document.getElementById('gui').innerHTML='Open XVI32 if you&#39ve not aready done so.<br/>(Don&#39t have it? Get it <a href="http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#download" target="_new">here</a>)<br/><br/>Then open your rom hack in XVI32.<br/>(File > Open...)<br/>(<a href="images/fileopen.png" target="_new">help!</a>)<br/><br/>From then on, follow the instructions below.' + '<br/><br/><br/>' + 'Go to: $' + gotoadd + '<br/>(Address > Goto...)<br/>(<a href="images/goto2.png" target="_new">help!</a>)<br/><br/><button onclick="FIRSTprintfindfog()">Ok, I&#39ve done that</button><br/><button onclick="FCLooseEnds()">String not found</button><br/><button onclick="FCLooseEnds()">Skip fog level texture fixing (skip to end)</button>';
  444. }
  445. function FIRSTprintfindfog() {
  446. document.getElementById('gui').innerHTML='Now I want you to search for "B7 00 00 00 00 01 00 00"<br/>(Search > Find...)<br/>(<a href="images/find.png" target="_new">help!</a>)<br/><br/><button onclick="printfindfoginput()">Ok, I&#39ve done that</button>';//none found button should do initialise FC cataloging
  447. }
  448. function printfindfoginput() {
  449. document.getElementById('gui').innerHTML='Enter the address you&#39ve arrived at: (<a href="images/address2.png" target="_new">how?</a>)<br/><br/><input id="userinput2" maxlength="7" placeholder="e.g. 120AC00 or 120ac00"><br/><button onclick="submitfogaddress()">Submit (to lvlswithfog array)</button><br/><button onclick="initialisefindFC()">String not found</button>';//none found button should do initialise FC cataloging
  450. }
  451. function printgotoFC() {
  452. //document.getElementById('searchfor').innerHTML='Search for ' + gotoadd; (Nerfed for the 'sort-of' release)
  453. document.getElementById('gui').innerHTML='Go to: $' + gotoadd + '<br/>(Address > Goto...)<br/>(<a href="images/goto2.png" target="_new">help!</a>)<br/><br/><button onclick="printfindFC()">Ok, I&#39ve done that</button><br/><button onclick="FCLooseEnds()">Erm, it says &#34Go to: $undefined&#34? Help?</button>';
  454. }
  455. function printScript() {
  456. document.getElementById('videobox').style.display = "none"; // hide blue box again
  457. document.getElementById('gui').innerHTML='The script has now been printed in the black box below.<br/><br/>1. Copy the whole script (i.e. the contents of the black box below), paste it into notepad and save it for future reference. (<a href="images/Step1.gif" target="_new">help!</a>)<br/><br/>2. In XVI32, click XVIscript, then Editor. This opens up the script interpreter window. (<a href="images/Step2.gif" target="_new">help!</a>)<br/><br/>3. Paste the script into the text box, click Execute and wait for the changes to be made. (<a href="images/Step3.gif" target="_new">help!</a>)<br/><br/>4. Once the script has finished executing, close the interpeter window. You&#39ll get a pop up saying &#34Script modified. Save now to file?&#34 - just click No here. (<a href="images/Step4.gif" target="_new">help!</a>)<br/><br/>5. Now click File, then Save As, and save the changed ROM. (<a href="images/Step5.gif" target="_new">help!</a>)<br/><br/>6. Drag and drop your saved ROM onto sm64compress v0.2a (<a href="https://github.com/queueRAM/sm64tools/releases/tag/sm64compressv0.2a" target="_new">get it here</a>). A new file called [ROMname].out.z64 will be created. (<a href="images/Step6.gif" target="_new">help!</a>)<br/><br/>7. Copy the new [ROMname].out.z64 file onto an SD card and try it out on your Nintendo 64. (<a href="images/Step7.gif" target="_new">help!</a>)';//
  458. document.getElementById('FFooter').innerHTML=testscript;//
  459. document.getElementById('FFooter').style.display = "block"; //Reveal Footer
  460.  
  461.  
  462.  
  463. }
  464.  
  465. /*========================== GUI script ==============================*/
  466.  
  467. /*========================= Debug script =============================*/
  468. function debugtoggle() {
  469. debugdisplay = debugdisplay +1;
  470. if (debugdisplay > 1){
  471. debugdisplay =0;
  472. }
  473. if (debugdisplay == 1) {
  474. document.getElementById('debugbox').style.display = "none";
  475. }
  476. if (debugdisplay == 0) {
  477. document.getElementById('debugbox').style.display = "block";
  478. }
  479. debugprint()
  480. }
  481.  
  482. function debugprint() {
  483. document.getElementById('debugbox').innerHTML=
  484. //
  485. "debugdisplay = " + debugdisplay + "<br/>" +
  486. "testvar = " + testvar + "<br/>" +
  487. "userno = " + userno + "<br/>" +
  488. "hexstring = " + hexstring + "<br/>" +
  489. "lvlswithfog = " + lvlswithfog + "<br/>" + //remove later, for testing atm
  490. "lvlstartadd1 = " + lvlstartadd1 + "<br/>" + //"actual" lvlstartadd list (placeholder)
  491. "lvlstartaddhex = " + lvlstartaddhex + "<br/>" +
  492. "foglvlmarker = " + foglvlmarker + "<br/>" +
  493. "lvlswithfog = " + lvlswithfog + "<br/>" +
  494. "lvlswithfogSTARTADD = " + lvlswithfogSTARTADD + "<br/>" +
  495. "lvlswithfogENDADD = " + lvlswithfogENDADD + "<br/>" +
  496. "FCholdingarray = " + FCholdingarray + "<br/>" +
  497. "lvlswithfogSTARThex = " + lvlswithfogSTARThex + "<br/>" +
  498. "lvlswithfogENDhex = " + lvlswithfogENDhex + "<br/>" +
  499. "FClvl03 = " + FClvl03 + "<br/>" +
  500. "gotoadd = " + gotoadd + "<br/>" +
  501. "FClvlmarker = " + FClvlmarker + "<br/>" +
  502. "lvlswithfogSTARThex.length = " + lvlswithfogSTARThex.length + "<br/>" +
  503. "testvar2 = " + testvar2;
  504. }
  505. /*========================= Debug script =============================*/
  506.  
  507. /*====================== Hex Convert Scripts ==========================*/
  508. function converttohex() {
  509. // Get the value of the input field with id="numb"
  510. x = parseInt(document.getElementById("userinput").value); // Very important to parse the string into an integer
  511. var n = x.toString(16);
  512. userno= x; // for testing
  513. hexstring= n;
  514. debugprint();
  515. }
  516. // Seems you can't pass a text variable into a function...
  517. function converttodecimal3() { //just a copy at the moment, want to refine it, maybe break down into 2 functions
  518. userno= 0; // testing
  519. var x, text; // just a temporary holding variable
  520. x = document.getElementById("userinput2").value;
  521. userno= x; //testing
  522. var a = parseInt(x, 16); // Changes hex number into decimal!! Magic!
  523. hexstring = a;
  524. debugprint();
  525. //return a; // a itself is just a temp holding var, but it carries the output
  526. }
  527. /*====================== Hex Convert Scripts ==========================*/
  528.  
  529. /*====================== Early Array Scripts ==========================*/
  530. function THE48MBbutton() { //Functions can't start with numbers :(
  531. //Remember, when math is involved, we're working in decimal!
  532. lvlstartadd1= [18874368, 19791872, 20709376, 21626880, 22544384, 23461888, 24379392, 25296896, 26214400, 27131904, 28049408, 28966912, 29884416, 30801920, 31719424, 32636928, 33554432, 34471936, 35389440, 36306944, 37224448, 38141952, 39059456, 39976960, 40894464, 41811968, 42729472, 43646976, 44564480, 45481984, 46399488];
  533. lvlendaddDEC= [19791872, 20709376, 21626880, 22544384, 23461888, 24379392, 25296896, 26214400, 27131904, 28049408, 28966912, 29884416, 30801920, 31719424, 32636928, 33554432, 34471936, 35389440, 36306944, 37224448, 38141952, 39059456, 39976960, 40894464, 41811968, 41811968, 43646976, 44564480, 45481984, 46399488, 47316992];
  534. lvlstartaddhex= ["1200000", "12E0000", "13C0000", "14A0000", "1580000", "1660000", "1740000", "1820000", "1900000", "19E0000", "1AC0000", "1BA0000", "1C80000", "1D60000", "1E40000", "1F20000", "2000000", "20E0000", "21C0000", "22A0000", "2380000", "2460000", "2540000", "2620000", "2700000", "27E0000", "28C0000", "29A0000", "2A80000", "2B60000", "2C40000"];
  535. lvlendaddhex= ["12E0000", "13C0000", "14A0000", "1580000", "1660000", "1740000", "1820000", "1900000", "19E0000", "1AC0000", "1BA0000", "1C80000", "1D60000", "1E40000", "1F20000", "2000000", "20E0000", "21C0000", "22A0000", "2380000", "2460000", "2540000", "2620000", "2700000", "27E0000", "28C0000", "29A0000", "2A80000", "2B60000", "2C40000", "2D20000"];
  536. dateStampDest= ["2FFFFC8", "2FFFFF8"]; //quick hack to avoid "write beyond end of file" error (actually obsolete now...)
  537. document.getElementById('videobox').style.display = "none"; // Hide blue textbox
  538. alpha48= 1;
  539. debugprint();
  540. printoptions();
  541. }
  542. function THE64MBbutton() {
  543. lvlstartadd1= [18874368, 20316160, 21757952, 23199744, 24641536, 26083328, 27525120, 28966912, 30408704, 31850496, 33292288, 34734080, 36175872, 37617664, 39059456, 40501248, 41943040, 43384832, 44826624, 46268416, 47710208, 49152000, 50593792, 52035584, 53477376, 54919168, 56360960, 57802752, 59244544, 60686336, 62128128];
  544. lvlendaddDEC= [20316160, 21757952, 23199744, 24641536, 26083328, 27525120, 28966912, 30408704, 31850496, 33292288, 34734080, 36175872, 37617664, 39059456, 40501248, 41943040, 43384832, 44826624, 46268416, 47710208, 49152000, 50593792, 52035584, 53477376, 54919168, 56360960, 57802752, 59244544, 60686336, 62128128, 63569920];
  545. lvlstartaddhex= ["1200000", "1360000", "14C0000", "1620000", "1780000", "18E0000", "1A40000", "1BA0000", "1D00000", "1E60000", "1FC0000", "2120000", "2280000", "23E0000", "2540000", "26A0000", "2800000", "2960000", "2AC0000", "2C20000", "2D80000", "2EE0000", "3040000", "31A0000", "3300000", "3460000", "35C0000", "3720000", "3880000", "39E0000", "3B40000"];
  546. lvlendaddhex= ["1360000", "14C0000", "1620000", "1780000", "18E0000", "1A40000", "1BA0000", "1D00000", "1E60000", "1FC0000", "2120000", "2280000", "23E0000", "2540000", "26A0000", "2800000", "2960000", "2AC0000", "2C20000", "2D80000", "2EE0000", "3040000", "31A0000", "3300000", "3460000", "35C0000", "3720000", "3880000", "39E0000", "3B40000", "3CA0000"];
  547. dateStampDest= ["3FFFFC8", "3FFFFF8"]; //quick hack to avoid "write beyond end of file" error (actually obsolete now...)
  548. document.getElementById('videobox').style.display = "none"; // Hide blue textbox
  549. debugprint();
  550. printoptions();
  551. }
  552. function submittoarray() { //test thing
  553. converttodecimal2();
  554. lvlswithfog.push(hexstring);
  555.  
  556. debugprint();
  557. }
  558. /*====================== Early Array Scripts ==========================*/
  559.  
  560. /*====================== Fog Detecting Script =========================*/
  561. function submitfogaddress() {
  562. //converttodecimal2(); //hexstring takes on decimalised value of entered data
  563. converttodecimal3(); //hexstring takes on decimalised value of entered data
  564. //Reminder, at the outset, foglvlmarker= 0;
  565. var enteredvalue= hexstring;
  566. //as long as foglvlmarker is less than *#NO. OF ITEMS* in lvlstartadd,
  567. //loop, incrementing foglvlmarker each time
  568. //i.e., do the following for each level, one at a time, till end
  569. for (foglvlmarker= 0; foglvlmarker < lvlstartadd1.length; foglvlmarker++) {
  570. //lvlswithfog.push(foglvlmarker); //for testing, just add foglvlmarker value to this array (seems to work)
  571.  
  572. if ((enteredvalue >= lvlstartadd1[foglvlmarker]) && (enteredvalue < lvlendaddDEC[foglvlmarker])) {
  573. lvlswithfog.push(foglvlmarker);
  574. gotoadd= lvlstartaddhex[foglvlmarker + 1]; // now goto address is the start address of the NEXT level
  575. if (enteredvalue > lvlstartadd1[30]) { // If entered value is within the last level range (i.e. no follow up level)
  576. gotoadd= "NOPE";
  577. testvar= 5093;
  578. }
  579. }
  580.  
  581. debugprint();
  582. } //end loop
  583. //this loop goes through (I think) 32 cycles for each button press
  584. //(i.e. to check that single text entry)
  585. //Then user, should be asked to repeat the previous step
  586.  
  587. //now needs to call a function issueing next lot of instructions/video update
  588. //Maybe instructions can be more detailed while still testing,
  589. //then simplified for release (if it gets to that stage)
  590.  
  591. //"Ok, you have entered: <number>
  592. //Again, please (chose find next case of FC and enter the relevant address
  593. //User should also have a button for "no more cases found", which jumps to next step
  594.  
  595. debugprint();
  596.  
  597. //Maybe: If goto="", we assume at last level and therefore no following level, in which case, do the "None were found" routine
  598. if (gotoadd=="NOPE") {
  599. //gotoadd= "I shouldn't say this";
  600. initialisefindFC();
  601. }
  602. else {
  603. //gotoadd= "test";
  604. printgoto();
  605. }
  606. debugprint();
  607. }
  608. /*====================== Fog Detecting Script =========================*/
  609.  
  610. /*====================== FC Cataloging Script =========================*/
  611. /* Just doodling atm
  612.  
  613. ***REALY SHOULD TIDY NAMES OF lvlstartadd 0 + 1, VERY CONFUSING ATM*** - DONE
  614. ***Have a go at improving convert to hex/decimal, make it so you can pass - DONEish
  615. a value to them, then they return it back out***
  616.  
  617.  
  618. *The below should maybe happen AFTER previous step completes...*
  619. *...but before user gets to enter any FC address (so, setup)*
  620.  
  621. lets assume lvlswithfog = [3,4,16,21] (these levels have fog)
  622. (lvlstartadd1 is levels start addresses as dictated by rom size
  623. holdingarray= [];
  624.  
  625. *Might be best to create 31/32 empty arrays, one for each level to store FC commands*
  626. *I don't know how to generate new variables/arrays on the fly...*
  627. *maybe use the one functional array when gathering data,
  628. *then just copy the completed array into the relevant level "bank" array to store them,
  629. *then clear the functional array, ready to start fresh for the next level?
  630. *User should have a button for "Reached the end of the file", just incase fixing very least level*
  631.  
  632. (foglvlmarker2 starts as zero, declared at begining)
  633.  
  634. function FCSetup() {
  635. if (foglvlmarker2 =< lvlswithfog.length) {
  636. lvlno= lvlswithfog[foglvlmarker2]
  637. lowerlimit= lvlstartadd1[lvlno]
  638. upperlimit= lvlstartadd1[lvlno + 1]
  639. lowerlimitdec= converttodecimal2(lowerlimit);
  640. upperlimitdec= converttodecimal2(upperlimit);
  641. ^^ Daft, just have 2 lvlstart arrays, 1 in hex, 1 in decimal, no need for converting!
  642. ...
  643. }
  644. if (foglvlmarker2 > lvlswithfog.length) {
  645. Call function to move onto the ending steps, printing etc
  646. }
  647. }
  648.  
  649.  
  650. USER SUBMITS ADDRESS {
  651. userinputdec= converttodecimal2(userinput); ***(convertodecimal2 needs an overhaul)***
  652. if ((userinputdec => lowerlimitdec) && (userinputdec =< upperlimitdec)) {
  653. holdingarray.push(userinput);
  654. call function to clear input window
  655. call function to repopulate input window
  656. print "received [userinput]" message
  657. print Again, please (find next case of FC and enter the relevant address)
  658. }
  659. if (userinputdec > upperlimitdec) { //This is a really complicated step, brace yourself!
  660. *1 - find relevant level array (function -> switch)*
  661. *2 - copy contents of holding array to relevant level array*
  662. findlevelarray(lvlno);
  663. *clear/wipe holdingarray (holdingarray= blankarray;?)*
  664.  
  665. ***
  666. ...or...
  667. we could just acknowledge that the entered address has exceeded the range, then send them back around the loop again with lowerlimit= lvlstartadd1[lvlno + 1]?
  668. In other words, more or less ignore what they've entered
  669. So:
  670. 1. copy contents of holding array to relevant FClvl bank (use foglvlmarker2 and a javascript switch - see below)
  671. 2. foglvlmarker2= foglvlmarker2++;
  672. 3. gottoadd= lvlstartaddhex[lvlswithfog[foglvlmarker2]];
  673. 4. print gotoV2
  674. (that's pretty simple, right?) ;)
  675. ***
  676.  
  677. print "received [userinput]" message
  678. foglvlmarker2++;
  679. FCSetup; //setup variables for the next level
  680. call function to clear input window
  681. call function to repopulate input window
  682. print "received [userinput]" message
  683. print "please go to [lowerlimit]"
  684. }
  685. }
  686.  
  687. function gonetoaddress() {
  688. call function to clear input window
  689. call function to repopulate input window
  690. print "please (find next case of FC and enter the relevant address)"
  691. (not much happens here, simple step so as not to overwhelm the user with instruc)
  692. }
  693.  
  694.  
  695. function findlevelarray() {
  696. case 0;
  697. lvl0array= holdingarray; (could it be that simple? I doubt it)
  698. break;
  699. case 1;
  700. lvl1array= holdingarray; (could it be that simple? I doubt it)
  701. break;
  702. etc
  703. }
  704. lvlstartadd1[foglvlmarker]
  705. */
  706.  
  707. function submitFCaddress() {
  708. var inputhex, text;
  709. inputhex = document.getElementById("userinput2").value;
  710.  
  711. converttodecimal3(); //hexstring takes on decimalised value of entered data
  712. //Reminder, at the outset, foglvlmarker= 0;
  713. var enteredvalue= hexstring;
  714.  
  715. //i.e., do the following for each level WITH FOG, one at a time, till end
  716. // lvlswithfog
  717. //for (foglvlmarker= 0; foglvlmarker < lvlswithfog.length; foglvlmarker++) {
  718. //lvlswithfog.push(foglvlmarker); //for testing, just add foglvlmarker value to this array (seems to work)
  719.  
  720.  
  721. //
  722. //
  723. //
  724.  
  725. //lvlswithfogSTARTADD, lvlswithfogENDADD
  726.  
  727. // if ((enteredvalue >= lvlstartadd1[lvlswithfog[foglvlmarker]]) && (enteredvalue < lvlstartadd1[lvlswithfog[foglvlmarker + 1]])) {
  728. // if ((enteredvalue >= lvlstartadd1[foglvlmarker]) && (enteredvalue < lvlstartadd1[foglvlmarker + 1])) {
  729. if ((enteredvalue >= lvlswithfogSTARTADD[FClvlmarker]) && (enteredvalue < lvlswithfogENDADD[FClvlmarker])) {
  730.  
  731. testvar= 111; //FC found - for testing
  732. FCvalve= 1;
  733. //FCholdingarray.push(hexstring); // push entered address into the holding array
  734. FCholdingarray.push(inputhex);
  735. //Really just need to print out "ok,now choose find next and enter next address"
  736. //gotoadd= lvlstartaddhex[FClvlmarker + 1]; // now goto address is the start address of the NEXT level
  737.  
  738. //Maybe valve=1; i.e. needs to be closed (add if statement to the function of the none found button
  739. printfindnextFC();
  740. }
  741.  
  742. /// A PRETTY BIG PROBLEM
  743. /// LIVES RIGHT HERE
  744. ///
  745. if (enteredvalue > lvlswithfogENDADD[FClvlmarker]) { // PRETTY BIG PROBLEM - what if no FCs beyond the level, holdingarray is not transfered!!
  746. testvar= 000; //FC found - for testing
  747. FCvalve= 0;
  748. debugprint();
  749. // Do many things.
  750. // COPY FCholdingarray CONTENTS TO RELEVANT LEVEL ARRAY (AND CLEAR HOLDING ARRAY)
  751. //lvlswithfog[FClvlmarker]
  752. holdingarraytransfer();
  753. FClvlmarker++;
  754. gotoadd= lvlswithfogSTARThex[FClvlmarker];
  755. if (FClvlmarker >= lvlswithfogSTARThex.length) { // But... if limit of lvlswithfogSARThex exceeded, should jump to FCLooseEnds.
  756. FCLooseEnds();
  757. testvar2= 555;
  758. }
  759. else {
  760. printgotoFC();
  761. testvar2= 666;
  762. }
  763. }
  764.  
  765. debugprint();
  766. }
  767.  
  768. function FCLooseEnds() { // if no FCs beyond final level, holdingarray transfered here instead
  769. if (FCvalve==1) {
  770. holdingarraytransfer();
  771. FCvalve= 0;
  772. gotoadd= "FC was 1, now 0 again";
  773. debugprint();
  774. }
  775. initialiseScript();
  776. }
  777. /*====================== FC Cataloging Script =========================*/
  778.  
  779. /*===================== Holding Array Transfer ========================*/
  780. function holdingarraytransfer() {
  781. switch(lvlswithfog[FClvlmarker]) {
  782. case 0:
  783. testvar= 00000;
  784. FClvl00= FCholdingarray;
  785. break;
  786. case 1:
  787. testvar= 11111;
  788. FClvl01= FCholdingarray;
  789. break;
  790. case 2:
  791. testvar= 22222;
  792. FClvl02= FCholdingarray;
  793. break;
  794. case 3:
  795. testvar= 33333;
  796. FClvl03= FCholdingarray;
  797. break;
  798. case 4:
  799. testvar= 44444;
  800. FClvl04= FCholdingarray;
  801. break;
  802. case 5:
  803. testvar= 55555;
  804. FClvl05= FCholdingarray;
  805. break;
  806. case 6:
  807. testvar= 66666;
  808. FClvl06= FCholdingarray;
  809. break;
  810. case 7:
  811. testvar= 77777;
  812. FClvl07= FCholdingarray;
  813. break;
  814. case 8:
  815. testvar= 88888;
  816. FClvl08= FCholdingarray;
  817. break;
  818. case 9:
  819. testvar= 99999;
  820. FClvl09= FCholdingarray;
  821. break;
  822. case 10:
  823. testvar= 10;
  824. FClvl10= FCholdingarray;
  825. break;
  826. case 11:
  827. testvar= 11
  828. FClvl11= FCholdingarray;
  829. break;
  830. case 12:
  831. testvar= 12;
  832. FClvl12= FCholdingarray;
  833. break;
  834. case 13:
  835. testvar= 13;
  836. FClvl13= FCholdingarray;
  837. break;
  838. case 14:
  839. testvar= 14;
  840. FClvl14= FCholdingarray;
  841. break;
  842. case 15:
  843. testvar= 15;
  844. FClvl15= FCholdingarray;
  845. break;
  846. case 16:
  847. testvar= 16;
  848. FClvl16= FCholdingarray;
  849. break;
  850. case 17:
  851. testvar= 17;
  852. FClvl17= FCholdingarray;
  853. break;
  854. case 18:
  855. testvar= 18;
  856. FClvl18= FCholdingarray;
  857. break;
  858. case 19:
  859. testvar= 19;
  860. FClvl19= FCholdingarray;
  861. break;
  862. case 20:
  863. testvar= 20;
  864. FClvl20= FCholdingarray;
  865. break;
  866. case 21:
  867. testvar= 21
  868. FClvl21= FCholdingarray;
  869. break;
  870. case 22:
  871. testvar= 22;
  872. FClvl22= FCholdingarray;
  873. break;
  874. case 23:
  875. testvar= 23;
  876. FClvl23= FCholdingarray;
  877. break;
  878. case 24:
  879. testvar= 24;
  880. FClvl24= FCholdingarray;
  881. break;
  882. case 25:
  883. testvar= 25;
  884. FClvl25= FCholdingarray;
  885. break;
  886. case 26:
  887. testvar= 26;
  888. FClvl26= FCholdingarray;
  889. break;
  890. case 27:
  891. testvar= 27;
  892. FClvl27= FCholdingarray;
  893. break;
  894. case 28:
  895. testvar= 28;
  896. FClvl28= FCholdingarray;
  897. break;
  898. case 29:
  899. testvar= 29;
  900. FClvl29= FCholdingarray;
  901. break;
  902. case 30:
  903. testvar= 30;
  904. FClvl30= FCholdingarray;
  905. break;
  906. /*case 31:
  907. testvar= 31;
  908. FClvl31= FCholdingarray;
  909. break;*/
  910. default:
  911. testvar= 123456789;
  912. }
  913. FCholdingarray= [];
  914. debugprint();
  915. }
  916. /*===================== Holding Array Transfer ========================*/
  917.  
  918. /*========================= Script Printing ===========================*/
  919. function initialiseScript() {
  920. // Variable below are now global to allow easy passing between functions.
  921. //var standardScript= "", titleScript= "", headScript= "", peachScript= "", pipeScript= "", camScript= "", fogScript= "";
  922. var endMessage= "MSG This script has made it's changes. But you're not quite done yet.&#92;nYou now need to save the changes (File > Save or File > Save As)&#92;n(you might also want to save a copy of the script for future use)<br/>" + "MSG After saving the changes to the rom, drag and drop the rom onto&#92;nsm64compress.exe - a file called [ROMname].out.z64 will be created.&#92;nFinally, copy [ROMname].out.z64 on to your memory card and try it&#92;nout on your Nintendo 64.";
  923. var cutHere= "REM CUT HERE<br/>REM -----------------------------------<br/><br/><br/>";
  924.  
  925. getDate();
  926. standardScript= "REM Included As Standard (No Obvious Side Effects):<br/>REM ---<br/>REM Reverse Any RCVI Changes<br/>ADR $F00C2<br/>OVERWRITE 02 0D<br/>REM ---<br/>REM Set Far Camera Value Back to 7F FF<br/>ADR $0<br/>REPLACEALL 0A 01 00 2D 00 64 96 96 80 29 AA 3C BY 0A 01 00 2D 00 64 7F FF 80 29 AA 3C<br/>REM --<br/>REM Fix for Billboarded objects in foggy levels which use alpha textures<br/>REPLACEALL BA 00 14 02 00 00 00 00 B9 00 03 1D C8 11 30 78 B6 00 00 00 00 01 00 00 BY BA 00 14 02 00 00 00 00 B9 00 03 1D 00 44 30 78 B6 00 00 00 00 01 00 00<br/><br/><br/>";
  927. if (alpha48== 1) { // 15 06 = bad, 15 04 = best in most cases but breaks Retroland torchglow, 15 05 gives slight transparencey to alpha textures and torchglow works. 15 05 is the best compromise IMO.
  928. alphaScript= "REM Fix Alpha Textures in Older (48MB) Hacks<br/>ADR $0<br/>REPLACEALL 15 06 00 00 0E BY 15 05 00 00 0E<br/><br/><br/>";
  929. }
  930. prepTitleScript();
  931. prepHeadScript();
  932. if (selectPeach== 0) {
  933. peachScript= "REM Peach Skip<br/>ADR $6BD4<br/>OVERWRITE 24 00<br/><br/><br/>";
  934. }
  935. if (selectPipe== 0) {
  936. pipeScript= "REM Replace Warp Pipe Behaviours with Normal Warp Behaviours<br/>ADR $1200000<br/>REPLACEALL 00 00 13 00 07 A0 BY 00 00 13 00 07 80<br/><br/><br/>";
  937. }
  938. if (selectCam==0) {
  939. camScript= "REM Apply the Parallel Lakitu Camera Patch by aglab2<br/>ADR $3DC3C<br/>OVERWRITE 3C 02 80 33 3C 03 80 34<br/>OVERWRITE 3C 08 80 28 21 08 6C B4<br/>OVERWRITE 03 28 40 22 19 00 00 03<br/>OVERWRITE 00 00 00 00 3C 19 80 28<br/>OVERWRITE 23 39 6C C4 3C 01 80 34<br/>OVERWRITE 84 28 AF A2 31 08 00 20<br/>OVERWRITE 11 00 00 07 00 00 00 00<br/>OVERWRITE 3C 01 80 28 8C 28 6D 24<br/>OVERWRITE 20 01 00 01 00 28 40 22<br/>OVERWRITE 3C 01 80 28 AC 28 6D 24<br/>OVERWRITE 3C 01 80 28 8C 28 6D 24<br/>OVERWRITE 11 00 00 0F 00 00 00 00<br/>OVERWRITE 3C 08 80 28 21 08 6C 84<br/>OVERWRITE 03 28 40 22 11 00 00 08<br/>OVERWRITE 00 00 00 00 3C 08 80 28<br/>OVERWRITE 21 08 6C A4 03 28 40 22<br/>OVERWRITE 11 00 00 03 00 00 00 00<br/>OVERWRITE 10 00 00 03 00 00 00 00<br/>OVERWRITE 3C 19 80 28 23 39 6C C4<br/>OVERWRITE 84 68 AF A0 84 64 C7 78<br/>OVERWRITE 31 01 02 00 10 20 00 03<br/>OVERWRITE 00 00 00 00 10 00 00 13<br/>OVERWRITE 20 84 FF C0 31 01 01 00<br/>OVERWRITE 10 20 00 03 00 00 00 00<br/>OVERWRITE 10 00 00 0E 20 84 00 40<br/>OVERWRITE 31 01 08 00 10 20 00 05<br/>OVERWRITE 00 00 00 00 8C 48 DF 60<br/>OVERWRITE 85 04 00 12 10 00 00 07<br/>OVERWRITE 20 84 80 00 84 68 AF A2<br/>OVERWRITE 31 01 04 00 10 20 00 03<br/>OVERWRITE 00 00 00 00 20 84 10 00<br/>OVERWRITE 30 84 E0 00 A4 64 C7 78<br/>OVERWRITE 3C 01 80 28 8C 28 6D 20<br/>OVERWRITE 11 19 00 08 00 00 00 00<br/>OVERWRITE 8C 48 DF 60 85 08 00 12<br/>OVERWRITE 21 08 90 00 31 08 E0 00<br/>OVERWRITE A4 68 C7 78 3C 01 80 28<br/>OVERWRITE AC 39 6D 20 03 20 00 08<br/>OVERWRITE 00 00 00 00<br/>REM --<br/>ADR $41BBC<br/>OVERWRITE 10 00 00 45<br/>REM --<br/>ADR $41C7C<br/>OVERWRITE 10 00 EF EF<br/>REM --<br/>ADR $41CD4<br/>OVERWRITE 3C 03 80 28 11 A0 FF DE<br/>OVERWRITE 00 00 00 00 8C 68 6D 24<br/>OVERWRITE 11 00 00 03 00 00 00 00<br/>OVERWRITE 10 00 00 02 00 00 00 00<br/>OVERWRITE AC 60 6D 20 10 00 FF B2<br/>OVERWRITE 00 00 00 00<br/>REM --<br/>ADR $41D24<br/>OVERWRITE 00 00 00 00<br/><br/><br/>";
  940. }
  941. if (selectMCam==0) {
  942. mcamScript= "REM Star Road style Mario Cam (code by Skelux)<br/>ADR $3F330<br/>OVERWRITE 34 06 00 00<br/>REM --<br/>ADR $46F16<br/>OVERWRITE 00 01<br/>REM --<br/>ADR $46F24<br/>OVERWRITE 85 F8 00 10<br/>REM --<br/>ADR $46F88<br/>OVERWRITE 00 00 00 00<br/>REM --<br/>ADR $46FA8<br/>OVERWRITE 87 28 00 10<br/>REM --<br/>ADR $4700C<br/>OVERWRITE 00 00 00 00<br/><br/><br/><br/>";
  943. }
  944.  
  945.  
  946. if (!(FClvl00=="")) {
  947. var i= 0; //just for looping
  948. var firstline= "REM ---<br/>REM Haunted House (Course 5)<br/>";
  949. var x= "", y= "";
  950. for (i= 0; i < FClvl00.length; i++) {
  951. x = "ADR $" + FClvl00[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  952. y= y + x;
  953. }
  954. FClvl00= firstline + y;
  955. }
  956. if (!(FClvl01=="")) {
  957. var i= 0; //just for looping
  958. var firstline= "REM ---<br/>REM Cool Cool Mountain (Course 4)<br/>";
  959. var x= "", y= "";
  960. for (i= 0; i < FClvl01.length; i++) {
  961. x = "ADR $" + FClvl01[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  962. y= y + x;
  963. }
  964. FClvl01= firstline + y;
  965. }
  966. if (!(FClvl02=="")) {
  967. var i= 0; //just for looping
  968. var firstline= "REM ---<br/>REM Inside Castle<br/>";
  969. var x= "", y= "";
  970. for (i= 0; i < FClvl02.length; i++) {
  971. x = "ADR $" + FClvl02[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  972. y= y + x;
  973. }
  974. FClvl02= firstline + y;
  975. }
  976. if (!(FClvl03=="")) {
  977. var i= 0; //just for looping
  978. var firstline= "REM ---<br/>REM Hazy Maze Cave (Course 6)<br/>";
  979. var x= "", y= "";
  980. for (i= 0; i < FClvl03.length; i++) {
  981. x = "ADR $" + FClvl03[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  982. y= y + x;
  983. }
  984. FClvl03= firstline + y;
  985. }
  986. if (!(FClvl04=="")) {
  987. var i= 0; //just for looping
  988. var firstline= "REM ---<br/>REM Shifting Sand Land (Course 8)<br/>";
  989. var x= "", y= "";
  990. for (i= 0; i < FClvl04.length; i++) {
  991. x = "ADR $" + FClvl04[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  992. y= y + x;
  993. }
  994. FClvl04= firstline + y;
  995. }
  996. if (!(FClvl05=="")) {
  997. var i= 0; //just for looping
  998. var firstline= "REM ---<br/>REM Bob-Omb's Battlefield (Course 1)<br/>";
  999. var x= "", y= "";
  1000. for (i= 0; i < FClvl05.length; i++) {
  1001. x = "ADR $" + FClvl05[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1002. y= y + x;
  1003. }
  1004. FClvl05= firstline + y;
  1005. }
  1006. if (!(FClvl06=="")) {
  1007. var i= 0; //just for looping
  1008. var firstline= "REM ---<br/>REM Snow Man's Land (Course 10)<br/>";
  1009. var x= "", y= "";
  1010. for (i= 0; i < FClvl06.length; i++) {
  1011. x = "ADR $" + FClvl06[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1012. y= y + x;
  1013. }
  1014. FClvl06= firstline + y;
  1015. }
  1016. if (!(FClvl07=="")) {
  1017. var i= 0; //just for looping
  1018. var firstline= "REM ---<br/>REM Wet Dry World (Course 11)<br/>";
  1019. var x= "", y= "";
  1020. for (i= 0; i < FClvl07.length; i++) {
  1021. x = "ADR $" + FClvl07[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1022. y= y + x;
  1023. }
  1024. FClvl07= firstline + y;
  1025. }
  1026. if (!(FClvl08=="")) {
  1027. var i= 0; //just for looping
  1028. var firstline= "REM ---<br/>REM Jolly Roger Bay (Course 3)<br/>";
  1029. var x= "", y= "";
  1030. for (i= 0; i < FClvl08.length; i++) {
  1031. x = "ADR $" + FClvl08[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1032. y= y + x;
  1033. }
  1034. FClvl08= firstline + y;
  1035. }
  1036. if (!(FClvl09=="")) {
  1037. var i= 0; //just for looping
  1038. var firstline= "REM ---<br/>REM Tiny Huge Island (Course 13)<br/>";
  1039. var x= "", y= "";
  1040. for (i= 0; i < FClvl09.length; i++) {
  1041. x = "ADR $" + FClvl09[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1042. y= y + x;
  1043. }
  1044. FClvl09= firstline + y;
  1045. }
  1046. if (!(FClvl10=="")) {
  1047. var i= 0; //just for looping
  1048. var firstline= "REM ---<br/>REM Tick Tock Clokc (Course 14)<br/>";
  1049. var x= "", y= "";
  1050. for (i= 0; i < FClvl10.length; i++) {
  1051. x = "ADR $" + FClvl10[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1052. y= y + x;
  1053. }
  1054. FClvl10= firstline + y;
  1055. }
  1056. if (!(FClvl11=="")) {
  1057. var i= 0; //just for looping
  1058. var firstline= "REM ---<br/>REM Rainbow Ride (Course 15)<br/>";
  1059. var x= "", y= "";
  1060. for (i= 0; i < FClvl11.length; i++) {
  1061. x = "ADR $" + FClvl11[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1062. y= y + x;
  1063. }
  1064. FClvl11= firstline + y;
  1065. }
  1066. if (!(FClvl12=="")) {
  1067. var i= 0; //just for looping
  1068. var firstline= "REM ---<br/>REM Castle Grounds<br/>";
  1069. var x= "", y= "";
  1070. for (i= 0; i < FClvl12.length; i++) {
  1071. x = "ADR $" + FClvl12[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1072. y= y + x;
  1073. }
  1074. FClvl12= firstline + y;
  1075. }
  1076. if (!(FClvl13=="")) {
  1077. var i= 0; //just for looping
  1078. var firstline= "REM ---<br/>REM Bowser 1 Course<br/>";
  1079. var x= "", y= "";
  1080. for (i= 0; i < FClvl13.length; i++) {
  1081. x = "ADR $" + FClvl13[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1082. y= y + x;
  1083. }
  1084. FClvl13= firstline + y;
  1085. }
  1086. if (!(FClvl14=="")) {
  1087. var i= 0; //just for looping
  1088. var firstline= "REM ---<br/>REM Vanish Cap<br/>";
  1089. var x= "", y= "";
  1090. for (i= 0; i < FClvl14.length; i++) {
  1091. x = "ADR $" + FClvl14[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1092. y= y + x;
  1093. }
  1094. FClvl14= firstline + y;
  1095. }
  1096. if (!(FClvl15=="")) {
  1097. var i= 0; //just for looping
  1098. var firstline= "REM ---<br/>REM Bowser 2 Course<br/>";
  1099. var x= "", y= "";
  1100. for (i= 0; i < FClvl15.length; i++) {
  1101. x = "ADR $" + FClvl15[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1102. y= y + x;
  1103. }
  1104. FClvl15= firstline + y;
  1105. }
  1106. if (!(FClvl16=="")) {
  1107. var i= 0; //just for looping
  1108. var firstline= "REM ---<br/>REM Secret Aquarium<br/>";
  1109. var x= "", y= "";
  1110. for (i= 0; i < FClvl16.length; i++) {
  1111. x = "ADR $" + FClvl16[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1112. y= y + x;
  1113. }
  1114. FClvl16= firstline + y;
  1115. }
  1116. if (!(FClvl17=="")) {
  1117. var i= 0; //just for looping
  1118. var firstline= "REM ---<br/>REM Bowser 3 Course<br/>";
  1119. var x= "", y= "";
  1120. for (i= 0; i < FClvl17.length; i++) {
  1121. x = "ADR $" + FClvl17[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1122. y= y + x;
  1123. }
  1124. FClvl17= firstline + y;
  1125. }
  1126. if (!(FClvl18=="")) {
  1127. var i= 0; //just for looping
  1128. var firstline= "REM ---<br/>REM Lethal Lava Land (Course 7)<br/>";
  1129. var x= "", y= "";
  1130. for (i= 0; i < FClvl18.length; i++) {
  1131. x = "ADR $" + FClvl18[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1132. y= y + x;
  1133. }
  1134. FClvl18= firstline + y;
  1135. }
  1136. if (!(FClvl19=="")) {
  1137. var i= 0; //just for looping
  1138. var firstline= "REM ---<br/>REM Dire Dire Docks (Course 9)<br/>";
  1139. var x= "", y= "";
  1140. for (i= 0; i < FClvl19.length; i++) {
  1141. x = "ADR $" + FClvl19[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1142. y= y + x;
  1143. }
  1144. FClvl19= firstline + y;
  1145. }
  1146. if (!(FClvl20=="")) {
  1147. var i= 0; //just for looping
  1148. var firstline= "REM ---<br/>REM Whomp's Fortress (Course 2)<br/>";
  1149. var x= "", y= "";
  1150. for (i= 0; i < FClvl20.length; i++) {
  1151. x = "ADR $" + FClvl20[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1152. y= y + x;
  1153. }
  1154. FClvl20= firstline + y;
  1155. }
  1156. if (!(FClvl21=="")) {
  1157. var i= 0; //just for looping
  1158. var firstline= "REM ---<br/>REM End Cake Picture<br/>";
  1159. var x= "", y= "";
  1160. for (i= 0; i < FClvl21.length; i++) {
  1161. x = "ADR $" + FClvl21[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1162. y= y + x;
  1163. }
  1164. FClvl21= firstline + y;
  1165. }
  1166. if (!(FClvl22=="")) {
  1167. var i= 0; //just for looping
  1168. var firstline= "REM ---<br/>REM Castle Courtyard<br/>";
  1169. var x= "", y= "";
  1170. for (i= 0; i < FClvl22.length; i++) {
  1171. x = "ADR $" + FClvl22[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1172. y= y + x;
  1173. }
  1174. FClvl22= firstline + y;
  1175. }
  1176. if (!(FClvl23=="")) {
  1177. var i= 0; //just for looping
  1178. var firstline= "REM ---<br/>REM Peach's Secret Slide<br/>";
  1179. var x= "", y= "";
  1180. for (i= 0; i < FClvl23.length; i++) {
  1181. x = "ADR $" + FClvl23[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1182. y= y + x;
  1183. }
  1184. FClvl23= firstline + y;
  1185. }
  1186. if (!(FClvl24=="")) {
  1187. var i= 0; //just for looping
  1188. var firstline= "REM ---<br/>REM Metal Cap<br/>";
  1189. var x= "", y= "";
  1190. for (i= 0; i < FClvl24.length; i++) {
  1191. x = "ADR $" + FClvl24[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1192. y= y + x;
  1193. }
  1194. FClvl24= firstline + y;
  1195. }
  1196. if (!(FClvl25=="")) {
  1197. var i= 0; //just for looping
  1198. var firstline= "REM ---<br/>REM Wing Cap<br/>";
  1199. var x= "", y= "";
  1200. for (i= 0; i < FClvl25.length; i++) {
  1201. x = "ADR $" + FClvl25[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1202. y= y + x;
  1203. }
  1204. FClvl25= firstline + y;
  1205. }
  1206. if (!(FClvl26=="")) {
  1207. var i= 0; //just for looping
  1208. var firstline= "REM ---<br/>REM Bowser 1 Battle<br/>";
  1209. var x= "", y= "";
  1210. for (i= 0; i < FClvl26.length; i++) {
  1211. x = "ADR $" + FClvl26[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1212. y= y + x;
  1213. }
  1214. FClvl26= firstline + y;
  1215. }
  1216. if (!(FClvl27=="")) {
  1217. var i= 0; //just for looping
  1218. var firstline= "REM ---<br/>REM Rainbow Clouds<br/>";
  1219. var x= "", y= "";
  1220. for (i= 0; i < FClvl27.length; i++) {
  1221. x = "ADR $" + FClvl27[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1222. y= y + x;
  1223. }
  1224. FClvl27= firstline + y;
  1225. }
  1226. if (!(FClvl28=="")) {
  1227. var i= 0; //just for looping
  1228. var firstline= "REM ---<br/>REM Bowser 2 Battle<br/>";
  1229. var x= "", y= "";
  1230. for (i= 0; i < FClvl28.length; i++) {
  1231. x = "ADR $" + FClvl28[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1232. y= y + x;
  1233. }
  1234. FClvl28= firstline + y;
  1235. }
  1236. if (!(FClvl29=="")) {
  1237. var i= 0; //just for looping
  1238. var firstline= "REM ---<br/>REM Bowser 3 Battle<br/>";
  1239. var x= "", y= "";
  1240. for (i= 0; i < FClvl29.length; i++) {
  1241. x = "ADR $" + FClvl29[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1242. y= y + x;
  1243. }
  1244. FClvl29= firstline + y;
  1245. }
  1246. if (!(FClvl30=="")) {
  1247. var i= 0; //just for looping
  1248. var firstline= "REM ---<br/>REM Tall Tall Mountain (Course 12)<br/>";
  1249. var x= "", y= "";
  1250. for (i= 0; i < FClvl30.length; i++) {
  1251. x = "ADR $" + FClvl30[i] + "<br/>OVERWRITE FC 12 7F FF FF FF F8 38<br/>"
  1252. y= y + x;
  1253. }
  1254. FClvl30= firstline + y;
  1255. }
  1256. //=======================
  1257.  
  1258. fogScript= FClvl00 + FClvl01 + FClvl02 + FClvl03 + FClvl04 + FClvl05 + FClvl06 + FClvl07 + FClvl08 + FClvl09;
  1259. fogScript= fogScript + FClvl10 + FClvl11 + FClvl12 + FClvl13 + FClvl14 + FClvl15 + FClvl16 + FClvl17 + FClvl18 + FClvl19;
  1260. fogScript= fogScript + FClvl20 + FClvl21 + FClvl22 + FClvl23 + FClvl24 + FClvl25 + FClvl26 + FClvl27 + FClvl28 + FClvl29;
  1261. //fogScript= fogScript + FClvl30 + FClvl31;
  1262. //fogScript= fogScript + FClvl30;
  1263. fogScript= "REM Restoring Levels With Fog:<br/>" + fogScript + "<br/><br/>";
  1264.  
  1265.  
  1266. testscript= stampScript + standardScript + alphaScript + titleScript + headScript + peachScript + pipeScript + camScript + mcamScript + cutHere + fogScript + endMessage;
  1267. debugprint();
  1268.  
  1269. printScript(); //atm, prints testcript
  1270.  
  1271. }
  1272.  
  1273. function getDate () {
  1274. var today=new Date();
  1275.  
  1276. // Fetching and preparing Date Stamp
  1277. var dsDate= 0, dsMonth= 0, dsFullYear= 0, dsHours= 0, dsMins= 0, dsSeconds= 0;
  1278. dsDate= today.getDate();
  1279. dsMonth= today.getMonth();
  1280. dsFullYear= today.getFullYear();
  1281. dsHours= today.getHours();
  1282. dsMins= today.getMinutes();
  1283. dsSeconds= today.getSeconds();
  1284.  
  1285. dsDate= checkTime(dsDate);
  1286. dsMonth= checkTime(dsMonth+1); // Seemingly need to add +1 here, assuming it starts counting from 0
  1287. dsFullYear= dsFullYear - 2000; // 2017-2000=17, add the 20 back in later, need to split 4 into two 2s for hex
  1288. dsHours= checkTime(dsHours);
  1289. dsMins= checkTime(dsMins);
  1290. dsSeconds= checkTime(dsSeconds);
  1291.  
  1292. dateStamp= dsDate + " " + dsMonth + " " + "20" + " " + dsFullYear + " " + dsHours + " " + dsMins + " " + dsSeconds;
  1293.  
  1294.  
  1295. today=new Date(today).toUTCString();
  1296. today=today.split(' ').slice(1, 6).join(' ');
  1297. theDate= today;
  1298. //stampScript= "REM Script generated on: " + theDate + "<br/><br/><br/>" + "REM Identification Stamp<br/>ADR $" + dateStampDest[0] + "<br/>OVERWRITE 20 22 46 69 78 65 64 22"/* "Fixed"*/+"<br/>OVERWRITE 77 69 74 68 20"/*with */+"<br/>OVERWRITE 4D 61 72 69 6F 4D 65"/*MarioMe*/+"<br/>OVERWRITE 6E 64 65 72 36 34 20"/*nder64 */+"<br/>OVERWRITE 56 30 2E 30 2E 30 2E 31"/*V0.0.0.1*/+"<br/>OVERWRITE 28 31 31 47 30"/*(11G)*/+"<br/>OVERWRITE 20 20 20 20 20 20 20 20"/* */+"<br/>ADR $" + dateStampDest[1] + "<br/>OVERWRITE 20 " + dateStamp + "<br/><br/><br/>";
  1299. stampScript= "REM Script generated on: " + theDate + "<br/><br/><br/>" + "REM Identification Stamp<br/>ADREOF<br/>ADR- 55<br/>OVERWRITE 20 22 46 69 78 65 64 22"/* "Fixed"*/+"<br/>OVERWRITE 77 69 74 68 20"/*with */+"<br/>OVERWRITE 4D 61 72 69 6F 4D 65"/*MarioMe*/+"<br/>OVERWRITE 6E 64 65 72 36 34 20"/*nder64 */+"<br/>OVERWRITE 56 30 2E 31 62 20"/*V0.0.1*/+"<br/>OVERWRITE 20 31 31 48 33"/* 11H1*/+"<br/>OVERWRITE 20 20 20 20 20 20 20 20"/* */+"<br/>ADREOF<br/>ADR- 7<br/>OVERWRITE 00 " + dateStamp + "<br/><br/><br/>";
  1300. }
  1301. function checkTime(i){
  1302. if (i<10)
  1303. {
  1304. i="0" + i;
  1305. }
  1306. return i;
  1307. }
  1308.  
  1309.  
  1310. function prepTitleScript() {
  1311. var x= "";
  1312. switch(selectTitle) {
  1313. case 1: //Skip
  1314. x= "REM Skip Title Screen<br/>ADR $269ECC<br/>OVERWRITE 01 10 00 14 00 26 9E A0 00 26 A3 A0 14 00 00 78<br/>REM --<br/>";
  1315. //Skip- 269ECC: 01 10 00 14 00 26 9E A0 00 26 A3 A0 14 00 00 78
  1316. break;
  1317. case 2: // Restore
  1318. x= "REM Restore Title Screen<br/>ADR $269ECC<br/>OVERWRITE 1D 04 00 00 1F 08 01 00 14 00 02 D0 20 04 00 00<br/>REM --<br/>";
  1319. //Rstr- 269ECC: 1D 04 00 00 1F 08 01 00 14 00 02 D0 20 04 00 00
  1320. break;
  1321. case 3: // Attempt Repair of Custom Title Screen (experimental)
  1322. sledgeFrom= "A00000"; //Replace all FCs from this location onwards (think it takes in custom title screens)
  1323. break;
  1324. default:
  1325. }
  1326. titleScript= x + "REM Replace all cases of FC 12 7F FF FF FF F8 38 with FC 12 7E 24 FF FF F9 FC from " + sledgeFrom + " onwards.<br/>REM This restores textures to levels without fog, but breaks textures in levels with fog.<br/>REM Normally done from 1200000 onwards (to leave the original SM64 levels alone).<br/>REM Can be set to replace from A00000 instead to try and restore textures to custom title screens.<br/>ADR $" + sledgeFrom + "<br/>REPLACEALL FC 12 7F FF FF FF F8 38 BY FC 12 7E 24 FF FF F9 FC<br/><br/><br/>";
  1327. testvar= 1108;
  1328.  
  1329. }
  1330.  
  1331. function prepHeadScript() {
  1332. switch(selectHead) {
  1333. case 0: //Restore, then Skip using alt method
  1334. // Good skip: Mario Head skip (Good): 269F68: 05 08 00 00 14 00 02 0C, 269FF4: 05 08 00 00 14 00 02 0C
  1335. headScript= "REM Restore Mario Head Screen<br/>ADR $269F4C<br/>OVERWRITE 1D 04 00 00 1F 08 01 00 14 00 03 5C 20 04 00 00<br/>REM --<br/>REM Skip Mario Head Screen using an alternative method which works on console<br/>ADR $269F68<br/>OVERWRITE 05 08 00 00 14 00 02 0C<br/>ADR $269FF4<br/>OVERWRITE 05 08 00 00 14 00 02 0C<br/><br/><br/>";
  1336. break;
  1337. case 1: // Restore: ADR $269F4C, OVERWRITE 1D 04 00 00 1F 08 01 00 14 00 03 5C 20 04 00 00
  1338. headScript= "REM Restore Mario Head Screen<br/>ADR $269F4C<br/>OVERWRITE 1D 04 00 00 1F 08 01 00 14 00 03 5C 20 04 00 00<br/><br/><br/>";
  1339. break;
  1340. case 2: // Bad Skip: 269F4C: 01 10 00 14 00 26 9E A0 00 26 A3 A0 14 00 02 0C, 269FD8: 01 10 00 14 00 26 9E A0 00 26 A3 A0 14 00 02 0C
  1341. headScript= "REM Skip Mario Head Screen (causes black screen on console)<br/>ADR $269F4C<br/>OVERWRITE 01 10 00 14 00 26 9E A0 00 26 A3 A0 14 00 02 0C<br/>ADR $269FD8<br/>OVERWRITE 01 10 00 14 00 26 9E A0 00 26 A3 A0 14 00 02 0C<br/><br/><br/>";
  1342. break;
  1343. default:
  1344. }
  1345. }
  1346. /*========================= Script Printing ===========================*/
  1347.  
  1348. </script>
  1349. <!--=================================================================-->
  1350. <!--========================= End Script ============================-->
  1351. <!--=================================================================-->
  1352.  
  1353.  
  1354. <Title>Mario Mender 64 V0.1b (11H3)</Title>
  1355. <!--IMPORTANT!! Remember to adjust the version number in the script-->
  1356. <!-- Search for: [REM Script generated on:] -->
  1357.  
  1358. </head>
  1359. <body onload="printromsize()">
  1360.  
  1361. <div class="MM64">
  1362. <h1>Mario Mender<span class="h64"> 64</span></h1>
  1363. </div>
  1364.  
  1365.  
  1366. <div id="splash"> <!-- Splash Screen ////////////////////////////////////////////// -->
  1367. <h3>Welcome to Mario Mender 64!</h5>
  1368. <p>As you probably know, most Super Mario 64 hacks are plauged with problems which stop them playing well on real Nintendo 64 consoles. Fortunately, we now have <a href="https://hack64.net/wiki/doku.php?id=super_mario_64:console_compatibility" target="_new">fixes and work arounds</a> for some of these problems.</p>
  1369. <p>Mario Mender 64 is my attempt at making it easier to apply some of the fixes and work arounds for more common problems. It's an unfinished but somewhat functional Javascript based tutorial/wizard that runs in your web browser. It is designed to be used together with the XVI32 hex editor and queueRAM's sm64compress v0.2a. Based on your input, it generates a script for you to run in the XVI32 hex editor. After the script has been executed, save the rom and run it through sm64compress.<br/><br/><u>This will not fix every hack</u>, it just attempts to fix many of the common problems.</p>
  1370.  
  1371. The code on display here is very amaturish. This is the most complex thing I have yet attempted to program, and I'm sure it shows!
  1372.  
  1373.  
  1374. <br/><br/><h3>Required Programs (download these first before starting)</h3>
  1375.  
  1376. XVI32:<br/>
  1377. <a href="http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#download" target="_new">http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#download</a>
  1378. <br/><br/>
  1379. sm64compress v0.2a by queueRAM:<br/>
  1380. <a href="https://github.com/queueRAM/sm64tools/releases/tag/sm64compressv0.2a" target="_new">https://github.com/queueRAM/sm64tools/releases/tag/sm64compressv0.2a</a>
  1381.  
  1382. <br/><br/><h3>Credits/Thanks</h3>
  1383.  
  1384. <table>
  1385. <tr><td>AwesomelukeyProject/Vertrex and Dudaw12</td><td>Pioneers. Solved the MIO0 data align issues, started the console compatibility ball rolling</td></tr>
  1386. <tr><td>Kyle</td><td>Created the first fixing tool (ED64.exe), brought XVI32 and hex editing to my attention</td></tr>
  1387. <tr><td>queueRAM</td><td>Awesome, in depth work on console compatibility, such as "Additional Music Settings and Sequences" patch fix. Created the brilliant sm64compress, helped me a lot, just very helpful overall!</td></tr>
  1388. <tr><td>David/Davideesk</td><td>Awesome, in depth work on console compatibility, finding levels with fog, alpha textures fixing, camera far value fixing, helped me a lot, just very helpful overall!</td></tr>
  1389. <tr><td>Kaze</td><td>His video tutorial series and Google site were crucial for this! Helped a great deal with the mario screen skip, "Additional Music Settings and Sequences" patch fix, chipped in on water boxes, 0xFC commands, drawing layers... Helped me a lot, just very helpful overall!</td></tr>
  1390. <tr><td>cpuHacka101</td><td>Wiki contributions, on "0xFC G_SETCOMBINE" commands, specifically</td></tr>
  1391. <tr><td>Skelux</td><td>Star Road Mario Cam code. Helped me with the VI change wayback when, various tweaks in the level editor also helped. Also helped me find some legacy Level Importer versions.</td></tr>
  1392. <tr><td>aglab2</td><td>Created the Parallel Lakitu Camera Patch and kindly provided me with the most up to date version. Thanks!</td></tr>
  1393. <tr><td>aterraformer</td><td>For his patience/persistance!</td></tr>
  1394. </table>
  1395.  
  1396. <h4 style="text-align:center;">This is for all the Nintendo 64 fans and flashcart users out there - Keepin' it real!</h4>
  1397.  
  1398. <p style="text-align:center;">
  1399. <button onclick="clearsplash()" style="width:400px;height:60px;font-size:large;margin: auto:">Click here to Begin</button>
  1400. </p>
  1401.  
  1402. </div> <!-- Splash Screen //////////////////////////////////////////////////////////// -->
  1403.  
  1404.  
  1405.  
  1406. <div id="maincontainer">
  1407.  
  1408.  
  1409. <div id="videobox">
  1410. <div id="searchfor" class="vidoverlay">
  1411. I <u><i>highly</i></u> recommend you start with a simple mini hack, to familiarise youself with the process.
  1412. <br/>Try one of these:
  1413. <br/>- SM64 Christmas Carnival Special
  1414. <br/>- Return to Retroland
  1415. <br/>- SM64: It's A Crash!
  1416. <br/>- Super Mario 64 Sapphire
  1417. <br/><br/>
  1418. Follow the instructions in the yellow box below to continue.
  1419. </div>
  1420. </div>
  1421.  
  1422. <div class="header">
  1423. <button onclick="debugtoggle()">Debug Toggle</button>
  1424.  
  1425. </div>
  1426.  
  1427. <div id="gui" class="column rightinstruction">
  1428. <h1>Pointless Sample Text</h1>
  1429. </div><!--close column rightinstruction-->
  1430. <!--</div>close leftrightboxcontainer-->
  1431.  
  1432. <div id="FFooter" class="footer">
  1433. <p>This is where the script will be printed</p>
  1434. <p></p>
  1435. </div>
  1436.  
  1437. </div><!--close maincontainer div-->
  1438.  
  1439. <div id="debugbox">
  1440. <h1>Debug Display</h1>
  1441. <p>Text.</p>
  1442.  
  1443.  
  1444. </div>
  1445.  
  1446. </body>
  1447. </html>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×