Language…
4 users online: Children's Playmate Magazine, FedoraFriday, Golden Yoshi, Necroeric - Guests: 109 - Bots: 174
Users: 69,704 (2,532 active)
Latest user: Togmyoa

Help needed to modify existing block code + create a new block

What I am after is a block (1) that, when touched by mario from any side, causes a different block (2) to change into another block (3) for a few frames, then revert back into it's original state (block 2) when no longer touching block 1.

I use a modified version of Snowshoe's P-Switch Set on Powerup Block that does what I need, but would like to make a much more versatile block that doesn't rely on p-switch timer code. I'm hoping to create a new value to be read but don't have much ASM knowledge, so am looking for someone to help me out.

The code I currently use is:
Code
; this block shortens and expands p-switch timer length depending on what power mario has, be it normal, mushroom, or fire and cape.
; by Snowshoe http://www.smwcentral.net/?p=profile&id=2122

db $42
JMP Mario : JMP Mario : JMP Mario : JMP Sprite : JMP Sprite : JMP Cape : JMP Fire
JMP Mario : JMP Mario : JMP Mario
print "A p-switch timer block that activates for only 3 frames."
Mario:	LDA #$00
	STA $1DF9
	LDA #$00
	STA $1DFB
	LDA #$00
	STA $1887
	LDX $19
	LDA TIMER_TYPE,x
	STA $14AD	; Note : Change to $14A_E/D for silver/blue P-Switch
Sprite:
Cape:
Fire:
	RTL             ; RTS Crashes your rom when using BTSD, it only works for bin blocks.

TIMER_TYPE:
	db $03,$03,$03,$03	;db $3F,$7F,$FF,$FF


So far I have this code which allows the p-switch timer only 3 frames of activity before reverting back. I would like to keep this functionality, as well as the powerup functionality but remove the reliance on the p-switch timer code.

This video shows what I want to do, but because of p-switch timer code the music gets restarted, and I can't use the actual p-switch alongside this block.

https://www.youtube.com/watch?v=nshvN3vEog4

I suppose two custom blocks would accomplish this task much better:
1. To be the block that is passed through to activate block 2.
2. This block which would act as one of two different Map16 blocks depending on block 1's timer.