Previous 15994 Revisions Next

r10693 Sunday 6th March, 2011 at 16:42:06 UTC by Angelo Salese
[PC-9801f]: Added upd1990a hook-up
[src/mess/drivers]pc8801.c pc9801.c

src/mess/drivers/pc9801.c
r10692r10693
2121#include "machine/8237dma.h"
2222#include "machine/pic8259.h"
2323#include "machine/upd765.h"
24#include "machine/upd1990a.h"
2425#include "sound/beep.h"
2526#include "video/upd7220.h"
2627#include "imagedev/flopdrv.h"
r10692r10693
298299   if((offset & 1) == 0)
299300   {
300301      if(offset == 0)
301         printf("Write to RTC port [%02x] <- %02x\n",offset+0x20,data);
302      {
303         upd1990a_c0_w(space->machine->device("upd1990a"),      (data & 0x01) >> 0);
304         upd1990a_c1_w(space->machine->device("upd1990a"),      (data & 0x02) >> 1);
305         upd1990a_c2_w(space->machine->device("upd1990a"),      (data & 0x04) >> 2);
306         upd1990a_stb_w(space->machine->device("upd1990a"),     (data & 0x08) >> 3);
307         upd1990a_clk_w(space->machine->device("upd1990a"),     (data & 0x10) >> 4);
308         upd1990a_data_in_w(space->machine->device("upd1990a"), (data & 0x20) >> 5);
309         if(data & 0xc0)
310            printf("RTC write to undefined bits %02x\n",data & 0xc0);
311      }
302312      else
303313         printf("Write to undefined port [%02x] <- %02x\n",offset+0x20,data);
304314   }
r10692r10693
9901000   PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(" un 7-8") PORT_IMPULSE(1) PORT_CHANGED(key_stroke, 0x7f) //PORT_CODE(KEYCODE_M) PORT_CHAR('M')
9911001
9921002   PORT_START("DSW1")
993   PORT_DIPNAME( 0x01, 0x00, "DSW1" )
994   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
995   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
996   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) // error beep if OFF
1003   PORT_BIT(0x01, IP_ACTIVE_HIGH,IPT_SPECIAL) PORT_READ_LINE_DEVICE("upd1990a", upd1990a_data_out_r)
1004   PORT_DIPNAME( 0x02, 0x00, "DSW1" ) // error beep if OFF
9971005   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
9981006   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
9991007   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
r10692r10693
13311339   NULL
13321340};
13331341
1342static UPD1990A_INTERFACE( pc9801_upd1990a_intf )
1343{
1344   DEVCB_NULL,
1345   DEVCB_NULL
1346};
13341347
13351348/****************************************
13361349*
r10692r10693
13581371   return r;
13591372}
13601373
1374static MACHINE_START(pc9801)
1375{
1376   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
13611377
1378   upd1990a_cs_w(machine->device("upd1990a"), 1);
1379   upd1990a_oe_w(machine->device("upd1990a"), 1);
1380}
1381
13621382static MACHINE_RESET(pc9801)
13631383{
13641384   pc9801_state *state = machine->driver_data<pc9801_state>();
13651385
1366   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
1367
13681386   /* this looks like to be some kind of backup ram, system will boot with green colors otherwise */
13691387   {
13701388      int i;
r10692r10693
14321450   MCFG_CPU_IO_MAP(pc9801_io)
14331451   MCFG_CPU_VBLANK_INT("screen",pc9801_vrtc_irq)
14341452
1453   MCFG_MACHINE_START(pc9801)
14351454   MCFG_MACHINE_RESET(pc9801)
14361455
14371456   MCFG_PIT8253_ADD( "pit8253", pit8253_config )
r10692r10693
14411460   MCFG_I8255A_ADD( "ppi8255_sys", ppi_system_intf )
14421461   MCFG_I8255A_ADD( "ppi8255_prn", ppi_printer_intf )
14431462   MCFG_I8255A_ADD( "ppi8255_fdd", ppi_fdd_intf )
1463   MCFG_UPD1990A_ADD("upd1990a", XTAL_32_768kHz, pc9801_upd1990a_intf)
14441464
14451465   MCFG_UPD765A_ADD("upd765_2dd", upd765_2dd_intf)
14461466   MCFG_FLOPPY_4_DRIVES_ADD(pc9801_floppy_config)
src/mess/drivers/pc8801.c
r10692r10693
871871    ---- --x- monitor refresh rate DIP-SW
872872    ---- ---x (pbsy?)
873873    */
874   UINT8 cdo;
875
876   cdo = (upd1990a_data_out_r(space->machine->device("upd1990a")) & 1) << 4;
877
878   return input_port_read(space->machine, "CTRL") | cdo;
874   return input_port_read(space->machine, "CTRL");
879875}
880876
881877static WRITE8_HANDLER( pc8801_ctrl_w )
r10692r10693
17091705   PORT_DIPNAME( 0x08, 0x08, "Auto-boot floppy at start-up" )
17101706   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
17111707   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1712   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
1708   PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_READ_LINE_DEVICE("upd1990a", upd1990a_data_out_r)
1709   PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_VBLANK )
17131710   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
17141711
17151712   PORT_START("CFG")      /* EXSWITCH */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team