fix: profile the beetle gba bios from its loader

This commit is contained in:
Abdessamad Derraz committed 2026-10-16 06:36:15 +02:00
1 parent 0d78a9e074
commit d021f4d6bc
2 files changed
+22 -2

No files matched your search

+10 -2
View File
@@ -1,14 +1,22 @@
# Beetle GBA (Mednafen) — Game Boy Advance (libretro)
# ref: beetle-gba-libretro/mednafen/gba, docs.libretro.com/library/beetle_gba
# Same BIOS as mGBA/VBA-M. Optional, no HLE fallback documented.
# Same BIOS as mGBA/VBA-M. Read only with the gba_hle core option disabled.
emulator: Beetle GBA (Mednafen)
type: libretro
cores: [mednafen_gba]
source: "https://github.com/libretro/beetle-gba-libretro"
source_commit: "b158166237b17253188cfdbe73a8a0b9fe4b3a8c"
systems:
- nintendo-gba
files:
- name: gba_bios.bin
system: nintendo-gba
required: false
md5: a860e8c0b6d573d191e4ec7db1b1e4f6
hle_fallback: true
size: 16384
validation: [size]
source_ref: "mednafen/gba/GBA.cpp:2639-2673, mednafen/settings.cpp:81-82, libretro.cpp:223-230"
note: >
Read only when the gba_hle core option is disabled; it is enabled by
default and the core then uses its built-in HLE BIOS. A file of any size
other than 16384 bytes is ignored and the core falls back to HLE.
+12
View File
@@ -99,5 +99,17 @@ class BeetleLynxBootRom(_Probe):
self.assertTrue(self.accepts("beetle_lynx", "lynxboot.img", b"\0" * 1024))
class BeetleGbaBios(_Probe):
"""CPUInit copies the BIOS only when it is exactly 0x4000 bytes and
otherwise falls back to HLE (mednafen/gba/GBA.cpp:2639-2673 at
b158166)."""
def test_only_16k_is_used(self):
self.assertTrue(self.accepts("beetle_gba", "gba_bios.bin", b"\0" * 16384))
for size in (1000, 32768):
with self.subTest(size=size):
self.assertFalse(self.accepts("beetle_gba", "gba_bios.bin", b"\0" * size))
if __name__ == "__main__":
unittest.main()