In the 4.09 Sun.java, if I simply add a phase angle correction I get the *correct* Moon phase graphic. So we know that's working! The 4.09 and earlier scheme...
For summer months the stock phase is a fat gibbous, just after full Moon. That's because the game always uses the 15th of the month, and every game month has 30 days. And so by July 15, 195 game days have elapsed. Divide this by the synodic month of 29.53 days, we get a phase angle of 195 / 29.53 = 6.603. From the Jan 1 new Moon, the Moon has completed 6.603 phase cycles. The remainder 0.603 is the current phase.
The phase angle is 0 to 1, with new=0, first quarter=0.25, full=0.5, last quarter=0.75, and back to new at 1.
The phase of 0.603 is therefore just past the full phase of 0.5. If I subtract 0.103 from the Sun.java calculation for phase, and open a map having the month of July (month number 6, because Jan is 0), I get a nice and round full Moon graphic. If I subtract about 0.36, I get a first quarter Moon graphic because the phase angle used is now about 0.25.
In my new treatment, then, I should calculate this old, simplistic phase as well, using the original algorithm. Then I determine the *real* Moon phase angle on Jan 1.0 of the current game year. This gives me a phase offset between the old Jan 1 and the proper Jan 1 Moon phase. This offset is propagated to the current game date and applied to a new MoonPhase value to be returned to the .dll.
Well, that's my provisional approach thus far. Assuming the .dll is independently determining all over again the old phase. Geez, how I'd love to peer inside the source code for the .dll's!