Add Sameboy bootroms and build them into VST
This commit is contained in:
parent
ef795d810b
commit
b3b0d94522
|
@ -71,7 +71,7 @@ const FRAMES_TO_BUFFER: usize = 1;
|
|||
const DOWNSAMPLE_TYPE: DownsampleType = DownsampleType::ZeroOrderHold;
|
||||
|
||||
const ROM: &[u8; 65536] = include_bytes!("../../test-roms/mGB.gb");
|
||||
const BOOTROM: Option<&[u8; 256]> = None;
|
||||
const BOOTROM: Option<&[u8; 2304]> = Some(include_bytes!("../../sameboy-bootroms/cgb_boot.bin"));
|
||||
|
||||
impl Plugin for GameboyEmu {
|
||||
const NAME: &'static str = "Gameboy";
|
||||
|
|
|
@ -76,16 +76,6 @@ where
|
|||
RomFile::Raw(data) => Rom::load(data, None, camera.clone()),
|
||||
};
|
||||
|
||||
let cgb = rom.rom_type == CgbRomType::CgbOnly || options.cgb_mode;
|
||||
|
||||
options.window.prepare(WIDTH, HEIGHT);
|
||||
options.window.set_title(format!(
|
||||
"{} on {} on {}",
|
||||
rom.get_title(),
|
||||
rom.mbc_type(),
|
||||
if cgb { "CGB" } else { "DMG" }
|
||||
));
|
||||
|
||||
let bootrom_enabled = if options.bootrom.is_some() {
|
||||
if options.skip_bootrom {
|
||||
RunBootrom::Skip
|
||||
|
@ -106,6 +96,18 @@ where
|
|||
RomFile::Raw(data) => data,
|
||||
});
|
||||
|
||||
let cgb = rom.rom_type == CgbRomType::CgbOnly
|
||||
|| options.cgb_mode
|
||||
|| bootrom.as_ref().map_or(false, |v| v.len() > 256);
|
||||
|
||||
options.window.prepare(WIDTH, HEIGHT);
|
||||
options.window.set_title(format!(
|
||||
"{} on {} on {}",
|
||||
rom.get_title(),
|
||||
rom.mbc_type(),
|
||||
if cgb { "CGB" } else { "DMG" }
|
||||
));
|
||||
|
||||
Self::new(
|
||||
receiver,
|
||||
Cpu::new(
|
||||
|
|
23
sameboy-bootroms/LICENSE
Normal file
23
sameboy-bootroms/LICENSE
Normal file
|
@ -0,0 +1,23 @@
|
|||
Bootroms from Sameboy ( https://github.com/LIJI32/SameBoy ) under MIT license
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2015-2023 Lior Halphon
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
BIN
sameboy-bootroms/agb_boot.bin
Normal file
BIN
sameboy-bootroms/agb_boot.bin
Normal file
Binary file not shown.
BIN
sameboy-bootroms/cgb0_boot.bin
Normal file
BIN
sameboy-bootroms/cgb0_boot.bin
Normal file
Binary file not shown.
BIN
sameboy-bootroms/cgb_boot.bin
Normal file
BIN
sameboy-bootroms/cgb_boot.bin
Normal file
Binary file not shown.
BIN
sameboy-bootroms/dmg_boot.bin
Normal file
BIN
sameboy-bootroms/dmg_boot.bin
Normal file
Binary file not shown.
BIN
sameboy-bootroms/mgb_boot.bin
Normal file
BIN
sameboy-bootroms/mgb_boot.bin
Normal file
Binary file not shown.
BIN
sameboy-bootroms/sgb2_boot.bin
Normal file
BIN
sameboy-bootroms/sgb2_boot.bin
Normal file
Binary file not shown.
BIN
sameboy-bootroms/sgb_boot.bin
Normal file
BIN
sameboy-bootroms/sgb_boot.bin
Normal file
Binary file not shown.
Loading…
Reference in a new issue