Homebrew Homebrew Development

GoodraIsBae9

Member
Newcomer
Joined
Oct 19, 2016
Messages
14
Trophies
0
Location
Lurking through the ceiling hole
XP
43
Country
Hello everyone, I'm trying to do a silly app that has something to do with installed titles and their icons. Been looking at the source of various apps that do the same (mostly FBI, JKSM and freeShop) but anytime I try to call AM_* it crashes

I understand the need for it o be compiled as .cia to have elevated privileges but either I don't know how to set up the ".rsf" for makerom or I'm doing something wrong with the services/permissions on it
Code:
    u64* titleIds;              //array to read tileids to
    u32* titleCount;           //number of titles installed

    AM_GetTitleCount(FS_MediaType::MEDIATYPE_SD, titleCount);
    titleIds = new u64[*titleCount];
    AM_GetTitleList(nullptr, FS_MediaType::MEDIATYPE_SD, *titleCount, titleIds);


On another side every time I try to use any FILE operation like fopen or fgets Intellisense tells me "There's too many arguments for function call X", the app compiles just fine, it bothers me a bit though
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
Hello everyone, I'm trying to do a silly app that has something to do with installed titles and their icons. Been looking at the source of various apps that do the same (mostly FBI, JKSM and freeShop) but anytime I try to call AM_* it crashes

I understand the need for it o be compiled as .cia to have elevated privileges but either I don't know how to set up the ".rsf" for makerom or I'm doing something wrong with the services/permissions on it
Code:
    u64* titleIds;              //array to read tileids to
    u32* titleCount;           //number of titles installed

    AM_GetTitleCount(FS_MediaType::MEDIATYPE_SD, titleCount);
    titleIds = new u64[*titleCount];
    AM_GetTitleList(nullptr, FS_MediaType::MEDIATYPE_SD, *titleCount, titleIds);


On another side every time I try to use any FILE operation like fopen or fgets Intellisense tells me "There's too many arguments for function call X", the app compiles just fine, it bothers me a bit though
For intellisense it is not actually possible to full correct this for C files though it does seem to work more completely for CPP files. You need to modify the intellisense/nmake settings. You need to add the defines _HAVE_STDC;ARM11;_3DS and make sure to remove the defaults so that WIN32 gets removed. I have a few projects in git where I did this - https://github.com/elhobbs
Hexen looks like it should be ok, but keep in mind these are C projects so it does not work completely.
 
  • Like
Reactions: GoodraIsBae9

GoodraIsBae9

Member
Newcomer
Joined
Oct 19, 2016
Messages
14
Trophies
0
Location
Lurking through the ceiling hole
XP
43
Country
For intellisense it is not actually possible to full correct this for C files though it does seem to work more completely for CPP files. You need to modify the intellisense/nmake settings. You need to add the defines _HAVE_STDC;ARM11;_3DS and make sure to remove the defaults so that WIN32 gets removed. I have a few projects in git where I did this - https://github.com/elhobbs
Hexen looks like it should be ok, but keep in mind these are C projects so it does not work completely.
The setting up VS2015 for 3DS HB guide I followed didn't mention any of it but your fix does seem to work, I even get proper FILE function descriptions using C++
Thanks!
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
The setting up VS2015 for 3DS HB guide I followed didn't mention any of it but your fix does seem to work, I even get proper FILE function descriptions using C++
Thanks!
There are a few more settings that I did not mention (but are in the examples) like removing almost all of the default directories (and uncheck the inherit checkbox) that are needed so that right-click go to definition works correctly. Iirc the only default that needs to stay is the exe path (this is needed or you won't be able to use the build commands in vs).
 
Last edited by elhobbs,

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
Hello everybody. I've a question about save data managent.
I have noticed that in rsf file you can specify the size for the save data of your program but I haven't found any example where I can use this.
What I want to do is to create a save data for my cia and read and write it in my program.
Is this possible?
Thanks for all :)
 

doingitwrong

Active Member
Newcomer
Joined
Oct 5, 2015
Messages
35
Trophies
0
Age
44
XP
108
Country
United States
info: I am writing an IRC client for the 3ds and after talking briefly with Sanky, by his recommendation I was intending to use this library. after getting eclipse up and running, and FINALLY figuring out how to get the library linked for building, now my build fails with two completely unhelpful errors:
error1:
Description: make: *** [build] Error 2
Resource: aIRC
Path:
Location
:
Type: C/C++ Problem

error2:
Description: make[1]: *** [/c/workspace/aIRC/aIRC.elf] Error 1
Resource:
aIRC
Path:
Location:
Type:
C/C++ Problem

note: both path are location are empty in both of the errors, I have not removed any error details.

question: am I able to use a pre-compiled .dll with coding for the 3ds? must I somehow recompile the dll from source with special instructions?
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
info: I am writing an IRC client for the 3ds and after talking briefly with Sanky, by his recommendation I was intending to use this library. after getting eclipse up and running, and FINALLY figuring out how to get the library linked for building, now my build fails with two completely unhelpful errors:
error1:
Description: make: *** [build] Error 2
Resource: aIRC
Path:
Location
:
Type: C/C++ Problem

error2:
Description: make[1]: *** [/c/workspace/aIRC/aIRC.elf] Error 1
Resource:
aIRC
Path:
Location:
Type:
C/C++ Problem

note: both path are location are empty in both of the errors, I have not removed any error details.

question: am I able to use a pre-compiled .dll with coding for the 3ds? must I somehow recompile the dll from source with special instructions?
Dll files are for windows - so no. If you are building for the 3ds then you are not going to be to use dynamic libraries using ctrulib.
 

delete12345

Well-Known Member
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,276
Country
United States
The setting up VS2015 for 3DS HB guide I followed didn't mention any of it but your fix does seem to work, I even get proper FILE function descriptions using C++
Thanks!
WHAT WHAT WHAT???

Can you at least tell me anything wrong around the guide? Making a list of issues is a plus!! I'm the guide creator, and I never get any feedback whatsoever on the guide until now.

Please immediately contact me so I can update accordingly and appropriately.

For intellisense it is not actually possible to full correct this for C files though it does seem to work more completely for CPP files. You need to modify the intellisense/nmake settings. You need to add the defines _HAVE_STDC;ARM11;_3DS and make sure to remove the defaults so that WIN32 gets removed. I have a few projects in git where I did this - https://github.com/elhobbs
Hexen looks like it should be ok, but keep in mind these are C projects so it does not work completely.

@elhobbs May I ask if you can explain more about the defines for IntelliSense? I am not aware of those you've mentioned, and I wish to improve my Visual Studio homebrew setup guide a bit more to clarify the issues better.
 
Last edited by delete12345,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
WHAT WHAT WHAT???

Can you at least tell me anything wrong around the guide? Making a list of issues is a plus!! I'm the guide creator, and I never get any feedback whatsoever on the guide until now.

Please immediately contact me so I can update accordingly and appropriately.



@elhobbs May I ask if you can explain more about the defines for IntelliSense? I am not aware of those you've mentioned, and I wish to improve my Visual Studio homebrew setup guide a bit more to clarify the issues better.
essentially this is just setting the defines the same as the makefile/gcc arm environment. the only additional one I added is "_HAVE_STDC". This probably should be "__STDC__" instead - as this is what gcc is doing for you (which in turn sets _HAVE_STDC - just use intellisense on printf and look at _EXFUN. scroll up a little and you will see _HAVE_STDC). the rest is just adding in all of the 3ds/arm include search paths. while also removing all references to the windows paths and defines.
this is what I use for the NMake include path:
$(ProjectDir)include;C:\devkitPro\devkitARM\arm-none-eabi\include;C:\devkitPro\devkitARM\lib\gcc\arm-none-eabi\5.3.0\include;C:\devkitPro\devkitARM\arm-none-eabi\include\c++\5.3.0;C:\devkitPro\libctru\include
 

delete12345

Well-Known Member
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,276
Country
United States
essentially this is just setting the defines the same as the makefile/gcc arm environment. the only additional one I added is "_HAVE_STDC". This probably should be "__STDC__" instead - as this is what gcc is doing for you (which in turn sets _HAVE_STDC - just use intellisense on printf and look at _EXFUN. scroll up a little and you will see _HAVE_STDC). the rest is just adding in all of the 3ds/arm include search paths. while also removing all references to the windows paths and defines.
this is what I use for the NMake include path:
$(ProjectDir)include;C:\devkitPro\devkitARM\arm-none-eabi\include;C:\devkitPro\devkitARM\lib\gcc\arm-none-eabi\5.3.0\include;C:\devkitPro\devkitARM\arm-none-eabi\include\c++\5.3.0;C:\devkitPro\libctru\include

So, the only info that I'm missing is the _HAVE_STDC? Ok.

You don't need to include the \c++ folder and \5.3.0, because they are redundant to the IDEs. I was told the \c++ folder will be auto-parsed when adding a library path to the C standard library header files.
 
Last edited by delete12345,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
So, the only info that I'm missing is the _HAVE_STDC? Ok.

You don't need to include the \c++ folder and \5.3.0, because they are redundant to the IDEs. I was told the \c++ folder will be auto-parsed when adding a library path to the C standard library header files.
did you miss the part where I said use "__STDC__" instead of "_HAVE_STDC"? in my experience the include paths I specified are required - really comes down to whether or not you are using the files at those paths. visual studio (and particularly intellisense) is not going to automagically find directories for you - I suspect you may have been confusing the issue with what gcc will do for you. but then again I am not really sure what you mean by "adding a library path to the C standard library header files" - what does that mean?
 

delete12345

Well-Known Member
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,276
Country
United States
did you miss the part where I said use "__STDC__" instead of "_HAVE_STDC"?

Ah, I was wrong.

but then again I am not really sure what you mean by "adding a library path to the C standard library header files" - what does that mean?

It means the \c++ directory and all subdirectories in that folder are automatically parsed by the IDEs. In other words, you do not have to include \c++\5.3.0\include and so on. Just include the root \include directory, and you're good to go.

Else you may get conflicts for the IntelliSense / Content Assist.

tP2BYIY.png
 
Last edited by delete12345,

GoodraIsBae9

Member
Newcomer
Joined
Oct 19, 2016
Messages
14
Trophies
0
Location
Lurking through the ceiling hole
XP
43
Country
Can you at least tell me anything wrong around the guide? Making a list of issues is a plus!! I'm the guide creator, and I never get any feedback whatsoever on the guide until now.

Please immediately contact me so I can update accordingly and appropriately.

Guess elhobbs already mentioned the issue but if you want more details I solved it by going to properties > NMake > Intellisense and replaced default preprocessor string with this one "_HAVE_STDC;ARM11;_3DS"

I think your guide was quite nice and noob-friendly, a couple things though; I ignored point 21 completely, didn't get any errors when adding the main.cpp "template" so ignored 23/24 too
Also, you might want to add a link to ctrulib github because the one bundled with Devkitpro gave me a couple errors so I had to update it
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
Ah, I was wrong.



It means the \c++ directory and all subdirectories in that folder are automatically parsed by the IDEs. In other words, you do not have to include \c++\5.3.0\include and so on. Just include the root \include directory, and you're good to go.

Else you may get conflicts for the IntelliSense / Content Assist.

tP2BYIY.png
I can't speak to eclipse but this is not exactly true. Subdirectories don't need to be included if the include files are referenced relative to the main directory. The directories I provided are the top level directories. Also, you want to remove the inherit checkbox as it prevents all of the Windows paths from being included.
I am not sure what the screenshots are supposed to be demonstrating - maybe you could elaborate on that?
 

delete12345

Well-Known Member
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,276
Country
United States
Guess elhobbs already mentioned the issue but if you want more details I solved it by going to properties > NMake > Intellisense and replaced default preprocessor string with this one "_HAVE_STDC;ARM11;_3DS"

I think your guide was quite nice and noob-friendly, a couple things though; I ignored point 21 completely, didn't get any errors when adding the main.cpp "template" so ignored 23/24 too
Also, you might want to add a link to ctrulib github because the one bundled with Devkitpro gave me a couple errors so I had to update it

I see. I'll look into those.

As for the ctrulib and the devkitpro version of ctrulib, I recalled WinterMute and others are looking into updating the package a bit, so I didn't include a link to update the ctrulib or so in the guide.

I can't speak to eclipse but this is not exactly true. Subdirectories don't need to be included if the include files are referenced relative to the main directory. The directories I provided are the top level directories. Also, you want to remove the inherit checkbox as it prevents all of the Windows paths from being included.
I am not sure what the screenshots are supposed to be demonstrating - maybe you could elaborate on that?

Like you said, subdirectories don't need to be included. But I'm certain you don't need the C++ and C++/5.3.0 top level directories in your include paths. By default, those directories are subdirectories of the arm-eabi-none/include directory, which is what you have.

Also, that Visual Studio screenshot was done on a brand new project. I didn't bother to remove the Windows includes because that was done in a rush.

The screenshots are to demonstrate that you only need a minimum total of 2 include paths to get a project to work with IntelliSense / Content Assist. (Aside from the default Windows include paths, those are unnecessary.)
 
Last edited by delete12345,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
I see. I'll look into those.

As for the ctrulib and the devkitpro version of ctrulib, I recalled WinterMute and others are looking into updating the package a bit, so I didn't include a link to update the ctrulib or so in the guide.



Like you said, subdirectories don't need to be included. But I'm certain you don't need the C++ and C++/5.3.0 top level directories in your include paths. By default, those directories are subdirectories of the arm-eabi-none/include directory, which is what you have.

Also, that Visual Studio screenshot was done on a brand new project. I didn't bother to remove the Windows includes because that was done in a rush.

The screenshots are to demonstrate that you only need a minimum total of 2 include paths to get a project to work with IntelliSense / Content Assist. (Aside from the default Windows include paths, those are unnecessary.)
Well, I am glad what you are saying works for you, but it does not work for me. It will seem to work if you leave the inherit checkbox set - but then it is looking at the Windows headers instead. Oh well. If it works for you then that's fine.
 

delete12345

Well-Known Member
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,276
Country
United States
QUICK UPDATE!!

Pica, the 3DS physics engine extension for Citro3D is 95% done! All that's left are the rendering functions needed to draw the objects onto the screen.

And then it's bug bashing time.....

I look forward to the day bug bashing starts, but I should be expecting little to no bugs.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: I'll reformat and have a 3tb raid0 m. 2 at least +1