Banner
Views: 583,739,425
Time: 2017-11-20 07:07:55 AM
6 users online: Bad luck man, JonKaruzu, MercuryPenny, Najeraldo, o RealMarioGamer, Sixcorby - Guests: 27 - Bots: 205Users: 33,001 (1,432 active)
Latest: Petrifying
Tip: Don't place Yoshi coins near a goal post because they keep glowing when a level fades out.Not logged in.
Details for Event Dependent Block V.1.0
SMW Blocks - Event Dependent Block V.1.0
File Name: Event Dependent Block V.1.0
Added: 2017-05-29 09:52:22 PM
Authors: RussianMan
Act As: Any
Includes GFX: No
Description: This block will act like another block when certain event is activated.

Be sure to check readme for more details.

Requested by Gi Manilla

Include SA-1 Version.
Tags: sa-1
Rating: 5.0 (Votes: 2)
Download: Download - 2.12 KiB
66 downloads
  Submit Update
MarioFanGamer
The code below is supposed to work. Edit: At least if it weren't for the CMP. You know that the event RAM is eigth flags per bit so you're supposed to use "AND" not not "CMP" for that. Edit²: And my mistake was that the event flags are stored in reversed order. Yeah, it's a bit complicated.

Quote
Is it even right? Does it divides by 8? Unless ">>" IS division

In a way, ">>" is a division order. But a division a by 2 (equal to "LSR" in 65c816). And the number after the operator tells, how often Asar should divide the number by two. You can write "m>>n" as m/(2^n) where m is the input and n the amount of shifts.

Edit³: You know what, here is the correct event determiner:
Code
!EventIndex = (!Event>>3)
!EventBit = (1<<(7-(!Event&(7))))
Posted by: MarioFanGamer - 2017-10-17 07:16:22 PM
RussianMan
I tried to update it once again... and failed. Due to how unclear is what I supposed todo. To find Index, you have to divide by 8, but since IDK how it works in Asar, I have

Code
!Event = $01

!EventIndex = (!Event>>3)	;Index (Is it even right? Does it divides by 8? Unless ">>" IS division)
!EventBit = (1<<(!Event&7))	;Bit

!BlockNum = $0025		; Ats like when Event is active
!EventRAM = $7F02+!EventIndex	; RAM were table is (in range from 7F02 to 7F0E) 	

... jumps

OK:
LDA !EventRAM  		;\Table ram
CMP #!EventBit		;|Check if bit is set in this table (aka event active) 	
BEQ ActLike		;/Make block act like whatever you like!
RTL

...Set to act like !BlockNum


Quote
latter two variables instead


Unclear again, do you mean use !EvenIndex and !EventBit and not !Event? I'm pretty sure I'm supposed to use all of them.

(Also, it's SA-1 code).
Posted by: RussianMan - 2017-10-03 05:40:49 PM
MarioFanGamer
Then why didn't you tell that in the first place? You simply have to use the latter two variables instead of the first one.
Posted by: MarioFanGamer - 2017-08-27 06:43:31 PM
RussianMan
No, I meant how to use the variables in code.
Posted by: RussianMan - 2017-08-02 03:46:15 PM
MarioFanGamer
@RussionMan: Go to "Submit Update" (below the download) and upload a ZIP file with the updated blocks.
Posted by: MarioFanGamer - 2017-08-02 07:38:19 AM
RussianMan
I'm too stupid to update it... IDK how it works! Can somebody explain me how it works?
Posted by: RussianMan - 2017-07-14 05:39:34 PM
RussianMan
I know that it can be better done, but I didn't know how. I'll update block soon.
Posted by: RussianMan - 2017-06-28 02:47:25 PM
MarioFanGamer
It could have been a bit more user-frendlier if you had made a single variable which controls both, the index and the bit. In order to get the index, you just have to divide by 8 and for the bit (e.g. "x+(E>>3)"), you just have to shift bit one by the reminder of the division (e.g. "y<<(E&7)".
Basically this:
Code
!Event = $01

!EventIndex = (!Event>>3)
!EventBit = (1<<(!Event&7))


Edit: It also allows you to have a discription which states the event number too.
Posted by: MarioFanGamer - 2017-06-27 06:58:35 AM
Sonikku
It works as intended. I recall that a similar block used to exist with the classic BlockTool, but maybe my memory is just mistaken. Regardless, this block seems like it has potential to be incredibly useful.
Posted by: o Sonikku - 2017-05-29 09:54:37 PM
RussianMan
Your welcome :)
Posted by: RussianMan - 2017-04-18 04:48:11 PM
Gi Manilla
Works as intended, thanks a bunch!
Posted by: Gi Manilla - 2017-04-17 06:06:48 AM
RussianMan
It wasn't simple at the beginning, but now I understand how it works, so... it's simple to me :P
And SA-1 support is the easiest thing I did with block. Really :P
Posted by: RussianMan - 2017-04-11 12:45:26 PM
SwagAssMustafa
How'd ya know this? Was this simple?
Posted by: SwagAssMustafa - 2017-04-11 12:42:27 PM

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2017 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 27

Menu

Follow Us On

  • Facebook
  • Twitter
  • YouTube

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented