Previous 15994 Revisions Next

r15316 Friday 25th May, 2012 at 14:02:23 UTC by Curt Coder
[WANGPC] Now showing some video. (nw)
[src/mess/drivers]wangpc.c
[src/mess/includes]wangpc.h
[src/mess/machine]wangpc_lic.c wangpc_lvc.c wangpc_lvc.h wangpc_rtc.c wangpc_wdc.c wangpcbus.c wangpckb.c

src/mess/machine/wangpc_lvc.c
r15315r15316
2222
2323#define RAM_SIZE      0x8000
2424
25#define OPTION_VRAM      BIT(m_option, 0)
26#define OPTION_80_COL   BIT(m_option, 2)
27#define OPTION_VSYNC   BIT(m_option, 3)
2528
2629
30
2731//**************************************************************************
2832//  DEVICE DEFINITIONS
2933//**************************************************************************
r15315r15316
3741
3842void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
3943{
40/*  const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
41    for (int column = 0; column < x_count; column++)
42    {
43        UINT8 code = m_video_ram[((ma + column) & 0x7ff)];
44        UINT16 addr = (code << 3) | (ra & 0x07);
45        UINT8 data = m_char_rom[addr & 0x7ff];
44   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
4645
47        if (column == cursor_x)
48        {
49            data = 0xff;
50        }
46   offs_t scroll_y = (((m_scroll >> 8) + 0x15) & 0xff) * 0x140;
5147
52        for (int bit = 0; bit < 8; bit++)
53        {
54            int x = (column * 8) + bit;
55            int color = BIT(data, 7) ? 7 : 0;
48   if (OPTION_80_COL)
49   {
50       for (int column = 0; column < x_count; column++)
51       {
52          offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + ((ma / 80) * 0x140) + (((ra & 0x0f) << 8) | ((column & 0x7f) << 1));
53           UINT16 data = m_video_ram[addr & 0x7fff];
5654
57            bitmap.pix32(y, x) = palette[color];
55           for (int bit = 0; bit < 8; bit++)
56           {
57               int x = (column * 8) + bit;
58               int color = (BIT(data, 15) << 1) | BIT(data, 7);
5859
59            data <<= 1;
60        }
61    }*/
60               bitmap.pix32(y, x) = palette[color];
61
62               data <<= 1;
63           }
64       }
65   }
66   else
67   {
68       for (int column = 0; column < x_count; column++)
69       {
70          offs_t addr = scroll_y + ((m_scroll & 0x3f) << 2) + ((ma / 40) * 0x140) + (((ra & 0x0f) << 8) | ((column & 0x3f) << 2));
71           UINT32 data = (m_video_ram[(addr + 1) & 0x7fff] << 16) | m_video_ram[addr & 0x7fff];
72
73           for (int bit = 0; bit < 8; bit++)
74           {
75               int x = (column * 8) + bit;
76               int color = (BIT(data, 31) << 3) | (BIT(data, 23) << 2) | (BIT(data, 15) << 1) | BIT(data, 7);
77
78               bitmap.pix32(y, x) = palette[color];
79
80               data <<= 1;
81           }
82       }
83   }
6284}
6385
6486static MC6845_UPDATE_ROW( wangpc_lvc_update_row )
6587{
6688   wangpc_lvc_device *lores = downcast<wangpc_lvc_device *>(device->owner());
89
6790   lores->crtc_update_row(device,bitmap,cliprect,ma,ra,y,x_count,cursor_x,param);
6891}
6992
7093WRITE_LINE_MEMBER( wangpc_lvc_device::vsync_w )
7194{
72   if (BIT(m_option, 3) && state)
95   if (OPTION_VSYNC && state)
7396   {
74      m_irq3 = ASSERT_LINE;
75      m_bus->irq3_w(m_irq3);
97      set_irq(ASSERT_LINE);
7698   }
7799}
78100
r15315r15316
87109   DEVCB_NULL,
88110   DEVCB_NULL,
89111   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_lvc_device, vsync_w),
90   NULL
112   NULL
91113};
92114
93115
r15315r15316
122144
123145
124146//**************************************************************************
147//  INLINE HELPERS
148//**************************************************************************
149
150//-------------------------------------------------
151//  set_irq2 -
152//-------------------------------------------------
153
154inline void wangpc_lvc_device::set_irq(int state)
155{
156   m_irq = state;
157
158   m_bus->irq3_w(m_irq);
159}
160
161
162
163//**************************************************************************
125164//  LIVE DEVICE
126165//**************************************************************************
127166
r15315r15316
134173   device_wangpcbus_card_interface(mconfig, *this),
135174   m_crtc(*this, MC6845_TAG),
136175   m_option(0),
137   m_irq3(CLEAR_LINE)
176   m_irq(CLEAR_LINE)
138177{
139178}
140179
r15315r15316
150189
151190   // state saving
152191   save_pointer(NAME(m_video_ram), RAM_SIZE);
192   save_item(NAME(m_option));
193   save_item(NAME(m_scroll));
194   save_item(NAME(m_irq));
153195}
154196
155197
r15315r15316
159201
160202void wangpc_lvc_device::device_reset()
161203{
204   m_option = 0;
205
206   set_irq(CLEAR_LINE);
162207}
163208
164209
r15315r15316
170215{
171216   UINT16 data = 0xffff;
172217
173   if (BIT(m_option, 0) && (offset >= 0xe0000/2) && (offset < 0xf0000/2))
218   if (OPTION_VRAM && (offset >= 0xe0000/2) && (offset < 0xf0000/2))
174219   {
175      data = m_video_ram[offset];
220      offs_t addr = offset & 0x7fff;
221
222      data = m_video_ram[addr];
176223   }
177224
178225   return data;
r15315r15316
185232
186233void wangpc_lvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
187234{
188   if (BIT(m_option, 0) && (offset >= 0xe0000/2) && (offset < 0xf0000/2))
235   if (OPTION_VRAM && (offset >= 0xe0000/2) && (offset < 0xf0000/2))
189236   {
190      m_video_ram[offset] = data;
237      offs_t addr = offset & 0x7fff;
238
239      m_video_ram[addr] = data;
191240   }
192241}
193242
r15315r15316
216265         break;
217266
218267      case 0xfe/2:
219         data = 0xff00 | (m_irq3 << 7) | OPTION_ID;
268         data = 0xff00 | (m_irq << 7) | OPTION_ID;
220269         break;
221270      }
222
223      logerror("Lores read %04x %04x %04x\n", offset << 1, mem_mask, data);
224271   }
225272
226273   return data;
r15315r15316
231278//  wangpcbus_aiowc_w - I/O write
232279//-------------------------------------------------
233280
234void wangpc_lvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
281void wangpc_lvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
235282{
236283   if (sad(offset))
237284   {
238      logerror("Lores write %04x %04x %04x\n", offset << 1, mem_mask, data);
285      logerror("Lores write %06x: %04x\n", offset, data);
239286
240287      switch (offset & 0x7f)
241288      {
242289      case 0x00/2:
243290         if (ACCESSING_BITS_0_7)
291         {
244292            m_crtc->address_w(space, 0, data & 0xff);
293         }
245294         break;
246295
247296      case 0x02/2:
248297         if (ACCESSING_BITS_0_7)
298         {
249299            m_crtc->register_w(space, 0, data & 0xff);
300         }
250301         break;
251302
252303      case 0x10/2:
253304         if (ACCESSING_BITS_0_7)
305         {
254306            m_option = data & 0xff;
307         }
255308         break;
256309
257310      case 0x20/2:
258311         m_scroll = data;
259312         break;
260313
314      case 0x40/2: case 0x42/2: case 0x44/2: case 0x46/2: case 0x48/2: case 0x4a/2: case 0x4c/2: case 0x4e/2:
315      case 0x50/2: case 0x52/2: case 0x55/2: case 0x56/2: case 0x58/2: case 0x5a/2: case 0x5c/2: case 0x5e/2:
316         {
317            offs_t index = offset & 0x0f;
318
319            int i = BIT(data, 15);
320            int r = BIT(data, 11) ? (i ? 0xff : 0x80) : 0;
321            int g = BIT(data, 7) ? (i ? 0xff : 0x80) : 0;
322            int b = BIT(data, 3) ? (i ? 0xff : 0x80) : 0;
323
324            palette_set_color_rgb(machine(), index, r, g, b);
325         }
326         break;
327
261328      case 0x70/2:
262         m_irq3 = CLEAR_LINE;
263         m_bus->irq3_w(m_irq3);
329         set_irq(CLEAR_LINE);
264330         break;
265331      }
266332   }
src/mess/machine/wangpc_lvc.h
r15315r15316
5252   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
5353
5454private:
55   inline void set_irq(int state);
56
5557   // internal state
5658   required_device<mc6845_device> m_crtc;
5759
5860   UINT16 *m_video_ram;
59   UINT8 m_attr[16];
6061   UINT8 m_option;
6162   UINT16 m_scroll;
62   int m_irq3;
63   int m_irq;
6364};
6465
6566
src/mess/machine/wangpckb.c
r15315r15316
4141 
4242*/
4343 
44/*
45 
46    TODO:
47 
48    - mcs51.c does not support 9-bit serial I/O
49 
50*/
51 
4452#include "wangpckb.h"
4553 
4654 
src/mess/machine/wangpc_rtc.c
r15315r15316
337337//  wangpcbus_aiowc_w - I/O write
338338//-------------------------------------------------
339339
340void wangpc_rtc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
340void wangpc_rtc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
341341{
342342   if (sad(offset))
343343   {
src/mess/machine/wangpc_wdc.c
r15315r15316
204204//  wangpcbus_aiowc_w - I/O write
205205//-------------------------------------------------
206206
207void wangpc_wdc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
207void wangpc_wdc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
208208{
209209   if (sad(offset))
210210   {
src/mess/machine/wangpcbus.c
r15315r15316
162162 
163163   while (entry)
164164   {
165      data |= entry->wangpcbus_mrdc_r(space, offset, mem_mask);
165      data &= entry->wangpcbus_mrdc_r(space, offset + 0x40000/2, mem_mask);
166166      entry = entry->next();
167167   }
168168 
r15315r15316
180180 
181181   while (entry)
182182   {
183      entry->wangpcbus_amwc_w(space, offset, mem_mask, data);
183      entry->wangpcbus_amwc_w(space, offset + 0x40000/2, mem_mask, data);
184184      entry = entry->next();
185185   }
186186}
r15315r15316
198198 
199199   while (entry)
200200   {
201      data |= entry->wangpcbus_iorc_r(space, offset + 0x880, mem_mask);
201      data &= entry->wangpcbus_iorc_r(space, offset + 0x1100/2, mem_mask);
202202      entry = entry->next();
203203   }
204204 
r15315r15316
216216 
217217   while (entry)
218218   {
219      entry->wangpcbus_aiowc_w(space, offset + 0x880, mem_mask, data);
219      entry->wangpcbus_aiowc_w(space, offset + 0x1100/2, mem_mask, data);
220220      entry = entry->next();
221221   }
222222}
src/mess/machine/wangpc_lic.c
r15315r15316
146146//  wangpcbus_aiowc_w - I/O write
147147//-------------------------------------------------
148148
149void wangpc_lic_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
149void wangpc_lic_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
150150{
151151   if (sad(offset))
152152   {
src/mess/includes/wangpc.h
r15315r15316
5959        m_uart_dr(0),
6060        m_uart_tbre(0),
6161        m_fpu_irq(0),
62        m_bus_irq2(0),
6263        m_fdc_tc_enable(0),
6364        m_fdc_dma_enable(1),
6465        m_fdc_drq(1),
r15315r15316
8384   virtual void machine_start();
8485   virtual void machine_reset();
8586 
87   void select_drive(int drive, bool select);
88   void set_motor(int drive, bool motor);
89   void fdc_reset();
90   void fdc_tc();
8691   void check_level1_interrupts();
8792   void check_level2_interrupts();
8893   void update_fdc_drq();
r15315r15316
167172   int m_uart_dr;
168173   int m_uart_tbre;
169174   int m_fpu_irq;
175   int m_bus_irq2;
170176 
171177   int m_fdc_tc_enable;
172178   int m_fdc_dma_enable;
r15315r15316
174180   int m_ds1;
175181   int m_ds2;
176182 
177   int m_led[6];
183   int m_led[6]; // HACK until keyboard works
178184};
179185 
180186 
src/mess/drivers/wangpc.c
r15315r15316
88 
99*/
1010 
11/*
12 
13   TODO:
14 
15   - boot
16   - keyboard
17   - floppy
18   - serial
19   - hard disk
20 
21*/
22 
1123#include "includes/wangpc.h"
1224 
1325 
r15315r15316
2941//  DIRECT MEMORY ACCESS
3042//**************************************************************************
3143 
44void wangpc_state::select_drive(int drive, bool select)
45{
46   if (LOG) logerror("%sselect drive %u\n", select ? "" : "De", drive + 1);
47 
48   int state = select ? 0 : 1;
49 
50   if (!drive)
51   {
52      m_ds1 = state;
53   }
54   else
55   {
56      m_ds2 = state;
57   }
58}
59 
60void wangpc_state::set_motor(int drive, bool motor)
61{
62   if (LOG) logerror("Motor %u %s\n", drive + 1, motor ? "on" : "off");
63 
64   int state = motor ? 0 : 1;
65 
66   if (!drive)
67   {
68      floppy_mon_w(m_floppy0, state);
69   }
70   else
71   {
72      floppy_mon_w(m_floppy1, state);
73   }
74}
75 
76void wangpc_state::fdc_reset()
77{
78    if (LOG) logerror("FDC reset\n");
79 
80   upd765_reset_w(m_fdc, 1);
81   upd765_reset_w(m_fdc, 0);
82}
83 
84void wangpc_state::fdc_tc()
85{
86    if (LOG) logerror("FDC TC\n");
87 
88   upd765_tc_w(m_fdc, 1);
89   upd765_tc_w(m_fdc, 0);
90}
91 
3292WRITE8_MEMBER( wangpc_state::fdc_ctrl_w )
3393{
3494   /*
r15315r15316
59119 
60120READ8_MEMBER( wangpc_state::deselect_drive1_r )
61121{
62    if (LOG) logerror("Deselect drive 1\n");
122   select_drive(0, false);
63123 
64      m_ds1 = 1;
65 
66   return 0;
124   return 0xff;
67125}
68126 
69127 
70128WRITE8_MEMBER( wangpc_state::deselect_drive1_w )
71129{
72    if (LOG) logerror("Deselect drive 1\n");
73 
74   m_ds1 = 1;
130   select_drive(0, false);
75131}
76132 
77133 
78134READ8_MEMBER( wangpc_state::select_drive1_r )
79135{
80    if (LOG) logerror("Select drive 1\n");
136   select_drive(0, true);
81137 
82   m_ds1 = 0;
83 
84   return 0;
138   return 0xff;
85139}
86140 
87141 
88142WRITE8_MEMBER( wangpc_state::select_drive1_w )
89143{
90    if (LOG) logerror("Select drive 1\n");
91 
92   m_ds1 = 0;
144   select_drive(0, true);
93145}
94146 
95147 
96148READ8_MEMBER( wangpc_state::deselect_drive2_r )
97149{
98    if (LOG) logerror("Deselect drive 2\n");
150   select_drive(1, false);
99151 
100   m_ds2 = 1;
101 
102   return 0;
152   return 0xff;
103153}
104154 
105155 
106156WRITE8_MEMBER( wangpc_state::deselect_drive2_w )
107157{
108    if (LOG) logerror("Deselect drive 2\n");
109 
110   m_ds2 = 1;
158   select_drive(1, false);
111159}
112160 
113161 
114162READ8_MEMBER( wangpc_state::select_drive2_r )
115163{
116    if (LOG) logerror("Select drive 2\n");
164   select_drive(1, true);
117165 
118   m_ds2 = 0;
119 
120   return 0;
166   return 0xff;
121167}
122168 
123169 
124170WRITE8_MEMBER( wangpc_state::select_drive2_w )
125171{
126    if (LOG) logerror("Select drive 2\n");
127 
128   m_ds2 = 0;
172   select_drive(1, true);
129173}
130174 
131175 
132176READ8_MEMBER( wangpc_state::motor1_off_r )
133177{
134    if (LOG) logerror("Motor 1 off\n");
135   
136   floppy_mon_w(m_floppy0, 1);
178   set_motor(0, false);
137179 
138   return 0;
180   return 0xff;
139181}
140182 
141183 
142184WRITE8_MEMBER( wangpc_state::motor1_off_w )
143185{
144    if (LOG) logerror("Motor 1 off\n");
145 
146   floppy_mon_w(m_floppy0, 1);
186   set_motor(0, false);
147187}
148188 
149189 
150190READ8_MEMBER( wangpc_state::motor1_on_r )
151191{
152    if (LOG) logerror("Motor 1 on\n");
192   set_motor(0, true);
153193 
154   floppy_mon_w(m_floppy0, 0);
155 
156   return 0;
194   return 0xff;
157195}
158196 
159197 
160198WRITE8_MEMBER( wangpc_state::motor1_on_w )
161199{
162    if (LOG) logerror("Motor 1 on\n");
163 
164   floppy_mon_w(m_floppy0, 0);
200   set_motor(0, true);
165201}
166202 
167203 
168204READ8_MEMBER( wangpc_state::motor2_off_r )
169205{
170    if (LOG) logerror("Motor 2 off\n");
206   set_motor(1, false);
171207 
172   floppy_mon_w(m_floppy1, 1);
173 
174   return 0;
208   return 0xff;
175209}
176210 
177211 
178212WRITE8_MEMBER( wangpc_state::motor2_off_w )
179213{
180    if (LOG) logerror("Motor 2 off\n");
181 
182   floppy_mon_w(m_floppy1, 1);
214   set_motor(1, false);
183215}
184216 
185217 
186218READ8_MEMBER( wangpc_state::motor2_on_r )
187219{
188    if (LOG) logerror("Motor 2 on\n");
220   set_motor(1, true);
189221 
190   floppy_mon_w(m_floppy1, 0);
191 
192   return 0;
222   return 0xff;
193223}
194224 
195225 
196226WRITE8_MEMBER( wangpc_state::motor2_on_w )
197227{
198    if (LOG) logerror("Motor 2 on\n");
199 
200   floppy_mon_w(m_floppy1, 0);
228   set_motor(1, true);
201229}
202230 
203231 
204232READ8_MEMBER( wangpc_state::fdc_reset_r )
205233{
206    if (LOG) logerror("FDC reset\n");
234   fdc_reset();
207235 
208   upd765_reset_w(m_fdc, 1);
209   upd765_reset_w(m_fdc, 0);
210 
211   return 0;
236   return 0xff;
212237}
213238 
214239 
215240WRITE8_MEMBER( wangpc_state::fdc_reset_w )
216241{
217    if (LOG) logerror("FDC reset\n");
218 
219   upd765_reset_w(m_fdc, 1);
220   upd765_reset_w(m_fdc, 0);
242   fdc_reset();
221243}
222244 
223245 
224246READ8_MEMBER( wangpc_state::fdc_tc_r )
225247{
226    if (LOG) logerror("FDC TC\n");
248   fdc_tc();
227249 
228   upd765_tc_w(m_fdc, 1);
229   upd765_tc_w(m_fdc, 0);
230 
231   return 0;
250   return 0xff;
232251}
233252 
234253 
235254WRITE8_MEMBER( wangpc_state::fdc_tc_w )
236255{
237    if (LOG) logerror("FDC TC\n");
238 
239   upd765_tc_w(m_fdc, 1);
240   upd765_tc_w(m_fdc, 0);
256   fdc_tc();
241257}
242258 
243259 
r15315r15316
290306 
291307WRITE8_MEMBER( wangpc_state::timer0_irq_clr_w )
292308{
293    if (LOG) logerror("Timer 0 IRQ clear\n");
309    //if (LOG) logerror("Timer 0 IRQ clear\n");
294310 
295311   pic8259_ir0_w(m_pic, CLEAR_LINE);
296312}
r15315r15316
302318 
303319READ8_MEMBER( wangpc_state::timer2_irq_clr_r )
304320{
305    if (LOG) logerror("Timer 2 IRQ clear\n");
321    //if (LOG) logerror("Timer 2 IRQ clear\n");
306322 
307323   m_timer2_irq = 1;
308324   check_level1_interrupts();
309325 
310   return 0;
326   return 0xff;
311327}
312328 
313329 
r15315r15316
331347 
332348   output_set_led_value(LED_DIAGNOSTIC, 1);
333349 
334   return 0;
350   return 0xff;
335351}
336352 
337353 
r15315r15316
397413    case 0x1d: m_led[0] = m_led[1] = m_led[2] = m_led[3] = m_led[4] = m_led[5] = 0; break;
398414    }
399415 
400    popmessage("%u%u%u%u%u%u", m_led[0], m_led[1], m_led[2], m_led[3], m_led[4], m_led[5]);
416    if (LOG) popmessage("%u%u%u%u%u%u", m_led[0], m_led[1], m_led[2], m_led[3], m_led[4], m_led[5]);
401417 
402418   m_uart_tbre = 0;
403419   check_level2_interrupts();
r15315r15316
446462   m_busy = 1;
447463   check_level1_interrupts();
448464 
449   return 0;
465   return 0xff;
450466}
451467 
452468 
r15315r15316
473489 
474490   output_set_led_value(LED_DIAGNOSTIC, 0);
475491 
476   return 0;
492   return 0xff;
477493}
478494 
479495 
r15315r15316
527543//-------------------------------------------------
528544 
529545static ADDRESS_MAP_START( wangpc_mem, AS_PROGRAM, 16, wangpc_state )
530//  AM_RANGE(0x00000, 0xfffff) AM_READWRITE(mrdc_r, amwc_c)
546   ADDRESS_MAP_UNMAP_HIGH
531547   AM_RANGE(0x00000, 0x1ffff) AM_RAM
548   AM_RANGE(0x40000, 0xf3fff) AM_DEVREADWRITE(WANGPC_BUS_TAG, wangpcbus_device, mrdc_r, amwc_w)
532549   AM_RANGE(0xfc000, 0xfffff) AM_ROM AM_REGION(I8086_TAG, 0)
533550ADDRESS_MAP_END
534551 
r15315r15316
538555//-------------------------------------------------
539556 
540557static ADDRESS_MAP_START( wangpc_io, AS_IO, 16, wangpc_state )
558   ADDRESS_MAP_UNMAP_HIGH
541559   AM_RANGE(0x1000, 0x1001) AM_WRITE8(fdc_ctrl_w, 0x00ff)
542560   AM_RANGE(0x1004, 0x1005) AM_READWRITE8(deselect_drive1_r, deselect_drive1_w, 0x00ff)
543561   AM_RANGE(0x1006, 0x1007) AM_READWRITE8(select_drive1_r, select_drive1_w, 0x00ff)
r15315r15316
545563   AM_RANGE(0x100a, 0x100b) AM_READWRITE8(select_drive2_r, select_drive2_w, 0x00ff)
546564   AM_RANGE(0x100c, 0x100d) AM_READWRITE8(motor1_off_r, motor1_off_w, 0x00ff)
547565   AM_RANGE(0x100e, 0x100f) AM_READWRITE8(motor1_on_r, motor1_on_w, 0x00ff)
548   AM_RANGE(0x1010, 0x1011) AM_READWRITE8(motor1_off_r, motor1_off_w, 0x00ff)
549   AM_RANGE(0x1012, 0x1013) AM_READWRITE8(motor1_on_r, motor1_on_w, 0x00ff)
566   AM_RANGE(0x1010, 0x1011) AM_READWRITE8(motor2_off_r, motor2_off_w, 0x00ff)
567   AM_RANGE(0x1012, 0x1013) AM_READWRITE8(motor2_on_r, motor2_on_w, 0x00ff)
550568   AM_RANGE(0x1014, 0x1015) AM_DEVREAD8_LEGACY(UPD765_TAG, upd765_status_r, 0x00ff)
551569   AM_RANGE(0x1016, 0x1017) AM_DEVREADWRITE8_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w, 0x00ff)
552570   AM_RANGE(0x1018, 0x1019) AM_MIRROR(0x0002) AM_READWRITE8(fdc_reset_r, fdc_reset_w, 0x00ff)
r15315r15316
584602   // keyboard defined in machine/wangpckb.c
585603 
586604   PORT_START("SW")
587   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW:1")
588   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
589   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
590   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW:2")
591   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
592   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
593   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW:3")
594   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
595   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
596   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW:4")
597   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
598   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
605   PORT_DIPNAME( 0x0f, 0x0f, "CPU Baud Rate" )   PORT_DIPLOCATION("SW:1,2,3,4")
606   PORT_DIPSETTING(    0x0f, "19200" )
607   PORT_DIPSETTING(    0x0e, "9600" )
608   PORT_DIPSETTING(    0x0d, "7200" )
609   PORT_DIPSETTING(    0x0c, "4800" )
610   PORT_DIPSETTING(    0x0b, "3600" )
611   PORT_DIPSETTING(    0x0a, "2400" )
612   PORT_DIPSETTING(    0x09, "2000" )
613   PORT_DIPSETTING(    0x08, "1800" )
614   PORT_DIPSETTING(    0x07, "1200" )
615   PORT_DIPSETTING(    0x06, "600" )
616   PORT_DIPSETTING(    0x05, "300" )
617   PORT_DIPSETTING(    0x04, "150" )
618   PORT_DIPSETTING(    0x03, "134.5" )
619   PORT_DIPSETTING(    0x02, "110" )
620   PORT_DIPSETTING(    0x01, "75" )
621   PORT_DIPSETTING(    0x00, "50 (Loop on Power-Up)" )
599622INPUT_PORTS_END
600623 
601624 
r15315r15316
737760 
738761void wangpc_state::check_level2_interrupts()
739762{
740   int state = !m_dma_eop | m_uart_dr /*| m_uart_tbre*/ | upd765_int_r(m_fdc) | m_fpu_irq;
763   int state = !m_dma_eop | m_uart_dr | m_uart_tbre | upd765_int_r(m_fdc) | m_fpu_irq | m_bus_irq2;
741764 
742765   pic8259_ir2_w(m_pic, state);
743766}
r15315r15316
10121035   DEVCB_DRIVER_LINE_MEMBER(wangpc_state, fdc_drq_w),
10131036   wangpc_fdc_get_image,
10141037   UPD765_RDY_PIN_NOT_CONNECTED,
1015   { FLOPPY_0, FLOPPY_1, NULL, NULL }
1038   { NULL, NULL, NULL, NULL }
10161039};
10171040 
10181041 
r15315r15316
10621085{
10631086    if (LOG) logerror("Bus IRQ2 %u\n", state);
10641087 
1088   m_bus_irq2 = state;
10651089   check_level2_interrupts();
10661090}
10671091 
r15315r15316
10871111   //SLOT_INTERFACE("mvc", WANGPC_MVC) // medium-resolution video controller
10881112   //SLOT_INTERFACE("mcc", WANGPC_MCC) // multiport communications controller
10891113   //SLOT_INTERFACE("tig", WANGPC_TIG) // text/image/graphics controller
1114   //SLOT_INTERFACE("emb", WANGPC_EMB) // extended memory board
10901115SLOT_INTERFACE_END
10911116 
10921117 
r15315r15316
11061131 
11071132   // connect serial keyboard
11081133   m_uart->connect(m_kb);
1134 
1135   // state saving
1136   save_item(NAME(m_dma_page));
1137   save_item(NAME(m_dma_channel));
1138   save_item(NAME(m_timer2_irq));
1139   save_item(NAME(m_ecpi_irq));
1140   save_item(NAME(m_acknlg));
1141   save_item(NAME(m_dav));
1142   save_item(NAME(m_busy));
1143   save_item(NAME(m_dma_eop));
1144   save_item(NAME(m_uart_dr));
1145   save_item(NAME(m_uart_tbre));
1146   save_item(NAME(m_fpu_irq));
1147   save_item(NAME(m_bus_irq2));
1148   save_item(NAME(m_fdc_tc_enable));
1149   save_item(NAME(m_fdc_dma_enable));
1150   save_item(NAME(m_fdc_drq));
1151   save_item(NAME(m_ds1));
1152   save_item(NAME(m_ds2));
11091153}
11101154 
11111155 
r15315r15316
11851229//  GAME DRIVERS
11861230//**************************************************************************
11871231 
1188COMP( 1985, wangpc, 0, 0, wangpc, wangpc, 0, "Wang Laboratories", "Wang Professional Computer", GAME_NOT_WORKING | GAME_NO_SOUND )
1232COMP( 1985, wangpc, 0, 0, wangpc, wangpc, 0, "Wang Laboratories", "Wang Professional Computer", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team