BGB version 0.88

homepage: bgbemu.cjb.net, www.xs4all.nl/~beware3/bgb
email: bgbemu@xs4all.nl

this is a gameboy/color emulator for win32 which will probably never be finished

disclaimer:
===========
no warranty of any kind, use at your own risk. This program is guaranteed to do nothing but taking disk space. Don't blame me if it damages your computer, or erases your hard drive, etc. 
Using copyrighted roms with this emulator is ILLEGAL, especially if you don't own the real cartridge. If you choose to do so, that is your responsibility.

features in this version:
=========================
* emulation of the GameBoy, GameBoy Color, and the Super GameBoy
* SGB multiplayer with 2 controllers
* runs almost all roms perfectly.
* Accurate sound emulation, sounds exactly as on a real GB/GBC. sound can be written to .wav file.
* accurate video emulation. The screen looks exactly as on a real GB/GBC.
* This emulator is fast.
* Joystick/Gamepad support, everything configurable
* MBC3 Real Time Clock emulation.
* Auto delay/frameskip, gameboy runs at 100% real speed.
* GameGenie and GameShark cheat
* save/load state with quick (zsnes style) keys.
* Configurable keys and screen colors.
* Load from zip and gzip files
* This program does not use DirectX or runtime libraries.
* support for optional border bitmap and pseudo fullscreen mode.
* TCP/IP game link support

technical specifications:
=========================
* Emulation of the gameboy "z80" cpu with all known opcodes, at 4.194304 MHz or double speed mode
* emulation of HALT+ints disabled bug
* Emulation of the LCD, 59.7275 fps, emulation of "ISTAT".
* All interrupts are emulated
* Support for MBC1,MBC2,MBC3+rtc, MBC5, and partially HuC1/HuC3 mapper, rom size up to 64Mbit, ram size up to 1 mbit
* Not initialized RAM contains random numbers (as in reality)
* Sound with stereo, per channel and global volume, envelope, sweep, white noise with polynomial, CH3 update as in reality, rapid register changes as in reality. Sound is generated at adjustable quality up to 48KHz/16bits.
* Emulation as GB or GBC mode, in GB mode it does not support any GBC features


system requirements:
====================
win32 (95/NT or later)

The windows screen mode must be 16 bits or more, but 16 bits is recommended because it's much faster than 24 or 32 bits mode.

soundcard and joystick/gamepad are optional.

Pentium 133 MHz: GB games and older GBC games run fast.
Pentium 233-266 MHz: recommended for demanding GBC games.

what can be in next versions
============================
* more roms supported

keys:
===== 
numpad +	fast forward
numpad *	reset gameboy
numpad -        cheat codes on/off
Z		B button
X		A button
Shift		Select button
Enter		Start button

F2 save snapshot
F3 select snapshot 
F4 load snapshot

The joypad keys can be changed. On some keyboards the Z and X pressed simultaneously do not respond. Setting the A and B to other keys can fix this.

Click the right mouse button in the emulator window to get the popup menu, from which you can access the options and functions.

options window:
===============
Popup menu --> options.
here you can change the joypad keys, the colors of gameboy screen, and the sound options. 

To change a key, click the editbox of that key and press the key. You don't have to care about the numbers.

Gamma correction: on most monitors, colors appear to dark. Adjust the gamma slider to make the colors and lcd shades look correct on your monitor.

8 bits gfx vs 16 bits gfx:
==========================
BGB has for both the GBC and the GB 2 separate gfx engines (screen draw routines), one which uses an 8 bits bitmap, and one which uses a 16 bits bitmap.

"No": Always uses the 16 bits graphics.
"Auto": Uses 8 bits gfx when possible, but switches to 16 bits when needed.

"Yes": not recommended. Always uses the 8 bits graphics engine.

- on any video card, BGB may be much faster if the windows desktop is set to 16 bits (hicolor) instead of 32 bits (truecolor)

- on a slow CPU, 8 bits gfx (auto setting) may be faster than 16 bits gfx because it uses less CPU.

which setting (8 or 16 bit) in BGB is faster depends on the hardware of your PC (CPU and video card), so try both settings, in different situations (window, maximized, etc)

wav file writer:
================
You set the name of the wav file in the options. 
Each time when you enable sound or restart the emulator, the wav file is reset. because of this, if you want to keep a sound, you must copy the wav file or a part of it. The wav file will be closed when you disable sound in the popup menu.

GameGenie/GameShark cheat:
==========================
The cheat window looks like a notepad. Enter or paste the codes, one per line, and they work immedeately. any line not looking like a valid code is ignored.
to disable a single code, prefix it by a non-alphanumeric character such as ";". If a code does not work, you may need to reset the gameboy or you have a different version of the rom.

Gameshark codes: Any code that has the 7th digit in A,B,C,D (ram area) are supported. i dont have more info on gameshark codes.

problems:
=========
- no known problems which are worth mentioning.

If you find a problem with a rom, send me email. preferably with info on how to fix it.

How to make bgb run faster if you have a slow computer
======================================================
* Combine 640x480 screen resolution with a small window (1x1 scale)
* Set the windows screen to 16 bpp. 
* Set "8 bits gfx quick & dirty" in the bgb options. 
* Set the sound samplerate to 22KHz or just turn sound off.

full screen mode:
=================
select window size -> full screen, to go to full screen mode. the GB screen will be at the center of the screen and has the same size which the window had before going to fullscreen mode.

border bitmap:
==============
you can use a bmp file as border for BGB (it will show if enabled, and there is no SGB border). use a 160x144 pixels plain, one color rectangle to define the location of the GB screen. You can also drag and drop a bitmap file to use it as background.

game link:
==========
for bgb game link to work at all, you need a very fast pc (P3, athlon) and <1ms lag (fast LAN, or localhost). it does not work with all games. some games that work are tetris, pokemon, mortal kombat. You can send me email: your system specs, OS, network specs (if applies), the game, and if it does work, or if it does not work. don't ask "when do you support (name of game)", i don't know. on one bgb, you select "listen", on the other you select "connect". it should then show "linked" in the titlebar. there is also an option "remotejoy" so joypad 2 of one bgb controls the other bgb (which does not have keyboard focus, for example).

version history:
===============
0.88 - fixed: save file name gets corrupted if loading a rom causes a warning, making load/save impossible. added: you can now change the current save name, by changing the save dir in the options, without reloading the rom.

0.87c - fixed: the info screen still showed my old email adres...

0.87b - fixed: linkspeed was not initialized, causing problems when not linked, such as breaking alleyway

0.87 - added experimental TCP game link support.

0.86 - added support for japanese pokemon crystal. fixed: accessing a word on address $ffff caused AccessViolation. fixed saving of joystick buttons config. Redone code which searches GB screen rectangle in border bitmap.

0.85 - emulation of 2 joypads for SGB multiplayer. fixed memory leak when loading a rom fails. added support for gzipped roms. fixed some bugs in zip header code, bgb is less likely to hang on corrupt zips. new time synchronization code. sound bugfixes and accuracy improvements. Added option to use GB colors in SGB mode.

0.84 - Fixed pokemon crystal (HDMA behavior guesswork). Option for generating high quality anti aliased rectangular waves (CH1 and CH2).

0.83 - fixed some sound bugs introduced in 0.82. CH4 anti aliasing, especially CH4 high pitch tones sound better. Fixed a resize problem in wine.

0.82 - fixed "magical drop" and "miahamm soccer shootout". fixed "little mermaid ii pinball frenzy", speculation about HDMA behavior. rewritten sound code, improved sound. CH4 (noise) is more like real gb now. implemented anti emulator detection.

0.81 - redone STAT/timing/interrupts core, more accurate now (?), fixed *many* known problem roms. implemented DI+HALT hardware bug now, needed to fix smurfs/thunderbirds again (thanks no$gmb history text). "little mermaid ii pinball frenzy" graphics will be broken until i have exact HDMA timing. added "no visible window" mode (doubleclick in bgb window to toggle). GB screen can now be off-center in the border bitmap. SGB border can now overlap main screen in 16 bits gfx mode (alfred chicken). minor fixes/changes.

0.8 - Added SGB support. renamed "snapshot" to "state" to prevent confusion with "screenshot". changed I/O register behavior, it should be more like the real hardware, i might break something. fixed bugs. added options. 

0.71b - i removed the hide taskbar code for fullscreen, i think its not needed. added support for "the smurfs" and "pocket puyo sun" (i didn't HALT if ints disabled)

0.71 - Added support for HuC1 and HuC3. Improved control panel GUI. The 4 sound channels can be enabled/disabled independently. Colors of background, window and sprites can be set. Improved full screen support. Bugfixes. Changed DMA behavior, "little mermaid II pinball frenzy" and "le mans 24h" both have correct GFX. fixed nintendo logo screen (ishido)

0.7 - improved compatibility, a number of problems fixed; tested: "legend of zerd", "magical chase", "elmo in grouchland", "faceball 2000" (framerate), "dragon slayer" (music). Emulation speed can be adjusted. added "delay" option so bgb doesnt have to use 100% cpu. emulation of absence of external ram (reads $ff). more cleanup.

0.66b - Saving zero length .sav files problem is fixed. save-filenames were truncated at first dot, fixed. problem with pressing U+D or L+R key simultaneously is fixed. Fixed problem of "Mr. do!" hanging at hi-scores screen. 

0.66 - You can drag & drop files to the BGB window. BGB can start with no rom loaded - you don't get the load rom dialog.

0.65b - i did the changes from 0.64 to 0.65 again... this time i did yet another gfx engine, i didnt like 0.65 being 5 fps slower on my pc.

0.65 - Support for bilinear filter. removed the vram viewer; i didn't use it, and it was not stable. Fixed problems with "Mr. Do!". fix in gfx engine: dirty statusbar-split in "fortress of fear". small sound fix (broken in 0.64)

0.64 - minor update+bugfix. based on diagnose roms. Fixed speed of envelope sweep, it is now 1/64 sec per unit as in reality. sound registers now behave more like on real gb. OAM is now zero filled on reset, sprites were flipped incorrectly.

0.63 - minor update. Fixed (reversed) sound stereo. Added option for GBC "LCD colors", similar to the "real colors" option in no$gmb. Joystick buttons up to #16 can now be used. Fixed problem with puzzle road.

0.62 - Added support for joystick/gamepad. Added support for rumble carts. Cleaned up the LCD/STAT/interrupts code; a few rom problems solved, runs pinball deluxe/fantasies. Fixed sound volume rounding, better sound. Fixed the in 0.61 introduced sound problem with Cannon Fodder.

0.61 - Added support for zip files. Added 16 bits gfx engine for old GB (faster if window is big/maximized).

0.6 - Added GameShark support. Fixed many bugs. Great sound improvements (also fixed a bug which messed up the sound in GBC mode). Sprite priority as on real gb.

0.52 - Added a setting which automaticly switches between the faster 8 bits gfx and the 16 bits gfx when needed. Changed window behavior again, it should be correct by now (alfred's adventure). WAV writer didn't work if soundcard disabled... minor fixes. Fixed problem with Hook.

0.51 - fixed problems, even more roms supported, check out the screenshots page. Added "Tiles viewer". Fixed a problem with the filename of the wav-writer.

0.5 - Added hicolor GBC graphics engine. Added background priority support. Added MBC3 timer emulation. Problems solved, more roms run correctly. Wait-loop detection, some games run faster.
Maximum frameskip option. BackGround map vram viewer. Minor changes.

0.4 - Added GBC support. Fixed bug in auto-frameskip code, it is now smoother. Minor change in video engine, "the addams family" and "starfight" now run.

0.32 - Added icon. Fixed serial transfer; Mortal Kombat and Alleyway now run. CPU optimized with assembler. Emulated behavior of window (startrek briefing screen). minor changes.

0.31 - Added support for MBC5 (games like warioland 2). Added gamegenie on/off key. Changed behavior of select snapshot window.

0.3 - First released version

greets:
=======
- Koiote at irc-hispano
- Martin nocash Korth
- Liu ricky
- lord_nightmare
- [dox]
- anyone else who i forgot to mention

feedback:
=========
If you have comments, questions, hints or problems/bugs which are not described here, 
send me mail: steendijk@tomaatnet.nl
