1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use crate::cpu::{CPU, R};
use crate::machine::Component;
use crate::memory::MMU;

pub struct Mouse {
}

impl Component for Mouse {
    fn int(&mut self, int: u8, cpu: &mut CPU, _mmu: &mut MMU) -> bool {
        if int != 0x33 {
            return false;
        }
        match cpu.get_r16(R::AX) {
            0x0003 => {
                // MS MOUSE v1.0+ - RETURN POSITION AND BUTTON STATUS
                // Return:
                // BX = button status (see #03168)
                // CX = column
                // DX = row
                // Note: In text modes, all coordinates are specified as multiples of the cell size, typically 8x8 pixels 
                println!("XXX impl MOUSE - RETURN POSITION AND BUTTON STATUS");
            }
            _ => return false
        }
        true
    }
}

/// Implements a PS/2 Mouse
/// https://wiki.osdev.org/Mouse_Input
impl Mouse {
    pub fn default() -> Self {
        Self {
        }
    }
}