Previous 15994 Revisions Next

r3652 Thursday 27th November, 2008 at 14:59:00 UTC by Nathan Woods
Reenabled Sord, some search and replace
[src/mess]mess.mak messdriv.c
[src/mess/drivers]sord.c
[src/mess/machine]dgn_beta.c

src/mess/messdriv.c
r3651r3652
563563   DRIVER( jupiter )   /* Jupiter Ace                              */
564564
565565   /* SORD */
566//128u4   DRIVER( sordm5 )
567//128u4   DRIVER( srdm5fd5 )
566   DRIVER( sordm5 )
567   DRIVER( srdm5fd5 )
568568
569569   /* APF Electronics Inc. */
570570   DRIVER( apfm1000 )
src/mess/machine/dgn_beta.c
r3651r3652
240240   int      bank_end;
241241   int      MapPage;
242242
243   LOG_BANK_UPDATE(("\n\nUpdating banks %d to %d at PC=$%X\n",first,last,activecpu_get_pc()));
243   LOG_BANK_UPDATE(("\n\nUpdating banks %d to %d at PC=$%X\n",first,last,cpu_get_pc(space->cpu)));
244244   for(Page=first;Page<=last;Page++)
245245   {
246246      bank_start   = bank_info[Page].start;
r3651r3652
670670
671671      /* CPU un-halted let it run ! */
672672      if (HALT_DMA==CLEAR_LINE)
673         cpu_yield();
673         cpu_yield(space->cpu);
674674
675675      d_pia1_pa_last=data & 0x80;
676676   }
r3651r3652
715715
716716      /* CPU un-halted let it run ! */
717717      if (HALT_CPU==CLEAR_LINE)
718         cpu_yield();
718         cpu_yield(space->cpu);
719719   }
720720}
721721
r3651r3652
762762      {
763763         cpu_set_input_line(machine->cpu[1],INPUT_LINE_NMI,ASSERT_LINE);
764764         logerror("cpu_yield()\n");
765         cpu_yield();   /* Let DMA CPU run */
765         cpu_yield(space->cpu);   /* Let DMA CPU run */
766766      }
767767      else
768768      {
src/mess/mess.mak
r3651r3652
419419   $(MESSOBJ)/sapi1.a \
420420   $(MESSOBJ)/sharp.a \
421421   $(MESSOBJ)/sony.a \
422   $(MESSOBJ)/sord.a \
422423   $(MESSOBJ)/sinclair.a \
423424   $(MESSOBJ)/special.a \
424425   $(MESSOBJ)/super80.a \
r3651r3652
470471#   $(MESSOBJ)/sega.a \
471472#   $(MESSOBJ)/sgi.a \
472473#   $(MESSOBJ)/sony.a \
473#   $(MESSOBJ)/sord.a \
474474#   $(MESSOBJ)/ssystem3.a \
475475#   $(MESSOBJ)/svi.a \
476476#   $(MESSOBJ)/svision.a \
src/mess/drivers/sord.c
r3651r3652
6868/* stb and ack automatically set on read/write? */
6969static WRITE8_HANDLER(fd5_communication_w)
7070{
71   cpu_yield();
71   cpu_yield(space->cpu);
7272
7373   fd5_port_0x020_data = data;
74   LOG(("fd5 0x020: %02x %04x\n",data,activecpu_get_pc()));
74   LOG(("fd5 0x020: %02x %04x\n",data,cpu_get_pc(space->cpu)));
7575}
7676
7777static  READ8_HANDLER(fd5_communication_r)
7878{
7979   int data;
8080
81   cpu_yield();
81   cpu_yield(space->cpu);
8282
8383   data = (obfa<<3)|(ibfa<<2)|2;
84   LOG(("fd5 0x030: %02x %04x\n",data, activecpu_get_pc()));
84   LOG(("fd5 0x030: %02x %04x\n",data, cpu_get_pc(space->cpu)));
8585
8686   return data;
8787}
8888
8989static  READ8_HANDLER(fd5_data_r)
9090{
91   cpu_yield();
91   cpu_yield(space->cpu);
9292
93   LOG(("fd5 0x010 r: %02x %04x\n",fd5_databus,activecpu_get_pc()));
93   LOG(("fd5 0x010 r: %02x %04x\n",fd5_databus,cpu_get_pc(space->cpu)));
9494
95   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
96   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x10);
97   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
95   ppi8255_set_port_c((device_config*)device_list_find_by_tag( space->machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
96   ppi8255_set_port_c((device_config*)device_list_find_by_tag( space->machine->config->devicelist, PPI8255, "ppi8255" ), 0x10);
97   ppi8255_set_port_c((device_config*)device_list_find_by_tag( space->machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
9898
9999   return fd5_databus;
100100}
101101
102102static WRITE8_HANDLER(fd5_data_w)
103103{
104   LOG(("fd5 0x010 w: %02x %04x\n",data,activecpu_get_pc()));
104   LOG(("fd5 0x010 w: %02x %04x\n",data,cpu_get_pc(space->cpu)));
105105
106106   fd5_databus = data;
107107
108108   /* set stb on data write */
109   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
110   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x40);
111   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
109   ppi8255_set_port_c((device_config*)device_list_find_by_tag( space->machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
110   ppi8255_set_port_c((device_config*)device_list_find_by_tag( space->machine->config->devicelist, PPI8255, "ppi8255" ), 0x40);
111   ppi8255_set_port_c((device_config*)device_list_find_by_tag( space->machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
112112
113   cpu_yield();
113   cpu_yield(space->cpu);
114114}
115115
116116static WRITE8_HANDLER(fd5_drive_control_w)
r3651r3652
132132
133133static WRITE8_HANDLER(fd5_tc_w)
134134{
135   nec765_set_tc_state(machine, 1);
136   nec765_set_tc_state(machine, 0);
135   nec765_set_tc_state(space->machine, 1);
136   nec765_set_tc_state(space->machine, 0);
137137}
138138
139139/* 0x020 fd5 writes to this port to communicate with m5 */
r3651r3652
156156{
157157   if (state)
158158   {
159      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
159      cpu_set_input_line(Machine->cpu[1], 0, HOLD_LINE);
160160   }
161161   else
162162   {
163      cpunum_set_input_line(Machine, 1, 0,CLEAR_LINE);
163      cpu_set_input_line(Machine->cpu[1], 0,CLEAR_LINE);
164164   }
165165}
166166
r3651r3652
195195
196196static READ8_DEVICE_HANDLER(sord_ppi_porta_r)
197197{
198   cpu_yield();
198   cpu_yield(device->machine->cpu[0]);
199199
200200   return fd5_databus;
201201}
202202
203203static READ8_DEVICE_HANDLER(sord_ppi_portb_r)
204204{
205   cpu_yield();
205   cpu_yield(device->machine->cpu[0]);
206206
207   LOG(("m5 read from pi5 port b %04x\n",activecpu_get_pc()));
207   LOG(("m5 read from pi5 port b %04x\n",cpu_get_pc(device->machine->cpu[0])));
208208
209209   return 0x0ff;
210210}
211211
212212static READ8_DEVICE_HANDLER(sord_ppi_portc_r)
213213{
214   cpu_yield();
214   cpu_yield(device->machine->cpu[0]);
215215
216   LOG(("m5 read from pi5 port c %04x\n",activecpu_get_pc()));
216   LOG(("m5 read from pi5 port c %04x\n",cpu_get_pc(device->machine->cpu[0])));
217217
218218/* from fd5 */
219219/* 00 = 0000 = write */
r3651r3652
242242
243243static WRITE8_DEVICE_HANDLER(sord_ppi_porta_w)
244244{
245   cpu_yield();
245   cpu_yield(device->machine->cpu[0]);
246246
247247   fd5_databus = data;
248248}
249249
250250static WRITE8_DEVICE_HANDLER(sord_ppi_portb_w)
251251{
252   cpu_yield();
252   cpu_yield(device->machine->cpu[0]);
253253
254254   /* f0, 40 */
255255   /* 1111 */
r3651r3652
257257
258258   if (data==0x0f0)
259259   {
260      cpunum_set_input_line(device->machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
261      cpunum_set_input_line(device->machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
260      cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE);
261      cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE);
262262   }
263   LOG(("m5 write to pi5 port b: %02x %04x\n",data,activecpu_get_pc()));
263   LOG(("m5 write to pi5 port b: %02x %04x\n",data,cpu_get_pc(device->machine->cpu[0])));
264264}
265265
266266/* A,  B,  C,  D,  E,   F,  G,  H,  I,  J, K,  L,  M,   N, O, P, Q, R,   */
r3651r3652
275275   intra = (data & 0x08) ? 1 : 0;
276276   ibfa = (data & 0x20) ? 1 : 0;
277277
278   cpu_yield();
279   LOG(("m5 write to pi5 port c: %02x %04x\n",data,activecpu_get_pc()));
278   cpu_yield(device->machine->cpu[0]);
279   LOG(("m5 write to pi5 port c: %02x %04x\n",data,cpu_get_pc(device->machine->cpu[0])));
280280}
281281
282282static const ppi8255_interface sord_ppi8255_interface =
r3651r3652
295295static void sord_m5_ctc_interrupt(const device_config *device, int state)
296296{
297297   //logerror("interrupting ctc %02x\r\n ",state);
298   cpunum_set_input_line(device->machine, 0, 0, state);
298   cpu_set_input_line(device->machine->cpu[0], 0, state);
299299}
300300
301301static const z80ctc_interface   sord_m5_ctc_intf =
r3651r3652
315315                              "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15",
316316                              "RESET"};
317317
318   return input_port_read(machine, keynames[offset]);
318   return input_port_read(space->machine, keynames[offset]);
319319}
320320
321321static ADDRESS_MAP_START( sord_m5_mem , ADDRESS_SPACE_PROGRAM, 8)
r3651r3652
344344   z80ctc_w(device, offset & 0x03, data);
345345}
346346
347static READ8_HANDLER(sord_sys_r)
347static READ8_HANDLER(sord_sys_r)
348348{
349349   unsigned char data;
350350   int printer_handshake;
r3651r3652
352352   data = 0;
353353
354354   /* cassette read */
355   if (cassette_input(cassette_device_image(machine)) >=0)
355   if (cassette_input(cassette_device_image(space->machine)) >=0)
356356      data |=(1<<0);
357357
358358   printer_handshake = centronics_read_handshake(0);
r3651r3652
390390
391391   /* cassette remote */
392392   cassette_change_state(
393      cassette_device_image(machine),
393      cassette_device_image(space->machine),
394394      (data & 0x02) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
395395      CASSETTE_MASK_MOTOR);
396396
397397   /* cassette data */
398   cassette_output(cassette_device_image(machine), (data & (1<<0)) ? -1.0 : 1.0);
398   cassette_output(cassette_device_image(space->machine), (data & (1<<0)) ? -1.0 : 1.0);
399399
400400   /* assumption: select is tied low */
401401   centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
r3651r3652
471471   TMS9928A_reset ();
472472
473473   /* should be done in a special callback to work properly! */
474   memory_set_bankptr(1, memory_region(machine, "user1"));
474   memory_set_bankptr(machine, 1, memory_region(machine, "user1"));
475475
476476   centronics_config(0, sordm5_cent_config);
477477   /* assumption: select is tied low */
r3651r3652
611611
612612static INTERRUPT_GEN( sord_interrupt )
613613{
614   if (TMS9928A_interrupt(machine))
615      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
614   if (TMS9928A_interrupt(device->machine))
615      cpu_set_input_line(device->machine->cpu[0], 0, HOLD_LINE);
616616}
617617
618618static const cassette_config sordm5_cassette_config =

Previous 15994 Revisions Next


© 1998-2018 The MESS Team