easily switchable bootrom

This commit is contained in:
Alex Janka 2023-03-09 10:39:00 +11:00
parent 77ee67a0fd
commit bfb895ef4c

View file

@ -33,6 +33,7 @@ type FrameReceiver = Mutex<Option<Receiver<Vec<[u8; 4]>>>>;
type JoypadSender = Mutex<Option<Sender<(JoypadButtons, bool)>>>;
const FRAMES_TO_BUFFER: usize = 1;
const INCLUDE_BOOTROM: bool = false;
impl Plugin for GameboyEmu {
const NAME: &'static str = "Gameboy";
@ -104,6 +105,14 @@ impl Plugin for GameboyEmu {
buffer_config: &BufferConfig,
_context: &mut impl InitContext<Self>,
) -> bool {
let bootrom = if INCLUDE_BOOTROM {
Some(RomFile::Raw(
include_bytes!("../../bootrom/dmg_boot.bin").to_vec(),
))
} else {
None
};
let options = gb_emu_lib::Options {
rom: RomFile::Raw(
include_bytes!("../../test-roms/Tetris.gb")
@ -112,9 +121,7 @@ impl Plugin for GameboyEmu {
),
save_path: None,
no_save: true,
bootrom: Some(RomFile::Raw(
include_bytes!("../../bootrom/dmg_boot.bin").to_vec(),
)),
bootrom,
connect_serial: false,
verbose: false,
cycle_count: false,