chore: remove Cycle struct and begin scheduler design
This commit is contained in:
14
src/cpu.rs
14
src/cpu.rs
@@ -1,10 +1,10 @@
|
||||
use crate::apu::Apu;
|
||||
use crate::bus::{Bus, BusIo};
|
||||
use crate::instruction::cycle::Cycle;
|
||||
use crate::instruction::Instruction;
|
||||
use crate::interrupt::{InterruptEnable, InterruptFlag};
|
||||
use crate::joypad::Joypad;
|
||||
use crate::ppu::Ppu;
|
||||
use crate::Cycle;
|
||||
use bitfield::bitfield;
|
||||
use std::fmt::{Display, Formatter, Result as FmtResult};
|
||||
|
||||
@@ -133,7 +133,7 @@ impl Cpu {
|
||||
self.bus.clock();
|
||||
|
||||
let elapsed = match kind {
|
||||
ImeEnabled | NonePending => Cycle::new(4),
|
||||
ImeEnabled | NonePending => 4,
|
||||
SomePending => todo!("Implement HALT bug"),
|
||||
};
|
||||
|
||||
@@ -146,11 +146,11 @@ impl Cpu {
|
||||
self.handle_ei();
|
||||
|
||||
// For use in Blargg's Test ROMs
|
||||
// if self.read_byte(0xFF02) == 0x81 {
|
||||
// let c = self.read_byte(0xFF01) as char;
|
||||
// self.write_byte(0xFF02, 0x00);
|
||||
// eprint!("{}", c);
|
||||
// }
|
||||
if self.read_byte(0xFF02) == 0x81 {
|
||||
let c = self.read_byte(0xFF01) as char;
|
||||
self.write_byte(0xFF02, 0x00);
|
||||
eprint!("{}", c);
|
||||
}
|
||||
|
||||
elapsed
|
||||
}
|
||||
|
Reference in New Issue
Block a user