
Gameboy Advance Development by Example: Drawing and Moving Sprites - khalladay
http://kylehalladay.com/blog/tutorial/2017/04/04/GBA-By-Example-2.html
======
Jach
Every time I read about GBA internals I'm still amazed something like Super
Monkey Ball Jr
([https://www.youtube.com/watch?v=K-AZQKTlUMs](https://www.youtube.com/watch?v=K-AZQKTlUMs))
could have been created on that platform...

~~~
glaberficken
would love to read a technical making-of of one of these games that pushed the
boundaries of their respective target platforms. Anyone got any suggestions?

------
juliangoldsmith
I have one nitpick here:

>I’m using 32 bit integers to store tile data because the GBA is a 32 bit
machine at heart, and I’ve found a couple places online that talk about how
much faster the GBA hardware is at working with 32 bit integers vs 16 bit ones
when possible. Since I have no way of verifying this right now (no timers
yet!), this is also a matter of faith for the moment.

This is true if you're doing calculations. However, memcpy works in bytes
(logically, anyway) so it wouldn't make any difference for tile data. Storing
tile data as ints would complicate things if you ever want to modify any of
your tiles.

Nitpicking aside, this is an excellent tutorial. The simplicity of the code
makes it easy to understand.

~~~
roblabla
IDK anything about GBA dev. But on x86_64, memcpy is traditionally implemented
by copying 64-bit data until len / 8 == 0, and then copying the remaining
bytes[0]. I suppose this is faster because accessing data with the proper cpu
alignment is faster.

0:
[https://github.com/lattera/glibc/blob/master/string/memcpy.c...](https://github.com/lattera/glibc/blob/master/string/memcpy.c#L39)

~~~
pmalynin
I'd contend that the in this day and age the most space efficient and fast way
to implement memcpy on x86_64 is to "rep movsb", which triggers internal
memcpy on the CPU anyway as per Intel® 64 and IA-32 Architectures Software
Developer’s Manual, Volume 1 Section 7.3.9.3

~~~
monocasa
Last time I checked, the movs variants were microcoded slow path; you used SSE
to get the fastest memcpy.

------
gravypod
Has anyone written a Unix-like OS that runs in a GBA? Maybe you could even
build a cartidge with IO (keyboard support) and a simple com port for
networking.

~~~
ginko
Yeah, there was this:
[http://www.kernelthread.com/publications/gbaunix/](http://www.kernelthread.com/publications/gbaunix/)

It's of course severely limited due to the small amount of memory and lack of
an MMU.

------
_sbrk
Enjoyable to see the youngsters discovering MOBs all over again. :-)

[https://www.c64-wiki.com/wiki/Sprite](https://www.c64-wiki.com/wiki/Sprite)

------
namero999
Nice. I have a GBA Micro and a development cartridge taking dust in a box, I
might very well jump into this. Do you have a tutorial where you explain how
to set up the development environment? Anyway I skimmed your tutorial here and
it looks clear and fun!

~~~
juliangoldsmith
I think the Tonc tutorials, which are linked to in the articles, go through
all that.

------
and0
Cool to see the follow-up based on feedback so quickly.

~~~
khalladay
Thanks! I think the feedback that I got last week on here was very good.
Despite my initial desire to stick with the bitmap modes and try some 3Dish
stuff, it really didn't make sense to try to learn new hardware by ignoring
the most common use case.

