The emulator thread that owns and runs the GBA.
| 211 | /// LCD frame buffer - RGB values for each pixel. |
| 212 | /// Stored as [R, G, B] for each pixel, row by row. |
| 213 | pub type FrameBuffer = [u8; LCD_WIDTH * LCD_HEIGHT * 3]; |
| 214 | |
| 215 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] |
| 216 | struct Breakpoint { |
| 217 | address: u32, |
| 218 | kind: BreakpointKind, |
| 219 | } |
| 220 | |
| 221 | #[derive(Clone, Copy)] |
| 222 | enum HandleUpdate { |
| 223 | AddBreakpoint { address: u32, kind: BreakpointKind }, |
| 224 | RemoveBreakpoint(u32), |
| 225 | SetSpeed(f32), |
| 226 | } |
| 227 | |
| 228 | /// The emulator thread that owns and runs the GBA. |
| 229 | struct EmuThread { |
| 230 | gba: Gba, |
| 231 | cmd_rx: rtrb::Consumer<EmuCommand>, |
| 232 | event_tx: rtrb::Producer<EmuEvent>, |
| 233 | shutdown: Arc<AtomicBool>, |
| 234 | // State |
| 235 | running: bool, |
| 236 | steps_remaining: u32, |
| 237 | breakpoints: BTreeSet<Breakpoint>, |
nothing calls this directly
no outgoing calls
no test coverage detected