diff --git a/gb-vst/src/lib.rs b/gb-vst/src/lib.rs index 6d68144..0805235 100644 --- a/gb-vst/src/lib.rs +++ b/gb-vst/src/lib.rs @@ -106,27 +106,6 @@ impl Plugin for GameboyEmu { buffer_config: &BufferConfig, _context: &mut impl InitContext, ) -> 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") - .to_vec() - .to_vec(), - ), - save_path: None, - no_save: true, - bootrom, - connect_serial: false, - verbose: false, - }; - if let Some(ref mut vars) = self.vars { let (output, rx) = AudioOutput::new( buffer_config.sample_rate, @@ -138,6 +117,27 @@ impl Plugin for GameboyEmu { vars.emulator_core.replace_output(output); vars.rx = rx; } else { + 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") + .to_vec() + .to_vec(), + ), + save_path: None, + no_save: true, + bootrom, + connect_serial: false, + verbose: false, + }; + let (sender, receiver) = channel::(); let (output, rx) = AudioOutput::new(