mirror of
https://github.com/FranLMSP/rmg-001.git
synced 2024-11-23 10:12:11 +00:00
Compare commits
2 Commits
d90a25e6f6
...
0957a79f15
Author | SHA1 | Date | |
---|---|---|---|
0957a79f15 | |||
0a30d9d194 |
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1171,7 +1171,6 @@ dependencies = [
|
||||
"log",
|
||||
"pixels",
|
||||
"rand",
|
||||
"wgpu",
|
||||
"winit",
|
||||
"winit_input_helper",
|
||||
]
|
||||
|
@ -14,6 +14,5 @@ rand = "0.8"
|
||||
env_logger = "0.9"
|
||||
log = "0.4"
|
||||
pixels = "0.7"
|
||||
wgpu = "0.11"
|
||||
winit = "0.25"
|
||||
winit_input_helper = "0.10"
|
||||
|
@ -6,7 +6,7 @@ use crate::ppu::{WIDTH, HEIGHT};
|
||||
use std::{thread, time};
|
||||
|
||||
use log::error;
|
||||
use pixels::{Pixels, PixelsBuilder, SurfaceTexture};
|
||||
use pixels::{wgpu, Pixels, PixelsBuilder, SurfaceTexture};
|
||||
use winit::dpi::LogicalSize;
|
||||
use winit::event::{Event, VirtualKeyCode, WindowEvent};
|
||||
use winit::event_loop::{ControlFlow, EventLoop};
|
||||
|
@ -194,9 +194,7 @@ impl ROM {
|
||||
return self.data[address as usize];
|
||||
} else if BANK_SWITCHABLE.in_range(address) {
|
||||
return self.data[((self.rom_bank as usize * 0x4000) + (address as usize & 0x3FFF)) as usize];
|
||||
// return self.data[(address + (BANK_SWITCHABLE.begin() * (self.rom_bank - 1))) as usize];
|
||||
} else if EXTERNAL_RAM.in_range(address) {
|
||||
println!("RAM read");
|
||||
if !self.info.has_ram {
|
||||
return 0xFF;
|
||||
}
|
||||
@ -232,7 +230,11 @@ impl ROM {
|
||||
// println!("RAM bank {:02X}", data);
|
||||
self.ram_bank = data & 0b11;
|
||||
} else if address >= 0x6000 && address <= 0x7FFF { // Banking mode select
|
||||
// println!("Change banking mode");
|
||||
self.banking_mode = match data & 1 {
|
||||
0 => BankingMode::Simple,
|
||||
1 => BankingMode::Advanced,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
} else if EXTERNAL_RAM.in_range(address) {
|
||||
if !self.ram_enable || !self.info.has_ram {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user