Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Apr 11, 2017

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.

@@ -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);
Copy link
Collaborator

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]

Copy link
Owner Author

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.

Copy link
Collaborator

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]

hrydgard added a commit that referenced this pull request May 18, 2017
@unknownbrackets
Copy link
Collaborator

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]

Copy link

@finansar222 finansar222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(deleted spam)

@hrydgard hrydgard changed the title Alternative to e9d5eb694b (fix for #7887). Alternative to e9d5eb694b (fix for #7887, Loco2 video issue). Jan 31, 2019
@hrydgard hrydgard changed the title Alternative to e9d5eb694b (fix for #7887, Loco2 video issue). WIP: Alternative to e9d5eb694b (fix for #7887, Loco2 video issue). Jan 31, 2019
@Panderner
Copy link
Contributor

Any updates for this?

@ghost
Copy link

ghost commented Jan 16, 2023

This wasn't fix by #14199?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants