Commit 27dfc26f authored by Dustin Nguyen's avatar Dustin Nguyen
Browse files

add sound registers

parent b42a7809
pub mod memorybus;
pub mod lcd;
pub mod memorybus;
pub mod sm83;
pub mod sound;
use std::fs::File;
use std::io::Read;
......@@ -12,6 +13,7 @@ use memorybus::MemoryBus as MemoryBus;
pub struct Soc {
cpu: sm83::Sm83,
mbus: memorybus::MemoryBus,
sound: sound::Sound,
}
impl Soc {
......@@ -24,9 +26,11 @@ impl Soc {
if 0xff != f.read(&mut buf)? {
return Err(std::io::Error::from(std::io::ErrorKind::UnexpectedEof));
}
let sound = sound::Sound::new();
let soc = Soc {
cpu: cpu,
sound: sound,
mbus: MemoryBus {
bootrom: buf,
lcd: lcd::LCD {
......
pub struct Sound {
pub wav: [u8;32 * 4 / 8], // ff30 - ff3f
pub sound1: [u8;4], // ff10 - ff14
pub sound2: [u8;4], // ff16 - ff19
pub sound3: [u8;4], // ff1a - ff1e
pub sound4: [u8;4], // ff20 - ff23
pub control: [u8;3], // ff24 - ff26
}
impl Sound {
pub fn new() -> Sound {
Sound {
wav: [0;16],
sound1: [0;4],
sound2: [0;4],
sound3: [0;4],
sound4: [0;4],
control: [0;3],
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment