Skip to content

Commit

Permalink
added Mega Man IV anticopy protection removal to make it compatible w…
Browse files Browse the repository at this point in the history
…ith the injector
  • Loading branch information
marcrobledo committed Apr 24, 2024
1 parent c64da0c commit a94b6df
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1 class="hide">Super Game Boy Border Injector</h1>


<footer>
Super Game Boy Border Injector v1.2.1<br/>
Super Game Boy Border Injector v1.2.1b<br/>
made with <span class="love" title="Super love">Super <img src="web-injector/assets/octicon_heart_color.svg" alt="love" class="octicon" /></span> by <a href="https://www.marcrobledo.com" target="_blank">Marc Robledo</a>
<img src="web-injector/assets/octicon_github.svg" alt="GitHub logo" class="octicon" /> <a href="https://github.com/marcrobledo/super-game-boy-border-injector/" target="_blank">See sourcecode in GitHub</a>
</footer>
Expand Down
30 changes: 30 additions & 0 deletions web-injector/app/known-games.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,36 @@ export const KNOWN_GAMES=[
globalChecksum:0xd9cf,
safeOffset:0x39d9
},



/*
ANTI COPY PROTECTION REMOVAL
some games have anti copy protection removal that need to be removed
to make the games work after its header has been changed
*/
{
title:'Mega Man IV (USA)',
globalChecksum:0xd18c,
nops:(function(){
const checks=[];
for(var i=0; i<28; i++){
checks.push(0x3f53 + i*6);
}
return checks;
}())
},
{
title:'Rockman World 4 (Japan)',
globalChecksum:0x7b71,
nops:(function(){
const checks=[];
for(var i=0; i<28; i++){
checks.push(0x3f53 + i*6);
}
return checks;
}())
},



Expand Down
4 changes: 2 additions & 2 deletions web-injector/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,9 @@ function buildROM(){
rom.writeBytes(assembledHookInfo.code);


//if it's a known SGB game, disable its original border loading
//apply custom patches
if(knownGame && knownGame.nops){
console.log('disabling original game SGB border');
console.log('applying custom patches (original SGB border and/or anticopy protection removal');
for(var i=0; i<knownGame.nops.length; i++){
rom.seek(knownGame.nops[i]);
rom.writeBytes([0x00, 0x00, 0x00]); //three nops
Expand Down

0 comments on commit a94b6df

Please sign in to comment.