
Making a Game Boy Game in 2017 - tosh
https://www.gamasutra.com/blogs/DoctorLudos/20171207/311143/Making_a_Game_Boy_game_in_2017_A_quotSheep_It_Upquot_PostMortem_part_12.php
======
jweir
A correction. We didn’t use graph paper for the art work. Maybe be very first
artists did, but not any I know.

The tools were pretty good. Deluxe Animator II and Deluxe Paint - both for MS
DOS - is what I used for all my console games - Game Gear, Game Boy, SNES etc.

~~~
GelatinousSqure
Deluxe paint for the Amiga.... I still have a copy of that. They are the
classic versions.

~~~
corysama
Every Deluxe Paint fan out needs to watch this video of the master of that
tool explain his craft

Mark Ferrari: 8 Bit & '8 Bitish' Graphics-Outside the Box

[https://www.youtube.com/watch?v=aMcJ1Jvtef0](https://www.youtube.com/watch?v=aMcJ1Jvtef0)

~~~
gadgetoid
Small world- I just finished watching this again today. I've been trying
palette-cycling techniques with 32blit to see if I can learn the ropes and put
together a half-decent tutorial. I've had these -
[http://www.effectgames.com/demos/canvascycle/](http://www.effectgames.com/demos/canvascycle/)
\- up on my screen for the last few days. I managed to get - terrible -
palette-cycled fire sprites working with smooting (which Joe calls "Blend
Shift Cycling") and I think there are still some interesting interactions to
be found between these classic techniques and modern hard/software.

It's really exciting to see renewed interest in these techniques and
"8-bitish" games in general since it probably means we've chosen the right
time to make our handheld.

------
ArmandGrillet
And in 2019: [https://www.gbstudio.dev/](https://www.gbstudio.dev/)

~~~
chrismaltby
The author of this article was really helpful chatting with me on Reddit while
I was building GB Studio and still working it all out :-)

------
IceWreck
> Despite a mere 4Mhz speed, all the Game Boy games are displayed in constant
> 60fps. Take that PS4 Pro and Xbox One X!

My favorite line from the post.

~~~
basementcat
The Gameboy has the advantage of a smaller display with fewer pixels (with
less colordepth) to update. 16 bit pointers are also (relatively) easier to
push around than 32 or 64 bit pointers.

~~~
ekimekim
I would wager that doesn't make up for how much slower the hardware is,
though.

The 4MHz value is the clock speed, but all instructions take a multiple of 4
clock cycles to accomplish, so you often talk about it as a 1MHz "instruction
cycle" machine.

The fastest memcpy implementation I've seen for it (not including in-hardware
DMA features, which are only available for copying to OAM (sprite) RAM on the
original gameboy) takes 4.5 cycles per byte (one 16-bit word every 9 cycles).

That means that if you were trying to update every pixel on the screen (which
doesn't actually work - the GB's screen pixels aren't memory mapped directly
but generally specified via a combination of up to 384 unique 8x8 tiles, which
are then arranged on a 20x18 tile grid), which would be 160 * 144 * 2
bits/pixel = 5760 bytes, it would take 25920 instruction cycles ~= 24.72ms,
which comes out to approx 40.45 FPS.

Of course, as I mentioned, the actual GB doesn't work like that, and has a
Pixel Processing Unit that handles writing to screen every frame. While the
PPU is writing to the screen, the CPU cannot access VRAM, which means that the
CPU actually only gets what's called the v-blank period, which is only 1140
instruction cycles, which is only enough time to copy up to 254 bytes or so
(I'm skipping over some detail here, like how you could squeeze a few extra
bytes out by loading the first 4 or so bytes into registers before vblank
begins, or how you can also (with very careful timing) write to VRAM during a
~60 cycle window on each line knowing as the h-blank and OAM search periods).

In practice, games work despite these limitations because they generally only
have to modify a small amount of the screen in any one frame. Scrolling is
implemented in hardware, and you can write new data off screen then scroll
into it so you can take multiple frames to write it if needed.

This plus other tricks (for example, animating 50 copies of a common tile by
editing the tile's pixel data, which affects every copy at once) let these
games accomplish so much with so little.

It's impossible to compare to a modern sytsem with a polygon-based GPU,
they're entirely different things.

------
ionforce
I find using <OLD TECHNOLOGY> in <MODERN_ERA> endlessly fascinating. I love
stuff like this!

~~~
sdegutis
Just the other day I was looking for a good NES IDE for my son who's
interested in learning assembly and who has maxed out his PICO-8 skills. I
think this would be a good way for kids to learn some niche skills like
assembly that are still going to be needed in some careers but aren't as
widespread as JavaScript or Python.

~~~
mikepurvis
I feel like there's a lot of value in the whole "knowing how the sausage is
actually made" thing. You'll still take collections and the garbage collector
for granted 95% of the time, like everyone else, but at least you will have
some sense what's going on under the hood if you've had to implement pieces of
it manually somewhere along the line— and an actual working implementation,
not just a toy one for some undergrad class.

~~~
Waterluvian
Having done no CS in school and jumping right into python and JS, learning how
the sausage was made was immensely satisfying. I wrote a CHIP-8 emulator in
Python and then a Game Boy emulator in Rust. None of those skills have been
practically useful but were very educational.

~~~
metasaval
Unrelated question: what resources did you use to write your CHIP-8 emulator?
I've also been wanting to write one in Python for educational purposes, but
haven't found any great resources yet in Python. Granted there are a few in C
that I could try to translate over, but I'm curious to know what you used.

~~~
Waterluvian
I looked at the Wikipedia page and a couple PDFs from Google front page.

I stole a collection of games from someone else's project to use for testing.

My goal was to get in the door so I picked a language I knew well and set some
constraints:

1\. Doesn't have to be fast. Just has to run.

2\. Write opcodes as pure functions, passing in an array of memory and
returning a new array of memory. This made it easy to test and debug. But also
made it super slow.

3\. DO NOT look at someone else's code. This forced me down a way slower path
where I learned a whole lot more than I would have if I just reimplemented
others' work.

------
azhenley
After reading the post a few days ago about the Playdate console and reading
this post, it makes me wish there was a popular retro-style handheld console
that I could develop for.

~~~
sneakernets
Honestly, I can't recommend the GBASP enough. It's small, it has a lot of
power for a handheld of that era (enough to pull off texture-mapped polygonal
graphics at an acceptable frame rate) and the addressable ROM size is
practically limitless, going all the way to 64 MB.

~~~
azhenley
I guess I should add another requirement to my wish list: a modern app store
so indie devs can sell their games :)

I am considering teaching a university course where the students implement a
NES or GB emulator though. Should be a blast!

~~~
copperx
> I am considering teaching a university course where the students implement a
> NES or GB emulator though. Should be a blast!

I was considering doing the same for my Machine Language class, but it seems
that many games rely on the precise timing of the emulation to work. And,
because the output was an anolog TV, there are a lot of tricks that need to be
figured out. I thought that was a no-go for a course.

------
straws
Previously:

[https://news.ycombinator.com/item?id=15884051](https://news.ycombinator.com/item?id=15884051)

------
juliangoldsmith
I'll have to take a look at BGB. I've been using NO$GMB, but I don't think
it's maintained any more.

One thing I didn't see mentioned in the article are the Pan Docs. Those
document basically everything about the Game Boy at a low level.

~~~
Keyframe
NO$GBA v2.9d 23 Feb 2019 -
[https://problemkaputt.de/index.htm](https://problemkaputt.de/index.htm)

------
voqk
I bought this Game Boy Color Replacement LCD [https://www.mw-
embedded.com/product/gameboy-color-replacemen...](https://www.mw-
embedded.com/product/gameboy-color-replacement-lcd-module/) which gives the
device a really nice backlight. Here's the 8-bit guy's video of the process:
[https://youtu.be/WG8loyh-kFw](https://youtu.be/WG8loyh-kFw)

Another great GB development resource is [https://github.com/gbdev/awesome-
gbdev](https://github.com/gbdev/awesome-gbdev)

------
Lyrkan
I'm wondering if selling physical copies of the game doesn't come with legal
issues...

The "Nintendo" logo you see when booting a Game Boy comes from the cartridge
and is checked against one stored in the console.

If they don't match the whole thing stops, which means that you have to add
(and distribute) a Nintendo logo to your game in order for it to work on real
hardware.

~~~
philistine
I have not tested this particular game on real hardware, but multiple games
found ways around the console's logo checksum. It has a buggy implementation
that can be circumvented, allowing you to never have the logo on your
cartridge.

------
mywittyname
For those interested in classic game dev, the guys at the Computerphile YT
channel did a series with a guy that wrote a Genesis game a few years back
using an original dev kit on a mid-90s PC.

[https://www.youtube.com/watch?v=GH94fKtGr0M](https://www.youtube.com/watch?v=GH94fKtGr0M)

------
jkoudys
Great read! I was active in the gb dev scene in the late 90s (hmu if you
remember gbdev99 or the bunghk contests), and it's amazing to see so many of
the names and libraries built so long ago still come up today. The Game Boy is
still one of my favourite platforms today; such a great example of what you
can accomplish with very limited resources if you have enough creativity.
We've seen some of the best games of our generation come out on a battery-
powered device with a CPU that can't even multiply.

------
orionblastar
My Nephews stole my Gameboys by borrowing them and never returning them. I
still got a DS my son owns. But I had the Classic Game Boy, Game Boy
translucent case, Color Game Boy yellow shell, Game Boy Advance SP. All gone
now. They are collector's items now worth a lot.

I had an Atari Lynx but had to sell it because I needed the money. It was like
the Game Boy but Atari and it had color graphics and slim cartridges.

I think Free Pascal or some other language can make console games by cross
compiling.

Right now I have a Raspberry PI with RetroPI to play Gameboy games.

------
Kipters
For anyone interest, I recommend watching "The Ultimate Game Boy Talk" [0]
from 33c3, lots of interesting details about how a Game Boy works, including
the PPU

[0]:
[https://www.youtube.com/watch?v=HyzD8pNlpwI](https://www.youtube.com/watch?v=HyzD8pNlpwI)

------
calewis
This is so well written and so cool! I love how it's on a real cartridge. I
had no idea this would even be still possible. Amazing work!

------
ngcc_hk
That is what learning to compute all about. Since day one. What is the driver
of internet. Or pdp machine. To play game developed and maintained by us and
fellow hackers.

Stay hungry and hack.

------
kuu
Quite interesting!

