cpu.rs: Actually derive (De)Serialize if feature=serde

This commit is contained in:
2023-04-23 12:16:31 -05:00
parent 5b5c5b41ab
commit 16a5e6a2a4
2 changed files with 4 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ type Nib = u8;
/// Represents the internal state of the CPU interpreter
#[derive(Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct CPU {
/// Flags that control how the CPU behaves, but which aren't inherent to the
/// chip-8. Includes [Quirks], target IPF, etc.
@@ -57,6 +58,7 @@ pub struct CPU {
// Execution data
cycle: usize,
breakpoints: Vec<Adr>,
#[cfg_attr(feature = "serde", serde(skip))]
disassembler: Dis,
}