mGBA output wasn't resetting its length used

This commit is contained in:
Lokathor 2019-01-12 13:34:43 -07:00
parent 8ff32b0304
commit 0e363477b7

View file

@ -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;
}
}
}