| ASM for Beginners: Basic, Basic Codes in 20 minutes |
|
Forum Index - SMW Hacking - General SMW Hacking Help - Tutorials - ASM for Beginners: Basic, Basic Codes in 20 minutes |
|
|
|
|
| Posted on 2010-02-02 05:19:18 PM |
Link | Quote |
|
|
Thank you so much, Maxx. I'm making a hack where you play as Yoshi. I originally was just going to use altered graphics, but now I'll hack it so you actually play as him. Amazing tutorial.
|
|
| Posted on 2010-02-03 02:02:57 PM |
Link | Quote |
|
|
I'm attempting to make my first branching coded block, but I'm stuck. I want to make a code after the branch, so that it hurts the Mario when he doesn't meet the requirements. What code would I use after it?
|
|
| Posted on 2010-02-03 02:09:00 PM |
Link | Quote |
|
BEQ Label ; Branch if met
JSL $F5B7 ; Hurt Mario
RTS
Label:
...
RTS
or
BNE Label ; Branch if not met
...
RTS
Label:
JSL $F5B7
RTS
|
|
| Posted on 2010-02-04 08:10:14 PM |
Link | Quote |
|
This is nice, it seems easy to use, I guess I'll make better levels now I know this.
Thanks for the tutorial.
|
|
| Posted on 2010-02-11 09:31:01 PM |
Link | Quote |
|
Maxx:
I DO really owe you one man, thanks to this, I can Finnally insert LevelASM.
Again, thanks.
|
| Last edited on 2010-02-11 10:37:57 PM by Teff007. |
|
| Posted on 2010-02-12 06:42:21 PM |
Link | Quote |
|
I have a problem. D:
I'm trying to make mario enter the level with a fireflower, but I also want collecting 10 coins to give him a cape. Here's the code i'm using:
LDA $7E0DBF; This is the code for the cape.
CMP #$0A
BEQ equal
RTS
equal:
LDA #$02
STA $7E0019
LDA #$03; This is where the code for the FireFlower starts.
STA $7E0019
Exactly like that (No semi-colons). Can somebody tell me what I did wrong?
|
| Last edited on 2010-02-12 06:43:47 PM by Rabees. |
|
| Posted on 2010-02-12 06:49:25 PM |
Link | Quote |
|
Originally posted by RabeesI have a problem. D:
I'm trying to make mario enter the level with a fireflower, but I also want collecting 10 coins to give him a cape. Here's the code i'm using:
LDA $7E0DBF; This is the code for the cape.
CMP #$0A
BEQ equal
RTS
equal:
LDA #$02
STA $7E0019
LDA #$03; This is where the code for the FireFlower starts.
STA $7E0019
Exactly like that (No semi-colons). Can somebody tell me what I did wrong?
What does happen, the game freezes? Or it don`t appear like you want?
Maxx (or however), I`m trying to use the Ground Pound that is in Patches section, But when I start the level, the music continues but the screen`s black, What do I do wrong?
|
|
| Posted on 2010-02-12 06:55:49 PM |
Link | Quote |
|
Originally posted by Teff007Originally posted by RabeesI have a problem. D:
I'm trying to make mario enter the level with a fireflower, but I also want collecting 10 coins to give him a cape. Here's the code i'm using:
LDA $7E0DBF; This is the code for the cape.
CMP #$0A
BEQ equal
RTS
equal:
LDA #$02
STA $7E0019
LDA #$03; This is where the code for the FireFlower starts.
STA $7E0019
Exactly like that (No semi-colons). Can somebody tell me what I did wrong?
What does happen, the game freezes? Or it don`t appear like you want?
Maxx (or however), I`m trying to use the Ground Pound that is in Patches section, But when I start the level, the music continues but the screen`s black, What do I do wrong?
The game doesn't freeze, the fireflower asm just doesn't work. No fireflower. :\
EDIT: I'm getting a fireflower after 10 coins now? And no cape? WHAT'S GOING ON HERE!?
|
| Last edited on 2010-02-12 07:17:18 PM by Rabees. |
|
| Posted on 2010-02-13 03:39:07 AM |
Link | Quote |
|
Rabees, try this code:
LDA #$03 ; Load fire flower.
STA #19 ; Store to Mario's power-up.
LDA $7E0DBF ; Load coin total.
CMP #$0A ; Has he got 10 coins?
BCS Greater ; Branch if equal or greater.
RTL ; End code.
Greater:
LDA #$02 ; Load cape.
STA $19 ; Store to Mario's power-up.
RTL ; End code.
Edit: Fixed the code. Thank you Ultimaximus, I didn't see the pound sign.
|
| Last edited on 2010-02-14 05:58:13 AM by Master S. |
|
| Posted on 2010-02-13 10:40:27 AM |
Link | Quote |
|
Originally posted by Master SSTA #7E0019 ; Store to Mario's power-up.
This is storing to a number itself, not an address. It should be $7E0019. Of course, since the address is under $7E1FFF, it can be shortened to $0019, and since that starts with 00 which is assumed, it can be shortened further to STA $19.
Originally posted by Master SLDA £7E0DBF ; Load coin total.
XD You need the American dollar ($) sign. It's "$" not because it's the monetary unit, but because it's right after "#" on a typical (American) keyboard (hence "%" being used for binary).
Oh, and instead of CMP #$0A to compare to 10 coins, since coins are in decimal, you can use CMP #10. #value is decimal, #$value is hex.
|
|
| Posted on 2010-02-25 02:10:45 AM |
Link | Quote |
|

What just happened?
|
|
| Posted on 2010-02-25 08:43:32 AM |
Link | Quote |
|
|
Boredman, I can't help you if you don't post the code you used. :S
|
|
| Posted on 2010-02-25 11:24:35 AM |
Link | Quote |
|
Sorry Maxx, here. I was doing some HDMA, copied a code basically.
Codelevel1:
LVL1BLUE:
db $4F,$99
db $08,$9A
db $08,$9B
db $08,$9D
db $08,$9E
db $08,$9F
db $00
|
| Last edited on 2010-02-25 11:24:58 AM by boredman. |
|
| Posted on 2010-02-25 01:31:08 PM |
Link | Quote |
|
|
That's not how HDMA works. What you're using here is only the color table, but the way you're using it, xkas interprets it as (invalid) code, causing the game to crash. You have to use Kaijyuu's code (from the D) section of his HDMA guide) and replace the color table with yours.
|
|
| Posted on 2010-02-25 02:07:54 PM |
Link | Quote |
|
Also, when I'm trying to get the climbing frame thing, it does nothing. Here is my code:
Codelevel2:
LDA $7E0075
CMP #$01
BEQ equal
RTS
equal:
LDA #$0A
STA $7E0DBF
|
|
| Posted on 2010-03-03 09:00:10 PM |
Link | Quote |
|
Now I can learn ASM! At first I saw it and said "This is just a bunch of random numbers with dollar signs in front!" But now, it makes sense why.
Thanks, Maxx!
|
|
| Posted on 2010-03-04 06:53:28 PM |
Link | Quote |
|
|
Asm will be in my next rom thx!!
|
|
| Posted on 2010-03-05 09:18:06 PM |
Link | Quote |
|
Originally posted by boredmanAlso, when I'm trying to get the climbing frame thing, it does nothing. Here is my code:
Codelevel2:
LDA $7E0075
CMP #$01
BEQ equal
RTS
equal:
LDA #$0A
STA $7E0DBF
Code$7E:0075 1 byte Flag "Mario is in water" flag
Change the code to this and it should work (haven't tested it):
Codelevel2:
LDA $74
CMP #$01
BEQ equal
RTS
equal:
LDA $0DBF
CLC
ADC $0A
STA $0DBF
RTS
|
|
| Posted on 2010-03-06 09:36:48 AM |
Link | Quote |
|
Codelevel2:
LDA $74
BNE water
RTS
water:
LDA #$0A
STA $0DBF
RTS
Double fixed.
|
| Last edited on 2010-03-06 09:37:05 AM by Maxx. |
|
| Posted on 2010-03-06 09:51:29 AM |
Link | Quote |
|
|
Thank you very much Maxx! Very helpful!
|
|
|
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - Tutorials - ASM for Beginners: Basic, Basic Codes in 20 minutes |