Banner
Views: 327,598,303
Time: 2014-12-18 03:38:20 PM
28 users online: 2cheerduck, Iesua Nazarenus, Alcaro, o Misplaced Halloween Decoration, o allowiscous, Amos Defamos, Sin, o Buster Beetle, o Counterfeit, Tree Christimas, Davros, CAN'T MAKE A GOOD HOLIDAY NAME, Mordecai, Sinon, o Hippo, o Koopsnow, smells like roses, is secretly, o Yukirann, dril, MerryMoskyMas2000, Jolly Old Potato, o Snowshizler, o Ghost of Christmas Future, smn00b, Mayonnai, Amos Defamos, Letty Whiterock - Guests: 36 - Bots: 34Users: 26,008 (1,132 active)
Latest: smn00b
Tip: This thread contains data you might find helpful when coding.
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 2 3 4 5 6 ... 353 354 »
Man im so sorry for confusion, and if your wondering why im requesting the pow, its for a secret.
Can you tell us exactly what you want? (Unless it spoils the secret)
Last edited on 2007-09-07 11:48:31 PM by Boingboingsplat.
like I already said it would be much easier to use ON/OFF animation to do what you seem to want. but like I already said, what you seem to want to do with it is just a cheap trick and should be avoided at all cost

Meh, unless you get clear and direct, I will just stop caring about your request
Last edited on 2007-09-07 11:54:56 PM by Bio.
Its ok nevermind, I'll just stick with what I have. I'll just go back to figuring that on/off animation thing. Sorry for everything guys. -_-
Okay, I've finally jumped into ASM. I've coded a block that I think when touched Will set the On/Off flag to Off if one Dinosaur COin is collected. Here is the code:

PHA
LDA $7E1422
CMP #$01
BEQ OnOffFlag
LDA #$01
STA $7E14AF
OnOffFlag:
RTS

Please tell me if I have done something wrong, because I haven't tried to insert it because I don'tknow how to convert this to hex. :/ I'm unsure what to set 7E:14AF to to signal that its off.
Nice first code, there only seem to be 2 problem(1 major one and 1 minor one)

1. the PHA instruction is useless and WILL cause glitch when the RTS instruction is executed. This will happen because you're pushing A to the stack, but you aren't pulling it at the end of your code, since RTS load the destination adress from the stack, it will end up using the value of A insted of where it should go.

2. when acessing RAM adress between 7E0000-7E1FFF you can use aboslute adressing, for example, you can use lda $1422 insted of lda $7E1422, this method is shorter and execute faster.
Last edited on 2007-09-08 01:40:12 AM by Bio.
OK, PLA is too pull from the stack, right? Would I just put that in a line? This is pretty confusing.
yesn PLA pull A from the stack, to fix your code you can either:

1. remove PHA
2. add PLA just before RTS
So I don't need PHA in that code at all? For now I'll just add PLA so here is my final code:

PHA
LDA $1422
CMP #$01
BEQ OnOffFlag
LDA #$01
STA $14AF
OnOffFlag:
PLA
RTS

And then I use a compiler to convert it to machine code? Is there a recomended compiler?
I think xkas and WLA see the most use. You can assemble it and insert the output with a hex editor into wherever it should be in your SMW ROM, or assemble it directly into the ROM either by:

-setting .org to the area of the ROM you want the code to be placed into and supplying your input ROM inplace of the output file in xkas (I think that's how it works there).
-.background an input ROM, insert code with OVERWRITE .sections / .unbackground'd areas in WLA.

The latter option is so much easier for larger patches since you don't have to use a hex editor every time you want to trial your code and the labels make it very convenient when it comes to pointing to your new code.
Erm, I'm still confused as to how to convert this to hex so I can test it as a Block Tool block. I feel like an idiot right now. ;_;
PHA
LDA $14AD
CMP #$01
BEQ WaterLevelFlag
LDA $01
STA $0085
WaterLevelFlag:
PLA
RTL

This code will turn the level into a Water Level, only when the Blue POW Timer is on.
I suck at ASM.
Last edited on 2007-09-08 01:34:02 PM by Rykon-V73.
Originally posted by Boingboingsplat
So I don't need PHA in that code at all? For now I'll just add PLA so here is my final code:

PHA
LDA $1422
CMP #$01
BEQ OnOffFlag
LDA #$01
STA $14AF
OnOffFlag:
PLA
RTS

And then I use a compiler to convert it to machine code? Is there a recomended compiler?


IF you want this in hex, it's:

48 AD 22 14 C9 01 F0 06 A9 01 8D AF 14 60 68 60 =/
Thanks Sparx! How'd you do that, I'd like to know so people don't have to do it for me. >_>
I need to learn that stuff too. Espacially ASM -> HEX converting.
Could someone make a tutorial for it or something?
Or do you guys use a special program? >_>
Most usually do it manually since it is easy, is that code for me?
Sorta kinda, but I've modified it.

PHA
LDA $1422
CMP #$01
BPL $#00 OnOffFlag
LDA #$01
STA $14AF
OnOffFlag:
PLA
RTS

I replaced BEQ with BPL $#00.
I haven't got to test this yet but you could use it as a block or you might be able to throw it into LevelASM/Sprite Tool Generator.
Last edited on 2007-09-08 05:41:44 PM by Boingboingsplat.
hmmm ok, is RTS needed for blocks?....wait nvm
Ok, I'm trying to make a generator that executes that code. Butwhen I try to insert it, I get an error where I have to type yes or no. I typed no, and when I tried to run the level with it it crashed. (I suspected this) What did I do wrong? Here's the code:


-------------------
RAM_DragonCoin = $1422
RAM_OnOff = $14AF

dcb "INIT" ; Generators don't have an INIT routine
RTL

dcb "MAIN"
LDA RAM_DragonCoin
CMP #$01
BPL $#00 OnOffFlag
LDA #$01
STA RAM_OnOff
OnOffFlag:
RTS
Return:
RTL
-------------------


I pretty much just copied and pasted so...
Originally posted by Boingboingsplat
Ok, I'm trying to make a generator that executes that code. Butwhen I try to insert it, I get an error where I have to type yes or no. I typed no, and when I tried to run the level with it it crashed. (I suspected this) What did I do wrong? Here's the code:


-------------------
RAM_DragonCoin = $1422
RAM_OnOff = $14AF

dcb "INIT" ; Generators don't have an INIT routine
RTL

dcb "MAIN"
LDA RAM_DragonCoin
CMP #$01
BPL $#00 OnOffFlag
LDA #$01
STA RAM_OnOff
OnOffFlag:
RTS
Return:
RTL
-------------------


I pretty much just copied and pasted so...

i dont think there should be RTL after the dcb "INIT"
but im pretty sure everything else is right.
Pages: « 1 2 3 4 5 6 ... 353 354 »
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 - 2014 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 29

C3 STARTING IN
19 HOURS, 21 MINUTES AND 40 SECONDS
C3 STARTING IN
19 HOURS, 21 MINUTES AND 40 SECONDS
Menu

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • RVLution