mirror of
https://github.com/marcrobledo/RomPatcher.js.git
synced 2025-06-27 16:25:54 +00:00
fixed MD5 hashing with >512MB files, ignore txt, readmes,etc files in zips, multiple predefined patches is now a dropdown, allowing user to choose and change patch without having to refresh the app
This commit is contained in:
parent
bcc714f179
commit
458d7297e4
7 changed files with 366 additions and 251 deletions
90
index.html
90
index.html
|
@ -41,55 +41,42 @@
|
|||
<script type="text/javascript" src="./js/formats/ppf.js"></script>
|
||||
<script type="text/javascript" src="./js/formats/pmsr.js"></script>
|
||||
<script type="text/javascript" src="./js/formats/vcdiff.js"></script>
|
||||
|
||||
<script type="text/javascript" src="./js/zip.js/zip.js"></script>
|
||||
<!-- <script type="text/javascript" src="js/libunrar/rpc.js"></script> -->
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
/*
|
||||
// PREDEFINED PATCHES EXAMPLE
|
||||
// uncomment this to enable predefined patches, Rom Patcher JS will fetch patches hosted in your server
|
||||
// - format should be self explanatory
|
||||
// - you can add provide crc for source files, allowing IPS to have validation!
|
||||
// - this could be also dynamically generated by your server backend, allowing you to build your own patcher for your projects
|
||||
var PREDEFINED_PATCHES=[
|
||||
//zip includes a single patch (recommended)
|
||||
{patch:'./_example/SONICDX.zip',name:'Sonic 3D Blast Director\'s Cut v1.1',crc:0x44a2ca44},
|
||||
|
||||
//if providing a zipped file, multiple patch files within it can be specified (recommended)
|
||||
{patch:'./_example/SML2DXv181.zip#SML2DXv181.ips',name:'Super Mario Land 2 DX v1.8.1 (USA/Europe)',crc:0xd5ec24e4},
|
||||
{patch:'./_example/SML2DXv181.zip#SML2DXv181_jap.ips',name:'Super Mario Land 2 DX v1.8.1 (Japan)',crc:0xa715daf5},
|
||||
|
||||
//if a patch file is not specified in a zipped file, user will be able to choose the desired patch file in a popup (not recommended, also only a single crc for all patches could be provided)
|
||||
{patch:'./_example/SML2DXv181.zip',name:'Super Mario Land 2 DX v1.8.1 (All regions)'},
|
||||
|
||||
//uncompressed patch (not recommended because of bandwidth purposes)
|
||||
{patch:'./_example/MarvelousATI_EN_v1.07.xdelta',name:'Marvelous (SFC) ENG Translation v1.07',crc:0xcedf3ba7}
|
||||
];
|
||||
*/
|
||||
--></script>
|
||||
|
||||
|
||||
<!-- custom code for RHDN -->
|
||||
<!--
|
||||
<?php
|
||||
if(isset($_REQUEST["file"]) && preg_match("/^(hacks|translations)\/\d+$/", $_REQUEST["file"]) && isset($_REQUEST["patch_name"])){
|
||||
$patch="/download/".$_REQUEST["file"];
|
||||
if(isset($_REQUEST["patch"])){
|
||||
$patch.='#'+strip_tags(trim($_REQUEST["patch"]))
|
||||
}
|
||||
$patch_name=strip_tags(trim($_REQUEST["patch_name"]));
|
||||
$crc="";
|
||||
if(isset($_REQUEST["crc"]) && preg_match("/^[0-9a-fA-F]{8}$/", $_REQUEST["crc"])){
|
||||
$crc=', crc:0x'.$_REQUEST["crc"];
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var PREDEFINED_PATCHES=[{patch:'<?= strip_tags($patch); ?>', name:'<?= strip_tags($patch_name); ?>'<?= $crc?>}];
|
||||
</script>
|
||||
<?php
|
||||
// CUSTOM PATCHER EXAMPLE
|
||||
// uncomment this to build your own custom exclusive patcher for your hacks/translations
|
||||
// user will only need to provide the ROM file, as patches will be fetched from your server!
|
||||
// a crc (or various crcs) can be provided for source files, allowing old formats like IPS to have validation!
|
||||
/*var CUSTOM_PATCHER=[
|
||||
{ //example: uncompressed file
|
||||
file:'./_example/SML2DXv181.ips',
|
||||
name:'Super Mario Land 2 DX v1.8.1 (USA/Europe)',
|
||||
crc:0xd5ec24e4
|
||||
},{ //example: uncompressed file
|
||||
file:'./_example/SML2DXv181_jap.ips',
|
||||
name:'Super Mario Land 2 DX v1.8.1 (Japan)',
|
||||
crc:0xa715daf5
|
||||
},{ //example: compressed file
|
||||
file:'./_example/SML2DXv181.zip',
|
||||
name:'Super Mario Land 2 DX v1.8.1 (World)',
|
||||
crc:[0xd5ec24e4,0xa715daf5]
|
||||
},{ //example: compressed file containing several patches, separate patches provided (recommended)
|
||||
file:'./_example/SML2DXv181.zip',
|
||||
patches:[{
|
||||
file:'SML2DXv181.ips',
|
||||
name:'Super Mario Land 2 DX v1.8.1 (USA/Europe)',
|
||||
crc:0xd5ec24e4
|
||||
},{
|
||||
file:'SML2DXv181_jap.ips',
|
||||
name:'Super Mario Land 2 DX v1.8.1 (Japan)',
|
||||
crc:0xa715daf5
|
||||
}]
|
||||
}
|
||||
?>
|
||||
-->
|
||||
|
||||
];*/
|
||||
--></script>
|
||||
</head>
|
||||
<body><div id="column">
|
||||
|
||||
|
@ -113,13 +100,13 @@
|
|||
<div class="leftcol">MD5:</div><div class="rightcol"><span id="md5"></span></div>
|
||||
<div class="leftcol">SHA-1:</div><div class="rightcol"><span id="sha1"></span></div>
|
||||
</div>
|
||||
<div class="row" id="row-removeheader">
|
||||
<div class="row hide" id="row-removeheader">
|
||||
<div class="leftcol"></div>
|
||||
<div class="rightcol">
|
||||
<input type="checkbox" id="checkbox-removeheader" /> <label for="checkbox-removeheader" data-localize="remove_header">Remove header before patching</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="row-addheader">
|
||||
<div class="row hide" id="row-addheader">
|
||||
<div class="leftcol"></div>
|
||||
<div class="rightcol">
|
||||
<input type="checkbox" id="checkbox-addheader" /> <label for="checkbox-addheader" data-localize="add_header">Add temporary header</label> <small>(<label id="headersize" for="checkbox-addheader"></label>)</small>
|
||||
|
@ -186,18 +173,19 @@
|
|||
<div>
|
||||
<select id="select-language">
|
||||
<option value="en">English</option>
|
||||
<option value="nl">Nederlands</option>
|
||||
<option value="sv">Svenska</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="es">Español</option>
|
||||
<option value="nl">Nederlands</option>
|
||||
<option value="sv">Svenska</option>
|
||||
<option value="ca">Català</option>
|
||||
<option value="ptb">Português Brasileiro</option>
|
||||
<option value="pt-br">Português Brasileiro</option>
|
||||
<option value="ru">Russian</option>
|
||||
<option value="ja">日本語</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
Rom Patcher JS <small>v2.4</small> by <a href="/">Marc Robledo</a>
|
||||
Rom Patcher JS <small>v2.5</small> by <a href="/">Marc Robledo</a>
|
||||
<br />
|
||||
<i class="icon github"></i> <a href="https://github.com/marcrobledo/RomPatcher.js/" target="_blank">See on GitHub</a>
|
||||
<i class="icon heart"></i> <a href="https://www.paypal.me/marcrobledo/5" target="_blank" rel="nofollow">Donate</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue