Page 1 of 1

Homebrew - External files?

Posted: Mon Jun 26, 2006 10:17 am
by Kojima
I'm new at this so I don't know the inner workings yet, but one thing just struck me. How do you access external files/models/textures etc in ps2 homebrew using ps2link?(Or naplink even)

I have a modded ps2, am I right in thinking once you require external media you have to either A) pack them in the source like on a gba etc or B) Start burning your game and media to cd every time and running directly?

I can do either without problem, I'd just rather know for sure I'm using the best method everyone else is.

Posted: Mon Jun 26, 2006 10:23 am
by Drakonite
ps2link provides this nifty 'host0' filesystem, which lets you read files from your pc

Posted: Mon Jun 26, 2006 10:58 am
by Kojima
Very nice, I wasn't looking forward to burning a game every build.

Know how it compares to reading from a dvd drive speed wise? I heard pslink transmits at 100mbs so I guess pretty good? (Said the bloke who had no idea at what speed a dvd is read)

Posted: Mon Jun 26, 2006 12:08 pm
by jbit
The PS2 ethernet hardware is 100mbps. But the PS2 IP stack is very slow and unoptimized at the moment, you're lucky if you see 5-10mbit/sec.
And ontop of that "host:" is still a bit flakey, music will skip when streaming audio for example.
Some of us are in the process of fixing the PS2 IP stack, so it should get better in the future.
But for now, I wouldn't expect any decent speed out of the "host:" filesystem.

Posted: Mon Jun 26, 2006 12:32 pm
by Drakonite
In the majority of cases you are likely to hit anytime soon, it should be 'good enough' ...

The main thing to keep in mind is to be smart about things; probably the biggest no-no to avoid is doing lots of small reads. Doing lots of small reads is horribly slow.

Posted: Mon Jun 26, 2006 12:40 pm
by Kojima
yeah it should be enough, I'm just learning at the moment so I don't expect to be greating 50gb games with a hundred levels.
Just very cool that I can stream data if needed.


jbit, expect to gain any big speed increases with your IP stack fix or will it just be more consistant? (I'm guessing it stalls based on his no small reads comment)

Posted: Mon Jun 26, 2006 1:09 pm
by Kojima
Btw, Drakonite is there any special way of reading the host 'drive' or is it does it integerate as the local dir?

I.e would I do,

blah = fopen("Somefile.txt");

or

blah = fopen("host:\somefile.txt")

or a 3rd option?

Sorry if it's a dumb question :)

Posted: Mon Jun 26, 2006 9:26 pm
by Drakonite
blah = fopen("host:somefile.txt");

Posted: Mon Jun 26, 2006 11:47 pm
by Kojima
Ta.

Good work on ps2link btw. I can't believe I've had a ps2 for over a year and only just now discovered your program as means to do homebrew.

Use the files Luke, the files.

Posted: Wed Jun 28, 2006 8:05 pm
by Kojima
Hey drak is it possible to write a file on the pc side as well?

I mean what would happen if I did something like (And the code will be wrong, I've been using C# for too long) fwrite("host:screenshot.raw")

could I then dump the screenbuffer pc side?

If not I suggest adding it please :) I think it would be a great feature for those of us without screen captures etc.

Posted: Wed Jun 28, 2006 8:17 pm
by cheriff
That's entirely possible. Not only that, but there is a debug.h floating around in the sdk somewhere which contains a function to dump the screen buffer to a tga file.. which for me usually is "host:sshot.tga".

Posted: Wed Jun 28, 2006 11:16 pm
by Kojima
nice, shame the connection isn't 100mbs then we could do caching etc on the hd, open up the possiblities for deus ex style games.(Best game ever made by a man not called Hideo Kojima)