gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Writing GBA registers in 32-bit

#177859 - Bregalad - Tue Apr 09, 2013 2:33 pm

Apparently the GBA registers are "offcially" 16-bit.

But when you write to 2 consecutive regs wouldn't it be more efficient to do a signle 32-bit write ? Apparently, the libgba have no provisions for this.

#177860 - Dwedit - Tue Apr 09, 2013 2:39 pm

Libgba might not provide it, but you can do *((vu32*)SOME_REGISTER) = value.

Also, individual register writes aren't usually a bottleneck or choke point. The biggest chokepoint is how fast your memset/memcpy routine is, and newlib still doesn't compile to a very good routine on ARM.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#177861 - Bregalad - Tue Apr 09, 2013 9:25 pm

Sorry but I what is a bottleneck or choke point ?

Regardless I just wanted to be sure it's ok to do 32-bit writes as well.

#177862 - Dwedit - Tue Apr 09, 2013 9:44 pm

Bottleneck or choke point: Something in the code that makes it run slowly. Like how a bottle would pour much faster if there wasn't a small hole at the end.

Small things like Register Writes that are run once infrequently generally aren't worth optimizing.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."