video region mode

This commit is contained in:
kirjavascript 2023-02-19 19:31:10 +00:00
parent 6114b38013
commit cfedc981db
5 changed files with 7 additions and 4 deletions

View file

@ -109,7 +109,7 @@ impl Megadrive {
self.core.execute(3420-588);
for _ in screen_height..262 {
for _ in screen_height..262 { // TODO: PAL scanlines
self.core.execute(3420);
}
}

View file

@ -37,7 +37,7 @@ impl Mem {
0xA11100..=0xA112FF => self.z80.ctrl_read(address) as _,
0xC00000..=0xDFFFFF => self.vdp.read(address),
0xFF0000..=0xFFFFFF => self.ram[address as usize & 0xFFFF] as _,
_ => todo!("read byte {:X}", address),
_ => 0, //todo!("read byte {:X}", address),
}
}
pub fn read_u16(&self, address: u32) -> u32 {
@ -67,7 +67,7 @@ impl Mem {
0xFF0000..=0xFFFFFF => {
self.ram[address as usize & 0xFFFF] = value as u8;
},
_ => todo!("write byte {:X} {:X}", address, value),
_ => (), //todo!("write byte {:X} {:X}", address, value),
}
}
pub fn write_u16(&mut self, address: u32, value: u32) {

View file

@ -39,5 +39,6 @@ impl ROM {
pub fn serial_number(&self) -> String { self.read_string(0x180..0x18E) }
pub fn checksum(&self) -> u16 { self.read_word(0x18E) }
pub fn device_support(&self) -> String { self.read_string(0x190..0x1A0) }
pub fn region(&self) -> String { self.read_string(0x1F0..0x1F3) }
}

View file

@ -10,7 +10,9 @@ impl MDEmu {
#[wasm_bindgen(constructor)]
pub fn new() -> MDEmu {
MDEmu(Megadrive::new(
include_bytes!("/home/cake/sonic/roms/s1p.bin").to_vec()
// include_bytes!("/home/cake/sonic/roms/s1p.bin").to_vec()
// include_bytes!("/home/cake/sonic/roms/s2.bin").to_vec()
include_bytes!("/home/cake/Genesis/Sonic The Hedgehog 3 (E) [!].bin").to_vec()
))
}