Skip to content

Instantly share code, notes, and snippets.

View 32th-System's full-sized avatar
🏠
Working from home

32th System 32th-System

🏠
Working from home
View GitHub Profile
@ExpHP
ExpHP / anm-manager.md
Last active July 6, 2022 11:21
AnmManager and TH17 1.00b

The ANM manager

TH16 can crash when a large number of enemies and bullets/lasers are destroyed, ruining some score runs. Notably, TH17 1.00a can also crash, but the bug was finally fixed in 1.00b.

Motivated by wanting to understand this crash and perhaps repair it for TH16, I made my best effort to look into the changes between TH17 1.00a and 1.00b. I have not yet figured out the true cause of the crash, but my efforts to discover the cause have forced me to understand even more about how ANMs work.
(Edit 2020/10/07: The reason for the crash is now known!)

Thanks to this, I have now mapped out a significant portion of AnmManager, the single largest struct ever allocated by the game.

The AnmManager structure

@ExpHP
ExpHP / 0_announcement.md
Last active August 17, 2023 05:22
anm parser info

Announcement regarding this gist

Much of the information here is old and outdated!

Visit my new site at exphp.github.io/thpages.

@WindowDump
WindowDump / thcrap_random.py
Last active June 16, 2019 15:59
thcrap patch configuration randomizer (Python 3.5+)
#!/usr/bin/env python3
# thcrap patch configuration randomizer by Window Dump, version 190430
# Changelog
# 190430
# * Added more patches to the default blacklist which probably corrupt your scorefiles
# 190314-2
# * Don't download files.js - it's managed by thcrap :nmlgcgod:
# * If patch.js had to be downloaded, keep it in memory
# 190314
About Locale Emulator and the concept of locale emulation itself

I came across this program a while ago myself, and was just as amazed by its premise. I looked at the source code, and saw lots of involved low-level NT kernel voodoo I don't understand, instead of the code I tend to use to solve this kind of problem. Truly, this must be an amazing piece of software, I thought... until I tested it with th135 and noticed that it rendered the Music Room text as exactly the same garbage you see when running the game without any locale emulation. Yeah, it did display 東方心綺楼 in the title bar and correctly referenced the 御首頂戴帳 folder, but overall I'd consider this to be a worse alternative to AppLocale.

So I did some research, and it turns out that this thing merely implements the bare minimum of functionality necessary (namely, changing the system ANSI code page in memory) to purportedly keep games from crashing. Anything just a bit more involved