-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes/ROMs for Roland stuff (#12555)
* Fixed screen * Added ROMs and GP/LP support * Fixed rom and prints * Leftover * Fix
- Loading branch information
Showing
13 changed files
with
286 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:giulioz | ||
|
||
// Initial skeleton based on the RE work by nukeykt | ||
|
||
#include "emu.h" | ||
#include "roland_gp.h" | ||
|
||
// Original chip (GP-2) TODO | ||
// DEFINE_DEVICE_TYPE(TC24SC201AF, tc6116_device, "tc24sc201af", "Roland GP TC24SC201AF PCM") | ||
|
||
// Newer chip (GP-4) including bugfixes and H8/500 cpu glue logic | ||
DEFINE_DEVICE_TYPE(TC6116, tc6116_device, "tc6116", "Roland GP TC6116 PCM") | ||
|
||
|
||
tc6116_device::tc6116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) | ||
: device_t(mconfig, TC6116, tag, owner, clock) | ||
, device_sound_interface(mconfig, *this) | ||
, device_rom_interface(mconfig, *this) | ||
, m_int_callback(*this) | ||
, m_clock(0) | ||
, m_rate(0) | ||
, m_stream(nullptr) | ||
, m_sel_chn(0) | ||
{ | ||
} | ||
|
||
//------------------------------------------------- | ||
// device_start - device-specific startup | ||
//------------------------------------------------- | ||
|
||
void tc6116_device::device_start() | ||
{ | ||
m_clock = clock() / 2; | ||
m_rate = m_clock / 512; // usually 32 KHz | ||
|
||
m_stream = stream_alloc(0, 2, m_rate); | ||
|
||
logerror("Roland GP: Clock %u, Rate %u\n", m_clock, m_rate); | ||
} | ||
|
||
//------------------------------------------------- | ||
// device_reset - device-specific reset | ||
//------------------------------------------------- | ||
|
||
void tc6116_device::device_reset() | ||
{ | ||
m_int_callback(CLEAR_LINE); | ||
} | ||
|
||
//------------------------------------------------- | ||
// rom_bank_pre_change - refresh the stream if the | ||
// ROM banking changes | ||
//------------------------------------------------- | ||
|
||
void tc6116_device::rom_bank_pre_change() | ||
{ | ||
// unused right now | ||
m_stream->update(); | ||
} | ||
|
||
|
||
u8 tc6116_device::read(offs_t offset) | ||
{ | ||
return 0xff; | ||
} | ||
|
||
void tc6116_device::write(offs_t offset, u8 data) | ||
{ | ||
} | ||
|
||
//------------------------------------------------- | ||
// sound_stream_update - handle a stream update | ||
//------------------------------------------------- | ||
|
||
void tc6116_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:giulioz | ||
#ifndef MAME_SOUND_ROLANDGP_H | ||
#define MAME_SOUND_ROLANDGP_H | ||
|
||
#pragma once | ||
|
||
#include "dirom.h" | ||
|
||
class tc6116_device : public device_t, public device_sound_interface, public device_rom_interface<23> | ||
{ | ||
public: | ||
tc6116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); | ||
|
||
auto int_callback() { return m_int_callback.bind(); } | ||
|
||
u8 read(offs_t offset); | ||
void write(offs_t offset, u8 data); | ||
|
||
protected: | ||
// device_t implementation | ||
virtual void device_start() override; | ||
virtual void device_reset() override; | ||
|
||
// device_sound_interface implementation | ||
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; | ||
|
||
// device_rom_interface implementation | ||
virtual void rom_bank_pre_change() override; | ||
|
||
private: | ||
static constexpr unsigned NUM_CHANNELS = 28; | ||
|
||
struct pcm_channel | ||
{ | ||
pcm_channel() { } | ||
|
||
// registers | ||
uint8_t pitch_coarse; | ||
uint8_t pitch_fine; | ||
uint8_t pan_l; | ||
uint8_t pan_r; | ||
uint8_t rev_send; | ||
uint8_t chorus_send; | ||
uint8_t volume1; | ||
uint8_t volume1_speed; | ||
uint8_t volume2; | ||
uint8_t volume2_speed; | ||
uint8_t cutoff; | ||
uint8_t cutoff_speed; | ||
|
||
bool irq_enable; // 0 | ||
bool filter_mode; // 1 (0:lpf, 1:hpf) | ||
uint8_t resonance_flags; // 8-15 | ||
|
||
uint8_t sub_phase_addr; // 0-4 | ||
bool key; // 5 | ||
bool alt_loop; // 6 | ||
bool reverse_play; // 7 | ||
uint8_t hiaddr; // 8-11 | ||
uint8_t nibble; // 2-15 | ||
|
||
// work variables | ||
uint16_t sub_phase_state; // 0-13 | ||
bool irq_disable; // 14 | ||
bool alt_loop_state; // 15 | ||
|
||
uint16_t volume1_tv; | ||
uint16_t volume2_tv; | ||
uint16_t cutoff_tv; | ||
}; | ||
|
||
devcb_write_line m_int_callback; | ||
|
||
uint32_t m_clock; // clock | ||
uint32_t m_rate; // sample rate (usually 32000 Hz) | ||
sound_stream* m_stream; // stream handle | ||
pcm_channel m_chns[NUM_CHANNELS]; // channel memory | ||
[[maybe_unused]] uint8_t m_sel_chn; // selected channel | ||
}; | ||
|
||
DECLARE_DEVICE_TYPE(TC6116, tc6116_device) | ||
|
||
#endif // MAME_SOUND_ROLANDGP_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.