2019-11-11 01:35:16 +00:00
|
|
|
#![feature(asm)]
|
|
|
|
#![feature(core_intrinsics)]
|
2019-12-21 18:19:43 +00:00
|
|
|
#![feature(exclusive_range_pattern)]
|
2019-11-11 01:35:16 +00:00
|
|
|
|
2020-01-16 17:49:13 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate serde;
|
|
|
|
extern crate bincode;
|
|
|
|
|
2019-12-28 13:59:35 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate debug_stub_derive;
|
|
|
|
|
2019-06-30 20:31:16 +01:00
|
|
|
#[macro_use]
|
|
|
|
extern crate enum_primitive_derive;
|
2019-07-02 14:42:55 +01:00
|
|
|
extern crate num;
|
2019-06-30 20:31:16 +01:00
|
|
|
extern crate num_traits;
|
|
|
|
|
|
|
|
extern crate bit;
|
2019-08-02 22:18:59 +01:00
|
|
|
#[macro_use]
|
|
|
|
extern crate bitfield;
|
2019-08-13 19:57:45 +01:00
|
|
|
#[macro_use]
|
|
|
|
extern crate bitflags;
|
2020-01-11 13:58:32 +00:00
|
|
|
extern crate bit_set;
|
2019-06-30 20:31:16 +01:00
|
|
|
|
|
|
|
extern crate byteorder;
|
|
|
|
|
2020-01-12 23:11:58 +00:00
|
|
|
#[cfg(feature = "debugger")]
|
2019-06-30 20:31:16 +01:00
|
|
|
extern crate rustyline;
|
|
|
|
|
2020-01-12 23:11:58 +00:00
|
|
|
#[cfg(feature = "debugger")]
|
2019-06-30 20:31:16 +01:00
|
|
|
extern crate nom;
|
|
|
|
|
|
|
|
extern crate ansi_term;
|
2019-07-02 14:57:35 +01:00
|
|
|
extern crate colored; // not needed in Rust 2018
|
2019-06-30 20:31:16 +01:00
|
|
|
|
2019-09-11 19:26:40 +01:00
|
|
|
extern crate zip;
|
|
|
|
|
2020-01-17 14:08:23 +00:00
|
|
|
extern crate memmem;
|
|
|
|
|
2020-01-30 23:47:52 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
|
|
|
|
2019-07-30 22:52:46 +01:00
|
|
|
#[macro_use]
|
|
|
|
pub mod util;
|
2019-07-20 14:46:00 +01:00
|
|
|
pub mod core;
|
2019-06-30 20:31:16 +01:00
|
|
|
pub mod disass;
|
2019-12-04 23:15:49 +00:00
|
|
|
|
2020-01-12 23:11:58 +00:00
|
|
|
#[cfg(feature = "debugger")]
|
2019-12-29 21:37:23 +00:00
|
|
|
pub mod debugger;
|
|
|
|
|
2019-12-04 23:15:49 +00:00
|
|
|
pub trait VideoInterface {
|
2020-01-16 23:28:11 +00:00
|
|
|
#[allow(unused_variables)]
|
|
|
|
fn render(&mut self, buffer: &[u32]) {}
|
2019-12-04 23:15:49 +00:00
|
|
|
}
|
|
|
|
|
2020-01-20 23:18:47 +00:00
|
|
|
pub type StereoSample<T> = (T, T);
|
2019-12-28 13:59:35 +00:00
|
|
|
|
2019-12-04 23:15:49 +00:00
|
|
|
pub trait AudioInterface {
|
2020-01-16 23:28:11 +00:00
|
|
|
fn get_sample_rate(&self) -> i32 {
|
|
|
|
44100
|
|
|
|
}
|
2019-12-21 22:58:18 +00:00
|
|
|
|
2020-01-20 23:18:47 +00:00
|
|
|
/// Pushes a stereo sample into the audio device
|
|
|
|
/// Sample should be normilized to siged 16bit values
|
|
|
|
/// Note: It is not guarentied that the sample will be played
|
2019-12-21 22:58:18 +00:00
|
|
|
#[allow(unused_variables)]
|
2020-01-20 23:18:47 +00:00
|
|
|
fn push_sample(&mut self, samples: StereoSample<i16>) {}
|
2019-12-04 23:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub trait InputInterface {
|
2020-01-16 23:28:11 +00:00
|
|
|
fn poll(&mut self) -> u16 {
|
|
|
|
core::keypad::KEYINPUT_ALL_RELEASED
|
|
|
|
}
|
2019-12-04 23:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub mod prelude {
|
|
|
|
pub use super::core::arm7tdmi;
|
|
|
|
pub use super::core::cartridge::Cartridge;
|
|
|
|
pub use super::core::{GBAError, GBAResult, GameBoyAdvance};
|
2020-01-12 23:11:58 +00:00
|
|
|
#[cfg(feature = "debugger")]
|
2019-12-04 23:15:49 +00:00
|
|
|
pub use super::debugger::Debugger;
|
2020-01-16 17:49:43 +00:00
|
|
|
pub use super::util::{read_bin_file, write_bin_file};
|
2019-12-04 23:15:49 +00:00
|
|
|
pub use super::{AudioInterface, InputInterface, VideoInterface};
|
|
|
|
}
|