Homebrew Homebrew Development

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Im trying to render a model using citro3d and im getting this:

What rule do i add to the makefile?

If you are trying to compile this you should only need the lates devkitpro with updated citro3d lib from the next branch (not the master one) fron the gitub repository

But if you are using a modified version of the example we need the full source code (and some info on your compiler enviroment and toolchain) to be able to give you some hints.
 

yerWizard

Active Member
Newcomer
Joined
Oct 21, 2016
Messages
32
Trophies
0
Age
25
XP
225
Country
If you are trying to compile this you should only need the lates devkitpro with updated citro3d lib from the next branch (not the master one) fron the gitub repository

But if you are using a modified version of the example we need the full source code (and some info on your compiler enviroment and toolchain) to be able to give you some hints.
I have the latest Devkitpro and ctrulib. I am using a modified textured_cube example but the makefile is intact. I have the .obj file in the data folder.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
I have the latest Devkitpro and ctrulib. I am using a modified textured_cube example but the makefile is intact. I have the .obj file in the data folder.
the data folder is to build a romfs from where to load resources at run time. Reading the error seems the linker needs that file at compile time but don't know how to handle the obj extension.
 

TuxSH

Well-Known Member
Member
Joined
Oct 19, 2015
Messages
614
Trophies
1
Age
26
XP
1,295
Country
France
I've got gdb working and can use VS Code to attach and debug my test app, but is there a way to attach before the app launches so I can debug from the start?

Not atm, and it'd be too complicated to implement properly.

Also a neat thing I found is that you can pass 80 to APT_SetAppCpuTimeLimit and it'll work but it breaks the luma menu and hardlocks the 3ds once
you enter the button combo.

Does it does that with 8.0 (and 8.1) ?
 

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
I know it did on 8.0, didn't try it on my n3ds or on any other version yet.
I just updated my 2DS luma to 8.1 last night so at some point tonight I'll try it again, also maybe trying 79% and seeing if that lets the menu work.
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
Another thing I have no idea how to do. Is delete a folder, and no I don't mean rd, because that only deletes empty directories. I saw something in the ctrulib documentation, it was something along the lines of fs_deleteDirectoryRecursively but I couldn't figure out the syntax. I'd blame c++ for not natively knowing how to do this, but that wont accomplish anything. So, anyone know what to do?
 

Teun1

Well-Known Member
Newcomer
Joined
Jan 13, 2016
Messages
63
Trophies
0
Location
Leiden
XP
200
Country
Netherlands
My bottom screen is flickering, how to fix it?

I am using the following void to set a background color to the buffer:

Code:
void test(u8* screen, int color)
{
    int width = (screen == TOP_SCREEN) ? SCREEN_WIDTH_TOP : SCREEN_WIDTH_BOT;
    for (int i = 0; i < (width * SCREEN_HEIGHT); i++) {
        *(screen++) = color >> 16;  // B
        *(screen++) = color >> 8;   // G
        *(screen++) = color & 0xFF; // R
    }
}

And this to set it:

Code:
u8* fb = gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);

test(fb, RGB(255, 0, 0));


UPDATE: Got it fixed by adding gfxSetDoubleBuffering(GFX_BOTTOM, false); to it.

Thanks.
 
Last edited by Teun1,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,033
Country
United States
My bottom screen is flickering, how to fix it?

I am using the following void to set a background color to the buffer:

Code:
void test(u8* screen, int color)
{
    int width = (screen == TOP_SCREEN) ? SCREEN_WIDTH_TOP : SCREEN_WIDTH_BOT;
    for (int i = 0; i < (width * SCREEN_HEIGHT); i++) {
        *(screen++) = color >> 16;  // B
        *(screen++) = color >> 8;   // G
        *(screen++) = color & 0xFF; // R
    }
}

And this to set it:

Code:
u8* fb = gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);

test(fb, RGB(255, 0, 0));


UPDATE: Got it fixed by adding gfxSetDoubleBuffering(GFX_BOTTOM, false); to it.

Thanks.
That will work fine for this simple case. But at some point you are going to want to use double buffering. A better solution would be to call
gfxGetFramebuffer each time so that you get the correct buffer. Because you were only calling
gfxGetFramebuffer once you were only updating one of the buffers. The flickering was caused by the other buffer that was never being updated.
 
  • Like
Reactions: Teun1

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
Does it does that with 8.0 (and 8.1) ?

Here's what I've noticed, the rosalina menu works fine with APT_SetAppCpuTimeLimit at 30, and beyond that it works less and less.
At 60% it's dropping input and at 80% it doesn't register anything at all afaik.

Edit:
The weird thing is sometimes thread creation fails, and I don't know why and as far as I've seen there's no error code.

Ignore the messy code, it's all kludged to approximate what I'm working with on my other project.
It does seem to increase conversion speed, but sometimes thread creation fails.

Pastebin link because the code tag ignores whitespace...
https://pastebin.com/Tafih3iE
 
Last edited by TarableCode,

TuxSH

Well-Known Member
Member
Joined
Oct 19, 2015
Messages
614
Trophies
1
Age
26
XP
1,295
Country
France
Here's what I've noticed, the rosalina menu works fine with APT_SetAppCpuTimeLimit at 30, and beyond that it works less and less.
At 60% it's dropping input and at 80% it doesn't register anything at all afaik.

Edit:
The weird thing is sometimes thread creation fails, and I don't know why and as far as I've seen there's no error code.

Ignore the messy code, it's all kludged to approximate what I'm working with on my other project.
It does seem to increase conversion speed, but sometimes thread creation fails.

Pastebin link because the code tag ignores whitespace...
https://pastebin.com/Tafih3iE
I'm changed the menu thread priority between 8.0 and 8.1, is there any difference between the two versions?
 

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
I didn't notice any, but that's just from what I remember before I updated to 8.1.
Probably the better way to do this would be to keep the cpu time limit at 30% until it's time for the thread to do work.
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
I don't understand how to use any of the FS and FSUSER functions in libctru. There is no documentation. Although let me specify, there is documentation on things like the syntax, but there is no explanation on what that syntax is. I want to check if a directory exists and if it does delete it.

Here's how I'm deleting the directory:
FSUSER_DeleteDirectoryRecursively(ARCHIVE_SDMC, "sdmc:/3ds/testFolder");
though, this doesn't work because the second argument is a const char, not a "FS_Path".
So I look up the documentation on FS_PATH, which tells me nothing.
I figure: I'll come back to it later, now let's see how to test if a directory exists.
There doesn't seem to be a function specifically for that but I figure I can make it work. I found FS_PathType which seems to give an int that tells you 0 for invalid 1 for empty etc. But it doesn't say in the documentation how to tell FS_PathType what path you want to specify. So I assume FS_PathType isn't a function but rather some kind of struct, but that only makes me more confused.

I need some serious explaining about FS in libctru. Or if someone can send me examples (and I don't mean link me to peoples GitHub repo's or anything like that, I mean actual examples).
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
though, this doesn't work because the second argument is a const char, not a "FS_Path".

FS_Path is a struct and you can define it like this

Code:
   FS_Path dirPath = (FS_Path){PATH_ASCII, 8, "/mydir/"};

The second value is the size of the path string.

But why don't you use common C functions to handle directory? You can check if a directory exist with something like this:

Code:
#include <dirent.h>
#include <errno.h>

---

DIR* dir = opendir("mydir");
if (dir)
{
   /* Directory exists. */
   closedir(dir);
}
else if (ENOENT == errno)
{
   /* Directory does not exist. */
}
else
{
   /* opendir() failed for some other reason. */
}


Note: not tested, just taken from the net
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
FS_Path is a struct and you can define it like this

Code:
   FS_Path dirPath = (FS_Path){PATH_ASCII, 8, "/mydir/"};

The second value is the size of the path string.

But why don't you use common C functions to handle directory? You can check if a directory exist with something like this:

Code:
#include <dirent.h>
#include <errno.h>

---

DIR* dir = opendir("mydir");
if (dir)
{
   /* Directory exists. */
   closedir(dir);
}
else if (ENOENT == errno)
{
   /* Directory does not exist. */
}
else
{
   /* opendir() failed for some other reason. */
}


Note: not tested, just taken from the net
because libctru has a function to delete a folder recursively (or in other words it can delete non-empty folders). C++ does not natively know how to do this. And I don't want to use the 'boost' system.
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
FS_Path is a struct and you can define it like this

Code:
   FS_Path dirPath = (FS_Path){PATH_ASCII, 8, "/mydir/"};

The second value is the size of the path string.

But why don't you use common C functions to handle directory? You can check if a directory exist with something like this:

Code:
#include <dirent.h>
#include <errno.h>

---

DIR* dir = opendir("mydir");
if (dir)
{
   /* Directory exists. */
   closedir(dir);
}
else if (ENOENT == errno)
{
   /* Directory does not exist. */
}
else
{
   /* opendir() failed for some other reason. */
}


Note: not tested, just taken from the net

so I tried this code:
Code:
FS_Path testDir = (FS_Path){PATH_ASCII, 20, "sdmc:/3ds/ROT_Data/"};
FSUSER_DeleteDirectoryRecursively(ARCHIVE_SDMC, testDir);
it doesn't work... there aren't any compiler error's but it doesn't work. Although a small side note is, the starting { in the first line has the red line under it in visual studio and says: expected an expression.
Any ideas?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BigOnYa @ BigOnYa: Hey hey!