Banner
Views: 236,178,801
Time: 2013-05-21 03:57:26 PM
27 users online: o 1UPdudes, altoiddealer, AntiDuck, o AnybodyAgrees, Arctic Avenger, baphomet, o BloodyToothBrush, Disco, DPBOX, EddyCartoon, ErikAlay, Flame8765, kirbymaster1, KY2010, o Ladida, o Luigi-San, Magiluigi, ManuMaster654, MolSno, Nameless, Pikerchu13, scooter102089, o ShadowPhoenix, Sokobansolver, o Undy, WeegeeBen, wiiqwertyuiop - Guests: 22 - Bots: 13Users: 22,858 (1,288 active)
Latest: FUNKY kong ending
Tip: Do not set the music bypass to 00 in a level with a P-switch/star; the music will endlessly loop.
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 ... 244 245 246 247 248 ... 319 320 »
State1:
JSR CircularMovement
LDA Flag3,x
BNE DontGenClusterAgain
JSR GenCluster
INC Flag3,x
DontGenClusterAgain:
JSR GenShell1
JSR GenShell2
RTS

;Graphics, GET_DRAW_INFO, SUB_OFF_SCREEN codes here...

GenShell1:
LDA $14
AND #$7F
ORA $9D
BNE RETURN2
JSL $02A9DE
BMI RETURN2
PHX
TYX
LDA #$0A
STA $14C8,x
LDA #$04
STA $9E,x
JSL $07F7D2
LDA #$20
STA $B6,x
TXY
PLX
LDA $E4,x
CLC
ADC #$0F
STA $00E4,y
LDA $14E0,x
STA $14E0,y
LDA $D8,x
STA $00D8,y
LDA $14D4,x
STA $14D4,y
RETURN2:
RTS
GenShell2:
LDA $14
AND #$7F
ORA $9D
BNE RETURN3
JSL $02A9DE
BMI RETURN3
PHX
TYX
LDA #$0A
STA $14C8,x
LDA #$04
STA $9E,x
JSL $07F7D2
LDA #$DF
STA $B6,x
TXY
PLX
LDA $E4,x
SEC
SBC #$0F
STA $00E4,y
LDA $14E0,x
STA $14E0,y
LDA $D8,x
STA $00D8,y
LDA $14D4,x
STA $14D4,y
RETURN3:
RTS

EDIT: Nevermind. I just need more speed :P
Last edited on 2011-01-12 06:41:23 PM by undefinied3.
I need help.
This code is supposed to give Mario an extra life and then increase the "Empty" value, so when Mario hits it AGAIN, he doesn't get anymore lives.
Code
db $42 JMP MarioBelow : JMP MarioAbove : JMP MarioSide : JMP SpriteV : JMP SpriteH : JMP MarioCape : JMP MarioFireball : JMP TopCorner : JMP HeadInside : JMP BodyInside MarioAbove: MarioBelow: INC $0DB4 INC $13E6 LDA #01 CMP $13E6 BEQ Return Return: RTL MarioSide: SpriteH: MarioCape: MarioFireball: TopCorner: HeadInside: BodyInside: RTL

It inserts, but it doesn't do anything.
Thanks!
Use $0DBE instead of $0DB4. As a rule of thumb, you should always use the address that says "current player's", not "Mario's" or "Luigi's".

Also, you'll want to check $13E6 before giving the player a life. The way you've got it now:
Code
BEQ Return Return:

it branches to the Return label no matter what. You need to check if $13E6 is 01, and if it is, go to the Return: label, otherwise increase $0DBE.
Also, you're missing a "SpriteV:" label.
Put the check for the "Empty" RAM first always. if you check it after, it'll still increase his lives
Code
db $42 JMP Mario : JMP Mario : JMP Mario : JMP Return : JMP Return : JMP Return : JMP Return JMP Mario : JMP Mario : JMP Mario Mario: LDA $13E6 BNE Return INC $0DBE INC $13E6 Return: RTL

This should work.
Still doesn't work.
Code
db $42 JMP MarioBelow : JMP MarioAbove : JMP MarioSide JMP SpriteV : JMP SpriteH : JMP MarioCape : JMP MarioFireball JMP TopCorner : JMP HeadInside : JMP BodyInside MarioAbove: MarioBelow: LDA $13E6 BNE Return INC $0DBE INC $13E6 Return: RTL MarioSide: SpriteV: SpriteH: MarioCape: MarioFireball: TopCorner: HeadInside: BodyInside: RTL

I've done everything you told me to, but it just won't give Mario a live.

Mod edit: Killed some table stretch.
Last edited on 2011-01-15 01:39:42 AM by Alcaro.
Try rearranging the labels a bit:

Quote
db $42
JMP MarioBelow : JMP MarioAbove : JMP MarioSide : JMP SpriteV : JMP SpriteH : JMP MarioCape : JMP MarioFireball : JMP TopCorner : JMP HeadInside : JMP BodyInside
MarioAbove:
MarioBelow:
MarioSide:
TopCorner:
HeadInside:
BodyInside:
LDA $13E6
BNE Return
INC $0DBE
INC $13E6

SpriteV:
SpriteH:
MarioCape:
MarioFireball:
Return:
RTL


If that doesn't work, I'm clueless. :/
I know I seem like such an idiot asking this, but I'm new to ASM anyways. Basically, I have a sprite that I want to use for a boss battle. So I want the typical defeat-boss-to-end-level thing that I can't make. Also, I would like it to enable the yellow switch blocks.
ASM
This is a block.
It inserts, but it doesn't do anything when the sprite horizontally hits it.
I've only taken a very quick look at it, so I might have missed a few things, but here's what I noticed:

- Storing to the controller RAM doesn't actually do anything in blocks/sprites, since their code is executed after the controller RAM has already been dealt with by the game. You'd have to make Mario jump manually by changing his Y speed, playing a sound and possibly changing his pose.

- You can leave out the leading zeroes at the beginning of RAM addresses to save some space (use $7D instead of $007D, $15 instead of $0015 etc.). Just make sure to only remove the zeroes if there's two of them ($0DBF, for example, shouldn't become $DBF).

- Your way of comparing isn't exactly efficient - Try loading the address first, then use a fixed value in the CMP statement.

LDA $7C
CMP #$01
BEQ Second
CMP #$02
BEQ Third

would work just as well, but save more space and typing time.

The last two points are just more-or-less-helpful tips, I guess the first one is what's causing you trouble.
I'm making a ASM to change the tittle screen music
here it is...
Code
lorom header org $0096C3 jsr $8134 lda #$01 ;music to play sta $1DFB ;bank to use

... it's my first shot making an ASM, and it actually work as it is right now, but I want to use custom music with it instead of the originals, that did I have to put to do that??
I need help.
Pastebin
It's supposed to make Mario jump if he lands on it (and it increases Empty by 1), and make him jump higher if he spin jumps on it (and it increases Empty by 2). When Empty is 4, it breaks.

However, if Mario uses a fireball, it increases the number Empty has to be to break to 6.

Unfortunately, it crashes the game when the code is activated.
Now there's a couple things wrong with that.

1. Line 38 "LDA $D0", don't you mean LDA #$D0?

2. That's not the correct way to shatter the block. you have to use this
Code
PHY ;\ PHB ;| LDA #$02 ;| PHA ;| Shatter Effect PLB ;| LDA #$00 ;| JSL $028663 ;| PLB ;/ LDA #$02 ;\ Replace Block STA $9C ;| with tile 25 JSL $00BEB0 ;/ PLY


3. The last part with MarioFireball is getting run when anything is touching it. remember that if there's another label before it, it'll run for that one too.

4. Some of the JMP's you have aren't needed since the label is right after it.

5. The Code can be reduced.

I went ahead and reduced it a bit. the code can is here
well, it doesn't crash, but nothing happens, for some reason.
*Hits self on desk* i forgot that the second JMP is MarioAbove and 1st is MarioBelow. so change the first JMP to JMP Return and the 2nd to JMP Mario.
That's why I never change the labels in blocks.
I'm having a bit of a problem with my sprite here, and it involves the ASM (or whatever it's called) for the bob-omb sprite. Here is the part of that code:

Code
SPRITE_TO_GEN = $38 ;only used if first extra bit is clear CUST_SPRITE_TO_GEN = $20 ;only used if first extra bit is set


can somebody help me out here? It's for an Albatoss boss like type thingy...
The first definition is a NORMAL sprite that will be throwed when the extra bit is clear.

The second definition is a CUSTOM sprite that will be throwed when the extra bit is set.
I know that but my problem is which one I need to load in the normal one for the bob-omb sprite.. in ASM language of course.
The first one will be used if you are using a normal sprite for it.
The second one will be used if you are using a custom sprite for it.

So if you want it to spawn the SMW bob-omb, you would change the value in the first one to $0D.
Pages: « 1 ... 244 245 246 247 248 ... 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: 27

Menu