I've updated the XGM driver wrapper to the last version of the XGM driver (which has not be yet released in official SGDK ^^). It mainly add a new setTempo(..) method (by default aligned on system speed) so you don't need anymore to have NTSC and PAL version of track. Also you have a getElapsedTime() method to know elapsed played time (useful mainly for player). Others changes are more related to internal implementation (now it uses the 68000 vint event to sync music and no more Z80 vint which was causing troubles on some clone systems).
I've updated the first post to relate the changes. Please report any problems ! Have fun
Looking over the test.bex file, there's a method in the vblank - I'm guessing this is required now as it handles the timing, right? I just want to make sure I update everything in the documentation for SecondBASIC correctly.
Also, for any SecondBASIC users that want to just copy and paste the code, it should work, but you'll need to add a colon on the vint line label, and again on the @addr_done line label. BEX automatically creates the line labels based on no spaces before the line label, where SecondBASIC doesn't as there's no space requirements.
Yeah, one of the biggest difference is that you need now to use the vint event so it handles music timing. In fact you can do it in your main loop, after the blank wait but that means that if your game doesn't run at 60 FPS then your music will slowdown. It's why it's better to handle it through the vint event ;-) I can change the vint label so people can directly take the code for second basic :-)
That's what I though. And nope, no need to worry about changing anything for SecondBASIC, I just wanted to make sure I was following everything properly so when I update SBS, I can document it with the right info.
Also love the additional features/commands with the new driver. I'm going to see what I can do about making a music player example like you made over on Sega 16, and use that for one of the included examples.
Looking forward the implementation in SBS :-) To be honest the XGM player I made use a not really straightforward method (basically parsing the XGM file and emulating YM/PSG) to get the live YM and PSG status but at least you can do a simple player displaying elapsed time now very easily ;-) There is also the possibility to read out current channel level directly from the YM chip (method is explained on Spritesmind) but that would only on real hardware.
I wonder what's causing it to not play unless you press start, or am I misunderstanding and XGM 2.0 works without issues? I haven't had a chance to put it into SecondBASIC yet (preparing for an expo this weekend coming up), so I haven't messed around with the new version.
It comes from an initialization state issue, i need to check that it does not occurs on real hardware. The weird think is that even on Fusion it does not always happen ? I think i can easily fix it sending a initial stop play command in the xgm_init method but still i need to check that.
I'll do some prelim testing in SecondBASIC. I had a hardware failure yesterday that lost the last 2 and a half months of updates on it. Fortunately I have most things documented to reapply the fixes, but I can copy and paste in the mean time and use my flash boards to test it out on the official hardware. May take me a few days as I have to prepare for an expo this weekend, but I'll let you know any results that I find