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

Thecl typed variables #62

Merged
merged 73 commits into from
Oct 27, 2019
Merged

Thecl typed variables #62

merged 73 commits into from
Oct 27, 2019

Conversation

ManDude
Copy link
Collaborator

@ManDude ManDude commented Oct 27, 2019

No description provided.

Priw8 and others added 30 commits September 2, 2019 22:18
I'll be suprised if this doesn't break anything. Also, simple creation mode is now required to recompile byte-perfect ECL files sometimes (ZUN's compiler doesn't seem to do math preprocessing well)
Couple bug/format fixes
It was interfering with the difficulty switch expression
timeline opcodes can be named in eclmaps by using "@" instead of "?"
now you can add/remove subs from dumps without everything exploding
I have doubts whether the person who originally wrote this knew how it worked
basically now all typecasts work correctly when creating a sub call by name. this means that these 2 calls generate exactly the same code:
call("whatever",
    _ff 10f, _SS 10,
    _fS 10, _Sf 10f,
    _ff (b + 2f), _SS (a + 2),
    _Sf (b + 2f), _fS (a + 2)
);
@whatever(
    10f, 10,
    _f(10), _S(10f),
    b + 2f, a + 2,
    _S(b + 2f), _f(a + 2)
);
this also fixes a bug that caused stack offsets for parameter type D to not be handled correctly.
ManDude and others added 28 commits October 12, 2019 20:21
A bit of an experimental feature - makes thecl utilize the I3/F3 variables as return registers, and allows creating functions that return values. Important note: "return" is now a keyword, so if you have it in your eclmap, change it to "ret" or something
- store passed expression value in a temporary variable (needed if expression contains stuff like the RAND variable). The variable is marked as unused after the switch, so next variable declared will reuse its offset.
- check cases in the correct order (previously it was reversed)
- add default case
… assume by default that the games aren't manually tampered, hence why the error is non-fatal)
…ed properly.

While the integer version most likely works, the float version just breaks under most conditions for some unknown reason. I'd have to take a closer look at the bytecode for it, but for now just have thecl throw an error. It's not like there aren't alternatives: multiply by -1 or just do 0-value instead.

Also, rename the expr macro for it.
@ManDude ManDude merged commit bc9d292 into master Oct 27, 2019
@ManDude ManDude deleted the thecl-typed-variables branch October 27, 2019 20:16
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