Is There an Updated .GBS Spec?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Is There an Updated .GBS Spec?
by on (#54642)
I've been working on an FPGA .GBS player, and have it working pretty decently, but I have come across a bunch of things in .GBS files that cannot be right.

I cannot seem to find a newer version of the spec, and on the entire internet, there appears to only be exactly 1 copy of the .GBS spec present, which is version 1.01 from 1/28/2001.

Where is everyone getting their info to write .GBS players?

I ran into a few bad problems that I don't know how to solve, because I cannot find documentation... Ferinstance, the .GBS for Felix the Cat does a bankswitch and tries to switch to bank 7, when the ROM only has 2 banks (0 and 1). What do you do in this case when a .GBS file tries to switch to a non-existant bank?

Obviously there's a "desired" method of emulating this because it plays on the .GBS players. The only thing I can think of that makes sense is to AND mask the bank register with the highest power of 2, i.e. in this case ANDing with 001h because it only has 2 banks. This would result in the tune working.

Another odd one is Motorcross Maniacs 2. An older version of the .GBS plays at the proper rate, but a newer version does not- it plays at around 1/2 the proper rate.

Checking with a PC GBS player, the old one plays back 2x faster than it should, while the new one plays at the proper rate. It appears that the function of the timer register at FF07h has been changed somehow. Like if bit 7 is set it runs at 2x normal speed?

Thanx for any help :-)
Re: Is There an Updated .GBS Spec?
by on (#54643)
kevtris wrote:
Obviously there's a "desired" method of emulating this because it plays on the .GBS players. The only thing I can think of that makes sense is to AND mask the bank register with the highest power of 2, i.e. in this case ANDing with 001h because it only has 2 banks. This would result in the tune working.

And if the number of banks isn't a power of two, repeat the last bank up to the nearest power of two. In fact, if we were to standardize handling of odd-size ROMs in an update to the .nes format, I'd recommend this exact algorithm.

Quote:
Another odd one is Motorcross Maniacs 2. An older version of the .GBS plays at the proper rate, but a newer version does not- it plays at around 1/2 the proper rate.

MM2 is GBC exclusive; that might have something to do with it.

by on (#54673)
I have a modified 1.02, updated 07/15/01, prior to my modifications for Timer+VBlank.

Grab GBS2GB, and check the source folder for !gbsspec.txt

http://www.angelfire.com/nc/ugetab/

Also, the 2x speed thing is mentioned in the new doc(the 1.02 update). Basically, the Gameboy Color emulates instructions at twice the speed of the original Gameboy. This makes the sound a little sharper, even if you halve the execution speed of the play routine to account for the doubled execution rate. There's some sort of work-around coded in the .GB player for regular gameboy systems.

There's a register that's not accounted for in the docs that you should emulate for 2x speed detection: FF4D= 7E(1x GBC Speed)/FE(2x GBC Speed) (FF used for Original Gameboy, but this doesn't need to be an option)

by on (#54677)
Thanks for the infos, I got more .gbs tunes playing now. Just have to figure out the last few bugs and it should be good to go I hope. Then it's onto the sound hardware bugs :-)