Manic EMU is an all-in-one retro game emulator for iOS. It packs powerful features while keeping a clean, sleek UI and delivering buttery-smooth gameplay.
Swift
const PMSR_MAGIC="PMSR",YAY0_MAGIC="Yay0",PAPER_MARIO_USA10_CRC32=2817903998,PAPER_MARIO_USA10_FILE_SIZE=41943040;function PMSR(){this.targetSize=0,this.records=[]}"undefined"!=typeof module&&module.exports&&(module.exports=PMSR),PMSR.prototype.addRecord=function(e,t){this.records.push({offset:e,data:t})},PMSR.prototype.toString=function(){var e="Star Rod patch";return e+="\nTarget file size: "+this.targetSize,e+="\n#Records: "+this.records.length},PMSR.prototype.validateSource=function(e){return 41943040===e.fileSize&&2817903998===e.hashCRC32()},PMSR.prototype.getValidationInfo=function(){return{type:"CRC32",value:2817903998}},PMSR.prototype.apply=function(e,t){if(t&&!this.validateSource(e))throw new Error("Source ROM checksum mismatch");console.log("a"),this.targetSize===e.fileSize?tempFile=e.slice(0,e.fileSize):(tempFile=new BinFile(this.targetSize),e.copyTo(tempFile,0)),console.log("b");for(var r=0;r<this.records.length;r++)tempFile.seek(this.records[r].offset),tempFile.writeBytes(this.records[r].data);return tempFile},PMSR.MAGIC="PMSR",PMSR.fromFile=function(e){var t=new PMSR;t.targetSize=41943040,e.seek(4);for(var r=e.readU32(),o=0;o<r;o++){var i=e.readU32(),a=e.readU32();t.addRecord(i,e.readBytes(a)),i+a>t.targetSize&&(t.targetSize=i+a)}return t},PMSR.YAY0_decode=function(e){};