Previous 199869 Revisions Next

r26665 Friday 20th December, 2013 at 03:30:14 UTC by R. Belmont
(MESS) Rainbow 100 updates: [Bavarese]
- added DEC-190-B model
- preliminary floppy (TD0 / IMG)
- corrected LK201 keyboard matrix (C12, Do + cursor keys)
- MHFU changes; character display speedups
- nicer bezel with 'C' + 'D' drive leds
[src/emu/imagedev]flopdrv.h
[src/mess]mess.lst
[src/mess/drivers]rainbow.c
[src/mess/layout]rainbow.lay
[src/mess/machine]dec_lk201.c dec_lk201.h
[src/mess/video]vtvideo.c vtvideo.h

trunk/src/emu/imagedev/flopdrv.h
r26664r26665
3434#define FLOPPY_STANDARD_5_25_SSSD    { FLOPPY_DRIVE_5_25_INCH, 1, 42, FLOPPY_DRIVE_SD }
3535#define FLOPPY_STANDARD_5_25_DSSD    { FLOPPY_DRIVE_5_25_INCH, 2, 42, FLOPPY_DRIVE_SD }
3636#define FLOPPY_STANDARD_5_25_SSDD_40 { FLOPPY_DRIVE_5_25_INCH, 1, 42, FLOPPY_DRIVE_DD }
37#define FLOPPY_STANDARD_5_25_SSDD_80 { FLOPPY_DRIVE_5_25_INCH, 1, 83, FLOPPY_DRIVE_DD }
3738#define FLOPPY_STANDARD_5_25_DSDD_40 { FLOPPY_DRIVE_5_25_INCH, 2, 42, FLOPPY_DRIVE_DD }
3839#define FLOPPY_STANDARD_5_25_SSDD    { FLOPPY_DRIVE_5_25_INCH, 1, 83, FLOPPY_DRIVE_DD }
3940#define FLOPPY_STANDARD_5_25_DSDD    { FLOPPY_DRIVE_5_25_INCH, 2, 83, FLOPPY_DRIVE_DD }
trunk/src/mess/machine/dec_lk201.c
r26664r26665
55    This is the later "cost-reduced" 6805 version; there's also an 8048 version.
66*/
77
8/* LK201-AA keyboard matrix (8048 version)
9   Source: VCB02 Technical Reference.
8/* LK201-AA keyboard matrix (8048 version with updates)
9   Source: VCB02 Technical Reference.
1010
1111   KBD controller scan matrix (PORT 1): 8 x BCD IN => 18 DECIMAL OUT
1212
r26664r26665
2020..KBD17:|[R] |F19 |[R] |F20|PF4|N--- N,| Enter
2121........|    |    |    |   |   |   NOTE1)
2222........|    |G22 |    |G23|E23|D23|C23| A23
23........|    |    |    |   | | <- - - - - -  ? ?
2423--------|----|----|----|---|---|---|---|---
25..KBD16:|F18 |PF3 |[R] |N9 ||N6 |N3 |N
24..KBD16:|F18 |PF3 |[R] |N9 |C:D|N6 |N3 |N.
2625........|G21 |E22 |    |D22|B17|C22|B22|A22
2726--------|----|----|----|---|---|---|---|---
28..KBD15:|F17 |PF2 |[R] |N8 |N5 |-> | N2|N0
27..KBD15:|F17 |PF2 |[R] |N8 |N5 |C:R| N2|N0
2928........|    |    |    |   |   |   |   |NOTE 2)
3029........|G20 |E21 |    |D21|C21|B18|B21|
3130--------|----|----|----|---|---|---|---|---
32  KBD14:|PF1 |Next|Remove ^|N7 |N4 |N1 |N0
33........|    |Scrn|    |  ||   |   |   |
31  KBD14:|PF1 |Next|Rem-|C:U|N7 |N4 |N1 |N0
32........|    |Scrn|move|...|   |   |   |
3433........|E20 |D18 |E18 |C17|D20|C20|B20|A20
3534--------|----|----|----|---|---|---|---|---
36..KBD13:|Ins.|--- |D0  Prev| { |"  |[R]|[R]
37........|Here|-   |    Scrn. [ |'  |   |
38........|E17 |E11 |G16 |D17 D11|C11|   |           
35..KBD13:|Ins.|--- |'Do'|Prev { |"  |[R]|[R]
36........|Here|-   |    Scrn| [ |'  |   |
37........|E17 |E11 |G16 |D17|D11|C11|   |           
3938--------|----|----|----|---|---|---|---|---
40..KBD12:|Find|+   |Help|Se-| } Re- |<- |
41........|    |=   |    |lect ] turn|   |
42........|E16 |E12 |G15 |D16 D12|C13|   |
39..KBD12:|Find|+   |Help|Se-| } |Re-|C:L| |
40........|    |=   |    |lect ] |turn...| \
41........|E16 |E12 |G15 |D16 D12|C13|B16|C12
4342--------|----|----|----|---|---|---|---|---
44..KBD11:Addtnl <X||[R] |)  |P  NOTE|:  |?
45.......Options Del|    |0  |   | 3)|;  |/
43..KBD11:Addtnl <X||[R] |)  |P  NOTE|:  | ?
44.......Options Del|    |0  |   | 3)|;  | /
4645........|G14 | E13|....|E10|D10|...|C10|B10
4746--------|----|----|----|---|---|---|---|---
48..KBD10:|[R] |F12 |[R] |F13| ( |O  |L  |.
49........|....|(BS)|    |(LF) 9 |   |   |
47..KBD10:|[R] |F12 |[R] |F13| ( |O  |L  | .
48........|....|(BS)|    |(LF) 9 |   |   | .
5049........|....|G12 |....|G13|E09|D09|C09|B09
5150--------|----|----|----|---|---|---|---|---
5251..KBD_9:|[R] |F11 |[R] |[R]|*  |I  |K  | ,
r26664r26665
5857........|    |G08 |    |G09|E07|D07|C07|B07
5958--------|----|----|----|---|---|---|---|---
6059..KBD_7:|[R] Cancel[R] Resu ^  |Y  |H  |N
61........|    |    |     me |6  |   |   |
62........|....|G07      |G06|E06|D06|C06|B06
60........|....|....|.....me |6  |   |   |
61........|....|G07 |....|G06|E06|D06|C06|B06
6362--------|----|----|----|---|---|---|---|---
6463..KBD_6:|[R] |[R] |[R] Inter % |T  |G  |B
6564........|....|....|....rupt| 5 |   |   |
6665........|....|....|....|G05|E05|D05|C05|B05
6766--------|----|----|----|---|---|---|---|---
68..KBD_5: F4   Break [R]|$  |R  |F  |V  |Space
69........|.........|....|4  |   |   |   |         
70........ G02  G03 |....|E04 D04 C04 B04 A01-A09
67..KBD_5: F4  |Break [R]|$  |R  |F  |V  |Space
68........|....|....|....|4  |   |   |   |         
69........ G02 |G03 |....|E04 D04 C04 B04 A01-A09
7170--------|----|----|----|---|---|---|---|---
7271..KBD_4: [R] |Prt.|[R] |Set|#  |E  |D  |C
7372........|....|Scrn|....|-Up|3  |   |   |
7473........|....|G00 |....|G01 E03 D03 C03 B03
7574--------|----|----|----|---|---|---|---|---
76..KBD_3: Hold|@   |[R] |Tab|W  |S  |X  |>
77........|Scrn|2   |....|   |   |   |   |<
75..KBD_3: Hold| @  |[R] |Tab|W  |S  |X  |>
76........|Scrn| 2  |....|   |   |   |   |<
7877........|G99 |E02 |....|D00|D02|C02|B02|B00
7978--------|----|----|----|---|---|---|---|---
8079..KBD_2: [R] |[R] |[R] |~  |!  |Q  |A  |Z
81........|..............|   |1 
80........|..............|...|1 
8281........|..............|E00 E01 D01 C01 B01
8382--------|----|----|----|---|---|---|---|---
8483..KBD_1: Ctrl|Lock|Comp|[R]
r26664r26665
9493  Normally only the N0 keyswitch is implemented as a double-sized key.
9594  NOTE 3) Return key occupies 2 positions that are
9695  decoded as the Return (C13) key.
96 
97  C:D - Cursor down (B17)
98  C:U - Cursor up (C17)
99  C:R - Cursor right (B18)
100  C:L - Cursor left (B16)
97101 */
98102 
99103#include "emu.h"
trunk/src/mess/machine/dec_lk201.h
r26664r26665
1111
1212#define LK201_TAG   "lk201"
1313
14#define LK_CMD_LEDS_ON          0x13    /* light LEDs - 1st param: led bitmask */
15#define LK_CMD_LEDS_OFF         0x11    /* turn off LEDs */
16
17#define LK_CMD_DIS_KEYCLK       0x99    /* disable the keyclick */
18#define LK_CMD_ENB_KEYCLK       0x1b    /* enable the keyclick - 1st param: volume */
19//#define LK_CMD_DIS_CTLCLK       0xb9    /* disable the Ctrl keyclick */
20//#define LK_CMD_ENB_CTLCLK       0xbb    /* enable the Ctrl keyclick */
21#define LK_CMD_SOUND_CLK        0x9f    /* emit a keyclick  - 1st param: volume */
22#define LK_CMD_DIS_BELL         0xa1    /* disable the bell */
23#define LK_CMD_ENB_BELL         0x23    /* enable the bell - 1st param: volume */
24#define LK_CMD_BELL             0xa7    /* emit a bell - 1st param: volume */
25
26#define LK_CMD_POWER_UP         0xfd    /* init power-up sequence */
27
1428//**************************************************************************
1529//  INTERFACE CONFIGURATION MACROS
1630//**************************************************************************
trunk/src/mess/video/vtvideo.c
r26664r26665
1   /**********************************************************************
1/**********************************************************************
22
33    DEC VT Terminal video emulation
44    [ DC012 and DC011 emulation ]
55
66    01/05/2009 Initial implementation [Miodrag Milanovic]
7    --/--/2013 portions by Karl-Ludwig Deisenhofer.
7    xx/xx/2013 portions by Karl-Ludwig Deisenhofer.
88
99    DEC VIDEO : STATE AS OF NOVEMBER 2013
1010    -------------------------------------
11    - NOT WORKING : scrolling requires implementation of 'scrolling region'. Multiple regions could be present.
12               Split & a full screen modes exist. Scroll should be synced with beam or DMA.
13               See 4.7.4 and up in VT manual.
11    - NOT FULLY WORKING : scrolling requires implementation of 'scrolling region'. Multiple regions could be present.
12                          Split & full screen modes exist. Scroll should be synced with beam or DMA.
13                          See 4.7.4 and up in VT manual.
1414
1515   - TESTS REQUIRED : do line and character attributes (plus combinations) match real hardware? 
1616
r26664r26665
103103   // LBA7 is scan line frequency update
104104   machine().scheduler().timer_pulse(attotime::from_nsec(31778), timer_expired_delegate(FUNC(vt100_video_device::lba7_change),this));
105105
106
107106   save_item(NAME(m_lba7));
108107   save_item(NAME(m_scroll_latch));
109108   save_item(NAME(m_blink_flip_flop));
r26664r26665
146145// 4 color (= monochrome intensities) palette, 24 and 48 line modes.
147146void rainbow_video_device::device_reset()
148147{
149   DEC_MHFU = true; // SET ON COLD BOOT
148   MHFU_FLAG = false;
149   MHFU_counter = 0; // **** MHFU: OFF ON COLD BOOT ! ****
150150
151   // (rest of the palette is set in the main program)
151152   palette_set_color_rgb(machine(), 0, 0x00, 0x00, 0x00); // black
152   // (rest of the palette is set in the main program)
153153
154154   m_height = 24;  // <---- DEC-100
155155   m_height_MAX = 48;
r26664r26665
201201// Also used by Rainbow-100 ************
202202WRITE8_MEMBER( vt100_video_device::dc012_w )
203203{
204   if (data == 0)
205   {
206      if (DEC_MHFU == true)
207         DEC_MHFU = false; // MHFU is disabled by writing 00 to port 010C.
208   } else
209   {
210      if (DEC_MHFU == false)
211         DEC_MHFU = true; // TODO: MHFU ENABLE should also reset the MHFU timer.
204      // TODO: writes to 10C/0C should be treated differently (emulation disables the watchdog too often).
205   if (data == 0) // MHFU is disabled by writing 00 to port 010C.
206   {   
207            //if (MHFU_FLAG == true)
208            //   printf("MHFU  *** DISABLED *** \n");
209            MHFU_FLAG = false;
210            MHFU_counter = 0;
212211   }
212   else
213   {           // RESET
214             //if (MHFU_FLAG == false)
215            //   printf("MHFU  ___ENABLED___ \n");
216            MHFU_FLAG = true;
213217
218            MHFU_counter = 0;
219   }
220
214221   if (!(data & 0x08))
215222   {
216223      // The scroll offset put in 'm_scroll_latch' is a decimal offset controlling 10 scan lines.
r26664r26665
223230      // and unlinked down at the bottom.
224231
225232      // Note that the scroll latch value will be used during the next frame rather than the current frame.
226      // All line linking/unlinking should be done during the vertical blanking interval (< 550ms).
233      // All line linking/unlinking is done during the vertical blanking interval (< 550ms).
227234
228235      // More on scrolling regions: Rainbow 100 B technical documentation (QV069-GZ) April 1985 page 22
229236      // Also see VT100 Technical Manual: 4.7.4 Address Shuffling to 4.7.9 Split Screen Smooth Scrolling.
r26664r26665
249256         case 0x09:
250257            // clear vertical frequency interrupt;
251258            m_clear_video_interrupt(0, 0);
259
252260            break;
253261         case 0x0a:
254262            // set reverse field on
r26664r26665
571579      // modify line since that is how it is stored in rom
572580      if (j == 0) j = 15; else j = j - 1;
573581
574      line = m_gfx[code * 16 + j];
582      line = m_gfx[ (code << 4) + j]; // code * 16
575583
576584      // UNDERLINED CHARACTERS (CASE 5 - different in 1 line):
577585      back_intensity = back_default_intensity; // 0, 1, 2
r26664r26665
606614         // Double, 'double_height + double_width', then normal.
607615         if (double_width)
608616         {
609                bitmap.pix16( y_preset, d_x_preset + b * 2 + 1) = bit;
610            bitmap.pix16( y_preset, d_x_preset + b * 2)     = bit;
617                bitmap.pix16( y_preset, d_x_preset + (b << 1) + 1) = bit;
618            bitmap.pix16( y_preset, d_x_preset + (b << 1)    ) = bit;
611619
612620            if (double_height)
613621            {
614                 bitmap.pix16( 1 + y_preset, d_x_preset + b * 2 + 1) = bit;
615                 bitmap.pix16( 1 + y_preset, d_x_preset + b * 2)     = bit;
622                 bitmap.pix16( 1 + y_preset, d_x_preset + (b << 1) + 1) = bit;
623                 bitmap.pix16( 1 + y_preset, d_x_preset + (b << 1)    ) = bit;
616624            }
617625         }
618626         else
r26664r26665
683691         }
684692
685693         //  LINE ATTRIBUTE - valid for all chars on next line  ** DO NOT SHUFFLE **
686         attr_addr = ( 0x1000 | ((addr + xpos + 1) & 0x0fff) );
694         attr_addr = 0x1000 | ( (addr + xpos + 1) & 0x0fff );
687695
688696         // MOVE TO NEW DATA
689697         temp = m_in_ram_func(addr + xpos + 2) * 256 + m_in_ram_func(addr + xpos + 1);
r26664r26665
747755                  break;
748756
749757         case 0x02:
750                  palette_set_color_rgb(machine(), 1, 0 , 200 -50, 0);        // GREEN (dim)
751                  palette_set_color_rgb(machine(), 2, 0 , 200,     0);      // GREEN (NORMAL)
752                  palette_set_color_rgb(machine(), 3, 0,  200 +50, 0);        // GREEN (brighter)
758                  palette_set_color_rgb(machine(), 1, 0 , 205 -50, 100 - 50);        // GREEN (dim)
759                  palette_set_color_rgb(machine(), 2, 0 , 205,     100     );         // GREEN (NORMAL)
760                  palette_set_color_rgb(machine(), 3, 0,  205 +50, 100 + 50);        // GREEN (brighter)
753761                  break;
754762
755763         case 0x03:
756                  palette_set_color_rgb(machine(), 1, 213 - 47, 146 - 47, 82 - 47);      // AMBER (dim)
757                  palette_set_color_rgb(machine(), 2, 213,      146,      82);      // AMBER (normal - not exact)
758                  palette_set_color_rgb(machine(), 3, 255, 193, 129);     // AMBER (brighter)
764                  palette_set_color_rgb(machine(), 1, 213 - 47, 146 - 47, 82 - 47); // AMBER (dim)
765                  palette_set_color_rgb(machine(), 2, 213,      146,      82     ); // AMBER (NORMAL)
766                  palette_set_color_rgb(machine(), 3, 255,      193,      129    ); // AMBER (brighter)
759767                  break;
760768   }
761769}
r26664r26665
764772void rainbow_video_device::video_blanking(bitmap_ind16 &bitmap, const rectangle &cliprect)
765773{
766774   // 'In reverse screen mode, termination forces the beam to the screen background intensity'
767   // Background intensity means 'dim' (1) according to one source. Most certainly not pitch black.
775   // Background intensity means 'dim' (1) according to one source.
768776    bitmap.fill( ((m_reverse_field ^ m_basic_attribute) ? 1 : 0) , cliprect);
769777}
770778
771int rainbow_video_device::dc012_MHFU()
779
780
781int rainbow_video_device::MHFU(int ASK)
772782{
773   return DEC_MHFU;
783   switch (ASK)
784   {     
785         case 1:         // "true": RETURN BOOLEAN (MHFU disabled or enabled?)
786            return MHFU_FLAG;
787
788         case -1:      // -1: increment, return counter value (=> Rainbow.c)
789             if (MHFU_FLAG == true)
790               MHFU_counter++;
791            return MHFU_counter;
792
793         case -100:         // -100 : RESET and ENABLE MHFU counter
794             //printf("-100 MHFU  * reset and ENABLE * \n");
795            MHFU_counter = 0;
796
797             //if (MHFU_FLAG == false)
798            //   printf("-100 MHFU  ___ENABLED___\n");
799            MHFU_FLAG = true;
800
801            return -100;
802
803         default:
804            assert(1);
805            return -255;
806   } // switch
774807}
775808
776809TIMER_CALLBACK_MEMBER( vt100_video_device::lba7_change )
trunk/src/mess/video/vtvideo.h
r26664r26665
4040   DECLARE_WRITE8_MEMBER(brightness_w);
4141
4242   virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
43
4443protected:
4544   // device-level overrides
4645   virtual void device_config_complete();
r26664r26665
5857   UINT8 *m_gfx;     /* content of char rom */
5958
6059   int m_lba7;
61   bool DEC_MHFU;
6260
61   bool MHFU_FLAG;
62   int MHFU_counter;
63
64
6365   // dc012 attributes
6466   UINT8 m_scroll_latch;
6567   UINT8 m_blink_flip_flop;
r26664r26665
8486   virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
8587   virtual void video_blanking(bitmap_ind16 &bitmap, const rectangle &cliprect);
8688
87   int dc012_MHFU();
89   int MHFU(int);
8890   void palette_select(int choice);
8991protected:
9092   virtual void display_char(bitmap_ind16 &bitmap, UINT8 code, int x, int y, UINT8 scroll_region, UINT8 display_type);
trunk/src/mess/mess.lst
r26664r26665
14331433dectalk // 1982 Digital Equipment Corporation
14341434mc7105 // Elektronika MC7105
14351435rainbow // DEC Rainbow 100B
1436rainb190   // DEC Rainbow 190
14361437
14371438// Memotech
14381439mtx512  // 1983 Memotech MTX 512
trunk/src/mess/layout/rainbow.lay
r26664r26665
11<mamelayout version="2">
2   <element name="led" defstate="0">
3      <disk state="0">
2   <element name="driveled" defstate="0">
3      <disk state="1">
44         <color red="0.75" green="0.0" blue="0.0" />
55      </disk>
6      <disk state="1">
6      <disk state="0">
77         <color red="0.20" green="0.0" blue="0.0" />
88      </disk>
99   </element>
1010
11   <element name="sysled" defstate="0">
12      <disk state="0">
13         <color red="0.55" green="0.0" blue="0.0" />
14      </disk>
15      <disk state="1">
16         <color red="0.15" green="0.0" blue="0.0" />
17      </disk>
18   </element>
1119
20   <element name="greenkbd" defstate="0">
21      <disk state="0">
22         <color red="0.0" green="0.75" blue="0.0" />
23      </disk>
24      <disk state="1">
25         <color red="0.0" green="0.20" blue="0.0" />
26      </disk>
27   </element>
28
1229   <element name="DRIVE0">
1330      <text string="A">
1431         <color red="1.0" green="1.0" blue="1.0" />
r26664r26665
2037      </text>
2138   </element>
2239
23   <element name="l1">
40   <element name="DRIVE2">
41      <text string="C">
42         <color red="0.70" green="0.70" blue="0.70" />
43      </text>
44   </element>
45   <element name="DRIVE3">
46      <text string="D">
47         <color red="0.70" green="0.70" blue="0.70" />
48      </text>
49   </element>
50
51
52   <element name="l1sysled0">
2453      <text string="1">
25         <color red="1.0" green="1.0" blue="1.0" />
54         <color red="0.70" green="0.70" blue="0.70" />
2655      </text>
2756   </element>
2857   <element name="l2">
2958      <text string="2">
30         <color red="1.0" green="1.0" blue="1.0" />
59         <color red="0.70" green="0.70" blue="0.70" />
3160      </text>
3261   </element>
3362   <element name="l3">
3463      <text string="3">
35         <color red="1.0" green="1.0" blue="1.0" />
64         <color red="0.70" green="0.70" blue="0.70" />
3665      </text>
3766   </element>
3867   <element name="l4">
3968      <text string="4">
40         <color red="1.0" green="1.0" blue="1.0" />
69         <color red="0.70" green="0.70" blue="0.70" />
4170      </text>
4271   </element>
4372   <element name="l5">
4473      <text string="5">
45         <color red="1.0" green="1.0" blue="1.0" />
74         <color red="0.70" green="0.70" blue="0.70" />
4675      </text>
4776   </element>
4877   <element name="l6">
4978      <text string="6">
50         <color red="1.0" green="1.0" blue="1.0" />
79         <color red="0.70" green="0.70" blue="0.70" />
5180      </text>
5281   </element>
5382   <element name="l7">
5483      <text string="7">
55         <color red="1.0" green="1.0" blue="1.0" />
84         <color red="0.70" green="0.70" blue="0.70" />
5685      </text>
5786   </element>
58   <element name="l8">
87   
88   <element name="l8wait">
5989      <text string="WAIT">
6090         <color red="1.0" green="1.0" blue="1.0" />
6191      </text>
r26664r26665
81111         <bounds x="30" y="0" width="640" height="480" />
82112      </screen>
83113
84      <bezel name="led20" element="led">
114      <bezel name="driveled0" element="driveled">
85115         <bounds x="15" y="3" width="10" height="10" />
86116      </bezel>
87      <bezel name="led21" element="led">
117      <bezel name="driveled1" element="driveled">
88118         <bounds x="15" y="18" width="10" height="10" />
89119      </bezel>
120      <bezel name="driveled2" element="driveled">
121         <bounds x="15" y="33" width="10" height="10" />
122      </bezel>
123      <bezel name="driveled3" element="driveled">
124         <bounds x="15" y="46" width="10" height="10" />
125      </bezel>
90126
91      <bezel name="led1" element="led">
92         <bounds x="15" y="43" width="10" height="10" />
127      <bezel name="led1" element="sysled">
128         <bounds x="15" y="76" width="10" height="10" />
93129      </bezel>
94      <bezel name="led2" element="led">
95         <bounds x="15" y="63" width="10" height="10" />
130      <bezel name="led2" element="sysled">
131         <bounds x="15" y="96" width="10" height="10" />
96132      </bezel>
97      <bezel name="led3" element="led">
98         <bounds x="15" y="83" width="10" height="10" />
133      <bezel name="led3" element="sysled">
134         <bounds x="15" y="116" width="10" height="10" />
99135      </bezel>
100      <bezel name="led4" element="led">
101         <bounds x="15" y="103" width="10" height="10" />
136      <bezel name="led4" element="sysled">
137         <bounds x="15" y="136" width="10" height="10" />
102138      </bezel>
103      <bezel name="led5" element="led">
104         <bounds x="15" y="123" width="10" height="10" />
139      <bezel name="led5" element="sysled">
140         <bounds x="15" y="156" width="10" height="10" />
105141      </bezel>
106      <bezel name="led6" element="led">
107         <bounds x="15" y="143" width="10" height="10" />
142      <bezel name="led6" element="sysled">
143         <bounds x="15" y="176" width="10" height="10" />
108144      </bezel>
109      <bezel name="led7" element="led">
110         <bounds x="15" y="163" width="10" height="10" />
145      <bezel name="led7" element="sysled">
146         <bounds x="15" y="196" width="10" height="10" />
111147      </bezel>
112      <bezel name="led8" element="led">
113         <bounds x="15" y="193" width="10" height="10" />
148      <bezel name="led8" element="greenkbd">
149         <bounds x="15" y="226" width="10" height="10" />
114150      </bezel>
115      <bezel name="led9" element="led">
116         <bounds x="15" y="213" width="10" height="10" />
151      <bezel name="led9" element="greenkbd">
152         <bounds x="15" y="246" width="10" height="10" />
117153      </bezel>
118      <bezel name="led10" element="led">
119         <bounds x="15" y="232" width="10" height="10" />
154      <bezel name="led10" element="greenkbd">
155         <bounds x="15" y="265" width="10" height="10" />
120156      </bezel>
121      <bezel name="led11" element="led">
122         <bounds x="15" y="252" width="10" height="10" />
157      <bezel name="led11" element="greenkbd">
158         <bounds x="15" y="285" width="10" height="10" />
123159      </bezel>
124160
125161      <bezel name="label20" element="DRIVE0">
r26664r26665
128164      <bezel name="label21" element="DRIVE1">
129165         <bounds x="0" y="14" width="15" height="16" />
130166      </bezel>
131      <bezel name="label1" element="l1">
132         <bounds x="0" y="40" width="15" height="16" />
167      <bezel name="label22" element="DRIVE2">
168         <bounds x="0" y="29" width="15" height="16" />
133169      </bezel>
170      <bezel name="label23" element="DRIVE3">
171         <bounds x="0" y="43" width="15" height="16" />
172      </bezel>
173
174      <bezel name="label1" element="l1sysled0">
175         <bounds x="0" y="73" width="15" height="16" />
176      </bezel>
134177      <bezel name="label2" element="l2">
135         <bounds x="0" y="60" width="15" height="16" />
178         <bounds x="0" y="93" width="15" height="16" />
136179      </bezel>
137180      <bezel name="label3" element="l3">
138         <bounds x="0" y="80" width="15" height="16" />
181         <bounds x="0" y="113" width="15" height="16" />
139182      </bezel>
140183      <bezel name="label4" element="l4">
141         <bounds x="0" y="100" width="15" height="16" />
184         <bounds x="0" y="133" width="15" height="16" />
142185      </bezel>
143186      <bezel name="label5" element="l5">
144         <bounds x="0" y="120" width="15" height="16" />
187         <bounds x="0" y="153" width="15" height="16" />
145188      </bezel>
146189      <bezel name="label6" element="l6">
147         <bounds x="0" y="140" width="15" height="16" />
190         <bounds x="0" y="173" width="15" height="16" />
148191      </bezel>
149192      <bezel name="label7" element="l7">
150         <bounds x="0" y="160" width="15" height="16" />
193         <bounds x="0" y="193" width="15" height="16" />
151194      </bezel>
152      <bezel name="label8" element="l8">
153         <bounds x="0" y="189" width="15" height="16" />
195      <bezel name="label8" element="l8wait">
196         <bounds x="0" y="222" width="15" height="16" />
154197      </bezel>
155198      <bezel name="label9" element="l9">
156         <bounds x="0" y="209" width="15" height="16" />
199         <bounds x="0" y="242" width="15" height="16" />
157200      </bezel>
158201      <bezel name="label10" element="l10">
159         <bounds x="0" y="229" width="15" height="16" />
202         <bounds x="0" y="262" width="15" height="16" />
160203      </bezel>
161204      <bezel name="label11" element="l11">
162         <bounds x="0" y="249" width="15" height="16" />
205         <bounds x="0" y="282" width="15" height="16" />
163206      </bezel>
164207   </view>
165208
trunk/src/mess/drivers/rainbow.c
r26664r26665
1/***************************************************************************
2
1/***************************************************************************************************
32    DEC Rainbow 100
43
5    Driver-in-progress by R. Belmont and Miodrag Milanovic with additions by Karl-Ludwig Deisenhofer.
4    Driver-in-progress by R. Belmont and Miodrag Milanovic.
5   Portions (2013) by Karl-Ludwig Deisenhofer (VT video, floppy, preliminary keyboard, DIP switches).
66
7    STATE AS OF NOVEMBER 2013
7    STATE AS OF DECEMBER 2013
88    --------------------------
9    - FATAL: keyboard emulation incomplete (inhibits the system from booting with ERROR 50 on cold or ERROR 13 on warm boot).
10    - NOT WORKING: serial (ERROR 60).
9   - FLOPPY TIMING: 'wd17xx_complete_command' * must * be hard wired to about 13 usecs.
10     Line 1063 in 'wd17xx.c' has to be changed (until legacy code here is removed):
11     -      w->timer_cmd->adjust(attotime::from_usec(usecs));
12     +      w->timer_cmd->adjust(attotime::from_usec(13));
13
14    - WORKAROUND AVAILABLE: keyboard emulation incomplete (inhibits the system from booting with ERROR 50 on cold or ERROR 13 on warm boot).
15   - NOT WORKING: serial (ERROR 60).
1116    - NOT WORKING: printer interface (ERROR 40). Like error 60 not mission-critical.
1217
13    - NON-CRITICAL: watchdog logic (triggered after 108 ms without interrupts) still not exactly by the book.
18    - NON-CRITICAL: watchdog logic (triggered after 108 ms without interrupts on original machine) still does not work as intended.
1419
1520               Timer is reset by TWO sources: the VERT INT L from the DC012, or the MHFU ENB L from the enable flip-flop.
1621               The MHFU gets active if the 8088 has not acknowledged a video processor interrupt within approx. 108 milliseconds.
1722   
1823               BIOS assumes a power-up reset if MHFU detection is disabled - and assumes a MHFU reset if MHFU detection is ENABLED.
19               Therefore a 'warm boot' within MESS (F3) causes ERROR 16.
24               
25               As there is no reset switch, only a limited software reset exists on a real DEC-100 (CTRL-SETUP within SETUP).
2026
21    - SHOULD BE IMPLEMENTED AS SLOT DEVICES (for now, DIP settings affect 'system_parameter_r' only and are disabled):
27    - TO BE IMPLEMENTED AS SLOT DEVICES (for now, DIP settings affect 'system_parameter_r' only and are disabled):
2228            * Color graphics option (uses NEC upd7220 GDC)
2329            * Extended communication option (same as BUNDLE_OPTION ?)
2430
2531    - OTHER UPGRADES (NEC_V20 should be easy, the TURBOW is harder to come by)
2632         * Suitable Solutions TURBOW286: 12 Mhz, 68-pin, low power AMD N80L286-12 and WAYLAND/EDSUN EL286-88-10-B ( 80286 to 8088 Processor Signal Converter )
27           plus DC 7174 or DT 7174 (barely readable). Add-on card, replaces main 8088 cpu (via ribbon cable). Changed BOOT ROM labeled 'TBSS1.3 - 3ED4'.
33           plus DC 7174 or DT 7174 (barely readable). Add-on card, replaces main 8088 cpu (via ribbon cable). Altered BOOT ROM labeled 'TBSS1.3 - 3ED4'.
2834
2935         * NEC_V20 (requires modded BOOT ROM because of - at least 2 - hard coded timing loops):
3036                 100A:         100B/100+:                  100B+ ALTERNATE RECOMMENDATION (fixes RAM size auto-detection problems when V20 is in place.
r26664r26665
154160W17 pulls J1 serial  port pin 1 to GND when set (chassis to logical GND).
155161****************************************************************************/
156162
157/*
158HARD DISC SIZES AND LIMITS
159  HARDWARE: the Rainbow winchester controller has a built-in limit of 8 heads and 1024 cylinders (67 MB). Standard geometry is 4 surfaces.
163// Workarounds DO NOT APPLY to the 190-B ROM. Only enable when compiling the 'rainbow' driver -
164//#define FORCE_RAINBOW_100_LOGO
165#define KBD_DELAY 875 // (debounce delay). Recommended: 875.
160166
161  SOFTWARE: the original DEC boot loader (and FDISK from DOS 3.10) initially allowed a maximum hard disc size of 20 MB.
162  - DOS 3 has a 1024 cylinder limit (32 MB).
163  - the custom boot loader that comes with 'WUTIL 3.2' stretches limits to 117 MB and 8 surfaces.
164*/
165
166
167167#include "emu.h"
168168#include "cpu/i86/i86.h"
169169#include "cpu/z80/z80.h"
170170#include "video/vtvideo.h"
171
171172#include "machine/wd17xx.h"
172173#include "imagedev/flopdrv.h"
174#include "formats/basicdsk.h"
175
173176#include "machine/i8251.h"
174177#include "machine/dec_lk201.h"
175178#include "sound/beep.h"
176179#include "machine/nvram.h"
177180
178#include "rainbow.lh" // BEZEL - LAYOUT with LEDs for diag 1-7, keyboard 8-11 and floppy 20-21
181#include "rainbow.lh" // BEZEL - LAYOUT with LEDs for diag 1-7, keyboard 8-11 and floppy 20-23
179182
180183class rainbow_state : public driver_device
181184{
r26664r26665
248251   DECLARE_READ8_MEMBER(floating_bus_r);
249252   DECLARE_WRITE8_MEMBER(floating_bus_w);
250253
254   DECLARE_READ8_MEMBER(hd_status_68_r);
251255      // EMULATOR TRAP TO INTERCEPT KEYBOARD cmd in AH and PARAMETER in AL (port 90 = AL / port 91 = AH)
252256      // TODO: beeper and led handling should better be handled by LK201 code.
253257   DECLARE_WRITE8_MEMBER(PORT90_W);
r26664r26665
261265   DECLARE_WRITE8_MEMBER(z80_diskdiag_read_w);
262266   DECLARE_WRITE8_MEMBER(z80_diskdiag_write_w);
263267
264   DECLARE_WRITE8_MEMBER(z80_diskcontrol_write_w);
268   DECLARE_READ8_MEMBER(z80_generalstat_r);
269
270   DECLARE_READ8_MEMBER(z80_diskstatus_r);
271   DECLARE_WRITE8_MEMBER(z80_diskcontrol_w);
272
265273   DECLARE_READ8_MEMBER(system_parameter_r);
266274
267275   DECLARE_READ_LINE_MEMBER(dsr_r);
r26664r26665
273281
274282   bool m_SCREEN_BLANK;
275283
284   int INT88, INTZ80;
285
276286   bool m_zflip;                   // Z80 alternate memory map with A15 inverted
277287   bool m_z80_halted;
288   int  m_z80_diskcontrol;         // retains values needed for status register
289
278290   bool m_kbd_tx_ready, m_kbd_rx_ready;
291   int m_KBD;
279292
280   int m_KBD;
281293   int m_beep_counter;
294   int MOTOR_DISABLE_counter;
282295
283   int MHFU_counter;
284
296   int COLD_BOOT;
285297private:
286298   UINT8 m_z80_private[0x800];     // Z80 private 2K
287299   UINT8 m_z80_mailbox, m_8088_mailbox;
288300
289301   void update_kbd_irq();
290302   virtual void machine_reset();
291   void MHFU_reset();
303
304   int m_unit;
305   device_t *m_image[4];
306
292307public:
293308   UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
294309   INTERRUPT_GEN_MEMBER(vblank_irq);
r26664r26665
296311   required_device<cpu_device> m_maincpu;
297312};
298313
314
299315void rainbow_state::machine_start()
300316
317   m_image[0] = subdevice(FLOPPY_0);
318   m_image[1] = subdevice(FLOPPY_1);
319   m_image[2] = subdevice(FLOPPY_2);
320   m_image[3] = subdevice(FLOPPY_3);
321
322   COLD_BOOT = 1;
323
301324   m_SCREEN_BLANK = false;
302325
303326   save_item(NAME(m_z80_private));
r26664r26665
309332
310333   UINT8 *rom = memregion("maincpu")->base();
311334
335   
336#ifdef FORCE_RAINBOW_100_LOGO
337 rom[0xf4174]=0xeb; // jmps  RAINBOW100_LOGO__loc_33D
338 rom[0xf4175]=0x08; 
339
340 rom[0xf4000 + 0x364a]= 0x0a; 
341 rom[0xf4384]=0xeb; // JMPS  =>  BOOT80
342#endif
343
312344   // Enables PORT90_W + PORT91_W via BIOS call (offset +$21 in HIGH ROM)
313345   // F8 / FC ROM REGION (CHECK + PATCH)
314346   if(rom[0xfc000 + 0x0022] == 0x22 && rom[0xfc000 + 0x0023] == 0x28)
315347   {
316348         rom[0xf4303]=0x00; // Disable CRC CHECK (F0 / F4 ROM)
317349
318         rom[0xfc000 + 0x0022] =0xe2;  // jmp to offset $3906
319         rom[0xfc000 + 0x0023] =0x38;
350         rom[0xfc000 + 0x0022] =0xfe;  // jmp to offset $1922
351         rom[0xfc000 + 0x0023] =0x18;
320352
321         rom[0xfc000 + 0x3906] =0xe6;  // out 90,al
322         rom[0xfc000 + 0x3907] =0x90;
353         rom[0xfc000 + 0x1922] =0xe6;  // out 90,al
354         rom[0xfc000 + 0x1923] =0x90;
323355
324         rom[0xfc000 + 0x3908] =0x86;  //  xchg al,ah
325         rom[0xfc000 + 0x3909] =0xc4;
356         rom[0xfc000 + 0x1924] =0x86;  //  xchg al,ah
357         rom[0xfc000 + 0x1925] =0xc4;
326358
327         rom[0xfc000 + 0x390a] =0xe6;  // out 91,al
328         rom[0xfc000 + 0x390b] =0x91;
359         rom[0xfc000 + 0x1926] =0xe6;  // out 91,al
360         rom[0xfc000 + 0x1927] =0x91;
329361
330         rom[0xfc000 + 0x390c] =0x86;  // xchg al,ah
331         rom[0xfc000 + 0x390d] =0xc4;
362         rom[0xfc000 + 0x1928] =0x86;  // xchg al,ah
363         rom[0xfc000 + 0x1929] =0xc4;
332364
333         rom[0xfc000 + 0x390e] =0xe9;  // jmp (original jump offset $2846)
334         rom[0xfc000 + 0x390f] =0x35;
335         rom[0xfc000 + 0x3910] =0xef;
365         rom[0xfc000 + 0x192a] =0xe9;  // jmp (original jump offset $2846) e9 + 19 0f
366         rom[0xfc000 + 0x192b] =0x19;
367         rom[0xfc000 + 0x192c] =0x0f;
336368   }
369
337370}
338371
339372static ADDRESS_MAP_START( rainbow8088_map, AS_PROGRAM, 8, rainbow_state)
r26664r26665
374407   // 0x04 Video processor DC011
375408   AM_RANGE (0x04, 0x04) AM_DEVWRITE("vt100_video", rainbow_video_device, dc011_w)
376409
410   // TODO: unmapped [06] : Communication bit rates (see page 21 of PC 100 SPEC)
411
377412   AM_RANGE (0x08, 0x08) AM_READ(system_parameter_r)
378413
379414   AM_RANGE (0x0a, 0x0a) AM_READWRITE(diagnostic_r, diagnostic_w)
r26664r26665
381416   // 0x0C Video processor DC012
382417   AM_RANGE (0x0c, 0x0c) AM_DEVWRITE("vt100_video", rainbow_video_device, dc012_w)
383418
419   // TODO: unmapped [0e] : PRINTER BIT RATE REGISTER (WO)
420
384421   AM_RANGE(0x10, 0x10) AM_DEVREADWRITE("kbdser", i8251_device, data_r, data_w)
385422   AM_RANGE(0x11, 0x11) AM_DEVREADWRITE("kbdser", i8251_device, status_r, control_w)
386423
424   // UNMAPPED:
425   // 0x20 - 0x2f ***** EXTENDED COMM. OPTION (option select 1)- for example:
426   // 0x27      (RESET EXTENDED COMM OPTION) - OUT 27 @ offset 1EA7
427
428   // 0x40  COMMUNICATIONS DATA REGISTER (MPSC)
429   // 0x41  PRINTER DATA REGISTER (MPSC)
430   // 0x42  COMMUNICATIONS CONTROL / STATUS REGISTER (MPSC)
431   // 0x43  PRINTER CONTROL / STATUS REGISTER (MPSC)
432
433   // 0x50 - 0xf  ***** OPTIONAL COLOR GRAPHICS - for example:
434   // 0x50     (RESET_GRAPH. OPTION) - OUT 50 @ offsets F5EB5 + F5EB9
435
436   // ===========================================================
437   // TODO: hard disc emulation!                               
438   // ------ Rainbow uses 'WD 1010 AL' (Western Digital 1983)   
439   //        Register compatible to WD2010 (present in MESS)   
440   // R/W REGISTERS 60 - 68 (?)                                 
441   // ===========================================================
442   // HARD DISC SIZES AND LIMITS
443   //   HARDWARE:
444   //      Controller has a built-in limit of 8 heads / 1024 cylinders (67 MB). Standard geometry is 4 surfaces.
445   //   SOFTWARE: the DEC boot loader (and FDISK from DOS 3.10) initially allowed a maximum hard disc size of 20 MB.
446    //   - DOS 3 has a 1024 cylinder limit (32 MB).
447    //   - the custom boot loader that comes with 'WUTIL 3.2' allows 117 MB and 8 surfaces.
448   AM_RANGE (0x68, 0x68) AM_READ(hd_status_68_r)
449
387450   AM_RANGE (0x90, 0x90) AM_WRITE(PORT90_W)
388451   AM_RANGE (0x91, 0x91) AM_WRITE(PORT91_W)
389452ADDRESS_MAP_END
r26664r26665
397460   ADDRESS_MAP_UNMAP_HIGH
398461   ADDRESS_MAP_GLOBAL_MASK(0xff)
399462   AM_RANGE(0x00, 0x00) AM_READWRITE(z80_latch_r, z80_latch_w)
400   AM_RANGE(0x20, 0x20) AM_WRITE(z80_diskdiag_read_w)
401   AM_RANGE(0x21, 0x21) AM_WRITE(z80_diskdiag_write_w)
402   AM_RANGE(0x40, 0x40) AM_WRITE(z80_diskcontrol_write_w)
463   AM_RANGE(0x20, 0x20) AM_READWRITE(z80_generalstat_r, z80_diskdiag_read_w) // read to port 0x20 used by MS-DOS 2.x diskette loader.
464   AM_RANGE(0x21, 0x21) AM_READWRITE(z80_generalstat_r, z80_diskdiag_write_w)
465   AM_RANGE(0x40, 0x40) AM_READWRITE(z80_diskstatus_r, z80_diskcontrol_w)
403466   AM_RANGE(0x60, 0x60) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_status_r, wd17xx_command_w)
404467   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_track_r, wd17xx_track_w)
405468   AM_RANGE(0x62, 0x62) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_sector_r, wd17xx_sector_w)
r26664r26665
407470ADDRESS_MAP_END
408471
409472/* Input ports */
410static INPUT_PORTS_START( rainbow )
473
474/* KEYBOARD (preliminary - transfer to DEC_LK201.xx as soon as possible) */
475static INPUT_PORTS_START( rainbow100b_in )
476/* DIP switches */
411477      PORT_START("MONITOR TYPE")
412478      PORT_DIPNAME( 0x03, 0x03, "MONOCHROME MONITOR")
413479      PORT_DIPSETTING(    0x01, "PAPER WHITE" )
414480      PORT_DIPSETTING(    0x02, "GREEN" )
415481      PORT_DIPSETTING(    0x03, "AMBER" )
416482
417      PORT_START("FLOPPY CONTROLLER")
418      PORT_DIPNAME( 0x02, 0x02, "FLOPPY CONTROLLER") PORT_TOGGLE
419      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
420      PORT_DIPSETTING(    0x02, DEF_STR( On ) )
421
422      PORT_START("GRAPHICS OPTION")
423      PORT_DIPNAME( 0x00, 0x00, "GRAPHICS OPTION") PORT_TOGGLE
424      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
425      PORT_DIPSETTING(    0x04, DEF_STR( On ) )
426
427      PORT_START("BUNDLE OPTION")
428      PORT_DIPNAME( 0x00, 0x00, "BUNDLE OPTION") PORT_TOGGLE
429      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
430      PORT_DIPSETTING(    0x01, DEF_STR( On ) )
431
432483      PORT_START("MEMORY PRESENT")
433484      PORT_DIPNAME( 0xF000, 0x2000, "MEMORY PRESENT")
434485      PORT_DIPSETTING(    0x2000, "128 K (BOARD DEFAULT)" ) // NOTE: 0x2000 hard coded in 'system_parameter_r'
r26664r26665
445496      PORT_DIPSETTING(    0xD000, "832 K (MEMORY OPTION)" )
446497      PORT_DIPSETTING(    0xE000, "896 K (MEMORY OPTION)" )
447498
448   PORT_START("W13")
499      PORT_START("GRAPHICS OPTION")
500      PORT_DIPNAME( 0x00, 0x00, "GRAPHICS OPTION") PORT_TOGGLE
501      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
502      PORT_DIPSETTING(    0x04, DEF_STR( On ) )
503
504      PORT_START("BUNDLE OPTION")
505      PORT_DIPNAME( 0x00, 0x00, "BUNDLE OPTION") PORT_TOGGLE
506      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
507      PORT_DIPSETTING(    0x01, DEF_STR( On ) )
508
509   PORT_START("W13") // W13 - W18 affect 'system_parameter_r'
449510      PORT_DIPNAME( 0x02, 0x02, "W13 (FACTORY TEST A, LEAVE OFF)") PORT_TOGGLE
450511      PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
451512      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r26664r26665
462523      PORT_DIPNAME( 0x01, 0x00, "W18 (FACTORY TEST D, LEAVE OFF) (8251A: DSR)") PORT_TOGGLE
463524      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
464525      PORT_DIPSETTING(    0x01, DEF_STR( On ) )
526
527    // J17 jumper on FDC controller board shifts drive select (experimental) -
528   PORT_START("FLOPPY CONTROLLER")
529      PORT_DIPNAME( 0x02, 0x00, "J17 DRIVE SELECT (A => C and B => D)") PORT_TOGGLE
530      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
531      PORT_DIPSETTING(    0x02, DEF_STR( On ) )
465532INPUT_PORTS_END
466533
467
468void rainbow_state::MHFU_reset()
469{
470   MHFU_counter = 530; // 528 = 110ms
471}
472
534// 800K native format (80 * 10). Also reads VT-180 disks and PC-DOS 360 k disks
535// ( both: 512 byte sectors, single sided, 9 sectors per track, 40 tracks )
536static LEGACY_FLOPPY_OPTIONS_START( dec100_floppy )
537    LEGACY_FLOPPY_OPTION( dec100_floppy, "td0", "Teledisk floppy disk image", td0_dsk_identify, td0_dsk_construct, td0_dsk_destruct, NULL )
538   LEGACY_FLOPPY_OPTION( dec100_floppy, "img", "DEC Rainbow 100", basicdsk_identify_default, basicdsk_construct_default,    NULL,             
539      HEADS([1])
540      TRACKS(40/[80])
541      SECTORS(9/[10])
542      SECTOR_LENGTH([512])
543      INTERLEAVE([0])
544      FIRST_SECTOR_ID([1])
545                  )
546LEGACY_FLOPPY_OPTIONS_END
547 
473548void rainbow_state::machine_reset()
474549{
475   MHFU_reset();
550   if (COLD_BOOT == 1)
551   {
552      COLD_BOOT = 2;
553      m_crtc->MHFU(-100); // reset MHFU counter
554   }
476555
477556   m_z80->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
478557
558   INT88 = false;
559   INTZ80 = false;
560
479561   m_zflip = true;
480562   m_z80_halted = true;
481563   m_kbd_tx_ready = m_kbd_rx_ready = false;
r26664r26665
500582   output_set_value("led10", 1);
501583   output_set_value("led11", 1);
502584
503   output_set_value("led20", 1); // DRIVE 0 (A)
504   output_set_value("led21", 1); // DRIVE 1 (B)
585   MOTOR_DISABLE_counter = 2; // soon resets drv.LEDs
586   m_unit = 0;
587
505588}
506589
507590UINT32 rainbow_state::screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
508591{
592   // TEST-DEBUG: no screen updates during diskette operations!
593   if (MOTOR_DISABLE_counter)
594      return 0;
595
509596   m_crtc->palette_select( m_inp9->read() );
510597
511598   if ( m_SCREEN_BLANK )
r26664r26665
516603}
517604
518605// It is no longer possible to key in the RAM size on the 100-B.
519// The DEC-100-B boot ROM probes until a 'flaky' area is found (around F400:xxxx).
606// The DEC-100-B boot ROM probes until a 'flaky' area is found (around F400:0E04).
520607
521608// Unexpected low RAM sizes are an indication of option RAM (at worst: 128 K on board) failure.
522609// While motherboard errors often render the system unbootable, bad option RAM (> 128 K)
523// can be narrowed down with a diagnostic disk and codes from the 'Pocket Service Guide'
610// can be narrowed down with the Diagnostic Disk and codes from the 'Pocket Service Guide'
524611// EK-PC100-PS-002 (APPENDIX B.2.2); pc100ps2.pdf
525
526// Simulate floating bus for initial RAM detection:
612// ================================================================
613// - Simulate floating bus for initial RAM detection -
614// FIXME: code valid ONLY within ROM section F4Exxx.
615//
616// NOTE: MS-DOS 2.x unfortunately probes RAM in a similar way.
617// => SET OPTION RAM to 896 K for unknown applications (and DOS) <=
618// ================================================================
527619READ8_MEMBER(rainbow_state::floating_bus_r)
528620{
529   if ( m_maincpu->state_int(I8086_CS) != 0xF400)
530      return space.read_byte(offset);
621   int pc = space.device().safe_pc();
531622
532   if  ( m_maincpu->state_int(I8086_DS) < m_inp8->read() )
623   if ( ((pc & 0xFFF00) == 0xF4E00) &&
624       ( m_maincpu->state_int(I8086_DS) >= m_inp8->read() )
625      )
533626   {
627      return (offset>>16) + 2;
628   }
629   else
534630      return space.read_byte(offset);
535   } else
536   {
537      return (offset>>16) + 2;
538   }
539631}
540632
541633WRITE8_MEMBER(rainbow_state::floating_bus_w)
542634{
543   space.write_byte(offset,data);
635      space.write_byte(offset,data);
544636}
545637
546638
r26664r26665
600692   }
601693}
602694
695// Until a full-blown hard-disc emulation evolves, deliver an error message:
696READ8_MEMBER(rainbow_state::hd_status_68_r)
697{
698   // Top 3 bits = status / error code
699   // SEE ->   W_INCHESTER__loc_80E
700
701   // return 0xa0; // A0 : OK, DRIVE IS READY (!)
702   
703   return 0xe0; //  => 21 DRIVE NOT READY (BIOS; when W is pressed on boot screen)
704}
705
603706READ8_MEMBER(rainbow_state::system_parameter_r)
604707{
605708/*  Info about option boards is in bits 0 - 3:
r26664r26665
610713   ( 1 means NOT present )
611714*/
612715   // Hard coded value 0x2000 - see DIP switch setup!
613   return 0x0f - m_inp5->read() - m_inp6->read() - m_inp7->read() - (
614                              (m_inp8->read() > 0x2000) ? 8 : 0
615                              );
716   return 0x0f - m_inp5->read()
717               - 0                 // floppy is hard coded in emulator.
718            - m_inp7->read()
719            - (m_inp8->read() > 0x2000) ? 8 : 0;
616720}
617721
618722READ8_MEMBER(rainbow_state::comm_control_r)
619723{
620/*
621--> What the specs says on how MHFU detection is disabled:
622   //  1.  by first disabling interrupts with CLI
623   //  2.  by writing 0x00 to port 0x10C (handled by 'dc012_w' in vtvideo)
624   // (3.) MHFU is re-enabled by writing to 0x0c (or automatically after STI - when under BIOS control ?)
625*/
626      return (  ( m_crtc->dc012_MHFU() << 5)  // shift status of DC012 - MHFU flag to bit pos.5
627            ); 
724/*   [02] COMMUNICATIONS STATUS REGISTER - PAGE 154 (**** READ **** )
725   Used to read status of SERIAL port, IRQ line of each CPU, and MHFU logic enable signal.
726
727//    What the specs says on how MHFU detection is disabled:
728//     1.  by first disabling interrupts with CLI
729//     2.  by writing 0x00 to port 0x10C (handled by 'dc012_w' in vtvideo)
730//    (3.) MHFU is re-enabled by writing to 0x0c (or automatically after STI - when under BIOS control ?)
731*/   
732   // During boot phase 2, do not consider MHFU ENABLE. Prevents ERROR 16.
733   int data;
734   if (COLD_BOOT == 2)
735      data = 0;
736   else
737      data = m_crtc->MHFU(1);
738
739   return (  ( (data > 0) ? 0x00 : 0x20) |// (L): status of MHFU flag => bit pos.5
740                  (   (INT88)    ? 0x00 : 0x40 ) |               // (L)
741                  (   (INTZ80)   ? 0x00 : 0x80 )                 // (L)
742           );
628743}
629744
630745WRITE8_MEMBER(rainbow_state::comm_control_w)
r26664r26665
651766
652767   m_KBD = 0; // reset previous command.
653768
654   if (data == 0xfd) {      // Powerup (beep)
655      m_beep->set_state(1);
656      m_beep_counter=600;  // BELL = 125 ms
769  if(MOTOR_DISABLE_counter == 0)
770  {
771
772   if (data == LK_CMD_POWER_UP) {      // Powerup (beep)
773      //m_beep->set_state(1);
774      //m_beep_counter=600;  // BELL = 125 ms
657775   }
658776
659   if (data == 0xa7) {
660         m_beep->set_state(1);
777   if (data == LK_CMD_BELL) {
778      m_KBD = data;
779      m_beep->set_state(1);
661780      m_beep_counter=600;  // BELL = 125 ms
662781   }
663782
664   if (data == 0x9f) {    // emit a keyclick (2ms)
783   if (data == LK_CMD_SOUND_CLK) {    // emit a keyclick (2ms)
784      m_KBD = data;
665785      m_beep->set_state(1);
666786      m_beep_counter=25; // longer than calculated ( 9,6 )
667787   }
668788
669   if (data == 0x13) {  // light LEDs -
670      m_KBD = 0x13;
789   if (data == LK_CMD_ENB_BELL) {   // enable the bell - PARAMETER: VOLUME!
790      m_KBD = data;
671791   }
672   if (data == 0x11) {  // switch off LEDs -
673         m_KBD = 0x11;
792
793   if (data == LK_CMD_ENB_KEYCLK) {   // enable the keyclick- PARAMETER: VOLUME!
794      m_KBD = data;
674795   }
796
797   if (data == LK_CMD_LEDS_ON ) {  // light LEDs -
798      m_KBD = data;
799   }
800   if (data == LK_CMD_LEDS_OFF) {  // switch off LEDs -
801      m_KBD = data;
802   }
803
804  } // prevent beeps during disk load operations
675805}
676806
677807WRITE8_MEMBER(rainbow_state::PORT91_W)
678808{
679   //printf("KBD PARAM %02x to AH (91) \n", data);
680
681809   // 4 leds, represented in the low 4 bits of a byte
682   if (m_KBD == 0x13) {  // light LEDs -
810   if (m_KBD == LK_CMD_LEDS_ON) {  // light LEDs -
683811      if (data & 1) { output_set_value("led8", 0); } //   KEYBOARD :  "Wait" LED
684812      if (data & 2) { output_set_value("led9", 0); } //   KEYBOARD :  "Compose" LED
685813      if (data & 4) { output_set_value("led10", 0); } //  KEYBOARD :  "Lock" LED
686814      if (data & 8) { output_set_value("led11", 0); } //  KEYBOARD :  "Hold" LED
687815      m_KBD = 0; // reset previous command.
688816   }
689   if (m_KBD == 0x11) {  // switch off LEDs -
817   if (m_KBD == LK_CMD_LEDS_OFF) {  // switch off LEDs -
690818      if (data & 1) { output_set_value("led8", 1); } //   KEYBOARD :  "Wait" LED
691819      if (data & 2) { output_set_value("led9", 1); } //   KEYBOARD :  "Compose" LED
692820      if (data & 4) { output_set_value("led10", 1); } //  KEYBOARD :  "Lock" LED
r26664r26665
694822      m_KBD = 0; // reset previous command.
695823   }
696824
697   if (m_KBD == 0x1b) {   /* enable the keyclick */
698                     /* max volume is 0, lowest is 0x7 */
825   // NVRAM offet $A8 : BELL VOLUME (=> ENABLE BELL 0x23)
826   if ( (m_KBD == LK_CMD_BELL) || (m_KBD == LK_CMD_ENB_BELL) )    /* BOTH sound or enable bell have a parameter */
827   {    /* max volume is 0, lowest is 0x7 */
828//      printf("\n%02x BELL CMD has bell volume = %02x\n", m_KBD, 8 - (data & 7));
699829      m_KBD = 0; // reset previous command.
700830   }
831
832   // NVRAM offet $A9 = KEYCLICK VOLUME (=> ENABLE CLK 0x1b)
833   // NVRAM offset $8C = KEYCLICK ENABLE / DISABLE (0/1)
834   if ( ( m_KBD == LK_CMD_ENB_KEYCLK ) || ( m_KBD == LK_CMD_SOUND_CLK ) )  /* BOTH keyclick cmds have a parameter */
835   {   // max volume is 0, lowest is 0x7  - 87 (BELL VOL:1) and  80 (BELL VOL:8)
836//      printf("\n%02x CLICK CMD - keyclick volume = %02x\n", m_KBD, 8 - (data & 7));
837      m_KBD = 0; // reset previous command.
838   }
839
840if (m_KBD > 0)   
841   printf("UNHANDLED PARAM FOR MODE: %02x / KBD PARAM %02x to AH (91) \n", m_KBD, data);
842
701843}
702
844// 8088 reads port 0x00. See page 133 (4-34)
703845READ8_MEMBER(rainbow_state::i8088_latch_r)
704846{
705847//    printf("Read %02x from 8088 mailbox\n", m_8088_mailbox);
706848   m_i8088->set_input_line(INPUT_LINE_INT0, CLEAR_LINE);
849
850   INT88 = false; // BISLANG:  INTZ80 = false; //   
707851   return m_8088_mailbox;
708852}
709853
854// 8088 writes port 0x00. See page 133 (4-34)
710855WRITE8_MEMBER(rainbow_state::i8088_latch_w)
711856{
712857//    printf("%02x to Z80 mailbox\n", data);
713858   m_z80->set_input_line_and_vector(0, ASSERT_LINE, 0xf7);
714859   m_z80_mailbox = data;
860
861   INTZ80 = true; //
715862}
716863
864// Z80 reads port 0x00
865// See page 134 (4-35)
717866READ8_MEMBER(rainbow_state::z80_latch_r)
718867{
719868//    printf("Read %02x from Z80 mailbox\n", m_z80_mailbox);
720869   m_z80->set_input_line(0, CLEAR_LINE);
870
871   INTZ80 = false; // BISLANG: INT88 = false;
721872   return m_z80_mailbox;
722873}
723874
875// Z80 writes to port 0x00
876// See page 134 (4-35)
724877WRITE8_MEMBER(rainbow_state::z80_latch_w)
725878{
726//    printf("%02x to 8088 mailbox\n", data);
879   //    printf("%02x to 8088 mailbox\n", data);
727880   m_i8088->set_input_line_and_vector(INPUT_LINE_INT0, ASSERT_LINE, 0x27);
728881   m_8088_mailbox = data;
882
883   INT88 = true;
729884}
730885
886// WRITE to 0x20
731887WRITE8_MEMBER(rainbow_state::z80_diskdiag_read_w)
732888{
733889   m_zflip = true;
734890}
735891
892// (Z80) : PORT 21H  _READ_
893READ8_MEMBER(rainbow_state::z80_generalstat_r)
894{
895/*   
896General / diag.status register Z80 / see page 157 (table 4-18).
897
898D7 : STEP L : reflects status of STEP signal _FROM FDC_
899      (when this 2us output pulse is low, the stepper will move into DIR)
900D6 : WRITE GATE L :reflects status of WRITE GATE signal _FROM FDC_
901      (asserted low before data can be written on the diskette)
902D5 : TR00: reflects status of TRACK 0 signal (= 1) * from the disk drive *
903D4 : DIR L: reflects status of DIRECTION signal * FROM FDC * to disk
904      (when low, the head will step towards the center)
905D3 : READY L: reflects status of READY L signal * from the disk drive *
906     (low active, asserts when disk is inserted and door is closed)
907D2 : INT88 L: (bit reads the INT88 bit sent by Z80 to interrupt 8088)
908D1 : INTZ80 L: (bit reads the INTZ80 bit sent by 8088 to interrupt Z80)
909D0 : ZFLIP L: (read from the diagnostic control register of Z80A)
910
911NOTES: ALL LOW ACTIVE - EXCEPT TR00
912*/
913   // * TRACK 00 *  signal for current drive
914   int tk00 = ( floppy_tk00_r( m_image[m_unit] ) == CLEAR_LINE ) ? 0x20 : 0x00;
915
916   int fdc_ready = floppy_drive_get_flag_state( m_image[m_unit] , FLOPPY_DRIVE_READY);
917
918   int data=(   0x80                    |   // (STEP L)
919//           (  (fdc_write_gate) )       |   
920          (  (tk00)           )                             |
921//          (   fdc_direction)                                |     
922           (  (fdc_ready)? 0x00 : 0x08 )                     |
923           (   (INT88)    ? 0x00 : 0x04 )                     |   
924             (   (INTZ80)   ? 0x00 : 0x02 )                     |     
925          (  (m_zflip)  ? 0x00 : 0x01 )
926         );
927   
928   return data;
929}
930
931// (Z80) : PORT 21H * WRITE *
736932WRITE8_MEMBER(rainbow_state::z80_diskdiag_write_w)
737933{
738934/*   Z80 LEDs:
r26664r26665
747943   m_zflip = false;
748944}
749945
750WRITE8_MEMBER(rainbow_state::z80_diskcontrol_write_w)
946// (Z80) : PORT 40H _READ_
947
948// **********************************************************************
949//  POLARITY OF _DRQ_ AND _IRQ_ (depends on controller type!) 
950// **********************************************************************
951READ8_MEMBER(rainbow_state::z80_diskstatus_r)
751952{
752   //printf("%02x to z80 DISK CONTROL (W)\n", data);
953static int last_track;
954int track = wd17xx_track_r(m_fdc, space, 0);
753955
754   // TODO: this logic is a bit primitive. According to the spec, the RX-50 drive LED only turns on if
755   //       (a) spindle motor runs (b) disk is in drive (c) door closed (d) drive side is selected
756   if ( (data & 1) && (data & 8) )
757      output_set_value("led20", 0); // DISKETTE 0 SELECTED & MOTOR 0 ON => LIGHT "DRIVE A"
956if (track != last_track)
957   printf("\n%02d",track);
958last_track = track;
959
960// 40H diskette status Register **** READ ONLY *** ( 4-60 of TM100.pdf )
961
962// AND 00111011 - return what was WRITTEN to D5-D3, D1, D0 previously
963//                (except D7,D6,D2)
964int data = m_z80_diskcontrol && 0x3b;       
965
966// D7: DRQ: reflects status of DATA REQUEST signal from FDC.
967// '1' indicates that FDC has read data OR requires new write data.
968data |= wd17xx_drq_r(m_fdc) ? 0x80 : 0x00; 
969
970// D6: IRQ: indicates INTERRUPT REQUEST signal from FDC. Indicates that a
971//          status bit has changed. Set to 1 at the completion of any
972//          command (.. see page 207 or 5-25).
973data |= wd17xx_intrq_r(m_fdc) ? 0x40 : 0x00;                       
974
975// D5: SIDE 0H: status of side select signal at J2 + J3 of RX50 controller.
976//               For 1 sided drives, this bit will always read low (0).
977
978// D4: MOTOR 1 ON L: 0 = indicates MOTOR 1 ON bit is set in drive control reg.
979// D3: MOTOR 0 ON L: 0 = indicates MOTOR 0 ON bit is set in drive  "
980
981// D2: TG43 L :  0 = INDICATES TRACK > 43 SIGNAL FROM FDC TO DISK DRIVE.
982data |= ( track > 43) ? 0x00 : 0x04;
983
984// D1: DS1 H: reflect status of bits 0 and 1 form disk.control reg.
985// D0: DS0 H: " 
986  return data;
987}
988
989// (Z80) : PORT 40H  * WRITE *
990
991// RX-50 has head A and head B (1 for each of the 2 disk slots in a RX-50).
992
993// TODO: find out how head load and drive select really work.
994WRITE8_MEMBER(rainbow_state::z80_diskcontrol_w)
995{
996   // FORCE_READY = 0 : assert DRIVE READY on FDC (diagnostic override; USED BY BIOS!)
997   //               1 : set ready only if drive is present, disk is in the drive,
998   //                   and disk motor is on - for Amstrad, Spectrum, PCW...
999   int force_ready = ( (data & 4) != 0 ) ? 0 : 1;
1000
1001   int drive;
1002   if ( m_inp6->read() && ((data & 3) < 2) )
1003      drive = (data & 1) + 2;
7581004   else
759      output_set_value("led20", 1);
1005      drive = data & 3;
7601006
761   if ( (data & 2) && (data & 8) )
762      output_set_value("led21", 0); // DISKETTE 1 SELECTED & MOTOR 0 ON => LIGHT "DRIVE B"
763   else
764      output_set_value("led21", 1);
1007   int selected_drive = 255;
1008
1009   if (flopimg_get_image( floppy_get_device( machine(), drive ) ) != NULL)
1010   {   selected_drive = drive;
1011      wd17xx_set_drive(m_fdc, selected_drive);
1012   }
1013
1014   // WD emulation (wd17xx.c) will ignore 'side select' if set to WD1793.
1015   // Is it safe to * always assume * single sided 400 K disks?
1016   wd17xx_set_side(m_fdc, (data & 20) ? 1 : 0); 
1017
1018   wd17xx_dden_w(m_fdc, 0); /* SEE 'WRITE_TRACK' : 1 = SD; 0 = DD; enable double density */
1019
1020    output_set_value("driveled0",  (selected_drive == 0) ? 1 : 0 );
1021   output_set_value("driveled1",  (selected_drive == 1) ? 1 : 0 );
1022
1023   output_set_value("driveled2",  (selected_drive == 2) ? 1 : 0 );
1024   output_set_value("driveled3",  (selected_drive == 3) ? 1 : 0 );
1025
1026   if (selected_drive < 4)
1027   {       
1028         m_unit = selected_drive;
1029
1030         // MOTOR ON flags 1+2 proved to be unreliable in this context.
1031         // So this timeout only disables LEDs.
1032         MOTOR_DISABLE_counter = 10000; // prolonged timeout. DEFAULT: 2400 = 500 ms
1033
1034         for(int f_num=0; f_num <= 3; f_num++)
1035         {
1036            // Although 1773 does not feature 'motor on' this statement is required:
1037            // CLEAR_LINE = turn motor on -
1038            floppy_mon_w(m_image[f_num], (f_num == selected_drive) ? CLEAR_LINE : ASSERT_LINE);
1039
1040            // Parameters: DRIVE, STATE, FLAG
1041            floppy_drive_set_ready_state( m_image[f_num],
1042                                         (f_num == selected_drive) ? 1 : 0,
1043                                   (f_num == selected_drive) ? force_ready : 0
1044                                 );
1045         }   
1046   }
1047
1048   m_z80_diskcontrol = data;
7651049}
7661050
7671051READ8_MEMBER( rainbow_state::read_video_ram_r )
r26664r26665
7721056INTERRUPT_GEN_MEMBER(rainbow_state::vblank_irq)
7731057{
7741058   device.execute().set_input_line_and_vector(INPUT_LINE_INT0, ASSERT_LINE, 0x20);
775
776   MHFU_reset();
7771059}
7781060
7791061WRITE8_MEMBER( rainbow_state::clear_video_interrupt )
r26664r26665
7971079//    printf("%02x to diag port (PC=%x)\n", data, space.device().safe_pc());
7981080   m_SCREEN_BLANK = (data & 2) ? false : true;
7991081
800   if ( !(data & 0x40)  && (m_diagnostic & 0x40) ) // if set to 1 (first) and later set to 0...
801   { 
802      //  SAVE / PROGRAM NVM: transfer data from volatile memory to NVM
1082   //  SAVE / PROGRAM NVM: transfer data from volatile memory to NVM
1083   if ( !(data & 0x40)  && (m_diagnostic & 0x40) )
8031084      memcpy( m_p_nvram, m_p_vol_ram, 256);
804   }
8051085
806   if ( (data & 0x80)  && !(m_diagnostic & 0x80) ) // if set to 0 (first) and later set to 1...
807   {
808       // READ / RECALL NVM: transfer data from NVM to volatile memory
1086   // READ / RECALL NVM: transfer data from NVM to volatile memory
1087   if ( (data & 0x80)  && !(m_diagnostic & 0x80) )
8091088      memcpy( m_p_vol_ram, m_p_nvram, 256);
810   }
8111089     
8121090   if (!(data & 1))
8131091   {
r26664r26665
8231101      m_z80->reset();
8241102   }
8251103
1104   /*   Page 197 or 5-13 of formatter description:
1105      ZRESET L : this low input from the 8088 diagnostic write register
1106      resets the formatter controller, loads 03H into the command register,
1107      and resets the not ready (status bit 7).
1108
1109      When ZRESET goes high (1), a restore command is executed regardless
1110      of the state of the ready signal from the diskette drive and
1111      01H is loaded into the sector register.
1112   */
1113   
1114   // reset device when going from high to low,
1115   // restore command when going from low to high :
1116   wd17xx_mr_w(m_fdc, (data & 1) ? 1 : 0);
1117
8261118   m_diagnostic = data;
8271119}
8281120
r26664r26665
8761168   m_kbd8251->transmit_clock();
8771169   m_kbd8251->receive_clock();
8781170
879   if ( m_crtc->dc012_MHFU() ) // MHFU ENABLED?
880    {   
881            if (MHFU_counter)
882               MHFU_counter--;
1171   if (MOTOR_DISABLE_counter)
1172      MOTOR_DISABLE_counter--;
8831173
884             if (MHFU_counter == 1) // resets ONCE.
885            {
886                  printf("*** CPU RESET: MASSIVE HARDWARE FAILURE DETECTED (MHFU LOGIC ~108 ms)\n");
887                  m_i8088->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
888            }
1174   if (MOTOR_DISABLE_counter == 1)
1175   {
1176         output_set_value("driveled0", 0); // DRIVE 0 (A)
1177         output_set_value("driveled1", 0); // DRIVE 1 (B)
1178         output_set_value("driveled2", 0); // DRIVE 2 (C)
1179         output_set_value("driveled3", 0); // DRIVE 3 (D)
8891180   }
8901181
1182    if ( m_crtc->MHFU(1) ) // MHFU ENABLED ?
1183    {           
1184/*            int data = m_crtc->MHFU(-1); // increment MHFU, return new value
1185                //  if (data >  480) ...
1186            //      m_crtc->MHFU(-100);
1187            //      machine().schedule_hard_reset(); // not exactly a proper watchdog reset
1188*/           
1189   }
1190
8911191   if (m_beep_counter > 1)
8921192         m_beep_counter--;
8931193   else
r26664r26665
9281228   DEVCB_NULL,
9291229   DEVCB_NULL,
9301230   DEVCB_NULL,
931   {FLOPPY_0, FLOPPY_1}
1231   {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
9321232};
9331233
9341234static const floppy_interface floppy_intf =
r26664r26665
9381238   DEVCB_NULL,
9391239   DEVCB_NULL,
9401240   DEVCB_NULL,
941   FLOPPY_STANDARD_5_25_SSDD,
942   LEGACY_FLOPPY_OPTIONS_NAME(default),
1241   FLOPPY_STANDARD_5_25_SSDD_80,
1242   LEGACY_FLOPPY_OPTIONS_NAME( dec100_floppy ),
9431243   "floppy_5_25",
9441244   NULL
9451245};
r26664r26665
9881288   MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
9891289
9901290   MCFG_FD1793_ADD("wd1793", rainbow_wd17xx_interface )
991   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf)
1291   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(floppy_intf)
9921292   MCFG_SOFTWARE_LIST_ADD("flop_list","rainbow")
9931293
9941294   MCFG_I8251_ADD("kbdser", i8251_intf)
r26664r26665
9981298   MCFG_NVRAM_ADD_0FILL("nvram")
9991299MACHINE_CONFIG_END
10001300
1001/* ROM definition */
1301
1302
1303// ROM definition for 100-B
10021304ROM_START( rainbow )
10031305   ROM_REGION(0x100000,"maincpu", 0)
10041306   ROM_LOAD( "23-022e5-00.bin",  0xf0000, 0x4000, CRC(9d1332b4) SHA1(736306d2a36bd44f95a39b36ebbab211cc8fea6e))
r26664r26665
10131315   ROM_LOAD( "chargen.bin", 0x0000, 0x1000, CRC(1685e452) SHA1(bc299ff1cb74afcededf1a7beb9001188fdcf02f))
10141316ROM_END
10151317
1318// 'Rainbow 190 B' (announced March 1985) is identical hardware with alternate ROM v5.05
1319// According to an article in Wall Street Journal, it came with a 10 MB HD and 640 K RAM.
1320
1321// We have no version history. The BOOT 2.4 README reveals 'recent ROM changes for MASS 11'
1322// in January 1985. These were not contained in the older version 04.03.11 (for PC-100-A)
1323// and also not present in version 05.03 (from PC-100B / PC100B+).
1324
1325// A first glance:
1326// => jump tables (F4000-F40083 and FC000-FC004D) were not extended.
1327// => absolute addresses of some internal routines have changed.
1328// => programs that do not rely on specific ROM versions should be compatible.
1329ROM_START( rainb190 )
1330   ROM_REGION(0x100000,"maincpu", 0)
1331   ROM_LOAD( "dec190rom0.bin",  0xf0000, 0x4000, CRC(FAC191D2) )
1332   ROM_RELOAD(0xf4000,0x4000)
1333   ROM_LOAD( "dec190rom1.bin", 0xf8000, 0x4000, CRC(5CE59632) )
1334
1335   ROM_RELOAD(0xfc000,0x4000)
1336   ROM_REGION(0x1000, "chargen", 0)
1337   ROM_LOAD( "chargen.bin", 0x0000, 0x1000, CRC(1685e452) SHA1(bc299ff1cb74afcededf1a7beb9001188fdcf02f))
1338ROM_END
1339
10161340/* Driver */
10171341
1018/*    YEAR  NAME     PARENT  COMPAT   MACHINE    INPUT    STATE          INIT COMPANY                         FULLNAME       FLAGS */
1019COMP( 1982, rainbow, 0,      0,       rainbow,   rainbow, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 100B", GAME_NOT_WORKING | GAME_IMPERFECT_COLORS)
1342/*    YEAR  NAME         PARENT   COMPAT  MACHINE       INPUT      STATE          INIT COMPANY                         FULLNAME       FLAGS */
1343COMP( 1983, rainbow   , 0      ,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 100-B", GAME_NOT_WORKING | GAME_IMPERFECT_COLORS)
1344COMP( 1985, rainb190, rainbow,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 190-B", GAME_NOT_WORKING | GAME_IMPERFECT_COLORS)
No newline at end of file

Previous 199869 Revisions Next


© 1997-2024 The MAME Team