Offline
Sweeeeeeden

I figured it might be useful to have thread for discussing BGB, the Gameboy emulator I would recommend. If you have questions you want answered/added, please ask here.

BGB homepage

Current version: 1.5.10, released 2022-10-18. All users are recommended to update to the latest version.

New in BGB 1.5.10 (2022-10-18) - Experimental Xaudio2 support, performance and accuracy fixes, improved Wine support.

New in BGB 1.5.9 (2021-04-23) - Added emulation support for sound features used in LSDj 9.2.0. Added Xinput support, fixes joypad focus issue. Many more bug fixes and improvements.

New in BGB 1.5.8 (2020-03-17) - Added mode where RTC stays at real time, improved accuracy, improved speedrun mode, many bug fixes.

New in BGB 1.5.7 (2018-09-14) - Improved accuracy, speedrun mode, new 64-bit version available, many bug fix and misc features.

New in BGB 1.5.6 (2017-12-06) - Fixed regression: choppy framerate and sound glitches after pause.

New in BGB 1.5.5 (2017-11-27) - Added support for GUI display scaling. Improved input lag on 120 Hz display mode. Improvements to debug messages. A number of bug fixes and small improvements.

New in BGB 1.5.4 (2017-07-18) - Fixed regression: pokemon yellow broken in SGB mode. Fixed a number of bugs.

New in BGB 1.5.3 (2017-03-04) - Accuracy improvements, including: pokemon (all versions) now has correct TID for speedruns. Fixed a large number of bugs and problems, including: "uncoverable direct3d error" on some Optimus laptops. Added improved support for automation/commandline use. Significant performance/efficiency improvement with most roms. Added support for loading RTC .sav files where a timestamp in the future does not (incorrectly) advance time.

New in BGB 1.5.2 (2015-08-17) - Fixed a large number of bugs and problems, including: glitches in pokemon linking. Screensaver now doesn't start if you play with gamepad. Crash/stability fixes. Many small improvements, including efficiency improvements. Added support for more joypad axes (xbox 360 controller). Various debugger GUI improvements including local symbols.

Why BGB?

It's reasonably fast, very accurate, has high quality audio rendering and is feature rich and generally well-working. It also has a powerful debugger which is useful for Gameboy software development.

xxx doesn't work/I have a problem.

First of all, make sure you have the latest version from the link above. If you have an old version there's a good chance that your problem is fixed in a recent release.
If that doesn't help, and if you believe you have found a bug, please report it to beware, the author. You can do that in this thread, by sending an e-mail to the address on the homepage or by visiting the #gbdev IRC channel on EFNet.

Which platforms are supported?

Almost any 32-bit or 64-bit of Windows. The latest version should work as far back as Windows 98 with DirectX 7 installed, and tentatively Windows 95 with DirectX 7 and the Winsock 2 package installed. On the other end of the lineage, BGB reportedly works perfectly on Windows 10.

Another platform that is officially supported by the author of BGB is Wine. Any issues with using BGB under Wine should be reported as bugs. The current version of BGB has received a platinum rating in the Wine AppDB.

How can I change BGB settings?

Right click the emulator window and select options, or press F11 on you keyboard.

Where are my savs stored?

By default, a save file for a ROM is stored next to the ROM, with a sav file extension. For example, if the ROM is called lsdj.gb, a file called lsdj.sav in the same directory will hold the save data.
BGB can also save all savs in a single directory which you can set in the options window, under the misc tab.

What are checksums and how can I fix them?

A Gameboy ROM contains two checksums to verify that the ROM hasn't been damaged. If you've edited the ROM (for example added kits) the checksums may no longer be valid.

The header checksum is calculated based on the values in the ROM header only. This checksum must be correct to to start the ROM on a real Gameboy, but will only need to be fixed if you've edited values in the header area.

The file checksum is not required to be correct to start program on a Gameboy, but you may still want to fix it after editing a ROM to get a warm fuzzy feeling inside. If you're distributing a ROM to other people, it's good practice to fix both checksums.

Press esc to bring up the debugger window. Select file, fix checksums. then file, save as to save the fixed ROM file.

How can I record audio from BGB?

Note: If you're using a version older than 1.4.x, it's especially important that you upgrade if you want to use the recording function, because of a bug that would cause timing problems, which was fixed in 1.4.

In the settings, go to the sound tab and enter the beginning of a file name in the wave file writer box, and check the checkbox. When you resume emulation, a timestamp and wav file extension is added to what you have entered.

For example, if you enter c:\songs\mysong then the audio will be recorded to a file with a name like c:\songs\mysong-1384891504.wav where 1384891504 is a UNIX time UTC timestamp indicating the when the recording was started. The recording continues until you pause or quit the emulator, or uncheck the wav file writer check box and hit apply or ok.

Why does the soundcard output skip a lot while recording?

Because BGB has to output the sound stream to two different locations, (both disk and soundcard) and sometimes BGB the disk IO will take so long that BGB can't produce a sound buffer when the soundcard wants it. However, the wav file is still recorded perfectly.

Is it possible to sync LSDj running on two different instances of BGB?

Yes. However you should use two different GB files with two different corresponding sav files, so they don't conflict.

Right click one of the BGB windows and select link, listen. Enter a port in the range 1024-65535. Right click the other window and select link connect. Enter 127.0.0.1 followed by the : followed by the port, for example 127.0.0.1:12345
This only creates a virtual link cable and you still need to set up LSDj to make the sync work. One instance should have sync type set to master and the other to slave. Press start on the master side in order to start playback. Or press start first on the slave which should show "WAIT" until you press start on the master.

Is it possible to record two LSDj synced in BGB?

Yes, you should be able to combine the two instructions above, with a couple of caveats.

When you open the BGB settings dialog, the settings are loaded from the ini file. So if you first set a filename in one of the instances, a,d then open the settings dialog for the other instance, the file name carries over. You can solve this by having both dialogs open before you begin. You could also keep two BGB instances in different folders, so they each have their own ini file.

Do things in the following order:

  1. Start two instances of BGB and load two different instances of LSDj.

  2. Establish a link connection, as described above.

  3. Pause one of the Gameboys. (This will pause poth.)

  4. Open the settings dialog in both the instances of BGB, and keep them open.

  5. Enter two different file name beginnings (see the above entry about recording) in the respective instance, and press apply.

  6. Unpause BGB. Now, both the instances should start recording in sync, and with minimal offset.

  7. When you're done, uncheck the respective record enable boxes then click  apply. Or just quit BGB. You will get a warning next time that recording is enabled, so you don't accidentally start recording again.

Links for developers

RTC save format specification - Real time clock save file format, for games like Pokemon Gold/Silver.
MBC2 save format specification - Specification of the save format for the MBC2 cartridge memory controller.
BGB 1.4 link protocol - The protocol for interfacing with BGB's link cable emulation.

Last edited by nitro2k01 (Nov 7, 2022 11:49 pm)

Offline
Sweeeeeeden

(reserved post)

Offline
Abandoned on Fire

Thanks for this, especially for pointing out that bgb is a good choice on LINUX!

Offline
Unsubscribe

Also bgb works well with a program like Virtual Audio Cable:
http://software.muzychenko.net/eng/vac.htm

and asio4all
http://www.asio4all.com/

So you could run multi emulator setups directly into a vst host for live effects.

Offline
Arizona

Thanks for the info. I don't use emulators often but maybe this one will change my mind...or at least give me another platform to write music on.

Offline
Los Angeles, CA

BGB is the shit. I've written most Wizwars songs with it.

Offline
Sweeeeeeden

Bumping because of the release of BGB 1.5. Among other things, the LSDj tempo bug was fixed. All users are recommended to upgrade to the latest version.

https://bgb.bircd.org/

Offline
NC in the US of America

Sweet! I didn't know there was tempo bug.

Offline
Abandoned on Fire

Word! BGB is great.

Offline
Detroit

Hell yes, I was getting frustrated with that shitty bug

Offline
Mannheim, Germany

tempo issue fixed? sweet as hell.

Offline
Unsubscribe

also it seems he explained the tcpip linkport spec in detail... wonder if anyone can hack the arduinoboy version to work with a sync application on the machine using it?

Offline
NC in the US of America

Ooh just saw the avi recording thing. Sweet.

Offline
Abandoned on Fire
herr_prof wrote:

also it seems he explained the tcpip linkport spec in detail... wonder if anyone can hack the arduinoboy version to work with a sync application on the machine using it?

I'm very interested in even just simple tempo sync for BGB.  The sample abuse I use so much apparently causes some significant speed fluctuations.  When recording a midi synced cgb I'm really surprised how different it is!

[in before "have at it, bro!"]

Last edited by egr (Jan 6, 2015 6:12 pm)

Offline
Chicago

Anyone have experience getting BGB to run on a Mac with Wine? For me, BGB always crashes right after I try to run it.

Offline
SLC, UT

Works fine for me. I'm using BGB 1.5.1, on OSX Yosemite.