sites we <3 - smw central smbx community mario fan games galaxy

ASM: Request, help and general discussion

Anthrax 2 Multiply Themodynamics

ASM: Request, help and general discussion

Postby Kil2 » 27 May 2010, 05:55

Ask here if you need asm advice. Some kind soul might even do it for you.
Here you can request help, advice, or even just generally discuss the ASM, level or otherwise, that will be added to the game.

Image[Image]

SMW ram map: http://www.smwcentral.net/?p=map&type=ram

^ You can use this to get ideas. Any of these values can be modified during your level for whatever wacky effect you can imagine. A lot of it is even simple enough to bang out a quick levelasm code in 30 seconds.

Image[Image]

Note: Deme will be making a list of what's already been inserted.

Image[Image]

How to insert Levelasm in 1 easy step

1.0) Go here viewtopic.php?f=9&t=1228 and download Ersanio's level ASM + INIT (Chdata's A2MT version)
1.1) Dump all the files in your main folder
1.2) Go to start menu > accessories > command prompt, and copy that into the same folder
1.3) Open the level.asm file and change !freespace = $xxxxxxxx to some freespace. $938E00 is free in an expanded rom I checked. $21FE00 was free last time I checked the base rom.
1.4) Get xkas from somewhere and dump it in the main folder
1.5) Open levelcodes.asm and copy your levelasm code to the corresponding level
1.6) Open the command prompt in the folder and type [xkas level.asm ROMNAME.smc]
1.7) That's it.

Or refer to this video in which I successfully patch levelasm onto a clean rom http://www.youtube.com/watch?v=jk1Hsl-Hbts
Last edited by Kil2 on 03 Jun 2014, 22:51, edited 10 times in total.
Reason: stickied, using this as the ASM hub
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby Cup » 27 May 2010, 08:35

Oh wow, thank you for offering yourself as a resource. I really appreciate the help. I'm want to get rolling with this so I hope you don't mind if I forgo further thanks and pleasantries and get right into things.

I've started reading through the basic ASM guides linked from SMWC and got myself "Hex Workshop" as a hex editor, but I'm having a hard time playing with anything the guides don't specifically tell me to do.

I was able to follow instructions to do something simple like make it so you lose coins instead of lives, but when I tried playing around with speed I got nowhere. It may be that I can't even find the correct location. I was able to find where mario loses a life by using "goto offset" and typing in 52d8, so I tried 007b for the speed and it took me somewhere, but changing the values that read 7F and 80 I noticed no change in anything. This may be something you can help clear up right away.

Looking at the code line as it reads in Hex Workshop:
(something like this)

000021320 96 14 F0 0A 4A 4A 49 FF 1A 18 69 0B 80 DA E6 19 A9 00 85 71 64 9D 60 A9 7F 85

Assuming these are all important numbers, is there anything in there that jumps out to your seasoned eye, so that you could tell me what it is... the fact that both 80 and 7F show up seems to indicate that I'm in the right place, but when I change these numbers, I get nothing.

I was reading up on Schwa's guide, about branching and conditions. I assume this is what you were referring to when you said "conditionals." If so it would make sense I couldn't make any changes because it seems centered around my next problem...

I'm not sure how to implement "A" style commands (LDA, STA etc). The example I was supposed to copy was to create a .bin with the following code: A0 01 A9 30 8D 93 16 60, but I don't know how to do that... I'm playing around with map 16 right now as well, since this example wants me to use blocktool, which I've never done before, though it seems pretty straightforward.

I think most of my problems stem from me not knowing how to use Hex Workshop. I'm looking through their help page, but I'm finding it difficult to locate the information I need. Is Hex Workshop what I should be using for mario hacks? It seems like a great program but I think I could learn more from you if I use the same program you do so there aren't two layers of confusion to every question I ask.

Wow, that's a lot of confusion there. I'll try to keep posts to one question at a time in the future so things are easier, I also assume as I get past the "getting started" phase, I'll be able to express my troubles in a more efficient way (meaning, i need to learn the language). Thank you again for starting this thread. Hopefully I'll be able to make some progress.

Edit-haha also due to something I changed, the game crashes whenever I pick up a feather. That's hilarious. Not gonna lie, this is pretty fun.
User avatar
Cup
 
Posts: 774
Joined: 19 Mar 2010, 07:07

Re: ASM Help Thread

Postby Kil2 » 27 May 2010, 16:53

Well, no one's going to get very far writing code in a plain hex editor. They're using LevelASM for this project, which is a premade hack that can run code in your level without affecting anything else. Instead of hex edits, write levelasm code using "Ersanio's LevelASM + INIT" which you can get on smwc.

Here's an example of some code that would run during level 105 that would make you move left and right differently http://pastebin.com/LNeiaYsm

Basically hex editing is great when you need to do something like change a single value somewhere, say, what sound effect plays when peach calls for help. Not so much for writing code. It's even more useless in a collab hack where everyone has to use the same rom.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby Cup » 27 May 2010, 20:55

This makes things so much simpler you wouldn't believe.

I learned how to patch with xkas, so at least some progress here, but when I tried applying Levelcode.asm to test Ersanio's demo ASM of 105 the rom refuses to load. It sticks at the black screen before the nintendo icon shows up. Everything other patch of pre-written asm works find so I'm running into a dead end as far as trouble shooting goes.

It's kind of lame because it's slowing down my own code writing experiments but I'm am having a blast playing with SMWC's patches. So it's not a total loss.

Also xkas seems amazing. I was reading about it on byuu's forum and I have a hard time wrapping my head around how it works, but it's damn interesting.
User avatar
Cup
 
Posts: 774
Joined: 19 Mar 2010, 07:07

Re: ASM Help Thread

Postby Kil2 » 27 May 2010, 21:02

Yeah I forgot to mention, you have to change the freespace pointer in level.asm. By patching without pointing to some free space you kinda destroyed your ROM. First get a backup and then do this:

1. Open rom in LM and make some change. Move a tile, delete an enemy sprite, etc
2. Save it
3. Open the level.asm and find
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Defines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

   !FreeSpace    =

4. Make it !FreeSpace = $938E00 (this SHOULD be free on a blank ROM)
5. Now you can patch levelasm with xkas.

Then just write the code in the levelcode.asm file. Whenever you want to change the code/update/test stuff, just patch level.asm again and reload the rom.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby yoshicookiezeus » 27 May 2010, 21:07

Kil2 wrote:4. Make it !FreeSpace = $938E00 (this SHOULD be free on a blank ROM)

Didn't we establish that levelASM doesn't work with freespace above $400200? And besides, just saving a level in Lunar Magic only expands the ROM to 1MB, so I don't think that address would even be valid.
PLEASE DO NOT SEND ME MESSAGES ASKING FOR HELP. POST IT IN THE FORUMS INSTEAD.

[insert that one userbar I won in the mosts here]

My Youtube channel
User avatar
yoshicookiezeus
 
Posts: 1748
Joined: 15 Jun 2009, 12:16

Re: ASM Help Thread

Postby VideoGuy » 27 May 2010, 21:49

This may sound stupid, but do definitions not work with SpriteTool or something?

When I put
Code: Select all
ACTIVATED_FLAG = $1534,x

at the top of my file, and then do something like
Code: Select all
LDA ACTIVATED_FLAG         ; Load Activated Flag
CMP #00                  ; 0 = Not Activated, 1 = Activated
BEQ CheckIfActivated      ; Check if Sprite Should be Activated

it doesn't work. Is there something I'm missing, or am I just doing something wrong?
Accepting any and all ASM requests for A2MT. Just send me a PM.
Note: If I accepted your ASM request and you never heard back from me, please let me know. I feel like I've forgotten a few of them.
Also the creator of the new A2MT CMS. PM me if you have any questions.
Youtube Channel
VideoGuy
 
Posts: 539
Joined: 13 Nov 2009, 03:04

Re: ASM Help Thread

Postby yoshicookiezeus » 27 May 2010, 22:02

As far as I know, there is no assembler that can interpret definitions that way. The ,x should be placed in the code itself, not in the definition.
PLEASE DO NOT SEND ME MESSAGES ASKING FOR HELP. POST IT IN THE FORUMS INSTEAD.

[insert that one userbar I won in the mosts here]

My Youtube channel
User avatar
yoshicookiezeus
 
Posts: 1748
Joined: 15 Jun 2009, 12:16

Re: ASM Help Thread

Postby Kil2 » 27 May 2010, 22:18

yoshicookiezeus wrote:
Kil2 wrote:4. Make it !FreeSpace = $938E00 (this SHOULD be free on a blank ROM)

Didn't we establish that levelASM doesn't work with freespace above $400200? And besides, just saving a level in Lunar Magic only expands the ROM to 1MB, so I don't think that address would even be valid.


You're thinking of the SNES address. In the rom file, $938E00 should be empty. $938E00 is something around $09:9000 in SNES mapping, a perfectly normal empty area in an expanded 1MB rom. Anyway, this is exactly how I just patched levelasm to an empty rom, so it should work.
Last edited by Kil2 on 27 May 2010, 22:25, edited 1 time in total.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby Kil2 » 27 May 2010, 22:19

VideoGuy wrote:This may sound stupid, but do definitions not work with SpriteTool or something?

When I put
Code: Select all
ACTIVATED_FLAG = $1534,x

at the top of my file, and then do something like
Code: Select all
LDA ACTIVATED_FLAG         ; Load Activated Flag
CMP #00                  ; 0 = Not Activated, 1 = Activated
BEQ CheckIfActivated      ; Check if Sprite Should be Activated

it doesn't work. Is there something I'm missing, or am I just doing something wrong?


By the way, sprite tool uses TRASM instead of xkas by default which is weird and crappy, so some problems may arise from that.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby Chdata » 28 May 2010, 02:46

$80:8000

is the exact same thing as

$00:8000

As

$96:8000

is the exact same thing as

$16:8000

Using the $80+ mapping makes codes run slightly faster, because $16 is only a mirror of $96, and $96 is the actual bank so if you're doing stuff directly instead of using a mirror it's apparently faster.

But if you do this you can't expand past 4mb although it's unlikely that anyone would need to do that anyways.
Image[Image]
Trouble with a capital COW.

<math>\tan{A}\sin{N}</math>
User avatar
Chdata
 
Posts: 3181
Joined: 14 Jul 2009, 19:58
Location: Computer Chair

Re: ASM Help Thread

Postby Kil2 » 28 May 2010, 03:20

Did someone want a runman code? Sounds easy to be honest.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby tatanga » 28 May 2010, 03:25

Well, I had several ideas in mind. Chdata is helping me with some levelasm for making it so the goal tape sprite disappears when the time expires but you don't die. I have some other ideas though:

Have a runman sprite run through the stage that you chase (similar to the world 2 castle of asmt)

Have runman style player controls

If you want to help it would be greatly appreciated.
User avatar
tatanga
 
Posts: 775
Joined: 09 Jul 2009, 01:19
Location: Sarasaland

Re: ASM Help Thread

Postby Kil2 » 28 May 2010, 03:27

Sure, can you describe exactly what you need from the runman controls? From what I recall, you're constantly running in either direction and you bounce off walls. What else?

For running on water, you could just use map16 to make water that acts like solid tiles.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby tatanga » 28 May 2010, 03:32

I'm pretty sure that's about it. I've already added the affect of bouncing up when you fall into a pit by using custom blocks. I guess you could make it so that if you get to running speed you can smash through enemies too, if that isn't too hard.
User avatar
tatanga
 
Posts: 775
Joined: 09 Jul 2009, 01:19
Location: Sarasaland

Re: ASM Help Thread

Postby Kil2 » 28 May 2010, 03:36

Alright the movement should be easy then. Enemy interaction is something that each enemy sprite does on its own so I don't know how possible that'll be with just levelasm.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby tatanga » 28 May 2010, 03:39

Well that's already a lot more authentic than I had before so that should be good enough!
User avatar
tatanga
 
Posts: 775
Joined: 09 Jul 2009, 01:19
Location: Sarasaland

Re: ASM Help Thread

Postby Kil2 » 28 May 2010, 04:26

Can you change direction whenever you want in runman, like just push left and start running left? I'm noticing that by holding left or right and jumping you can kinda walljump up walls, which will probably break your level.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby tatanga » 28 May 2010, 11:21

Fortunately, that doesn't break my level at all, I don't think. I can't think of any walls I have in my level that aren't intended to be made up, since the level design is loosely based off of an actual runman level.
User avatar
tatanga
 
Posts: 775
Joined: 09 Jul 2009, 01:19
Location: Sarasaland

Re: ASM Help Thread

Postby Machoman » 28 May 2010, 12:19

In runman you can only change direction by hitting a wall.

And oh, I need help with one thing.

How do I make horizontal exit enabled pipes in Map16? What should I make the blocks act like.
(I need horizontal from right and left)
User avatar
Machoman
 
Posts: 558
Joined: 15 Jul 2009, 14:27
Location: あなたの後ろに!

Re: ASM Help Thread

Postby yoshicookiezeus » 28 May 2010, 12:24

Have the bottom tile of the pipe act 13F.
PLEASE DO NOT SEND ME MESSAGES ASKING FOR HELP. POST IT IN THE FORUMS INSTEAD.

[insert that one userbar I won in the mosts here]

My Youtube channel
User avatar
yoshicookiezeus
 
Posts: 1748
Joined: 15 Jun 2009, 12:16

Re: ASM Help Thread

Postby Machoman » 28 May 2010, 12:43

yoshicookiezeus wrote:Have the bottom tile of the pipe act 13F.

Ah thank you!
User avatar
Machoman
 
Posts: 558
Joined: 15 Jul 2009, 14:27
Location: あなたの後ろに!

Re: ASM Help Thread

Postby tatanga » 28 May 2010, 14:53

Machoman wrote:In runman you can only change direction by hitting a wall.

And oh, I need help with one thing.

How do I make horizontal exit enabled pipes in Map16? What should I make the blocks act like.
(I need horizontal from right and left)


Umm have you played runman? You can change direction quite easily, actually. The direction is not set in stone at all unless you hold the zoom button.
User avatar
tatanga
 
Posts: 775
Joined: 09 Jul 2009, 01:19
Location: Sarasaland

Re: ASM Help Thread

Postby Kil2 » 28 May 2010, 15:30

Well then the levelasm's done. If you need one where you can't change direction unless you hit a wall I can easily get that going too.

Code: Select all
level7:
   !MAXRSPEED = #$31
   !MAXLSPEED = #$CF

      LDA $15
      AND #$01
      BEQ +
      STZ $1FFF
      BRA MOVE007
   +   LDA $15
      AND #$02
      BEQ MOVE007
      LDA #$01
      STA $1FFF
MOVE007:      
      LDA $1FFF
      BNE LEFT007

      LDA !MAXRSPEED
       STA $7B
      JMP CHECKBOUNCE007

LEFT007:

      LDA !MAXLSPEED
       STA $7B

CHECKBOUNCE007:
      LDA $77
      AND #$02
      BEQ +
      STZ $1FFF
      STZ $7B

   +   LDA $77
      AND #$01
      BEQ RETURN007
      LDA #$01
      STA $1FFF
      STZ $7B

RETURN007:      
      RTS


You can adjust the running speed with !MAXRSPEED = #$31 !MAXLSPEED = #$CF to suit your needs. You probably want to adjust them in sync, so if you increase maxrspeed by 2 to #$33, you should decrease maxlspeed by 2 to #$CD.
Kil2
 
Posts: 409
Joined: 21 Apr 2010, 21:09

Re: ASM Help Thread

Postby tatanga » 28 May 2010, 15:40

Thanks a lot! I'll test it out right now...
Last edited by tatanga on 28 May 2010, 15:43, edited 1 time in total.
User avatar
tatanga
 
Posts: 775
Joined: 09 Jul 2009, 01:19
Location: Sarasaland

Next

Return to A2MT

Who is online

Users browsing this forum: No registered users and 1 guest