File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
platform/rustboyadvance-sdl2/src Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ fn try_load_zip(data: &[u8]) -> LoadRomResult {
5656 ) )
5757}
5858
59- pub ( super ) fn load_from_file ( path : & Path ) -> LoadRomResult {
59+ pub fn load_from_file ( path : & Path ) -> LoadRomResult {
6060 let bytes = read_bin_file ( path) ?;
6161
6262 match path. extension ( ) {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ mod rtc;
1818use gpio:: Gpio ;
1919
2020mod builder;
21- mod loader;
21+ pub mod loader;
2222pub use builder:: GamepakBuilder ;
2323
2424pub const GPIO_PORT_DATA : u32 = 0xC4 ;
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ use rustboyadvance_core::prelude::*;
2626
2727use rustboyadvance_utils:: FpsCounter ;
2828
29+ use rustboyadvance_core:: cartridge:: loader:: { load_from_file, LoadRom } ;
30+
2931const LOG_DIR : & str = ".logs" ;
3032
3133fn ask_download_bios ( ) {
@@ -161,7 +163,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
161163 let ( audio_interface, _sdl_audio_device_new) =
162164 audio:: create_audio_player ( & sdl_context) ?;
163165 _sdl_audio_device = _sdl_audio_device_new;
164- let rom = opts. read_rom ( ) ?. into_boxed_slice ( ) ;
166+ let rom = match load_from_file ( & opts. rom ) ? {
167+ LoadRom :: Raw ( data) => data. into_boxed_slice ( ) ,
168+ LoadRom :: Elf { data, .. } => data. into_boxed_slice ( ) ,
169+ } ;
165170 gba = Box :: new ( GameBoyAdvance :: from_saved_state (
166171 & save,
167172 bios_bin. clone ( ) ,
You can’t perform that action at this time.
0 commit comments