Banner
Views: 236,216,903
Time: 2013-05-21 09:46:07 PM
10 users online: CerberusYoshi, Jack Kitetsu, kianworld, MetalYoshi94, MolSno, MonkeyMan, Reggie, Rextep, Sokobansolver, wiiqwertyuiop - Guests: 38 - Bots: 16Users: 22,858 (1,279 active)
Latest: FUNKY kong ending
Tip: There's a fine line between difficult and unfair. Avoid the latter.
Official Hex/ASM/Etc. Help Thread
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Official Hex/ASM/Etc. Help Thread
Pages: « 1 ... 290 291 292 293 294 ... 319 320 »
Maniacal laughter + ASM = always a good sign
Hey, I have two small ASM questions.

1) How could I make a block (if possible) that shatters if the ON/OFF Switch is set to ON and needs no contact? (I mean, nor Mario nor any sprites have to touch it, it just shatters when the switch is ON)
I want to do something like when a VWF dialogue ends, the switch sets to ON and the blocks shatter (but without anything touching them).

2) How to make a block's/sprite's/VWF message's code to "wait" some time? It'd be pretty cool if there was a way to make a VWF message wait a bit until a gate opens or blocks shatter or something and then "release" Mario. Is there a specific command for that or some other tricky thing?
Dunno any VWF stuff but I can answer #1.


Simply put, not possible. With some hardcoding, you certainly could shatter a bunch of blocks; I do it all the time for custom bosses and the like. But that's unique, specifically made code for every different circumstance. If you want it portable and easy to apply, you'll have to do something else. Exanimation to make them look/act passable is the normal method and should work fine (doesn't always have to be dotted outlines, if you want something more thematically appropriate).
Oh, alright. I thought of using the One Shot ExAnimation type, but I just wanted to be sure. Sorry if it was a bit stupid question, I'm still not that big (or even medium) at ASM. :p

Well, as for the second question, I don't mean it's VWF-specific, although yes, I guess it wouldn't have much use at anything else. I remember there were those NOP and WAI opcodes, what do they do actually? Wouldn't they work for my second question? (though I have a feeling that they wouldn't)
Using WAI, NOP or any other opcode that wastes lots of cycles won't help because the time wasted there is negligible for you needs. You'll have to use a custom timer using a free RAM Address (and $13 if you want a longer timer).
I see (kind of). Um, how exactly could I do that counter? To be honest, I have no idea (I've never done anything like this before). Load $13 to a free RAM address then compare? (this would probably be a stupid thing but it's the first thing that came to my mind)
You could probably do something like this:

Code
LDA $13 AND #$03 ; Change this if you want to BNE + INC !FreeRAM + LDA !FreeRAM CMP #$15 ; Wait time BCS MoveOn ...
I would change the AND #$03 to AND #$3F and replace the CMP #$15 with CMP #xx, where xx is the time in seconds to wait for (though it'd be off by a very small amount of time). Don't forgot to add STZ !FreeRAM after the message has ended too.
Awesome, it works now! It's exactly the effect I wanted. Thanks a bunch, wiiq and Iceguy.
Weird question time:

So I managed to finally insert my layer 3 background into my vertical level. However, for some reason the code has caused the camera to shift the camera 18 or so pixels to the right.

I imagine putting some code in levelinit.asm to shift the camera back over to the left (or layer 1 and 2 to the right) would remedy the problem, but I'm not sure how exactly how I would do that. can I get some help please?
For layer 3, you just change $22-25. There's no other mirrors for the layer position like there is for layers 1 and 2.


If you want layer 3 static, you can just set it to a specific value every frame in levelasm.
Originally posted by Kaijyuu
For layer 3, you just change $22-25. There's no other mirrors for the layer position like there is for layers 1 and 2.


If you want layer 3 static, you can just set it to a specific value every frame in levelasm.


I'm really confused as to how that was an answer to my question. I just want to move everything (all the layers) over a little more than 1 tile to the right w/o using lunar magic. moving the camera to the left would accomplish what I need as well.

The thing I'm talking about on IRC is a separate issue, if that's what threw you off.

EDIT: I seemed to have found a solution, albeit a weird one. I disabled vertical scrolling in the levelasm. If I move that code into a generator I don't seem to have any problems. Huh...
Last edited on 2012-03-27 04:54:55 PM by jesus.
Quick question: is the "standard" for finding free ROM space to search for consecutive 00s not protected by a RATS tag or to just use any unprotected data?
Search for unprotected 00. Some tools misses to use RATS tags (and/or does it improperly, for example by missing to protect the last byte), and not breaking them sounds like a good idea to me.
Is there a way to terminate a VWF message in the middle of processing it and load a new message, based on user input from somewhere else?
Couldn't you just throw a db $F1 : dl .code in the middle of the text (or at whichever place you want it), and have the .code part change the text pointer if certain conditions are met?




Two questions of my own for once:
  • Is there a list of which HDMA channels are used for which purposes in SMW? I'm in a situation where I might have to use more than the usual three channels, and it'd be nice to know which channel is safest to overwrite.
  • Does anyone happen to have a code template that generates a "vertical wave" HDMA effect? It doesn't look like ScrollBars supports that, and I'm far too inexperienced with any HDMA (other than brightness and color) to make anything like that from scratch.
Originally posted by WhiteYoshiEgg
Couldn't you just throw a db $F1 : dl .code in the middle of the text (or at whichever place you want it), and have the .code part change the text pointer if certain conditions are met?

No, that won't clear the text that's already there. Although now that I think about it, I wonder if I could use $ED or $FC...but how would I check for a certain button every frame? It would have to be processed separately from the VWF message code, but maybe I could change the VWF text pointer manually...huh. I'd have to try it.

As for your questions:
1) Yeah, SMWiki has one, although it's incomplete. You should be safe using channel 6 as well.
2) Doesn't one of Ice Man's HDMA effect packages have such a code?
Last edited on 2012-04-02 06:21:30 PM by imamelia.
As I recall, channels 3 4 5 and 6 are safe to use. 6 is used during the ending credits, 7 on the overworld.

0, 1, and 2 are used for DMA at various points.



There's a wavy HDMA example in my tutorial thread, but it's just directly copy/pasted from my personal levelasm and not really commented. Not good if you want to learn how to do it yourself.
Hey, me again.

I'm still trying to work my layer 3 code so that it will act like rising lava/poison in a vertical level. Various people told me that there is a problem with doing this: first, layer 3 position is relative to the screen, so I must fix it to something else. Second, layer 3 can only be 512 by 512 tiles large, so if I DO fix it, it will loop around constantly.

I think I worked out a solution: If I set layer 3 relative to layer 1, but then offset it by an amount that is constantly increased by a variable (the distance between mario and the surface of the lava), layer 3 will rise at a rate so that it the player can never outrun the whole image, but it is still possible to survive. It's sort of a "rubber band" effect that bad racing games have between the player and npcs, except it's with the player's y position and the y position of the layer 3 lava/poison/whatever.

So, I wrote out some code, and, surprise, it isn't doing what I want. I don't think my idea is the problem; there has to be something going awry with my bad programming. Right now, layer 3 just flies all over the place really quickly at variable speed. Worse, it seems to be going downwards rapidly rather than upwards.

Here is the init routine
Code
L3Init07_InitRising: STZ $2E STZ $2F STZ $30 STZ $31 REP #$20 LDA $1C CLC ADC #$0BD0 STA $30 SEP #$20 RTL
And here is the Main routine
Code
L3Main06_Rising: REP #$20 LDA $96 SEC SBC $24 BEQ NOVERFLOW BVC NOVERFLOW LDA #$0010 NOVERFLOW: LSR LSR LSR LSR CLC ADC $2E STA $2E LDA $30 SEC SBC $2E BVC NOVERFLOW2 LDA #$0000 NOVERFLOW2: STA $24 SEP #$20

($2E and $30 are being used as freeram; $2E as the growing layer 3 offset and $30 as the initial layer 3 offset. I've also never used BVC before so I may be using it wrong)

hopefully someone can help me out with this. Thanks!
Last edited on 2012-04-03 04:32:01 AM by jesus.
So sorry for not being able to help you right now, jesus - I might do an in-depth read of your code later.




My actual reason for posting: Gah, color addition is driving me nuts.
I want to apply color addition (through a backdrop color gradient) to layer 3 (and only layer 3), which is on the subscreen with everything else on the main screen. I've tried a dozen possible settings of $40 and $44, but none have the desired effect. Is this even possible to do given my situation?

To make things slightly clearer, this is what I'd like to have:
Last edited on 2012-04-03 10:08:15 AM by WhiteYoshiEgg.
Pages: « 1 ... 290 291 292 293 294 ... 319 320 »
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Official Hex/ASM/Etc. Help Thread

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

Copyright © 2005 - 2013 - SMW Central
Legal Information - Link To Us


Total queries: 29

Menu