Homebrew Homebrew Development

ernilos

Well-Known Member
Member
Joined
Aug 28, 2013
Messages
145
Trophies
0
Location
CAT
XP
280
Country
United States
Today finally I had some free time and I finished my port of my old Snake 3DS. I used some stuff of the old library's (like font drawing), and I added a easy sprintf function cause adding stdio.h give me many errors... Also i re-coded eveything of structure of the game and I'll upload it to github, now no cause I have all the code in chaos xD.
DL: https://mega.co.nz/#!pBVnhSwD!V-n16d0HFQF1EoZLXtrE1f6gBNaT5mqD0bHUD1PqnPg
Icon Pic:
kKCgd.png


I know, it have some GPU lag, I don't know why it happens...
 

gamesquest1

Nabnut
Former Staff
Joined
Sep 23, 2013
Messages
15,153
Trophies
2
XP
12,247
Today finally I had some free time and I finished my port of my old Snake 3DS. I used some stuff of the old library's (like font drawing), and I added a easy sprintf function cause adding stdio.h give me many errors... Also i re-coded eveything of structure of the game and I'll upload it to github, now no cause I have all the code in chaos xD.
DL: https://mega.co.nz/#!pBVnhSwD!V-n16d0HFQF1EoZLXtrE1f6gBNaT5mqD0bHUD1PqnPg
Icon Pic:
kKCgd.png


I know, it have some GPU lag, I don't know why it happens...
cool, your "lag" appears to be one of the *screens* flickering you can see it better with one eye closed......kinda trippy if you have 3d on :D

but still very nice work good to see some homebrew emerging
 

bobmcjr

Well-Known Member
Member
Joined
Apr 26, 2013
Messages
1,156
Trophies
1
XP
3,227
Country
United States
Very nice, and yep the right screen is flickering fast/very dim on mine. Kinda odd what it does with 3D off (every other horizontal pixel flashes).
 

HCStealth

Member
Newcomer
Joined
May 14, 2014
Messages
8
Trophies
0
Age
44
Website
www.headcannon.com
XP
110
Country
United States
I keep reading that the 3DS has 128MB of RAM, and according to this post, it seems that up to about 64MB should be available to any given game

I'm attempting to use the template from this post, but when I try to create an array any larger than just over 2MB, the linker complains about overflowing the .bss section. It seems that the included linker script defines the section as "2395K", and since I don't know why that value was chosen, I'm hesitant to modify it

I've noticed that light usage of malloc() will compile and link without error, but link errors do start showing up when I try to use the pointers in some cases, so I assume that means that there just isn't a malloc() implementation at all right now. I've considered faking it for the sake of testing what I'm trying to do right now, but I still don't know how to get a large enough memory pool to use

Is there currently a safe way to use (much) more than 2MB?

Also, in response to the screen capture discussion- If you have an original model 3DS and the money for it, this works well. I sent away for one myself and got it back pretty quickly, and haven't had any problems with it at all. Just don't try to install it using a USB extension cable; it won't be properly recognized until after it's already been installed by plugging it in directly, but the cable should work fine afterward. I don't know how many have already heard of it and either can't afford it or don't want to risk it, but I mention it because a software capture solution is bound to become a balancing act between quality and performance, and the hardware capture board catches full frames with no effect on performance
 
D

Deleted User

Guest
You need to use one of the memory mapping/allocation SVCs. Maybe you can ask 3dbrew for help on this
 

Bond697

Dies, died, will die.
Member
Joined
Jun 7, 2009
Messages
350
Trophies
0
Age
39
Location
CT
XP
464
Country
United States
I keep reading that the 3DS has 128MB of RAM, and according to this post, it seems that up to about 64MB should be available to any given game

I'm attempting to use the template from this post, but when I try to create an array any larger than just over 2MB, the linker complains about overflowing the .bss section. It seems that the included linker script defines the section as "2395K", and since I don't know why that value was chosen, I'm hesitant to modify it

I've noticed that light usage of malloc() will compile and link without error, but link errors do start showing up when I try to use the pointers in some cases, so I assume that means that there just isn't a malloc() implementation at all right now. I've considered faking it for the sake of testing what I'm trying to do right now, but I still don't know how to get a large enough memory pool to use

Is there currently a safe way to use (much) more than 2MB?

Also, in response to the screen capture discussion- If you have an original model 3DS and the money for it, this works well. I sent away for one myself and got it back pretty quickly, and haven't had any problems with it at all. Just don't try to install it using a USB extension cable; it won't be properly recognized until after it's already been installed by plugging it in directly, but the cable should work fine afterward. I don't know how many have already heard of it and either can't afford it or don't want to risk it, but I mention it because a software capture solution is bound to become a balancing act between quality and performance, and the hardware capture board catches full frames with no effect on performance

using malloc requires defining an extra symbol or two in the linker script and editing the memory map in (one of?) the linker scripts. idk how exactly the ones you're using are set up, so i can't say. using new and a lot of the STL requires other symbols to be defined. a proper one is actually pretty large.
 

Sylantemp

Active Member
Newcomer
Joined
Jul 20, 2012
Messages
43
Trophies
0
XP
71
Country
United States
using malloc requires defining an extra symbol or two in the linker script and editing the memory map in (one of?) the linker scripts. idk how exactly the ones you're using are set up, so i can't say. using new and a lot of the STL requires other symbols to be defined. a proper one is actually pretty large.


Can you recommend anywhere to find the details on that? I've been hitting some malloc errors while trying to compile one of the ctrulib examples.
 

Bond697

Dies, died, will die.
Member
Joined
Jun 7, 2009
Messages
350
Trophies
0
Age
39
Location
CT
XP
464
Country
United States
if you read the error message(s) from the linker when you try to call malloc, you'll see that __sbrk_r is missing symbol "__end__"(i think that's the name). that was the problem i had, at least. if you check out the linker script(s) in devkitarm, you'll have a better idea of where to put that and maybe how linker scripts work.

also: https://sourceware.org/binutils/docs-2.24/ld/index.html
 

Sylantemp

Active Member
Newcomer
Joined
Jul 20, 2012
Messages
43
Trophies
0
XP
71
Country
United States
if you read the error message(s) from the linker when you try to call malloc, you'll see that __sbrk_r is missing symbol "__end__"(i think that's the name). that was the problem i had, at least. if you check out the linker script(s) in devkitarm, you'll have a better idea of where to put that and maybe how linker scripts work.

also: https://sourceware.org/binutils/docs-2.24/ld/index.html


I actually haven't gotten any such missing symbol linker errors; I directly get an "undefined reference to __sbrk_r".
 

Sylantemp

Active Member
Newcomer
Joined
Jul 20, 2012
Messages
43
Trophies
0
XP
71
Country
United States
you haven't gotten it because sbrk_r isn't even showing up. does your makefile give access to stdlib?


After looking over it and noticing that my makefile would not give access to stdlib, I made a small change to accommodate for that and attempted to compile the example again. There was little significant change, this time giving the error "undefined reference to '_sbrk'".
 

Cjuub

Well-Known Member
Member
Joined
May 25, 2006
Messages
198
Trophies
1
Age
33
XP
2,068
Country
Does anyone know how to write a new file to the SD card in the ARM9 payload? (aka the old method, not GW-homebrew, I don't even have a GW.)

I've looked at some code from here and there seems to be some functions like file_open, file_write etc, but I have no idea on how to use them (where's handle? what's the process ID? flags..?).
I've got the data I want to store in a file, but for now all i can do is output it to the screen. Would really appreciate some example of opening/creating + writing to a new file. :P
 

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
Does anyone know how to write a new file to the SD card in the ARM9 payload? (aka the old method, not GW-homebrew, I don't even have a GW.)

I've looked at some code from here and there seems to be some functions like file_open, file_write etc, but I have no idea on how to use them (where's handle? what's the process ID? flags..?).
I've got the data I want to store in a file, but for now all i can do is output it to the screen. Would really appreciate some example of opening/creating + writing to a new file. :P


In archive4 of kane49 have a example of it :P
 

Cjuub

Well-Known Member
Member
Joined
May 25, 2006
Messages
198
Trophies
1
Age
33
XP
2,068
Country
In archive4 of kane49 have a example of it :P
Any specific example you know is working? The SD code in kanes archive seems to vary between project folders. I've tried doing the following:

Code:
FATFS  fs;
pf_mount(&fs);
pln("mounted");

But it never gets past the mount ("mounted" is never printed).

Am I missing something?
 

Cjuub

Well-Known Member
Member
Joined
May 25, 2006
Messages
198
Trophies
1
Age
33
XP
2,068
Country
Is the SD in your 3ds an SDHC card?

I have tried with both a standard 1GB SD and the 4GB SDHC that came with the system.

Also, I have successfully run kanes FCRAM-dumper before, so it shouldn't be the SD card. Too bad he didn't seem to include the code for that one in his archive. :P

EDIT:
Still no clue on what to do... However I found the address to the PXI services somewhere in Kanes code. Calling the function at 0x0808A928 will do the stuff shown here: http://3dbrew.org/wiki/Filesystem_services_PXI

My question is, before I dive into the inner workings here, can I use fileopen and filewrite here? I'm asking because Kane had some code calling PXI services which I tried and it just froze up (might be trusting Kanes code to much though...).

Also, if anyone feels like answering: what is "PXI" and why is it separate from the services (google confused me here :( )? Is it just services that are in the internal ARM9 memory?
 

Cjuub

Well-Known Member
Member
Joined
May 25, 2006
Messages
198
Trophies
1
Age
33
XP
2,068
Country
Okay, so I experimented a little with the PXI calls and no luck. Pretty sure my requests were formatted correctly but it never returned from the call, unless my request were wrong in which case it returned an error. Did you actually get those PXI calls in 3DS_Arm9_Shenanigans to work, Kane49 ?

Oh, and while I have your attention Kane, please please give me some hints on how to use your file-writing code, as it obviously works in your FCRAM dumper.

Sorry for double post/nagging, but I'm getting really frustrated here. I have the cake but I can't eat it because of one little stupid thing. :P

EDIT:
CRAP

The FAT code in 3DS_Homebrew_stuff is working!!! Wohooo! I guess it just was the other projects it wasn't stable in? I have not tested writing yet, but it should work... I hope. :) Thanks for sharing your code Kane49, it's very helpful and I would be nowhere without it. Just wish it was a little more... User friendly. :P
 

Kane49

Well-Known Member
Member
Joined
Nov 4, 2013
Messages
446
Trophies
0
Age
36
XP
343
Country
Gambia, The
Okay, so I experimented a little with the PXI calls and no luck. Pretty sure my requests were formatted correctly but it never returned from the call, unless my request were wrong in which case it returned an error. Did you actually get those PXI calls in 3DS_Arm9_Shenanigans to work, Kane49 ?

Oh, and while I have your attention Kane, please please give me some hints on how to use your file-writing code, as it obviously works in your FCRAM dumper.

Sorry for double post/nagging, but I'm getting really frustrated here. I have the cake but I can't eat it because of one little stupid thing. :P

The ramdumper uses full fatfs sdmmc library, the pxi methods do not work ^^
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • SylverReZ @ SylverReZ:
    @Materia_tofu, We do learn a lot from plenty of talented individuals.
  • Materia_tofu @ Materia_tofu:
    this is true! i learned how to make soundfont remixes from a friend back in 2021
    +1
  • BakerMan @ BakerMan:
    Update on my brother: He's home now, tired and hungry, obviously, but other than that, seems to be doing fine.
    +2
  • Veho @ Veho:
    That's a relief to hear. Do you know what happened?
  • SylverReZ @ SylverReZ:
    @BakerMan, Any idea what happened? I hope that your brother's doing good.
  • BakerMan @ BakerMan:
    Well, from what I've heard from my parents, he had a seizure last night, perhaps an epileptic episode, fucking died, had a near death experience, my dad called the paramedics, they showed up, took him to the hospital, and he woke up covered in tubes, and started complaining.
  • BakerMan @ BakerMan:
    He couldn't eat until after his MRI, when he had a bomb pop.
  • BakerMan @ BakerMan:
    What matters now is that he's doing alright.
  • Veho @ Veho:
    But you still don't know what it was?
  • Veho @ Veho:
    Has he had seizures before?
  • The Real Jdbye @ The Real Jdbye:
    apparently stress can cause seizures, my brother had one during a test once
  • The Real Jdbye @ The Real Jdbye:
    never had one before that, and never had one since
  • Redleviboy123 @ Redleviboy123:
    Question about game texture chanching Do i need an own game id?
  • The Real Jdbye @ The Real Jdbye:
    @Veho for those that want to
    experience being sonic the hedgehog
  • Veho @ Veho:
    Ah, you mean
    furries.
    +1
  • The Real Jdbye @ The Real Jdbye:
    well, sonic fans are a whole separate thing from furries
  • The Real Jdbye @ The Real Jdbye:
    like bronys
  • The Real Jdbye @ The Real Jdbye:
    sonic porn is too weird even for me
  • Dumpflam @ Dumpflam:
    bruh
  • Dumpflam @ Dumpflam:
    guys how do i delete a post
  • The Real Jdbye @ The Real Jdbye:
    you don't
  • The Real Jdbye @ The Real Jdbye:
    you can report it and request deletion
  • BakerMan @ BakerMan:
    Also, no, that was his first time having a seizure, and hopefully the last
    +1
    BakerMan @ BakerMan: Also, no, that was his first time having a seizure, and hopefully the last +1