ferretro_core -> ferretro_base

This commit is contained in:
Vivian Lim 2021-08-18 14:47:57 -07:00
parent 5d2692262c
commit 7b850c1800
18 changed files with 23 additions and 23 deletions

View File

@ -1,5 +1,5 @@
[workspace]
members = [
"ferretro_core",
"ferretro_base",
"ferretro_components",
]

View File

@ -1,5 +1,5 @@
[package]
name = "ferretro_core"
name = "ferretro_base"
version = "0.1.0"
authors = ["lifning <lifning+git@pm.me>", "viv <vvnl+git@protonmail.com>", "iliana <iliana@buttslol.net>"]
edition = "2018"

View File

@ -1,4 +1,4 @@
extern crate ferretro_core;
extern crate ferretro_base;
extern crate ffmpeg_next as ffmpeg;
use std::collections::VecDeque;
@ -8,11 +8,11 @@ use std::pin::Pin;
use structopt::StructOpt;
use ferretro_core::retro;
use ferretro_core::retro::ffi::{PixelFormat, GameGeometry, SystemAvInfo, SystemInfo};
use ferretro_core::retro::wrapper::{LibretroWrapper, RetroCallbacks};
use ferretro_base::retro;
use ferretro_base::retro::ffi::{PixelFormat, GameGeometry, SystemAvInfo, SystemInfo};
use ferretro_base::retro::wrapper::{LibretroWrapper, RetroCallbacks};
use ferretro_core::retro::wrapped_types::{Variable2};
use ferretro_base::retro::wrapped_types::{Variable2};
use ffmpeg::{ChannelLayout, Packet, codec, filter, format, frame, media};
use ffmpeg::util::rational::Rational;

View File

@ -1,12 +1,12 @@
extern crate crossbeam_channel;
extern crate ferretro_core;
extern crate ferretro_base;
extern crate sdl2;
use ferretro_core::retro;
use ferretro_core::retro::ffi::{GameGeometry, SystemInfo, SystemAvInfo};
use ferretro_core::retro::constants::{InputIndex, JoypadButton, AnalogAxis, DeviceType};
use ferretro_core::retro::wrapped_types::{ControllerDescription2, InputDescriptor2, InputDeviceId, SubsystemInfo2, Variable2};
use ferretro_core::retro::wrapper::LibretroWrapper;
use ferretro_base::retro;
use ferretro_base::retro::ffi::{GameGeometry, SystemInfo, SystemAvInfo};
use ferretro_base::retro::constants::{InputIndex, JoypadButton, AnalogAxis, DeviceType};
use ferretro_base::retro::wrapped_types::{ControllerDescription2, InputDescriptor2, InputDeviceId, SubsystemInfo2, Variable2};
use ferretro_base::retro::wrapper::LibretroWrapper;
use std::ffi::CStr;
use std::io::Read;

View File

@ -8,7 +8,7 @@ edition = "2018"
cc = "^1"
[dependencies]
ferretro_core = { path = "../ferretro_core"}
ferretro_base = { path = "../ferretro_base"}
libloading = "0.5"
num_enum = "0.4"
ffmpeg-next = { version = "4.3.8", optional = true }

View File

@ -1,5 +1,5 @@
use crate::prelude::*;
use ferretro_core::retro::ffi::*;
use ferretro_base::retro::ffi::*;
use std::os::raw::c_uint;
use std::path::{PathBuf, Path};
use std::pin::Pin;
@ -46,7 +46,7 @@ impl RetroComponentBase {
// TODO: constructor & wrapper that uses a statically linked libretro?
pub fn new(core_path: impl AsRef<Path>) -> Pin<Box<Self>> {
let lib = libloading::Library::new(core_path.as_ref()).unwrap();
let raw_retro = ferretro_core::retro::loading::LibretroApi::from_library(lib).unwrap();
let raw_retro = ferretro_base::retro::loading::LibretroApi::from_library(lib).unwrap();
let retro = LibretroWrapper::from(raw_retro);
let emu = RetroComponentBase {
@ -67,7 +67,7 @@ impl RetroComponentBase {
};
let mut pin_emu = Box::pin(emu);
ferretro_core::retro::wrapper::set_handler(pin_emu.as_mut());
ferretro_base::retro::wrapper::set_handler(pin_emu.as_mut());
pin_emu.retro.init();
pin_emu
}
@ -493,6 +493,6 @@ impl RetroCallbacks for RetroComponentBase {
impl Drop for RetroComponentBase {
fn drop(&mut self) {
ferretro_core::retro::wrapper::unset_handler();
ferretro_base::retro::wrapper::unset_handler();
}
}

View File

@ -3,8 +3,8 @@ pub mod base;
pub mod prelude {
pub use crate::base::{RetroComponent, RetroComponentBase};
pub use ferretro_core::retro::constants::*;
pub use ferretro_core::retro::wrapped_types::*;
pub use ferretro_core::retro::wrapper::{RetroCallbacks, LibretroWrapper, LibretroWrapperAccess};
pub use ferretro_core::retro::ffi::{PixelFormat, GameGeometry, SystemAvInfo, SystemInfo};
pub use ferretro_base::retro::constants::*;
pub use ferretro_base::retro::wrapped_types::*;
pub use ferretro_base::retro::wrapper::{RetroCallbacks, LibretroWrapper, LibretroWrapperAccess};
pub use ferretro_base::retro::ffi::{PixelFormat, GameGeometry, SystemAvInfo, SystemInfo};
}

View File

@ -32,7 +32,7 @@ pub struct StderrLogComponent {
impl RetroComponent for StderrLogComponent {}
impl RetroCallbacks for StderrLogComponent {
fn log_print(&mut self, level: ferretro_core::retro::ffi::LogLevel, msg: &str) {
fn log_print(&mut self, level: ferretro_base::retro::ffi::LogLevel, msg: &str) {
eprint!("{}[{:?}] {}", self.prefix, level, msg);
}
}