void ikbd_reset(void) { static const char cmd[2] = { 0x80, 0x01 }; ikbd_write(cmd, 2); }
void ikbd_mem_read(int address, char data[6]) { char cmd[3] = { 0x21, address>>8, address&0xFF }; ikbd_write(cmd, 3); }
/* Memory read */ void ikbd_mem_read(int address, char data[6]) { char cmd[3] = { 0x21, address>>8, address&0xFF }; ikbd_write(cmd, 3); /* receive data and put it in data */ }
/* Interrogate mouse position */ void ikbd_mouse_pos_get(int *x, int *y) { static const char cmd[1] = { 0x0D }; ikbd_write(cmd, 1); /* wait for returning bytes */ }
/* Set joystick monitoring */ void ikbd_joystick_monitor(int rate) { static const char cmd[2] = { 0x17, rate }; ikbd_write(cmd, 2); kb_state.state = JOYSTICK_MONITOR; }
void ikbd_mouse_pos_get(int *x, int *y) { static const char cmd[1] = { 0x0D }; ikbd_write(cmd, 1); }
/* Reset (without touching the clock) */ void ikbd_reset(void) { static const char cmd[2] = { 0x80, 0x01 }; ikbd_write(cmd, 2); /* if all's well code 0xF1 is returned, else the break codes of all keys making contact */ }
/* Disable joysticks */ void ikbd_joystick_disable(void) { static const char cmd[1] = { 0x1A }; ikbd_write(cmd, 1); }
/* Time-of-day clock set */ void ikbd_clock_set(int year, int month, int day, int hour, int minute, int second) { char cmd[7] = { 0x1B, year, month, day, hour, minute, second }; ikbd_write(cmd, 7); }
/* Joystick interrogation */ void ikbd_joystick_get_state(void) { static const char cmd[1] = { 0x16 }; ikbd_write(cmd, 1); }
/* Set relative mouse position reporting */ void ikbd_mouse_rel_pos(void) { static const char cmd[1] = { 0x08 }; ikbd_write(cmd, 1); }
/* Pause output */ void ikbd_pause(void) { static const char cmd[1] = { 0x13 }; ikbd_write(cmd, 1); }
/* Set joystick interrogation mode */ void ikbd_joystick_event_off(void) { static const char cmd[1] = { 0x15 }; ikbd_write(cmd, 1); }
/* Resume */ void ikbd_resume(void) { static const char cmd[1] = { 0x11 }; ikbd_write(cmd, 1); }
/* Set mouse threshold */ void ikbd_mouse_thresh(int x, int y) { char cmd[3] = { 0x0B, x, y }; ikbd_write(cmd, 3); }
/* Controller execute */ void ikbd_exec(int address) { char cmd[3] = { 0x22, address>>8, address&0xFF }; ikbd_write(cmd, 3); }
/* Set mouse button action */ void ikbd_mouse_button_action(int mode) { char cmd[2] = { 0x07, mode }; ikbd_write(cmd, 2); }
/* Load mouse position */ void ikbd_mouse_pos_set(int x, int y) { char cmd[6] = { 0x0E, 0x00, x>>8, x&0xFF, y>>8, y&0xFF }; ikbd_write(cmd, 6); }
/* Set absolute mouse position reporting */ void ikbd_mouse_abs_pos(int xmax, int ymax) { char cmd[5] = { 0x09, xmax>>8, xmax&0xFF, ymax>>8, ymax&0xFF }; ikbd_write(cmd, 5); }
/* Set mouse scale */ void ikbd_mouse_scale(int x, int y) { char cmd[3] = { 0x0C, x, y }; ikbd_write(cmd, 3); }
/* Interrogate time-of-day clock */ void ikbd_clock_get(int *year, int *month, int *day, int *hour, int *minute, int second) { static const char cmd[1] = { 0x1C }; ikbd_write(cmd, 1); }
/* Disable mouse */ void ikbd_mouse_disable(void) { static const char cmd[1] = { 0x12 }; ikbd_write(cmd, 1); }
/* Set Y=0 at bottom */ void ikbd_mouse_y0_bot(void) { static const char cmd[1] = { 0x0F }; ikbd_write(cmd, 1); }
/* Set mouse keycode mode */ void ikbd_mouse_kbd_mode(int dx, int dy) { char cmd[3] = { 0x0A, dx, dy }; ikbd_write(cmd, 3); }
/* Set the state of the caps lock led. */ void atari_kbd_leds (unsigned int leds) { char cmd[6] = {32, 0, 4, 1, 254 + ((leds & 4) != 0), 0}; ikbd_write(cmd, 6); }
/* Set Y=0 at top */ void ikbd_mouse_y0_top(void) { static const char cmd[1] = { 0x10 }; ikbd_write(cmd, 1); }