Skip to content

Implement MxDisplaySurface::VTable0x34#1264

Merged
foxtacles merged 5 commits intoisledecomp:masterfrom
madebr:MxDisplaySurface-VTable0x34
Dec 23, 2024
Merged

Implement MxDisplaySurface::VTable0x34#1264
foxtacles merged 5 commits intoisledecomp:masterfrom
madebr:MxDisplaySurface-VTable0x34

Conversation

@madebr
Copy link
Copy Markdown
Contributor

@madebr madebr commented Dec 23, 2024

Accuracy is an embarrassing 34.91%.

Here's some stack information to get you started:

Stack depth is 0x84, DDSURFACEDESC surfaceDesc is at ESP+0x18
The arguments are at:
p_pixels: ESP+0x88
p_bpp: ESP+0x8c
p_width: ESP+0x90
p_height: ESP+0x94
p_x: ESP+0x98
p_y: ESP+0x9c

(It's a "RawBlitAt" function)

@foxtacles
Copy link
Copy Markdown
Member

Matched it to 100%. Since the function exists in the BETA at address 0x10141191 it's much easier to use this as a reference.

}
case 16: {
if (p_bpp == 16) {
MxU8* dst = (MxU8*) surfaceDesc.lpSurface + p_y * surfaceDesc.lPitch + p_x;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this correct if both dest and src contain 16-bit pixels?
Shouldn't it be + 2 * p_x?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes I think you are right. It looks like a bug. The function is never called in the game

@Ramen2X
Copy link
Copy Markdown
Member

Ramen2X commented Dec 23, 2024

I was here! Thanks everyone. 🎉

@foxtacles foxtacles merged commit 938a5d7 into isledecomp:master Dec 23, 2024
@madebr madebr deleted the MxDisplaySurface-VTable0x34 branch December 23, 2024 18:26
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.

4 participants