diff options
| author | 2025-11-08 10:18:39 +0100 | |
|---|---|---|
| committer | 2025-11-08 10:18:39 +0100 | |
| commit | 07bc95ba8cbd612751ca31f4a2ebede8a04b9a4d (patch) | |
| tree | 049181a22d009360d53f37ca4cd47b02355fca34 | |
| parent | 97a40e2728288893a98e5ed3d1fa06cc6340da3b (diff) | |
Add dsp56362 to the audio processing unit in xbox_pci.cpp as the general purpose dsp
| -rw-r--r-- | src/mame/shared/xbox_pci.cpp | 19 | ||||
| -rw-r--r-- | src/mame/shared/xbox_pci.h | 8 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/mame/shared/xbox_pci.cpp b/src/mame/shared/xbox_pci.cpp index 3b850664acf..530eca40dc3 100644 --- a/src/mame/shared/xbox_pci.cpp +++ b/src/mame/shared/xbox_pci.cpp @@ -9,6 +9,8 @@ #include "machine/pci.h" #include "machine/idectrl.h" +#include "cpu/dsp563xx/dsp56362.h" + #include <functional> #define LOG_AUDIO (1U << 1) @@ -1041,8 +1043,15 @@ void mcpx_apu_device::apu_mmio(address_map &map) map(0x00000000, 0x00007ffff).rw(FUNC(mcpx_apu_device::apu_r), FUNC(mcpx_apu_device::apu_w)); } +void mcpx_apu_device::p_map(address_map &map) +{ + map(0xc00000, 0xc01fff).ram(); + //map(0x002000, 0x002fff).r(FUNC(mcpx_apu_device::test_r)); +} + mcpx_apu_device::mcpx_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, MCPX_APU, tag, owner, clock), + gpdsp(*this, "gpdsp"), cpu(*this, finder_base::DUMMY_TAG) { } @@ -1065,6 +1074,7 @@ void mcpx_apu_device::device_start() apust.space = &cpu->space(); apust.timer = timer_alloc(FUNC(mcpx_apu_device::audio_update), this); apust.timer->enable(false); + gpdsp->set_disable(); } void mcpx_apu_device::device_reset() @@ -1072,6 +1082,15 @@ void mcpx_apu_device::device_reset() pci_device::device_reset(); } +void mcpx_apu_device::device_add_mconfig(machine_config &config) +{ + DSP56362(config, gpdsp, 10'000'000); + gpdsp->set_hard_omr(0); // try to reset at 0xc00000 + gpdsp->set_addrmap(dsp56362_device::AS_P, &mcpx_apu_device::p_map); + //m_dsp->set_addrmap(dsp56364_device::AS_X, &mcpx_apu_device::x_map); + //m_dsp->set_addrmap(dsp56364_device::AS_Y, &mcpx_apu_device::y_map); +} + TIMER_CALLBACK_MEMBER(mcpx_apu_device::audio_update) { // this works only for outr2 diff --git a/src/mame/shared/xbox_pci.h b/src/mame/shared/xbox_pci.h index 2fc2fc51e1b..27b2bbd4ad7 100644 --- a/src/mame/shared/xbox_pci.h +++ b/src/mame/shared/xbox_pci.h @@ -15,6 +15,8 @@ #include "machine/ds128x.h" #include "machine/am9517a.h" +#include "cpu/dsp563xx/dsp56362.h" + /* * Host */ @@ -367,11 +369,14 @@ protected: virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual void config_map(address_map &map) override ATTR_COLD; TIMER_CALLBACK_MEMBER(audio_update); private: + required_device<dsp56362_device> gpdsp; required_device<device_memory_interface> cpu; // APU contains 3 dsps: voice processor (VP) global processor (GP) encode processor (EP) struct apu_state { @@ -385,7 +390,7 @@ private: uint32_t epdsp_sgblocks2 = 0; int voice_number = 0; uint32_t voices_heap_blockaddr[1024]{}; - uint64_t voices_active[4]{}; //one bit for each voice: 1 playing 0 not + uint64_t voices_active[4]{}; // one bit for each voice: 1 playing 0 not uint32_t voicedata_address = 0; int voices_frequency[256]{}; // sample rate int voices_position[256]{}; // position in samples * 1000 @@ -396,6 +401,7 @@ private: address_space *space = nullptr; } apust; void apu_mmio(address_map &map) ATTR_COLD; + void p_map(address_map &map) ATTR_COLD; uint8_t minimum_grant_r() { return 1; } uint8_t maximum_latency_r() { return 0xc; } }; |
