Add markers to event stream

This commit is contained in:
2025-08-27 22:49:44 -04:00
parent ed06004a60
commit 5e23df4723
4 changed files with 116 additions and 63 deletions
+5 -1
View File
@@ -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 {