wram in a box
This commit is contained in:
parent
e6b4d9c254
commit
9b7e52d73f
1 changed files with 3 additions and 3 deletions
|
@ -26,8 +26,8 @@ pub(crate) mod rom;
|
|||
#[serde_with::serde_as]
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct Wram {
|
||||
#[serde_as(as = "[_; 4096]")]
|
||||
bank_0: [u8; 4096],
|
||||
#[serde_as(as = "Box<[_; 4096]>")]
|
||||
bank_0: Box<[u8; 4096]>,
|
||||
banks: WramBanks,
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ enum WramBanks {
|
|||
impl Wram {
|
||||
fn new(cgb: bool) -> Self {
|
||||
Self {
|
||||
bank_0: [0; 4096],
|
||||
bank_0: Box::new([0; 4096]),
|
||||
banks: if cgb {
|
||||
WramBanks::Cgb {
|
||||
banks: Box::new([[0; 4096]; 8]),
|
||||
|
|
Loading…
Add table
Reference in a new issue