From 4b8a79d674d614b643977164cd9d3c026c79a2dc Mon Sep 17 00:00:00 2001 From: Damian Yerrick Date: Sun, 4 Aug 2024 20:13:08 -0400 Subject: [PATCH] Cult of GBA BIOS incompatibility warning --- .gitignore | 2 ++ gba/README.md | 20 ++++++++++++++++++++ gba/tools/get_bios.sh | 12 ++++++++++++ gba/tools/write_bios.c | 12 ++++++++++++ nes/src/helppages.txt | 10 +++++----- 5 files changed, 51 insertions(+), 5 deletions(-) create mode 100755 gba/tools/get_bios.sh create mode 100644 gba/tools/write_bios.c diff --git a/.gitignore b/.gitignore index d43c51a..31ff3a6 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,8 @@ __pycache__/ /gba/*.sav /gba/.map /gba/compile_commands.json +/gba/tools/write_bios +/gba/tools/gba_bios.h /nes/obj/nes/*.s /nes/obj/nes/*.sav /nes/obj/nes/last-commit* diff --git a/gba/README.md b/gba/README.md index 83356c8..920783b 100644 --- a/gba/README.md +++ b/gba/README.md @@ -117,6 +117,26 @@ or macOS, once you have installed `gba-dev` using pacman, type these: source /etc/profile.d/devkit-env.sh make +In 2024, unreliability of devkitPro's download servers led the team +to investigate replacing devkitARM with [Wonderful Toolchain]. + +Some GBA emulators, such as Mesen, do not ship with a free +reimplementation of Game Boy Advance BIOS. GBA owners can +[dump the authentic BIOS] using a GBA flash cartridge. +Emulator-only users can use [Cult of GBA's reimplementation], either +using a GNU binutils distribution (such as devkitARM or Wonderful) +to build it from source code or using the `tools/get_bios.sh` +script with a native C compiler to retrieve and unpack the copy of +Cult of GBA BIOS distributed with [SkyEmu]. **Careful:** As of +August 2024, Cult of GBA BIOS works only with the devkitARM build, +not the Wonderful build. (This has been filed as [issue #14].) + +[Wonderful Toolchain]: https://wonderful.asie.pl/ +[dump the authentic BIOS]: https://glazedbelmont.github.io/gbabiosdump/ +[Cult of GBA's reimplementation]: https://github.com/Cult-of-GBA/BIOS +[SkyEmu]: https://github.com/skylersaleh/SkyEmu +[issue #14]: https://github.com/Cult-of-GBA/BIOS/issues/14 + Contributors ------------ * Concept: Artemio Urbina [@Artemio] diff --git a/gba/tools/get_bios.sh b/gba/tools/get_bios.sh new file mode 100755 index 0000000..58a99f2 --- /dev/null +++ b/gba/tools/get_bios.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Downloader for SkyEmu distribution of Cult of GBA BIOS +# Copyright 2024 Damian Yerrick +# SPDX-License-Identifier: FSFAP +# +# Script to download and produce the file gba_bios.bin based on +# Cult of GBA BIOS +# which is under Expat license +set -e +curl --remote-name --referer 'https://github.com/SourMesen/Mesen2/' 'https://raw.githubusercontent.com/skylersaleh/SkyEmu/555bd384f3346b7cd3103d74d5191c3b86312157/src/gba_bios.h' +gcc -std=c11 -s -Os -o write_bios write_bios.c +./write_bios diff --git a/gba/tools/write_bios.c b/gba/tools/write_bios.c new file mode 100644 index 0000000..314e811 --- /dev/null +++ b/gba/tools/write_bios.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include "gba_bios.h" +static_assert(sizeof(gba_bios_bin) == 16384); +int main(void) { + FILE *outfp = fopen("gba_bios.bin", "wb"); + if (!outfp) return EXIT_FAILURE; + size_t written = fwrite(gba_bios_bin, sizeof gba_bios_bin, 1, outfp); + fclose(outfp); + return !written; +} diff --git a/nes/src/helppages.txt b/nes/src/helppages.txt index ed50d05..40252a8 100644 --- a/nes/src/helppages.txt +++ b/nes/src/helppages.txt @@ -143,11 +143,11 @@ color levels. A: Toggle bars' brightness Select: Play 1 kHz tone -Use blue filters or some TVs' -blue-only mode to confirm -color balance. Because of -shortcuts in the NES PPU's -composite output stage, +Use blue filters or some +TVs' blue-only mode to +confirm color balance. +Because of shortcuts in the +NES PPU's composite output, these colors are impure. On NTSC, green and magenta have correct hues, and