Archives: wwwdir, chipfun
GameBoy Page
This page is currently under construction and therefore contains a lot of inconsistent information.
Virtual GameBoy sources
Virtual GameBoy for Windows
There is also a GameBoy-look-alike emulator for the Commodore Amiga called ToyBoy. This emulator can be obtained via FTP from WUARCHIVE or any other AmiNet site.
Gameboy68000.lha from WUARCHIVE
Unfortunately, this package is incomplete amd HAS NOTHING TO DO with the real GameBoy. It was stolen from a UK-based company called Argonaut which does hardware and software development for Nintendo. According to Argonaut's managing director Jez San, ToyBoy was an in-house emulator written to see how difficult it would be to program GameBoy games. Since its authors knew nothing about internals of the real GameBoy when they were writing the emulator, ToyBoy is completely incompatible with GameBoy.
MCM Electronics
ftp://ftp.netcom.com/pub/vidgames/gamegenie/
.
Example: 3D2-ABF-3BE - Set 3Dh (DEC A command) at address F2ABh
Some commonly used Z80 instructions with their codes:
Complete list of Z80 instructions
--------------------------- FFFF | 32kB ROMs are non-switchable and occupy
I/O ports + internal RAM | 0000-7FFF are. Bigger ROMs use one of two
--------------------------- FF00 | different bank switches. The type of a
Internal RAM | bank switch can be determined from the
--------------------------- C000 | internal info area located at 0100-014F
8kB switchable RAM bank | in each cartridge.
--------------------------- A000 |
16kB VRAM | MBC1 (Memory Bank Controller 1):
--------------------------- 8000 | Writing a value into 2000-3FFF area will
16kB switchable ROM bank | select an appropriate ROM bank at
--------------------------- 4000 | 4000-7FFF. Writing a value into 4000-5FFF
16kB ROM bank #0 | area will select an appropriate RAM bank
--------------------------- 0000 | at A000-C000.
|
| MBC2 (Memory Bank Controller 2):
| Writing a value into 2100-21FF area will
| select an appropriate ROM bank at
| 4000-7FFF. RAM switching is not provided.
Following Z80 opcodes are changed:
------------------------------------------------------------------------------ Code Z80 operation GameBoy operation ------------------------------------------------------------------------------ 08 xx xx EX AF,AF' LD (word),SP Save SP at given address 10 xx DJNZ offset STOP Meaning unknown 22 LD (word),HL LD (HLI),A Save A at (HL) and increment HL 2A LD HL,(word) LD A,(HLI) Load A from (HL) and increment HL 32 LD (word),A LD (HLD),A Save A at (HL) and decrement HL 3A LD A,(word) LD A,(HLD) Load A from (HL) and decrement HL D3 OUTA (byte) No operation D9 EXX RETI Enable interrupts and return DB INA (byte) No operation DD Prefix DD No operation E0 xx RET PO LD (byte),A Save A at (FF00+byte) E2 JP PO,word LD (C),A Save A at (FF00+C) E3 EX HL,(SP) No operation E4 CALL PO,word No operation E8 xx RET PE ADD SP,offset Add signed offset to SP EA xx xx JP PE,word LD (word),A Save A at given address EB EX DE,HL No operation EC CALL PE,word No operation F0 xx RET P LD A,(byte) Load A from (FF00+byte) F2 JP P,word No operation F4 CALL P,word No operation F8 xx RET M LDHL SP,offset Load HL with SP + signed offset FA xx xx JP M,word LD A,(word) Load A from given address FC CALL M,word No operation FD Prefix FD No operation ------------------------------------------------------------------------------
0100-0103 A sequence of bytes 00 C3 xx xx where last two bytes contain the
starting address of a cartridge [lower byte first]. The first two
bytes of this sequence can be used as a "magic number" to
recognize GameBoy cartridges. When GameBoy starts, the control is
passed to address 0100 and then the sequence is interpreted as
NOP; JP .
0105-0133 Nintendo character area:
CE ED 66 66 CC 0D 00 0B 03 73 00 83 00 0C 00 0D
00 08 11 1F 88 89 00 0E DC CC 6E E6 DD DD D9 99
BB BB 67 63 6E 0E EC CC DD DC 99 9F BB B9 33 3E
0134-0143 Title of the game in ASCII terminated by zeroes
0144-0146 Not used
0147 Cartridge type:
0 - ROM ONLY 3 - ROM+MBC1+RAM+BATTERY
1 - ROM+MBC1 5 - ROM+MBC2
2 - ROM+MBC1+RAM 6 - ROM+MBC2+BATTERY
0148 ROM size:
0 - 256kBit = 32kB = 2 banks
1 - 512kBit = 64kB = 4 banks
2 - 1MBit = 128kB = 8 banks
3 - 2MBit = 256kB = 16 banks
4 - 4MBit = 512kB = 32 banks
0149 RAM size:
0 - None
1 - 16kBit = 2kB = 1 bank
2 - 64kBit = 8kB = 1 bank
3 - 256kBit = 32kB = 4 banks
0150-0151 Manufacturer code:
3301 - Nintendo
7901 - Accolade
A400 - Konami
014C Version number
014D Complement check
014E-014F Checksum [higher byte first] produced by adding all bytes of
a cartridge except for two checksum bytes together and taking
two lower bytes of the result.