
Making a Game Boy game in 2017 - doppp
https://www.gamasutra.com/blogs/DoctorLudos/20171207/311143/Making_a_Game_Boy_game_in_2017_A_quotSheep_It_Upquot_PostMortem_part_12.php
======
aaavl2821
My parents never let me have video games growing up because they thought it
would be a waste of time. They let me get a gameboy for some reason though, I
guess cause they couldn't imagine someone wanting to stare at a 2x2 black and
white screen for any length of time. Even when my friends got n64s, we spent
most time playing Pokémon or Zelda on game boy, because the games were just so
good

I recently downloaded roller coaster tycoon for my gf, as we both used to play
it when we were younger. She doesn't really play games, but during our 4th
date at an amusement park we found out we both played it as children. That
game was written in assembly by one person

Not really a point here, other than that nostalgia and craftsmanship can be
far more powerful than the latest hardware or software

~~~
wallace_f
>craftsmanship can be far more powerful than the latest hardware or software

I was just listening to the original Warcraft soundtrack for nostalgia's sake
and the Youtube video had scrolled through some of the old artwork. It brought
back memories of playing at my friend's house when we were kids. The game also
had such nice craftsmanship--the artwork, character and themes. It reminded me
of what those old games on small budgets were able to do. Something about that
seems missing in today's big gaming titles.

~~~
norswap
Might be early Xmas for you: [http://www.pcgamer.com/this-is-how-blizzard-
plans-to-finally...](http://www.pcgamer.com/this-is-how-blizzard-plans-to-
finally-bring-back-vanilla-wow-servers/)

~~~
kleiba
I believe s/he was talking about the original Warcraft, not World of Warcraft.

------
EvanAnderson
If you're into knowing more about the Game Boy I can't recommend "The Ultimate
Game Boy Talk" from 33c3 enough. Michael Steil is a wonderful presenter:
[https://media.ccc.de/v/33c3-8029-the_ultimate_game_boy_talk](https://media.ccc.de/v/33c3-8029-the_ultimate_game_boy_talk)

------
userbinator
The hardware may seem very limiting but in fact you can often exploit the
limitations to achieve even better effects --- for example, the LCD's
relatively slow refresh rate means you can do temporal dithering to go beyond
2 bits of grayscale, and I believe modifying the GPU registers multiple times
per frame, while it's drawing, is another relatively common trick.

You can look at some of the GameBoy demos from the demoscene to get an idea of
what others have been able to get from the hardware:

[http://www.pouet.net/prodlist.php?platform%5B%5D=Gameboy&pag...](http://www.pouet.net/prodlist.php?platform%5B%5D=Gameboy&page=1)

~~~
simias
One very common effect is to change the x offset of the background mid-frame
to create parallax effects. The introduction to Link's Awakening does that for
instance:
[https://youtu.be/qoj8F0ymwpI?t=23s](https://youtu.be/qoj8F0ymwpI?t=23s)

It looks like you have multiple layers in the background moving at different
speeds but of course on the GB you only have one background layer so it's just
the game modifying the offset when it reaches certain lines.

To help with that the console lets you configure an interruption when the GPU
reaches a certain line so you don't have to poll the line register or use an
external timer.

~~~
digi_owl
Showing that the design of the GB dates back to the time of the NES and C64.
The tight coupling between the CPU and the CRT beam meant that you had similar
interrupts there.

And as those systems supported color displays (in a limited fashion), it was
used for things like swapping palettes mid draw.

While it takes whole different level of effort to do so, it is quite
impressive what can be done on limited hardware when one do not have multiple
layers of abstractions on top.

~~~
tinus_hn
Just about every architecture works like this because ultimately to drive a
screen you need to send display data down the wire in order.

Modern systems are so capable that using raster interrupts wouldn’t add
anything but if you change the display without Vsync you can see that it still
works by scanning lines.

~~~
digi_owl
These days i would have thought that a LCD or OLED screen would have been able
to handle directly addressing each pixel.

the reason for the CRT requiring the data "serially" was the electron beam
that refreshed the phosphor.

~~~
simias
All the (uncompressed) video protocols still work like in the good old time of
CRTs, you have the notion of horizontal and vertical blanking. Image is sent
top to bottom, left to right (well, progressive video is, but let's not get
into interlacing).

Actually in many protocols you _have_ to keep the blanking periods because
people crammed tons of things in them over the years (audio, subtitles,
timecode, remote control protocols, various metadata...).

Having random access to the pixels would be beneficial if you only wanted to
only update specific portions of the screen but you have to know which parts
of the screen have to be updated (either by diffing each frame with the
previous or by being tightly coupled with the drawing code and know which
parts have been updated). However in very dynamic content like movies or video
games you'll often end up having the entire screen changing at once so you'll
have to be able to support that anyway and the additional complexity of
optimizing for the simpler cases is probably not worth it.

------
TD-Linux
I really like Game Boy development - one nice thing is that its graphics
hardware is more regular in comparison to e.g. the NES, and its sound hw is
legendary. Also fun is the DS, which although being far newer still retains
the tile-and-sprite graphics hardware. Flash cartridges are also plentiful.

It seems to be the season of homebrew - Tobu Tobu Girl is another Game Boy
game on a physical cartridge to come out this month, with full source code
(also using GBDK)
[http://tangramgames.dk/tobutobugirl/](http://tangramgames.dk/tobutobugirl/)

------
mmjaa
We get new games for old computers often, and in my particular case I'm a huge
fan of the Oric-1/Atmos sytems from the 80's. These are similar in many ways
to the Gameboy architecture, but were far more user-dependent in that there
was never any good software for them. (Well, not enough, anyway.)

But the machines live on and many elite developers are quite fond of them, so
lately, every few months or so, we get new stuff for the Oric-1/Atmos systems.
The latest game that blows everyones minds (because who knew you could do it
on Oric), is Blakes7:

[http://www.defence-
force.org/index.php?page=games&game=blake...](http://www.defence-
force.org/index.php?page=games&game=blakes7)

Its quite an achievement as a point 'n click adventure and there is much to
the 8-bit aesthetic in this game that would appeal to those who came here for
the Gameboy look.

Remember kids, old machines never die - their users do!

(More great Oric games here:)

[http://www.defence-force.org/index.php?page=games](http://www.defence-
force.org/index.php?page=games)

(.. and here:)

[http://oric.org/software/](http://oric.org/software/)

~~~
tluyben2
Wow, thanks for Blakes7. I love the series and old computers (I have an Oric
somewhere) but did not know this game. Orac on Oric...

Wish someone with a brain would redo the series though; even though the
effects are dated, the series drips misery more than what goes for dystopian
these days imho.

~~~
mmjaa
I strongly urge you to dig out your old Oric and get Blakes7 running on it,
you won't believe how great it is .. these machines still get a lot of love,
so I hope I'll see you out there on oric.org and/or forums.defence-force.org
if you get the druthers .. Cheers and happy hacking!

~~~
memsom
I had an Oric Atmos at one point. I got it in the late 80's as I always loved
the look of the Oric computers and (ahead of my time) collected retro
computers at that point. I sold it sometime in the Noughties, but I keep
thinking to get another one.

~~~
mmjaa
They're delightfully interesting machines, in that they really didn't get the
chance to shine back in the day .. but now we have emulators and disk drives,
and all kinds of weird and wonderful stuff.

The guys at Defence Force are making a dual-Oric: two Orics' chained together
to combine graphics and audio capabilities .. if you get the druthers, follow
the progress here:

[http://forum.defence-
force.org/viewtopic.php?f=8&t=1771](http://forum.defence-
force.org/viewtopic.php?f=8&t=1771)

(tl;dr, two Orics are wired up, they're gonna work in sync to build a hi-res
image .. yay!)

------
gciruelos
i have been writing a gameboy emulator for the last year (with short bursts of
work where i implement some module), and it's been very challanging and fun, i
recommend everyone to try it.

it has a very simple 8-bit (risc) architecture, but obviously tailored for
games (for example, it has a dedicated sprite memory sector). i recommend
people to try it out because it is has fun quirks compared with "regular"
architectures, like arm and x86, for example in the way it handles cartridges,
or in that some cartridges actually had non-trivial logic inside them and
weren't just a rom.

it always amazes me how active gameboy research and development is still
today, for example there's a very recent gameboy emulator / research project
done in rust [https://github.com/Gekkio/mooneye-
gb](https://github.com/Gekkio/mooneye-gb)

there are even test roms with which you can test your emulator to see if it
implements all opcodes, interrupts and whatnot correctly (where correctly not
only means "with respect to the effects" but also with respect to how many
cycles everything should take). example of these test roms:
[http://gbdev.gg8.se/files/roms/blargg-gb-
tests/](http://gbdev.gg8.se/files/roms/blargg-gb-tests/)

also for example this disasm of pokemon red:
[https://github.com/pret/pokered](https://github.com/pret/pokered)

if you want to write an emulator or a game and you have basic computer
organization knowledge, i'd start with the famous pandocs.

~~~
wolfgke
> it has a very simple 8-bit (risc) architecture

The 8080/Z80 variant that is used in the Game Boy is not a RISC architecture -
it is a processor architecture from a time long before the term "RISC" was
even used the first time.

While the terms RISC/CISC are defined somewhat vaguely, there are still some
common properties of architectures that are considered RISC:

\- Load-store architecture:

Counterexample: ADD A,(HL)

\- Lots of general purpose registers:

The 8080 has rather few:

B,C,D,E,H,L,A as 8 bit registers and BC,DE,HL,SP as 16 bit registers

\- Very orthogonal instruction set:

Counterexample: AND has always destination A

\- Often pipelined architecture (though this is not very specific to RISC)

\- Instructions typically aim to be run in one cycle (when pipelined)

Counterexample: Look at the instruction timing tables

\- very uniform instruction format

Look at the instruction encoding

~~~
userbinator
_\- very uniform instruction format

Look at the instruction encoding_

The instruction encoding is quite regular -- it follows the 2-3-3 pattern that
came from the 8008 (if not earlier), and thus looks much better in octal than
hex:

[http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html](http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html)

[http://www.z80.info/decoding.htm](http://www.z80.info/decoding.htm)

As for everything else, I would agree with you --- it's not RISC.

~~~
wolfgke
> The instruction encoding is quite regular -- it follows the 2-3-3 pattern
> that came from the 8008 (if not earlier)

While it is true (and I am aware of it) that the Z80 instructions follow the
2-3-3 pattern, it is nevertheless not _that_ regular. Best look at the "purest
example" for this that is referred in the literature all the time and acted as
a model for the criterion that in RISC the instruction format is very regular:
the instruction format(s) used by MIPS. Here there only exist 3 different
types of instruction (R-type, I-type and J-type) and all have a very regular
pattern. One can find very suggestive pictures at

>
> [http://homepage.divms.uiowa.edu/~ghosh/1-24-06.pdf](http://homepage.divms.uiowa.edu/~ghosh/1-24-06.pdf)

------
stevenwoo
There were programmable cartridges in the 90's but IIRC Nintendo sued them all
out of business, even the ones from Hong Kong. Did Nintendo lose interest in
them after they stopped releasing new cartridges on those platforms? I didn't
keep up after we cancelled the cartridge project I was working on at the time.

~~~
jsheard
Nintendo still takes action against DS and 3DS flashcart resellers where they
can, so you usually have to import them directly from China.

They don't seem to care about NES/SNES/N64/GB/GBA flashcarts anymore however,
those are readily available from NA and EU based stores.

~~~
jasonkostempski
Do they actually have a case against flashcarts or are they just bullying them
into submission?

~~~
jsheard
The courts are on Nintendo's side here in the UK at least:

[http://www.nintendolife.com/news/2010/01/british_r4_card_imp...](http://www.nintendolife.com/news/2010/01/british_r4_card_importer_shipping_off_to_prison)

[http://www.nintendolife.com/news/2010/07/high_court_outlaws_...](http://www.nintendolife.com/news/2010/07/high_court_outlaws_flash_carts_in_uk)

I assume the DMCA anti-circumvention rules let them make a similar argument in
the US.

~~~
jasonkostempski
That's nuts. I'm sure if the DMCA covered it, there'd be cases on record of it
happening (too lazy to search). I have no doubt there's a cases for selling
counterfeit games but to outlaw the possession of the cart itself is
ridiculous. A 1 year sentence is even more ridiculous.

> the judge argued that "the mere fact that the device can be used for a non-
> infringing purpose is not a defence."

That judge is unfit to be a judge.

------
mhd
It's always interesting when retro game dev is delivered on actual hardware
(disks, cassettes, modules). The recently featured RTS by the "8 bit guy" even
comes in a box.

On the other hand, while I appreciate this voluntary hardship (a bit like
esoteric languages), I guess you get about 90% of the "engendering art with
constraints" with a lot less pain by using something like PICO-8.

------
wheresmyusern
im currently doing something similar but with the ps2. it really amazes me
that there are so few people interested in picking apart the ps2 and its
games, and so few people interested in writing demos and games for the ps2.
this lack of interest means that finding good documentation has been a little
hard, but recently i hit a goldmine with official sony documentation on many
of the important processors and coprocessors of the ps2 and it has been
fascinating to read them. messing around with old game consoles is definitely
a lot of fun.

~~~
wingerlang
Why would people be interested in it when you can build for modern systems? I
get the nostalgia factor, but other than that?

Maybe you should document it, then make it easily accessible so that people
have minimal friction getting started.

~~~
Hendrikto
That‘s a bad argument, as Game Boys are even older and more limited, yet there
is still very active development going on.

~~~
simias
I think there's a sweet spot for these things. Very old consoles are very
limited but also pretty simple. You could get an overview of all the basic
capabilities of a GameBoy in half an hour. As such they're easier to get
started, playing a sound on a GB from scratch would take you a dozen CPU
instructions at most, pushing a sprite into the GPU only slightly more.

Doing that on a PlayStation 1 would be already significantly more complicated.
Even if you don't bother with 3D you need to figure out how to upload the
texture to the (significantly more complex) GPU, configure a bunch of stuff
and then you might be lucky enough to draw something on the screen. Take for
instance this code for a "virtual terminal" on the PS1 GPU, this is what the
GPU init code looks like: [https://github.com/simias/psx-hardware-
tests/blob/a72e0ba0c8...](https://github.com/simias/psx-hardware-
tests/blob/a72e0ba0c8d577792cf65ae449bc39e461ebc815/libpsx/term.c#L138-L174)

And keep in mind that it's a super simplistic case, for anything more serious
you'll want to configure double buffering, DMA, the GTE coprocessor for the 3D
transforms and probably a few other things. Even just reading data from the
CD-ROM is significantly more complex than accessing the memory mapped ROM of
the GB.

I expect the PS2 to be even more complicated, although I don't have a
significant experience coding on it. So you end up coding on a machine that's
very limited by modern standards but at the same time might be more
complicated to develop for than if you used Unity or the Unreal Engine.

~~~
zokier
I feel like this hits the nail. In addition to the complexity, there is also
the thing that ps2 is comparatively similar to basic PC development, whereas
8/16 bitters have a very distinct different feeling.

2D pixel graphics arguably have aged better than early 3d graphics, and simple
pixel graphics is also far more doable for a solo dev (or a very small team)
than complex 3d scenes.

~~~
wolfgke
> 2D pixel graphics arguably have aged better than early 3d graphics, and
> simple pixel graphics is also far more doable for a solo dev (or a very
> small team) than complex 3d scenes.

I often ask whether part of the reason for this is also that the (graphics)
tooling for 2D pixel graphics is better than for 3D graphics.

~~~
zokier
Of course this comes back to the complexity. Creating a very basic pixel art
editor is essentially a weekend project. A 3d editor not so much.

------
bArray
Does anyone know where one might find modern made buy-able Game Boy games? I
have an old working Game Boy Color knocking around and would love to purchase
some modern games for it!

------
Operyl
This game really reminds me of Doodle Jump, very cool that he finished one of
his life goals.

------
pjmlp
This is why my one of my hobby coding is using the NDK on Android, although we
are carry a supercomputer in our pockets, I get some of that nostalgia feeling
back.

I guess a better experience would be to plug an ESP32 to a LCD screen. :)

~~~
jmiller099
you can even do console on android with aide. was doing recently. paused while
I switched to porting some console stuff to jailbroken iPad. running those
over ssh. great nostalgia running nurses Dr Mario in a terminal. pointless,
but enjoyable.

------
stevewillows
well, this is amazing. I was especially impressed with reusing tiles for the
main screen image.

I'm a graphic designer and definitely not a coder for anything fun like this
--- but I love seeing how people design low res sprites more than almost any
other type of image. I think it speaks to my desire for minimalism, in a
sense.

Fantastic work. That game looks pretty fun too.

------
santaclaus
It is interesting to see which systems get thriving home-brew communities.
Anecdotally I see a lot of posts about Game Boy hacking, but nothing about
Sega Game Gear hacking.

~~~
ashleyn
The 16-bit generation is the inverse. The Sega Genesis has an AMAZING homebrew
community thanks to a C-language dev kit that makes writing games remarkably
easy. The SNES has almost nothing, save for a wiki and secondary board on
Nesdev.

~~~
T-hawk
Could this be that the SNES hackers are modifying existing games instead?
There's all sorts of fan hacks and remakes of Super Mario World, Super
Metroid, Zelda, Final Fantasy, Mario Kart, Castlevania, and more. But the
Genesis doesn't have quite so many memorable franchises beyond Sonic so that's
where the homebrewers are making new stuff.

------
mesozoic
Quite the hot new game for the Game Child!

------
rootsudo
>$15 to create homebrew GB

I wonder how much would it be to forge valuable gameboy games.

~~~
kn0where
There are tons of counterfeit Pokemon cartridges on eBay and elsewhere.

