Mercurial > repos > blastem
comparison io.h @ 2053:3414a4423de1 segacd
Merge from default
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 15 Jan 2022 13:15:21 -0800 |
parents | 0f54a898db03 |
children | 93918a6a8ab7 |
comparison
equal
deleted
inserted
replaced
1692:5dacaef602a7 | 2053:3414a4423de1 |
---|---|
22 IO_JUSTIFIER, | 22 IO_JUSTIFIER, |
23 IO_SEGA_MULTI, | 23 IO_SEGA_MULTI, |
24 IO_EA_MULTI_A, | 24 IO_EA_MULTI_A, |
25 IO_EA_MULTI_B, | 25 IO_EA_MULTI_B, |
26 IO_SEGA_PARALLEL, | 26 IO_SEGA_PARALLEL, |
27 IO_GENERIC | 27 IO_GENERIC, |
28 IO_GENERIC_SERIAL, | |
29 IO_HEARTBEAT_TRAINER | |
28 }; | 30 }; |
29 | 31 |
30 typedef struct { | 32 typedef struct { |
31 union { | 33 union { |
32 struct { | 34 struct { |
55 uint8_t write_pos; | 57 uint8_t write_pos; |
56 uint8_t tr_counter; | 58 uint8_t tr_counter; |
57 uint8_t mode; | 59 uint8_t mode; |
58 uint8_t cmd; | 60 uint8_t cmd; |
59 } keyboard; | 61 } keyboard; |
62 struct { | |
63 uint8_t *nv_memory; | |
64 uint8_t *cur_buffer; | |
65 uint64_t rtc_base_timestamp; | |
66 uint8_t rtc_base[5]; | |
67 uint8_t bpm; | |
68 uint8_t cadence; | |
69 uint8_t buttons; | |
70 uint8_t nv_page_size; | |
71 uint8_t nv_pages; | |
72 uint8_t param; | |
73 uint8_t state; | |
74 uint8_t status; | |
75 uint8_t device_num; | |
76 uint8_t cmd; | |
77 uint8_t remaining_bytes; | |
78 } heartbeat_trainer; | |
60 } device; | 79 } device; |
61 uint8_t output; | 80 uint8_t output; |
62 uint8_t control; | 81 uint8_t control; |
63 uint8_t input[3]; | 82 uint8_t input[3]; |
64 uint32_t slow_rise_start[8]; | 83 uint32_t slow_rise_start[8]; |
84 uint32_t serial_cycle; | |
85 uint32_t serial_divider; | |
86 uint32_t last_poll_cycle; | |
87 uint32_t transmit_end; | |
88 uint32_t receive_end; | |
65 uint8_t serial_out; | 89 uint8_t serial_out; |
90 uint8_t serial_transmitting; | |
66 uint8_t serial_in; | 91 uint8_t serial_in; |
92 uint8_t serial_receiving; | |
67 uint8_t serial_ctrl; | 93 uint8_t serial_ctrl; |
68 uint8_t device_type; | 94 uint8_t device_type; |
69 } io_port; | 95 } io_port; |
70 | 96 |
71 typedef struct { | 97 typedef struct { |
104 PSEUDO_BUTTON_MOTION=0xFF | 130 PSEUDO_BUTTON_MOTION=0xFF |
105 }; | 131 }; |
106 | 132 |
107 void setup_io_devices(tern_node * config, rom_info *rom, sega_io *io); | 133 void setup_io_devices(tern_node * config, rom_info *rom, sega_io *io); |
108 void io_adjust_cycles(io_port * pad, uint32_t current_cycle, uint32_t deduction); | 134 void io_adjust_cycles(io_port * pad, uint32_t current_cycle, uint32_t deduction); |
135 void io_run(io_port *port, uint32_t current_cycle); | |
109 void io_control_write(io_port *port, uint8_t value, uint32_t current_cycle); | 136 void io_control_write(io_port *port, uint8_t value, uint32_t current_cycle); |
110 void io_data_write(io_port * pad, uint8_t value, uint32_t current_cycle); | 137 void io_data_write(io_port * pad, uint8_t value, uint32_t current_cycle); |
138 void io_tx_write(io_port *port, uint8_t value, uint32_t current_cycle); | |
139 void io_sctrl_write(io_port *port, uint8_t value, uint32_t current_cycle); | |
111 uint8_t io_data_read(io_port * pad, uint32_t current_cycle); | 140 uint8_t io_data_read(io_port * pad, uint32_t current_cycle); |
141 uint8_t io_rx_read(io_port * port, uint32_t current_cycle); | |
142 uint8_t io_sctrl_read(io_port *port, uint32_t current_cycle); | |
143 uint32_t io_next_interrupt(io_port *port, uint32_t current_cycle); | |
112 void io_serialize(io_port *port, serialize_buffer *buf); | 144 void io_serialize(io_port *port, serialize_buffer *buf); |
113 void io_deserialize(deserialize_buffer *buf, void *vport); | 145 void io_deserialize(deserialize_buffer *buf, void *vport); |
114 | 146 |
115 void io_port_gamepad_down(io_port *port, uint8_t button); | 147 void io_port_gamepad_down(io_port *port, uint8_t button); |
116 void io_port_gamepad_up(io_port *port, uint8_t button); | 148 void io_port_gamepad_up(io_port *port, uint8_t button); |