File Name: | Automatic ON/OFF Switch Triggering |
Submitted: | 2013-03-10 12:20:43 by Koopster |
Rating: | 0.0 |
Authors: | Koopster |
Tool: | Romi's Spritetool |
Type: | Generator |
Dynamic: | No |
Disassembly: | No |
Includes GFX: | No |
Description: | This generator makes the ON/OFF switch trigger automatically. By default, it triggers on each 6 SMW seconds (or $FF frames). You can customize the triggering time by changing the frames value on the ASM file. Made on EvilGuy's request. |
Tags: | automatic, switch, trigger |
Download: | 7 downloads |
Code
dcb "INIT" dcb "MAIN" LDA $13 AND $FF ; Frames until switch triggers BNE Return LDA #$0B STA $1DF9 LDA $14AF EOR #$01 STA $14AF Return: RTL
- AND $FF will read from RAM address $FF, which is freeram or used by LM for some undocumented purpose (I don't know which). You want #$FF.
- You're using $13. You want $14 in almost every situation, or the timer will run while the game is paused, while Mario is being hurt, and a bunch of similar situations.
- The comment's suggests that #$C0 would be a valid value - it's not, it'd make the switch go completely crazy for 64 frames and then stand still for 192 frames. You want to mention that the only valid values are #$00, #$01, #$03, #$07, #$0F, #$1F, #$3F, #$7F and #$FF; alternatively you can use a RAM address and make your own timer. Unfortunately, the generators don't seem to have any dedicated RAM addresses, so I'd recommend making this a normal sprite if you're going to use this method.
<blm> zsnes users are the flatearthers of emulation