Using /pc/ filesystem with DreamSDK?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
glairedaggers
DCEmu Newbie
DCEmu Newbie
Posts: 3
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sun Nov 20, 2022 2:44 pm
Has thanked: 3 times
Been thanked: 0

Using /pc/ filesystem with DreamSDK?

Post by glairedaggers »

Hello,
I've been messing with some Dreamcast homebrew for a few days (experimenting to see if a basic 2D game engine w/ Wren as a scripting language is feasible). I'm using DreamSDK, and have up to now been using the romdisk, however I'm worried that at some point the game's total assets will become too large and it won't be as feasible to store the assets here.
I have seen several references to the /pc/ filesystem, which as far as I can tell would retrieve files over the LAN connection, which'd be perfect I think since the files would just be stored on my PC instead of being always present in RAM. However, I'm not sure how to actually use this in a DreamSDK project. I passed the init flags to enable networking & tried to access some files in /pc/ but it always just failed to open a file handle. I saw some references say that the default location points to my C drive, but that appears to not be the case. I also tried passing flags to dc-tool to change the directory, but it complains that the -c flag isn't valid - maybe the dc-tool is out of date and I have to replace it with a newer version?
Any help would be appreciated!
|darc|
DCEmu Webmaster
DCEmu Webmaster
Posts: 16373
Joined: Wed Mar 14, 2001 6:00 pm
Location: New Orleans, LA
Has thanked: 103 times
Been thanked: 90 times
Contact:

Re: Using /pc/ filesystem with DreamSDK?

Post by |darc| »

You shouldn't need to init the networking, dcload-ip will just handle the functionality for you. It's been a million years since I've used dc-tool on Windows, but on Linux you need to run it using sudo for superuser privileges to use the -c option, so maybe you need to run it as admin?
These users thanked the author |darc| for the post (total 2):
legit nyckglairedaggers
It's thinking...
User avatar
glairedaggers
DCEmu Newbie
DCEmu Newbie
Posts: 3
Joined: Sun Nov 20, 2022 2:44 pm
Has thanked: 3 times
Been thanked: 0

Re: Using /pc/ filesystem with DreamSDK?

Post by glairedaggers »

Ah, gotcha! Thanks for the tip about networking.
The dc-tool process is being kicked off by Code::Blocks so I'm not sure how to make it run as admin - maybe it's enough to just run C::B itself as admin? Otherwise I guess I can just try and manually kick off the dc-tool process from a terminal.

I *was* previously trying to set up KOS myself under Ubuntu on WSL, which almost worked except I couldn't get GDB to compile. Oh well.

EDIT: Oh. I just took a look at the dc-tool source code. It seems to explicitly remove the -c command when compiled under mingw (which is true using DreamSDK). So... I guess I just don't have this option available? Not sure what I'm supposed to use instead. Maybe I just go back and try to get my WSL setup working again instead.
Twada
DC Developer
DC Developer
Posts: 42
Joined: Wed Jan 20, 2016 4:55 am
Has thanked: 18 times
Been thanked: 53 times

Re: Using /pc/ filesystem with DreamSDK?

Post by Twada »

hello.
I may be wrong, but I hope this topic helps you.

https://dreamcast.wiki/Romdisk_Swapping
https://dreamcast.wiki/Filesystem

With Romdisk, all the data is packaged with the binary. Then you will run out of free space.
According to this topic, it should be possible to dynamically swap a Romdisk with another Romdisk.

This forum advises using Debian for WSL. I was fine with that too.
These users thanked the author Twada for the post:
glairedaggers
User avatar
glairedaggers
DCEmu Newbie
DCEmu Newbie
Posts: 3
Joined: Sun Nov 20, 2022 2:44 pm
Has thanked: 3 times
Been thanked: 0

Re: Using /pc/ filesystem with DreamSDK?

Post by glairedaggers »

Yeah I actually just wiped my Ubuntu and tried Debian and it seems to have all compiled & installed correctly, GDB and all, so I might just set that up (which is great, since I honestly would much prefer a VSCode setup to Code::Blocks)
|darc|
DCEmu Webmaster
DCEmu Webmaster
Posts: 16373
Joined: Wed Mar 14, 2001 6:00 pm
Location: New Orleans, LA
Has thanked: 103 times
Been thanked: 90 times
Contact:

Re: Using /pc/ filesystem with DreamSDK?

Post by |darc| »

Glad to hear you've got your issue resolved! Welcome to the forums, btw. Enjoy your stay. :)
These users thanked the author |darc| for the post:
glairedaggers
It's thinking...
TapamN
DC Developer
DC Developer
Posts: 104
Joined: Sun Oct 04, 2009 11:13 am
Has thanked: 2 times
Been thanked: 88 times

Re: Using /pc/ filesystem with DreamSDK?

Post by TapamN »

The -c option is just for chroot, to remap the root of /pc to something besides /. /pc should just work as long as you aren't passing dcload the -n option to disable it. I've used dcload-ip to access files on both Windows and Linux, without using the -c option.

If you're having problems, you can use the file browser in VMU Tool to see what the /pc filesystem looks like from the Dreamcast. Download the unscrambled binary and run it from dcload-ip.

One issue you might run into is slow file access over ethernet. Using the C library stdio.h functions (fread, fwrite) can be much slower than using the KOS filesystem calls directly (fs_read, fs_write) when reading/writing large blocks. With stdio, you get something like tens of KB/sec, while with KOS you can get over 1 MB/sec. Stdio might be faster when preforming many very small operations. dcload-serial doesn't have this issue.
These users thanked the author TapamN for the post (total 2):
|darc|legit nyck
Post Reply