Previous 15994 Revisions Next

r14752 Tuesday 13th March, 2012 at 02:20:02 UTC by R. Belmont
m68k: allow FPU instructions on '020 (it's possible to have an external 68881/882) and fix missing break; in the FPU [Hans Ostermeyer]

Apollo: various cleanups [Hans Ostermeyer, R. Belmont]
[src/emu/cpu/m68000]m68k_in.c m68kfpu.c
[src/mess/drivers]apollo.c
[src/mess/includes]apollo.h
[src/mess/layout]apollo_dsp.lay
[src/mess/machine]apollo.c apollo_eth.c apollo_kbd.c apollo_net.c

src/emu/cpu/m68000/m68kfpu.c
r14751r14752
13701370         REG_FP(m68k)[dst] = double_to_fx80((double)temp2);
13711371         SET_CONDITION_CODES(m68k, REG_FP(m68k)[dst]);
13721372         m68k->remaining_cycles -= 6;
1373         break;
13731374      }
13741375      case 0x20:      // FDIV
13751376      {
src/emu/cpu/m68000/m68k_in.c
r14751r14752
367367M68KMAKE_TABLE_START
3683681010       0  .     .     1010............  ..........  U U U U U U U   4   4   4   4   4   4   4
3693691111       0  .     .     1111............  ..........  U U U U U U U   4   4   4   4   4   4   4
370040fpu0   32  .     .     11110010........  ..........  . . . U U U .   .   .   .   0   0   0   .
371040fpu1   32  .     .     11110011........  ..........  . . . U U U .   .   .   .   0   0   0   .
370040fpu0   32  .     .     11110010........  ..........  . . U U U U .   .   .   0   0   0   0   .
371040fpu1   32  .     .     11110011........  ..........  . . U U U U .   .   .   0   0   0   0   .
372372abcd       8  rr    .     1100...100000...  ..........  U U U U U U U   6   6   4   4   4   4   4
373373abcd       8  mm    ax7   1100111100001...  ..........  U U U U U U U  18  18  16  16  16  16  16
374374abcd       8  mm    ay7   1100...100001111  ..........  U U U U U U U  18  18  16  16  16  16  16
src/mess/machine/apollo_kbd.c
r14751r14752
1616#include "machine/apollo_kbd.h"
1717#include "sound/beep.h"
1818
19#if defined(__linux__)
19#if defined(APOLLO_FOR_LINUX)
2020#include <unistd.h>
2121#include <fcntl.h>
2222#include <errno.h>
r14751r14752
895895        /* C9      I           */ 0x34, 0xB4, 0x69,     0x49,   0x09,   0x49,     NOP,     No,
896896        /* C10     O           */ 0x35, 0xB5, 0x6F,     0x4F,   0x0F,   0x4F,     NOP,     No,
897897        /* 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,
900900        /* D13     RETURN      */ 0x52, 0xD2, 0xCB,     0xDB,   NOP,    0xCB,     NOP,     No,
901901
902902        /* D2      A           */ 0x46, 0xC6, 0x61,     0x41,   0x01,   0x41,     NOP,     No,
r14751r14752
909909        /* D9      K           */ 0x4D, 0xCD, 0x6B,     0x4B,   0x0B,   0x4B,     NOP,     No,
910910        /* D10     L           */ 0x4E, 0xCE, 0x6C,     0x4C,   0x0C,   0x4C,     NOP,     No,
911911        /* 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,
913913        /* D14     ! \         */ 0x53, 0xD3, 0xC8,     0xC9,   NOP,    0xC8,     NOP,     No,
914914
915915        /* E2      Z           */ 0x60, 0xE0, 0x7A,     0x5A,   0x1A,   0x5A,     NOP,     No,
src/mess/machine/apollo.c
r14751r14752
4444
4545#include "emuopts.h"
4646
47#if 0 //defined(__linux__)
47#if defined(APOLLO_FOR_LINUX)
4848#include <fcntl.h>
4949#include <unistd.h>
5050#endif
r14751r14752
255255   else if ((data & APOLLO_CSR_CR_FPU_TRAP_ENABLE) == 0)
256256   {
257257      // 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);
259259   }
260260   else
261261   {
262262      // 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);
264264
265265      if (!apollo_is_dn3000())
266266      {
r14751r14752
10691069static TIMER_CALLBACK(kbd_timer_callback)
10701070{
10711071
1072#if 0 //defined(__linux__)
1072#if defined(APOLLO_FOR_LINUX)
10731073   device_t *device = (device_t *) ptr;
10741074   UINT8 data;
10751075
r14751r14752
11271127   sio_input_data = apollo_get_ram_config_byte();
11281128   sio_output_data = 0xff;
11291129
1130#if 0 //defined(__linux__)
1130#if defined(APOLLO_FOR_LINUX)
11311131   // FIXME: unavailable in mingw
11321132   // set stdin to nonblocking to allow polling in sio_poll_rxb
11331133   fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL) | O_NONBLOCK);
src/mess/machine/apollo_eth.c
r14751r14752
2020
2121#include "includes/apollo.h"
2222
23#if 1
23#if !defined(APOLLO_FOR_LINUX)
2424
2525int apollo_eth_transmit(device_t *device, const UINT8 data[], int length)
2626{
r14751r14752
3636{
3737}
3838
39#else  /* __linux__ */
39#else  /* defined(APOLLO_FOR_LINUX) */
4040
4141#include "machine/3c505.h"
4242
r14751r14752
347347      }
348348   }
349349}
350#endif /* __linux__ */
350#endif /* defined(APOLLO_FOR_LINUX) */
src/mess/machine/apollo_net.c
r14751r14752
4141   UINT32 daddr;
4242} ip_header;
4343
44typedef 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
7044#define ETHERNET_HEADER_SIZE sizeof(ethernet_header)
7145
7246/* Ethernet protocol ID's */
r14751r14752
294268   return ETHERNET_HEADER_SIZE;
295269}
296270
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
326271static int set_packet_header(UINT8 *packet_buffer, UINT32 dest_node_id,
327272      UINT32 source_node_id) {
328273   // --------- apollo header --------------
src/mess/includes/apollo.h
r14751r14752
4343
4444#define  MAINCPU "maincpu"
4545
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!
4753
54#if defined(__linux__)
55//#define APOLLO_FOR_LINUX
56#endif
57
58/*----------- machine/apollo_dbg.c -----------*/
59
4860int apollo_debug_instruction_hook(device_t *device, offs_t curpc);
4961
5062/*----------- drivers/apollo.c -----------*/
r14751r14752
97109class apollo_state : public driver_device
98110{
99111public:
100//  apollo_state(running_machine &machine, const driver_device_config_base &config)
101//      : driver_device(machine, config) { }
102
103112   apollo_state(const machine_config &mconfig, device_type type, const char *tag)
104113         : driver_device(mconfig, type, tag),
105114            m_ctape(*this, APOLLO_CTAPE_TAG)
src/mess/layout/apollo_dsp.lay
r14751r14752
99   <element name="label_b">      <text string="B"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
1010   <element name="label_c">      <text string="C"> <color red="1.0" green="1.0" blue="1.0" /> </text> </element>
1111   <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>
1315
1416   <element name="background">
1517      <rect>
r14751r14752
1820      </rect>
1921   </element>
2022
21   <view name="Apollo DSP Terminal">
23   <view name="Terminal">
2224      <bezel element="background">
2325         <bounds left="0" right="639" top="480" bottom="502" />
2426      </bezel>
r14751r14752
4446      </screen>
4547   </view>
4648
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
4774</mamelayout>
src/mess/drivers/apollo.c
r14751r14752
143143 apollo_set_cpu_has_fpu - enable/disable the FPU
144144 -------------------------------------------------*/
145145
146/*void apollo_set_cpu_has_fpu(device_t *device, int onoff)
146void apollo_set_cpu_has_fpu(device_t *device, int onoff)
147147{
148148    if (device == NULL || (device->type() != M68020PMMU && device->type() != M68030))
149149    {
r14751r14752
153153    {
154154        m68ki_cpu_core *cpu = (m68ki_cpu_core *) downcast<legacy_cpu_device *> (device)->token();
155155        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"));
157157    }
158}*/
158}
159159
160160/***************************************************************************
161161 apollo_check_log - check for excessive logging
r14751r14752
534534      SLOG1(("unmapped memory dword read from %08x with mask %08x (ir=%04x)", address , mem_mask, m68k->ir));
535535   }
536536
537//  if (address == 0xfffffffc) {
538//      // temporary hack for disp7d.dex @ 010456D8
539//      return  0xffffffff;
540//  }
541537   /* unmapped; access causes a bus error */
542538   apollo_bus_error(space->machine());
543
544539   return 0xffffffff;
545540}
546541
r14751r14752
10481043
10491044    // reset non-CPU devices here
10501045    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();
10511049}
10521050
10531051/***************************************************************************
r14751r14752
11611159};
11621160
11631161static 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   }
11651169}
11661170
11671171static GENERIC_TERMINAL_INTERFACE( apollo_terminal_config ) {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team