diff options
| author | 2025-07-02 11:49:09 +0200 | |
|---|---|---|
| committer | 2025-07-02 11:50:22 +0200 | |
| commit | 44a48c55c375ef5a25e601d4e4dc39ffa95aa584 (patch) | |
| tree | 22bd5f677386f5faeb5ceabdfc8e9bd6b60566c6 /src/devices/cpu/sh | |
| parent | 1ea3db6c4574a6400da5d46e4f60838c45c4295e (diff) | |
sh/sh7604: hookup UBC BARA/BARB r/w
* fix sound in 32x:aburner
Diffstat (limited to 'src/devices/cpu/sh')
| -rw-r--r-- | src/devices/cpu/sh/sh7604.cpp | 75 | ||||
| -rw-r--r-- | src/devices/cpu/sh/sh7604.h | 15 |
2 files changed, 90 insertions, 0 deletions
diff --git a/src/devices/cpu/sh/sh7604.cpp b/src/devices/cpu/sh/sh7604.cpp index 8bd1e59970c..d91692d0ac8 100644 --- a/src/devices/cpu/sh/sh7604.cpp +++ b/src/devices/cpu/sh/sh7604.cpp @@ -149,6 +149,12 @@ void sh7604_device::device_start() save_item(NAME(m_rstcsr)); save_item(NAME(m_wtcw)); + // UBC + save_item(NAME(m_barah)); + save_item(NAME(m_baral)); + save_item(NAME(m_barbh)); + save_item(NAME(m_barbl)); + // DMAC save_item(NAME(m_dmaor)); save_item(STRUCT_MEMBER(m_dmac, drcr)); @@ -197,6 +203,11 @@ void sh7604_device::device_reset() m_wtcnt = 0; m_wtcsr = 0; + + m_barah = 0; + m_baral = 0; + m_barbh = 0; + m_barbl = 0; } void sh7604_device::sh7604_map(address_map &map) @@ -263,6 +274,24 @@ void sh7604_device::sh7604_map(address_map &map) map(0xffffff18, 0xffffff1b).r(FUNC(sh7604_device::dvdnth_r)); map(0xffffff1c, 0xffffff1f).r(FUNC(sh7604_device::dvdntl_r)); + // UBC + map(0xffffff40, 0xffffff41).rw(FUNC(sh7604_device::barah_r), FUNC(sh7604_device::barah_w)); + map(0xffffff42, 0xffffff43).rw(FUNC(sh7604_device::baral_r), FUNC(sh7604_device::baral_w)); +// map(0xffffff44, 0xffffff45).rw(FUNC(sh7604_device::bamrah_r), FUNC(sh7604_device::bamrah_w)); +// map(0xffffff46, 0xffffff47).rw(FUNC(sh7604_device::bamral_r), FUNC(sh7604_device::bamral_w)); +// map(0xffffff48, ).rw(FUNC(sh7604_device::bbra_r), FUNC(sh7604_device::bbra_w)); + + map(0xffffff60, 0xffffff61).rw(FUNC(sh7604_device::barbh_r), FUNC(sh7604_device::barbh_w)); + map(0xffffff62, 0xffffff63).rw(FUNC(sh7604_device::barbl_r), FUNC(sh7604_device::barbl_w)); +// map(0xffffff64, 0xffffff65).rw(FUNC(sh7604_device::bamrbh_r), FUNC(sh7604_device::bamrbh_w)); +// map(0xffffff66, 0xffffff67).rw(FUNC(sh7604_device::bamrbl_r), FUNC(sh7604_device::bamrbl_w)); +// map(0xffffff68, ).rw(FUNC(sh7604_device::bbrb_r), FUNC(sh7604_device::bbrb_w)); +// map(0xffffff70, 0xffffff71).rw(FUNC(sh7604_device::bdrbh_r), FUNC(sh7604_device::bdrbh_w)); +// map(0xffffff72, 0xffffff73).rw(FUNC(sh7604_device::bdrbl_r), FUNC(sh7604_device::bdrbl_w)); +// map(0xffffff74, 0xffffff75).rw(FUNC(sh7604_device::bdmrbh_r), FUNC(sh7604_device::bdmrbh_w)); +// map(0xffffff76, 0xffffff77).rw(FUNC(sh7604_device::bdmrbl_r), FUNC(sh7604_device::bdmrbl_w)); +// map(0xffffff78, 0xffffff79).rw(FUNC(sh7604_device::brcr_r), FUNC(sh7604_device::brcr_w)); + // DMAC map(0xffffff80, 0xffffff83).rw(FUNC(sh7604_device::sar_r<0>), FUNC(sh7604_device::sar_w<0>)); map(0xffffff84, 0xffffff87).rw(FUNC(sh7604_device::dar_r<0>), FUNC(sh7604_device::dar_w<0>)); @@ -1174,6 +1203,52 @@ void sh7604_device::dvdntl_w(offs_t offset, uint32_t data, uint32_t mem_mask) } /* + * UBC + */ + +// TODO: bare-bones, used for proper 32x:aburnerju sound (on slave side) as buffer storage + +uint16_t sh7604_device::barah_r() +{ + return m_barah; +} + +uint16_t sh7604_device::baral_r() +{ + return m_baral; +} + +void sh7604_device::barah_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_barah); +} + +void sh7604_device::baral_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_baral); +} + +uint16_t sh7604_device::barbh_r() +{ + return m_barbh; +} + +uint16_t sh7604_device::barbl_r() +{ + return m_barbl; +} + +void sh7604_device::barbh_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_barbh); +} + +void sh7604_device::barbl_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_barbl); +} + +/* * WTC */ diff --git a/src/devices/cpu/sh/sh7604.h b/src/devices/cpu/sh/sh7604.h index bc0bfcc3330..4fe1d3989fd 100644 --- a/src/devices/cpu/sh/sh7604.h +++ b/src/devices/cpu/sh/sh7604.h @@ -120,6 +120,17 @@ private: uint32_t dvcr_r(); void dvcr_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + // UBC + uint16_t barah_r(); + void barah_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t baral_r(); + void baral_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + uint16_t barbh_r(); + void barbh_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t barbl_r(); + void barbl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + // DMAC template <int Channel> uint32_t vcrdma_r(); template <int Channel> void vcrdma_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); @@ -206,6 +217,10 @@ private: uint8_t m_rstcsr; uint16_t m_wtcw[2]; + // UBC + uint16_t m_barah, m_baral; + uint16_t m_barbh, m_barbl; + // DMAC struct { |
