Compare commits

..

2 Commits

Author SHA1 Message Date
0957a79f15 Remove wgpu dependency 2021-11-13 09:24:01 -05:00
0a30d9d194 Banking mode 2021-11-13 08:04:34 -05:00
4 changed files with 6 additions and 6 deletions

1
Cargo.lock generated
View File

@ -1171,7 +1171,6 @@ dependencies = [
"log",
"pixels",
"rand",
"wgpu",
"winit",
"winit_input_helper",
]

View File

@ -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"

View File

@ -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};

View File

@ -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;