Homebrew Homebrew Development

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,032
Country
United States
About sftdlib, I can compile sample without problems, it runs on citra, but when I try to lauch it via HBL on 9.6 o3ds, it just freeze with a red bottom screen and a "colored" top screen.
Note that I can boot it using 3dslink!
I am using the latest version of sftd, tested with both libctru 1.0 & 1.1 .
Can anyone try to help me ?
Is your source code somewhere I can look at it? GitHub or the like would be best - don't have access to a computer at the moment - just my phone.

As a note citra is super forgiving with access violations and other things that will cause real hardware to lock-up.
 

randomdev

Well-Known Member
Member
Joined
Jun 7, 2015
Messages
155
Trophies
0
XP
236
Country
Brazil
Is your source code somewhere I can look at it? GitHub or the like would be best - don't have access to a computer at the moment - just my phone.

As a note citra is super forgiving with access violations and other things that will cause real hardware to lock-up.
I'm on my phone too, basically I can compile the sample, run it on citra AND on my 3ds by using 3dslink, but got a red screen when trying to launch it in normal way via HBL. All is here https://github.com/xerpi/sftdlib?files=1
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Trying to packing a 3dsx with the --romfs option, 3dsxtool crashes. My ctrulib is updated to the latest version.

Does someone else experienced the same problem?

PS: I have a windows 64bit OS.
 

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
For the 3d engine wizards:
I got my font rendering working using the 3D engine, but suppose if I want to invert the colours of the text like a selected object?

My lazy ass goto would be to have a 2nd font source with the colours inverted but I was wondering if there was an existing way to do this with the 3D engine.
 

MasterFeizz

Well-Known Member
Member
Joined
Oct 15, 2015
Messages
1,098
Trophies
1
Age
29
XP
3,710
Country
United States
For the 3d engine wizards:
I got my font rendering working using the 3D engine, but suppose if I want to invert the colours of the text like a selected object?

My lazy ass goto would be to have a 2nd font source with the colours inverted but I was wondering if there was an existing way to do this with the 3D engine.
Use a white font, change the vertex colors.
 
  • Like
Reactions: TarableCode

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
Use a white font, change the vertex colors.

So this requires me to:

Modify the shader to accept an input colour.
Add another AttrInfo loader for the input colour.
Add another call to C3D_SendImmAttrib after the tex coords with the colour values.
?

That's what I've done so far and it's ignoring the colour values I send.
If I remove the calls to send the vertex colour the text will not show up at all, I've even temporarily modified the shader to put a constant value into outclr.

It's quite possible that again I'm still blindly fiddling my way through 3D land and It's something really dumb I'm missing.

Edit:
I was missing the TexEnv stuff, all solved now and sorry for bothering :)

Edit 2:
Spoke too soon lol, the colour constant works but the colours I'm sending via C3D_SendImmAttrib are being ignored.
 
Last edited by TarableCode,

MasterFeizz

Well-Known Member
Member
Joined
Oct 15, 2015
Messages
1,098
Trophies
1
Age
29
XP
3,710
Country
United States
So this requires me to:

Modify the shader to accept an input colour.
Add another AttrInfo loader for the input colour.
Add another call to C3D_SendImmAttrib after the tex coords with the colour values.
?

That's what I've done so far and it's ignoring the colour values I send.
If I remove the calls to send the vertex colour the text will not show up at all, I've even temporarily modified the shader to put a constant value into outclr.

It's quite possible that again I'm still blindly fiddling my way through 3D land and It's something really dumb I'm missing.

Edit:
I was missing the TexEnv stuff, all solved now and sorry for bothering :)

Edit 2:
Spoke too soon lol, the colour constant works but the colours I'm sending via C3D_SendImmAttrib are being ignored.
I've never used citro3d, but the steps you wrote above seems right. Basically pass the color attribute to the shader and set the texEnv correctly.
 

YugamiSekai

Mr. Picross
Member
Joined
Dec 24, 2014
Messages
2,015
Trophies
1
Age
22
XP
2,285
Country
United States
I decided I would attempt to port this so I made this github repo.
But then I realized I have no Idea what I'm doing.
so is there any tutorial anywhere that can teach me to make 3ds homebrew so that I can learn to port this?
There's not much tutorials out there. And even those only cover the bare minimum. I guess I can start making one once I get a little more knowledge in C.
 

YugamiSekai

Mr. Picross
Member
Joined
Dec 24, 2014
Messages
2,015
Trophies
1
Age
22
XP
2,285
Country
United States

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,032
Country
United States
https://mega.nz/#!bIhHHI7S!IoF2TbWHVBOaqT23IKwg5mcZLqxoTzrsqS6BYNq1_A0 You'll need a MEGA account or a PC (to download without account).

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

How does one port a game? Is it a specific way for 3ds or is it like other systems? (I know the source code has to be available)
Basically the same as other systems. Replace or remove the platform specific parts with something that will work on the 3ds. This is typically input, sound, and display. The display can be as simple as pointing the code at the 3ds frame buffer or all the way up to replacing 3D hardware calls with 3ds equivalents. Sometimes you may need to replace win32/dos io calls with either stdio equivalents or native 3ds.
 

ElyosOfTheAbyss

Well-Known Member
Member
Joined
Aug 20, 2015
Messages
2,225
Trophies
1
XP
1,901
Country
Quick question:
Code:
C:\Users\adrian\Documents\GitHub\Super-Tux-3DS>make
make[1]: *** No rule to make target `credits.txt.o', needed by `/c/Users/adrian/
Documents/GitHub/Super-Tux-3DS/Super-Tux-3DS.elf'.  Stop.
make: *** [build] Error 2

C:\Users\adrian\Documents\GitHub\Super-Tux-3DS>
I have no clue on what this means. Does anyone know?
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,032
Country
United States
Quick question:
Code:
C:\Users\adrian\Documents\GitHub\Super-Tux-3DS>make
make[1]: *** No rule to make target `credits.txt.o', needed by `/c/Users/adrian/
Documents/GitHub/Super-Tux-3DS/Super-Tux-3DS.elf'.  Stop.
make: *** [build] Error 2

C:\Users\adrian\Documents\GitHub\Super-Tux-3DS>
I have no clue on what this means. Does anyone know?
It looks like it is trying to compile the credits.txt file which is in the data directory. The template makefile assumes everything in the data directory needs to be converted to a .o file and included as raw data. This is generally not done with text files so there is no rule to convert them. the template makefile is not going to work with this project without extensive modifications. Are you not able to build the project using cmake?
 

ElyosOfTheAbyss

Well-Known Member
Member
Joined
Aug 20, 2015
Messages
2,225
Trophies
1
XP
1,901
Country
It looks like it is trying to compile the credits.txt file which is in the data directory. The template makefile assumes everything in the data directory needs to be converted to a .o file and included as raw data. This is generally not done with text files so there is no rule to convert them. the template makefile is not going to work with this project without extensive modifications. Are you not able to build the project using cmake?
Can Cmake convert to .o or something? Never heard of it
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
I decided I would attempt to port this so I made this github repo.
But then I realized I have no Idea what I'm doing.
so is there any tutorial anywhere that can teach me to make 3ds homebrew so that I can learn to port this?


Tutorial on coding c: there are a lot on internet

Tutorial on coding c on 3ds: no, but there are the ctrulib examples (a beginners has to study them very weel) and a lot of simple homebrew to analyze

Tutorial to porting a graphical PC game on a small fixed size screen, with low cpu resources, no default libraries like SDL and a lot of low lwvwl calls to OS to know: forget it :)

I defined some code patterns to port the sdl calls (key input, graphics and sound) that I'm using on my ports of emulators and on the port of syobon action: you can look at my code on github.

But I sugest to start with a simpler game to port, superTux is too complex for a first project.

You could start with SDL pacman or something similar, with some exerience it's possible to have a first basic port of such a game in a day of work, but there ar always small problems to fix using all your ingenuity.

With a small project I could give you some hints, if you leave me time to answer when I can.

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

Can Cmake convert to .o or something? Never heard of it

bin2c convert a generic binary file to an aray that the code can read without loading from file. 3ds uses a simpler way, romfs (that I started using only few days ago :D).

and don't waste time with that makefile, it miss a lot of things (first libararies declarations). It will never work
 
Last edited by nop90,

ElyosOfTheAbyss

Well-Known Member
Member
Joined
Aug 20, 2015
Messages
2,225
Trophies
1
XP
1,901
Country
bin2c convert a generic binary file to an aray that the code can read without loading from file. 3ds uses a simpler way, romfs (that I started using only few days ago :D).

and don't waste time with that makefile, it miss a lot of things (first libararies declarations). It will never work
I'm a bit confused here. Don't you need a makefile to compile homebrew?
 

Site & Scene News

Popular threads in this forum

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