Previous 15994 Revisions Next

r4269 Monday 16th February, 2009 at 09:59:23 UTC by Dirk Best
[SORDM5] Updated to use the new centronics support
[docs]messnew.txt
[src/mess/drivers]sord.c

src/mess/drivers/sord.c
r4268r4269
2323#include "sound/sn76496.h"
2424#include "cpu/z80/z80.h"
2525#include "cpu/z80/z80daisy.h"
26#include "machine/centroni.h"
27#include "devices/printer.h"
26#include "machine/ctronics.h"
2827#include "machine/z80ctc.h"
2928#include "machine/z80sio.h"
3029#include "machine/8255ppi.h"
r4268r4269
340339
341340static READ8_HANDLER(sord_sys_r)
342341{
343   unsigned char data;
344   int printer_handshake;
342   const device_config *printer = devtag_get_device(space->machine, CENTRONICS, "centronics");
343   UINT8 data = 0;
345344
346   data = 0;
347
348345   /* cassette read */
349346   if (cassette_input(cassette_device_image(space->machine)) >=0)
350347      data |=(1<<0);
351348
352   printer_handshake = centronics_read_handshake(space->machine, 0);
349   data |= centronics_busy_r(printer) << 1;
353350
354   /* if printer is not online, it is busy */
355   if ((printer_handshake & CENTRONICS_ONLINE)!=0)
356   {
357      data|=(1<<1);
358   }
359
360351   /* bit 7 must be 0 for saving and loading to work */
361352
362353   logerror("sys read: %02x\n",data);
r4268r4269
374365
375366static WRITE8_HANDLER(sord_sys_w)
376367{
377   int handshake;
368   const device_config *printer = devtag_get_device(space->machine, CENTRONICS, "centronics");
378369
379   handshake = 0;
380   if (data & (1<<0))
381   {
382      handshake = CENTRONICS_STROBE;
383   }
384
385370   /* cassette remote */
386371   cassette_change_state(
387372      cassette_device_image(space->machine),
r4268r4269
391376   /* cassette data */
392377   cassette_output(cassette_device_image(space->machine), (data & (1<<0)) ? -1.0 : 1.0);
393378
394   /* assumption: select is tied low */
395   centronics_write_handshake(space->machine, 0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
396   centronics_write_handshake(space->machine, 0, handshake, CENTRONICS_STROBE);
379   centronics_strobe_w(printer, BIT(data, 0));
397380
398381   logerror("sys write: %02x\n",data);
399382}
400383
401static WRITE8_HANDLER(sord_printer_w)
402{
403//  logerror("centronics w: %02x\n",data);
404   centronics_write_data(space->machine, 0,data);
405}
406384
407385static ADDRESS_MAP_START( sord_m5_io , ADDRESS_SPACE_IO, 8)
408386   ADDRESS_MAP_GLOBAL_MASK(0xff)
r4268r4269
411389   AM_RANGE(0x11, 0x11) AM_MIRROR(0x0e)   AM_READWRITE(TMS9928A_register_r,   TMS9928A_register_w)
412390   AM_RANGE(0x20, 0x2f)               AM_WRITE(                     sn76496_0_w)
413391   AM_RANGE(0x30, 0x3f)               AM_READ(sord_keyboard_r)
414   AM_RANGE(0x40, 0x40)               AM_WRITE(                     sord_printer_w)
392   AM_RANGE(0x40, 0x40)               AM_DEVWRITE(CENTRONICS, "centronics", centronics_data_w)
415393   AM_RANGE(0x50, 0x50)               AM_READWRITE(sord_sys_r,         sord_sys_w)
416394ADDRESS_MAP_END
417395
r4268r4269
422400   AM_RANGE(0x11, 0x11) AM_MIRROR(0x0e)   AM_READWRITE(TMS9928A_register_r,   TMS9928A_register_w)
423401   AM_RANGE(0x20, 0x2f)               AM_WRITE(                     sn76496_0_w)
424402   AM_RANGE(0x30, 0x3f)               AM_READ(sord_keyboard_r)
425   AM_RANGE(0x40, 0x40)               AM_WRITE(                     sord_printer_w)
403   AM_RANGE(0x40, 0x40)               AM_DEVWRITE(CENTRONICS, "centronics", centronics_data_w)
426404   AM_RANGE(0x50, 0x50)               AM_READWRITE(sord_sys_r,         sord_sys_w)
427405   AM_RANGE(0x70, 0x73)               AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
428406ADDRESS_MAP_END
429407
430408
431409
432static const CENTRONICS_CONFIG sordm5_cent_config[1] =
433{
434   {
435      PRINTER_CENTRONICS,
436      NULL
437   },
438};
439
440410static void sordm5_video_interrupt_callback(running_machine *machine, int state)
441411{
442412   if (state)
r4268r4269
466436
467437   /* should be done in a special callback to work properly! */
468438   memory_set_bankptr(machine, 1, memory_region(machine, "user1"));
469
470   centronics_config(machine, 0, sordm5_cent_config);
471   /* assumption: select is tied low */
472   centronics_write_handshake(machine, 0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
473439}
474440
475/* 2008-05 FP:
441/* 2008-05 FP:
476442Small note about natural keyboard: currently
477443- "Reset" is mapped to 'Esc'
478444- "Func" is mapped to 'F1'
r4268r4269
644610   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
645611
646612   /* printer */
647   MDRV_PRINTER_ADD("printer")
613   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
648614
649615   MDRV_CASSETTE_ADD( "cassette", sordm5_cassette_config )
650   
616
651617   /* cartridge */
652618   MDRV_CARTSLOT_ADD("cart")
653619   MDRV_CARTSLOT_EXTENSION_LIST("rom")
r4268r4269
667633
668634   MDRV_QUANTUM_TIME(HZ(1200))
669635   MDRV_MACHINE_RESET( sord_m5_fd5 )
670   
636
671637   MDRV_NEC765A_ADD("nec765", sord_fd5_nec765_interface)
672638MACHINE_DRIVER_END
673639
docs/messnew.txt
r4268r4269
4949 
5050- [SMS/GG] Fixed scrolling for 8 rightmost columns.  (bug #1497) [Enik Land]
5151
52- [SORDM5] Updated to use the new centronics support.  [Dirk Best]
53
5254- [TI81, TI85, TI86] Added the new ROM_DEFAULT_BIOS feature to select the most
5355  recent rom versions.  [Hobie Troxell]
5456

Previous 15994 Revisions Next


© 1998-2018 The MESS Team