| Official Hex/ASM/Etc. Help Thread |
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Official Hex/ASM/Etc. Help Thread |
|
|
|
|
| Posted on 2011-01-12 08:57:18 AM |
Link | Quote |
|
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
|
| Last edited on 2011-01-12 06:41:23 PM by undefinied3. |
|
| Posted on 2011-01-14 07:28:53 AM |
Link | Quote |
|
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.
Codedb $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!
|
|
| Posted on 2011-01-14 07:53:29 AM |
Link | Quote |
|
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:
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.
|
|
| Posted on 2011-01-14 08:15:28 AM |
Link | Quote |
|
|
Also, you're missing a "SpriteV:" label.
|
|
| Posted on 2011-01-14 01:34:08 PM |
Link | Quote |
|
Put the check for the "Empty" RAM first always. if you check it after, it'll still increase his lives
Codedb $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.
|
|
| Posted on 2011-01-14 03:26:05 PM |
Link | Quote |
|
Still doesn't work.
Codedb $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. |
|
| Posted on 2011-01-14 03:52:30 PM |
Link | Quote |
|
Try rearranging the labels a bit:
Quotedb $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. :/
|
|
| Posted on 2011-01-14 05:28:46 PM |
Link | Quote |
|
|
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.
|
|
| Posted on 2011-01-15 02:56:18 PM |
Link | Quote |
|
ASM
This is a block.
It inserts, but it doesn't do anything when the sprite horizontally hits it.
|
|
| Posted on 2011-01-15 04:09:35 PM |
Link | Quote |
|
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.
|
|
| Posted on 2011-01-16 09:03:10 AM |
Link | Quote |
|
I'm making a ASM to change the tittle screen music
here it is...
Codelorom
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??
|
|
| Posted on 2011-01-16 02:50:58 PM |
Link | Quote |
|
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.
|
|
| Posted on 2011-01-16 03:47:39 PM |
Link | Quote |
|
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
CodePHY ;\
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
|
|
| Posted on 2011-01-16 03:56:01 PM |
Link | Quote |
|
|
well, it doesn't crash, but nothing happens, for some reason.
|
|
| Posted on 2011-01-16 04:10:30 PM |
Link | Quote |
|
|
*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.
|
|
| Posted on 2011-01-16 04:19:08 PM |
Link | Quote |
|
|
That's why I never change the labels in blocks.
|
|
| Posted on 2011-01-20 09:25:36 AM |
Link | Quote |
|
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...
|
|
| Posted on 2011-01-20 09:32:04 AM |
Link | Quote |
|
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.
|
|
| Posted on 2011-01-20 09:42:21 AM |
Link | Quote |
|
|
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.
|
|
| Posted on 2011-01-20 09:48:37 AM |
Link | Quote |
|
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.
|
|
|
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Official Hex/ASM/Etc. Help Thread |