Homebrew Homebrew Development

schuko1982

Member
Newcomer
Joined
Nov 4, 2014
Messages
18
Trophies
0
Age
41
Location
Tarragona
XP
112
Country
Hello everyone, here a little tutorial to whom wanna begin with homebrew on 3DS :P

Before anything you will need these files:
DevKitARM : devkitpro.org
DevKitARM Add-on 3ds: http://mtheall.com/~fincs/3dsdkA/
3DSTemplate(with new ctrulib): http://filetrip.net/dl?rqkeqrIIns

After download all files:
1 - open the "dkA-3dsx-patch-12092014.zip" and copy the DevKitARM folder to DevKitPro/DevKitARM folder on your PC.
2 - extract 3dstemplate where you wanna, open the 3dstemplate folder and copy the "libctru" on C:/ or D:/ or where you wanna on your disk.
3 - Go to environment variables and at system variables, create a new with name: CTRULIB , value: D:\libctru (change to your libctru directory !).
4 - on 3dstemplate folder open the build.bat, if you did everything correct, it will generate three new files, ".elf", ".3dsx" and ".3ds", the .3ds is to Gateway users, .elf to alternative homebrew loaders and .3dsx to future Smea Homebrew Loader.

If you wanna edit the code, just go to source and edit the main.c, there is a little example on code, have fun :P



no valid link, someone can give it to me? DevKitARM Add-on 3ds: http://mtheall.com/~fincs/3dsdkA/

Thank!!
 

xem

Well-Known Member
Member
Joined
Nov 22, 2014
Messages
142
Trophies
0
Age
36
Location
Valbonne
XP
333
Country
France
Hello everyone, here a little tutorial to whom wanna begin with homebrew on 3DS :P

Before anything you will need these files:
DevKitARM : devkitpro.org
DevKitARM Add-on 3ds: http://mtheall.com/~fincs/3dsdkA/
3DSTemplate(with new ctrulib): http://filetrip.net/dl?rqkeqrIIns

After download all files:
1 - open the "dkA-3dsx-patch-12092014.zip" and copy the DevKitARM folder to DevKitPro/DevKitARM folder on your PC.
2 - extract 3dstemplate where you wanna, open the 3dstemplate folder and copy the "libctru" on C:/ or D:/ or where you wanna on your disk.
3 - Go to environment variables and at system variables, create a new with name: CTRULIB , value: D:\libctru (change to your libctru directory !).
4 - on 3dstemplate folder open the build.bat, if you did everything correct, it will generate three new files, ".elf", ".3dsx" and ".3ds", the .3ds is to Gateway users, .elf to alternative homebrew loaders and .3dsx to future Smea Homebrew Loader.

If you wanna edit the code, just go to source and edit the main.c, there is a little example on code, have fun :P

Hi st4rk, and other people reading this.
Please note that the setup procedure is much easier now (devkitpro now includes mtheall's add-on and ctrulib natively)
But if you like writing tutorials, please join ours at https://github.com/xem/3DShomebrew :)
 
  • Like
Reactions: st4rk

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
Hey I have a quick question. I'm trying to write homebrew in c++, I was writing it in C but I'm not to comfortable with C, and I'm having trouble with my compiler and the function "u8* gfxGetFramebuffer(gfxScreen_t screen, gfx3dSide_t side, u16* width, u16* height);" . basically I want to draw to the bottom screen so I use screenBottom = gfxGetFramebuffer(GFX_BOTTOM, GFX_BOTTOM, NULL, NULL); and it doesn't work. can anyone point me in the right direction? please?

--edit

I'm sorry. I am a little tired basically what i want to do is clear the frame buffer not draw on the screen. using c++
gfxGetFramebuffer(GFX_BOTTOM, GFX_BOTTOM, NULL, NULL);
sb
gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);
in 2d generally the left screen is the visible framebuffer. GFX_BOTTOM would effectively be referencing the right(as in GFX_RIGHT) framebuffer.
 

arm113ds

Active Member
Newcomer
Joined
Nov 1, 2014
Messages
31
Trophies
0
XP
204
Country
what are elf files? I never had to deal with them and managed to compile 3dsx files anyway.

when you compile the source using "make", creates three files .elf, .3dsx, and .sdmh. If I have not the source but if I have the file .elf I can use to convert .elf to .3dsx?
 

Helreizer543

Well-Known Member
Newcomer
Joined
Nov 24, 2014
Messages
49
Trophies
0
Age
102
XP
119
Country
United States
gfxGetFramebuffer(GFX_BOTTOM, GFX_BOTTOM, NULL, NULL);
sb
gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);
in 2d generally the left screen is the visible framebuffer. GFX_BOTTOM would effectively be referencing the right(as in GFX_RIGHT) framebuffer.


I got it. thanks in the function when you specify GFX_BOTTOM it does nothing with the 2nd part (GFX_LEFT). GFX_LEFT and GFX_RIGHT are only used when clear the top screen frame buff (left is 2d, right is 3d).the function works correctly though
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
Could you tell me how this funtions works?
Code:
drawCircleCircum(int cx, int cy, int x, int y, char r, char g, char b, u8* screen)

x and y are the circle's center position? And cx and cy are meant to do what exactly?
 

minexew

ayy lmao
Member
Joined
Mar 16, 2013
Messages
228
Trophies
0
XP
284
Country
After about 5 hours of debugging I figured out that you have to call GPU_FinishDrawing before touching any depth buffer settings. Unless you want the GPU to lock up, that is.
Thanks, Nintendo!
 
  • Like
Reactions: AlbertoSONIC

Helreizer543

Well-Known Member
Newcomer
Joined
Nov 24, 2014
Messages
49
Trophies
0
Age
102
XP
119
Country
United States
Could you tell me how this funtions works?
Code:
drawCircleCircum(int cx, int cy, int x, int y, char r, char g, char b, u8* screen)

x and y are the circle's center position? And cx and cy are meant to do what exactly?

I tried out the funtion. it seems cx and cy are the circles center position. but its not creating a circle outline at all. only 4s point around the specified center. btw what are you using to debug your app?
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
I tried out the funtion. it seems cx and cy are the circles center position. but its not creating a circle outline at all. only 4s point around the specified center. btw what are you using to debug your app?

My 3DS ;) I think i'll have to load a circle from an image instead of generating it...
 

Helreizer543

Well-Known Member
Newcomer
Joined
Nov 24, 2014
Messages
49
Trophies
0
Age
102
XP
119
Country
United States
My 3DS ;) I think i'll have to load a circle from an image instead of generating it...

so y is the radius and x is idk I put 3 and it gave me 6 pixels gonna try some other things. you could just drawFillCircle since you cant specify the thickness of the outline with the function you were trying to use.
Edit: Im gonna try and write a better function than this ^.^
 

PewnyPL

Well-Known Member
Member
Joined
Feb 2, 2014
Messages
771
Trophies
1
XP
2,188
Country
Poland
so y is the radius and x is idk I put 3 and it gave me 6 pixels gonna try some other things. you could just drawFillCircle since you cant specify the thickness of the outline with the function you were trying to use.

I think this function may be drawing an ellipsis, so the X and Y would be the two radiuses.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    HiradeGirl @ HiradeGirl: https://www.youtube.com/watch?v=ntjkwIXWtrc&ab_channel=Apple I feel uncomfortable from watching...