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 > Porting C to GBA.

#89307 - bobert111 - Sat Jun 24, 2006 3:19 am

Is there any easy way to port C code to the gba? I am interested in porting Ruby to the gameboy after I saw that Python had been ported to the DS. I prefer Ruby so I thought about porting it. So can anyone point me in the right direction? You can find the source at http://www.ruby-lang.org/en/20020102.html

#89337 - keldon - Sat Jun 24, 2006 9:57 am

How well can your program? The main devkit for the gba is c/c++.

#89357 - tepples - Sat Jun 24, 2006 2:31 pm

But can the Ruby runtime fit in the 256 KB of EWRAM + 32 KB of IWRAM + the 80 KB of the 96 KB of VRAM that a simple text display does not use?

EDIT: corrected memory sizes
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.


Last edited by tepples on Fri Sep 22, 2006 9:41 pm; edited 1 time in total

#89431 - Dwedit - Sat Jun 24, 2006 10:18 pm

Don't forget that a cartridge provides 32MB of ROM, and 64k of sram. Some cartridges even contain 32MB of usable RAM.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#103521 - madmax - Fri Sep 22, 2006 4:40 pm

Hi guys

Tepples is your statment about memory sizes right ? I was under the impression you have less IWRAM than EWRAM. I see lots of programs trying to push nearly everything onto EWRAM because there worried about running out of IWRAM.

Anyway just thought I'd point that out
_________________
John Noon

#103530 - DiscoStew - Fri Sep 22, 2006 5:33 pm

Yeah, he meant the other way around.
_________________
DS - It's all about DiscoStew

#103578 - tepples - Fri Sep 22, 2006 9:43 pm

Dwedit wrote:
Don't forget that a cartridge provides 32MB of ROM, and 64k of sram. Some cartridges even contain 32MB of usable RAM.

Don't forget that all that a lot of people have is a GBA Movie Player, and that you succeeded in your heroic attempt to get emulators working on it. But don't forget that the technique you used, a swap file on flash memory, is good only for read-only access, and a lot of programs have more than 256 KB of mutable state.

Don't forget that most C compilers don't understand the quirks of the GBA memory controller that require different write sizes in different address spaces. For example, 8-bit writes to 0x05000000 through 0x0DFFFFFF don't work properly, and 16-bit or 32-bit writes to 0x0E000000 through 0x0E00FFFF don't work properly.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.