-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Developing Pointdevice Mode for all TH danmaku games #174
Comments
First, I would recommend that you check out https://github.com/exphp-share/th-re-data. Now, to answer your questions. Is there a function that can immediately reload the current stage?Yes... sort of. In Touhou there is a variable called the game mode. Well, it's three actually (the current gamemode, the next gamemode (which is the variable you actually want to modify if you want to change it), and the previous gamemode). Examples of gamemodes are:
So setting the gamemode to 14 (or 0xE) does exactly what you want. I just invoke THPatch() with modified parameters, and sometimes it works sometimes it doesn't + Sometimes boss' AI can be messed upThis is because reloading does not reload the ECL scripts. The game keeps using the scripts it had already loaded previously. thprac also handles warping to a chapter within the stage vs warping to a boss with different functions. Of course, if you perform a reset in a stage that's not 1, the game will reload the script for stage 1. However, setting the gamemode to 14 will never reload the script. ECLJumpThis is a utility function that creates a jump instruction in the ECL script to skip over a few other instructions. This does turn the data immediately after the newly created jump into garbage, but the ECL parser will never try to run that since it will jump over that due to the jump instruction. ECLSetChapterBecause making sure that the internal chapter number is set correctly matters a lot in th15, thprac will also do that. It wants to make sure though that it sets the chapter number at the correct time though. The code Because of that, instead of just doing it directly, it will activate a hook that will set the chapter number and then deactivate itself. The |
Hi all, I am a CS student who is developing a fork of thprac that implements a Pointdevice Mode that supports all TH danmaku games (probably except th9 and th19). Some basic functionalities are already done like detecting loss of life and overwriting
section
in practice mode. But there are some obstacles.Two biggest challenge: (1) Is there a function that can immediately reload the current stage? (2) How to get the current section number?
(Edit: the second is solved by Cheat Engine. For example, 4e73f0/4e73f8 is the stage/section in th15.)
Forgive my limited knowledge of reverse engineering...
Here is something I tried but doesn't work well:
THSectionPatch()
(the function that warps to a section in practice mode), which sets the section and stageWhat will happen:
I also don't understand what are
ECLJump
andECLSetChapter
. I just invokeTHPatch()
with modified parameters, and sometimes it works sometimes it doesn't.Any help is greatly appreciated! I hope this mode will bring joy to all of us soon.
The text was updated successfully, but these errors were encountered: