Share This Page

Hi all, I bought 2 3ds XL on Ebay to experiment with homebrew. One is with gateway on firmware 4.1, the other one is with supercard dstwo on firmware 8.
I have a general knowledge of C++ and I'm learning SFML, is it possible to develop something with these tools on the 3ds, I'd like to make a game in C++.
Please let me know what do I need to configure the C++ environment and what are the best solutions to accomplish my goal (a simple game in C++ with visual studio or xcode).
Thank you and keep up the good work

deja vu? I swear, I've already answered this, lol.. Theres no currect way via straight up mset + arm9 vuln.. not sure if its even possible to inject into a ROM or not.. it may be though since people are injecting emulators.

Hi all, I bought 2 3ds XL on Ebay to experiment with homebrew. One is with gateway on firmware 4.1, the other one is with supercard dstwo on firmware 8.
I have a general knowledge of C++ and I'm learning SFML, is it possible to develop something with these tools on the 3ds, I'd like to make a game in C++.
Please let me know what do I need to configure the C++ environment and what are the best solutions to accomplish my goal (a simple game in C++ with visual studio or xcode).
Thank you and keep up the good work

long answer:
you need a c++ compiler, or to build one. but who really wants to build a C++ compiler for 3DS? thats just painful. Sure you could cross compile with GCC or something, but again, things that require any kind of malloc, or an stdout terminal are broken. For example, in just plain C, if i wanted to printf(), that requires that i have a standard output.. well the 3DS doesnt have one.. just has a screen to paint to by writing to RAM.. Also any command that is built using malloc is broken since deep down, that requires a syscall sbrk().. the 3DS doesnt have any syscall that acts like that (as far as I know). When I program for it, it just use stack allocation and write to the RAM to form pixels on the screen and write my own pseudo fuctions.
So sure, we can achieve a similar fake environment where c++ would work, but its a lot of work and hasnt been done yet

long answer:
you need a c++ compiler, or to build one. but who really wants to build a C++ compiler for 3DS? thats just painful. Sure you could cross compile with GCC or something, but again, things that require any kind of malloc, or an stdout terminal are broken. For example, in just plain C, if i wanted to printf(), that requires that i have a standard output.. well the 3DS doesnt have one.. just has a screen to paint to by writing to RAM.. Also any command that is built using malloc is broken since deep down, that requires a syscall sbrk().. the 3DS doesnt have any syscall that acts like that (as far as I know). When I program for it, it just use stack allocation and write to the RAM to form pixels on the screen and write my own pseudo fuctions.
So sure, we can achieve a similar fake environment where c++ would work, but its a lot of work and hasnt been done yet

Linker's work is to set up environment properly. (well that's a job for library writters than normal coders). it's not malloc, calloc , sbrk are break if a new hardware is released, the same vendors should give you a proper g++ (libg in gnu ARM devices) and c compiler (libc in gnu ARM devices) , then a linker (ld in gnu ARM) whose job is to find and allocate symbols from objects and link to generate the executable file.

But linker accepts a linker script file for a reason: to set up stacks, and memory map for your hardware . This is basically then later passed as arguments to libraries such above and correct areas are defined to work with higher level APIs later.

But I have to say I don't like either C++ OOP style programming when static allocation of linear memory, because everything screws up. D: