Coranac hosts TONC, a Game Boy Advance programming tutorial, plus articles on ARM assembly, fixed-point math, and graphics.
HN commenters praise TONC as a great software project with excellent documentation, and recommend its Mode 7 pages for old-school GBA programming.
if you want to understand chip architectures, work through the elements of computing systems (aka nand to tetris). it walks you through implementing your own cpu, gate by gate, plus an operating system, compiler, and tetris game, in a way tested to successfully fit inside of a single-semester undergraduate class. their hardware designs are pretty weird (their hdl looks nothing like any hdl you can actually synthesize hardware from, their descriptions of how gates work are oversimplified, and their instruction set architecture is pretty similar to the eclipse that kidder was writing about but completely unlike any current design) but that isn't really important
after completing the work in that book and raising investment capital for your company, you can honestly call yourself a fullstack engineer
— arm —
the best architecture to write assembly for is the arm—the original one, not thumb, which is a bit of a pain—and arm is also only slightly more complex to build than the fake-ass architecture in nand2tetris, and quite a bit faster. if you already know any assembly language, including the nand2tetris one, the best introduction to arm might not actually be any current tutorial but rather the vlsi arm3 datasheet from 01990 https://www.chiark.greenend.org.uk/~theom/riscos/docs/ARM3-datasheet_ARM-Family-Data-Manual-VLSI.pdf which has a summary of the instruction set on p.1-7 (9/56) and a fully complete description on pp.3-12 to 3-43 (19/56 to 34/56)
as you probably know,…
If you're interested in programming Gameboy Advance games:
While in college, one intro course on lower-level computer programming had a few projects for programming for a Gameboy Advance emulator. This site was heavily used for reference and guidance: http://www.coranac.com/tonc/text/toc.htm
Also, here are some materials (from the course) and even examples of created projects:
_
Related Course Materials
1. Main Reference: http://www.coranac.com/tonc/text/toc.htm
2. GBA Installation: https://github.com/nuppan/Georgia-Tech/tree/master/2nd%20Year/CS%202110/Linux%20Assignments/CS2110/GBA%20Installation
2. Another site: http://www.loirak.com/gameboy/gbatutor.php
_
Projects
1. "Duckhunt" - https://github.com/jabelman/duck_hunt-gba
2. "Pacman" - https://github.com/zjhzyyk/gba-pacman
3. Video of "The Snuggler" - https://www.youtube.com/watch?v=wxnEY3RRPp4
4. Video of "Samurai Jack" - https://www.youtube.com/watch?v=fgIeKCxAfSk
Practice. A lot.
A good start is actually the ARM processor; since it's a RISC instruction set, it's quite simple.
I've done lots of assembly in my ugrad days, even writing a Motorola HC11 micro-controller emulator, but ARM would be a much better choice right now.
I found the "Tonic: Whirlwind Tour of Assembly" [1] site invaluable to get me started for SnappyCam, as it covers a lot of the ARM ISA.
For iOS-related assembly, I'd recommend [2].
And for a taste of ARM NEON SIMD, have a look at [3]. The one thing that "clicked" for me on SIMD is that you should look at each register "lane" as trying to unroll a loop. I initially dived in thinking I'd just make a sequential algorithm parallel, which is often too difficult to arrange.
[1] http://www.coranac.com/tonc/text/asm.htm
[2] http://www.shervinemami.info/armAssembly.html
[3] http://hilbert-space.de/?p=22
You are definitely right. Tonc has some interesting data (here: http://www.coranac.com/tonc/text/text.htm#tbl-txt-se2) about performance of operations with 16 bit vs 32 bit variables, but none of that information applies to memcpy, and I think I jumped the gun on making as much as possible 32 bit types.
Thanks for catching that! I'll remedy that line later this evening.
Although, evidently ARM chips have an optimized code path for 4 byte aligned data: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka3934.html , I'm not sure if that would apply in this case or not?
No, you can directly rasterize to the screen buffer:
https://www.coranac.com/tonc/text/bitmaps.htm
However, you’re limited to the CPU’s (relatively) mediocre processing power. This is exactly how some of the raycasted game engines were built, though:
https://m.youtube.com/watch?v=eD1RRESSF6Y
And, if you look at open source raycaster engines, they’ll use either Mode 3 or Mode 4, usually with a background enabled:
https://github.com/jduranmaster/GBA-caster/blob/dd62073a4371c143e7e57f789cde38a3abbf362f/gbaRaycaster_ver1.c#L108
This series ends abruptly at Part 2. The author said there would be a Part 3, but I couldn't find anything.
In any case, if you want another overview article on ARM Assembly, try this: http://www.coranac.com/tonc/text/asm.htm
If you want a tutorial: http://thinkingeek.com/2013/01/09/arm-assembler-raspberry-pi-chapter-1/
And finally, this is a pretty good book if you've never looked at Assembly before and you've got a RPi or RPi emulator: http://www.amazon.com/Raspberry-Assembly-Language-RASPBIAN-Beginners/dp/1492135283