![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on Ebootr isnt dead! within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Kay y'all, here's my current update. I havent been able to put as much effort into Ebootr as I'd like! ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() Join Date: Apr 2009
Real First Name: Morgan
Location: Around black mesa.
Just Played: SMB
Posts: 83
Trader Feedback: 0
|
Kay y'all, here's my current update.
I havent been able to put as much effort into Ebootr as I'd like! There's still several major chunks of code I really *really* need to optimize, but Here's What I've Done So Far:
The SFO parsing reads strings a little funky, and it *will* include multiple NULLs if you use my library! However, on the flipside, it packs things *tighter* than PBP Packer! QuakePSP's Param.SFO was 904 bytes when I started, was only 122 when I finished. I really must thank the guy who came up with Another PSP Documentation Page (Its got a *really* Nice description of how the SFO (PSF) format works. I'm making SFO objects look like this for everyone who cares: Code:
SFOFile sfo = new SFOFile(); // new SFOFile
sfo.Add(SFOFile.GetKeyPair("TITLE", "My Kick-ass PSP app")); // Add a string item to it.
sfo.Add(SFOFile.GetKeyPair("BOOTABLE", 1)); // Add an integer to it.
sfo.Add(SFOFile.GetKeyPair("DRIVER_PATH", System.Text.Encoding.UTF8.GetBytes("SYSDIR"))); // add binary data to it.
{ SNIP }
SFOFile sfo = new SFOFile(System.IO.File.ReadAllBytes("param.sfo")); // new SFO file from byte[] stream.
if(sfo.ContainsKey("TITLE")) // Does it contain the "TITLE" key? (NOTE! this is MOST DEFINITELY case sensitive!)
{
MessageBox.Show(sfo["TITLE"].ToString()); // show it!
}
|
|
|
|
|
|
#2 |
![]() The Cake Is A LIE
|
Haha You coding in C#
You know you can't code in C# for PSP :/
__________________
I hate those monkeys ZOMG!
-~Slasher~- ![]() |
|
|
|
|
|
#3 |
![]() ![]() Developer
|
Maybe, but, as far as I know, Ebootr is some sort replacement for PBP Unpacker, thus for PC and not for the PSP.
Am I wrong ?
__________________
00:00: Windows is loading...Come back tomorrow. 01:00 : Booting done.Not yet errors encountered... 01:10: Fatal error.Windows has been detected on logical drive 01:22: Keyboard Locked, try everything. 01:42 : Mouse Device Pilot not found, or uninstalled.Press Left-Bouton to continue. 01:50 : Ending User session.Do you want to play another game ? 01:59: Not enough memory.Only 508'312'583 bytes available. 02:00 : System is shutting Down. |
|
|
|
|
|
#4 |
![]() ![]() Join Date: Apr 2009
Real First Name: Morgan
Location: Around black mesa.
Just Played: SMB
Posts: 83
Trader Feedback: 0
|
Its a PC-Side app to replace PBP Unpacker because I dont like the style.
One thing I may do is include a command line version of the tools to make life so much easier. There is a version of the CLR for the PSP, but I havent tried playing around with it. |
|
|
|
|
|
#5 |
![]() The Cake Is A LIE
|
I can help you if you need help, Im Mast3r C# Codaaaaar
__________________
I hate those monkeys ZOMG!
-~Slasher~- ![]() |
|
|
|
|
|
#6 |
![]() ![]() Join Date: Apr 2009
Real First Name: Morgan
Location: Around black mesa.
Just Played: SMB
Posts: 83
Trader Feedback: 0
|
Maybe.
I'm working on getting pseudo-SVN from my webhost.... Currently, its ~2kloc ... here's just for reading SFO files! Spoiler for Code...:
Here (for you people who dont care about the above but want nice pretty-printed code) is a nice pretty-printed version: http://sonof.bandit.name/files/Ebootr2/sfofile.html Last edited by indrora; 09-25-2009 at 06:52 AM.. |
|
|
|
|
|
#7 |
![]() The Cake Is A LIE
|
Code:
// the filetype. NOTE!!! this isnt really useful.
public enum SFOFileType
{
SaveGame,
MSGame,
UMDGame
}
LOL. There's also no point doing: Code:
public struct SFOEntry
{
public SFOEntryType type;
public byte[] data;
public SFOEntry(SFOEntryType t, byte[] d)
{
type = t;
data = d;
}
public SFOEntry(string value)
{
type = SFOEntryType.txt;
data = System.Text.Encoding.UTF8.GetBytes(value);
}
public SFOEntry(UInt32 value)
{
type = SFOEntryType.num;
data = BitConverter.GetBytes((UInt32)value);
}
public SFOEntry(byte[] value)
{
type = SFOEntryType.bin;
data = value;
}
__________________
I hate those monkeys ZOMG!
-~Slasher~- ![]() |
|
|
|
|
|
#8 |
![]() ![]() Join Date: Apr 2009
Real First Name: Morgan
Location: Around black mesa.
Just Played: SMB
Posts: 83
Trader Feedback: 0
|
@slasher: There's a Really Good Reason(tm) for having overloaded constructors.
Because I have those three overloaded constructors, I can go like this: Code:
mySfoFile.Add("TITLE", new SFOEntry("What the hell?"));
Stucts in .NET are also finnicky things. They're like classes but a lot lighter on the brain. They also always have a default constructor, and its a *recommended practice* that you add overloaded constructors for structs. Hell, the basic layout for a system.drawing.point is Code:
struct Point
{
public int x,y;
public Point(int x, y) { this.x = x; this.y = y; }
public Point(int x) { this.x = x; this.y = x; }
public Point(Size s) { this.x = s.Width; this.y = s.Height; }
public static ==(point a,point b) { return (a.x == b.x) && (a.y == b.y); }
}
Here's what it looks like how *most* people use structs: (and classes for that matter!) Code:
let ld0, null // make sure our object is null first. call .SFOEntry // Call its constructor. Note that we arent Pushing it onto the stack because we have no extra variables. push lr0, ld0 // make sure the constructor gets pushed. mov SFOEntryType->string,lo0 // mov "MY Title",ldstr0 push lo0, ld0~>SFOEntry_t mov ldstr0, ldarg0 pop ldarg0 call System.Text.Encoding.UTF8.GetBytes(ldstr) push lr0 mov lr0, ldstr0 push ldstr0,ld0~>SFOEntry_d Code:
push "My Title",ldarg0 call .SFOEntry(string) mov lr0, ld0 Plus, its smart enough to know that if I screw up and use (Uint32) instead of (String), It'll find the right constructor (and throw a big warning) otherwise it will tell me "Hey dipstick! you didn't give a valid constructor!" Overloaded structs are beautiful things in C#. Now, I do completely ignore them some times in the code but I make wonderful use of them throughout my code. Also, yeah, the SFOFileType enum can be thrown away, it was just that I was using that as a "I'm walking through my documentation and wanted everything." paranoia. |
|
|
|
![]() |
| Tags |
| dead , ebootr |
| Thread Tools | |
|
|