Previous 15994 Revisions Next

r4263 Friday 13th February, 2009 at 16:22:51 UTC by Dirk Best
[SF7000] Updated to use the new centronics support
[docs]messnew.txt
[src/mess/drivers]sg1000.c

src/mess/drivers/sg1000.c
r4262r4263
3131
3232Notes:
3333    All IC's shown.
34   
34
3535   Z80      - NEC D780C-1 / Zilog Z8400A (REV.A) Z80A CPU @ 3.579545
3636   TMS9918A- Texas Instruments TMS9918ANL Video Display Processor @ 10.738635MHz
3737   MB8118   - Fujitsu MB8118-12 16K x 1 Dynamic RAM
r4262r4263
5555
5656   - OMV keyboard
5757   - SC-3000 return instruction referenced by R when reading ports 60-7f,e0-ff
58   - connect the PSG /READY signal
58   - connect the PSG /READY signal
5959   - accurate video timing
6060    - SP-400 serial printer
6161   - SH-400 racing controller
r4262r4263
7070#include "devices/cartslot.h"
7171#include "devices/cassette.h"
7272#include "devices/printer.h"
73#include "machine/centroni.h"
73#include "machine/ctronics.h"
7474#include "includes/serial.h"
7575#include "machine/msm8251.h"
7676#include "machine/8255ppi.h"
r4262r4263
421421   PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
422422   PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
423423   PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
424   
424
425425   PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S-1") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
426426   PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S-1") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
427427*/
r4262r4263
531531
532532   /* cartridge contact */
533533   data |= 0x10;
534   
534
535535   /* printer */
536536   data |= 0x60;
537537
r4262r4263
609609        PA7
610610    */
611611
612   const device_config *printer = devtag_get_device(device->machine, CENTRONICS, "centronics");
612613   sg1000_state *state = device->machine->driver_data;
614   UINT8 result = 0;
613615
614   int centronics_handshake = centronics_read_handshake(device->machine,1);
615   int busy = 0;
616   result |= state->fdc_irq;
617   result |= centronics_busy_r(printer) << 1;
618   result |= state->fdc_index << 2;
616619
617   if ((centronics_handshake & CENTRONICS_NOT_BUSY) == 0)
618   {
619      busy = 0x02;
620   }
621
622   return (state->fdc_index << 2) | busy | state->fdc_irq;
620   return result;
623621}
624622
625static WRITE8_DEVICE_HANDLER( sf7000_ppi8255_b_w )
626{
627   /*
628        Signal  Description
629
630        PB0     Data output to Centronics printer
631        PB1     Data output to Centronics printer
632        PB2     Data output to Centronics printer
633        PB3     Data output to Centronics printer
634        PB4     Data output to Centronics printer
635        PB5     Data output to Centronics printer
636        PB6     Data output to Centronics printer
637        PB7     Data output to Centronics printer
638    */
639
640   centronics_write_data(device->machine, 1, data);
641}
642
643623static WRITE8_DEVICE_HANDLER( sf7000_ppi8255_c_w )
644624{
645   device_config *fdc = (device_config*)devtag_get_device(device->machine, NEC765A, "nec765");
625   const device_config *fdc = devtag_get_device(device->machine, NEC765A, "nec765");
626   const device_config *printer = devtag_get_device(device->machine, CENTRONICS, "centronics");
646627   /*
647628        Signal  Description
648629
r4262r4263
670651   }
671652
672653   /* ROM selection */
673   memory_set_bank(device->machine, 1, (data & 0x40) >> 6);
654   memory_set_bank(device->machine, 1, BIT(data, 6));
674655
675656   /* printer strobe */
676   centronics_write_handshake(device->machine, 1, (data & 0x80) ? 0 : CENTRONICS_STROBE, CENTRONICS_STROBE);
657   centronics_strobe_w(printer, BIT(data, 7));
677658}
678659
679660static const ppi8255_interface sf7000_ppi8255_intf[2] =
r4262r4263
691672      DEVCB_NULL,                        // Port B read
692673      DEVCB_NULL,                        // Port C read
693674      DEVCB_NULL,                        // Port A write
694      DEVCB_HANDLER(sf7000_ppi8255_b_w),      // Port B write
675      DEVCB_DEVICE_HANDLER(CENTRONICS, "centronics", centronics_data_w),   // Port B write
695676      DEVCB_HANDLER(sf7000_ppi8255_c_w)      // Port C write
696677   }
697678};
r4262r4263
719700   NEC765_RDY_PIN_CONNECTED
720701};
721702
722static const CENTRONICS_CONFIG sf7000_centronics_config[1] = {
723   {
724      PRINTER_IBM,
725      NULL
726   }
727};
728703
729704static MACHINE_START( sf7000 )
730705{
r4262r4263
736711   /* configure FDC */
737712   floppy_drive_set_index_pulse_callback(image_from_devtype_and_index(machine, IO_FLOPPY, 0), sf7000_fdc_index_callback);
738713
739   /* configure PPI */
740   centronics_config(machine, 1, sf7000_centronics_config);
741
742714   /* configure memory banking */
743715   memory_configure_bank(machine, 1, 0, 1, memory_region(machine, "main"), 0);
744716   memory_configure_bank(machine, 1, 1, 1, mess_ram, 0);
r4262r4263
883855
884856static MACHINE_DRIVER_START( omv )
885857   MDRV_IMPORT_FROM(sg1000)
886   
858
887859   MDRV_CARTSLOT_MODIFY("cart")
888860   MDRV_CARTSLOT_EXTENSION_LIST("sg,bin")
889861   MDRV_CARTSLOT_NOT_MANDATORY
r4262r4263
922894   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
923895
924896   /* printer */
925   MDRV_PRINTER_ADD("printer")
897   MDRV_PRINTER_ADD("sp400") /* serial printer */
926898
927899   /* cassette */
928900   MDRV_CASSETTE_ADD( "cassette", sc3000_cassette_config )
r4262r4263
947919   MDRV_MACHINE_RESET( sf7000 )
948920
949921   MDRV_PPI8255_ADD("ppi8255_0", sf7000_ppi8255_intf[0])
950
951922   MDRV_PPI8255_ADD("ppi8255_1", sf7000_ppi8255_intf[1])
952923
953924    /* video hardware */
r4262r4263
962933   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
963934
964935   /* printer */
965   MDRV_PRINTER_ADD("printer")
966   MDRV_PRINTER_ADD("sp400")
936   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
937   MDRV_PRINTER_ADD("sp400") /* serial printer */
967938
968939   /* cassette */
969940   MDRV_CASSETTE_ADD("cassette", sc3000_cassette_config)
970941
971942   /* uart */
972943   MDRV_MSM8251_ADD("uart", default_msm8251_interface)
973   
974   MDRV_NEC765A_ADD("nec765", sf7000_nec765_interface)     
944
945   MDRV_NEC765A_ADD("nec765", sf7000_nec765_interface)
975946MACHINE_DRIVER_END
976947
977948/* ROMs */
docs/messnew.txt
r4262r4263
4545
4646- [SAMCOUPE] Added centronics printer support.  [Dirk Best]
4747
48- [SF7000] Updated to use the new centronics support.  [Dirk Best]
49
4850- [TI81, TI85, TI86] Added the new ROM_DEFAULT_BIOS feature to select the most
4951  recent rom versions.  [Hobie Troxell]
5052

Previous 15994 Revisions Next


© 1998-2018 The MESS Team