I've written a software emulation of a Yamaha YM2413 (OPLL) for use in a Sega Master System emulator, although that was a couple of years ago. What I remember is a table for the sine wave (1/4 of the full cycle, since the rest can be done by mirroring and inversion), but stored in some logarithmic format so that multiplications can be done through addition, and then a lookup table to convert the output value to an actual integer.
It was cool because there were set values that you could subtract to cut the volume in half, for example. It makes the envelopes into just adding and subtracting values, and getting a cool volume curve out of it.
I remember that I got it reliably producing recognizable output for most register settings, but there are some parameters that I must've gotten wrong, because some settings sound way off from how they do on real hardware.
It was cool because there were set values that you could subtract to cut the volume in half, for example. It makes the envelopes into just adding and subtracting values, and getting a cool volume curve out of it.
I remember that I got it reliably producing recognizable output for most register settings, but there are some parameters that I must've gotten wrong, because some settings sound way off from how they do on real hardware.