Homebrew C++, SFML, Homebrew

The Thinker

Member
OP
Newcomer
Joined
Oct 17, 2014
Messages
12
Trophies
0
Age
41
Location
London, United Kingdom
Website
asetgames.altervista.org
XP
77
Country
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 :)
 

Reisyukaku

Onii-sama~
Developer
Joined
Feb 11, 2014
Messages
1,534
Trophies
2
Website
reisyukaku.org
XP
5,422
Country
United States
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.
 

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
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 :)


Hello, so if you wanna write homebrews, you will need use DevKitARM and ctrulib, you can find it here:
devkitpro.org - DevKitARM
https://github.com/smealum/ctrulib/t

There is some examples in the ctrulib folder, if you wanna compile a .3ds, there is some template in Homebrew Developed Thread, you can check it.

Good Luck, we really need peoples on Homebrew 3DS Scene.
 

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
I forgot ctrulib existed, lol.. It still isnt complete, like all the other libraries :x .. it's probably the closest one to usable though.


We just have ctrulib and 3dsbrew documentation to homebrew, belive me, ctrulib is too good to work on homebrews and now have support to GPU, this is so good.
 

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
And what about development tools? What do i need to install?

Hi, C# will not work, how Reisy said: It run on Virtual Machine, we need native code compiled.

Everything you will need is: Install DevKitARM, Get last ctrulib and a good IDE or Text Editor(I personally prefer Sublime Text Editor), here the links ²:

devkitpro.org - DevKitARM
https://github.com/smealum/ctrulib/t

There is a thread here which may help you with it:
http://gbatemp.net/threads/homebrew-development.360646/


Good Luck (:
 

Wabsta

you fight like a dairy farmer
Member
Joined
Apr 25, 2008
Messages
2,495
Trophies
0
Age
32
Location
SCUMM Bar
Website
www.wabsta.com
XP
449
Country
Netherlands
I wouldnt even use C++, honestly.. C works best for me.. Introducing Object Oriented languages into this is asking for trouble, lol

Can you elaborate? I'm building software for microcontrollers using C++ (and its OO functionality) just fine. Why would it bring trouble to NDS or 3DS homebrew?

Not attacking you, just really curious why people say this :)
 

Reisyukaku

Onii-sama~
Developer
Joined
Feb 11, 2014
Messages
1,534
Trophies
2
Website
reisyukaku.org
XP
5,422
Country
United States
short answer:
no one wrote a compiler for it and probably wont.

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
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
Just a strange question: developing homebrew for Nintendo DS involves the use of libnds and C or libnds and C++? Because i've written some DS homebrew and i can't remember which language i used!
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
Country
Chile
short answer:
no one wrote a compiler for it and probably wont.

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


gcc (c compiler) with libc
and
http://developer.mbed.org/users/fra...ocs/bf7b9fba3924/libnosys__gnu_8c_source.html
and
linker file

should give support to sbrk. (which requires _sbrk)

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:
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    Yea is a pain sometimes
  • Psionic Roshambo @ Psionic Roshambo:
    Now that they decided to add Tiger handheld and fruit machines.... Newer sets are worthless
  • Psionic Roshambo @ Psionic Roshambo:
    Because who doesn't want to emulate Halo LCD by Tiger when the machine needed to emulate it... Could just play Halo....
  • K3Nv2 @ K3Nv2:
    Batocera has some tiger games
  • Psionic Roshambo @ Psionic Roshambo:
    I don't have them on mine Ken lol
  • K3Nv2 @ K3Nv2:
    Waste of the 128kb they take
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Tiger handhelds are good for one thing.... Occupying space in a landfill
  • K3Nv2 @ K3Nv2:
    They make good burning plastic
  • BigOnYa @ BigOnYa:
    Makes me wonder if the Pi5 can play PS2? If there's even a core for it yet.
  • K3Nv2 @ K3Nv2:
    Pi5 should be able to do ps2
  • Psionic Roshambo @ Psionic Roshambo:
    Try Dragon Quest VIII it ran perfectly on a core 2 Duo I had
  • Psionic Roshambo @ Psionic Roshambo:
    Easiest game to run I found
  • K3Nv2 @ K3Nv2:
    Ps2 emulation is cake compared to 3 years ago
  • Psionic Roshambo @ Psionic Roshambo:
    Hardest is probably Gran Turismo 4
  • Psionic Roshambo @ Psionic Roshambo:
    It's much better now yes but Gran Turismo 4 is still the hardest one to emulate that I have in my collection
  • Psionic Roshambo @ Psionic Roshambo:
    Runs perfectly fine but it's as if I can feel it always on the boarder line of dropping a frame lol
  • BigOnYa @ BigOnYa:
    I ordered a spin ball couple days ago to add to my arcade cabinet, will be nice for games like golden tee, or bowling
  • Psionic Roshambo @ Psionic Roshambo:
    I always wanted a controller for like Ikari Warriors, Time Soldiers, Heavy Barrel, Forgotten Worlds games like those
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Not even sure what to call that controller
  • Xdqwerty @ Xdqwerty:
    an online friend I've known since 2021 left me :( bc my attitude is "cutty"
  • Psionic Roshambo @ Psionic Roshambo:
    Sylvester Stallone should have played Kyle Reese lol Arnold still as the Terminator
  • BakerMan @ BakerMan:
    TF DOES "CUTTY" EVEN MEAN?
  • Xdqwerty @ Xdqwerty:
    @BakerMan, he is peruvian so it's probably an idiom
  • BigOnYa @ BigOnYa:
    I thought Cutty was a west coast rapper
    BigOnYa @ BigOnYa: I thought Cutty was a west coast rapper