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,564
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
  • S @ salazarcosplay:
    @Sicklyboy I was reading your post on the lgbtq batman
  • S @ salazarcosplay:
    @Sicklyboy @K3Nv2 In the cas of Robin it would be Dick Grayson
  • S @ salazarcosplay:
    I have seen the new 52 and dcau animated movies I think they take every opportunity to say his name "Dick", and they say it more often than should have been necessary
  • ShdwTakashi @ ShdwTakashi:
    Good morning!
  • ShdwTakashi @ ShdwTakashi:
    pineapple belong on pizza? The answer is yes until proven otherwise
  • StatusN @ StatusN:
    hi, i need help with unbanning my 3ds, can somebody show me a link to a seed that still works and isnt yet banned, mine got banned yesterday
  • A @ anotherthing:
    The Nintendo servers are going down in 9 days anyway.
  • Xdqwerty @ Xdqwerty:
    Good morning
  • Xdqwerty @ Xdqwerty:
    @StatusN, welcome
  • BakerMan @ BakerMan:
    hey qwerty look at that you ain't the youngest here anymore
    +1
  • S @ salazarcosplay:
    Had a question on 3ds
  • S @ salazarcosplay:
    will one still be able to transfer pokemon from the ds 3ds games to Switch
  • A @ anotherthing:
    Supposedly Bank isn't going down.
  • StatusN @ StatusN:
    i know they are @anotherthing but i modded m y 3ds last month and i installed pretendo but as my 3ds got banned i need a friend seed to unblock my 3ds
  • A @ anotherthing:
    You got banned from Pretendo?
  • StatusN @ StatusN:
    online ban
  • S @ salazarcosplay:
    @anotherthing I think Nintendo should have just re released all pokemon games on the switch
    +1
  • S @ salazarcosplay:
    let you transfer it all
  • StatusN @ StatusN:
    bank got shutdown in april last year
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, yea the only game they rereleased are the game boy and games boy color ones (remakes don't count)
  • StatusN @ StatusN:
    does anyone have a friend seed link to a seed that isnt already banned and is new, if anyone does then thanks
  • S @ salazarcosplay:
    @Xdqwerty I refuse to get Nintendo Switch online
  • S @ salazarcosplay:
    until they add pokemon mainline games
  • S @ salazarcosplay:
    they could very easily do so
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, i meant that they got rereleased in virtual console in 3ds
    Xdqwerty @ Xdqwerty: @salazarcosplay, i meant that they got rereleased in virtual console in 3ds