This patch replaces the normal Dragon Coin counter with a 3-digit numerical one. The new counter keeps track of the *total* number of coins you have collected rather than the ones within a single level, and each coin also saves to SRAM so that it cannot be collected again. Thanks to Alcaro for finding the (laughably small) thing that caused the bug in the previous version.
NEW - Added SA-1 support, converted it to asar and it allows to be used with SRAM/BW-RAM Plus.
Hi! We (MiniMawile and I) were wondering, if it would be possible to get this patch to write to https://www.smwcentral.net/?p=nmap&m=smwram#7E1F2F like the vanilla game does when the number of coins collected in the level would trigger the second score (so, by default, 5 yoshi coins; or whatever the level was set to in the table at the bottom of the patch).
They wanted to use this patch with https://www.smwcentral.net/?p=section&a=details&id=6226 so that if any dragon coins were collected (they set all their level values in this patch to $00), and that patch reads the value from $1F2F to see if 5 or more yoshi coins were collected in a level. Unfortunately, this function from the base game is completely bypassed and not reimplimented within this patch; and my attempt to add it back in for them did not work. I thought, in theory, https://imgur.com/a/45vs22y would work, but it appears to disable the functions of your patch completely.
Whenever I try to apply this patch, the numbers show up as a glitch sprite (looks like part of the SMW title screen) then 4 then 5. As in: (coin)(glitch)45. And the dragon coins are all removed from the levels.
Keep in mind that this patch requiresSRAM/BW-RAM Plus to work properly. Additionally, it does not give 1-up if you collect all yoshi coins late (for example, collect 3 yoshi coins on a level, and then go back and collect the 2 remaining ones).
About the patch itself, I had to modify a few things:
1. I added information on the readme about the default SRAM/BW-RAM plus values.
2. I added more two defines for setting up SA-1 Free BW-RAM addresses or otherwise the patch won't work properly on SA-1 ROM because the SA-1 CPU executes one of the hijacks and thus it ends up illegally accessing WRAM.
Other than that, this is a welcome update for the obsoleted xkas one. Approved.