From 0e363477b714fdbadf0cd3eebf6e562258fae9b3 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sat, 12 Jan 2019 13:34:43 -0700 Subject: [PATCH] mGBA output wasn't resetting its length used --- src/mgba.rs | 4 ++++ 1 file changed, 4 insertions(+) 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; } } }