From a1061aae99f7076781457834cca52c160f31ffcc Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 24 May 2018 15:48:10 +0200 Subject: pc9801.cpp: fix sound ROM mapping, fixed sound board initialize for Eikan wa Kimi ni 2 [Angelo Salese] --- src/devices/sound/aica.cpp | 2 ++ src/mame/drivers/pc9801.cpp | 14 ++++++++------ src/mame/includes/pc9801.h | 4 ++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/devices/sound/aica.cpp b/src/devices/sound/aica.cpp index 7ff090dd404..fb6a2957bda 100644 --- a/src/devices/sound/aica.cpp +++ b/src/devices/sound/aica.cpp @@ -1212,6 +1212,8 @@ int32_t aica_device::UpdateSlot(AICA_SLOT *slot) StopSlot(slot,0); } break; + // TODO: causes an hang in Border Down/Metal Slug 6/Karous etc. + // for mslug6 culprit RAM address is 0x13880 ARM side (a flag that should be zeroed somehow) case 1: //normal loop if(*addr[addr_select]>=chanlea) { diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp index 29eeb82eee0..8d33c346480 100644 --- a/src/mame/drivers/pc9801.cpp +++ b/src/mame/drivers/pc9801.cpp @@ -7,6 +7,7 @@ driver by Angelo Salese TODO: + - move sound bios ROMs into pc9801_26 / pc9801_86 devices - proper 8251 uart hook-up on keyboard - SASI/SCSI support; - Write a PC80S31K device (also used on PC-8801 and PC-88VA, it's the FDC + Z80 sub-system); @@ -648,7 +649,7 @@ void pc9801_state::pc9801_map(address_map &map) { map(0xa0000, 0xa3fff).rw(this, FUNC(pc9801_state::tvram_r), FUNC(pc9801_state::tvram_w)); //TVRAM map(0xa8000, 0xbffff).rw(this, FUNC(pc9801_state::gvram_r), FUNC(pc9801_state::gvram_w)); //bitmap VRAM - map(0xcc000, 0xcdfff).rom().region("sound_bios", 0); //sound BIOS + map(0xcc000, 0xcffff).rom().region("sound_bios", 0); //sound BIOS map(0xd6000, 0xd6fff).rom().region("fdc_bios_2dd", 0); //floppy BIOS 2dd map(0xd7000, 0xd7fff).rom().region("fdc_bios_2hd", 0); //floppy BIOS 2hd map(0xe8000, 0xfffff).rom().region("ipl", 0); @@ -782,9 +783,10 @@ WRITE8_MEMBER(pc9801_state::a20_ctrl_w) if(offset == 0x00) { uint8_t por; - /* reset POR bit, TODO: is there any other way? */ - por = machine().device("ppi8255_sys")->read(space, 2) & ~0x20; - machine().device("ppi8255_sys")->write(space, 2,por); + /* reset POR bit */ + // TODO: is there any other way that doesn't involve direct r/w of ppi address? + por = m_ppi_sys->read(space, 2) & ~0x20; + m_ppi_sys->write(space, 2, por); m_maincpu->set_input_line(INPUT_LINE_A20, CLEAR_LINE); m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); m_gate_a20 = 0; @@ -1403,7 +1405,7 @@ void pc9801_state::pc9821_map(address_map &map) map(0x000a0000, 0x000a3fff).rw(this, FUNC(pc9801_state::tvram_r), FUNC(pc9801_state::tvram_w)); map(0x000a4000, 0x000a4fff).rw(this, FUNC(pc9801_state::pc9801rs_knjram_r), FUNC(pc9801_state::pc9801rs_knjram_w)); map(0x000a8000, 0x000bffff).rw(this, FUNC(pc9801_state::pc9821_grcg_gvram_r), FUNC(pc9801_state::pc9821_grcg_gvram_w)); - map(0x000cc000, 0x000cdfff).rom().region("sound_bios", 0); //sound BIOS + map(0x000cc000, 0x000cffff).rom().region("sound_bios", 0); //sound BIOS //map(0x000d8000, 0x000d9fff).rom().region("ide",0) map(0x000da000, 0x000dbfff).ram(); // ide ram map(0x000e0000, 0x000e7fff).rw(this, FUNC(pc9801_state::pc9821_grcg_gvram0_r), FUNC(pc9801_state::pc9821_grcg_gvram0_w)); @@ -2764,7 +2766,7 @@ ROM_START( pc9821 ) ROM_FILL(0x27ffe, 1, 0x92) ROM_FILL(0x27fff, 1, 0xd7) - ROM_REGION( 0x10000, "sound_bios", 0 ) + ROM_REGION( 0x10000, "sound_bios", 0 ) // this is a -26 bios! ROM_LOAD( "sound.rom", 0x0000, 0x4000, CRC(a21ef796) SHA1(34137c287c39c44300b04ee97c1e6459bb826b60) ) ROM_REGION( 0x80000, "chargen", 0 ) diff --git a/src/mame/includes/pc9801.h b/src/mame/includes/pc9801.h index a65e61f435e..9f2c16e25b9 100644 --- a/src/mame/includes/pc9801.h +++ b/src/mame/includes/pc9801.h @@ -84,6 +84,8 @@ public: m_pit8253(*this, "pit8253"), m_pic1(*this, "pic8259_master"), m_pic2(*this, "pic8259_slave"), + m_ppi_sys(*this, "ppi8255_sys"), + m_ppi_prn(*this, "ppi8255_prn"), m_fdc_2hd(*this, "upd765_2hd"), m_fdc_2dd(*this, "upd765_2dd"), m_rtc(*this, UPD1990A_TAG), @@ -130,6 +132,8 @@ private: required_device m_pit8253; required_device m_pic1; required_device m_pic2; + required_device m_ppi_sys; + required_device m_ppi_prn; required_device m_fdc_2hd; optional_device m_fdc_2dd; required_device m_rtc; -- cgit v1.2.3