Previous 199869 Revisions Next

r19098 Thursday 22nd November, 2012 at 03:51:49 UTC by Angelo Salese
Hooked up upd71071, from suggestion by Carl & Barry (same DMAC as FM-Towns)
[src/mess/drivers]pc88va.c

trunk/src/mess/drivers/pc88va.c
r19097r19098
1717      hooked up by the current z80 core
1818    - PC-88VA has two bogus opcodes. One is at 0xf0b15, another at 0xf0b31. Making a patch
1919      for the latter makes the system to jump into a "DIP-Switch" display.
20    - DMA almost certainly ISN'T i8237. What is it?
2120
2221********************************************************************************************/
2322
r19097r19098
3332#include "formats/mfi_dsk.h"
3433#include "formats/xdf_dsk.h"
3534#include "formats/d88_dsk.h"
35#include "machine/upd71071.h"
3636
3737/* Note: for the time being, just disable FDC CPU, it's for PC-8801 compatibility mode anyway ... */
3838#define TEST_SUBFDC 0
r19097r19098
5959public:
6060   pc88va_state(const machine_config &mconfig, device_type type, const char *tag)
6161      : driver_device(mconfig, type, tag) ,
62      m_dmac(*this, "dmac"),
6263      m_palram(*this, "palram"){ }
6364
65   required_device<upd71071_device> m_dmac;
6466   required_shared_ptr<UINT16> m_palram;
6567   UINT16 m_bank_reg;
6668   UINT16 m_screen_ctrl_reg;
r19097r19098
129131   DECLARE_WRITE8_MEMBER(r232_ctrl_portc_w);
130132   DECLARE_WRITE_LINE_MEMBER(pc88va_pic_irq);
131133   DECLARE_READ8_MEMBER(get_slave_ack);
132   DECLARE_READ8_MEMBER(pc88va_dma_r);
133   DECLARE_WRITE8_MEMBER(pc88va_dma_w);
134134   DECLARE_WRITE_LINE_MEMBER(pc88va_pit_out0_changed);
135135   DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt);
136136   UINT8 m_fdc_ctrl_2;
r19097r19098
946946
947947READ8_MEMBER(pc88va_state::key_r)
948948{
949   // note row C bit 2 does something at POST ... some kind of test mode?
949   // note row D bit 2 does something at POST ... some kind of test mode?
950950   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3",
951951                                           "KEY4", "KEY5", "KEY6", "KEY7",
952952                                           "KEY8", "KEY9", "KEYA", "KEYB",
r19097r19098
11251125}
11261126#endif
11271127
1128/* TODO: identify or emulate this DMAC */
1129READ8_MEMBER(pc88va_state::pc88va_dma_r)
1130{
1131/*
11320: undefined
11331: ---x ---- mode
1134   ---- xxxx select channel (bit-wise)
11352/3: xxxx xxxx count
11364/5: xxxx xxxx address
11376: ---- xxxx address
11388: ???? ???? Device control Register
1139A: ???? ???? Mode control Register
1140B: ???? ???? Status Register (r/o)
1141F: xxxx xxxx Mask Register
1142*/
1143
1144   return 0;
1145}
1146
1147WRITE8_MEMBER(pc88va_state::pc88va_dma_w)
1148{
1149   switch(offset)
1150   {
1151      case 0x00: printf("DMA reset %02x\n",data & 1); break;
1152      case 0x01: printf("DMA select channel %02x mode channel %02x\n",data & 3,(data & 4) >> 2); break;
1153      case 0x02: printf("DMA count 7-0 %02x\n",data); break;
1154      case 0x03: printf("DMA count 15-8 %02x\n",data); break;
1155      case 0x04: printf("DMA address 7-0 %02x\n",data); break;
1156      case 0x05: printf("DMA address 15-8 %02x\n",data); break;
1157      case 0x06: printf("DMA address 19-16 %02x\n",data); break;
1158      case 0x08: printf("DMA Device control register %02x\n",data); break;
1159      case 0x0a: printf("DMA Mode control register %02x\n",data); break;
1160      case 0x0f: printf("DMA Mask register %02x\n",data); break;
1161   }
1162}
1163
11641128static ADDRESS_MAP_START( pc88va_io_map, AS_IO, 16, pc88va_state )
11651129   AM_RANGE(0x0000, 0x000f) AM_READ8(key_r,0xffff) // Keyboard ROW reading
11661130//  AM_RANGE(0x0010, 0x0010) Printer / Calendar Clock Interface
r19097r19098
12111175   AM_RANGE(0x0156, 0x0157) AM_READ8(rom_bank_r,0x00ff) // ROM bank status
12121176//  AM_RANGE(0x0158, 0x0159) Interruption Mode Modification
12131177//  AM_RANGE(0x015c, 0x015f) NMI mask port (strobe port)
1214   AM_RANGE(0x0160, 0x016f) AM_READWRITE8(pc88va_dma_r,pc88va_dma_w,0xffff) // DMA Controller
1178   AM_RANGE(0x0160, 0x016f) AM_DEVREADWRITE8_LEGACY("dmac", upd71071_r, upd71071_w,0xffff) // DMA Controller
12151179   AM_RANGE(0x0184, 0x0187) AM_DEVREADWRITE8_LEGACY("pic8259_slave", pic8259_r, pic8259_w, 0x00ff)
12161180   AM_RANGE(0x0188, 0x018b) AM_DEVREADWRITE8_LEGACY("pic8259_master", pic8259_r, pic8259_w, 0x00ff) // ICU, also controls 8214 emulation
12171181//  AM_RANGE(0x0190, 0x0191) System Port 5
r19097r19098
14561420   PORT_START("SYSOP_SW")
14571421   PORT_DIPNAME( 0x03, 0x01, "System Operational Mode" )
14581422//  PORT_DIPSETTING(    0x00, "Reserved" )
1459   PORT_DIPSETTING(    0x02, "N88 V1 Mode" )
14601423   PORT_DIPSETTING(    0x01, "N88 V2 Mode" )
1424   PORT_DIPSETTING(    0x02, "N88 V1 Mode" )
14611425//  PORT_DIPSETTING(    0x03, "???" )
14621426INPUT_PORTS_END
14631427
r19097r19098
17231687   DEVCB_NULL
17241688};
17251689
1690/* ch2 is FDC, ch0/3 are "user". ch1 is unused */
1691static const upd71071_intf pc88va_dma_config =
1692{
1693   "maincpu",
1694   8000000,
1695   { 0, 0, 0, 0 },
1696   { 0, 0, 0, 0 }
1697};
1698
17261699static const floppy_format_type pc88va_floppy_formats[] = {
17271700   FLOPPY_XDF_FORMAT,
17281701   FLOPPY_MFI_FORMAT,
r19097r19098
17671740   MCFG_PIC8259_ADD( "pic8259_master", pc88va_pic8259_master_config )
17681741   MCFG_PIC8259_ADD( "pic8259_slave", pc88va_pic8259_slave_config )
17691742
1743   MCFG_UPD71071_ADD("dmac",pc88va_dma_config)
1744
17701745   MCFG_UPD765A_ADD("upd765", false, true)
17711746   MCFG_FLOPPY_DRIVE_ADD("upd765:0", pc88va_floppies, "525hd", 0, pc88va_floppy_formats)
17721747   MCFG_FLOPPY_DRIVE_ADD("upd765:1", pc88va_floppies, "525hd", 0, pc88va_floppy_formats)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team