
Another Game Boy emulator for your terminal - ndrake
https://github.com/dobyrch/termboy-go
======
JonnieCache
The bootrom with the copyrighted material patched out of it is a nice touch.

The gameboy bootrom is an epic thing in itself. Its purpose is to scroll the
nintendo logo, and to check the integrity of the logo data. If the logo is
corrupted, the bootloader crashes.

The logo is read from the game cartridge, so the idea is that unlicensed
developers would be forced to distribute the nintendo logo (with the © next to
it!) in any cartridges they produced, making it easy for nintendo to sue them
into oblivion. Very clever.

Lots of lovely details here:
[https://realboyemulator.wordpress.com/2013/01/03/a-look-
at-t...](https://realboyemulator.wordpress.com/2013/01/03/a-look-at-the-game-
boy-bootstrap-let-the-fun-begin/)

and here:
[http://gbdev.gg8.se/wiki/articles/Gameboy_Bootstrap_ROM](http://gbdev.gg8.se/wiki/articles/Gameboy_Bootstrap_ROM)

~~~
teraflop
The original LEGO Mindstorms did something similar. In order to upload
firmware to the RCX brick (a common operation, since the firmware was stored
in volatile RAM) you had to pass a "copyrighted unlock string" ("Do you byte,
when I knock?") which would be verified by both the interface DLL and the boot
ROM itself.

The intent was apparently to use the copyright on that phrase as a means to
force developers to use the officially sanctioned API. I don't know if that
was ever legally enforceable; it certainly didn't stop hobbyists from plugging
the unlock string into their code.

~~~
monocasa
On the trademark side of things, it's not enforceable. Not sure about the
copyright side.

[http://en.wikipedia.org/wiki/Sega_Enterprises_Ltd._v._Accola...](http://en.wikipedia.org/wiki/Sega_Enterprises_Ltd._v._Accolade,_Inc).

~~~
Jolijn
Working link:
[http://en.wikipedia.org/wiki/Sega_Enterprises_Ltd._v._Accola...](http://en.wikipedia.org/wiki/Sega_Enterprises_Ltd._v._Accolade%2C_Inc%2E)

~~~
monocasa
Thanks, do you know why HN strips the period off of the link?

~~~
peri
HN has a very particular parser because a lot of us have found we'll copy
paste too much too fast if we don't have a weird parser with separate
noprocrast settings from our normal work.

------
kaoD
How are the graphics drawn?

I expected the grayscale pixels to be drawn with some kind of grayscale
characters (like "-=#$"), but judging from the screenshots those are actual
graphics.

Is it messing with the framebuffer, or does it really work with a simple
terminal, like over SSH?

~~~
glhaynes
It's using a console font:

 _Ubuntu users may see the message "Failed to set font height." Term Boy uses
the setfont command to change the font height, which looks for the font
default8x16.psfu in /usr/share/consolefonts. The font can be downloaded from
the Kbd project. Download any of the archives and the font will be located in
data/consolefonts._

~~~
cogburnd02
How is this font able to do graphics like this?

~~~
glhaynes
The original Game Boy display was 160x144 pixels. The font's name implies that
it's made of 8x16 pixel characters. So I'm guessing each glyph in it is used
to represent a unique configuration of 2x4 Game Boy pixels because that'd mean
an 80x36 character terminal, a fairly common terminal size, would fit
perfectly. Since the Game Boy display only has 2-bit color depth (so, 4
colors), that means the font would need 4^8 (65,536) glyphs.

------
ostyn
This is amazing. Raspberry pi here we come.

~~~
SSilver2k2
I just compiled it for the RPI (Model B). Make sure you download and compile
the latest version of GoLang.

It runs so slowly, but it's still awesome.

I'm going to try it on a Pi2 later tonight.

~~~
codezero
There's a more full featured C++ version apparently, maybe that runs faster?

