Gameboy Advance development by example: Drawing and Moving Rectangles
kylehalladay.com
kylehalladay.com
These machines are small enough to fit in your head when you're developing, and you really learn to get 'down to the metal' when your builtin libraries are memory addresses and ranges. The development is fast and fun.
I totally recommend checking it out and making a couple of games on something like the Gameboy or Gameboy advance. An excellent learning experience.
The hard part back then was finding examples generally, but that's also the fun part in that you read all the specs for the machine you can find and let your imagination run wild. Assembly is kind of like that and the machines are small enough that, with enough background knowledge, they can be made to do some pretty interesting things.
Like learning anything, just read the every doc you can find and write code is the best advice to get started :)
Most of the time the course doesn't cover the more advanced features (mode 0? or was it 4, or 6 that did sprites and textures) but it was a fun introduction to something, and I got to write flappy bird in C when flappy bird was still culturally relevant.
I actually have a bit of half-finished GB code that does sprites and backgrounds, without using libraries. If anyone cares for it, I can put it up on Github later.
I'll most likely clean up the sources and put them up on Github later.
I ran into that same problem with a few games I wrote for the PSP[1,2] in high school. I did all the rendering by drawing color values directly to the framebuffer. Quickly all of your CPU time per frame is taken up by drawing pixels and you have no time for game logic. This doomed my projects to small scale, and I didn't have the interest in learning actual PSP hardware programming and rewriting the rendering to use it.
[1] http://brightnightgames.com/games.php?game=dyox [2] http://brightnightgames.com/games.php?game=abahd
I know about the sprite system in abstract, but I haven't tinkered with it yet (nor do I know enough to start tinkering with it yet). I'm still trying to decide whether I want to go down that route or build a ray casting engine / do some 3D stuff, since most of my other work is 3D related.
Regardless, this post was meant more to cater to the "I know nothing and want to feel like I'm making progress in 15 minutes" crowd.
Mario Kart-style faux 3D's much more doable on the platform; those games use sprites (for characters and objects that aren't flush with the ground) combined with a tilemapped background that's scaled and rotated per-scanline to look 3D.
Alternatively, if you're more interested in 3D, you might switch over to the Nintendo DS-- it's essentially the same hardware and programming model as the GBA, but with hardware accelerated 3D.
I'm one of the coders of a number of 3D GBA demos [0] (and there's much better works on Pouet.net still). My teammate Jacob coded the 3D renderer and a lot of sweat went into it, but the result is pretty decent IMO.
Unlike some other GBA demos out there, this one doesn't contain any precalculation to speak of, which means that all of this could've be interactive as well and run at similar framerates. That said, most scenes are pretty damn lowpoly so the game design space is limited. But hey, limits are fun!
[0] capture of our best GBA work "Unibrau" https://www.youtube.com/watch?v=v2FjuF7l1Mk
The track was purpose-composed for this demo though, and we did have quite some fun times synchronizing the visuals to the track. We used a tool called GNU Rocket[0] to change parameters over time (eg camera position, angles, anything we'd want to animate) but it's a desktop program. So we patched Visual Boy Advance to write all parameters to some piece of uninitialized RAM on every frame, and then inside the demo we just dereferenced a hardcoded pointer to that place. No access violations in GBA land so this worked :-)
Then, when we compiled the demo for release, we simply recorded a stream of parameters, again 60x per second, as a binary blob. No compression no structure no nothing. Just on the nth frame we'd look up camerapositions[n] and that was it :)
(we were on a bit of a deadline)
For the background, there are two layers -- the 2 pattern tables are 256 8x8 tile images each using 2 bpp color. The name tables are what is actually displayed. Each tile in the background is an index into one of the pattern tables. (Determined by a global selection bit).
However, in some cartridges, the pattern tables are mapped to RAM. This lets the game simulate drawing into the framebuffer directly. Some games use this for drawing variable width fonts, for example. Battletoads does some cool parallax effects. It turns out that the pattern tables have just enough bits to fill the whole screen with a monochrome image, so you could treat it as a framebuffer (it requires timing changes to midframe, though). I created a demo for that http://forums.nesdev.com/viewtopic.php?f=22&t=14884
On the NES, the PPU would render a bunch of scanlines, and then during the vertical blanking interval, would trigger an interrupt on the CPU telling it to make whatever changes it needs to the graphical memory through a particular port. However, the CPU is still running while the PPU is rendering things, so it's possible to modify the graphics memory during rendering to pull some interesting tricks.
On the SNES, you could do the same (but now faster, with more memory, with Mode 7, with variable size sprites iirc) but on top of that, you could use external coprocessors as part of the cartridge to extend the existing hardware, like the Super FX or Cx4 to name a couple. With these, you could draw actual realtime 3D graphics to the screen.
So in a sense, on the SNES, you could provide a chip that would have direct access to the renderer. It was just never directly controlled from code on the main processor.
The hardware itself doesn't even contain a framebuffer; calculating palette effects and compositing the background and sprite layers into a final image is done by the hardware in realtime, 1 pixel at a time, and fed to the video output pin.
However, many game cartridges actually had RAM to store their graphic tiles in, rather than a set group of tiles in ROM. Graphics would be stored within the program code and transferred byte-by-byte into the PPU's (Picture Processing Unit, aka the GPU's) memory space. Legend of Zelda worked this way, along with a lot of other well-known games. Look at Elite for an example of the NES emulating a framebuffer using that method to render 3D polygons: https://www.youtube.com/watch?v=zoBIOi00sEI
[0] The background has 4 screens worth of area in a 2x2 screen grid, and increments addresses during rendering to simulate a toroidal memory space, allowing for smooth scrolling. This is a (perhaps overly) simplified explanation; things are slightly more complicated.
It is worth noting that to do anything serious on the GBA you need to use the tile+sprite modes for graphics. That is really the way to get decent performance.
The way it done in the article is still a good way to start out but you would probably transistion quickly to some other video mode.
Having a flashcart and running your homemade program on a real GBA is a really nice experience. I totally recommend it.
Nintendo seems to have relaxed the entry barriers to developing for their systems.
https://pyra-handheld.com/boards/pages/pandora/
Game kits sold by ic0nstrux?
http://www.ic0nstrux.com/game-console-starter-kit-2.0-self-s...
Failing that, you can always just grab an Android phone and convert it into an handheld.
The harsh limitations of pico-8 are carefully chosen to be fun to work with,
encourage small but expressive designs give pico-8 cartridges their own
particular look and feel.
It's entirely open-software and open-hardware, and it's focused on 2D indie gaming. It even has breakout pins.(But still not as great as my Pandora..)
http://www.thingiverse.com/search?q=pocketchip
Find one you like! :) I chose this:
http://www.thingiverse.com/thing:1998427
Read this amazing thread:
https://bbs.nextthing.co/t/case-mod-customisation-decoration...
(It gets better towards the end..)
I tried ordering one before but the 3D printer operator said the design was unprintable.
Does it make the device easier to use? Is it comfortable to type and play on now?
Anyway, good luck! :)
PICO-8 is available for desktop platforms as well, it is not open-source, and there's a 3D version as well, called the Voxatron.
Both are really cool projects, but not open-source software.
Voxatron is a game (even though you can make expansions on the engine), and predates PICO-8
http://www.lexaloffle.com/bbs/?tid=28325
You can run PICO8 carts in Voxatron now. :)
So actually, such a thing has existed for a long time and has gone through a lot of iterations.
Have a look at this amazing repository of apps for the Pandora, for example of how vibrant and alive this scene is:
EDIT: And one more detail, the amazing scene behind the Pyra/Pandora handhelds: https://pyra-handheld.com/boards/
For years I followed the Open Pandora without knowing what Pandora (music) was. I remember being a little annoyed I couldn't just search "Pandora" without getting a bunch of results for "some music thing". I still don't really get what happened with the Pandora, the release history was long and complicated iirc
The manufacturing delays, the issues with the case .. the volcano! (Seriously, the project was delayed by the Iceland volcano in 2010 ..) The issues with the original team splitting up, and so on .. well, it still bloody shipped! And its an excellent device!
And the best part is that all those lessons were learned, and applied, to the new Pyra - which is the spiritual successor to the Pandora in many ways. I was lucky enough to have a Pyra prototype to play with a few months back, and its going to be a very special device for a lot of folks - open, accessible, hackable. A truly delightful Linux workstation! :)
https://www.newegg.com/Product/Product.aspx?Item=9SIA3525789...
GPD Win Game Console is the World's First 5.5 Inch Handheld PC / Gaming Console Based on Windows 10 System. Equipped with a 5.5 inch capacitive touch display that supports 1280 x 720 pixels. Powered by Intel Atom X7 Z8700 64 bits Quad Core 1.6GHz(up to 2.4GHz) processor, and 16 units Intel HD Graphics. Besides, it has larger storage (4GB RAM and 64GB ROM) for your using, all features provide you wonderful gaming and using experience.
Open source has its place, but you're asking for someone to selflessly give their entire life so you can "play" in a sandbox - and in 2D instead of 3D, as if that's viable anymore. Give me a break. If it's so easy, do it yourself.
They're asking for a million dollars or more to be invested by someone else, simply to be able to fool around with it. The very concept screams not understanding how much time and money it takes to produce such hardware and matching software. We're not talking about $5,000 and one month of development time from some indie developer; we're talking about more than $1 million and 2-3 years of development time from a serious shop... all for free and as open source? Not going to happen.
I can accept a million dollars but I did it for free (in fact for a cost. Of course you can say it's bad, or not a really "modern" in the sense of "powerful" but in the sense of "available with somewhat current plugs" and I was happy to see the GP comment, as in : there are other interested people, fine !
As I'm not the only one, I don't understand your angry comment.
Has happened: GP32, GP2X, GPH WIZ, CAANNOO, Open Pandora .. Pyra .. PocketCHIP.
There is a lot for you to catch up on. These are open machines, made by people who are quite content with contributing a great deal to the Open Source ethos you seem to think has no place in this market ..
If you're going to rage at things that aren't even there, at least try to not make yourself look like an idiot in the process.
> They're asking for a million dollars or more to be invested by someone else, simply to be able to fool around with it.
And they're presumably willing to pay some amount of money for the opportunity to do so. The groups that have successfully designed, built, and sold open gaming handhelds in the past (and present, actually) seem like good proof that a product like that is something that a lot of people want and are willing to pay for.
> all for free and as open source? Not going to happen.
"Free" as in "gratis"? Maybe for the software, especially if it's built as a hardware-specific SDK, on top of already-available open libraries, like SDL. I'd expect to pay for the hardware, and pay more than something that's subsidized by the subsequent game purchases (like Sony or Nintendo hardware).
The Open Pandora is a great little games machine, has decent 3D capabilities, and its successor - the Dragonbox Pyra - is going to be even more superb. Calm down a little, and take a look:
https://pyra-handheld.com/boards/pages/pyra/
(I'm a very content owner of two Open Pandora devices.. fantastic little machines, and I hope we see more like them in the years to come.)
See http://bitboxconsole.tk / https://github.com/makapuf/bitbox
Not handheld but plugging a SPI TFT screen would be simple.
I'd create something using raycasting and prerendered billboards if 3d was a mush.