diff --git a/_data/en-US/strings.json b/_data/en-US/strings.json index 15786a82..ae624c51 100644 --- a/_data/en-US/strings.json +++ b/_data/en-US/strings.json @@ -15,4 +15,4 @@ "toggle-navigation": "Toggle navigation", "translate-here": "Translate here", "translate-on-crowdin": "Translate on Crowdin" -} \ No newline at end of file +} diff --git a/_includes/bios-shrinker.html b/_includes/bios-shrinker.html new file mode 100644 index 00000000..2640776d --- /dev/null +++ b/_includes/bios-shrinker.html @@ -0,0 +1,2 @@ + + diff --git a/assets/js/bios-shrinker.js b/assets/js/bios-shrinker.js new file mode 100644 index 00000000..8a4b2dc5 --- /dev/null +++ b/assets/js/bios-shrinker.js @@ -0,0 +1,39 @@ +const gbaSha = "fd2547724b505f487e6dcb29ec2ecff3af35a841a77ab2e85fd87350abd36570"; +const dsSha = "782eb3894237ec6aa411b78ffee19078bacf10413856d33cda10b44fd9c2856b"; + +function shrinkBios(file) { + // Check that the file is 32 KiB + if(file.size != 32 << 10) + return alert("Error! This is not a correct GBA BIOS dumper save."); + + // Read the file + var reader = new FileReader(); + reader.readAsArrayBuffer(file); + reader.onload = function() { + var array = new Uint8Array(this.result); + + // Trim to 16 KiB + array = array.subarray(0, 16 << 10); + + // Check hash + var bStr = ""; + for(i in array) + bStr += String.fromCharCode(array[i]); + var sha = sha256(bStr); + + if(sha == gbaSha || sha == dsSha) { + // Download trimmed file + var blob = new Blob([array], {type: "application/octet-stream"}); + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = "bios.bin"; + a.click(); + window.URL.revokeObjectURL(url); + + alert("Done! Checksum matches as a correct BIOS dump from a " + (sha == gbaSha ? "GBA" : "DS") + ".\n\nSHA-256: " + sha); + } else { + alert("Error! Trimmed BIOS checksum does not match a valid GBA BIOS checksum.\n\nSHA-256: " + sha); + } + }; +} diff --git a/pages/_en-US/gbarunner2/bios-dump.md b/pages/_en-US/gbarunner2/bios-dump.md new file mode 100644 index 00000000..b4083d00 --- /dev/null +++ b/pages/_en-US/gbarunner2/bios-dump.md @@ -0,0 +1,80 @@ +--- +lang: en-US +layout: wiki +section: gbarunner2 +title: GBA BIOS Dumping +description: How to extract the Nintendo GBA BIOS from your console +tabs: + - tab-3ds-sd-card: 3DS with open_agb_firm + tab-gba-flashcart: GBA/DS/DS Lite with a GBA-mode flashcart +--- + +While most GBA emulators have no issue playing GBA games by itself, some emulators and hypervisors, such as GBARunner2, may need the BIOS file to properly playback some titles. + +There are two distinct ways to achieve this, using: +- a 3DS with custom firmware, OR +- a GBA/DS/DS Lite with a GBA-mode flashcart + +{% capture tab-3ds-sd-card %} +### Part 1: Getting the required files +1. Download [open_agb_firm](https://github.com/profi200/open_agb_firm/releases/latest) (the `.7z` file) +1. Download [Bios_Dumper.gba](https://github.com/GlaZedBelmont/Random-Stuff/releases/download/0.0.5/Bios_Dumper.gba) +1. Create a folder named `payloads` inside the `/luma` folder if it does not already exist +1. Copy `open_agb_firm.firm` from the open_agb_firm `.7z` file to the `/luma/payloads` folder +1. Copy `Bios_Dumper.gba` to the root of your SD card +1. Reinsert your SD card into your device + +### Part 2: Bios_Dumper +1. Press and hold START, and while holding START, power on your device + - This will launch open_agb_firm + - If it loads the `Luma3DS Chainloader`, select `open_agb_firm` from this menu + - If it loads to something else, you did not copy `open_agb_firm.firm` to the correct folder on your SD card +1. From open_agb_firm, launch `Bios_Dumper.gba` +1. The screen will flash red, then it will flash green +1. Wait for about five seconds +1. Power off your device + +{% capture upload-bios-text %} +From your SD card, upload `/3ds/open_agb_firm/saves/Bios_Dumper.sav` here: +{% endcapture %} + +### Part 3: Unpack the BIOS from the generated save file +1. Insert your SD card into your computer +1. {% include bios-shrinker.html text=upload-bios-text %} + +{% endcapture %} +{% assign tab-3ds-sd-card = tab-3ds-sd-card | split: "////////" %} + + +{% capture tab-gba-flashcart %} +### Part 1: Getting the required files +1. Download [Bios_Dumper.gba](https://github.com/GlaZedBelmont/Random-Stuff/releases/download/0.0.5/Bios_Dumper.gba) +1. Copy `Bios_Dumper.gba` to the root of your flashcart's SD card +1. Reinsert your SD card into your flashcart +1. Reinsert your GBA flashcart into your cartridge + +### Part 2: Bios_Dumper +1. Launch your flashcart, then launch `Bios_Dumper.gba` +1. The screen will flash red, then it will flash green +1. Wait for about five seconds +1. Power off your device + +{% capture upload-bios-text %} +From your SD card, upload `Bios_Dumper.sav` here: +{% endcapture %} + +### Part 3: Unpack the BIOS from the generated save file +1. Insert your SD card into your computer +1. {% include bios-shrinker.html text=upload-bios-text %} + +{% endcapture %} +{% assign tab-gba-flashcart = tab-gba-flashcart | split: "////////" %} + +{% assign tabs = tab-3ds-sd-card | concat: tab-gba-flashcart %} +{% include tabs.html index=0 tabs=tabs %} + +A `bios.bin` file will automatically download. This is the final GBA BIOS file. +{:.alert .alert-success} + + +