Name: | SMB3 P-Meter |
Authors: | AmperSam, Ersanio |
Added: | |
Type: | Level, Game Mode |
Includes GFX: | Yes |
Includes Hijack: | Yes |
Featured: | No |
Description: | This is an UberASM conversion and enhancement of Ersanio's "SMB3 P-Meter" patch to display the p-meter in the status bar. This resource applies a small hijack which you need to be wary of when removing. Instructions to remove the hijack included. |
Tags: | lorom p-meter sa-1 status bar |
Comments: | 4 (jump to comments) |
Rating: |
Download
3.38 KiB | 69 downloads
Comments (4)
The code for drawing empty triangles does check if it wrote the last tile before terminating, but not the full triangles loop and the meter here have, by default, 6 units to fill up (there are 5 triangles (each spanning 1 tile) and 1 rectangular "P" (spanning 2 tiles), totaling 6 units to fill up, unlike the original SMB3 which is 6 arrows + 1 "P" ).
The maximum P-meter value is #$70, which after dividing by 16, is 7. This means that a full P-meter results in drawing 7 out of the 5 triangles filled, an excess of 2 full triangles. These excess tiles, however are both overwritten by the rectangular "P". Care must be taken that if you set the P-meter to have 4 arrows of !Length or less, you end up drawing full arrows beyond the rectangular "P" when maxing out.
The same thing can theoretically happen if you modify $13E4 so its maximum is greater than $80 (and modify Mario's physics to handle larger values of this increased range), which means more full tiles can be filled up to, drawing 8 or more units.
My version utilizes a repeated symbol routine that always check for writing the last tile for both full and empties, and only have one loop handling both:
It works like this: Very first thing in the loop is check both how many total tiles and the full tiles remaining to draw. If total depletes to zero, stop drawing (either full or empty) and finish. If there are any remaining full tiles, write that and subtract that remaining by 1, otherwise draw empty tiles. In the end of both cases, subtract total tiles left to write by 1, and repeat back to where it checks if there are remaining fulls and totals. So if I have Total set to 5 and Filled set to 6, it will loop 5 times, and ends the subroutine (total=0, then branches to ".Done") before drawing the 6th full tile.