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

[Call of Cthulhu] Fixed Inventory Menu Cursor Boxes and Heart Rate Monitor #1619

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

deanff
Copy link
Contributor

@deanff deanff commented Sep 6, 2024

PROBLEM:
-Open Inventory Menu with [I].
Hover mouse over top-left icon (book) - instead the second icon (watch) will be selected.
-Click on Jack to view Heal Menu.
Hover mouse over left-most square in grid - instead the second square will be selected.
-Watch the Heart Rate Monitor at top-right of the screen.
Right-most Line Paper texture disappears leaving ink line over black screen.

SOLUTION:
-Added/Modified calculations for cursor boxes in inventory and heal menu.
-Found unused black square in inventory menu. Covered the right-most Line Paper with it. However, the ink line was being drawn at the top layer (on top of the black box). Adjusted the ink line to be between the black box and the inventory.

TESTING:
I've played up to Innsmouth with no issues. Only tested on 16:9 monitor as that's all I have available.

@ThirteenAG
Copy link
Owner

You should use patterns instead of addresses, like the rest of the code.

@deanff
Copy link
Contributor Author

deanff commented Sep 11, 2024

Hi Thirteen,
I noticed get() couldn't find patterns in the .rdata section of the program - Is this by design?
In your experience, do stack references like [esp+4] tend to stay the same between compilations?

@ThirteenAG
Copy link
Owner

I noticed get() couldn't find patterns in the .rdata section of the program - Is this by design?

Yes, what do you need rdata for? Usually the references to that are replaced.

In your experience, do stack references like [esp+4] tend to stay the same between compilations?

Use sigmaker plugin to generate patterns, it will take care of everything for you.

@deanff
Copy link
Contributor Author

deanff commented Sep 11, 2024

All of the HealMenuBox constants are grouped together in the range (0x62D5D4 to 0x62D5E4), where-as instructions referencing them are scattered throughout the program code (.text).
In my previous commit, I wrote to these constants - was wondering if that was a bad idea. Like maybe get() had been set up this way to prevent writes to Read-Only data...
I'll check out sigmaker. I've made unique patterns for what I need. Just figured I'd ask if you've ever encountered one of the games getting updated and suddenly [esp+4] is now [esp+8] and the pattern no longer works.

@ThirteenAG
Copy link
Owner

Just figured I'd ask if you've ever encountered one of the games getting updated and suddenly [esp+4] is now [esp+8] and the pattern no longer works.

I didn't compare anything like that, not sure.

All of the HealMenuBox constants are grouped together in the range (0x62D5D4 to 0x62D5E4), where-as instructions referencing them are scattered throughout the program code

So you find a xref to that data, and if it's required, overwrite read only data using that pointer.

@ThirteenAG ThirteenAG merged commit 7cb0ce1 into ThirteenAG:master Sep 11, 2024
5 checks passed
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.

2 participants