src/mess/machine/apollo_kbd.c
| r14751 | r14752 | |
| 16 | 16 | #include "machine/apollo_kbd.h" |
| 17 | 17 | #include "sound/beep.h" |
| 18 | 18 | |
| 19 | | #if defined(__linux__) |
| 19 | #if defined(APOLLO_FOR_LINUX) |
| 20 | 20 | #include <unistd.h> |
| 21 | 21 | #include <fcntl.h> |
| 22 | 22 | #include <errno.h> |
| r14751 | r14752 | |
| 895 | 895 | /* C9 I */ 0x34, 0xB4, 0x69, 0x49, 0x09, 0x49, NOP, No, |
| 896 | 896 | /* C10 O */ 0x35, 0xB5, 0x6F, 0x4F, 0x0F, 0x4F, NOP, No, |
| 897 | 897 | /* C11 P */ 0x36, 0xB6, 0x70, 0x50, 0x10, 0x50, NOP, No, |
| 898 | | /* C12 { [ / ? */ 0x37, 0xB7, 0x7B, 0x5B, 0x1B, 0x7B, NOP, No, |
| 899 | | /* C13 } ] / ? */ 0x38, 0xB8, 0x7D, 0x5D, 0x1D, 0x7D, NOP, No, |
| 898 | /* C12 { [ / Ue */ 0x37, 0xB7, 0x7B, 0x5B, 0x1B, 0x7B, NOP, No, |
| 899 | /* C13 } ] / Oe */ 0x38, 0xB8, 0x7D, 0x5D, 0x1D, 0x7D, NOP, No, |
| 900 | 900 | /* D13 RETURN */ 0x52, 0xD2, 0xCB, 0xDB, NOP, 0xCB, NOP, No, |
| 901 | 901 | |
| 902 | 902 | /* D2 A */ 0x46, 0xC6, 0x61, 0x41, 0x01, 0x41, NOP, No, |
| r14751 | r14752 | |
| 909 | 909 | /* D9 K */ 0x4D, 0xCD, 0x6B, 0x4B, 0x0B, 0x4B, NOP, No, |
| 910 | 910 | /* D10 L */ 0x4E, 0xCE, 0x6C, 0x4C, 0x0C, 0x4C, NOP, No, |
| 911 | 911 | /* D11 : ; */ 0x4F, 0xCF, 0x3B, 0x3A, 0xFB, 0x3B, NOP, No, |
| 912 | | /* D12 " ' / ? */ 0x50, 0xD0, 0x27, 0x22, 0xF8, 0x27, NOP, No, |
| 912 | /* D12 " ' / Ae */ 0x50, 0xD0, 0x27, 0x22, 0xF8, 0x27, NOP, No, |
| 913 | 913 | /* D14 ! \ */ 0x53, 0xD3, 0xC8, 0xC9, NOP, 0xC8, NOP, No, |
| 914 | 914 | |
| 915 | 915 | /* E2 Z */ 0x60, 0xE0, 0x7A, 0x5A, 0x1A, 0x5A, NOP, No, |
src/mess/machine/apollo.c
| r14751 | r14752 | |
| 44 | 44 | |
| 45 | 45 | #include "emuopts.h" |
| 46 | 46 | |
| 47 | | #if 0 //defined(__linux__) |
| 47 | #if defined(APOLLO_FOR_LINUX) |
| 48 | 48 | #include <fcntl.h> |
| 49 | 49 | #include <unistd.h> |
| 50 | 50 | #endif |
| r14751 | r14752 | |
| 255 | 255 | else if ((data & APOLLO_CSR_CR_FPU_TRAP_ENABLE) == 0) |
| 256 | 256 | { |
| 257 | 257 | // enable FPU (i.e. FPU opcodes in CPU) |
| 258 | | // apollo_set_cpu_has_fpu(&space->device(), 1); |
| 258 | apollo_set_cpu_has_fpu(&space->device(), 1); |
| 259 | 259 | } |
| 260 | 260 | else |
| 261 | 261 | { |
| 262 | 262 | // disable FPU (i.e. FPU opcodes in CPU) |
| 263 | | // apollo_set_cpu_has_fpu(&space->device(), 0); |
| 263 | apollo_set_cpu_has_fpu(&space->device(), 0); |
| 264 | 264 | |
| 265 | 265 | if (!apollo_is_dn3000()) |
| 266 | 266 | { |
| r14751 | r14752 | |
| 1069 | 1069 | static TIMER_CALLBACK(kbd_timer_callback) |
| 1070 | 1070 | { |
| 1071 | 1071 | |
| 1072 | | #if 0 //defined(__linux__) |
| 1072 | #if defined(APOLLO_FOR_LINUX) |
| 1073 | 1073 | device_t *device = (device_t *) ptr; |
| 1074 | 1074 | UINT8 data; |
| 1075 | 1075 | |
| r14751 | r14752 | |
| 1127 | 1127 | sio_input_data = apollo_get_ram_config_byte(); |
| 1128 | 1128 | sio_output_data = 0xff; |
| 1129 | 1129 | |
| 1130 | | #if 0 //defined(__linux__) |
| 1130 | #if defined(APOLLO_FOR_LINUX) |
| 1131 | 1131 | // FIXME: unavailable in mingw |
| 1132 | 1132 | // set stdin to nonblocking to allow polling in sio_poll_rxb |
| 1133 | 1133 | fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL) | O_NONBLOCK); |
src/mess/machine/apollo_net.c
| r14751 | r14752 | |
| 41 | 41 | UINT32 daddr; |
| 42 | 42 | } ip_header; |
| 43 | 43 | |
| 44 | | typedef struct |
| 45 | | { |
| 46 | | UINT8 type; |
| 47 | | UINT8 code; |
| 48 | | UINT16 checksum; |
| 49 | | UINT16 id; |
| 50 | | UINT16 sequence; |
| 51 | | } icmp_header; |
| 52 | | |
| 53 | | //typedef struct { |
| 54 | | // UINT16 version; |
| 55 | | // UINT16 checksum; |
| 56 | | // UINT16 packet_type; |
| 57 | | // UINT16 control_header; |
| 58 | | // UINT16 header_length; |
| 59 | | // UINT16 header_data_length; |
| 60 | | // UINT16 transaction_id; |
| 61 | | //} control_header; |
| 62 | | // |
| 63 | | //typedef struct { |
| 64 | | // UINT16 length; |
| 65 | | // UINT16 current; |
| 66 | | // UINT16 source_socket; |
| 67 | | // UINT16 new_route; |
| 68 | | //} packet_address; |
| 69 | | |
| 70 | 44 | #define ETHERNET_HEADER_SIZE sizeof(ethernet_header) |
| 71 | 45 | |
| 72 | 46 | /* Ethernet protocol ID's */ |
| r14751 | r14752 | |
| 294 | 268 | return ETHERNET_HEADER_SIZE; |
| 295 | 269 | } |
| 296 | 270 | |
| 297 | | //static int set_packet_header1(UINT8 *packet_buffer, UINT32 dest_node_id, |
| 298 | | // UINT32 source_node_id) { |
| 299 | | // |
| 300 | | // //0000 08 00 1e 02 61 6d 08 00 1e 04 20 e8 80 19 ff ff |
| 301 | | // //0010 00 20 00 be 00 00 47 11 08 00 1e 02 61 6d 06 20 |
| 302 | | // //0020 00 00 00 00 08 00 1e 04 20 e8 00 01 00 02 61 6d |
| 303 | | // //0030 20 00 00 00 00 04 20 e8 02 00 20 00 00 4e 00 02 |
| 304 | | // //0040 00 00 00 00 2e 04 00 01 20 e8 00 01 00 04 20 e8 |
| 305 | | // |
| 306 | | // //0050 61 6d 06 20 ff ff 00 20 00 04 00 00 47 11 00 00 |
| 307 | | // //0060 00 02 61 6d 06 20 00 00 00 00 00 00 00 04 20 e8 |
| 308 | | // //0070 00 01 00 00 00 00 80 31 00 01 |
| 309 | | // |
| 310 | | // set_packet_header(packet_buffer, dest_node_id, source_node_id); |
| 311 | | // set_word(packet_buffer + 8, 0x4711); // Apollo network number |
| 312 | | // set_word(packet_buffer + 16, 0x0620); // ? was 0x0000 |
| 313 | | // set_word(packet_buffer + 28, 0x0001); // ? was 0x0003 |
| 314 | | |
| 315 | | // set_long(packet_buffer + 34, 0x20000000L); // ? was 0x24000000L |
| 316 | | // set_long(packet_buffer + 42, 0x02002000L); // ? was 0x01002400L |
| 317 | | // set_word(packet_buffer + 46, 0x004e); // ? data_size + 0x22 |
| 318 | | // set_word(packet_buffer + 48, 0x0002); // ? data_size |
| 319 | | // set_word(packet_buffer + 54, 0x2e04); // ? 0x0401 |
| 320 | | // set_word(packet_buffer + 56, 0x0001); // ? 0x0003 |
| 321 | | // set_word(packet_buffer + 60, 0x616d); |
| 322 | | // set_word(packet_buffer + 62, 0x0000); |
| 323 | | // return PACKET_HEADER_SIZE; |
| 324 | | //} |
| 325 | | |
| 326 | 271 | static int set_packet_header(UINT8 *packet_buffer, UINT32 dest_node_id, |
| 327 | 272 | UINT32 source_node_id) { |
| 328 | 273 | // --------- apollo header -------------- |
src/mess/includes/apollo.h
| r14751 | r14752 | |
| 43 | 43 | |
| 44 | 44 | #define MAINCPU "maincpu" |
| 45 | 45 | |
| 46 | | /*----------- debug/apollo.c -----------*/ |
| 46 | // Note: defining APOLLO_FOR_LINUX will provide following unportable extensions: |
| 47 | // * a real Apollo keyboard may be attached at /dev/ttyS0 |
| 48 | // * SIO1 of the DSP3x00 will be connected with stdout and stdin |
| 49 | // * the 3c505 emulation will be connected with the real ethernet at ETH0 |
| 50 | // |
| 51 | // Enabling this is >NOT< supported by MESSdev and this code will be removed. |
| 52 | // Do *not* report any issues on MESS Bugzilla if this is enabled! |
| 47 | 53 | |
| 54 | #if defined(__linux__) |
| 55 | //#define APOLLO_FOR_LINUX |
| 56 | #endif |
| 57 | |
| 58 | /*----------- machine/apollo_dbg.c -----------*/ |
| 59 | |
| 48 | 60 | int apollo_debug_instruction_hook(device_t *device, offs_t curpc); |
| 49 | 61 | |
| 50 | 62 | /*----------- drivers/apollo.c -----------*/ |
| r14751 | r14752 | |
| 97 | 109 | class apollo_state : public driver_device |
| 98 | 110 | { |
| 99 | 111 | public: |
| 100 | | // apollo_state(running_machine &machine, const driver_device_config_base &config) |
| 101 | | // : driver_device(machine, config) { } |
| 102 | | |
| 103 | 112 | apollo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 104 | 113 | : driver_device(mconfig, type, tag), |
| 105 | 114 | m_ctape(*this, APOLLO_CTAPE_TAG) |
src/mess/layout/apollo_dsp.lay
| r14751 | r14752 | |
| 9 | 9 | <element name="label_b"> <text string="B"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element> |
| 10 | 10 | <element name="label_c"> <text string="C"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element> |
| 11 | 11 | <element name="label_d"> <text string="D"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element> |
| 12 | | <element name="power_label"> <text string="PWR"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element> |
| 12 | <element name="power_label"> <text string="Pwr"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element> |
| 13 | <element name="text_1"> <text string="DOMAIN"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element> |
| 14 | <element name="text_2"> <text string="SERIES 3000"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element> |
| 13 | 15 | |
| 14 | 16 | <element name="background"> |
| 15 | 17 | <rect> |
| r14751 | r14752 | |
| 18 | 20 | </rect> |
| 19 | 21 | </element> |
| 20 | 22 | |
| 21 | | <view name="Apollo DSP Terminal"> |
| 23 | <view name="Terminal"> |
| 22 | 24 | <bezel element="background"> |
| 23 | 25 | <bounds left="0" right="639" top="480" bottom="502" /> |
| 24 | 26 | </bezel> |
| r14751 | r14752 | |
| 44 | 46 | </screen> |
| 45 | 47 | </view> |
| 46 | 48 | |
| 49 | <view name="Domain"> |
| 50 | <bezel element="background"> |
| 51 | <bounds left="0" right="49" top="0" bottom="49" /> |
| 52 | </bezel> |
| 53 | |
| 54 | <bezel name="text_1" element="text_1"> <bounds left=" 1" right="48" top=" 1" bottom="17" /> </bezel> |
| 55 | <bezel name="text_2" element="text_2"> <bounds left=" 1" right="48" top="18" bottom="27" /> </bezel> |
| 56 | |
| 57 | <bezel name="label_a" element="label_a"> <bounds left=" 2" right=" 6" top="36" bottom="42" /> </bezel> |
| 58 | <bezel name="label_b" element="label_b"> <bounds left="12" right="16" top="36" bottom="42" /> </bezel> |
| 59 | <bezel name="label_c" element="label_c"> <bounds left="22" right="26" top="36" bottom="42" /> </bezel> |
| 60 | <bezel name="label_d" element="label_d"> <bounds left="32" right="36" top="36" bottom="42" /> </bezel> |
| 61 | <bezel name="power_label" element="power_label"> <bounds left="38" right="49" top="36" bottom="42" /> </bezel> |
| 62 | |
| 63 | <bezel name="external_led_a" element="external_led"> <bounds left=" 2" right=" 6" top="43" bottom="47" /> </bezel> |
| 64 | <bezel name="external_led_b" element="external_led"> <bounds left="12" right="16" top="43" bottom="47" /> </bezel> |
| 65 | <bezel name="external_led_c" element="external_led"> <bounds left="22" right="26" top="43" bottom="47" /> </bezel> |
| 66 | <bezel name="external_led_d" element="external_led"> <bounds left="32" right="36" top="43" bottom="47" /> </bezel> |
| 67 | <bezel name="power_led" element="power_led"> <bounds left="42" right="46" top="43" bottom="47" /> </bezel> |
| 68 | |
| 69 | <screen index="0"> |
| 70 | <bounds x="0" y="0" width="0" height="0" /> |
| 71 | </screen> |
| 72 | </view> |
| 73 | |
| 47 | 74 | </mamelayout> |
src/mess/drivers/apollo.c
| r14751 | r14752 | |
| 143 | 143 | apollo_set_cpu_has_fpu - enable/disable the FPU |
| 144 | 144 | -------------------------------------------------*/ |
| 145 | 145 | |
| 146 | | /*void apollo_set_cpu_has_fpu(device_t *device, int onoff) |
| 146 | void apollo_set_cpu_has_fpu(device_t *device, int onoff) |
| 147 | 147 | { |
| 148 | 148 | if (device == NULL || (device->type() != M68020PMMU && device->type() != M68030)) |
| 149 | 149 | { |
| r14751 | r14752 | |
| 153 | 153 | { |
| 154 | 154 | m68ki_cpu_core *cpu = (m68ki_cpu_core *) downcast<legacy_cpu_device *> (device)->token(); |
| 155 | 155 | cpu->has_fpu = onoff; |
| 156 | | DLOG1(("set_cpu_has_fpu: FPU has been %s", onoff ? "enabled" : "disabled")); |
| 156 | DLOG1(("apollo_set_cpu_has_fpu: FPU has been %s", onoff ? "enabled" : "disabled")); |
| 157 | 157 | } |
| 158 | | }*/ |
| 158 | } |
| 159 | 159 | |
| 160 | 160 | /*************************************************************************** |
| 161 | 161 | apollo_check_log - check for excessive logging |
| r14751 | r14752 | |
| 534 | 534 | SLOG1(("unmapped memory dword read from %08x with mask %08x (ir=%04x)", address , mem_mask, m68k->ir)); |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | | // if (address == 0xfffffffc) { |
| 538 | | // // temporary hack for disp7d.dex @ 010456D8 |
| 539 | | // return 0xffffffff; |
| 540 | | // } |
| 541 | 537 | /* unmapped; access causes a bus error */ |
| 542 | 538 | apollo_bus_error(space->machine()); |
| 543 | | |
| 544 | 539 | return 0xffffffff; |
| 545 | 540 | } |
| 546 | 541 | |
| r14751 | r14752 | |
| 1048 | 1043 | |
| 1049 | 1044 | // reset non-CPU devices here |
| 1050 | 1045 | apollo->m_ctape->device_reset(); |
| 1046 | |
| 1047 | // HACK: should go through our devices and just reset those, not the entire machine object. |
| 1048 | device->machine().schedule_soft_reset(); |
| 1051 | 1049 | } |
| 1052 | 1050 | |
| 1053 | 1051 | /*************************************************************************** |
| r14751 | r14752 | |
| 1161 | 1159 | }; |
| 1162 | 1160 | |
| 1163 | 1161 | static WRITE8_DEVICE_HANDLER( terminal_kbd_putchar ) { |
| 1164 | | apollo_sio_rx_data(device->machine().device(APOLLO_SIO_TAG), 1, data); |
| 1162 | // put input character from terminal to the RS232 sio (i.e. sio1) |
| 1163 | DLOG1(("terminal_kbd_putchar: 0x%02x", data)); |
| 1164 | // FIXME: as of mess0145u1, terminal.c will append a null character after each input character |
| 1165 | if (data != 0) |
| 1166 | { |
| 1167 | apollo_sio_rx_data(device->machine().device(APOLLO_SIO_TAG), 1, data); |
| 1168 | } |
| 1165 | 1169 | } |
| 1166 | 1170 | |
| 1167 | 1171 | static GENERIC_TERMINAL_INTERFACE( apollo_terminal_config ) { |