Homebrew Homebrew Development

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil

intermet

Well-Known Member
Member
Joined
Jul 19, 2012
Messages
152
Trophies
0
XP
138
Country
France
WORD w;
FRESULT res;
FATFS fs;
pf_mount(&fs);
res=pf_open("file");
res=pf_write("z",1,&w);
res = pf_write(0,0,&w);

I get a grey screen with this code but it seems to run if a comment the last line (but of course the data wont be writed).
Why?
Thank you ! :lol:
 

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
WORD w;
FRESULT res;
FATFS fs;
pf_mount(&fs);
res=pf_open("file");
res=pf_write("z",1,&w);
res = pf_write(0,0,&w);

I get a grey screen with this code but it seems to run if a comment the last line (but of course the data wont be writed).
Why?
Thank you ! :lol:

Have a lot of problem with fatFS, you will need edit the "ffconf.h" to use f_write, after it, a good sample how use f_write:
Code:
        FATFS FatFs;
FIL fil;
DIR dir;
FRESULT fr;
        UINT br = 5;
        u32 br_abs = 0;
        u32 cont = 0;
 
 
        p("Mount");
        fr = f_mount(&FatFs, "", 0);
ps((u32)fr);
 
 
p("File Open");
fr = f_open(&fil, "DUMP.BIN", FA_CREATE_ALWAYS | FA_WRITE);
ps((u32)fr);
UINT bw;
p("LALALA DUMP");
 
 
for(;;){
print_u32(cont, 250, 100, 0xFF,0x0,0xFF);
fr = f_write(&fil,  ((unsigned char*)0x0LALALA000000 + cont), 0x00100000, &bw);
 
        }
 

intermet

Well-Known Member
Member
Joined
Jul 19, 2012
Messages
152
Trophies
0
XP
138
Country
France
Have a lot of problem with fatFS, you will need edit the "ffconf.h" to use f_write, after it, a good sample how use f_write:
Code:
        FATFS FatFs;
FIL fil;
DIR dir;
FRESULT fr;
        UINT br = 5;
        u32 br_abs = 0;
        u32 cont = 0;
 
 
        p("Mount");
        fr = f_mount(&FatFs, "", 0);
ps((u32)fr);
 
 
p("File Open");
fr = f_open(&fil, "DUMP.BIN", FA_CREATE_ALWAYS | FA_WRITE);
ps((u32)fr);
UINT bw;
p("LALALA DUMP");
 
 
for(;;){
print_u32(cont, 250, 100, 0xFF,0x0,0xFF);
fr = f_write(&fil,  ((unsigned char*)0x0LALALA000000 + cont), 0x00100000, &bw);
 
        }

I tested this code :

FATFS fs;
FIL fil;
FRESULT res;

res=f_mount(&fs,"",0);
p("Mounted");
res =f_open(&fil,"file",FA_CREATE_ALWAYS);
p("Opened");

but it freeze at res =f_open(&fil,"file",FA_CREATE_ALWAYS);
 

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
I tested this code :

FATFS fs;
FIL fil;
FRESULT res;

res=f_mount(&fs,"",0);
p("Mounted");
res =f_open(&fil,"file",FA_CREATE_ALWAYS);
p("Opened");

but it freeze at res =f_open(&fil,"file",FA_CREATE_ALWAYS);


f_open(&fil,"file",FA_CREATE_ALWAYS)

Change
f_open(&fil,"file",FA_CREATE_ALWAYS | FA_WRITE);

Try now.


smealum

can you explain more how the Audio work ? Thanks.
 

Bond697

Dies, died, will die.
Member
Joined
Jun 7, 2009
Messages
350
Trophies
0
Age
39
Location
CT
XP
464
Country
United States
wow, i told you what arm9 functions to use to open, read, and write files, the exact arguments for all 3 functions, how to get access to the memory you want to dump, how to make other areas available to yourself, what exactly to do with all of them, i even spent time answering ridiculous question after ridiculous question because you didn't know what to do even after being handed literally everything, and this is what you do with it? try to get yourself some attention by posting (illegal, by the way) stuff that's been posted before here and on twitter? what a damn waste.
 

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
wow, i told you what arm9 functions to use to open, read, and write files, the exact arguments for all 3 functions, how to get access to the memory you want to dump, how to make other areas available to yourself, what exactly to do with all of them, i even spent time answering ridiculous question after ridiculous question because you didn't know what to do even after being handed literally everything, and this is what you do with it? try to get yourself some attention by posting (illegal, by the way) stuff that's been posted before here and on twitter? what a damn waste.


i use fatFS not your Process9 fopen/fread/fwrite.
 

smealum

growing up sucks.
Member
Joined
May 1, 2006
Messages
635
Trophies
2
Age
31
Location
SF
Website
www.smealum.net
XP
2,515
Country
United States
CSND_playsound(u32 channel, u32 looping, u32 encoding, u32 samplerate, u32 *vaddr0, u32 *vaddr1, u32 totalbytesize, u32 unk0, u32 unk1);


About the "CSND_PlaySound", the *encoding* is the Audio ? and this *vaddr0/vaddr1* what is it ?

Thank you xD

as you should be able to tell from my link, that code was written by yellows8, not me. I have never used any of these commands so he should definitely be the one you ask for help

Someone tried a way to list all files in folder with ctrulib ?

this should help : https://gist.github.com/smealum/249b0e5598409f78b5eb
it's part of the source of a very old/crappy/buggy ftp server i wrote for ctrulib. no guarantee it'll compile on latest version, but it should show how to use FSUSER_OpenDirectory as that hasn't changed. and as a bonus there's some SOC code in there too.
 
  • Like
Reactions: redact and st4rk

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
as you should be able to tell from my link, that code was written by yellows8, not me. I have never used any of these commands so he should definitely be the one you ask for help



this should help : https://gist.github.com/smealum/249b0e5598409f78b5eb
it's part of the source of a very old/crappy/buggy ftp server i wrote for ctrulib. no guarantee it'll compile on latest version, but it should show how to use FSUSER_OpenDirectory as that hasn't changed. and as a bonus there's some SOC code in there too.


Very nice, i will see it, i need to complete my little 3DNES :P
 

ernilos

Well-Known Member
Member
Joined
Aug 28, 2013
Messages
145
Trophies
0
Location
CAT
XP
280
Country
United States
Loooong time I didn't played with 3DS, I done a little 3DS file explorer (thank's to smea gist)

Control's:
-Key Up & key down move current menu position
-A Handle different event if its an directory, file or just is trying to go back
-B It goes to the previous path
I post the source code for if someone is interested on it:
https://mega.co.nz/#!tR1XhZwL!FHVm6TPD_Y39CM5epoAWEb0kXc_TrxPUuqHxnooVO0k
It would be cool list first directorys and after sort files by name but I'm too lazy for search/done algorythms xD
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://youtu.be/3eGAHfC5P-Y?si=Fo3iEl1pZ4D_O6dp +1