1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-21 21:33:54 +00:00

Improves commentary.

This commit is contained in:
Thomas Harte 2020-04-19 22:42:25 -04:00
parent c54bbc5a04
commit 6568c29c54
2 changed files with 8 additions and 1 deletions

View File

@ -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.

View File

@ -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;
}