-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Alternative to e9d5eb694b (fix for #7887, Loco2 video issue). #9601
base: master
Are you sure you want to change the base?
Conversation
@@ -1229,6 +1229,10 @@ static int _PsmfPlayerSetPsmfOffset(u32 psmfPlayer, const char *filename, int of | |||
psmfplayer->videoWidth = buf[142] * 16; | |||
psmfplayer->videoHeight = buf[143] * 16; | |||
|
|||
// Reflect these values to memory - LocoRoco2 reads the height directly here. | |||
Memory::Write_U32(psmfplayer->videoWidth, psmfPlayer + 0xBC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may need to allocate a struct, and write that pointer to psmfplayer
on create. If this works, I bet it's dereferencing that pointer and using the private structure, which we hadn't been emulating yet.
AFAIK, you can do this:
PsmfPlayerData **p1 = nullptr;
scePsmfPlayerCreate(p1, createParams);
PsmfPlayerData **p2 = p1;
scePsmfPlayerSetPsmf(p2, "video.pmf");
scePsmfPlayerStart(p1, startParams, 0);
And really, you can only create one psmf player at a time...
Won't be able to double check until some hours from now. But right now PPSSPP essentially does:
void scePsmfPlayerCreate(PsmfPlayerData **p, ...) {
*p = (PsmfPlayerData *)p;
}
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this makes sense. Wonder where it should be allocated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested a few lib versions quickly - scePsmfPlayerCreate()
takes away 290816 (0x47000) bytes of user RAM. It allocates low (like an FPL without PSP_FPL_ATTR_HIGHMEM.)
Interestingly, it seems like the pointer written by scePsmfPlayerCreate is actually 80 (0x50) behind the real allocated memory. That is, *p = (PsmfPlayerData *)((intptr_t)allocated - 0x50);
So the width/height are probably at 0x6C and 0x70 from the actual memory. I assume this because it always points to 0x??????b0, and that address actually points inside an FPL if I allocate one first.
That being said, I still end up with 0 at player + 0xbc and 0xc0, it seems like, even after calling scePsmfPlayerGetPsmfInfo()
. But probably I'm just missing something.
-[Unknown]
FWIW, I didn't test again that specific lib version - since I don't have it. Reporting says it might be in NPEG90012_1.00 (Locoroco 2 Demo), though. -[Unknown] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(deleted spam)
Any updates for this? |
This wasn't fix by #14199? |
This is probably a more likely explanation than the extra parameters..
This works fine in Loco2 and hopefully won't break Growlanser.
WIP: Do not merge, as unknown says below this needs some changes.