LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Getting PetitComputer Programs off a 3DS?

Root / Programming Questions / [.]

amihartCreated:
I recently fired up PetitComputer which I hadn't touched in years and found a bunch of old programs I had written and was thinking of trying to port them to SmileBASIC. All my old programs are still there from when I did a data transfer from DSi to 3DS. The issue is, I can't get them off the 3DS. The "save to SD card" feature softlocks. Is there already a good solution out there to get files out of PetitComputer or do I need to hack together a solution myself?

I think it's your console, I am able to save to SD card

I think it's your console, I am able to save to SD card
Which one do you have? I have a new 3DS fully up to date. I can't think of anything special about my console that would cause it to softlock.

Is your SD card properly formatted/working properly/is there enough free space? The feature has always worked for me; I previously used a o3DS before switching to the new 2DS XL I now use. No clue why your system wouldn't like it. I would suggest reinstalling PTC but I believe that causes you to lose all of your save data to no avail. You really have no options beyond "type them by hand" because you can't even make a petitmodem clone in PTC

Is your SD card properly formatted/working properly/is there enough free space?
There's definitely nothing wrong with my SD card as I use this SD card for everything on my 3DS and never had trouble with it.
I would suggest reinstalling PTC but I believe that causes you to lose all of your save data to no avail.
Can you even do that? I believe PTC is no longer available, I don't know how Nintendo is with letting you redownload games no longer offered.
You really have no options beyond "type them by hand" because you can't even make a petitmodem clone in PTC
It wouldn't be hard to set up something to let you transfer the programs by sound, it just would be really slow because you can't represent the program as interwoven sine waves. But you can play sound and stop playing sound at controlled intervals (with something like BGMPLAY), which can act as 1 bit, and 1 bit and a defined protocol is all you need. It'd be... incredibly slow, but the largest program I ever wrote for the original PetitComputer was about 6000 bytes, so if I got it to run at 0.5 bytes/second I could just leave it and it'd take about three hours to run, which I've let my 3DS idle transferring stuff much longer with PetitModem.

You can't load PRG files as text strings in PTC. It's impossible. You actually cannot make a petitmodem clone.

You can't load PRG files as text strings in PTC. It's impossible. You actually cannot make a petitmodem clone.
Just delete the newline characters and you can transfer it as a string.

No, what I mean is, there is no function in PTC akin to loading a file as TXT in SB. A program in PTC cannot read the source text of another program, or its own, unlike in SB. Even if that were possible, a single string in PTC cannot be longer than 256 characters. You could use a string array, but I believe there's some asinine limit to that as well. The closest resource type you had to TXT in PTC was MEM, but that was just a special string variable, and it was a fixed file type in a specific format.

No, what I mean is, there is no function in PTC akin to loading a file as TXT in SB. A program in PTC cannot read the source text of another program, or its own, unlike in SB. Even if that were possible, a single string in PTC cannot be longer than 256 characters. You could use a string array, but I believe there's some asinine limit to that as well. The closest resource type you had to TXT in PTC was MEM, but that was just a special string variable, and it was a fixed file type in a specific format.
Yes I can read. Hence why I mentioned turning it to a string by hand. Not sure the max size of a string array I'll have to see if it's possible for larger programs.

-SNIP- Yes I can read. -SNIP-
snail_ didn't say you couldn't

You probably could make something like petit modem in PTC (not counting the file type limitations) because it DOES have WAVSET (I think it was called BGMPRG in PTC) Really though, I think it would take less time to just copy the programs out by hand.

Does the Save to SD option actually softlock or do you just need to wait for it to finish loading?

Have you tried copying all the data onto another SD card?

I don't know how you'll manage turning the program into a string if you can't even read it. Maybe I'm the dumb one here idk The conceit here is to get PRG files (programs) off without using the Save to SD card button by writing a Petit Computer program (or PRG) if you will. There's only two things you can do with PRG files in Petit: load them in the editor and run them. There is no TXT loading OR PRG slot editing functions, so as far as I'm aware there's zero way to "convert them into a string." Unless you intend to edit the System Memory and convert them all into another format, or you've found a really useful undocumented function. I'm really not trying to insist you don't know anything, I'm just not sure my point is getting across (or if I'm failing to entirely see yours.) If you know away you can manage to do this I'd actually love to see it.

Does the Save to SD option actually softlock or do you just need to wait for it to finish loading?
Well all the animations on the screen freeze and it just sits there. How long does it usually take? Is it normal for a small ~1000 byte program to take over 5 minutes? I could let it sit overnight and see if it finishes, I haven't tried that yet.
Have you tried copying all the data onto another SD card?
I only have this one.
I don't know how you'll manage turning the program into a string if you can't even read it. Maybe I'm the dumb one here idk
All I meant when I said "by hand" way like,
PRINT 1
PRINT 2
PRINT 3
to something like this:
DIM DAT$[3]
DAT$[0]="PRINT 1"
DAT$[1]="PRINT 2"
DAT$[2]="PRINT 3"
You could use the copy/paste function to speed it up and it'd theoretically be a lot faster to do that on a large program than copy the entire thing by hand. It'd still be tedious but it'd make the job go by a little faster.

Oh, I see what you mean. Not an automated process per se, but I guess it's a process. If you don't want to use a string array, perhaps for memory limits, you can use a DATA block and READ one string at a time. I also don't think this process will be possible on programs that are right below the size limit but if you aren't transfering any of those that's not a problem I guess. EDIT: It would actually be easier to use a DATA block because all you would have to do is put DATA" on a function key and press it at the beginning of every line (and properly escape strings, somehow). Then you just need to use a special marker string at the end that says "this is the end" (I'd use a dingbat character that doesn't mean anything in syntax). Now you don't have to number all the lines or keep track of how big the array is.

It would actually be easier to use a DATA block because all you would have to do is put DATA" on a function key and press it at the beginning of every line (and properly escape strings, somehow). Then you just need to use a special marker string at the end that says "this is the end" (I'd use a dingbat character that doesn't mean anything in syntax). Now you don't have to number all the lines or keep track of how big the array is.
Oh that sounds like a good idea, thanks! I'll look into trying that. I'll also look into trying other SD cards. It could be that I have a very large SD card that it doesn't like the format or something, I know some older systems don't support larger SD card formats.

If your 3DS has CFW, you can dump the save file and mount it as a FAT12 image on your PC. You'll have to convert some files to different formats and trim parts off other files, but it definitely works

I think it's your console, I am able to save to SD card
Which one do you have? I have a new 3DS fully up to date. I can't think of anything special about my console that would cause it to softlock.
mine is a old 3ds w/ luma

did I miss something?