Homebrew Homebrew Development

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
So, I didnt know where to post this at so I'm asking my question here, is there a guide on how to MAKE Homebrew? not just being able to compile it/Collection of tools...... Sorry if this is in a wrong section
First learn C through one of many tutorials online. Then learn the specific 3ds functions/API by playing around with the examples included in ctrulib.
https://github.com/smealum/ctrulib/tree/master/examples
 

Clydefrosch

Well-Known Member
Member
Joined
Jan 2, 2009
Messages
6,024
Trophies
2
XP
4,623
Country
Germany
hey there, not sure if this is the right topic (its probably not but you guys most likely know) but I didn't want to make a new one just for this question
i'm on 9.9.0-26 E on an old 3ds with theme and tubehax working.
is there a reason for me not to update atm? cause there's some games that want patches from the eshop but i cant go there without updating and all
 
Last edited by Clydefrosch,

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Nevermidn, that isn't it since it hangs somewhere in this code:
Code:
int dim;
             char* query;
             if (totalSongs == 0){
               query = malloc(2);
               query[0] = ':';
               query[1] = 0;
               dim = 1;
             }else{
               query = parseSongs(songList, totalSongs);
               dim = 128*totalSongs;
             }

Which is extremely weird

I found something really weird in the code. It seems the send after the failed printf is correctly working, in fact, my 3DS socket receive the data normally.
What should happened?
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
It could be possible that the
sleep(1); isn't long enough for the text to print before the sockets takes over.
But that's pretty unlikely.
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
It could be possible that the
sleep(1); isn't long enough for the text to print before the sockets takes over.
But that's pretty unlikely.

When i'll get the 3DS side working i'll try to increase the sleep value.
Stucked with 3DS side with the soc:U random initialization fail...

http://pastebin.com/M4erXPNb This code works fine.
If i de-comment the graphic related code (the 4 lines in the else clause), soc:U fails to initialize (and this code is never executed if soc:U fails to start.
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
It could be possible that the
sleep(1); isn't long enough for the text to print before the sockets takes over.
But that's pretty unlikely.

Solved that strange problem by replacing all the printf calls with write syscalls (it should be what implicitly printf does but it seems it's a bit confused about sockets and stdout).
 
Last edited by Rinnegatamante,

rafalince

Well-Known Member
Member
Joined
Jul 4, 2015
Messages
115
Trophies
0
Age
34
XP
213
Country
Brazil
Oh , sorry and thanks. It did not Appeared in my pc. But Now i can see the link. Can i use that to do a downgrade and install CFW RXTOOLS to access the homebrew offline in future ?
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
Oh , sorry and thanks. It did not Appeared in my pc. But Now i can see the link. Can i use that to do a downgrade and install CFW RXTOOLS to access the homebrew offline in future ?
Nope, that's not possible with the current exploits we know
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Is there something strange in this piece of code?

Code:
// Sending command to client
   char cmd[10];
   sprintf(cmd, "exec1:%i", idx);
   cmd[9] = 0;
   socketSend(Client, cmd);
  
   // Getting file info
   while (pkg == NULL) pkg = socketRecv(Client, 64);
   infoPacket = (char*)pkg->message;
   Songlist* song = getSong(idx);
  
   u64 fileSize = atoi(infoPacket);
   socketSend(Client, "OK");

First socketSend works correctly but 3DS crashes before sending the second ones.

(pkg is a Packet struct containing an array of char (nam), an u8* (message) allocated with linearAlloc and a u32 (size)).

What socketRecv should receive is the size of a file sent with this piece of code:
Code:
char info[64];
memset(&info, 0, 64);
sprintf(info, "%i", size);
write(my_socket->sock, info, 64);
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Is there some limitations about packet size for socketing?

It seems trying to receive something about 500 KB as packet corrupt it.

Here's my 3DS code (Receiver):
Code:
while (pkg == NULL) pkg = socketRecv(Client, 16384);
         u32 processedBytes = 0;
         songFile->audiobuf = (u8*)linearAlloc(songFile->mem_size);
         while (processedBytes < songFile->mem_size){
           if (pkg == NULL) break;
           memcpy(&songFile->audiobuf[processedBytes], pkg->message, pkg->size);
           processedBytes = processedBytes + pkg->size;
           linearFree(pkg->message);
           free(pkg);
           pkg = socketRecv(Client, 16384);         
         }

And here's PC ones (Sender):
Code:
char* buffer = malloc(STREAM_SIZE);
                 fread(buffer, STREAM_SIZE, 1, currentSong);
                 print("\nGET_SONG: Sending first block...");
                 write(my_socket->sock, buffer, STREAM_SIZE);
                 print(" Done!");
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
Is there some limitations about packet size for socketing?
No, else you wouldn't be able to use ftpservers for files bigger then 500KB as well.
I can't see anything wring with the code you've shown.
Maybe it's a problem with another part of the code.
Are you trying to stream a song? i might try that out tonight, will let you know if i can get it to work.
 

Trinitro21

Well-Known Member
Member
Joined
Oct 14, 2015
Messages
133
Trophies
0
Location
Userland
XP
206
Country
United States
You could take a look at the sf2d library
Alright, I'll look at it, but I'm interested in using the GPU functions in my programs. Specifically 3D stuff, which I'm pretty sure sf2dlib doesn't do. But the source code might be helpful since there are descriptions of what each function does.
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
Alright, I'll look at it, but I'm interested in using the GPU functions in my programs. Specifically 3D stuff, which I'm pretty sure sf2dlib doesn't do. But the source code might be helpful since there are descriptions of what each function does.
portal3DS in that case,
here is its source:
https://github.com/smealum/portal3DS
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Right onto uremums 3d printed dildo