mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
funtech/acan: rename to umc6619_sound.cpp/.h, add minor notes
This commit is contained in:
parent
39b831b20c
commit
8e7642c070
@ -64,16 +64,18 @@ STATUS:
|
||||
**************************************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/m6502/m65c02.h"
|
||||
|
||||
#include "bus/generic/slot.h"
|
||||
#include "bus/generic/carts.h"
|
||||
#include "acan.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/m6502/m65c02.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "softlist_dev.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
#include "umc6619_sound.h"
|
||||
#include "umc6650.h"
|
||||
|
||||
#define LOG_UNKNOWNS (1U << 1)
|
||||
@ -185,7 +187,7 @@ private:
|
||||
|
||||
required_shared_ptr<uint16_t> m_vram;
|
||||
required_shared_ptr<uint8_t> m_soundram;
|
||||
required_device<acan_sound_device> m_sound;
|
||||
required_device<umc6619_sound_device> m_sound;
|
||||
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
@ -2255,7 +2257,7 @@ void supracan_state::supracan(machine_config &config)
|
||||
SPEAKER(config, "rspeaker").front_right();
|
||||
|
||||
// TODO: derive and verify from U13_CLOCK
|
||||
ACANSND(config, m_sound, XTAL(3'579'545));
|
||||
UMC6619_SOUND(config, m_sound, XTAL(3'579'545));
|
||||
m_sound->ram_read().set(FUNC(supracan_state::sound_ram_read));
|
||||
m_sound->timer_irq_handler().set(FUNC(supracan_state::sound_timer_irq));
|
||||
m_sound->dma_irq_handler().set(FUNC(supracan_state::sound_dma_irq));
|
||||
|
@ -2,23 +2,23 @@
|
||||
// copyright-holders:Ryan Holtz, superctr
|
||||
/***************************************************************************
|
||||
|
||||
Super A'Can sound driver
|
||||
Super A'Can UMC 6619 sound driver
|
||||
|
||||
Currently has a number of unknown registers and functionality.
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "acan.h"
|
||||
#include "umc6619_sound.h"
|
||||
|
||||
#define VERBOSE (0)
|
||||
#include "logmacro.h"
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(ACANSND, acan_sound_device, "acansound", "Super A'Can Audio")
|
||||
DEFINE_DEVICE_TYPE(UMC6619_SOUND, umc6619_sound_device, "umc6619_sound", "UMC UM6619 Sound Engine")
|
||||
|
||||
acan_sound_device::acan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, ACANSND, tag, owner, clock)
|
||||
umc6619_sound_device::umc6619_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, UMC6619_SOUND, tag, owner, clock)
|
||||
, device_sound_interface(mconfig, *this)
|
||||
, m_stream(nullptr)
|
||||
, m_timer(nullptr)
|
||||
@ -31,11 +31,11 @@ acan_sound_device::acan_sound_device(const machine_config &mconfig, const char *
|
||||
}
|
||||
|
||||
|
||||
void acan_sound_device::device_start()
|
||||
void umc6619_sound_device::device_start()
|
||||
{
|
||||
m_stream = stream_alloc(0, 2, clock() / 16 / 5);
|
||||
m_mix = std::make_unique<int32_t[]>((clock() / 16 / 5) * 2);
|
||||
m_timer = timer_alloc(FUNC(acan_sound_device::channel_irq), this);
|
||||
m_timer = timer_alloc(FUNC(umc6619_sound_device::channel_irq), this);
|
||||
|
||||
// register for savestates
|
||||
save_item(NAME(m_active_channels));
|
||||
@ -56,18 +56,23 @@ void acan_sound_device::device_start()
|
||||
save_item(NAME(m_regs));
|
||||
}
|
||||
|
||||
void acan_sound_device::device_reset()
|
||||
void umc6619_sound_device::device_reset()
|
||||
{
|
||||
m_active_channels = 0;
|
||||
m_dma_channels = 0;
|
||||
std::fill(std::begin(m_regs), std::end(m_regs), 0);
|
||||
|
||||
for (auto &channel : m_channels)
|
||||
{
|
||||
channel.register9 = 0;
|
||||
}
|
||||
|
||||
m_timer->reset();
|
||||
m_timer_irq_handler(0);
|
||||
m_dma_irq_handler(0);
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(acan_sound_device::channel_irq)
|
||||
TIMER_CALLBACK_MEMBER(umc6619_sound_device::channel_irq)
|
||||
{
|
||||
if (m_regs[0x14] & 0x40)
|
||||
{
|
||||
@ -79,7 +84,7 @@ TIMER_CALLBACK_MEMBER(acan_sound_device::channel_irq)
|
||||
}
|
||||
}
|
||||
|
||||
void acan_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
void umc6619_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
|
||||
{
|
||||
std::fill_n(&m_mix[0], outputs[0].samples() * 2, 0);
|
||||
|
||||
@ -130,7 +135,7 @@ void acan_sound_device::sound_stream_update(sound_stream &stream, std::vector<re
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t acan_sound_device::read(offs_t offset)
|
||||
uint8_t umc6619_sound_device::read(offs_t offset)
|
||||
{
|
||||
if (offset == 0x14)
|
||||
{
|
||||
@ -142,10 +147,11 @@ uint8_t acan_sound_device::read(offs_t offset)
|
||||
// acknowledge DMA IRQ?
|
||||
m_dma_irq_handler(0);
|
||||
}
|
||||
// TODO: offset 0x15 (read by streaming DMAs)
|
||||
return m_regs[offset];
|
||||
}
|
||||
|
||||
void acan_sound_device::keyon_voice(uint8_t voice)
|
||||
void umc6619_sound_device::keyon_voice(uint8_t voice)
|
||||
{
|
||||
acan_channel &channel = m_channels[voice];
|
||||
channel.curr_addr = channel.start_addr << 6;
|
||||
@ -156,11 +162,12 @@ void acan_sound_device::keyon_voice(uint8_t voice)
|
||||
//printf("Keyon voice %d\n", voice);
|
||||
}
|
||||
|
||||
void acan_sound_device::write(offs_t offset, uint8_t data)
|
||||
void umc6619_sound_device::write(offs_t offset, uint8_t data)
|
||||
{
|
||||
const uint8_t upper = (offset >> 4) & 0x0f;
|
||||
const uint8_t lower = offset & 0x0f;
|
||||
|
||||
m_stream->update();
|
||||
m_regs[offset] = data;
|
||||
|
||||
switch (upper)
|
||||
@ -285,6 +292,10 @@ void acan_sound_device::write(offs_t offset, uint8_t data)
|
||||
break;
|
||||
}
|
||||
|
||||
// case 4:
|
||||
// Normally 0x03 for keyon channels, 0x01 for streaming DMAs
|
||||
// (staiwbbl, formduel, sangofgt)
|
||||
|
||||
default:
|
||||
LOG("Unknown sound register: %02x = %02x\n", offset, data);
|
||||
break;
|
@ -6,15 +6,15 @@
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef MAME_FUNTECH_ACAN_H
|
||||
#define MAME_FUNTECH_ACAN_H
|
||||
#ifndef MAME_FUNTECH_UM6619_SOUND_H
|
||||
#define MAME_FUNTECH_UM6619_SOUND_H
|
||||
|
||||
#pragma once
|
||||
|
||||
class acan_sound_device : public device_t, public device_sound_interface
|
||||
class umc6619_sound_device : public device_t, public device_sound_interface
|
||||
{
|
||||
public:
|
||||
acan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
umc6619_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
auto ram_read() { return m_ram_read.bind(); }
|
||||
auto timer_irq_handler() { return m_timer_irq_handler.bind(); }
|
||||
@ -65,6 +65,6 @@ private:
|
||||
std::unique_ptr<int32_t[]> m_mix;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(ACANSND, acan_sound_device)
|
||||
DECLARE_DEVICE_TYPE(UMC6619_SOUND, umc6619_sound_device)
|
||||
|
||||
#endif // MAME_FUNTECH_ACAN_H
|
||||
#endif // MAME_FUNTECH_UM6619_SOUND_H
|
Loading…
Reference in New Issue
Block a user