Live data from Hacker News

Choosing tools for Game Boy development

gbdev.io

11–20 of 38 posts

Re: Choosing tools for Game Boy development

#11
I wonder if we could have a web based GameBoy editor, like the Pebble had. Just write code on the site and have it compiled and pushed out at the click of a button?

GB Studio seems to have some of that. Maybe just a little more magic to get it there?

Re: Choosing tools for Game Boy development

#13
‘Never use recursive functions’ is one of those stories that comes up in embedded. For automotive work it is one of the SAE’s ground rules.

Since The 1980s, when LISPers decried Microsoft BASIC’s hegemony we were told that recursive functions are a superior answer. They are for some things, but as soon as you start coding in assembly (pure assembly, not a few lines of Assembly to optimize a C program) you start to see stack calling conventions as a problem as much as a solution.

Re: Choosing tools for Game Boy development

#15
post #3

Recently got an EZ Flash Jr to get into playing homebrew gameboy games on my (unmodded) GB pocket from middleschool. Itch.io has more fun GB games than i'll ever have time to play and its felt like a really positive community. https://itch.io/search?q=gameboy Then while bored in a meeting at work I started looking into coding a hello world for it and quickly found my way to some Assembly tutorials which Ive never had…

IMO C for GameBoy dev is a non starter. It's so different from other platforms that you really just want to control the instructions directly. Say you type "a * 5" that would just be one instruction on a regular cpu but it must be some more expensive function on a GameBoy. Even bit shifting can only shift one bit at a time, 1<<8 is 8 instructions. When programming in ASM it's usually that more instructions is slower so for a bit shift it might make sense to have a lut or something, C would hide it behind a single operator.

Re: Choosing tools for Game Boy development

#16

‘Never use recursive functions’ is one of those stories that comes up in embedded. For automotive work it is one of the SAE’s ground rules. Since The 1980s, when LISPers decried Microsoft BASIC’s hegemony we were told that recursive functions are a superior answer. They are for some things, but as soon as you start coding in assembly (pure assembly, not a few lines of Assembly to optimize a C program) you start to se…

It's good to distinguish between general-recursive and tail-recursive functions. Tail-recursive functions can be transformed into code that uses a bounded amount of stack (no more than a single call worth). The latter kind of functions could be used freely on systems where general recursion is forbidden, and sometimes are a clearer or more succinct way to specify the required behavior (and sometimes not)

Some lisp-adjacent languages like clojure use a special syntax for tail-recursive functions[0], so that you document and know at compile time that you don't have a general recursive function.

[0]: https://clojuredocs.org/clojure.core/recur

Re: Choosing tools for Game Boy development

#17
The official Game Boy Programming Manual [0] leaked and is available at the Internet Archive. It's a great resource.

If you're just getting started with assembly and want to look at a short program, my maze generator [1] is available on GitHub with annotated source code.

[0]: https://archive.org/details/GameBoyProgManVer1.1

[1]: https://github.com/svendahlstrand/10-print-game-boy

Re: Choosing tools for Game Boy development

#18
post #12

>>> if you are using VBA or VBA-rr, stop using them right now. These emulators are extremely inaccurate, and also contain severe security flaws thnx for the alert! does this include mgba?

mGBA is great, and actively developed.

mGBA's sound for GB/GBC is still inferior to VBA's. See these comments by the mGBA dev and others: https://www.reddit.com/r/emulation/comments/sdlxz8/so_in_202...

In any case, mGBA has nothing to do with VBA, so there's no reason why that statement would include it.

Personally, I've been using BGB for 10 years or so, and it's been great.

Re: Choosing tools for Game Boy development

#19
post #16

‘Never use recursive functions’ is one of those stories that comes up in embedded. For automotive work it is one of the SAE’s ground rules. Since The 1980s, when LISPers decried Microsoft BASIC’s hegemony we were told that recursive functions are a superior answer. They are for some things, but as soon as you start coding in assembly (pure assembly, not a few lines of Assembly to optimize a C program) you start to se…

It's good to distinguish between general-recursive and tail-recursive functions. Tail-recursive functions can be transformed into code that uses a bounded amount of stack (no more than a single call worth). The latter kind of functions could be used freely on systems where general recursion is forbidden, and sometimes are a clearer or more succinct way to specify the required behavior (and sometimes not) Some lisp-ad…

Tail recursions are just very badly documented while loops. In a while loop it is very clear if you use memory or not, in a tail recursion you have to inspect the code and realize if it is tail recursive or not, and if you do it wrongly you just accidentally used a lot of memory for the stack. And tail recursions doesn't do anything you can't do in a while loop, recursions only power is the power to use the stack, without it they don't add anything.

Re: Choosing tools for Game Boy development

#20
post #5
post #3

Recently got an EZ Flash Jr to get into playing homebrew gameboy games on my (unmodded) GB pocket from middleschool. Itch.io has more fun GB games than i'll ever have time to play and its felt like a really positive community. https://itch.io/search?q=gameboy Then while bored in a meeting at work I started looking into coding a hello world for it and quickly found my way to some Assembly tutorials which Ive never had…

There's a lot of retro dev happening now across the board. SGDK has led to a big interest in making Genesis/Megadrive games. Jo Engine is increasing interest in the Saturn, etc. I'm also attempting to help contribute by writing a book on Neo Geo development (it has a long ways to go) https://github.com/Stephane-D/SGDK https://www.jo-engine.org/ a Saturn homebrew showcase - https://www.youtube.com/watch?v=NqKKExcTaKo…

I just would absolutely love to give a +1 for jo-engine. It’s an insanely strong dev kit for Saturn games with great built in features like tilemap support, basic collision detection; a sprite converter - and a handful of incredible tutorials.

I got started as a developer / programmer at about 10/11 with mostly Assembly due to the burgeoning Sonic ROM hacking community. I’m 32 now and I’ve been a professional developer for 12+ years. I owe this scene a lot!

Post reply on HN