hash/pcecd.xml: QA notes (#10956)

* pce_cd.cpp: convert to logmacro, fix regression on stop/repeat conditions, workaround MT#07972

* Delete unnecessary stub files from the other branch

* hash/pcecd.xml: QA notes

* nec/pce_cd.cpp: fix MT#07972 for good

* hash/pcecd.xml: update QA

* hash/pcecd.xml, nec/pce_cd.cpp: update QA

* nec/pce_cd.cpp: make pregap to have a minimum of 2 seconds, fixes redbook offset

* sound/cdda.cpp: add an actual write callback for audio playback end event

* nec/pce_cd.cpp: implement CDDA audio end event, fixes redbook repeat with emeraldd

* hash/pcecd.xml: update QA

* nec/pce_cd.cpp: do not send an irq when start/end redbook commands are issued, fixes macr2036 (MT #5995), jleagt94, iganin

* hash/pcecd.xml: QA heavy hitters

* hash/pcecd.xml: QA

* nec/pce_cd.cpp: unbreak snatcher, unbreak audio CD player

* nec/pce_cd.cpp: document crazyhos btanb

* nec/pce_cd.cpp: make BRAM to init to a standard scdsys format data

* hash/pcecd.xml: acknowledge games using Save-Kun peripheral

* nec/pce_cd.cpp: fix cdda get_channel_volume index overflow

* sound/cdda.cpp: fix longstanding regression with get_channel_volume, rename it to get_channel_sample

* nec/pce_cd.cpp: QA fader

* nec/pce_cd.cpp: cancel redbook when audio start + play mode = 0 is issued, fixes ppersia sound when picking up sword

* hash/pcecd.xml: finalize QA

* nec/pce_cd.cpp: misc cleanups

* hash/pcecd.xml: fix neklegbb description tag

* hash/pcecd.xml: faussete/traveler description fixes
This commit is contained in:
Angelo Salese 2023-03-19 13:02:02 +01:00 committed by GitHub
parent 84140265c4
commit 3cf4d60bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 764 additions and 422 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
<!--
license:CC0-1.0
-->
<softwarelist name="tg16" description="NEC Turbografx-16 cartridges">
<softwarelist name="tg16" description="NEC Turbografx-16 HuCards">
<software name="aeroblst">
<description>Aero Blasters</description>
<year>1990</year>

View File

@ -3,7 +3,7 @@
/***********************************************************************************************************
PC-Engine & Turbografx-16 cart emulation
PC-Engine & Turbografx-16 HuCard emulation
***********************************************************************************************************/
@ -18,11 +18,11 @@
// pce_rom_device - constructor
//-------------------------------------------------
DEFINE_DEVICE_TYPE(PCE_ROM_STD, pce_rom_device, "pce_rom", "PCE/TG16 Carts")
DEFINE_DEVICE_TYPE(PCE_ROM_CDSYS3, pce_cdsys3_device, "pce_cdsys3", "PCE/TG16 CD-System Cart v3.00")
DEFINE_DEVICE_TYPE(PCE_ROM_POPULOUS, pce_populous_device, "pce_populous", "PCE Populous Cart")
DEFINE_DEVICE_TYPE(PCE_ROM_SF2, pce_sf2_device, "pce_sf2", "PCE Street Fighter 2 CE Cart")
DEFINE_DEVICE_TYPE(PCE_ROM_TENNOKOE, pce_tennokoe_device, "pce_tennokoe", "PCE Tennokoe Bank Cart")
DEFINE_DEVICE_TYPE(PCE_ROM_STD, pce_rom_device, "pce_rom", "PCE/TG16 HuCards")
DEFINE_DEVICE_TYPE(PCE_ROM_CDSYS3, pce_cdsys3_device, "pce_cdsys3", "PCE/TG16 CD-System HuCard v3.00")
DEFINE_DEVICE_TYPE(PCE_ROM_POPULOUS, pce_populous_device, "pce_populous", "PCE Populous HuCard")
DEFINE_DEVICE_TYPE(PCE_ROM_SF2, pce_sf2_device, "pce_sf2", "PCE Street Fighter 2 CE HuCard")
DEFINE_DEVICE_TYPE(PCE_ROM_TENNOKOE, pce_tennokoe_device, "pce_tennokoe", "PCE Tennokoe Bank HuCard")
pce_rom_device::pce_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)

View File

@ -187,6 +187,11 @@ void pce_control_port_devices(device_slot_interface &device)
// 3 Button Joypad/Joysticks (ex: Avenue Pad 3)
// PC Engine Mouse (PI-PD10)
// Memory Base 128 (PI-AD19)
// Memory BRAM storages, connects to joyport and exposes another DIN-8 port
// cfr. https://github.com/BlockoS/mb128
// NEC Memory Base 128 (PI-AD19, メモリベース128)
// Koei Save-Kun (セーブくん), clone of above?
// etc...
}

View File

@ -18,8 +18,6 @@
void cdda_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
get_audio_data(outputs[0], outputs[1]);
m_audio_volume[0] = outputs[0].get(0);
m_audio_volume[1] = outputs[1].get(0);
}
//-------------------------------------------------
@ -42,6 +40,8 @@ void cdda_device::device_start()
m_audio_bptr = 0;
m_disc = nullptr;
m_audio_end_cb.resolve_safe();
save_item( NAME(m_audio_playing) );
save_item( NAME(m_audio_pause) );
save_item( NAME(m_audio_ended_normally) );
@ -174,8 +174,10 @@ void cdda_device::get_audio_data(write_stream_view &bufL, write_stream_view &buf
{
m_audio_playing = false;
m_audio_ended_normally = true;
m_audio_end_cb(ASSERT_LINE);
}
m_audio_data[0] = m_audio_data[1] = 0;
bufL.fill(0, sampindex);
bufR.fill(0, sampindex);
return;
@ -190,8 +192,12 @@ void cdda_device::get_audio_data(write_stream_view &bufL, write_stream_view &buf
for (i = 0; i < samples; i++)
{
/* CD-DA data on the disc is big-endian */
bufL.put_int(sampindex + i, s16(big_endianize_int16( audio_cache[ m_audio_bptr ] )), 32768); m_audio_bptr++;
bufR.put_int(sampindex + i, s16(big_endianize_int16( audio_cache[ m_audio_bptr ] )), 32768); m_audio_bptr++;
m_audio_data[0] = s16(big_endianize_int16( audio_cache[ m_audio_bptr ] ));
bufL.put_int(sampindex + i, m_audio_data[0], 32768);
m_audio_bptr++;
m_audio_data[1] = s16(big_endianize_int16( audio_cache[ m_audio_bptr ] ));
bufR.put_int(sampindex + i, m_audio_data[1], 32768);
m_audio_bptr++;
}
sampindex += samples;
@ -222,13 +228,16 @@ void cdda_device::get_audio_data(write_stream_view &bufL, write_stream_view &buf
}
/*-------------------------------------------------
cdda_get_channel_volume - sets CD-DA volume level
for either speaker, used for volume control display
get_channel_sample - reads currently decoded
data sample on the stream.
Used by PC Engine CD class family for volume
metering on audio CD player.
-------------------------------------------------*/
int16_t cdda_device::get_channel_volume(int channel)
int16_t cdda_device::get_channel_sample(int channel)
{
return m_audio_volume[channel];
m_stream->update();
return m_audio_data[channel];
}
DEFINE_DEVICE_TYPE(CDDA, cdda_device, "cdda", "CD/DA")
@ -238,5 +247,6 @@ cdda_device::cdda_device(const machine_config &mconfig, const char *tag, device_
, device_sound_interface(mconfig, *this)
, m_disc(nullptr)
, m_stream(nullptr)
, m_audio_end_cb(*this)
{
}

View File

@ -18,13 +18,15 @@ public:
void start_audio(uint32_t startlba, uint32_t numblocks);
void stop_audio();
void pause_audio(int pause);
int16_t get_channel_volume(int channel);
int16_t get_channel_sample(int channel);
uint32_t get_audio_lba();
int audio_active();
int audio_paused();
int audio_ended();
auto audio_end_cb() { return m_audio_end_cb.bind(); }
protected:
// device-level overrides
virtual void device_start() override;
@ -46,7 +48,9 @@ private:
std::unique_ptr<uint8_t[]> m_audio_cache;
uint32_t m_audio_samples;
uint32_t m_audio_bptr;
int16_t m_audio_volume[2];
int16_t m_audio_data[2];
devcb_write_line m_audio_end_cb;
};
DECLARE_DEVICE_TYPE(CDDA, cdda_device)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Wilbert Pol
// copyright-holders:Wilbert Pol, Angelo Salese
#ifndef MAME_NEC_PCE_CD_H
#define MAME_NEC_PCE_CD_H
@ -91,7 +91,7 @@ private:
uint8_t adpcm_address_control_r();
void adpcm_address_control_w(uint8_t data);
void adpcm_playback_rate_w(uint8_t data);
void fade_register_w(uint8_t data);
void fader_control_w(uint8_t data);
uint8_t m_reset_reg = 0;
uint8_t m_irq_mask = 0;
@ -103,7 +103,7 @@ private:
uint16_t m_adpcm_latch_address = 0;
uint8_t m_adpcm_control = 0;
uint8_t m_adpcm_dma_reg = 0;
uint8_t m_fade_reg = 0;
uint8_t m_fader_ctrl = 0;
void regs_map(address_map &map);
void adpcm_stop(uint8_t irq_flag);
@ -214,6 +214,8 @@ private:
DECLARE_WRITE_LINE_MEMBER(msm5205_int);
void nvram_init(nvram_device &nvram, void *data, size_t size);
DECLARE_WRITE_LINE_MEMBER(cdda_end_mark_cb);
};

View File

@ -1,84 +1,16 @@
// license:BSD-3-Clause
// copyright-holders:Charles MacDonald, Wilbert Pol, Angelo Salese
/************************************************************
/**************************************************************************************************
PC Engine CD HW notes:
PC Engine legacy middle ground file, to be removed ...
TODO:
- Dragon Ball Z: ADPCM dies after the first upload;
- Dragon Slayer - The Legend of Heroes: black screen;
- Mirai Shonen Conan: dies at new game selection;
- Snatcher: black screen after Konami logo, tries set up CD-DA
while transferring data?
- Steam Heart's: needs transfer ready irq to get past the
gameplay hang, don't know exactly when it should fire
- Steam Heart's: bad ADPCM irq, dialogue is cutted due of it;
=============================================================
CD Interface Register 0x00 - CDC status
x--- ---- busy signal
-x-- ---- request signal
---x ---- cd signal
---- x--- i/o signal
CD Interface Register 0x03 - BRAM lock / CD status
-x-- ---- acknowledge signal
--x- ---- done signal
---x ---- bram signal
---- x--- ADPCM 2
---- -x-- ADPCM 1
---- --x- CDDA left/right speaker select
CD Interface Register 0x05 - CD-DA Volume low 8-bit port
CD Interface Register 0x06 - CD-DA Volume high 8-bit port
CD Interface Register 0x07 - BRAM unlock / CD status
x--- ---- Enables BRAM
CD Interface Register 0x0c - ADPCM status
x--- ---- ADPCM is reading data
---- x--- ADPCM playback (0) stopped (1) currently playing
---- -x-- pending ADPCM data write
---- ---x ADPCM playback (1) stopped (0) currently playing
CD Interface Register 0x0d - ADPCM address control
x--- ---- ADPCM reset
-x-- ---- ADPCM play
--x- ---- ADPCM repeat
---x ---- ADPCM set length
---- x--- ADPCM set read address
---- --xx ADPCM set write address
(note: some games reads bit 5 and wants it to be low otherwise they hangs, surely NOT an ADPCM repeat flag read because it doesn't make sense)
CD Interface Register 0x0e - ADPCM playback rate
CD Interface Register 0x0f - ADPCM fade in/out register
---- xxxx command setting:
0x00 ADPCM/CD-DA Fade-in
0x01 CD-DA fade-in
0x08 CD-DA fade-out (short) ADPCM fade-in
0x09 CD-DA fade-out (long)
0x0a ADPCM fade-out (long)
0x0c CD-DA fade-out (short) ADPCM fade-in
0x0d CD-DA fade-out (short)
0x0e ADPCM fade-out (short)
*************************************************************/
**************************************************************************************************/
#include "emu.h"
#include "cpu/h6280/h6280.h"
#include "pce.h"
/* joystick related data*/
#define JOY_CLOCK 0x01
#define JOY_RESET 0x02
void pce_state::init_pce()
{
m_io_port_options = PCE_JOY_SIG | CONST_SIG;
@ -119,7 +51,6 @@ void pce_state::machine_reset()
}
}
/* todo: how many input ports does the PCE have? */
void pce_state::controller_w(u8 data)
{
m_port_ctrl->sel_w(BIT(data, 0));