E00c070.PDF
(
419 KB
)
Pobierz
000152-UK GBDT
MICRO
PROCESSOR
GameBoy Development Tools
By Luc Lemmens
The articles on the GameBoy Digital sampling oscilloscope (GBDSO) did
not fail to convince many of you that the Nintendo game console is a
veritable gateway to more serious applications. This month we’ll look at
the tricks of the trade, or what goes into creating your GB application.
Since its introduction on the toy market, the
immensely successful Gameboy computer
game console has been used applications
‘totally different’ from than those envisaged
by its manufacturer, Nintendo. The original
game cartridges containing no more than a
ROM (sometimes accompanied by a RAM),
illegal copies soon appeared on the black
market. The next step was to develop Flash-
RAM cartridges which could be loaded over
and over again (from a PC) with different
games. The Internet abounds with websites
where this (illegal) activity is practised.
On a more serious (and certainly less illegal)
front, people are creating their own games for
the GameBoy. This deserves more respect
than the copying activity because one needs
to know the internal workings of the Game-
boy, and be able to program in the processor
language. The GBDSO takes this one step fur-
ther by adding not only software but also new
hardware to the GameBoy, enabling the ‘toy’ to
perform a task which is completely different
from what it was originally designed for! Not
surprising, really, because the GameBoy is a
compact system with its own control soft-
ware, a graphics display, processor, pushbut-
tons and an attractively styled plastic case, all
a price which defeats home construction.
Like us, you’ll soon get lost if you try to fol-
low all GameBoy links, threads and other ref-
erences on the Internet. In this article we will
endeavour to inform you about ‘places to
visit’ if you are interested in development
tools for the GB. Alas, in view if the huge vol-
ume of GameBoy-related information on the
web, it is impossible to cover it all.
Inside the GameBoy
The heart of the GameBoy is a Z80-
ish processor. The Z80 has been fea-
tured in many
Elektor Electronics
projects, and is an offshoot of the
good old Intel 8080. The instruction
set, however, misses out on some
instructions, while others have been
added. Furthermore, the flag regis-
ter looks slightly different because
the sign and overflow bits have
been omitted.
Developing your own software
requires a system memory map like
the one shown in
Figure 1
. The
address space of the Gameboy com-
prises several RAM banks (regular
internal memory, video memory,
sprite memory), ROM banks, mem-
ory-mapped I/O and three registers
that allow other memory banks to be
selected. In this way, the physical
memory can be much larger than
64 kBytes as originally specified for
the Z80 processor.
At the end of this article you’ll
find a reference to the document
called ‘GMB-SPEC.SC’ in which all
relevant hardware aspects are dis-
cussed at length. A must for anyone
70
Elektor Electronics
12/2000
GBDT
MICRO
PROCESSOR
General Memory Map
General Memory Map
board to be made to enable it to be connected.
Whatever method you use, the final test will
have to be on real hardware, and that is espe-
cially true for project designed on emulators, as
well as for designs involving new hardware
added to a cartridge.
In most cases, you’ll also need a helper
program to add the special Nintendo header
to the ROM cartridge and in addition com-
putes the right checksum. The job is best
handled by a program like RGBFIX. At
power-on, the GameBoy first runs a couple of
routines from internal ROM to check if the
cartridge contains the correct checksum, and
the Nintendo copyright message is stored in
the right location in the cartridge memory. If
these two conditions are not satisfied the
GameBoy will not get past its own start
screen. If everything is okay, it is up to the
ROM in the cartridge to make the little com-
puter do the necessary.
Interrupt Enable Register
FFFF
Internal RAM
FF80
Empty but unusable for I / O
FF4C
I /O ports
FF00
Empty but unusable for I / O
FEA0
Sprite Attrib Memory (OAM)
FE00
Echo of 8 kB Internal RAM
E000
8 kB Internal RAM
C000
8 kB switchable RAM bank
A000
Shopping list
8 kB Video RAM
8000
First of all you need a GameBoy, at least
that’s what you would think. True and not
true. On the Internet you may find several
emulators that allow GameBoy software to be
tested on many different computer types,
before you even get your hands on the real
thing. However, especially when designing
new hardware, you really have to get your
hands on a GameBoy to make sure your appli-
cation actually works.
Besides the hardware development tools,
you’ll also find an integrated development
system useful, like ‘GameBoy Development
Studio’. This wonderful product bundles all
components of the development software in
one graphics-based package. Finally, the
GameBoy Development Kit (GBDK) is highly
recommended, if only for the extensive col-
lection of examples included.
MBC1 ROM/RAM Select
16 kB switchable ROM bank
6000
RAM Bank Select
4000
ROM Bank Select
RAM Bank Enable
16 kB ROM bank #0
2000
0000
000152 - 11
Figure 1. GameBoy memory map.
serious about developing GameBoy
cartridge hardware.
The graphics
The Gameboy works with tiles,
which in graphics terms translates
into rectangles of 8?6 pixels. The
next large unit, a ‘map’ consists of
32?32 tiles. Graphics screens may be
designed on the PC using tile editors
or map editors like Tile Buddy, GB
Tile Designer (GBTD) and GB Map
Builder (GBMB), all suitable for run-
ning under Windows 95. DOS users
may employ TILE256. Besides these
editors, there are also programs that
enable graphic files to the BMP, PCX,
GIF or TIF format to be converted to
GameBoy pictures.
Development Software
While there are various superb
assemblers for the Z80, you’ll like
the news that there also is a real C
Compiler for the GameBoy: the
GameBoy Development Kit (GBDK).
None the less, many developers will
stick to their assemblers, mainly
because the C Compiler fails to gen-
erate code which is optimised for
compactness. A number of assem-
blers float around on the Internet,
including RGBDS, TASM (Table
Assembler —
not
Turbo ASsembler),
ADVancedGBIDE and the assembler
included with the GBDK. Profession-
als typically use ISAS, an assembler
recommended by Nintendo. Unfor-
tunately, it is only made available to
licensed designers.
Each assembler has its own pros
and cons, and your choice will ulti-
mately be governed by personal
taste and requirements.
(000152-1)
Internet addresses:
Jeff Frohwein’s Technical Page:
http://www.devrs.com/gb/
Pascal Felber and Michael Hope’s GBDK:
http://gbdk.sourceforge.net/
Ian James GBDS:
http://www.geocities.com/Eureka/9827/
Dr Pan’s Gameboy technical documentation:
http://www.gbdev.org/news/dl.html
Paul Robson’s GB97 emulator:
http://users.aol.com/autismuk/gameboy.htm
Hardware or software?
Several options are available when it
comes to testing applications. Of
course, you could use a cartridge con-
taining an EPROM or a Flash memory,
but for your first (faltering) attempts a
GameBoy emulator is highly recom-
mended. Alternatively you could
resort to an EPROM emulator,
although that requires an adapter
12/2000
Elektor Electronics
71
Plik z chomika:
TirNaNog
Inne pliki z tego folderu:
bge.jpg
(22 KB)
detail10.htm
(5 KB)
detail1.htm
(5 KB)
detail12.htm
(15 KB)
detail11.htm
(7 KB)
Inne foldery tego chomika:
1974
1975
1976
1977
1978
Zgłoś jeśli
naruszono regulamin