			

		        ---== CBEBoy2K1 v0.60 eta ==---
			     --- by David Prez ---
			   CopyRight  1999, 2K, 2K1



_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._
                                     I n T r O
_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._

  Hi everybody, welcome to my Game Boy emulator. The name of this project is 
   CBEBoy, because my nickname is CBeard. CBEBoy is written enterily in C++ 
   using OOP with the gcc compiler joined with the Allegro libraries.

  CBEBoy is still in beta stage so any images won't run correctly. Moreover, 
   the images of exclusively CGB (not DMG-Compatible) are not yet implemented.
   All color carts that works with old DMG are emulated.



_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._
				  F e A t U r I n G
_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._

  CBEBoy2K1 features: 

	- Cartdridge header read
	- CPU like-z80 emulation
	- Integrated Dissassembler and Debugger
	- Support of ROM ONLY, MBC1, MBC2, MBC3, MBC5, GB CAMERA and Hudson 
          Hu-C1 rom types emulation (not RTC coded still for MBC3)
	- LCD emulation
	- Interrupts of VBlank, LCD, Timer and Serial
	- Virtual joypad (not using GB joypad interruption)
	- Pallette & Raster effects
	- Save Battery support



_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._
                            H a R d W a R e   N e E d E d				   
_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._

  Nowadays, painting one of every two VBlanks, seems works fine on my 
   computer. That is 30 fps, real Game Boy is 60 fps. I hope fix this problem 
   soon. 

  My computer is: AMD K6-2 400 MHz, 
                   S3 Virge 3D 2MBytes graphics card,
                   128 MBytes of RAM.

  Conclusions: More MHz of CPU will be great to run at full speed.



_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._
                                     K e Y s
_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._

  Keys in DEBUG mode:
        - 'T' -> Trace   
        - 'D' -> Actualize Dump to ($value)
        - 'E' -> Execute to ($value) tracing every mnemonic until breakpoint 
                 at X
        - 'V' -> Execute until next VBlank interruption (0x40)
	- 'R' -> See the I/O registers status
        - 'C' -> Change the value of a memory position

	- '1' -> See Tile Info Status (TPT1 & TPT2)
	- '2' -> See VRAM status (256x256)
  	- '3' -> See BACKGROUND status (160x144)
  	- '4' -> See OAM status
  	- '5' -> See WINDOW status
  	- '6' -> See Palettes status of BG & WIN, OBJPAL0, OBJPAL1 

        - 'F1' -> Help 
  
  Keys in RUNNING mode:
	- Arrow Keys -> Up, Down, Left, Right 
	- '1' -> Start
	- '2' -> Select
 	- 'CONTROL' -> Button B
 	- 'ALT' -> Button A
 
 NOTE: Pressing TAB key, you can change between Running or Debug Mode, or
       from Debug to Running Mode.

 

_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._
                                    H i S t O r Y
_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._

@ CBEBoy2K1 History:
--------------------
 v0.60 -> 05-06-01
  * Started again the emulator.
  * Fully new CPU engine, more faster than ever; coded in 5 days ;).
  * Added the same dissassembler and debugger of old CBEBoy.
  * Debugging and fixing some CPU bugs.
  * Included LCD pre-liminary version.
  * Added JoyPad emulation in PCKeyboard.
  * Recoded interruptions (except Serial Int).
  * Added serial interruption -> more games working (finally Alleyway works).
  * More and more faster.
  * Added LCD full emulation: BG + WIN + OAM (all of them line-by-line).
  * Saved the RAM of the cart in a file to load it later (savegame support).
  * Fixed priorities between BG & OAM.


                                 -o-o-


@ CBEBoy History:
-----------------

 v0.51 -> 20-02-01 * FACULTY PRESENTATION ... NOT RELEASED; most playable *
 * Fixed some crashes in debug mode.
 * Keyboard interrupt installed. Works fine, now sprites can be moved easily 
   and speeder than before.
 * Repaired a failure when pressing two or more keys from the keyboard. 4 
   buttons save in zelda now works perfect :D
 * Added a small help in debug mode when pressing F1 key.
 * Now values in RAM can be changed pressing key 'C' in debug mode. 
 * Fixed a bug in switching ROM banks when code wanted to access banks 
   greather than 32. Note: Armaggedon Video Trailer ROM has got incorrect bad 
   type MBC1 switching!
 * Repaired a big bug: when LY reaches line 0x90 my gfx engine always paint the 
   screen, jumping to the interrupt, inclusive when lcd was off. If lcd is off 
   at LY = 0x90 no paint will be allowed.
 * Repaired a bug putting >> (right rotation) instead of << (left rotation) 
   when looking for another interrupts different that VBlank.
 * OAM Priorities implemented between BG-WIN and OAM. 
 * OAM Priorities also corrected between sprites (the first on the OAM table is
   the most prioritary OAM than others).
 * Fixed save file ram name when in the filename was a point before the point 
   of the extension.
 * Changed of name because started again from 0 some parts of the code, and
   also because CBEBoy was the project of end-of-career. Now that is finished,
   CBEBoy2K1 will be my next target.
 
 v0.014 -> 28-09-00 * FIRST INTERNET RELEASE *
 * LCD int. now works fine but slow. By the moment, I have switched off this 
   option.
 * Thinking in make a new cpu in asm language. Problem: my version of DJGPP is
   the v2.1 and it works with AT&T asm language. Is similar to intel asm but a 
   little strange. Does the newer versions of DJGPP supports intel asm :?
 * Compiled now with Allegro v3.12 and with a newer version of DJGPP
 * Now accepts filenames of more that 12 characters and also saves the ram in 
   the correct filename.
 * Code idented, was inidented due to also the new RHIDE interface of DJGPP.

 v0.013 -> 15-09-00
 * Now save state is renamed to "filename.ram" and it is loaded inside game :D. 
   I have tested this with Zelda and works fine.
 * Switchings and copies from memory to memory optimized with memcpy C function.
 * Now number of ROM and number of RAM switched can be saw more easy in debug 
   mode.
 * Repaired a failure that makes that when LY was into (90x, 99x) the emu dont 
   knows that it was in vblank.
 * GB Camera support, hehehe.
 * Optimizations in CPU: OR, AND and XOR opcodes.
 * Repaired flag h in ADDhlss opcodes.
 * Some other opcodes optimized.
 * LCD interruption semiimplented.
 
 v0.012 -> 11-09-00
 * Opcodes who read a value from PC+1, and this value must be signed have been 
   repaired. The problem was dont make a logic and and then the values will
   turn crazy: "JR e", "JR z, e", "JR nz, e", "JR c, e" and "JR nc, e".
 * Battery implemented for MBC-1. I have tested that it saves the game 
   correctly. Still no loading of this file.
 * Battery now works with all cartdridge types.
 
 v0.011 -> 08-09-00
 * ROM ONLY + MBC1 emulated :D that means that hundred of games are now 
   compatible. And no more limit of 32 KB ROMs. I have tested ROMs of 2 MBytes 
   like as Armaggedon Video Trailer (PD) and they work fine. ROM switching seems
   work fine.
 * Big error detected: before I set the IF flag of vblank every time LY reaches 
   90, but if LCD is off this flag mustn be set -> This means more speed for 
   any games.
 * Now the user screen dont waits until pc reaches 0x40 line (because some 
   roms never arrives to this point). Some roms are viewed now  without changing
   between Debug or Running Mode.
 * More cartdridge types supported.
 * Opcodes RLr_RRr repaired.
 
 v0.010 -> 06-09-00
 * Screen centered in the middle of the pc screen.
 * Modified click counters for LY and VBlank. Now are more exact and work 
   together.
 * RSTx opcodes repaired. 
 * CALLpq opcodes repaired.
 * TIMER interruption introduced. This makes more compatibility :D
 
 v0.009 -> 23-08-00
 * Repaired EI opcode into interruption, this makes more games compatibles :). 
 * CCF opcode repaired. 
 * Joined BG & WINDOW painting routines in the same loop, but seeing that this 
   is a little slow because of some boolean comprovations, I turned to the old
   form. 
 * Added pallettes for Sprites (OBJP0 & OBP1).
 * Sprites now have got transparences. 
 * Fixed a problem in painting procedure who makes put pixels in screen with 
   some strange colors. 
 * If a halt is executed and interrupts are disabled and (IE & IF > 0) cpu won't
   hang now.
 
 v0.008 -> 21-08-00
 * OOP wasn't the problem, I pass it to simple C and the frame skip is the same. 
   Maybe are the painting functions of Allegro library. I don't know. 
 * The arrays of TPTx wasn't the problem of slow down. 
 * Without painting, the scence of the russian towers in Tetris (appears after
   505 vblanks = 8.4 seconds) in my EMU is about 3.5 seconds. So wehave 8.4-3.5 
   = 4.9 seconds for painting!!!! That's too much. So the problem must be in the 
   painting procedure. 
 * Support of CGB images (but in 4 colours), futhermore, if this images have got 
   memory mapped they will hang.
 
 v0.007 -> 19-08-00
 * DAA opcode repaired, now no more counters with hexadecimal values. 
 * Corrected the flip from Y and XY in 8x16 pixels sprite mode. 
 * More exact now counting cycles (all work from a general counter). 
 * RES and SET opcodes optimized. 
 * Pallette for BG & WINDOW added. 
 * Now I have calculated that I must put a frameskip of 1/5 to work fine 
   == 12fps. Ummmmhh maybe soon I must pass from OOP to simple C.
 
 v0.006 -> 18-08-00
 * Sprite Flipping works fine now. 
 * Reduced to the maximum (I think) the CPU core. Still it doesn't works 
   completely fine; it must have opcodes bad emulated. 
 * A failure in counters repaired now. 
 * BG Memory is cyclic/scrollable 100% now :D (Space Demo demostrates it). 
 * Window visualization. 
 * Added triple buffering for BG, WIN and OAM at the same time => more speed
   working with pc VGA and not more flickering.
 
 v0.005 -> 16-08-00
 * FrameSkip command introduced (in my pc skipping 1/4 frames works fine = 
   20fps). I think I must optimize the painting procedure, and forget of save the 
   pixels in arrays. I think that it slows the process. 
 * JoyPad routines introduced ... (see JoyPad Rom) and finally TETRIS is joyable!!! 
 * More games of 32 KBytes tested and also joyable!!!! 
 * New keys for dissassembler/debugger more easy of remember.
 
 v0.004 -> 09-08-00
 * Displaying sprites of 8x16 corrected. 
 * CPU still most optimized & reduced. 
 * Tetris and a lot of more cartdridges doesn't hangs now, but still no JoyPad 
   routines coded. 
 * 0xE8 & 0xF8 opcodes <-> SP+e (where e = signed value) repaired now. 
 * SBC opcode repaired. 
 * DIV register introduced.
 
 v0.003 -> 05-08-00
 * OAM Tiles & DMA incorporated. Fe: Tetris (G until 0x6CAD, then "G" until 0xFFBA,
   then O 2 see OAM Table). 
 * Too many games intros runs now directly :), including sprites animation (see 
   Amida or Serpent). 
 * CPU core size reduced :. 
 * ADC opcode repaired.
 
 v0.002 -> 01-08-00
 * Introduced a representative stack in the debugger. 
 * Some changes in the emulation of the CPU (I think that I can optimize it a 
   little more). 
 * EI and DI opcodes now work fine. 
 * HALT opcode also works fine now. 
 * Opcode BIT repaired. 
 * Some other less important opcodes repaired! :D. 
 * Added timing (but still unused) for LCDCStatus. 
 * Yeahhh again! The second screen of Tetris can be saw now tracing until line 
   $6cad, or not entering onto the debugger; that means that interrupts might be 
   right now.
 
 v0.001 -> 24-07-00
 * Yeahhhh! The first screen of Tetris cart can be saw now :D (tracing until line 
   0x2F0 and pressing "L" key).
 
 23-07-00
 * Compiling now with Allegro of Shawn Hargreaves. 
 * Now I can see VRAM tiles and also the corresponding LCD. 
 * Introduced counters for HBlank & VBlank interruptions (LCDStatus). F.e. in 
   Alleway $193 -> VRAM
 
 20-07-00
 * Added a visual interface for a complete dissasembler and debugger.
 
 17-07-00
 * Portating the code from visual c++ to GNU of DJ DELORIE. 
 * Corrected the "external linkage" error. 
 
 01-06-00
 * New z80 motor with a lot of corrections. 
 * Included new values in opcodes machine cycles.
 
 15-05-00
 * After 5 months I coded the first z80 motor in VC++ using OOP. Docs: 
 "Programacin del z80" by Rodnay Zaks. 
 
 17-12-99
 * The project starts...
 


_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._
                                   S t I l L   2   D o
_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._

  I know that there are some things to fix, but my priorities are exactly 
   now:
	- Debugging to fix the few last cpu bugs; if there are really any bug ;)
        - Revise the lcd status interruption (some games working with scanlines
          make bad glitches).
        - Support exclusively GBC ROMs (pure MBC5 stuff).
        - Make a list for interruption nesting.

	

_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._
                               H o W   2   C o N t A c T
_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._

  Don't ask me where to find rom images, I don't want to know anything about 
   them. Moreover, having files with game images is illegal if you havent got 
   the original cart. 

  Only report comments or problems please, my e-mail is:
			
				"cbeboy@terra.es"

  Also you can find me sometimes in EFNET or HipanoIRC (channel #emuladores); 
   my nickname is CBeard.



_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._
                             T h A n K s   G o E s   T o
_.--.___.--.___.--.___.--.___.--.___.--.___.--.__.--.___.--.___.--._

 - Principally goes to Cristina Marquez, my girlfriend, I love u :*. You know 
   you are the flame who makes live my soul :
 - Oriol Pujol for your support and helping offered to me.
 - Brainiack/HexDump for introduce me in the great world of developing 
   emulators ;) Do you remember still GBShOcK? :D
 - Marat Fayzullin for write "How 2 write a computer emulator".
 - Denzel for the beautiful logo of my homepage and Lemonade for his pics.
 - Augus & Jose bros. Perez for the Rodnay Zaks - Z80 book.
 - Enrique Jose for teach me how 2 fix any problems under OOP.
 - DJ DELORIE for his great GNU GCC compiler.
 - Shawn Hargreaves for the wonderful Allegro library.
 - DP for compile all the info written about GB (written previously by Pan of 
   Anthrox, GABY, Marat Fayzullin, Pascal Felber, Paul Robson, Martin Korth, 
   kOOPa and Bowser) and publish it in "Game BoyTM CPU Manual". 
 - Han & Kray (NEOGEM) for teach me how to build an EMU.
 - Martin Korth for answering me some questions and for his unique and genuine 
   dissasembler/debugger. 
 - Julien Frelet also for answering me some questions.
 - The Web Master of www.otakunozoku.com for pusblish "The Gameboy Crib Sheet" 
   resuming almost all the GB HW.
 - All my friends in IRC Hispano in channel #emuladores (so sorry for my poor 
   english, I'm spanish): Kaerv, LiM, A-Kristo, Debugger, Arkanoid, CopyRight, 
   SuBuRu, Flashy, ZjoyKiler, Rumans, Chrono, Blumer, Rikin, Tolvatar, Koiote, 
   Kreator, PTS, z80User, RooBoo, ryleh ... (and some others I forgot now, 
   sorry!).
 - All my friends in NEW NET in channel #emugods.
 - Oscar Perez for helping me searching keyboard handling routines under DJGPP
   in Internet (there are so rare).
 - Markus F.X.J. Oberhumer & Laszlo Molnar for develope UPX.
 - Judge for his ideas about the line by line LCD buffer painting.
 



 ----------------------------------------------------------------------------
 CBEBoy is not endorsed in anyway with Nintendo. 
    Game Boy is a Trade Mark of Nintendo.

	 h t t p : / / w w w . e m u m a n i a . c o m / c b e b o y
