SMS PSG+FM w/ MML
BotB Academy Bulletins
 
 
54435
Level 27 Renderist
b00daw
 
 
 
 
post #54435 :: 2015.03.06 1:13am :: edit 2015.03.06 1:17am
  
  pedipanol, RatShack, anewuser, ap0c, raphaelgoulart, marcb0t and goluigi liēkd this
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. :)
 
 
54436
Level 27 Renderist
b00daw
 
 
 
 
post #54436 :: 2015.03.06 1:30am :: edit 2015.03.06 1:41am
  
  raphaelgoulart and marcb0t liēkd this
Oh, and I got SGC export fixed too. :X

http://average.truechiptilldeath.com/nesdev/b00test.sgc

Easier than I thought... Just edit mksgc.bat. Change "-sgg" to "-sms".

HAVE FUN! :D
 
 
54442
Level 21 Criticist
Xyz
 
 
 
 
post #54442 :: 2015.03.06 3:38am :: edit 2015.03.06 3:51am
I am offended that I was not sought out ;)

But I don't think even any material related to SMS programming have ever mentioned that port. All materials I found say write to port $7F for anything PSG, write to port $F0 to select OPLL internal register and write to $F1 to write to OPLL.

[edit:tested, also more dickwaving]
I knew about the sgc bat compiling using gamegear mode from mic_ himself (more reason you should've come my way!). Though he seems to be slow with email correspondence lately.

I am very pleased that this also fixes sgc output. Maybe it works for kss export too? I'll try that out right now

[after testing]
SGC export doesn't seem to work correctly with my song using OPLL mode 0 and the 32kb kss file just doesn't play at all.

Btw you did not provide dogpoosong for us to test out
 
 
54446
Level 27 Renderist
b00daw
 
 
 
 
post #54446 :: 2015.03.06 9:14am
  
  marcb0t liēkd this
http://www.smspower.org/Development/AudioControlPort < $F2 documentation.

Not certain if SGC supports MSX? I think SGC is just for SMS/GG/Colecovision.

Maybe after work if I have time I'll upload a fixed zip file with some additional scripts; and possibly contact mic_ to see if he's interested in applying a fix to his work.

Xyz: how about you just make something sound pretty that uses all the PSG and FM channels and provide MML and SGC? :)
 
 
54450
Level 21 Criticist
Xyz
 
 
 
 
post #54450 :: 2015.03.06 9:59am
https://dl.dropboxusercontent.com/u/39060235/WCX.zip
I do not know if you still want the .sgc that ended up on my end of the compilation or not.


I wasn't saying I was trying to get an MSX song into a .sgc file, but rather getting a master system song into a .kss, which is already a thing. Though I don't think I've come across any kss rips of SMS FM, despite the soundchip also being supported in MSX-Music.

Though I'll admit the XPMCK manual makes it seem that compiling to .kss using the SN is really only for MSX models which don't use the AY or the YM2149, but rather SN. And is therefore not SMS music.
 
 
54494
Level 27 Renderist
b00daw
 
 
 
 
post #54494 :: 2015.03.06 10:58pm :: edit 2015.03.06 11:04pm
  
  anewuser and Xyz liēkd this
http://average.truechiptilldeath.com/nesdev/xpmck-rel32a.zip

Here's an unofficial version "32a".

Aside from the above functions I've also added preliminary SGC export for ColecoVision.

Read the changes.txt file. Also don't forget to use WLA DX binaries in the /demo/(console) directory with the specified linker and assembler needed.

Edit: Oh! And if you're gonna do ColecoVision make sure to use a ColecoVision BIOS ROM and have your player reference it somewhere. AKA in NezPlug make sure to edit your plugin .ini file.
 
 
54499
Level 13 Mixist
9999HP
 
 
post #54499 :: 2015.03.07 7:04am
The YM2413 stuff was probably crossed out because it's not finished/buggy. The rhythm mode stuff is completely broken when exporting to VGM. It just writes a value to the rhythm register instead of writing the correct value to the corresponding key on bit.
 
 
61008
Level 27 Renderist
b00daw
 
 
 
 
post #61008 :: 2015.11.18 5:30am
 
 
61322
Level 27 Renderist
b00daw
 
 
 
 
post #61322 :: 2015.12.05 4:20am :: edit 2015.12.05 4:20am
Not all the effects work properly at the moment. I've not got a lot of momentum to work on this project due to "big boy/IRL" duties; but doesn't put a nail in the coffin.
 
 

LOGIN or REGISTER to add your own comments!