Skip to content

Instantly share code, notes, and snippets.

@5paceToast 5paceToast/th10.asl
Last active Aug 29, 2015

Embed
What would you like to do?
Touhou 10 Autosplitter
state("th10")
{
int stageId1 : "th10.exe", 0x74C7C;
//int stageId2 : "th10.exe", 0x74C80;//stage id 2 bugged out once, stage 1 seems to still be fine.
int lives : "th10.exe", 0x74C70;
int power : "th10.exe", 0x74C48;
int score : "th10.exe", 0x74C44;
int stageFrames : "th10.exe", 0x74C88;
}
start
{
if((current.stageId1 == 1)
&& (current.power == 0)
&& (current.score == 0)
&& (current.lives == 2)
)
{
current.totalFrames = 0;
return true;
}
return false;
}
split
{
return (old.stageId1 < current.stageId1);
}
reset
{
if ((current.lives == 2)
&& (current.score == 0)
&& (current.score < old.score)
)
{
current.totalFrames = 0;
return true;
}
return false;
}
isLoading
{
return old.stageFrames == current.stageFrames;
}
gameTime
{
if(current.stageFrames < old.stageFrames)
current.totalFrames += old.stageFrames;
return TimeSpan.FromSeconds((current.totalFrames + current.stageFrames) / 60.0f);
}
@5paceToast

This comment has been minimized.

Copy link
Owner Author

5paceToast commented May 20, 2015

Initial version limitations:

  • need to split yourself at the end of the run (I recommend doing that when the screen fades after the boss fight)
  • reset includes continues (design choice)
  • no loadtime removal (don't think it matters in this game though)
  • no FPS detection (FPS matters!)
  • need to have killed at least one enemy before resetting (overall)
@5paceToast

This comment has been minimized.

Copy link
Owner Author

5paceToast commented May 21, 2015

Changes:

  • loadtime and pauses now no longer count in Game Time (I suggest using game time, though it doesn't matter much)
  • still no FPS detection (I'm having difficulties using the gameTime stuff, TimeSpan seems not to actually be exposed)
  • Fixes potential issue (stageId2 bugged out on me once, stayed 1 when I moved to stage 2. It's making me think it's a form of backup value? Stage Id 1 is still fine.)
@5paceToast

This comment has been minimized.

Copy link
Owner Author

5paceToast commented May 21, 2015

Changes:

  • implemented FPS/gametime detection
  • kept isLoading, since current gameTime implementation seems to be buggy on stage 1 for some reason, shouldn't interfere (since we get proper total gametime).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.