Sim68K Peripheral I/O


TRAP #15 is used for I/O.  Put the task number in D0.

The output screen resolution is adjustable via Task 33. The top left corner of the window is position 0,0

 Task

 60

  Enable/Disable mouse IRQ
  An IRQ is created when a mouse button is pressed or released in the output window.
  D1.W High Byte = IRQ level (1-7), 0 to turn off
  D1.W Low Byte = 1 in the corresponding bit to indicate which mouse event triggers IRQ where:
                             Bit2 = Move, Bit1 = button Up, Bit0 = button Down
  (Example D1.W = $0107, Enable mouse IRQ level 1 for Move, button Up and button Down)
  (Example D1.W = $0002, Disable mouse IRQ for button Up)

 61   Mouse Read
  Pre: D1.B = 00 to read current state of mouse
                 = 01 to read mouse up state
                 = 02 to read mouse down state
  Post: The mouse data is contained in the following registers:
         D0 as bits = Ctrl, Alt, Shift, Double, Middle, Right, Left
            Left is Bit0, Right is Bit 1 etc. 1 = true, 0 = false
            Shift, Alt, Ctrl represent the state of the corresponding keys.
         D1.L = 16 bits Y, 16 bits X in pixel coordinates. (0,0 is top left)
 62   Enable/Disable keyboard IRQ
  An IRQ is created when a key is pressed or released in the output window.
  D1.W High Byte = IRQ level (1-7), 0 to turn off
  D1.W Low Byte = 1 in the corresponding bit to indicate which keyboard event triggers IRQ where:
                             Bit1 = key Up, Bit0 = key Down
  (Example D1.W = $0103, Enable keyboard IRQ level 1 for key Up and key Down)
  (Example D1.W = $0002, Disable keyboard IRQ for key Up)
  Read the last key down or key up with trap task #19.