diff --git a/src/mgba.rs b/src/mgba.rs index 24e6648..46e0063 100644 --- a/src/mgba.rs +++ b/src/mgba.rs @@ -6,6 +6,7 @@ use super::*; #[repr(u16)] #[allow(missing_docs)] pub enum MGBADebugLevel { + /// Warning! This causes the emulator to halt emulation! Fatal = 0, Error = 1, Warning = 2, @@ -51,9 +52,12 @@ impl MGBADebug { pub fn send(&mut self, level: MGBADebugLevel) { if level == MGBADebugLevel::Fatal { Self::SEND_ADDRESS.write(Self::SEND_FLAG | MGBADebugLevel::Error as u16); + + // Note(Lokathor): A Fatal send causes the emulator to halt! Self::SEND_ADDRESS.write(Self::SEND_FLAG | MGBADebugLevel::Fatal as u16); } else { Self::SEND_ADDRESS.write(Self::SEND_FLAG | level as u16); + self.bytes_written = 0; } } }