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.

Coding > What's bios good for?

#26131 - NoMis - Wed Sep 08, 2004 1:16 pm

What's the purpose of bios functions. I lately read a thread about how much overhead the swi instruction actually creates. So reagardless of how fast the bios function is the overhead makes it somewhat useless.
Or does Nintendo maybe have another solution than the swi instruction to call bios functions?

NoMis

#26133 - Lord Graga - Wed Sep 08, 2004 1:19 pm

SWI calls are very useful. They can do all sorts of stuff, and I guess that you would know if you looked a bit further into GBATEK/Cowbite/whatever under the BIOS functions.

#26141 - NoMis - Wed Sep 08, 2004 1:54 pm

Lord Graga wrote:
SWI calls are very useful. They can do all sorts of stuff, and I guess that you would know if you looked a bit further into GBATEK/Cowbite/whatever under the BIOS functions.


Yeah, i know it has much usefull functions, like the affineset stuff and similar.

But I'm refering more to the divide and multiply functions that have absolutly no use with that kind of overhead.

NoMis

#26142 - Lord Graga - Wed Sep 08, 2004 1:57 pm

NoMis wrote:
Lord Graga wrote:
SWI calls are very useful. They can do all sorts of stuff, and I guess that you would know if you looked a bit further into GBATEK/Cowbite/whatever under the BIOS functions.


Yeah, i know it has much usefull functions, like the affineset stuff and similar.

But I'm refering more to the divide and multiply functions that have absolutly no use with that kind of overhead.

NoMis

Well. They are there, they don't take romsize, and they are probably fine for some things, and not good enough for something else. You really can't ask why they are there, because only the Nintendo folks will know, we can only guess.

#26144 - poslundc - Wed Sep 08, 2004 2:47 pm

NoMis wrote:
But I'm refering more to the divide and multiply functions that have absolutly no use with that kind of overhead.


There isn't a multiply function; multiply is supported through hardware. As for the divide, it's faster than GCC's divide operator (on non-constant values) and it provides the remainder (modulus) for free.

Dan.