diff options
author | Angelo Salese <angelosa@users.noreply.github.com> | 2021-05-11 22:19:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 22:19:16 +0200 |
commit | ef515893122866f8e98e47f9f758f96f539a60c3 (patch) | |
tree | 2653dda793344d3d464d9a0fb86a17fc40eb303a | |
parent | 94db317064735d4f0126676a827ce63787fb044e (diff) |
pc9801.cpp: add implementation of the DAC_1BIT interface (#8017)
* pc9801.cpp: add implementation of the DAC_1BIT interface
* pc9801.cpp: fix DAC1BIT sound aliasing by changing it to a speaker_sound_device, kudos to Lord Nightmare for pointing this out
* pc98.xml: update QA notes
* pc98.xml: fix zeta boot order, promoted to working
* pc9801.cpp: bind level_w directly instead of lambda trampoline
-rw-r--r-- | hash/pc98.xml | 46 | ||||
-rw-r--r-- | src/mame/drivers/pc9801.cpp | 31 | ||||
-rw-r--r-- | src/mame/includes/pc9801.h | 13 |
3 files changed, 59 insertions, 31 deletions
diff --git a/hash/pc98.xml b/hash/pc98.xml index 178faa189d2..9b8c947e46f 100644 --- a/hash/pc98.xml +++ b/hash/pc98.xml @@ -5474,8 +5474,8 @@ only have some part of Windows file and a Video driver(CLGD?). </part> </software> - <!-- This game plays sampled voices through the beeper, but it doesn't work in MAME - it just outputs a constant beep --> - <!-- (has a DAC1BIT tester at boot, may be useful) --> + <!-- boot OK --> + <!-- Has a DAC1BIT sampling tester on boot, needs +18 [tempo]/low [volume] on RS class to match 3 secs as claimed (confirm via real HW). --> <software name="arquelph" supported="partial"> <description>Arquelphos</description> <year>1993</year> @@ -7286,7 +7286,7 @@ only have some part of Windows file and a Video driver(CLGD?). </part> </software> - <!-- boot OK on RS class, on intro uses DAC1BIT and some text doesn't seem to be drawn? --> + <!-- boot OK on RS class, on intro some text doesn't seem to be drawn given the DAC1BIT clicks. --> <!-- black screen after Cocktail Soft logo on VM class (btanb?) --> <software name="bishotsu" supported="partial"> <description>Bishoujo Tsuushin - Chat no Susume</description> @@ -7603,7 +7603,7 @@ only have some part of Windows file and a Video driver(CLGD?). </part> </software> - <!-- This game is supposed to play sound effects through the beeper, but in MAME it just outputs a constant beep (DAC1BIT) --> + <!-- boot OK, DAC1BIT sounds awful on anything, cfr. title screen (tested VM class, RS class and 9821 class) --> <software name="blockouta" cloneof="blockout" supported="partial"> <description>Block Out (Patched?)</description> <year>1991</year> @@ -20933,7 +20933,7 @@ only have some part of Windows file and a Video driver(CLGD?). </software> <!-- boot OK, has heavy GFX issues if EGC is detected. --> - <!-- Uses DAC1BIT for speech --> + <!-- Uses DAC1BIT for speech, sounds too slow for VM class --> <!-- Has extensive system check, NESA bus for instance --> <software name="hypbingo" supported="partial"> <description>Gals Talk Hyper Bingo</description> @@ -23399,7 +23399,7 @@ only have some part of Windows file and a Video driver(CLGD?). </part> </software> - <!-- boot OK, beeps out when it's supposed to play samples (DAC1BIT) --> + <!-- boot OK, DAC1BIT sounds very aliased on RS class (btanb?) --> <software name="hercequa" supported="partial"> <description>Hercequary</description> <year>1994</year> @@ -28339,8 +28339,8 @@ only have some part of Windows file and a Video driver(CLGD?). <!-- all three Madou Monogatari sports a "Madou Monogatari 1-2-3" title screen --> <!-- verify if these were really released as stand alone. --> - <!-- boot OK, uses DAC1BIT samples --> - <software name="madoum1" supported="partial"> + <!-- boot OK --> + <software name="madoum1" supported="yes"> <description>Madou Monogatari 1</description> <year>1991</year> <publisher>コンパイル (Compile)</publisher> @@ -28360,8 +28360,8 @@ only have some part of Windows file and a Video driver(CLGD?). </part> </software> - <!-- boot OK, uses DAC1BIT samples --> - <software name="madoum2" supported="partial"> + <!-- boot OK --> + <software name="madoum2" supported="yes"> <description>Madou Monogatari 2</description> <year>1991</year> <publisher>コンパイル (Compile)</publisher> @@ -28381,8 +28381,8 @@ only have some part of Windows file and a Video driver(CLGD?). </part> </software> - <!-- boot OK, uses DAC1BIT samples --> - <software name="madoum3" supported="partial"> + <!-- boot OK --> + <software name="madoum3" supported="yes"> <description>Madou Monogatari 3</description> <year>1991</year> <publisher>コンパイル (Compile)</publisher> @@ -36345,8 +36345,9 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) </part> </software> - <!-- boot OK, beeps out when it's supposed to play samples (DAC1BIT) --> - <software name="puyopuyo" supported="partial"> + <!-- boot OK --> + <!-- Has DAC1BIT Note class switch option, has Epson class mixing option --> + <software name="puyopuyo" supported="yes"> <description>Puyo Puyo</description> <year>1993</year> <publisher>コンパイル (Compile)</publisher> @@ -49368,12 +49369,15 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) </part> </software> - <software name="zeta"> + <!-- boot OK --> + <software name="zeta" supported="yes"> <description>Zeta</description> <year>1991</year> <publisher>トンキンハウス (Tonkin House)</publisher> <info name="alt_title" value="ゼータ" /> + <info name="developer" value="Will" /> <info name="release" value="19911010" /> + <!-- boot order is trusted, would otherwise moan that file is missing after new game intro (without chance of a disk swap) --> <part name="flop1" interface="floppy_5_25"> <feature name="part_id" value="Disk S1"/> <dataarea name="flop" size="1281968"> @@ -49381,15 +49385,15 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) </dataarea> </part> <part name="flop2" interface="floppy_5_25"> - <feature name="part_id" value="Disk S2"/> + <feature name="part_id" value="Disk D1"/> <dataarea name="flop" size="1281968"> - <rom name="zeta_s2.d88" size="1281968" crc="c1de4377" sha1="e409d06f16a787650ba39974616e0d03957825b1" offset="0" /> + <rom name="zeta_d1.d88" size="1281968" crc="1501f5cc" sha1="6dafbc36800b2ad36ab6b9f8dff37679fed23c1a" offset="0" /> </dataarea> </part> <part name="flop3" interface="floppy_5_25"> - <feature name="part_id" value="Disk D1"/> + <feature name="part_id" value="Disk S2"/> <dataarea name="flop" size="1281968"> - <rom name="zeta_d1.d88" size="1281968" crc="1501f5cc" sha1="6dafbc36800b2ad36ab6b9f8dff37679fed23c1a" offset="0" /> + <rom name="zeta_s2.d88" size="1281968" crc="c1de4377" sha1="e409d06f16a787650ba39974616e0d03957825b1" offset="0" /> </dataarea> </part> <part name="flop4" interface="floppy_5_25"> @@ -69101,8 +69105,8 @@ Same as Police Quest 2 - Quest for Glory stand-alone disks </part> </software> - <!-- boot OK, beeps on intro/start of stages (DAC1BIT) --> - <software name="transbor" supported="partial"> + <!-- boot OK --> + <software name="transbor" supported="yes"> <description>TransbOrder</description> <year>1993</year> <publisher>コンパイル (Compile)</publisher> diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp index 861a097c6e8..287fcd89a42 100644 --- a/src/mame/drivers/pc9801.cpp +++ b/src/mame/drivers/pc9801.cpp @@ -15,8 +15,7 @@ - CMT support (-13/-36 cbus only, identify which models mounted it off the bat); - Write a PC80S31K device for 2d type floppies (also used on PC-8801 and PC-88VA, it's the FDC + Z80 sub-system); - - Anything post-PC9801E/F/M should overwrite "speaker_device" to actually use a - dac_bit_interface instead (cfr. DAC1BIT in SW list); + - DAC1BIT has a bit of clicking with start/end of samples, is it fixable or just a btanb? - clean-ups & split into separate devices and driver flavours; - derive romsets by default options (cfr. 3.5 2HD floppies vs. default 5.25, 2D/2DD etc.); - Remove kludge for POR bit in a20_ctrl_w fn; @@ -1877,11 +1876,19 @@ ch3 SCSI * ****************************************/ -void pc9801_state::ppi_sys_portc_w(uint8_t data) +void pc9801_state::ppi_sys_beep_portc_w(uint8_t data) { m_beeper->set_state(!(data & 0x08)); } +void pc9801_state::ppi_sys_dac_portc_w(uint8_t data) +{ + m_dac_disable = BIT(data, 3); + // TODO: some models have a finer grained volume control at I/O port 0xae8e + // (98NOTE only?) + m_dac->set_output_gain(0, m_dac_disable ? 0.0 : 1.0); +} + /* * Mouse 8255 I/F * @@ -2083,6 +2090,8 @@ MACHINE_START_MEMBER(pc9801_state,pc9801rs) { MACHINE_START_CALL_MEMBER(pc9801_common); + save_item(NAME(m_dac_disable)); + m_sys_type = 0x80 >> 6; } @@ -2112,8 +2121,6 @@ MACHINE_RESET_MEMBER(pc9801_state,pc9801_common) { memset(m_tvram.get(), 0, sizeof(uint16_t) * 0x2000); - m_beeper->set_state(0); - m_nmi_ff = 0; m_mouse.control = 0xff; m_mouse.freq_reg = 0; @@ -2143,6 +2150,8 @@ MACHINE_RESET_MEMBER(pc9801_state,pc9801f) for(i=0;i<0x1000;i++) ROM[i] = PRG[i+op_mode*0x8000+0x10000]; + + m_beeper->set_state(0); } MACHINE_RESET_MEMBER(pc9801_state,pc9801rs) @@ -2162,6 +2171,8 @@ MACHINE_RESET_MEMBER(pc9801_state,pc9801rs) else m_maincpu->space(AS_PROGRAM).install_rom(0xd8000, 0xd9fff, memregion("ide")->base() + 0x2000); } + + m_dac_disable = true; } MACHINE_RESET_MEMBER(pc9801_state,pc9821) @@ -2348,7 +2359,7 @@ void pc9801_state::pc9801_common(machine_config &config) m_ppi_sys->in_pa_callback().set_ioport("DSW2"); m_ppi_sys->in_pb_callback().set_ioport("DSW1"); m_ppi_sys->in_pc_callback().set_constant(0xa0); // 0x80 cpu triple fault reset flag? - m_ppi_sys->out_pc_callback().set(FUNC(pc9801_state::ppi_sys_portc_w)); +// m_ppi_sys->out_pc_callback().set(FUNC(pc9801_state::ppi_sys_portc_w)); I8255(config, m_ppi_prn, 0); // TODO: check this one @@ -2393,7 +2404,6 @@ void pc9801_state::pc9801_common(machine_config &config) SPEAKER(config, "mono").front_center(); - BEEP(config, m_beeper, 2400).add_route(ALL_OUTPUTS, "mono", 0.15); GFXDECODE(config, m_gfxdecode, m_palette, gfx_pc9801); } @@ -2405,6 +2415,7 @@ void pc9801_state::pc9801(machine_config &config) m_maincpu->set_irq_acknowledge_callback("pic8259_master", FUNC(pic8259_device::inta_cb)); pc9801_common(config); + m_ppi_sys->out_pc_callback().set(FUNC(pc9801_state::ppi_sys_beep_portc_w)); MCFG_MACHINE_START_OVERRIDE(pc9801_state, pc9801f) MCFG_MACHINE_RESET_OVERRIDE(pc9801_state, pc9801f) @@ -2424,6 +2435,7 @@ void pc9801_state::pc9801(machine_config &config) m_dmac->in_ior_callback<3>().set(m_fdc_2dd, FUNC(upd765a_device::dma_r)); m_dmac->out_iow_callback<3>().set(m_fdc_2dd, FUNC(upd765a_device::dma_w)); + BEEP(config, m_beeper, 2400).add_route(ALL_OUTPUTS, "mono", 0.15); PALETTE(config, m_palette, FUNC(pc9801_state::pc9801_palette), 16); } @@ -2435,6 +2447,9 @@ void pc9801_state::pc9801rs(machine_config &config) m_maincpu->set_irq_acknowledge_callback("pic8259_master", FUNC(pic8259_device::inta_cb)); pc9801_common(config); + m_ppi_sys->out_pc_callback().set(FUNC(pc9801_state::ppi_sys_dac_portc_w)); + // TODO: verify if it needs invert(); + m_pit8253->out_handler<1>().set( m_dac, FUNC(speaker_sound_device::level_w)); ADDRESS_MAP_BANK(config, "ipl_bank").set_map(&pc9801_state::ipl_bank).set_options(ENDIANNESS_LITTLE, 16, 18, 0x18000); @@ -2450,6 +2465,8 @@ void pc9801_state::pc9801rs(machine_config &config) m_hgdc2->set_addrmap(0, &pc9801_state::upd7220_grcg_2_map); +// DAC_1BIT(config, m_dac, 0).set_output_range(-1, 1).add_route(ALL_OUTPUTS, "mono", 0.15); + SPEAKER_SOUND(config, m_dac).add_route(ALL_OUTPUTS, "mono", 0.40); PALETTE(config, m_palette, FUNC(pc9801_state::pc9801_palette), 16 + 16); } diff --git a/src/mame/includes/pc9801.h b/src/mame/includes/pc9801.h index e4d4e2e98d3..c426a5da972 100644 --- a/src/mame/includes/pc9801.h +++ b/src/mame/includes/pc9801.h @@ -30,6 +30,7 @@ #include "bus/scsi/scsihd.h" #include "sound/beep.h" +//#include "sound/dac.h" #include "sound/spkrdev.h" #include "sound/ym2608.h" @@ -105,6 +106,7 @@ public: m_video_ram_2(*this, "video_ram_2"), m_ext_gvram(*this, "ext_gvram"), m_beeper(*this, "beeper"), + m_dac(*this, "dac"), m_ram(*this, RAM_TAG), m_ipl(*this, "ipl_bank"), m_gfxdecode(*this, "gfxdecode"), @@ -175,7 +177,9 @@ private: required_shared_ptr<uint16_t> m_video_ram_1; required_shared_ptr<uint16_t> m_video_ram_2; optional_shared_ptr<uint32_t> m_ext_gvram; - required_device<beep_device> m_beeper; + optional_device<beep_device> m_beeper; +// optional_device<dac_1bit_device> m_dac; + optional_device<speaker_sound_device> m_dac; optional_device<ram_device> m_ram; optional_device<address_map_bank_device> m_ipl; required_device<gfxdecode_device> m_gfxdecode; @@ -317,7 +321,8 @@ private: DECLARE_WRITE_LINE_MEMBER(dack1_w); DECLARE_WRITE_LINE_MEMBER(dack2_w); DECLARE_WRITE_LINE_MEMBER(dack3_w); - void ppi_sys_portc_w(uint8_t data); + void ppi_sys_beep_portc_w(uint8_t data); + void ppi_sys_dac_portc_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER(fdc_2dd_irq); DECLARE_WRITE_LINE_MEMBER(pc9801rs_fdc_irq); @@ -330,7 +335,6 @@ private: TIMER_DEVICE_CALLBACK_MEMBER( mouse_irq_cb ); uint8_t unk_r(); - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t a20_286(bool state); @@ -393,6 +397,9 @@ private: uint8_t m_ide_sel; + // starting from PC9801VF/U buzzer is substituted with a DAC1BIT + bool m_dac_disable; + /* PC9801RS specific, move to specific state */ uint8_t m_gate_a20; //A20 line uint8_t m_access_ctrl; // DMA related |