From 61aeb0bb5ec4b7e1532ac5e606523eb64e58d920 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sat, 22 Oct 2022 10:10:02 +0900 Subject: [PATCH] Revert "Temporarily revert "Sync vgsound_emu with master"" This reverts commit f832ce5cca28ca082566117924ee643d5647904c. --- extern/vgsound_emu-modified/CHANGELOG.md | 7 + extern/vgsound_emu-modified/CMakeLists.txt | 2 +- .../vgsound_emu/src/core/core.hpp | 34 +++ .../vgsound_emu/src/core/util.hpp | 245 ++---------------- .../vgsound_emu/src/core/util/clock_pulse.hpp | 167 ++++++++++++ .../vgsound_emu/src/core/util/mem_intf.hpp | 44 ++++ .../vgsound_emu/src/core/vox/vox.hpp | 10 +- .../vgsound_emu/src/es550x/es550x.hpp | 15 +- .../vgsound_emu/src/k005289/k005289.hpp | 3 +- .../vgsound_emu/src/k007232/k007232.hpp | 4 +- .../vgsound_emu/src/k053260/k053260.hpp | 6 +- .../vgsound_emu/src/msm6295/msm6295.hpp | 24 +- .../vgsound_emu/src/n163/n163.hpp | 4 +- .../vgsound_emu/src/scc/scc.hpp | 5 +- .../vgsound_emu/src/template/template.hpp | 5 +- .../vgsound_emu/src/vrcvi/vrcvi.cpp | 8 +- .../vgsound_emu/src/vrcvi/vrcvi.hpp | 4 +- .../vgsound_emu/src/x1_010/x1_010.hpp | 5 +- 18 files changed, 339 insertions(+), 253 deletions(-) create mode 100644 extern/vgsound_emu-modified/vgsound_emu/src/core/core.hpp create mode 100644 extern/vgsound_emu-modified/vgsound_emu/src/core/util/clock_pulse.hpp create mode 100644 extern/vgsound_emu-modified/vgsound_emu/src/core/util/mem_intf.hpp diff --git a/extern/vgsound_emu-modified/CHANGELOG.md b/extern/vgsound_emu-modified/CHANGELOG.md index 305e8337..46957e50 100644 --- a/extern/vgsound_emu-modified/CHANGELOG.md +++ b/extern/vgsound_emu-modified/CHANGELOG.md @@ -2,6 +2,13 @@ ## Important changes +### V 2.1.2 (2022-10-21) + +Split utilities and core framework header +Use static constexprs for global constants +Fix initialization +Fix CMake + ### V 2.1.1 (2022-10-20) Add C++11 detection for CMake diff --git a/extern/vgsound_emu-modified/CMakeLists.txt b/extern/vgsound_emu-modified/CMakeLists.txt index f1ba138e..0aea2e92 100644 --- a/extern/vgsound_emu-modified/CMakeLists.txt +++ b/extern/vgsound_emu-modified/CMakeLists.txt @@ -97,8 +97,8 @@ set(EMU_SOURCE "") # Core functions list(APPEND CORE_SOURCE vgsound_emu/src/core/core.hpp + vgsound_emu/src/core/util.hpp vgsound_emu/src/core/util/clock_pulse.hpp - vgsound_emu/src/core/util/fifo.hpp vgsound_emu/src/core/util/mem_intf.hpp ) diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/core/core.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/core/core.hpp new file mode 100644 index 00000000..ac0652d0 --- /dev/null +++ b/extern/vgsound_emu-modified/vgsound_emu/src/core/core.hpp @@ -0,0 +1,34 @@ +/* + License: Zlib + see https://gitlab.com/cam900/vgsound_emu/-/blob/main/LICENSE for more details + + Copyright holder(s): cam900 + Core framework for vgsound_emu +*/ + +#ifndef _VGSOUND_EMU_SRC_CORE_CORE_HPP +#define _VGSOUND_EMU_SRC_CORE_CORE_HPP + +#pragma once + +#include "util.hpp" + +namespace vgsound_emu +{ + class vgsound_emu_core + { + public: + // constructors + vgsound_emu_core(std::string tag) + : m_tag(tag) + { + } + + // getters + std::string tag() { return m_tag; } + + private: + std::string m_tag = ""; // core tags + }; +}; // namespace vgsound_emu +#endif diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/core/util.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/core/util.hpp index a6a9d6a2..5df967f6 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/core/util.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/core/util.hpp @@ -32,232 +32,39 @@ namespace vgsound_emu typedef float f32; typedef double f64; - class vgsound_emu_core - { - public: - // constructors - vgsound_emu_core(std::string tag) - : m_tag(tag) - { - } - - // getters - std::string tag() { return m_tag; } - - protected: - const f64 PI = 3.1415926535897932384626433832795; - - // std::clamp is only for C++17 or later; I use my own code - template - T clamp(T in, T min, T max) - { -#if defined(_HAS_CXX17) && _HAS_CXX17 - // just use std::clamp if C++17 or above - return std::clamp(in, min, max); -#else - // otherwise, use my own implementation of std::clamp - return std::min(std::max(in, min), max); -#endif - } - - // get bitfield, bitfield(input, position, len) - template - T bitfield(T in, u8 pos, u8 len = 1) - { - return (in >> pos) & (len ? (T(1 << len) - 1) : 1); - } - - // get sign extended value, sign_ext(input, len) - template - T sign_ext(T in, u8 len) - { - len = std::max(0, (8 * sizeof(T)) - len); - return T(T(in) << len) >> len; - } - - // convert attenuation decibel value to gain - inline f32 dB_to_gain(f32 attenuation) { return std::pow(10.0f, attenuation / 20.0f); } - - private: - std::string m_tag = ""; // core tags - }; - - class vgsound_emu_mem_intf : public vgsound_emu_core - { - public: - // constructor - vgsound_emu_mem_intf() - : vgsound_emu_core("mem_intf") - { - } - - virtual u8 read_byte(u32 address) { return 0; } - - virtual u16 read_word(u32 address) { return 0; } - - virtual u32 read_dword(u32 address) { return 0; } - - virtual u64 read_qword(u32 address) { return 0; } - - virtual void write_byte(u32 address, u8 data) {} - - virtual void write_word(u32 address, u16 data) {} - - virtual void write_dword(u32 address, u32 data) {} - - virtual void write_qword(u32 address, u64 data) {} - }; + static constexpr f64 PI = 3.1415926535897932384626433832795; + // std::clamp is only for C++17 or later; I use my own code template - class clock_pulse_t : public vgsound_emu_core + static inline T clamp(T in, T min, T max) { - private: - const T m_init_width = 1; +#if defined(_HAS_CXX17) && _HAS_CXX17 + // just use std::clamp if C++17 or above + return std::clamp(in, min, max); +#else + // otherwise, use my own implementation of std::clamp + return std::min(std::max(in, min), max); +#endif + } - class edge_t : public vgsound_emu_core - { - private: - const u8 m_init_edge = 1; + // get bitfield, bitfield(input, position, len) + template + static inline T bitfield(T in, u8 pos, u8 len = 1) + { + return (in >> pos) & (len ? (T(1 << len) - 1) : 1); + } - public: - edge_t(u8 init_edge = 0) - : vgsound_emu_core("clock_pulse_edge") - , m_init_edge(init_edge) - , m_current(init_edge ^ 1) - , m_previous(init_edge) - , m_rising(0) - , m_falling(0) - , m_changed(0) - { - set(init_edge); - } + // get sign extended value, sign_ext(input, len) + template + static inline T sign_ext(T in, u8 len) + { + len = std::max(0, (8 * sizeof(T)) - len); + return T(T(in) << len) >> len; + } - // internal states - void reset() - { - m_previous = m_init_edge; - m_current = m_init_edge ^ 1; - set(m_init_edge); - } + // convert attenuation decibel value to gain + static inline f32 dB_to_gain(f32 attenuation) { return std::pow(10.0f, attenuation / 20.0f); } - void tick(bool toggle) - { - u8 current = m_current; - if (toggle) - { - current ^= 1; - } - set(current); - } - - void set(u8 edge) - { - edge &= 1; - m_rising = m_falling = m_changed = 0; - if (m_current != edge) - { - m_changed = 1; - if (m_current && (!edge)) - { - m_falling = 1; - } - else if ((!m_current) && edge) - { - m_rising = 1; - } - m_current = edge; - } - m_previous = m_current; - } - - // getters - inline bool current() { return m_current; } - - inline bool rising() { return m_rising; } - - inline bool falling() { return m_falling; } - - inline bool changed() { return m_changed; } - - private: - u8 m_current : 1; // current edge - u8 m_previous : 1; // previous edge - u8 m_rising : 1; // rising edge - u8 m_falling : 1; // falling edge - u8 m_changed : 1; // changed flag - }; - - public: - clock_pulse_t(T init_width, u8 init_edge = 0) - : vgsound_emu_core("clock_pulse") - , m_init_width(init_width) - , m_edge(edge_t(init_edge & 1)) - , m_width(init_width) - , m_width_latch(init_width) - , m_counter(init_width) - , m_cycle(0) - { - } - - void reset(T init) - { - m_edge.reset(); - m_width = m_width_latch = m_counter = init; - m_cycle = 0; - } - - inline void reset() { reset(m_init_width); } - - bool tick(T width = 0) - { - bool carry = ((--m_counter) <= 0); - if (carry) - { - if (!width) - { - m_width = m_width_latch; - } - else - { - m_width = width; // reset width - } - m_counter = m_width; - m_cycle = 0; - } - else - { - m_cycle++; - } - - m_edge.tick(carry); - return carry; - } - - inline void set_width(T width) { m_width = width; } - - inline void set_width_latch(T width) { m_width_latch = width; } - - // Accessors - inline bool current_edge() { return m_edge.current(); } - - inline bool rising_edge() { return m_edge.rising(); } - - inline bool falling_edge() { return m_edge.falling(); } - - // getters - edge_t &edge() { return m_edge; } - - inline T cycle() { return m_cycle; } - - private: - edge_t m_edge; - T m_width = 1; // clock pulse width - T m_width_latch = 1; // clock pulse width latch - T m_counter = 1; // clock counter - T m_cycle = 0; // clock cycle - }; }; // namespace vgsound_emu -using namespace vgsound_emu; - #endif diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/core/util/clock_pulse.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/core/util/clock_pulse.hpp new file mode 100644 index 00000000..de643856 --- /dev/null +++ b/extern/vgsound_emu-modified/vgsound_emu/src/core/util/clock_pulse.hpp @@ -0,0 +1,167 @@ +/* + License: Zlib + see https://gitlab.com/cam900/vgsound_emu/-/blob/main/LICENSE for more details + + Copyright holder(s): cam900 + Common clock pulse emulation for vgsound_emu +*/ + +#ifndef _VGSOUND_EMU_SRC_CORE_UTIL_CLOCK_PULSE_HPP +#define _VGSOUND_EMU_SRC_CORE_UTIL_CLOCK_PULSE_HPP + +#pragma once + +#include "../core.hpp" + +namespace vgsound_emu +{ + template + class clock_pulse_t : public vgsound_emu_core + { + private: + const T m_init_width = 1; + + class edge_t : public vgsound_emu_core + { + private: + const u8 m_init_edge = 1; + + public: + edge_t(u8 init_edge = 0) + : vgsound_emu_core("clock_pulse_edge") + , m_init_edge(init_edge) + , m_current(init_edge ^ 1) + , m_previous(init_edge) + , m_rising(0) + , m_falling(0) + , m_changed(0) + { + set(init_edge); + } + + // internal states + void reset() + { + m_previous = m_init_edge; + m_current = m_init_edge ^ 1; + set(m_init_edge); + } + + void tick(bool toggle) + { + u8 current = m_current; + if (toggle) + { + current ^= 1; + } + set(current); + } + + void set(u8 edge) + { + edge &= 1; + m_rising = m_falling = m_changed = 0; + if (m_current != edge) + { + m_changed = 1; + if (m_current && (!edge)) + { + m_falling = 1; + } + else if ((!m_current) && edge) + { + m_rising = 1; + } + m_current = edge; + } + m_previous = m_current; + } + + // getters + inline bool current() { return m_current; } + + inline bool rising() { return m_rising; } + + inline bool falling() { return m_falling; } + + inline bool changed() { return m_changed; } + + private: + u8 m_current : 1; // current edge + u8 m_previous : 1; // previous edge + u8 m_rising : 1; // rising edge + u8 m_falling : 1; // falling edge + u8 m_changed : 1; // changed flag + }; + + public: + clock_pulse_t(T init_width, u8 init_edge = 0) + : vgsound_emu_core("clock_pulse") + , m_init_width(init_width) + , m_edge(edge_t(init_edge & 1)) + , m_width(init_width) + , m_width_latch(init_width) + , m_counter(init_width) + , m_cycle(0) + { + } + + void reset(T init) + { + m_edge.reset(); + m_width = m_width_latch = m_counter = init; + m_cycle = 0; + } + + inline void reset() { reset(m_init_width); } + + bool tick(T width = 0) + { + bool carry = ((--m_counter) <= 0); + if (carry) + { + if (!width) + { + m_width = m_width_latch; + } + else + { + m_width = width; // reset width + } + m_counter = m_width; + m_cycle = 0; + } + else + { + m_cycle++; + } + + m_edge.tick(carry); + return carry; + } + + inline void set_width(T width) { m_width = width; } + + inline void set_width_latch(T width) { m_width_latch = width; } + + // Accessors + inline bool current_edge() { return m_edge.current(); } + + inline bool rising_edge() { return m_edge.rising(); } + + inline bool falling_edge() { return m_edge.falling(); } + + // getters + edge_t &edge() { return m_edge; } + + inline T cycle() { return m_cycle; } + + private: + edge_t m_edge; + T m_width = 1; // clock pulse width + T m_width_latch = 1; // clock pulse width latch + T m_counter = 1; // clock counter + T m_cycle = 0; // clock cycle + }; +}; // namespace vgsound_emu +#endif diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/core/util/mem_intf.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/core/util/mem_intf.hpp new file mode 100644 index 00000000..8ee05177 --- /dev/null +++ b/extern/vgsound_emu-modified/vgsound_emu/src/core/util/mem_intf.hpp @@ -0,0 +1,44 @@ +/* + License: Zlib + see https://gitlab.com/cam900/vgsound_emu/-/blob/main/LICENSE for more details + + Copyright holder(s): cam900 + Common memory interface for vgsound_emu +*/ + +#ifndef _VGSOUND_EMU_SRC_CORE_UTIL_MEM_INTF_HPP +#define _VGSOUND_EMU_SRC_CORE_UTIL_MEM_INTF_HPP + +#pragma once + +#include "../core.hpp" + +namespace vgsound_emu +{ + class vgsound_emu_mem_intf : public vgsound_emu_core + { + public: + // constructor + vgsound_emu_mem_intf() + : vgsound_emu_core("mem_intf") + { + } + + virtual u8 read_byte(u32 address) { return 0; } + + virtual u16 read_word(u32 address) { return 0; } + + virtual u32 read_dword(u32 address) { return 0; } + + virtual u64 read_qword(u32 address) { return 0; } + + virtual void write_byte(u32 address, u8 data) {} + + virtual void write_word(u32 address, u16 data) {} + + virtual void write_dword(u32 address, u32 data) {} + + virtual void write_qword(u32 address, u64 data) {} + }; +}; // namespace vgsound_emu +#endif diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/core/vox/vox.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/core/vox/vox.hpp index 231f9b63..2f42e394 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/core/vox/vox.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/core/vox/vox.hpp @@ -3,7 +3,7 @@ see https://gitlab.com/cam900/vgsound_emu/-/blob/main/LICENSE for more details Copyright holder(s): cam900 - Dialogic ADPCM core + OKI/Dialogic ADPCM core */ #ifndef _VGSOUND_EMU_SRC_CORE_VOX_VOX_HPP @@ -11,7 +11,9 @@ #pragma once -#include "../util.hpp" +#include "../core.hpp" + +using namespace vgsound_emu; class vox_core : public vgsound_emu_core { @@ -93,8 +95,8 @@ class vox_core : public vgsound_emu_core bool m_loop_saved = false; }; - const s8 m_index_table[8] = {-1, -1, -1, -1, 2, 4, 6, 8}; - const s32 m_step_table[49] = { + static constexpr s8 m_index_table[8] = {-1, -1, -1, -1, 2, 4, 6, 8}; + static constexpr s32 m_step_table[49] = { 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552}; diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp index 4457c244..d99fdfbf 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp @@ -11,7 +11,10 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" +#include "../core/util/clock_pulse.hpp" + +using namespace vgsound_emu; // ES5504/ES5505/ES5506 interface class es550x_intf : public vgsound_emu_core @@ -168,11 +171,11 @@ class es550x_shared_core : public vgsound_emu_core } // configurations - const u8 m_integer; - const u8 m_fraction; - const u8 m_total_bits; - const u32 m_accum_mask; - const bool m_transwave; + const u8 m_integer = 21; + const u8 m_fraction = 11; + const u8 m_total_bits = 32; + const u32 m_accum_mask = 0xffffffff; + const bool m_transwave = true; // internal states void reset(); diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/k005289/k005289.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/k005289/k005289.hpp index 6fae1f2c..2c2b0715 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/k005289/k005289.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/k005289/k005289.hpp @@ -11,7 +11,8 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" +using namespace vgsound_emu; class k005289_core : public vgsound_emu_core { diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/k007232/k007232.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/k007232/k007232.hpp index d500f091..ef3af56d 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/k007232/k007232.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/k007232/k007232.hpp @@ -11,7 +11,9 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" + +using namespace vgsound_emu; class k007232_intf : public vgsound_emu_core { diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.hpp index bca78a1f..a84dc16a 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/k053260/k053260.hpp @@ -11,7 +11,9 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" + +using namespace vgsound_emu; class k053260_intf : public vgsound_emu_core { @@ -31,7 +33,7 @@ class k053260_core : public vgsound_emu_core friend class k053260_intf; // k053260 specific interface private: - const int pan_dir[8] = {-1, 0, 24, 35, 45, 55, 66, 90}; // pan direction + static constexpr int pan_dir[8] = {-1, 0, 24, 35, 45, 55, 66, 90}; // pan direction class voice_t : public vgsound_emu_core { diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/msm6295/msm6295.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/msm6295/msm6295.hpp index 04326ae6..bb2e6a1c 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/msm6295/msm6295.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/msm6295/msm6295.hpp @@ -11,24 +11,28 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" +#include "../core/util/mem_intf.hpp" #include "../core/vox/vox.hpp" +using namespace vgsound_emu; + class msm6295_core : public vox_core { friend class vgsound_emu_mem_intf; // common memory interface private: // Internal volume table, 9 step - const s32 m_volume_table[9] = {32 /* 0.0dB */, - 22 /* -3.2dB */, - 16 /* -6.0dB */, - 11 /* -9.2dB */, - 8 /* -12.0dB */, - 6 /* -14.5dB */, - 4 /* -18.0dB */, - 3 /* -20.5dB */, - 2 /* -24.0dB */}; // scale out to 5 bit for optimization + static constexpr s32 m_volume_table[9] = { + 32 /* 0.0dB */, + 22 /* -3.2dB */, + 16 /* -6.0dB */, + 11 /* -9.2dB */, + 8 /* -12.0dB */, + 6 /* -14.5dB */, + 4 /* -18.0dB */, + 3 /* -20.5dB */, + 2 /* -24.0dB */}; // scale out to 5 bit for optimization // msm6295 voice classes class voice_t : vox_decoder_t diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/n163/n163.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/n163/n163.hpp index 1c04d1f3..bbf2720a 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/n163/n163.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/n163/n163.hpp @@ -11,7 +11,9 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" + +using namespace vgsound_emu; class n163_core : public vgsound_emu_core { diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/scc/scc.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/scc/scc.hpp index 8824d253..12322d84 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/scc/scc.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/scc/scc.hpp @@ -12,7 +12,10 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" +#include "../core/util/mem_intf.hpp" + +using namespace vgsound_emu; // shared for SCCs class scc_core : public vgsound_emu_core diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/template/template.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/template/template.hpp index ca8f91b5..ffc6f932 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/template/template.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/template/template.hpp @@ -11,7 +11,10 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" +#include "../core/util/mem_intf.hpp" + +using namespace vgsound_emu; class template_core : public vgsound_emu_core { diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/vrcvi/vrcvi.cpp b/extern/vgsound_emu-modified/vgsound_emu/src/vrcvi/vrcvi.cpp index dc59120f..8ff62fea 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/vrcvi/vrcvi.cpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/vrcvi/vrcvi.cpp @@ -61,10 +61,10 @@ bool vrcvi_core::alu_t::tick() } // carry handling - bool carry = bitfield(m_host.m_control.shift(), 1) - ? (bitfield(temp, 8, 4) == 0) - : (bitfield(m_host.m_control.shift(), 0) ? (bitfield(temp, 4, 8) == 0) - : (bitfield(temp, 0, 12) == 0)); + const bool carry = bitfield(m_host.m_control.shift(), 1) + ? (bitfield(temp, 8, 4) == 0) + : (bitfield(m_host.m_control.shift(), 0) ? (bitfield(temp, 4, 8) == 0) + : (bitfield(temp, 0, 12) == 0)); if (carry) { m_counter = m_divider.divider(); diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/vrcvi/vrcvi.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/vrcvi/vrcvi.hpp index f163114c..d6694aae 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/vrcvi/vrcvi.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/vrcvi/vrcvi.hpp @@ -11,7 +11,9 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" + +using namespace vgsound_emu; class vrcvi_intf : public vgsound_emu_core { diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/x1_010/x1_010.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/x1_010/x1_010.hpp index 34a4ab99..37a1895b 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/x1_010/x1_010.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/x1_010/x1_010.hpp @@ -11,7 +11,10 @@ #pragma once -#include "../core/util.hpp" +#include "../core/core.hpp" +#include "../core/util/mem_intf.hpp" + +using namespace vgsound_emu; class x1_010_core : public vgsound_emu_core {