Skip to content

Commit

Permalink
Fixes #6,
Browse files Browse the repository at this point in the history
CPU bus request on interrupt independently of I
  • Loading branch information
LLeny committed Nov 8, 2024
1 parent 0fb1455 commit ce9550c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/mikey/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum MikeyInstruction {
}

#[derive(Clone, Copy, PartialEq, Serialize, Deserialize)]
enum MikeyBusOwner {
pub enum MikeyBusOwner {
Video,
Refresh,
Cpu,
Expand Down Expand Up @@ -144,8 +144,10 @@ impl Mikey {
if int != 0 {
int |= self.registers.data(INTSET);
trace!("INTSET -> {:02X}", int);
self.registers.set_data(INTSET, int);
if !self.cpu.flags().contains(M6502Flags::I) && !bus.grant() { // wake up the cpu
if !self.cpu.flags().contains(M6502Flags::I) {
self.registers.set_data(INTSET, int);
}
if !bus.grant() { // wake up the cpu
bus.set_request(true);
}
}
Expand Down Expand Up @@ -584,6 +586,10 @@ impl Mikey {
pub(crate) fn comlynx_cable(&self) -> &ComlynxCable {
self.uart.cable()
}

pub fn bus_owner(&self) -> MikeyBusOwner {
self.bus_owner
}
}

impl Default for Mikey {
Expand Down
1 change: 1 addition & 0 deletions src/mikey/registers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl MikeyRegisters {
self.palette[pen_index as usize][2] = (bluered >> 4) * 16;
}

#[inline]
pub fn get_pen(&self, pen_index: u8) -> &[u8; 3] {
&self.palette[pen_index as usize]
}
Expand Down

0 comments on commit ce9550c

Please sign in to comment.