librsmsx 0.4.4

a MSX emulator written in rust, a port from gomsx
Documentation
use std::ops::ControlFlow;

use crate::libs::{memory::Memory, ports::Ports};

use super::z80_base::Z80Data;

// do nothing
pub trait FuncHook {
    fn handle_generic_hook(
        &mut self,
        _data: &mut Z80Data,
        _memory: &mut Memory,
        _ports: &mut Ports,
    ) -> ControlFlow<()> {
        ControlFlow::Break(()) // it means that this pc cannot be handled
                               // ControlFlow::Continue(()) // otherwise
    }
    fn handle_call_hook(
        &mut self,
        _data: &mut Z80Data,
        _memory: &mut Memory,
        _ports: &mut Ports,
        _new_pc: u16,
        _old_pc: u16,
    ) -> ControlFlow<()> {
        // ControlFlow::Break(()) // override call
        ControlFlow::Continue(()) // continue to the original call
    }
    fn handle_ret_hook(&mut self, _data: &mut Z80Data, _memory: &mut Memory, _next_pc: u16) {}
}