(shouting)

SimpleHP Pack for HP and Retry

Post Reply
User avatar
Lord Ruby
Posts: 348
Joined: 2 years ago
Location: Sweden

SimpleHP Pack for HP and Retry

Post by Lord Ruby »

tl;dr: Don't write to $788A ($188A|!addr) if you don't want rad stuff to happen.

I feel like it might be a good idea to document this somewhere that isn't IRC-styled or a project repository, but I'm not on the central and wherever, so I'll put this here since it was made for AAT.

Demonstration:

(Guest featuring some of the other stuff I've coded for my AAT levels.)

Download:
SimpleHPPack.tar.gz
(922.35 KiB) Downloaded 82 times
I'll keep it brief here since the main ASM file has usage notes and examples are provided in the pack. The deathcounter patch is by yoshicookiezeus (and a small bit by Iceguy), not by me, I only moved the hijack to resolve a conflict with SimpleHP.

The pack only fully claims the $788A RAM byte (well, technically just the two highest bits). Setting bit 7 (that is, $80-$FF) activates the HP system, in which case two additional bytes are claimed: $58 (current HP) and $7C (this byte can be used to check if certain patch routines have been triggered). Setting bit 6 ($40-$7F, $C0-$FF) activates the custom death code feature, which can be used for retry systems, this claims three bytes, $6DDB-$6DDD, as a pointer to the custom death code. Note that the patch itself only provides a framework, stuff like initializing HP, capping HP, and drawing a UI must be handled by level code (although the example provided is fairly flexible itself) or other patches.

If you have any questions or want help using this, feel free to ask here or on the Discord!
a
Post Reply