54435
So I asked quite a few people about XPMCK's support for the Japanese SMS's SN79489 and YM2413 working together. Nobody really seemed to have an answer who were XPMCK users. (I did not ask mic_ himself.) If we look at XPMCK's manual page we can see that all references to YM2413 in SMS have been striked out. Again, nobody seemed to have a clue about that either.
So, I brought up XPMCK an tried to compile some of the demos. PSG worked fine; and then FM also worked fine -- but only on VGM export. I took at look at the sound code and saw that all the workings for the YM2413 were in there. Things should work. I referenced to the 9 FM channels E through M and attempted to export to SGC... It vomits at reference of "E" and above; meaning it doesn't understand the additional channels' references. (There is another source file just for SGC, but I haven't dug into fixing it yet.) So, I attempted to export to SMS instead. PSG channels play and at least it doesn't choke when referencing the FM channels.
So I did some research into the SMS. Turns out that there is an audio port register ($F2) that if it's loaded with "$03" it will enable both the PSG and the FM chips. A quick patch and PSG and FM audio now output in "SMS" format. This means that PSG+FM songs can now be rendered on hardware from XPMCK code; either using a Japanese SMS or using a PowerBase FM Mini adapter and flash cart.
I only had to add three lines of code to fix the problem...
1.) Extract the contents of XPMCK to a folder.
2.) Open "xpmp_sms.asm" from /lib/sms_gg
3.) Find the following lines, add those with my comments and save:
.IFDEF XPMP_ENABLE_FM
ld a,0
ld (xpmp_ym2413Oper),a
ld (xpmp_ym2413Rhythm),a
ld a,3 ; Load $03
out ($f2),a ; into port $F2 to enable PSG+FM
ld a,0
.ENDIF
4.) Save the file.
5.) Run the mksms.bat script in demo/sms_gg referring to an MML file in demo/mml without MML extension. For example: mksms.bat dogpoosong
6.) Play dogpoosong.sms in Fusion or on your Everdrive cart.
Again, I haven't fixed SGC export yet, but hopefully I can figure that out too. :)
So, I brought up XPMCK an tried to compile some of the demos. PSG worked fine; and then FM also worked fine -- but only on VGM export. I took at look at the sound code and saw that all the workings for the YM2413 were in there. Things should work. I referenced to the 9 FM channels E through M and attempted to export to SGC... It vomits at reference of "E" and above; meaning it doesn't understand the additional channels' references. (There is another source file just for SGC, but I haven't dug into fixing it yet.) So, I attempted to export to SMS instead. PSG channels play and at least it doesn't choke when referencing the FM channels.
So I did some research into the SMS. Turns out that there is an audio port register ($F2) that if it's loaded with "$03" it will enable both the PSG and the FM chips. A quick patch and PSG and FM audio now output in "SMS" format. This means that PSG+FM songs can now be rendered on hardware from XPMCK code; either using a Japanese SMS or using a PowerBase FM Mini adapter and flash cart.
I only had to add three lines of code to fix the problem...
1.) Extract the contents of XPMCK to a folder.
2.) Open "xpmp_sms.asm" from /lib/sms_gg
3.) Find the following lines, add those with my comments and save:
.IFDEF XPMP_ENABLE_FM
ld a,0
ld (xpmp_ym2413Oper),a
ld (xpmp_ym2413Rhythm),a
ld a,3 ; Load $03
out ($f2),a ; into port $F2 to enable PSG+FM
ld a,0
.ENDIF
4.) Save the file.
5.) Run the mksms.bat script in demo/sms_gg referring to an MML file in demo/mml without MML extension. For example: mksms.bat dogpoosong
6.) Play dogpoosong.sms in Fusion or on your Everdrive cart.
Again, I haven't fixed SGC export yet, but hopefully I can figure that out too. :)