I wanted to use the ME to do IDCT, but got an 8002013C err
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
I wanted to use the ME to do IDCT, but got an 8002013C err
Sys:401M33
I tried to use the ME, but got the 8002013C error code. I checked the .prx file, which used functions in sysreg.prx, but there is no such a file in my flash0, and maybe it need the kernel mode.
How can I use the ME on PSP with 4.01M33? Please help.
THX.
I tried to use the ME, but got the 8002013C error code. I checked the .prx file, which used functions in sysreg.prx, but there is no such a file in my flash0, and maybe it need the kernel mode.
How can I use the ME on PSP with 4.01M33? Please help.
THX.
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
http://www.mediafire.com/download.php?ahbmqxooqwq
Try that. It works fine on my slim in 4.01 M33-2. It has the clock setting code disabled. You can't change the cpu clock while the ME is running. The code there shows how to init the ME, start running code, set flags, and cleanup.
Try that. It works fine on my slim in 4.01 M33-2. It has the clock setting code disabled. You can't change the cpu clock while the ME is running. The code there shows how to init the ME, start running code, set flags, and cleanup.
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
nope it means we want to read/write into uncached segment as both processors cannot share the contents of their respective caches. The "|0x40000000" operation gives the same result in both processors : bypass the cache update, don't read/write in the cache even if there may be a hit but directly in main ram, vram or scratchpad.
Yeah, just remember that the ME cannot access vram or scratchpad. It DOES have it's own ram it can access (2MB at addr 0). Given the Slim PSP doubled the vram, I wonder if the ME edram was doubled as well... one of these days, one of us should do a mem test on the ME edram to see how big it is on the Slim.hlide wrote:nope it means we want to read/write into uncached segment as both processors cannot share the contents of their respective caches. The "|0x40000000" operation gives the same result in both processors : bypass the cache update, don't read/write in the cache even if there may be a hit but directly in main ram, vram or scratchpad.
Anywho, you'll notice my example sets the framebuffer in system memory so that the ME can do the color cycles. That's because the ME can't access vram, so trying to do color cycle in vram from the ME would be useless.
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
It's an idea from the Amiga. Each bit is a signal. You can alter any number of bits by setting the bit number of the flag to be altered in sigmask. The value for the flag is determined by setting the same bit number in the sigset. So if you wanted to set flags 1 and 4, and clear flags 0, 2, and 3, you'd use a sigmask of 0x0000001f and sigset of 0x00000012.realjoeeye1 wrote:I'm not sure what the sigmask and sigset exactly mean, can J.F. give a simple explanation?
What I really want to do here sometime before the year is over is rewrite the ME library so that the ME is running something akin to exec.library.
You probably forgot the mediaengine prx when you copied the EBOOT. If you made a directory in GAME4XX and copied the EBOOT and mediaengine prx lib, it should work. It certainly does on my Slim.realjoeeye1 wrote:I've tried J.F.'s sample code, the EBOOT.pbp already compiled did not work, it received an 80020001 error code loading the .prx. But when I recompiled it, it works well! Maybe I have to rewrite my codes based on J.F.'s MediaEngine.prx.
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
I know it, I just thought that you had already defined the functions of these flags, now I realize those are for me or someone who use the struct to define our own meanings.J.F. wrote:It's an idea from the Amiga. Each bit is a signal. You can alter any number of bits by setting the bit number of the flag to be altered in sigmask. The value for the flag is determined by setting the same bit number in the sigset. So if you wanted to set flags 1 and 4, and clear flags 0, 2, and 3, you'd use a sigmask of 0x0000001f and sigset of 0x00000012.realjoeeye1 wrote:I'm not sure what the sigmask and sigset exactly mean, can J.F. give a simple explanation?
What I really want to do here sometime before the year is over is rewrite the ME library so that the ME is running something akin to exec.library.
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
Are the adresses with and without "|0x40000000" point to the same physical memory block? like:hlide wrote:nope it means we want to read/write into uncached segment as both processors cannot share the contents of their respective caches. The "|0x40000000" operation gives the same result in both processors : bypass the cache update, don't read/write in the cache even if there may be a hit but directly in main ram, vram or scratchpad.
int *a,*b;
a=0x0000 FFFF;
b=0x4000 FFFF;
*a=100 get a same result as *b=100? just *b=100 does not use cache of the core?
Yes, and you can also extend the structure if you want, putting your own stuff in it.realjoeeye1 wrote:I just thought that you had already defined the functions of these flags, now I realize those are for me or someone who use the struct to define our own meanings.
@realjoeeye1 - They are the same address, but you may or may not get the same values depending on whether or not you have flushed the cache, and do so after writing through the cached pointer. For example, if you write through the cached pointer, the data is in the cache, not the memory, so reading through the uncached pointer will return the PREVIOUS data, not the data you just wrote.
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
Now I clearly understand that!J.F. wrote:Yes, and you can also extend the structure if you want, putting your own stuff in it.realjoeeye1 wrote:I just thought that you had already defined the functions of these flags, now I realize those are for me or someone who use the struct to define our own meanings.
@realjoeeye1 - They are the same address, but you may or may not get the same values depending on whether or not you have flushed the cache, and do so after writing through the cached pointer. For example, if you write through the cached pointer, the data is in the cache, not the memory, so reading through the uncached pointer will return the PREVIOUS data, not the data you just wrote.
Thanks!
-
- Posts: 20
- Joined: Sat Aug 30, 2008 10:24 pm
I used the ME to IDCT a 8X8 short block, but it doesn't work correctly.
Codes:
static int idct_me(int start_block)
{
idct_start((short*)(int(&dct_recon[start_block][0][0])|0x40000000));
return 0;
}
static void idct(int start_block)
{
int err;
err=BeginME(mei, (int)idct_me, start_block, 0, 0, 0, 0);
/* if (err < 0)
printf(" failed! Error calling BeginME. %d\n",err);
else
printf("BeginMe OK. %d\n",err);
sceKernelDelayThread(300000); */
}
idct_start() is a function to do the IDCT, it can do that correctly on th SC. But when I used ME as above code, I got an incorrect result, and sometimes PSP crashed.
Codes:
static int idct_me(int start_block)
{
idct_start((short*)(int(&dct_recon[start_block][0][0])|0x40000000));
return 0;
}
static void idct(int start_block)
{
int err;
err=BeginME(mei, (int)idct_me, start_block, 0, 0, 0, 0);
/* if (err < 0)
printf(" failed! Error calling BeginME. %d\n",err);
else
printf("BeginMe OK. %d\n",err);
sceKernelDelayThread(300000); */
}
idct_start() is a function to do the IDCT, it can do that correctly on th SC. But when I used ME as above code, I got an incorrect result, and sometimes PSP crashed.
Using caches:
SC: store data to input array, then flush dcache
ME: invalidate input array (not flush!), then process data, then flush dcache for output array
SC: invalidate dcache for output array (not flush!), then read results
When you use BeginME(), remember that the data won't be valid until the ME is done. There's a function to check if the ME is done, and one to wait for the ME to finish.
If you don't want to mess with the caches, always use the uncached pointer EVERYWHERE for EVERYTHING. Also, flush/invalidate the dcache for the arrays BEFORE messing with them to make sure that you're using the contents of memory instead of the cache.
SC: store data to input array, then flush dcache
ME: invalidate input array (not flush!), then process data, then flush dcache for output array
SC: invalidate dcache for output array (not flush!), then read results
When you use BeginME(), remember that the data won't be valid until the ME is done. There's a function to check if the ME is done, and one to wait for the ME to finish.
If you don't want to mess with the caches, always use the uncached pointer EVERYWHERE for EVERYTHING. Also, flush/invalidate the dcache for the arrays BEFORE messing with them to make sure that you're using the contents of memory instead of the cache.