src/mess/drivers/tmc2000e.c
| r2396 | r2397 | |
| 1 | 1 | #include "driver.h" |
| 2 | | #include "deprecat.h" |
| 3 | 2 | #include "cpu/cdp1802/cdp1802.h" |
| 4 | 3 | #include "devices/printer.h" |
| 5 | 4 | #include "devices/basicdsk.h" |
| r2396 | r2397 | |
| 94 | 93 | |
| 95 | 94 | /* CDP1802 Interface */ |
| 96 | 95 | |
| 97 | | static UINT8 tmc2000e_mode_r(void) |
| 96 | static CDP1802_MODE_READ( tmc2000e_mode_r ) |
| 98 | 97 | { |
| 99 | | if (input_port_read(Machine, "RUN") & 0x01) |
| 98 | if (input_port_read(machine, "RUN") & 0x01) |
| 100 | 99 | { |
| 101 | 100 | return CDP1802_MODE_RUN; |
| 102 | 101 | } |
| r2396 | r2397 | |
| 106 | 105 | } |
| 107 | 106 | } |
| 108 | 107 | |
| 109 | | static UINT8 tmc2000e_ef_r(void) |
| 108 | static CDP1802_EF_READ( tmc2000e_ef_r ) |
| 110 | 109 | { |
| 111 | 110 | UINT8 flags = 0x0f; |
| 112 | 111 | char port[4]; |
| r2396 | r2397 | |
| 120 | 119 | |
| 121 | 120 | // keyboard |
| 122 | 121 | sprintf(port, "IN%d", keylatch / 8); |
| 123 | | if (~input_port_read(Machine, port) & (1 << (keylatch % 8))) flags -= EF3; |
| 122 | if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF3; |
| 124 | 123 | |
| 125 | 124 | return flags; |
| 126 | 125 | } |
| 127 | 126 | |
| 128 | | static void tmc2000e_q_w(int level) |
| 127 | static CDP1802_Q_WRITE( tmc2000e_q_w ) |
| 129 | 128 | { |
| 130 | 129 | // CDP1864 sound generator on/off |
| 131 | 130 | cdp1864_audio_output_enable(level); |
| r2396 | r2397 | |
| 139 | 138 | // floppy control (FDC-6) |
| 140 | 139 | } |
| 141 | 140 | |
| 142 | | static const CDP1802_CONFIG tmc2000e_config = |
| 141 | static const cdp1802_interface tmc2000e_config = |
| 143 | 142 | { |
| 144 | 143 | tmc2000e_mode_r, |
| 145 | 144 | tmc2000e_ef_r, |
src/mess/drivers/tmc1800.c
| r2396 | r2397 | |
| 86 | 86 | */ |
| 87 | 87 | |
| 88 | 88 | #include "driver.h" |
| 89 | | #include "deprecat.h" |
| 90 | 89 | #include "cpu/cdp1802/cdp1802.h" |
| 91 | 90 | #include "video/cdp1864.h" |
| 92 | 91 | #include "devices/cassette.h" |
| r2396 | r2397 | |
| 169 | 168 | |
| 170 | 169 | // Telmac 1800 |
| 171 | 170 | |
| 172 | | static UINT8 tmc1800_mode_r(void) |
| 171 | static CDP1802_MODE_READ( tmc1800_mode_r ) |
| 173 | 172 | { |
| 174 | | if (input_port_read(Machine, "RUN") & 0x01) |
| 173 | if (input_port_read(machine, "RUN") & 0x01) |
| 175 | 174 | { |
| 176 | 175 | return CDP1802_MODE_RUN; |
| 177 | 176 | } |
| r2396 | r2397 | |
| 181 | 180 | } |
| 182 | 181 | } |
| 183 | 182 | |
| 184 | | static UINT8 tmc1800_ef_r(void) |
| 183 | static CDP1802_EF_READ( tmc1800_ef_r ) |
| 185 | 184 | { |
| 186 | 185 | UINT8 flags = 0x0f; |
| 187 | 186 | char port[4]; |
| r2396 | r2397 | |
| 195 | 194 | |
| 196 | 195 | // keyboard |
| 197 | 196 | sprintf(port, "IN%d", keylatch / 8); |
| 198 | | if (~input_port_read(Machine, port) & (1 << (keylatch % 8))) flags -= EF2; |
| 197 | if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF2; |
| 199 | 198 | |
| 200 | 199 | return flags; |
| 201 | 200 | } |
| 202 | 201 | |
| 203 | | static void tmc1800_q_w(int level) |
| 202 | static CDP1802_Q_WRITE( tmc1800_q_w ) |
| 204 | 203 | { |
| 205 | 204 | } |
| 206 | 205 | |
| 207 | | static const CDP1802_CONFIG tmc1800_config = |
| 206 | static const cdp1802_interface tmc1800_config = |
| 208 | 207 | { |
| 209 | 208 | tmc1800_mode_r, |
| 210 | 209 | tmc1800_ef_r, |
| r2396 | r2397 | |
| 216 | 215 | |
| 217 | 216 | // Telmac 2000 |
| 218 | 217 | |
| 219 | | static UINT8 tmc2000_ef_r(void) |
| 218 | static CDP1802_EF_READ( tmc2000_ef_r ) |
| 220 | 219 | { |
| 221 | 220 | int flags = 0x0f; |
| 222 | 221 | char port[4]; |
| r2396 | r2397 | |
| 230 | 229 | |
| 231 | 230 | // keyboard |
| 232 | 231 | sprintf(port, "IN%d", keylatch / 8); |
| 233 | | if (~input_port_read(Machine, port) & (1 << (keylatch % 8))) flags -= EF2; |
| 232 | if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF2; |
| 234 | 233 | |
| 235 | 234 | return flags; |
| 236 | 235 | } |
| 237 | 236 | |
| 238 | | static void tmc2000_q_w(int level) |
| 237 | static CDP1802_Q_WRITE( tmc2000_q_w ) |
| 239 | 238 | { |
| 240 | 239 | // turn CDP1864 sound generator on/off |
| 241 | 240 | cdp1864_audio_output_enable(level); |
| r2396 | r2397 | |
| 244 | 243 | set_led_status(1, level); |
| 245 | 244 | } |
| 246 | 245 | |
| 247 | | static const CDP1802_CONFIG tmc2000_config = |
| 246 | static const cdp1802_interface tmc2000_config = |
| 248 | 247 | { |
| 249 | 248 | tmc1800_mode_r, |
| 250 | 249 | tmc2000_ef_r, |