src/mess/video/dl1416.c
| r5078 | r5079 | |
| 23 | 23 | * - 2008-02-25: Converted to the new device interface. [Dirk Best] |
| 24 | 24 | * - 2008-12-18: Cleanups. [Dirk Best] |
| 25 | 25 | * |
| 26 | | * |
| 26 | * |
| 27 | 27 | * We use the following order for the segments: |
| 28 | 28 | * |
| 29 | 29 | * 000 111 |
| r5078 | r5079 | |
| 181 | 181 | *****************************************************************************/ |
| 182 | 182 | |
| 183 | 183 | /* write enable, active low */ |
| 184 | | void dl1416_set_input_w(const device_config *device, int data) |
| 184 | WRITE_LINE_DEVICE_HANDLER( dl1416_wr_w ) |
| 185 | 185 | { |
| 186 | 186 | dl1416_state *chip = get_safe_token(device); |
| 187 | | chip->write_enable = !data; |
| 187 | chip->write_enable = !state; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | | |
| 191 | 190 | /* chip enable, active low */ |
| 192 | | void dl1416_set_input_ce(const device_config *device, int data) |
| 191 | WRITE_LINE_DEVICE_HANDLER( dl1416_ce_w ) |
| 193 | 192 | { |
| 194 | 193 | dl1416_state *chip = get_safe_token(device); |
| 195 | | chip->chip_enable = !data; |
| 194 | chip->chip_enable = !state; |
| 196 | 195 | } |
| 197 | 196 | |
| 198 | | |
| 199 | 197 | /* cursor enable, active low */ |
| 200 | | void dl1416_set_input_cu(const device_config *device, int data) |
| 198 | WRITE_LINE_DEVICE_HANDLER( dl1416_cu_w ) |
| 201 | 199 | { |
| 202 | 200 | dl1416_state *chip = get_safe_token(device); |
| 203 | | chip->cursor_enable = !data; |
| 201 | chip->cursor_enable = !state; |
| 204 | 202 | } |
| 205 | 203 | |
| 206 | | |
| 207 | 204 | /* data */ |
| 208 | | WRITE8_DEVICE_HANDLER( dl1416_w ) |
| 205 | WRITE8_DEVICE_HANDLER( dl1416_data_w ) |
| 209 | 206 | { |
| 210 | 207 | dl1416_state *chip = get_safe_token(device); |
| 211 | 208 | const dl1416_interface *intf = device->inline_config; |
src/mess/video/dl1416.h
| r5078 | r5079 | |
| 14 | 14 | #ifndef DL1416_H_ |
| 15 | 15 | #define DL1416_H_ |
| 16 | 16 | |
| 17 | #include "devcb.h" |
| 17 | 18 | |
| 19 | |
| 18 | 20 | /*************************************************************************** |
| 19 | 21 | CONSTANTS |
| 20 | 22 | ***************************************************************************/ |
| r5078 | r5079 | |
| 62 | 64 | ***************************************************************************/ |
| 63 | 65 | |
| 64 | 66 | /* inputs */ |
| 65 | | void dl1416_set_input_w(const device_config *device, int data); /* write enable */ |
| 66 | | void dl1416_set_input_ce(const device_config *device, int data); /* chip enable */ |
| 67 | | void dl1416_set_input_cu(const device_config *device, int data); /* cursor enable */ |
| 68 | | WRITE8_DEVICE_HANDLER( dl1416_w ); |
| 67 | WRITE_LINE_DEVICE_HANDLER( dl1416_wr_w ); /* write enable */ |
| 68 | WRITE_LINE_DEVICE_HANDLER( dl1416_ce_w ); /* chip enable */ |
| 69 | WRITE_LINE_DEVICE_HANDLER( dl1416_cu_w ); /* cursor enable */ |
| 70 | WRITE8_DEVICE_HANDLER( dl1416_data_w ); |
| 69 | 71 | |
| 70 | 72 | /* device get info callback */ |
| 71 | 73 | #define DL1416 DEVICE_GET_INFO_NAME(dl1416) |
src/mess/machine/aim65.c
| r5078 | r5079 | |
| 65 | 65 | |
| 66 | 66 | static void dl1416_update(const device_config *device, int index) |
| 67 | 67 | { |
| 68 | | dl1416_set_input_ce(device, pia_a & (0x04 << index)); |
| 69 | | dl1416_set_input_w(device, pia_a & 0x80); |
| 70 | | dl1416_set_input_cu(device, pia_b & 0x80); |
| 71 | | dl1416_w(device, pia_a & 0x03, pia_b & 0x7f); |
| 68 | dl1416_ce_w(device, pia_a & (0x04 << index)); |
| 69 | dl1416_wr_w(device, BIT(pia_a, 7)); |
| 70 | dl1416_cu_w(device, BIT(pia_b, 7)); |
| 71 | dl1416_data_w(device, pia_a & 0x03, pia_b & 0x7f); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static void aim65_pia(running_machine *machine) |