Homebrew Homebrew Development

renhei

Well-Known Member
Newcomer
Joined
Jun 21, 2016
Messages
64
Trophies
0
XP
282
Country
United States
@erman1337 It is very likely that I'm doing something wrong then. Would you be able to look at my code and see what's wrong? Or show me code of yours where it works so I can learn from it? :)
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
@renhei use sf2dlib o top screen and the console on bottomscreen and it will work. Or swap the two if you prefer.

What you can't do is printing with the console on the screen where you want to use the graphics. If you need text and gfx on the same screen, use sftdlib instead of the console
 

renhei

Well-Known Member
Newcomer
Joined
Jun 21, 2016
Messages
64
Trophies
0
XP
282
Country
United States
@nop90 Thank you. I'll check out sftdlib too. :) With some trial and error I figured out how to do it. Turns out that gfxInit() and sf2d_init() conflict because the latter includes gfxInitDefault() already.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
@nop90 Turns out that gfxInit() and sf2d_init() conflict because the latter includes gfxInitDefault() already.

Correct. Sf2dlib uses the ctrulib gpu calls but making it simpler; you can mix the two but only well knowing what you're doing. Better using only sf2dlib if you're not experienced.

If you want to use low level calls, study citro3d. It's only a little higher level than ctrulib gpu functions but it's easier. Sf2dlib is a great library but it's no more maintained afaik.
 
Last edited by nop90,
  • Like
Reactions: Joel16

renhei

Well-Known Member
Newcomer
Joined
Jun 21, 2016
Messages
64
Trophies
0
XP
282
Country
United States
I took your advice and starting learning citro3d. I learned the simple_tri and system_font examples and the accompanying shaders. Thank you!

Now I'm trying to add text to my program like before, but again I can't seem to draw and do text on the same screen...

For text I need the Y origin at the bottom:
Mtx_OrthoTilt(&projection, 0.0, 400.0, 240.0, 0.0, 0.0, 1.0, true);​

But for drawing triangles I need the Y origin at the top:
Mtx_OrthoTilt(&projection, 0.0, 400.0, 0.0, 240.0, 0.0, 1.0, true);​

If I change the origin for either, it doesn't work. How can I draw triangles with the Y origin at the bottom?
 
Last edited by renhei,

renhei

Well-Known Member
Newcomer
Joined
Jun 21, 2016
Messages
64
Trophies
0
XP
282
Country
United States
Is there any decent library for text?? SFTD is too buggy, I gave up on trying to use citro3d because, like the text console, I still couldn't have anything but text on one screen. The only other thing I've found is STB, but I haven't made any progress on figuring out how to use it from examples because I'm so exhausted from trying and failing so much to just draw text... If it sounds like I'm exasperated, I am. ><
 
  • Like
Reactions: Joel16

Gizametalman

Banned!
Banned
Joined
Dec 18, 2015
Messages
974
Trophies
0
Age
30
Location
D.F. - Zona Cero.
XP
730
Country
Mexico
Hallo, I want to ask something:

Is this going to help me to develop many stuff?
I'm interested in homebrew games, and one or two personal use homebrew apps. The first one being a digital painting app, and the other... I dunno... I'll see later.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Is there any decent library for text?? SFTD is too buggy, I gave up on trying to use citro3d because, like the text console, I still couldn't have anything but text on one screen. The only other thing I've found is STB, but I haven't made any progress on figuring out how to use it from examples because I'm so exhausted from trying and failing so much to just draw text... If it sounds like I'm exasperated, I am. ><

SDL and SDL_TTF are now stable and they are easy to use.
 

YugamiSekai

Mr. Picross
Member
Joined
Dec 24, 2014
Messages
2,015
Trophies
1
Age
22
XP
2,286
Country
United States
Code:
c:/(path)/citro3d-master/source/base.c: In function 'C3Di_FinalizeFrame':
c:/(path)/citro3d-master/source/base.c:275:2: error: 'GPUCMD_Finalize' is deprecated [-Werror=deprecated-declarations]
  GPUCMD_Finalize();
  ^~~~~~~~~~~~~~~
In file included from C:\devkitPro\libctru/include/3ds.h:69:0,
                 from c:/(Path)/citro3d-master/include/c3d/types.h:3,
                 from c:/(Path)/citro3d-master/include/c3d/attribs.h:2,
                 from c:/(Path)/citro3d-master/source/internal.h:2,
                 from c:/(Path)/citro3d-master/source/base.c:1:
C:\devkitPro\libctru/include/3ds/gpu/gpu.h:81:17: note: declared here
 DEPRECATED void GPUCMD_Finalize(void);
                 ^~~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
make[1]: *** [base.o] Error 1
make: *** [build] Error 2
Should I remove -Werror?
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Code:
c:/(path)/citro3d-master/source/base.c: In function 'C3Di_FinalizeFrame':
c:/(path)/citro3d-master/source/base.c:275:2: error: 'GPUCMD_Finalize' is deprecated [-Werror=deprecated-declarations]
  GPUCMD_Finalize();
  ^~~~~~~~~~~~~~~
In file included from C:\devkitPro\libctru/include/3ds.h:69:0,
                 from c:/(Path)/citro3d-master/include/c3d/types.h:3,
                 from c:/(Path)/citro3d-master/include/c3d/attribs.h:2,
                 from c:/(Path)/citro3d-master/source/internal.h:2,
                 from c:/(Path)/citro3d-master/source/base.c:1:
C:\devkitPro\libctru/include/3ds/gpu/gpu.h:81:17: note: declared here
 DEPRECATED void GPUCMD_Finalize(void);
                 ^~~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
make[1]: *** [base.o] Error 1
make: *** [build] Error 2
Should I remove -Werror?

update ctrulib and citro3d
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,033
Country
United States
update ctrulib and citro3d
citro3d still uses the finalize cal
update ctrulib and citro3d
citro3d still uses the finalize call - so either fix the warning or remove the warnings as error flag.
There are some notes in ctrulib for the commit that added the deprecated attribute.
- Deprecated GPUCMD_Finalize/Run/FlushAndRun:
- Use GPUCMD_Split + GX_ProcessCommandList instead
 
  • Like
Reactions: Joel16

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Strange, I updated everthing this week and had no problems

--------------------- MERGED ---------------------------

Oh yes, I remember. I used the Next branch, not the master, of citro 3d

You could try with it, it'a a developement version bur seems to be stable
 

NO_ob

Well-Known Member
Member
Joined
Apr 16, 2017
Messages
155
Trophies
0
Age
25
XP
306
Country
Which programming languages should I learn to start out with 3ds development?? Some point down the line I want to try and build a custom firmware I imagine it will be a huge task but where would be a good place to start
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Which programming languages should I learn to start out with 3ds development?? Some point down the line I want to try and build a custom firmware I imagine it will be a huge task but where would be a good place to start

definively start with C.

But if you already don't know coding, CFW or 3ds coding is not for for you. Try first a simple hello world program on windows (or linux.)
 

catlover007

Developer
Developer
Joined
Oct 23, 2015
Messages
722
Trophies
1
XP
3,943
Country
Germany
As a C# developper i wonder if developping using mono on 3ds will be possible one day
It's possible if you manage to obtain a copy of Unity for 3DS from some shady source. But in this case you may not publish your game on this site(or on most most sites). This method isn't recommended. Porting Mono by yourself would be a huge undertakement. There exist some tools which convert C# to C++(Unity has it's own and uses it for it's mobile platforms including the 3DS) but I doubt those are suitable for 3DS development.
Which programming languages should I learn to start out with 3ds development?? Some point down the line I want to try and build a custom firmware I imagine it will be a huge task but where would be a good place to start
There are two major programming languages in the 3DS dev scene: C and C++. Besides these two it's also possible to program in Lua but this is limited to normal applications. And really, writing a custom firmware doesn't only need a good programming skills but also great knowledge about the 3DS architecture. If your'e just starting, writing a CFW in near future is an unrealistc goal.
But if you're still interested in homebrew programming I recommend you to simply start by learning Lua for the PC.

EDIT: ah, I was ninjaed. C is also an option, but if you're a total beginner, I would definitely recommend Lua over C
 
Last edited by catlover007,

NO_ob

Well-Known Member
Member
Joined
Apr 16, 2017
Messages
155
Trophies
0
Age
25
XP
306
Country
It's possible if you manage to obtain a copy of Unity for 3DS from some shady source. But in this case you may not publish your game on this site(or on most most sites). This method isn't recommended. Porting Mono by yourself would be a huge undertakement. There exist some tools which convert C# to C++(Unity has it's own and uses it for it's mobile platforms including the 3DS) but I doubt those are suitable for 3DS development.

There are two major programming languages in the 3DS dev scene: C and C++. Besides these two it's also possible to program in Lua but this is limited to normal applications. And really, writing a custom firmware doesn't only need a good programming skills but also great knowledge about the 3DS architecture. If your'e just starting, writing a CFW in near future is an unrealistc goal.
But if you're still interested in homebrew programming I recommend you to simply start by learning Lua for the PC.

EDIT: ah, I was ninjaed. C is also an option, but if you're a total beginner, I would definitely recommend Lua over C

I have some experience with programming i did computing for 2 years at school and my first year of college and i am a quick learner do you know what would be some good places so start learning c and c++ is it worth buying textbooks??
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    How do you know if the night will be good when you're asleep
  • BakerMan @ BakerMan:
    because i didn't say i was asleep
  • BakerMan @ BakerMan:
    i said i was sleeping...
  • BakerMan @ BakerMan:
    sleeping with uremum
  • K3Nv2 @ K3Nv2:
    Even my mum slept on that uremum
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
  • Karma177 @ Karma177:
    do y'all think having an sd card that has a write speed of 700kb/s is a bad idea?
    trying to restore emunand rn but it's taking ages... (also when I finished the first time hekate decided to delete all my fucking files :wacko:)
  • The Real Jdbye @ The Real Jdbye:
    @Karma177 that sd card is 100% faulty so yes, its a bad idea
  • The Real Jdbye @ The Real Jdbye:
    even the slowest non-sdhc sd cards are a few MB/s
  • Karma177 @ Karma177:
    @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really think it's faulty (pasted 40/50gb+ folders and no write errors)
    Karma177 @ Karma177: @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really...