Language…
18 users online:  AmperSam, CroNo, Dennsen86, elegist, Golden Yoshi, Green Jerry, Hammerer,  Lazy, MellyMellouange, Metal-Yoshi94, mtheordinarygamer, Nayfal, Nemesis1407, Neuromancer, signature_steve, slopcore, Sweetdude, TheXander - Guests: 331 - Bots: 405
Users: 64,795 (2,370 active)
Latest user: mathew

Fireball Coin Block 2.0 - Hernan

File Name:Fireball Coin Block 2.0
Submitted:06/7/2013 01:34:08 by Hernan
Rating:0.0
Authors:Hernan
Act As:130
Includes GFX:No
Description:A 1 coin block activated by a fireball, then it disappears.
The amount of coins is customizable in the ASM file (even for those who don't know ASM)
Note that the block has a bug : if you use it too much times, it won't give a life after 99 coins, but will continue to increase (9A,9B,9C)... and the counter will come back at 0 after FF coins.
EDIT: If you use this block, then you can put real coins before it gets to 99, and the player will receive a life.
Ver.2.0: Optimised the code, and added some functions. See the changes.txt included for more infos
For those who had the other version, please redownload.
Tags:block, coin, fireball
Download:Download - 879 bytes
7 downloads


Removal reason:
First, like you said on description, if you use with 99 coins, it will not reset, not give a life and will keep increasing. Don't use $0DBF to increase the amount of coins, but $13CC:

[11:21:52] <VitorVilela> !ar ram $13CC
[11:21:54] <AlcaRobot> The value you store here is the amount of coins that are being added up to the total. Usually, $7E:13CC is either #$00 or #$01, but it can be set to other values in order to add up multiple coins at once. (1 byte)

in that case, replace

Code
LDA $0DBF ; loads coin counter value
CLC ; carry flag off
ADC #$01 ; add 1 coins to the counter
STA $0DBF ; reinsert coins


with a simple INC $13CC. INC is same as LDA $13CC : CLC : ADC #$01 : STA $13CC or LDA $13CC : INC : STA $13CC, but it's faster, shorter and doesn't modifies A.

Second, while you placed all the offsets correctly, you forgot to put db $42 at start, or the offsets MarioCorner, MarioHead or MarioBody will never get trigged. And the extra offsets is required anyway to approve.

Thrid, you're storing to $1DFC two times: one with coin sound and another with fire sound. Decide which one will you sure. x_x

And fourth, you should preverse Y. Since you have to modify Y register, place a PHY at start (after MarioFireBall label) and PLY at end (after Return label and after the last STA $1DFC).