Previous 15994 Revisions Next

r3634 Thursday 27th November, 2008 at 10:52:13 UTC by Miodrag Milanović
[APEXC][APF] Enabled
[src/mess]mess.mak messdriv.c
[src/mess/drivers]apexc.c apf.c

src/mess/messdriv.c
r3633r3634
567567//128u4   DRIVER( srdm5fd5 )
568568
569569   /* APF Electronics Inc. */
570//128u4   DRIVER( apfm1000 )
571//128u4   DRIVER( apfimag )
570   DRIVER( apfm1000 )
571   DRIVER( apfimag )
572572
573573   /* Tatung */
574574//128u4   DRIVER( einstein )
r3633r3634
868868
869869   /* Andrew Donald Booth (this is the name of the designer, not a company) */
870870//   DRIVER( apexc53 )   /* 1951(?) APEXC: All-Purpose Electronic X-ray Computer */
871//128u4   DRIVER( apexc )      /* 1955(?) APEXC: All-Purpose Electronic X-ray Computer */
871   DRIVER( apexc )      /* 1955(?) APEXC: All-Purpose Electronic X-ray Computer */
872872
873873   /* Sony */
874874   DRIVER( psj )      /* 1994 Sony PlayStation (Japan)               */
src/mess/mess.mak
r3633r3634
372372   $(MESSOBJ)/advision.a \
373373   $(MESSOBJ)/amiga.a \
374374   $(MESSOBJ)/amstrad.a \
375   $(MESSOBJ)/apexc.a \
376   $(MESSOBJ)/apf.a \
375377   $(MESSOBJ)/aquarius.a \
376378   $(MESSOBJ)/ascii.a \
377379   $(MESSOBJ)/b2m.a \
r3633r3634
416418   $(MESSOBJ)/trs80.a \
417419   $(MESSOBJ)/shared.a \
418420
419#   $(MESSOBJ)/apexc.a \
420#   $(MESSOBJ)/apf.a \
421421#   $(MESSOBJ)/apple.a \
422422#   $(MESSOBJ)/arcadia.a \
423423#   $(MESSOBJ)/at.a \
src/mess/drivers/apexc.c
r3633r3634
2222
2323/*
2424    APEXC RAM loading/saving from cylinder image
25
25   
2626    Note that, in an actual APEXC, the RAM contents are not read from the cylinder :
2727    the cylinder IS the RAM.
2828
r3633r3634
207207   if (apexc_tapes[1].fd)
208208      image_fwrite(apexc_tapes[1].fd, & data5, 1);
209209
210   apexc_teletyper_putchar(machine, data & 0x1f);   /* display on screen */
210   apexc_teletyper_putchar(space->machine, data & 0x1f);   /* display on screen */
211211}
212212
213213/*
r3633r3634
326326*/
327327static INTERRUPT_GEN( apexc_interrupt )
328328{
329   const address_space* space = cpu_get_address_space(device->machine->cpu[0],ADDRESS_SPACE_PROGRAM);
329330   UINT32 edit_keys;
330331   int control_keys;
331332
r3633r3634
336337
337338
338339   /* read new state of edit keys */
339   edit_keys = (input_port_read(machine, "data1") << 16) | input_port_read(machine, "data2");
340   edit_keys = (input_port_read(device->machine, "data1") << 16) | input_port_read(device->machine, "data2");
340341
341342   /* toggle data reg according to transitions */
342343   panel_data_reg ^= edit_keys & (~ old_edit_keys);
r3633r3634
346347
347348
348349   /* read new state of control keys */
349   control_keys = input_port_read(machine, "panel");
350   control_keys = input_port_read(device->machine, "panel");
350351
351352   /* compute transitions */
352353   control_transitions = control_keys & (~ old_control_keys);
r3633r3634
355356
356357   if (control_transitions & panel_run)
357358   {   /* toggle run/stop state */
358      cpunum_set_reg(0, APEXC_STATE, ! cpunum_get_reg(0, APEXC_STATE));
359      cpu_set_reg(device, APEXC_STATE, ! cpu_get_reg(device, APEXC_STATE));
359360   }
360361
361362   while (control_transitions & (panel_CR | panel_A | panel_R | panel_ML | panel_HB))
r3633r3634
397398         /* read/write register #reg_id */
398399         if (control_keys & panel_write)
399400            /* write reg */
400            cpunum_set_reg(0, reg_id, panel_data_reg);
401            cpu_set_reg(device, reg_id, panel_data_reg);
401402         else
402403            /* read reg */
403            panel_data_reg = cpunum_get_reg(0, reg_id);
404            panel_data_reg = cpu_get_reg(device, reg_id);
404405      }
405406   }
406407
407408   if (control_transitions & panel_mem)
408409   {   /* read/write memory */
409410
410      if (control_keys & panel_write)
411      if (control_keys & panel_write) {
411412         /* write memory */
412         apexc_writemem(cpunum_get_reg(0, APEXC_ML_FULL), panel_data_reg);
413      else
413         memory_write_dword_32be(space, cpu_get_reg(device, APEXC_ML_FULL)<<2, panel_data_reg);
414      }
415      else {
414416         /* read memory */
415         panel_data_reg = apexc_readmem(cpunum_get_reg(0, APEXC_ML_FULL));
417         panel_data_reg = memory_read_dword_32be(space, cpu_get_reg(device, APEXC_ML_FULL)<<2);
418      }
416419   }
417420
418421   /* remember new state of control keys */
r3633r3634
539542
540543   apexc_draw_led(bitmap, 0, 0, 1);
541544
542   apexc_draw_led(bitmap, 0, 8, cpunum_get_reg(0, APEXC_STATE));
545   apexc_draw_led(bitmap, 0, 8, cpu_get_reg(screen->machine->cpu[0], APEXC_STATE));
543546
544547   for (i=0; i<32; i++)
545548   {
src/mess/drivers/apf.c
r3633r3634
5353
5454  UINT8 data=~0;
5555  if (!(pad_data & 0x08))
56    data &= input_port_read(machine, "joy3");
56    data &= input_port_read(space->machine, "joy3");
5757  if (!(pad_data & 0x04))
58    data &= input_port_read(machine, "joy2");
58    data &= input_port_read(space->machine, "joy2");
5959  if (!(pad_data & 0x02))
60    data &= input_port_read(machine, "joy1");
60    data &= input_port_read(space->machine, "joy1");
6161  if (!(pad_data & 0x01))
62    data &= input_port_read(machine, "joy0");
62    data &= input_port_read(space->machine, "joy0");
6363
6464   return data;
6565}
r3633r3634
207207
208208   data = 0x000;
209209
210   if (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" )) > 0.0038)
210   if (cassette_input(device_list_find_by_tag( space->machine->config->devicelist, CASSETTE, "cassette" )) > 0.0038)
211211      data =(1<<7);
212212
213213   return data;
r3633r3634
251251   static const char *keynames[] = { "key0", "key1", "key2", "key3", "key4", "key5", "key6", "key7" };
252252
253253   keyboard_line = data & 0x07;
254   keyboard_data = input_port_read(machine, keynames[keyboard_line]);
254   keyboard_data = input_port_read(space->machine, keynames[keyboard_line]);
255255
256256   /* bit 4: cassette motor control */
257   cassette_change_state(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ),
257   cassette_change_state(device_list_find_by_tag( space->machine->config->devicelist, CASSETTE, "cassette" ),
258258      (data & 0x10) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
259259      CASSETTE_MASK_MOTOR);
260260
261261   /* bit 6: cassette write */
262   cassette_output(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ),
262   cassette_output(device_list_find_by_tag( space->machine->config->devicelist, CASSETTE, "cassette" ),
263263      (data & 0x40) ? -1.0 : 1.0);
264264}
265265
r3633r3634
362362
363363static WRITE8_HANDLER(apf_wd179x_command_w)
364364{
365   wd17xx_command_w(machine, offset,~data);
365   wd17xx_command_w(space, offset,~data);
366366}
367367
368368static WRITE8_HANDLER(apf_wd179x_track_w)
369369{
370   wd17xx_track_w(machine, offset,~data);
370   wd17xx_track_w(space, offset,~data);
371371}
372372
373373static WRITE8_HANDLER(apf_wd179x_sector_w)
374374{
375   wd17xx_sector_w(machine, offset,~data);
375   wd17xx_sector_w(space, offset,~data);
376376}
377377
378378static WRITE8_HANDLER(apf_wd179x_data_w)
379379{
380   wd17xx_data_w(machine, offset,~data);
380   wd17xx_data_w(space, offset,~data);
381381}
382382
383383static READ8_HANDLER(apf_wd179x_status_r)
384384{
385   return ~wd17xx_status_r(machine, offset);
385   return ~wd17xx_status_r(space, offset);
386386}
387387
388388static READ8_HANDLER(apf_wd179x_track_r)
389389{
390   return ~wd17xx_track_r(machine, offset);
390   return ~wd17xx_track_r(space, offset);
391391}
392392
393393static READ8_HANDLER(apf_wd179x_sector_r)
394394{
395   return ~wd17xx_sector_r(machine, offset);
395   return ~wd17xx_sector_r(space, offset);
396396}
397397
398398static READ8_HANDLER(apf_wd179x_data_r)
399399{
400   return wd17xx_data_r(machine, offset);
400   return wd17xx_data_r(space, offset);
401401}
402402
403403static ADDRESS_MAP_START(apf_imagination_map, ADDRESS_SPACE_PROGRAM, 8)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team