Language…
17 users online: af1899,  AmperSam, anonimzwx,  Anorakun, bandicoot,  BeeKaay, GRIMMKIN, gui, h.carrell, Handfish_Heze, Hikaru, Jolpengammler, MM102, rafaelfutbal, StackDino, tOaO, yoshi3706 - Guests: 173 - Bots: 363
Users: 64,661 (2,404 active)
Latest user: dorito

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 418
  • 419
  • 420
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)
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
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.
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.
HEY,LISTEN



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? >_>
My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
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.
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
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 418
  • 419
  • 420