Fix SRAM addressable range
This commit is contained in:
parent
af2df78809
commit
6687b1f12f
|
@ -28,14 +28,14 @@ impl Cart {
|
||||||
|
|
||||||
let sram = if sram_file.metadata()?.len() == 0 {
|
let sram = if sram_file.metadata()?.len() == 0 {
|
||||||
// new SRAM file, randomize the contents
|
// new SRAM file, randomize the contents
|
||||||
let mut sram = vec![0; 8 * 1024];
|
let mut sram = vec![0; 16 * 1024];
|
||||||
let mut rng = rand::rng();
|
let mut rng = rand::rng();
|
||||||
for dst in sram.iter_mut().step_by(2) {
|
for dst in sram.iter_mut().step_by(2) {
|
||||||
*dst = rng.random();
|
*dst = rng.random();
|
||||||
}
|
}
|
||||||
sram
|
sram
|
||||||
} else {
|
} else {
|
||||||
let mut sram = Vec::with_capacity(8 * 1024);
|
let mut sram = Vec::with_capacity(16 * 1024);
|
||||||
sram_file.read_to_end(&mut sram)?;
|
sram_file.read_to_end(&mut sram)?;
|
||||||
sram
|
sram
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue