From 6568c29c5450b5a6760e9c25cd76ce3ed72d7005 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 19 Apr 2020 22:42:25 -0400 Subject: [PATCH] Improves commentary. --- Components/OPL2/Implementation/Tables.hpp | 7 ++++++- Machines/MasterSystem/MasterSystem.cpp | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Components/OPL2/Implementation/Tables.hpp b/Components/OPL2/Implementation/Tables.hpp index 849a8d1aa..66fcf71fd 100644 --- a/Components/OPL2/Implementation/Tables.hpp +++ b/Components/OPL2/Implementation/Tables.hpp @@ -20,11 +20,16 @@ namespace OPL { they're very compact. */ +/*! + Represents both the logarithm of a value and its sign. + It's actually the negative logarithm, in base two, in fixed point. +*/ struct LogSign { int log; int sign; }; + /*! @returns Negative log sin of x, assuming a 1024-unit circle. */ @@ -83,7 +88,7 @@ constexpr LogSign negative_log_sin(int x) { } /*! - @returns 2 ^ -x/256 in 0.10 fixed-point form. + Computes the linear value represented by the log-sign @c ls. */ constexpr int power_two(LogSign ls) { /// A derivative of the exponent table in a real OPL2; mapped_exp[x] = (source[c ^ 0xff] << 1) | 0x800. diff --git a/Machines/MasterSystem/MasterSystem.cpp b/Machines/MasterSystem/MasterSystem.cpp index 7fa1828ce..4c0531fd9 100644 --- a/Machines/MasterSystem/MasterSystem.cpp +++ b/Machines/MasterSystem/MasterSystem.cpp @@ -325,6 +325,8 @@ class ConcreteMachine: opll_.write(address, *cycle.value); break; case 0xf2: + // TODO: it turns out this address isn't just a detection space; + // it's actually an audio control. See https://www.smspower.org/Development/AudioControlPort opll_detection_word_ = *cycle.value; break; }