Banner
Views: 854,150,043
Time:
17 users online:  1UPdudes, autisticsceptile1993, ExONightZ, Far, ForthRightMC, Golden Yoshi, Infinity,  KevinM, KitikuSa, MecchaSugoiTntn, MegaSonic1999, Nicoke42, Ralshi02, RyanRocksHacking, Synergic, viniciuskombat, WhiteYoshiEgg - Guests: 39 - Bots: 68 Users: 47,133 (2,480 active)
Latest: Helloworld
Tip: If you give the player a cape, be sure they can't cheat and fly over the level with it!Not logged in.
Schwa's ASM tutorial
Forum Index - SMW Hacking - SMW Hacking Help - Tutorials - Old Tutorials - Schwa's ASM tutorial
Pages: « 1 29 10 11 12 »
Awesomeness. But I guess dat's fot bt soooooo...
#w{|o} nothing to do here

--------------------

Y HALO THAR!
This really bugs me :(

I can't get past the Core Commands! :(

I have no idea what to do D:

How am I supposed to know, what numbers do what? Like you said, 19 makes the power up status. How am I supposed to know what byte does which power up? I do know 00 makes you small and 01 makes you big, but what makes you fiery or cape? How do you know which byte does what?? And, do we replace the 19 with 01 if we want Big Mario or what? And also, how do you know that 19 is the power up status? I am stuck. Or do I need to learn C++ first? That would be horrible. Learning 2 hard languages at once... It would be a nightmare! #ab{o_o}

--------------------
Snake Block! Rattle rattle!
For beginners: We've got it all documented.
For advanced users: Use the disassembly, a debugger, cheat search, or whatever. Or multiple of those.
C++/etc is only needed if you want to create tools; you're not at that point now.

--------------------
<blm> zsnes users are the flatearthers of emulation
I am a VERRYYYYY big beginner at coding because I have only understood ONE language in my whole life which is ActionScript 2 and only a bit of it. So please, tell me is this the right place to post this in that will this code work?
Code
LDA #$B3
CMP #$00
BEQ MakeLuigi
RTS
MakeLuigi:
LDA #$01
STA $B3
LDA #$B3
CMP #01
BEQ MakeMario
RTS
MakeMario:
LDA #$00
STA $B3
RTS


What I want is Mario becoming Luigi when he hits the block and Luigi becoming Mario when he hits the block. The ROM map says $7E:0DB3 is the address, so I used the last 2 letters/numbers which are "B3". Is this okay? ._.

--------------------
Snake Block! Rattle rattle!
Originally posted by hamza62240
I am a VERRYYYYY big beginner at coding because I have only understood ONE language in my whole life which is ActionScript 2 and only a bit of it. So please, tell me is this the right place to post this in that will this code work?
Code
LDA #$B3
CMP #$00
BEQ MakeLuigi
RTS
MakeLuigi:
LDA #$01
STA $B3
LDA #$B3
CMP #01
BEQ MakeMario
RTS
MakeMario:
LDA #$00
STA $B3
RTS


What I want is Mario becoming Luigi when he hits the block and Luigi becoming Mario when he hits the block. The ROM map says $7E:0DB3 is the address, so I used the last 2 letters/numbers which are "B3". Is this okay? ._.

No, because the direct page is zero you must use $0DB3 ($B3 is one of sprite speed adresses) and "CMP #$00" is more useless, "LDA #$00 : STA #$xx" is only needfull if the adress is 24-bit.

Edit: optimized code:
Code
LDA $B3
BEQ MakeLuigi
RTS
MakeLuigi:
LDA #$01
STA $B3
LDA $B3
BNE MakeMario
RTS
MakeMario:
STZ $B3
RTS

Edit²: And "LDA #$B3" will load the number $B3, not the number of adress $B3. #smw{-_-;}

Edit³: Well, I'm editing this post so much. But you code doesn't work anyway.

--------------------
Okay, my layout looks ugly.
@MFG659 if you just correct his code, knowing it won't work, why don't you provide a working code to begin with?

Well, to repeat what he already said:
You can't use $B3 if you want $0DB3, $B3 alone is equal to $00B3.
At least, you picked the right address.

Tp provide a working code:

To clear up your code and make it slightly more simple:

Code
	LDA $0DB3		;load the address
	BEQ MakeLuigi		;if you want to compare with #$00, you don't need the CMP
				;just use the branch command. It compares with #$00 on it's own
MakeMario:			
	STZ $0DB3		;If the code doesn't branch to MakeLuigi, that means we want to make Mario!
	RTL			;In blocks you use RTL instead of RTS
	MakeLuigi:
	LDA #$01		;\
	STA $0DB3		; | Make Luigi and Return
	RTL			;/


Though if you want a even better solution:

Code
	LDA $0DB3	;Load RAM address
	EOR #$01	;invert the last bit:
			;it turnes #$00 into #$01
			;and #$01 into #$00
	STA $0DB3	;Store the result back.
	RTL		;END

The real problem is, that as long as you touch the block, this code will execute, meaning you'll paridly switch between Mario and Luigi.

So, it would be the best, if you either distroy the block, after it's has been used, or you make 2 different blocks, one which turns you into Mario, and one which turns you into Luigi.

Also, for ASM questions, this forum or this thread, might be a better place to look at.

modedit: don't table stretch
OK. Sorry. Probably the reason is I only got to lesson 2 before writing that code. :P And I
I don't know much about maths.


--------------------
Snake Block! Rattle rattle!
Now, how do i get to the Ram map...
By clicking the "RAM Map" link in the sidebar to the right.

--------------------
My YouTube channel
Get the official ASMT resource pack here!

Originally posted by zipper
ASM is difficult...
I can only make command.


If I were you, I would look into opcodes, this document is the beginner's scroll on training on ASM.

--------------------
Give thanks to RPG hacker for working on Asar.
Do you know any good ASM programs?
What do you mean by ASM programs? If you mean things to code ASM with, I would assume most people just use a text editor (I use Notepad++). If you mean things to insert it, Asar is the preferred assembler around here. If you mean useful resources made with ASM, it depends on personal preference, but you can find plenty of blocks, sprites, and patches in the respective sections for them.
Not wrong or bad, but obsoleted by Ersanio's 2 tutorials.

--------------------
Your layout has been removed.
Pages: « 1 29 10 11 12 »
Forum Index - SMW Hacking - SMW Hacking Help - Tutorials - Old Tutorials - Schwa's ASM tutorial

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

Copyright © 2005 - 2020 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy