Homebrew Homebrew Development

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Yeah, that's the problem, if you zoom in the images, you can notice that the text is all weird (blank squares appearing, blur, not at the same space, etc...). How do I initialize a font with a size? The only thing I see is "sftd_font *sftd_load_font_file(const char *pathname);", and this doesn't take any parameters referring to the size.

Print something on screen at the max size you need (you can print black on a black background if you dont want show it to the user).

The problem of the lib is that at the first print the code loads in a cache a texture of the fontset (i.e. a bitmap) rendered at the size of the first print and then next print uses this texture to get the rendered chars and copy them on screen scaled.

If the next print uses a smaller font, the GPU scaling gives a nice result, but using a larger font size, the zoomed bitmap results in a blurred image.

My fist workaround was to use different instances of the font (one for every size needed) but this waste memory. Printing the first time at the max size is a good solution.
 
Last edited by nop90,
  • Like
Reactions: Joel16 and cheuble

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,594
Trophies
3
Age
24
XP
20,990
Country
United States
I've ran into a problem when testing out TWLoader.
Whenever I press the HOME button to go into HOME Menu, the app crashes with a black screen with an error message.
Exiting out the app with a button press still works.

Is there a reason why this happens?
 

zoogie

playing around in the end of life
Developer
Joined
Nov 30, 2014
Messages
8,560
Trophies
2
XP
15,000
Country
Micronesia, Federated States of
Does anybody have any idea how to get APT_PrepareToDoApplicationJump and APT_DoApplicationJump to work on a 3dsx? They work fine using the example code here as a cia, but the same code hangs on 3dsx. Both functions return 0 when run so I don't think it's a permissions issue.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
I'm trying to cross-compile a library (specifically, mbedtls: https://github.com/ARMmbed/mbedtls) for the 3DS. Can I have some pointers on cross-compiling for the 3DS (necessary modifications to the Makefile)?

Use the portlib makefile template from Xerpi's github.

You have to run ./configure, make and make install.

Running configure is easy on a linux systen, on windows you have to use msys (not user friendly).

But about mbedtls, I don't knoe if DevKitArm provides the required network libs.
 
  • Like
Reactions: Deleted User

Theon

New Member
Newbie
Joined
Dec 11, 2016
Messages
4
Trophies
0
Age
113
XP
54
Country
Saint Kitts and Nevis
Hello, homebrewers!
I'm a huge fan of the homebrew scene, and used to follow GBAtemp religiously back when the DS was the coolest thing I knew.
I don't know how far 3DS homebrewing has come, but it seems like a fairly long list of tools are already available.

Is development of (simple) 3D games possible yet?
Would someone be up for taking on a fairly ambitious 3DS project, if I provided all the graphics?

I love making lowpoly 3D stuff, with very small texture maps, and would gladly supply such things (for free, of course) to anyone
looking to make a 3D homebrew game for this machine.
It wouldn't have to be very amazing (just getting something to move around on the screen would be worth it, to be honest), but
I assume there would be a lot of work involved for the programmer anyway, seeing as the console is still rather uncharted(?)

Sorry if this is just a silly and unrealistic request - I'd just like to be part of the homebrew scene in any way I can (can't program)

Here are some example graphics:
tumblr_ohsh46KdaK1usc8qto1_r1_500.gif
tumblr_ohum1zfhZg1usc8qto1_r1_400.gif
tumblr_ogwxyeV7Ym1usc8qto1_400.gif

tumblr_oh2l3rtPAu1usc8qto1_500.gif
tumblr_ogz2vsqhUg1usc8qto4_540.gif

tumblr_ogtjn1QMpd1usc8qto3_400.gif
tumblr_ogrpi3KGXZ1usc8qto1_400.gif
tumblr_ogpy5rw3Bb1usc8qto1_250.gif
tumblr_ogido0P2iC1usc8qto2_250.gif

tumblr_og2qriCx6O1usc8qto1_250.gif
tumblr_og2qriCx6O1usc8qto2_r1_250.gif
tumblr_ofxaw0yk7c1usc8qto1_250.gif
tumblr_ofxaw0yk7c1usc8qto3_r1_250.gif

tumblr_ofkm0oIaax1usc8qto1_400.gif
tumblr_ofiv8tXvWE1usc8qto1_250.gif
tumblr_ofiv8tXvWE1usc8qto3_r1_250.gif
tumblr_ofiv8tXvWE1usc8qto4_r1_250.gif
 

Attachments

  • Walker1.png
    Walker1.png
    96.8 KB · Views: 183
D

Deleted User

Guest
Use the portlib makefile template from Xerpi's github.

You have to run ./configure, make and make install.

Running configure is easy on a linux systen, on windows you have to use msys (not user friendly).

But about mbedtls, I don't knoe if DevKitArm provides the required network libs.

Thanks, I'll try building mbedtls anyways. If it doesn't work, I'll have to turn to other libraries.

BTW, where is Xerpi's Template? I checked his GitHub and can't seem to find it anywhere.
 

Theon

New Member
Newbie
Joined
Dec 11, 2016
Messages
4
Trophies
0
Age
113
XP
54
Country
Saint Kitts and Nevis
Oh, man. Just found out that there's a 3DS-plugin for Unity! Maybe I'll just try to learn some basics and go solo for now.
Anyone have experience with Unity for 3DS?
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Oh, man. Just found out that there's a 3DS-plugin for Unity! Maybe I'll just try to learn some basics and go solo for now.
Anyone have experience with Unity for 3DS?

Unity is supported by the official devkit, that you can download for free subscribing a Nintendo licence. But you have to accept a NDA a you can't release your project as homebrew.
 

Theon

New Member
Newbie
Joined
Dec 11, 2016
Messages
4
Trophies
0
Age
113
XP
54
Country
Saint Kitts and Nevis
What would stop people from releasing their Unity game anonymously? Does the exported game have some sort of identification?

Here's what the NDA says (the important part):

Grant of License. Subject to your compliance with this Agreement, we hereby grant you a limited, royalty-free, non-assignable, and non-exclusive license to use the Services solely in connection with the lawful development of applications or other lawful content designed for use on our platforms, together with any other purpose expressly authorized by us in writing (the “Purpose”). Any sale, distribution or public use of applications or other content developed with use of the Services shall be subject to a separate agreement that you have to enter into with Nintendo. You may not use the Services for any purpose other than the Purpose described above.

That said, I was able to register and get instant access to all development tools by simply providing a name and a verified email address, so it would be easy to use a fake name and release your work anonymously.

What's more, there's actually a lot of different software and tools available, and this really seems like a godsend for the homebrew community!
(Not so much for what it can do, but for how much power and knowledge could be unlocked by homebrew people!)

There are also devkits for sale, but they mostly seem to be normal consoles with the ability to load ROMs from flashcarts or USB (though there is mention of some debugging function).

You homebrew wizards REALLY ought to sign in and have a look at all the stuff there!
 

Theon

New Member
Newbie
Joined
Dec 11, 2016
Messages
4
Trophies
0
Age
113
XP
54
Country
Saint Kitts and Nevis
Here's the debugger devkit:

The IS-SNAKE-Devkit has 3 major features enabled by separate software licenses. For most Unity developers, only one license is necessary: either the CAPTURE or VIDEO OUTPUT license. Choose the DEBUGGER license if you also intend to develop titles using C/C++ or write native plugins for Unity. You may purchase 1, 2, or all 3 licenses.

License Features
CAPTURE Allows screenshots and recording of 3DS gameplay onto a PC over a USB cable.
VIDEO OUTPUT Allows displaying 3DS gameplay on a TV.
DEBUGGER Used for debugging C/C++ code. This is not needed for most Unity projects.

Apart from debugging, video output sounds really cool (although hardly very useful for homebrewing).

The most interesting stuff is the vast number of software tools provided!
Check out the two .txt files attached here to see what tools are available for download
 

Attachments

  • Nintendo_tools.txt
    48.3 KB · Views: 2,136
  • Nintendo_tools2.txt
    3 KB · Views: 287

CuriousTommy

Well-Known Member
Member
Joined
Jul 22, 2014
Messages
524
Trophies
0
Age
27
XP
647
Country
United States
I apologize for the really dumb question, but I have a question about the 3ds example, in particular, the read-controls example.

So I noticed that if statements are written like this:
Code:
int i;
for (i = 0; i < 32; i++)
{
    if (kDown & BIT(i)) printf("%s down\n", keysNames[i]);
    if (kHeld & BIT(i)) printf("%s held\n", keysNames[i]);
    if (kUp & BIT(i)) printf("%s up\n", keysNames[i]);
}
My question is why is there an ampersand sign in the if condition. Why wouldn't == be used instead? Also doesn't a single ampersand sign mean that the variable is passed by reference?
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
I apologize for the really dumb question, but I have a question about the 3ds example, in particular, the read-controls example.

So I noticed that if statements are written like this:
Code:
int i;
for (i = 0; i < 32; i++)
{
    if (kDown & BIT(i)) printf("%s down\n", keysNames[i]);
    if (kHeld & BIT(i)) printf("%s held\n", keysNames[i]);
    if (kUp & BIT(i)) printf("%s up\n", keysNames[i]);
}
My question is why is there an ampersand sign in the if condition. Why wouldn't == be used instead? Also doesn't a single ampersand sign mean that the variable is passed by reference?
KeyDown is not the key for the down direction, but is avariable where every bit tells if the one of the available key swas pressed.

KeyUp is for the released keys.

KeyHeld is for keys pressed and not released.

Since the code is in loop, it checks every bit and prints for ever key one of this tree events.

Edit: & as unary operator gets the pointer to the memory location containing a variable, but as a binary operator (between two variables) performs a bit by bit logical AND
 
Last edited by nop90,
  • Like
Reactions: CuriousTommy

CuriousTommy

Well-Known Member
Member
Joined
Jul 22, 2014
Messages
524
Trophies
0
Age
27
XP
647
Country
United States
Is it possible to use the for_sleep function on the 3DS? I making a silly 3DS program that gives a prompt with the user pressing the button to change the amount. But the error messages disappear too fast before the user the read the message.

Here is a link to my source code: https://gist.github.com/CuriousTommy/ff14de96428e8e503697f55c7020a366

I make a simple version to compile for Linux and this code works fine:
Code:
#include <iostream>
#include <chrono>
#include <thread>

using namespace std;
using namespace std::this_thread;     // sleep_for, sleep_until
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
using std::chrono::system_clock;

int main()
{
    cout << "For five seconds" << endl;
    sleep_for(5s);
    cout << "Hello World" << endl;
    return 0;
}

But when applying it to my 3ds code, I get this error message...
Code:
docker run --user `id -u` -v $(pwd):/source -it devkitpro make
main.cpp
arm-none-eabi-g++ -MMD -MP -MF /source/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -I/source/include -I/opt/devkitpro/libctru/include -I/source/build -DARM11 -D_3DS -fno-rtti -fno-exceptions -std=gnu++11 -c /source/source/main.cpp -o main.o
/source/source/main.cpp:8:22: error: 'this_thread' is not a namespace-name
using namespace std::this_thread; // sleep_for, sleep_until
                      ^
/source/source/main.cpp:8:33: error: expected namespace-name before ';' token
using namespace std::this_thread; // sleep_for, sleep_until
                                 ^
/source/source/main.cpp:9:22: error: 'chrono_literals' is not a namespace-name
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
                      ^
/source/source/main.cpp:9:37: error: expected namespace-name before ';' token
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
                                     ^
/source/source/main.cpp: In function 'int main(int, char**)':
/source/source/main.cpp:55:14: error: unable to find numeric literal operator 'operator""s'
    sleep_for(2s);
              ^
/source/source/main.cpp:55:16: error: 'sleep_for' was not declared in this scope
    sleep_for(2s);
                ^
/opt/devkitpro/devkitARM/base_rules:79: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
Makefile:126: recipe for target 'build' failed
make: *** [build] Error 2

Does anyone know what I am doing wrong?
 
Last edited by CuriousTommy,

GalladeGuy

Cool and Epic
Member
Joined
Oct 28, 2015
Messages
2,686
Trophies
1
XP
3,105
Country
United States
Is it possible to use the for_sleep function on the 3DS? I making a silly 3DS program that gives a prompt with the user pressing the button to change the amount. But the error messages disappear too fast before the user the read the message.

Here is a link to my source code: https://gist.github.com/CuriousTommy/ff14de96428e8e503697f55c7020a366

I make a simple version to compile for Linux and this code works fine:
Code:
#include <iostream>
#include <chrono>
#include <thread>

using namespace std;
using namespace std::this_thread;     // sleep_for, sleep_until
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
using std::chrono::system_clock;

int main()
{
    cout << "For five seconds" << endl;
    sleep_for(5s);
    cout << "Hello World" << endl;
    return 0;
}

But when applying it to my 3ds code, I get this error message...
Code:
docker run --user `id -u` -v $(pwd):/source -it devkitpro make
main.cpp
arm-none-eabi-g++ -MMD -MP -MF /source/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -I/source/include -I/opt/devkitpro/libctru/include -I/source/build -DARM11 -D_3DS -fno-rtti -fno-exceptions -std=gnu++11 -c /source/source/main.cpp -o main.o
/source/source/main.cpp:8:22: error: 'this_thread' is not a namespace-name
using namespace std::this_thread; // sleep_for, sleep_until
                      ^
/source/source/main.cpp:8:33: error: expected namespace-name before ';' token
using namespace std::this_thread; // sleep_for, sleep_until
                                 ^
/source/source/main.cpp:9:22: error: 'chrono_literals' is not a namespace-name
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
                      ^
/source/source/main.cpp:9:37: error: expected namespace-name before ';' token
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
                                     ^
/source/source/main.cpp: In function 'int main(int, char**)':
/source/source/main.cpp:55:14: error: unable to find numeric literal operator 'operator""s'
    sleep_for(2s);
              ^
/source/source/main.cpp:55:16: error: 'sleep_for' was not declared in this scope
    sleep_for(2s);
                ^
/opt/devkitpro/devkitARM/base_rules:79: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
Makefile:126: recipe for target 'build' failed
make: *** [build] Error 2

Does anyone know what I am doing wrong?
This_thread and chrono_literals don't exist, sleep_for is undefined, and there should be no "s" after the number of seconds.
 

CuriousTommy

Well-Known Member
Member
Joined
Jul 22, 2014
Messages
524
Trophies
0
Age
27
XP
647
Country
United States
This_thread and chrono_literals don't exist, sleep_for is undefined
At first, I had that error when I didn't include chrono and thread header in my Linux test source code, but once I added that, the problem was fixed. However, even when I included chrono and thread in the header for the 3ds source code, I still have the same error message.

there should be no "s" after the number of seconds
The reason why I did that was because the example on stackoverflow did that (used ns instead of s) and it does work (at least the Linux example compiled fine with there being an s)
 
D

Deleted User

Guest
Is it possible to use the for_sleep function on the 3DS? I making a silly 3DS program that gives a prompt with the user pressing the button to change the amount. But the error messages disappear too fast before the user the read the message.

Here is a link to my source code: https://gist.github.com/CuriousTommy/ff14de96428e8e503697f55c7020a366

I make a simple version to compile for Linux and this code works fine:
Code:
#include <iostream>
#include <chrono>
#include <thread>

using namespace std;
using namespace std::this_thread;     // sleep_for, sleep_until
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
using std::chrono::system_clock;

int main()
{
    cout << "For five seconds" << endl;
    sleep_for(5s);
    cout << "Hello World" << endl;
    return 0;
}

But when applying it to my 3ds code, I get this error message...
Code:
docker run --user `id -u` -v $(pwd):/source -it devkitpro make
main.cpp
arm-none-eabi-g++ -MMD -MP -MF /source/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -I/source/include -I/opt/devkitpro/libctru/include -I/source/build -DARM11 -D_3DS -fno-rtti -fno-exceptions -std=gnu++11 -c /source/source/main.cpp -o main.o
/source/source/main.cpp:8:22: error: 'this_thread' is not a namespace-name
using namespace std::this_thread; // sleep_for, sleep_until
                      ^
/source/source/main.cpp:8:33: error: expected namespace-name before ';' token
using namespace std::this_thread; // sleep_for, sleep_until
                                 ^
/source/source/main.cpp:9:22: error: 'chrono_literals' is not a namespace-name
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
                      ^
/source/source/main.cpp:9:37: error: expected namespace-name before ';' token
using namespace std::chrono_literals; // ns, us, ms, s, h, etc.
                                     ^
/source/source/main.cpp: In function 'int main(int, char**)':
/source/source/main.cpp:55:14: error: unable to find numeric literal operator 'operator""s'
    sleep_for(2s);
              ^
/source/source/main.cpp:55:16: error: 'sleep_for' was not declared in this scope
    sleep_for(2s);
                ^
/opt/devkitpro/devkitARM/base_rules:79: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
Makefile:126: recipe for target 'build' failed
make: *** [build] Error 2

Does anyone know what I am doing wrong?

Use svcSleepThread(). It's in <3ds.h>. Here's an example: https://github.com/TheKingy34/arm11loaderhax/blob/master/source/main.c
 
  • Like
Reactions: CuriousTommy

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    OctoAori20 @ OctoAori20: Nice nice-