mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 08:41:34 +11:00
get cycles
This commit is contained in:
parent
cda7e95a28
commit
744c7a8bb4
|
@ -89,7 +89,9 @@ where
|
||||||
mgba::DebugLevel::Info,
|
mgba::DebugLevel::Info,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
mgba::number_of_cycles_tagged(785);
|
||||||
self(gba);
|
self(gba);
|
||||||
|
mgba::number_of_cycles_tagged(785);
|
||||||
mgba.print(format_args!("[ok]"), mgba::DebugLevel::Info)
|
mgba.print(format_args!("[ok]"), mgba::DebugLevel::Info)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
@ -138,6 +140,8 @@ pub extern "C" fn main() -> ! {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
fn assert_image_output(image: &str) {
|
fn assert_image_output(image: &str) {
|
||||||
|
display::busy_wait_for_VBlank();
|
||||||
|
display::busy_wait_for_VBlank();
|
||||||
let mut mgba = crate::mgba::Mgba::new().unwrap();
|
let mut mgba = crate::mgba::Mgba::new().unwrap();
|
||||||
mgba.print(
|
mgba.print(
|
||||||
format_args!("image:{}", image),
|
format_args!("image:{}", image),
|
||||||
|
|
|
@ -26,6 +26,12 @@ fn is_running_in_mgba() -> bool {
|
||||||
DEBUG_ENABLE.get() == ENABLE_HANDSHAKE_OUT
|
DEBUG_ENABLE.get() == ENABLE_HANDSHAKE_OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const NUMBER_OF_CYCLES: MemoryMapped<u16> = unsafe { MemoryMapped::new(0x04FF_F800) };
|
||||||
|
|
||||||
|
pub fn number_of_cycles_tagged(tag: u16) {
|
||||||
|
NUMBER_OF_CYCLES.set(tag)
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Mgba {
|
pub struct Mgba {
|
||||||
bytes_written: usize,
|
bytes_written: usize,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue