Language…
14 users online: bradcomp, Danik2343, deported,  DeppySlide, Domokun007, Heitor Porfirio, hhuxy, Knight of Time, ModernKiwi, mtheordinarygamer, Sammmoo,  StayAtHomeStegosaurus, The_Uber_Camper, Tomi P - Guests: 290 - Bots: 268
Users: 64,795 (2,375 active)
Latest user: mathew

"Kirby and the Amazing Mirror" Styled Enemy HP Meter v2.5.23

SMW Patches → "Kirby and the Amazing Mirror" Styled Enemy HP Meter v2.5.23

Submission Details

Name: "Kirby and the Amazing Mirror" Styled Enemy HP Meter v2.5.23
Author: HammerBrother
Added:
Version History: View
Tool: Asar
Requires Free Space: Yes
Bug Fix: No
Featured: No
Description: This patch makes the game display the HP of an enemy when they take damage.

Note: Only a few enemies in smw uses HP system.

Make sure you read the readme, as it has a lot of information reguarding things like custom sprites, graphical bar settings, etc.

Note: The bar flickering in the screenshot gif is supposed to represent the damage incurred, the recorder is pretty bad at keeping up the game's framerate, thus the actual is much more fluent.
Tags: code health health bar hp bar lorom sa-1 sprite
Comments: 26 (jump to comments)
Download 290.48 KiB | 428 downloads

Screenshots

View all

Comments (26)

HammerBrother Author Link
Originally posted by AnasMario130
Does this patch strictly depend on the presence of the status bar to work correctly?

Sorry for late reply, but by default, it uses the super status bar patch. I made a comprehensive documentation on both.
Skewer Link
And what if I don't want the graphic to appear and only just use this to add the health to enemies. Does this also have applications to custom sprites or is that something that has to be done manually?
HammerBrother Author Link
Skewer The ASM resource itself does support custom sprites, however with existing custom sprites, you must edit them to write their HP values into the freeram this patch uses and also set !Freeram_SprHPCurrSlot to whatever sprite slot it's on to display it (and be warned that some custom sprites have an inverted HP system that a number increases by 1 and dies when it increases to a specific value). It should be noted in the readme.

If you do not want the HP to be displayed, and you still want to use values provided, leave !Freeram_SprHPCurrSlot of whatever value it's on.
Anas Link
Does this patch strictly depend on the presence of the status bar to work correctly?
HammerBrother Author Link
Originally posted by MarioFanGamer
allowing 256 pixels of the HP bar or not


you mean 256 tile bytes (the number of 8x8 tiles the bar occupies and also the number of bytes the table the bar is stored in), not pixels. Very unlikely would anyone would need a bar that is over 32 tiles long (the width of the screen).
 MarioFanGamer Link
The only difference in this version is that you can control the multiplication (!Setting_GraphicalBar_SNESMathOnly) and allowing 256 pixels of the HP bar or not. Pretty minor so I went to accept it.

Edit: And note that if you use SA-1, you should use !Setting_GraphicalBar_SNESMathOnly to 0 because sprites run in SA-1 and they call codes about the HP bar which also means the code about multiplication also runs in SA-1.
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.21 Link
@Final Theory

Actually, vanilla smw's HP system is stored in a single byte, thus up to 255HP is allowed. If your hack uses "varying damage" and needs more than 255HP, you want to use the new sprite tables directly (!Freeram_SprTbl_CurrHPLow,x AND !Freeram_SprTbl_CurrHPHi,x).
Final Theory From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.21 Link
This could be very useful if other new custom bosses used the SMW HP system. Even though it wasn't used much in the original SMW you can still make use of it for future things.
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.21 Link
Ack! I think I messed up the if statement for the digit glitch protection, because the user can specify 8/16bit health, the maximum number of digits to exclude the protection (3 for 8-bit, 5 for 17) could go wonkey. I’ll fix that when I get home today.

Edit: Yep, I did made a mistake, if the user makes HP 8-bit, and selects the number of digits at least 3 and less than 5, would still include the subroutine when it shouldn't (it checks if the user picks a number is below 5, which 5 isn't always the maximum number of digits if the user picks 8-bit). That is now fixed.
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.17 Link
Note: On emulators that randomizes untouched RAM address (such as BSNES), if you're not using custom sprites, smw bosses HP bar fail to show up than intended when set to enabled. This is caused by $7FAB10,x (custom sprite bit) having bit 3 (#%00001000) being (randomly) set. I'm pretty sure that anyone wouldn't use this patch if they're not using any custom sprite, as for these reasons:

-All smw bosses take very few hits to defeat; either 3 stomps/thrown sprite or, 5 or 12 fireballs. And no, since Bowser boss fight have the HUD disabled (to accommodate the cutoff if it did exist), I don't think I need to add to that boss (and not many hackers would ever rehash Bowser again).
-Again, very few smw sprites ever use the health system AT ALL, either they die in one hit, or changes into a different sprite (such as a Dino Rhino turning into a Dino Torch).

For some reason, if you WANT to, open Uberasm_Tool_Files/GM_14.asm and comment out this code:
Code
;		LDA !Ram_CustSprBit,x	;\If it is a custom sprite, next
;		AND #$08		;|
;		BNE ....Next		;/

(note the semicolons on the left of each line).
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.17 Link
Thanks.
 MarioFanGamer From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.17 Link
... No? I have done it already, though.
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.17 Link
Thanks! Did you edit the version history?
 MarioFanGamer From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.17 Link
It happens generally with any ROM mapping being able to access more than 4MB and the SA-1 mapper (i.e. using the SA-1 chip) is one of them.

Though let me quickly fix it.

Edit: Done!
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.17 Link
Code
 -While using banks $10+ for rats tags is needed, however banks $80 is a mirror used for fastROM. Thus using
  banks $80 to $8F is similar to $00-$0F that it was mirrored. Thus, it will include the rats tags ANYWHERE
  above banks $10 when it should've treat $80+ the same as $00-$7F, where $00-$0F and $80-$8F is ONLY when
  you place the rats tags.


oops, I mean you only don't need RATS if banks $00-$0F and $80-$8F. My bad.

Another thing that I wasn't paying attention, is that on the shared subroutines patch, Erik stated that $80+ under the SA-1 effects is completely different (fastrom no longer accessible). Not sure if this only happens if you activate SA-1 mode, or if you patch the sa-1, it's permanently entirely inaccessible. I do understand many ppu and SNES registers become out of reach if the mode is active.
 MarioFanGamer From older version: Kirby and the Amazing Mirror styled Enemy HP meter v2.5.17 Link
Added the SA-1 tag and changed "sprites" to "sprite" in the tag field.

Given its size, I'm pretty sure I missed something, lol. But as far as I'm concerned, the patch seems to work fine.
 MarioFanGamer From older version: Kirby and the Amazing Mirror styled Enemy HP meter 2.3 Link
The insertion is quite difficult due to using UberASM and there are many stuff to consider (though that shouldn't be surprising for you).
And it also would have been nice if there were an easier way to get the subroutines for the patch and that you can disable the HP display for chuck when you have allowed the patch before.

Other then that, the patch works fine.
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter 2.3 Link
Bug found: ludwig boss has an HP underflow glitch where if you get his HP down to 5, and stomp on him on midair (1 HP left) (about halfway on his jump animation when he is able to be stomped), and shoot 2 fireballs on the frame he ends his "stomped animation", his HP will decrement TWICE (both fireballs absorbed) and ends up with 255 HP while dying. I recommend not having fireballs or not having the ludwig boss altogether until I'll update the patch.

Edit: Fixed.

Edit1: Fix another glitch where if the damage is large enough to exceed 255, will overflow (without death). Fixed by checking if the value goes over 255 via BCS after the ADC.

Edit2: Really optimized the damage subroutine code (only used by custom sprites), after learning that if the SBC underflows a value, the carry clears, it makes the CMP redundant.

New bug found: When a chargin chuck dies by falling off screen, SwitchHPBar will be executed every frame until its sprite status ($7E14C8 = #$00, when it goes far enough below the screen), causing the HP bar to instantly switch back to the dying enemy when the player attacks a different enemy, also freezing the record damage indicator should $9D is frozen while the enemy is dying. NOTE: I'll update this patch once my new graphical bar gets done updating.
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter 2.3 Link
Converting to SA-1 for freeram has never been easier, I made a "substitute" for your needs.
lx5 From older version: Kirby and the Amazing Mirror styled Enemy HP meter 2.0 Link
It's working fine with vanilla enemies and the included custom sprite. It's a great addition, so the player knows how much hp the sprite has.

The patch comes with very detailed documentation, so it's easy to set up.

Also it needs full SA-1 support on the sprite and the RAM address (sprites can't access to RAM in banks $7E/$7F, so you have to use a free BW-RAM/I-RAM address). I'll remove the tag until something is done about that.
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter Link
Thanks, it uses a better counter to show the numbers now. Do note that for custom sprites, 9,999 HP is the highest value allowed, since only up to 4 digits can be shown.
DiscoTheBat From older version: Kirby and the Amazing Mirror styled Enemy HP meter Link
I like this patch, it was a bit complicated to set it up but once I did, I liked what I saw. Good work, GHB!
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter Link
@Mariofan64

You mean maintain the number of hits? Oops, should've added defines on the amount of damage also.
Mariofan64 From older version: Kirby and the Amazing Mirror styled Enemy HP meter Link
this patch would be better if Jumping did 6 damage to Chuck enemies instead of 5, so that 2 jumps + 1 fireball kills Chuck enemies, and if the status bar element was able to be turned off, so that the patch was purely a damage counter.
TheOrangeToad From older version: Kirby and the Amazing Mirror styled Enemy HP meter Link
Great Patch GreenHammerBro but i sucks at make patch like this.
HammerBrother Author From older version: Kirby and the Amazing Mirror styled Enemy HP meter Link
Due to a framerate issue, the flickering animation when taking damage on the bar does not show, until the end.