Previous 15994 Revisions Next

r4252 Wednesday 11th February, 2009 at 11:53:55 UTC by Dirk Best
[ORIC] Updated to use the new centronics interface
[docs]messnew.txt
[src/mess/drivers]oric.c
[src/mess/machine]oric.c

src/mess/machine/oric.c
r4251r4252
2424#include "machine/6522via.h"
2525#include "machine/applefdc.h"
2626#include "machine/6551.h"
27#include "machine/centroni.h"
27#include "machine/ctronics.h"
2828#include "devices/basicdsk.h"
2929#include "devices/mfmdisk.h"
30#include "devices/printer.h"
3130#include "devices/cassette.h"
3231#include "sound/ay8910.h"
3332
r4251r4252
246245   if (oric_psg_control==0)
247246   {
248247      /* if psg not selected, write to printer */
249      centronics_write_data(device->machine,0,data);
248      const device_config *printer = devtag_get_device(device->machine, CENTRONICS, "centronics");
249      centronics_data_w(printer, 0, data);
250250   }
251251}
252252
r4251r4252
309309static unsigned char previous_portb_data = 0;
310310static WRITE8_DEVICE_HANDLER ( oric_via_out_b_func )
311311{
312   int printer_handshake;
312   const device_config *printer = devtag_get_device(device->machine, CENTRONICS, "centronics");
313313
314314   /* KEYBOARD */
315315   oric_keyboard_line = data & 0x07;
r4251r4252
330330   /* cassette data out */
331331   cassette_output(cassette_device_image(device->machine), (data & (1<<7)) ? -1.0 : +1.0);
332332
333   /* centronics STROBE is connected to PB4 */
334   centronics_strobe_w(printer, BIT(data, 4));
333335
334   /* PRINTER STROBE */
335   printer_handshake = 0;
336
337   /* normal value is 1, 0 is the strobe */
338   if ((data & (1<<4))!=0)
339   {
340      printer_handshake = CENTRONICS_STROBE;
341   }
342
343   /* assumption: select is tied low */
344   centronics_write_handshake(device->machine, 0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
345   centronics_write_handshake(device->machine, 0, printer_handshake, CENTRONICS_STROBE);
346
347336   oric_psg_connection_refresh(device->machine);
348337   previous_portb_data = data;
349
350338}
351339
352static void oric_printer_handshake_in(running_machine *machine,int number, int data, int mask)
353{
354   int acknowledge;
355   const device_config *via_0 = devtag_get_device(machine, VIA6522, "via6522_0");
356340
357   acknowledge = 1;
358
359   if (mask & CENTRONICS_ACKNOWLEDGE)
360   {
361      if (data & CENTRONICS_ACKNOWLEDGE)
362      {
363         acknowledge = 0;
364      }
365   }
366
367    via_ca1_w(via_0, 0, acknowledge);
368}
369
370static const CENTRONICS_CONFIG oric_cent_config[1]={
371   {
372      PRINTER_CENTRONICS,
373      oric_printer_handshake_in
374   },
375};
376
377
378341static READ8_DEVICE_HANDLER ( oric_via_in_ca2_func )
379342{
380343   return oric_psg_control & 1;
r4251r4252
599562   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
600563      APPLEFDC,
601564      "fdc");
602   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);     
565   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
603566
604567   memory_install_read8_handler(space, 0x0300, 0x030f, 0, 0, oric_IO_r);
605568   memory_install_read8_device_handler(space, fdc, 0x0310, 0x031f, 0, 0, applefdc_r);
r4251r4252
971934{
972935   unsigned char data = 0x0ff;
973936   device_config *fdc = (device_config*)devtag_get_device(space->machine, WD179X, "wd179x");
974   
937
975938   switch (offset & 0x0ff)
976939   {
977940      /* microdisc floppy disc interface */
r4251r4252
10681031static void oric_install_microdisc_interface(running_machine *machine)
10691032{
10701033   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1071   
1034
10721035   memory_install_read8_handler(space, 0x0300, 0x030f, 0, 0, oric_IO_r);
10731036   memory_install_read8_handler(space, 0x0310, 0x031f, 0, 0, oric_microdisc_r);
10741037   memory_install_read8_handler(space, 0x0320, 0x03ff, 0, 0, oric_IO_r);
r4251r4252
11381101
11391102static void oric_common_init_machine(running_machine *machine)
11401103{
1141   const device_config *via_0 = devtag_get_device(machine, VIA6522, "via6522_0");
1142
11431104   /* clear all irqs */
11441105   oric_irqs = 0;
11451106   oric_ram_0x0c000 = NULL;
11461107
11471108    timer_pulse(machine, ATTOTIME_IN_HZ(4800), NULL, 0, oric_refresh_tape);
1148
1149   centronics_config(machine, 0, oric_cent_config);
1150   /* assumption: select is tied low */
1151   centronics_write_handshake(machine, 0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
1152    via_ca1_w(via_0, 0, 1);
11531109}
11541110
11551111MACHINE_START( oric )
r4251r4252
11661122{
11671123   int disc_interface_id = input_port_read(machine, "FLOPPY") & 0x07;
11681124   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1169   
1125
11701126   switch (disc_interface_id)
11711127   {
11721128      default:
src/mess/drivers/oric.c
r4251r4252
2020#include "cpu/m6502/m6502.h"
2121#include "sound/wave.h"
2222#include "includes/oric.h"
23#include "machine/centroni.h"
24#include "devices/printer.h"
23#include "machine/ctronics.h"
2524#include "devices/mflopimg.h"
2625#include "devices/cassette.h"
2726#include "formats/ap2_dsk.h"
r4251r4252
352351   CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED
353352};
354353
354static const centronics_interface oric_contronics_config =
355{
356   FALSE,
357   DEVCB_DEVICE_HANDLER(VIA6522, "via6522_0", via_ca1_w),
358   DEVCB_NULL,
359   DEVCB_NULL
360};
361
355362static MACHINE_DRIVER_START( oric )
356363   /* basic machine hardware */
357364   MDRV_CPU_ADD("main", M6502, 1000000)
r4251r4252
383390   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
384391
385392   /* printer */
386   MDRV_PRINTER_ADD("printer")
393   MDRV_CENTRONICS_ADD("centronics", oric_contronics_config)
387394
388395   /* cassette */
389396   MDRV_CASSETTE_ADD( "cassette", oric_cassette_config )
390397
391398   /* via */
392399   MDRV_VIA6522_ADD( "via6522_0", 1000000, oric_6522_interface )
393   
400
394401   MDRV_WD179X_ADD("wd179x", oric_wd17xx_interface )
395402MACHINE_DRIVER_END
396403
docs/messnew.txt
r4251r4252
3333
3434- [MTX512] Connected CTC channels 0-2 to clock sources. (bug #781) [Curt Coder]
3535
36- [ORIC] Updated to use the new centronics interface.  [Dirk Best]
37
3638- [TI81, TI85, TI86] Added the new ROM_DEFAULT_BIOS feature to select the most
3739  recent rom versions.  [Hobie Troxell]
3840

Previous 15994 Revisions Next


© 1998-2018 The MESS Team