Previous 199869 Revisions Next

r32558 Sunday 5th October, 2014 at 21:21:36 UTC by Carl
(mess) pc9801: make ide almost work (nw)
---
This one will actually try to boot with the changes noted in the source (the tvram change may work for sasi too along with the sasi rom in 2hdif.rom) but there appear to be pio timing issues so when it branches in the bootloader it lands on the wrong instruction.  The ide rom has a few 386 instructions in it so it won't work with the ux.
[src/mess/drivers]pc9801.c

trunk/src/mess/drivers/pc9801.c
r32557r32558
649649   DECLARE_READ8_MEMBER(pic_r);
650650   DECLARE_WRITE8_MEMBER(pic_w);
651651
652   DECLARE_READ8_MEMBER(pc9801rs_ide_io_0_r);
653   DECLARE_READ16_MEMBER(pc9801rs_ide_io_1_r);
654   DECLARE_READ16_MEMBER(pc9801rs_ide_io_2_r);
655   DECLARE_WRITE8_MEMBER(pc9801rs_ide_io_0_w);
656   DECLARE_WRITE16_MEMBER(pc9801rs_ide_io_1_w);
657   DECLARE_WRITE16_MEMBER(pc9801rs_ide_io_2_w);
658
659652   DECLARE_READ8_MEMBER(sdip_0_r);
660653   DECLARE_READ8_MEMBER(sdip_1_r);
661654   DECLARE_READ8_MEMBER(sdip_2_r);
r32557r32558
20542047   else if(offset >= 0x000b8000 && offset <= 0x000bffff)                   { return m_pc9801rs_grcg_r(offset & 0x7fff,3);        }
20552048   else if(offset >= 0x000cc000 && offset <= 0x000cffff)                   { return pc9801rs_soundrom_r(space,offset & 0x3fff);}
20562049   else if(offset >= 0x000d8000 && offset <= 0x000d9fff)                   { return pc9801rs_ide_r(space,offset & 0x1fff);         }
2050   else if(offset >= 0x000da000 && offset <= 0x000dbfff)                   { return pc9821_ideram_r(space,offset & 0x1fff);      }
20572051   else if(offset >= 0x000e0000 && offset <= 0x000e7fff)                   { return m_pc9801rs_grcg_r(offset & 0x7fff,0);        }
20582052   else if(offset >= 0x000e0000 && offset <= 0x000fffff)                   { return pc9801rs_ipl_r(space,offset & 0x1ffff);      }
20592053   else if(offset >= 0x00100000 && offset <= 0x00100000+m_ram_size-1)      { return pc9801rs_ex_wram_r(space,offset-0x00100000); }
r32557r32558
20752069   else if(offset >= 0x000a8000 && offset <= 0x000affff)                   { m_pc9801rs_grcg_w(offset & 0x7fff,1,data);        }
20762070   else if(offset >= 0x000b0000 && offset <= 0x000b7fff)                   { m_pc9801rs_grcg_w(offset & 0x7fff,2,data);        }
20772071   else if(offset >= 0x000b8000 && offset <= 0x000bffff)                   { m_pc9801rs_grcg_w(offset & 0x7fff,3,data);        }
2072   else if(offset >= 0x000da000 && offset <= 0x000dbfff)                   { pc9821_ideram_w(space,offset & 0x1fff,data);         }
20782073   else if(offset >= 0x000e0000 && offset <= 0x000e7fff)                   { m_pc9801rs_grcg_w(offset & 0x7fff,0,data);        }
20792074   else if(offset >= 0x00100000 && offset <= 0x00100000+m_ram_size-1)      { pc9801rs_ex_wram_w(space,offset-0x00100000,data);    }
20802075   //else
r32557r32558
23082303   }
23092304}
23102305
2311READ8_MEMBER(pc9801_state::pc9801rs_ide_io_0_r)
2312{
2313   printf("IDE r %02x\n",offset);
2314   return m_ide_bank[offset];
2315}
2316
2317WRITE8_MEMBER(pc9801_state::pc9801rs_ide_io_0_w)
2318{
2319   /*
2320   [0x430]
2321   [Read/write]
2322       bit 7-0: unknown
2323       00 h = IDE Bank # 1
2324       01 h = IDE Bank # 2
2325
2326   [0x432]
2327       bit 7-0: Bank select
2328       80 h = readout for dummy (only [WRITE])
2329       00 h = IDE Bank # 1 choice
2330       01 h = IDE Bank # 2 selection
2331   */
2332
2333   printf("IDE w %02x %02x\n",offset,data);
2334
2335   if ((data & 0x80) == 0x00)
2336      m_ide_bank[offset] = data & 0x7f;
2337}
2338
2339/* TODO: is mapping correct? */
2340READ16_MEMBER(pc9801_state::pc9801rs_ide_io_1_r)
2341{
2342   return m_ide->read_cs0(space, offset, mem_mask);
2343}
2344
2345WRITE16_MEMBER(pc9801_state::pc9801rs_ide_io_1_w)
2346{
2347   m_ide->write_cs0(space, offset, data, mem_mask);
2348}
2349
2350READ16_MEMBER(pc9801_state::pc9801rs_ide_io_2_r)
2351{
2352   return m_ide->read_cs1(space, offset + 6, mem_mask);
2353}
2354
2355WRITE16_MEMBER(pc9801_state::pc9801rs_ide_io_2_w)
2356{
2357   m_ide->write_cs1(space, offset + 6, data, mem_mask);
2358}
2359
23602306static ADDRESS_MAP_START( pc9801rs_map, AS_PROGRAM, 32, pc9801_state )
23612307   AM_RANGE(0x00000000, 0xffffffff) AM_READWRITE8(pc9801rs_memory_r,pc9801rs_memory_w,0xffffffff)
23622308ADDRESS_MAP_END
r32557r32558
23812327//  AM_RANGE(0x00ec, 0x00ef) PC-9801-86 sound board
23822328   AM_RANGE(0x00f0, 0x00ff) AM_READWRITE8(pc9801rs_f0_r,      pc9801rs_f0_w,      0xffffffff)
23832329//  AM_RANGE(0x0188, 0x018f) AM_READWRITE8(pc9801_opn_r,       pc9801_opn_w,       0xffffffff) //ym2203 opn / <undefined>
2384   AM_RANGE(0x0430, 0x0433) AM_READWRITE8(pc9801rs_ide_io_0_r,  pc9801rs_ide_io_0_w,0x00ff00ff)
23852330
23862331   AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffffffff)
23872332   AM_RANGE(0x043c, 0x043f) AM_WRITE8(pc9801rs_bank_w,    0xffffffff) //ROM/RAM bank
23882333
2389   AM_RANGE(0x0640, 0x064f) AM_READWRITE16(pc9801rs_ide_io_1_r,  pc9801rs_ide_io_1_w,0xffffffff)
2390   AM_RANGE(0x074c, 0x074f) AM_READWRITE16(pc9801rs_ide_io_2_r,  pc9801rs_ide_io_2_w,0xffffffff)
2334   AM_RANGE(0x0640, 0x064f) AM_DEVREADWRITE16("ide", ata_interface_device, read_cs0, write_cs0, 0xffffffff)
2335   AM_RANGE(0x0740, 0x074f) AM_DEVREADWRITE16("ide", ata_interface_device, read_cs1, write_cs1, 0xffffffff)
23912336
23922337   AM_RANGE(0x3fd8, 0x3fdf) AM_READWRITE8(pc9801rs_pit_mirror_r,        pc9801rs_pit_mirror_w,        0xffffffff) // <undefined> / pit mirror ports
23932338   AM_RANGE(0x7fd8, 0x7fdf) AM_READWRITE8(pc9801_mouse_r,     pc9801_mouse_w,     0xffffffff) // <undefined> / mouse ppi8255 ports
r32557r32558
27512696   AM_RANGE(0x00f0, 0x00ff) AM_READWRITE8(pc9801rs_f0_r,      pc9801rs_f0_w,      0xffffffff)
27522697//  AM_RANGE(0x0188, 0x018f) AM_READWRITE8(pc9801_opn_r,       pc9801_opn_w,       0xffffffff) //ym2203 opn / <undefined>
27532698//  AM_RANGE(0x018c, 0x018f) YM2203 OPN extended ports / <undefined>
2754   AM_RANGE(0x0430, 0x0433) AM_READWRITE8(pc9801rs_ide_io_0_r,  pc9801rs_ide_io_0_w,0x00ff00ff) // IDE bank register
27552699   AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffffffff)
27562700//  AM_RANGE(0x043d, 0x043d) ROM/RAM bank (NEC)
27572701   AM_RANGE(0x043c, 0x043f) AM_WRITE8(pc9801rs_bank_w,    0xffffffff) //ROM/RAM bank (EPSON)
27582702   AM_RANGE(0x0460, 0x0463) AM_READWRITE8(pc9821_window_bank_r,pc9821_window_bank_w, 0xffffffff)
27592703//  AM_RANGE(0x04a0, 0x04af) EGC
27602704//  AM_RANGE(0x04be, 0x04be) FDC "RPM" register
2761   AM_RANGE(0x0640, 0x064f) AM_READWRITE16(pc9801rs_ide_io_1_r,  pc9801rs_ide_io_1_w,0xffffffff) // IDE registers / <undefined>
2762   AM_RANGE(0x074c, 0x074f) AM_READWRITE16(pc9801rs_ide_io_2_r,  pc9801rs_ide_io_2_w,0xffffffff) // IDE status (r) - IDE control registers (w) / <undefined>
2705   AM_RANGE(0x0640, 0x064f) AM_DEVREADWRITE16("ide", ata_interface_device, read_cs0, write_cs0, 0xffffffff)
2706   AM_RANGE(0x0740, 0x074f) AM_DEVREADWRITE16("ide", ata_interface_device, read_cs1, write_cs1, 0xffffffff)
27632707//  AM_RANGE(0x08e0, 0x08ea) <undefined> / EMM SIO registers
27642708   AM_RANGE(0x09a0, 0x09a3) AM_READWRITE8(pc9821_ext2_video_ff_r, pc9821_ext2_video_ff_w, 0xffffffff) // GDC extended register r/w
27652709//  AM_RANGE(0x09a8, 0x09a8) GDC 31KHz register r/w
r32557r32558
33933337   }
33943338
33953339   m_ide_rom = memregion("ide")->base();
3340   m_ide_ram = auto_alloc_array(machine(), UINT8, 0x2000);
33963341   m_sys_type = 0x80 >> 6;
3342   save_pointer(NAME(m_ide_ram), 0x2000);
33973343}
33983344
33993345MACHINE_START_MEMBER(pc9801_state,pc9801bx2)
r32557r32558
34083354{
34093355   MACHINE_START_CALL_MEMBER(pc9801rs);
34103356
3411   m_ide_ram = auto_alloc_array(machine(), UINT8, 0x2000);
34123357   m_ext_gvram = auto_alloc_array(machine(), UINT8, 0xa0000);
34133358
34143359   save_pointer(NAME(m_sdip), 24);
3415   save_pointer(NAME(m_ide_ram), 0x2000);
34163360   save_pointer(NAME(m_ext_gvram), 0xa0000);
34173361}
34183362
r32557r32558
34313375      int i;
34323376      static const UINT8 default_memsw_data[0x10] =
34333377      {
3378         // set high nibble of byte 9 to 0xa and comment ROM_FILL below to boot from hdd
34343379         0xe1, 0x48, 0xe1, 0x05, 0xe1, 0x04, 0xe1, 0x00, 0xe1, 0x01, 0xe1, 0x00, 0xe1, 0x00, 0xe1, 0x6e
34353380//          0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff
34363381      };

Previous 199869 Revisions Next


© 1997-2024 The MAME Team