Add markers to event stream
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::{ffi::c_void, ptr, slice};
|
||||
use std::{borrow::Cow, ffi::c_void, ptr, slice};
|
||||
|
||||
use anyhow::{Result, anyhow};
|
||||
use bitflags::bitflags;
|
||||
@@ -191,6 +191,9 @@ extern "C" fn on_frame(sim: *mut VB) -> c_int {
|
||||
// There is no way for the userdata to be null or otherwise invalid.
|
||||
let data: &mut VBState = unsafe { &mut *vb_get_user_data(sim).cast() };
|
||||
data.frame_seen = true;
|
||||
if data.monitor.enabled {
|
||||
data.monitor.event = Some(SimEvent::Marker(Cow::Borrowed("Frame Drawn")));
|
||||
}
|
||||
1
|
||||
}
|
||||
|
||||
@@ -328,6 +331,7 @@ pub enum SimEvent {
|
||||
Halt,
|
||||
Interrupt(u16, u32),
|
||||
Reti,
|
||||
Marker(Cow<'static, str>),
|
||||
}
|
||||
|
||||
struct EventMonitor {
|
||||
|
||||
Reference in New Issue
Block a user