-
Notifications
You must be signed in to change notification settings - Fork 20
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
Touchscreen struct and script parameter conversion functions #254
Touchscreen struct and script parameter conversion functions #254
Conversation
b58155b
to
467eb0d
Compare
We could make a bitfield, but I think the documentation in the function description is enough. I'd be fine leaving these as
As I mentioned, these are fixed-point numbers. For the 64-bit variants, there actually is a type, |
9ea6f55
to
62702e1
Compare
Alright, everything is updated and fixed. I also rebased master since there were new commits from Marius' PR. Let me know if it looks good now or if something still needs to be changed. |
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.
All looks good now, thanks!
This PR contains two minor additions.
First, I've documented a struct that can be used to read data about the current status of the touchscreen, including whether it's currently being pressed or not and the position being pressed. This data, unlike the raw values that can be read from the I/O ports, is expressed in pixels starting from the top left corner of the screen, which should be a better spot to read touchscreen coordinates since it's easier to use and consistent across emulators (seems like the raw values are not).
Second, I've researched the function previously known as
ProcessScriptParam
and its sister function. We now have a better understanding of how scripting opcode parameters work, and how the two special bits they contain affect their value.A couple of questions:
ScriptParamToDecimal
. I'm not sure what name I could give it, nor how to explain it in a clear and concise way. It's just a number that's stored multiplied by 256, should we add a new type for that?