mirror of
https://github.com/italicsjenga/gba.git
synced 2025-01-11 03:21:30 +11:00
mGBA output wasn't resetting its length used
This commit is contained in:
parent
8ff32b0304
commit
0e363477b7
|
@ -6,6 +6,7 @@ use super::*;
|
||||||
#[repr(u16)]
|
#[repr(u16)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum MGBADebugLevel {
|
pub enum MGBADebugLevel {
|
||||||
|
/// Warning! This causes the emulator to halt emulation!
|
||||||
Fatal = 0,
|
Fatal = 0,
|
||||||
Error = 1,
|
Error = 1,
|
||||||
Warning = 2,
|
Warning = 2,
|
||||||
|
@ -51,9 +52,12 @@ impl MGBADebug {
|
||||||
pub fn send(&mut self, level: MGBADebugLevel) {
|
pub fn send(&mut self, level: MGBADebugLevel) {
|
||||||
if level == MGBADebugLevel::Fatal {
|
if level == MGBADebugLevel::Fatal {
|
||||||
Self::SEND_ADDRESS.write(Self::SEND_FLAG | MGBADebugLevel::Error as u16);
|
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);
|
Self::SEND_ADDRESS.write(Self::SEND_FLAG | MGBADebugLevel::Fatal as u16);
|
||||||
} else {
|
} else {
|
||||||
Self::SEND_ADDRESS.write(Self::SEND_FLAG | level as u16);
|
Self::SEND_ADDRESS.write(Self::SEND_FLAG | level as u16);
|
||||||
|
self.bytes_written = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue