8/09/2006

ReadUMD Sample for UMDeM4eLoaderGTA Released

with "UMD Emulator for FW2.60 w/ eLoader(GTA)"
you can Open and Read file inside ISO :)

main.c

/*
 * ReadUMD Sample for UMDeM4eLoaderGTA v0.03 by 0okm
 * Thanks moonlight, Humma Kavula, hitchhikr, Ditlew, Fanjita and PSPDEV
 */

#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <pspumd.h>

#include <string.h>

PSP_MODULE_INFO("ReadUMD", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);

int main(int argc, char* argv[])
{
    sceUmdActivate(1, "disc0:");
    sceUmdWaitDriveStat(UMD_WAITFORINIT);

    SceUID fd1;
    SceUID fd2;
    int readSize;
    char filebuf[0x8000];

    pspDebugScreenInit();
    pspDebugScreenPrintf("ReadUMD Sample for UMDeM4eLoaderGTA v0.03 by 0okm\n");
    pspDebugScreenPrintf("Thanks moonlight, Humma Kavula, hitchhikr, Ditlew, Fanjita and PSPDEV\n");
    pspDebugScreenPrintf("\n");
    pspDebugScreenPrintf(" press [TRIANGLE] - Copy disc0:/UMD_DATA.BIN to ms0:/UMD_DATA.BIN\n");
    pspDebugScreenPrintf(" press [SQUARE] - Copy disc0:/PSP_GAME/ICON0.PNG to ms0:/ICON0.PNG\n");
    pspDebugScreenPrintf(" press [CIRCLE] - Copy disc0:/PSP_GAME/PARAM.SFO to ms0:/PARAM.SFO\n");
    pspDebugScreenPrintf(" press [CROSS] to EXIT\n\n");

    SceCtrlData pad;
    sceCtrlSetSamplingCycle(0);
    sceCtrlSetSamplingMode(0);
    while (1)
    {
        sceCtrlReadBufferPositive(&pad, 1);
        if (pad.Buttons & PSP_CTRL_TRIANGLE)
        {
            fd1 = sceIoOpen("disc0:/UMD_DATA.BIN", PSP_O_RDONLY, 0777);
            fd2 = sceIoOpen("ms0:/UMD_DATA.BIN", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
            while ((readSize = sceIoRead(fd1, filebuf, 0x08000)) > 0)
            {
                sceIoWrite(fd2, filebuf, readSize);
            }
            sceIoClose(fd2);
            sceIoClose(fd1);
        }
        if (pad.Buttons & PSP_CTRL_SQUARE)
        {
            fd1 = sceIoOpen("disc0:/PSP_GAME/ICON0.PNG", PSP_O_RDONLY, 0777);
            fd2 = sceIoOpen("ms0:/ICON0.PNG", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
            while ((readSize = sceIoRead(fd1, filebuf, 0x08000)) > 0)
            {
                sceIoWrite(fd2, filebuf, readSize);
            }
            sceIoClose(fd2);
            sceIoClose(fd1);
        }
        if (pad.Buttons & PSP_CTRL_CIRCLE)
        {
            fd1 = sceIoOpen("disc0:/PSP_GAME/PARAM.SFO", PSP_O_RDONLY, 0777);
            fd2 = sceIoOpen("ms0:/PARAM.SFO", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
            while ((readSize = sceIoRead(fd1, filebuf, 0x08000)) > 0)
            {
                sceIoWrite(fd2, filebuf, readSize);
            }
            sceIoClose(fd2);
            sceIoClose(fd1);
        }
        if (pad.Buttons & PSP_CTRL_CROSS)
        {
            sceKernelExitGame();
        }
        sceKernelDelayThread(200*1000);
    }

    return 0;
}


Makefile

TARGET = ReadUMD
OBJS = main.o

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS = -lpspumd

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = ReadUMD Sample

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

18 Comments:

At 8/09/2006 10:38:00 am, Blogger nielsss said...

could youmake an eboot please cuz my cygwin is all buggerd up

 
At 8/09/2006 12:03:00 pm, Blogger Sr. Lobo said...

the UMD Emulator you released yesterday didn´t ask me to input a button. it only returned to e-loader, what´s the problem?
sorry, my english is awful :(

 
At 8/09/2006 12:17:00 pm, Blogger Medieval Ånubis said...

The UMD emulator only mounts the ISO.

This program here is supposed to be able to read off the mounted ISO and gives you the option to copy stuff from the ISO to the Memory Stick.

 
At 8/09/2006 09:27:00 pm, Blogger Andy819 said...

So are we able to Load a ISO yet?

 
At 8/10/2006 12:09:00 am, Blogger ~teamwrite said...

I have no idea what all that tech stuff means, but I really appreciate all your hard work and can't wait for the finished product.
You rule! : )

 
At 8/10/2006 05:07:00 am, Blogger Medieval Ånubis said...

I just tested it. It works very well. I copied the PNGs from the UMD disc.

 
At 8/10/2006 06:40:00 am, Blogger t-082 PSPER said...

whatever the result is ~Thank you for your nice work!thank you very much

 
At 8/10/2006 05:08:00 pm, Blogger Vicki said...

Hi I own a V2.6 TA-082 psp
I dun own GTA yet but am planning on bidding for a UK GTA LCS ULES 00151# unpatched version.

Will I continue to need the GTA after I apply the eloader once?

I'm a newbie please don't flame me.

 
At 8/10/2006 08:25:00 pm, Blogger Medieval Ånubis said...

@Vicki, yes, you do need to run eloader everytime you want to use homebrew on a TA-082 PSP. We're just out of luck.

Visit this thread for more info.

http://forums.qj.net/showthread.php?t=59297

 
At 8/11/2006 03:47:00 am, Blogger Vicki said...

Good thing I won the GTA LCS ULES-00151# unpatched psp game then.

Hey sure sucks to be in a country where the game is banned and whatever stocks the shops bring in happen to be patched versions.

Er about the QJ link I didn't really understand the coding so I didn't know what was going on with all the flaming about piracy comments.

I just want to be able to stream videos to my psp with this via the homebrew PSPPIMP iso once this UMD Emulator gets updated in later versions.

 
At 8/11/2006 08:07:00 am, Blogger Arthanos said...

This comment has been removed by a blog administrator.

 
At 8/13/2006 10:09:00 am, Blogger darkmillennium said...

hey all,

I installed everything according ro Ookm's info, and i got the "psp" screen just like if it was going to load my iso, but then i got an error message "80020148"
and it says "the game could not be started" i think this is just a sort of a trial for us to try and see that he (Ookm) is working on the program for us, and we should be patient. for now, just wait alittle longer people.....

 
At 8/13/2006 02:15:00 pm, Blogger Medieval Ånubis said...

uhh no you're wrong. First of all you tried launching it from the XMB or the PSP main menu. You're supposed to use the GTA exploit eloader to load the iso reader. I compiled it and it works. But you are right in saying that its only a sample and really can't do anything except read a couple of files of the UMD iso.

 
At 8/13/2006 03:35:00 pm, Blogger darkmillennium said...

hey anubis, i wonder, did you get the same screen i got when i tried to load my backup iso from the GTA exploit? i was able to load fanjita's eloader, and it went to a black screen naming Ookm's umd emulator for 2.6
"UMD emulator 2.6 v0.03"
so i was wondering, do you think that the problem lies in alittle more tweaking of the eloader to be compatible with 2.6 to load iso, or is the product awaiting it's finishing touches by Ookm....

 
At 8/13/2006 11:42:00 pm, Blogger Medieval Ånubis said...

Its normal for it to go to a black screen. The reason for it is that due to the fact that the kernel exploit is prone to crashing randomly. In fact even simple text display could cause the PSP to crash. It did mount the ISO so don't worry.

You use the ReadUMD to read off the ISO. It uses a different mode so it won't crash.

All these programs are just POC (Proof Of Concepts) just showing all the possibilites available. Either 0okm or someone else has to develop them further into something useful.

try pspupdates.qj.net for more PSP info.

 
At 8/14/2006 04:42:00 am, Blogger darkmillennium said...

Oh, i see Anubis, but if this proof of concept could get this far, i suppose it's ok to hope for a solution soon. thanks for the link, i will check it out.









HOPE: the reason we live.

 
At 8/16/2006 09:39:00 pm, Blogger matt said...

ookm when is it your next update for this UMDemulator, have you find a way to load the actual game iso

 
At 9/08/2006 02:24:00 pm, Blogger voso said...

sorry if this is a stupid question but do you use software to mount the iso's on the psp and if so what software do you use?

Cheers

 

Post a Comment

<< Home