Homebrew - External files?

General, off-topic discussion about things of interest to the members of these forums.

Moderator: cheriff

Post Reply
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Homebrew - External files?

Post 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.
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

ps2link provides this nifty 'host0' filesystem, which lets you read files from your pc
Shoot Pixels Not People!
Makeshift Development
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post 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)
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Post 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.
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post 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.
Shoot Pixels Not People!
Makeshift Development
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post 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)
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post 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 :)
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

blah = fopen("host:somefile.txt");
Shoot Pixels Not People!
Makeshift Development
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post 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.
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Use the files Luke, the files.

Post 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.
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post 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".
Damn, I need a decent signature!
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post 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)
Post Reply