Language…
16 users online:  Alex, Alfombra de madera,  AmperSam,  Anorakun, art61, Gattocqt89, HammerBrother, Heitor Porfirio, Isikoro, LightAligns, mmBeefStew, mmmdoggy, monkey03297,  sincx, TheKazooBloccGosh,  Thomas - Guests: 78 - Bots: 182
Users: 57,930 (2,489 active)
Latest user: spygames36

ASM Question and Block Offsets

How do I know the difference of offsets in Blocktool.

And these code, for example


Code
LDA #$xx


How do I know the correct specific number to go in xx?
Fierce Deity is cool.
Workin' in OW request...
Currently attendind Scape Santa, but I don't know what to do...
The number you load depends on what you are going to do with it.
As for the Blocktool offsets:

0: Run the code
-1: Do nothing
Any other offset: What address to start the code at.


 
Because I'm trying to make a block that is only slippery if small Mario stands on it.

And I'm trying to make a DKC Barrel block...
Fierce Deity is cool.
Workin' in OW request...
Currently attendind Scape Santa, but I don't know what to do...
You'll need a sprite for the barrel if you want it to move and you'll need LevelASM to only run the slippery code if Mario is on that block. Otherwise, you'll just have the whole level slippery as Mario plays through it.
----------

Interested in MushROMs? View its progress, source code, and make contributions here.

I think I understand... Thanks... but I still don't know about this:


Code
LDA#$xx

Fierce Deity is cool.
Workin' in OW request...
Currently attendind Scape Santa, but I don't know what to do...
Okay... you know what the LDA opcode does, right? It simply loads a RAM value from the accumulator ("A"). To store this value to the accumulator, you'll need to use the opcode STA right after the LDA opcode. There's a "#" right before the dollar sign and the number, which means that you're doing something with a RAM value. Let's say that you want to make a block that makes Mario big (as shown in Schwa's ASM Tutorial). This is what you'll need to type in order to the block work correctly:

LDA #$01 (#$01 is the RAM value that means Big Mario. For more RAM values, check out the "RAM Values Thread", found in the SMW Data Repository forum.)
STA $19 (This means that the RAM value for big Mario is going to be stored in the accumulator, and you need to type the RAM address right after the STA command to do that - RAM address $19 is related to the player's powerup, by the way.)
RTS (I'm pretty sure you know what this means, but anyway: RTS stands for Return To Subroutine, and needs to be put at the end of the code. Otherwise the game is going to crash or something.)

Oh, and if you're using BTSD, I'd suggest to put RTL in the end of the code instead of RTS. If you haven't gotten it yet, check out Schwa's ASM tutorial, stickied up this forum. Oh, and to code the ice block, you'll need to use branching commands, so if you don't know what they do or how to use them, check out the ASM tutorial. As for the offsets of this block... I think you can set the above offset to 0 and all the others to -1, meaning that if Mario is above the block, it's going to be slippery, and if he's not above the block, it's going to do nothing. Hope that helps. ;)

Oh, and as for the barrel thingy, I cannot help you, since it sounds rather like a sprite than a block.
I'm going to cut in here and say that such a block already exists- it's in the blocktool folder. It's called something like slippery block.
Very thanks, Broozer and Doomdragon. Broozer, you can speak to me in Portuguese, I'm Brazilian too.
Fierce Deity is cool.
Workin' in OW request...
Currently attendind Scape Santa, but I don't know what to do...
Originally posted by Manuz
Very thanks, Broozer and Doomdragon. Broozer, you can speak to me in Portuguese, I'm Brazilian too.


I had realized that before, by taking a look at your "from" line, and by seeing your avatar - I just like speaking English in the forums, so that other people that have the same problems that you do can understand what I'm saying and stuff. If you don't understand something, though, PM me and I can explain everything in portuguese, but I think you've gotten it. ;)

Originally posted by Doomdragon
I'm going to cut in here and say that such a block already exists- it's in the blocktool folder. It's called something like slippery block.


I think Manuz was trying to code a block that's only slippery for small Mario, and acts like a regular block if any other Mario forms collide with it.
You're right, Broozer. I'm trying to make a block that is only slippery if small Mario stands on it
Fierce Deity is cool.
Workin' in OW request...
Currently attendind Scape Santa, but I don't know what to do...



deleted.


Kawaii !!


Originally posted by Aiyo
Originally posted by WhiteYoshiEgg
As for the Blocktool offsets:

0: Run the code
-1: Do nothing
Any other offset: What address to start the code at.

Actually, 0 means start from line 0, and -1 means don't execute.... based on my theory: http://kaiyoken.googlepages.com/Offsets.txt

I honestly never tried that myself, but i have a strong feeling I'm correct.


no it's all wrong.

I'm not sure how you came up with lines because it's a very awkward concept and blocktool has no access to such information when all it works with are .bin files.

offsets are byte offsets into the .bin file where blocktool will jump to on the given condition. -1 means it will not run the code at all on the given condition. reloc offsets are byte offsets into the .bin file where an absolute address (16bits) is placed that needs adjusting. blocktool bins are assembled from 0000 afaik so that a .bin containing for whatever reason:

Code
JSR $0002
RTS


will need a reloc offset on offset 1 (to adjust the JSR address). it needs this because the bin can be placed anywhere in the rom and addresses that are not relative need fixing.
I think I understand, but I still don't know about some other offsets...
Fierce Deity is cool.
Workin' in OW request...
Currently attendind Scape Santa, but I don't know what to do...

oh i see. okay.
Kawaii !!


and other offsets like 2,3,4,...?
Fierce Deity is cool.
Workin' in OW request...
Currently attendind Scape Santa, but I don't know what to do...