News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

ASM having errors

Started by Jet3rd, March 02, 2018, 01:27:01 AM

Previous topic - Next topic

Jet3rd

Basically I am trying to use these three asm patches. not working. Pulling up a lot of errors.  :sad: :cry:

[spoiler=Patch Links]http://metroidconstruction.com/resource.php?id=103
http://metroidconstruction.com/resource.php?id=94
http://metroidconstruction.com/resource.php?id=87[/spoiler]

I don't know whats wrong with it. Would appreciate some help or general facepalm your an idiot dude. thanks  :bounce:

OneOf99

Can you explain how you are implementing the ASM? It's kinda hard to know what is going wrong with so little info.

Cpt.Glitch

If you look at the address used as freespace, you'll see they all conflict with freespace. Therefore, issues are bound to happen, you'll need to repoint the code to places where the don't conflict. And it cannot be your typical freespace, as it has to be a certain distance from the hijack. So, apply one patch, and use a hex editor to see where the code ends, and point the other ASM file there. Then repeat for last ASM file. They all use Crocomire GFX as freespace, and it's large enough to contain all three of those codes. So just do the steps above and they should work fine together.

Jet3rd

Sorry. I am using SNESstuff. I copied the text of the asm on the page and put it in a .txt file. Which I change to a .asm file. then I just apply it to the rom as normal.

Most of the errors say either "invalid opcode or command" or "label not found."

The name of the rom I'm using is "1370 - Metroid - Zero Mission (U)(TrashMan)"

I have tried using asar as well. doesn't make a difference.

After reading Cpt.Glitch's post: Thanks. I will try this.

Jet3rd

ok, the problem is. I can't even apply one patch. It's not just ZM I tried applying an asm for fusion as well. Basically the same errors. I don't know what I'm doing wrong.

Cpt.Glitch

Well, firstly, the rom needs to be named a certain thing.  At the top of every asm file you'll see something like this.
.gba
.open "zm.gba","SMControls.gba",0x8000000

The part in quotations after .open is the name your rom must be. So in this case, it needs to be named zm.gba. See if that works. Also you need to be using armips or something similar to compile GBA assembly. You can find it here.

FelixWright

#6
EDIT: I see glitch has covered a lot of this already. Whoops.

Quote from: Jet3rd on March 02, 2018, 11:43:41 AM
Sorry. I am using SNESstuff.

There's your MAIN issue.

Use ARMIPS https://buildbot.orphis.net/armips/

Also, Learn from Glitch.

Quote from: Cpt.Glitch on March 02, 2018, 11:37:13 AM
If you look at the address used as freespace, you'll see they all conflict with freespace. They all use Crocomire GFX as freespace, and it's large enough to contain all three of those codes.

Quote from: Cpt.GlitchWell, firstly, the rom needs to be named a certain thing.

So what you can do is make a main asm

.gba
.open "zm.gba","combo.gba",0x8000000

.close


So the input rom is zm.gba and the output is combo.gba
Feel free to change those to your liking.

split each asm into two files: one ASM has code that doesn't use the croco free space, the other ASM has the free space code. Also, remove the .gba, .open, and .close instructions in each of those asm.

let's look back at that main asm, and add some code

.gba
.open "zm.gba","combo.gba",0x8000000

.include "ZM_U_SMControls.asm"
.include "ZM_U_upgradableMissiles.asm"
.include "ZM_U_itemGrab.asm"

.close

Okay, so we've added all the ASM that ISN'T using free space together. Now, to add the code that uses free space, you need to find and remove the following from each asm


.org 0x8304054 ;Croco GFX, unused


and put that into the main asm, including the other half of the asm that uses free space


.gba
.open "zm.gba","combo.gba",0x8000000

.include "ZM_U_SMControls.asm"
.include "ZM_U_upgradableMissiles.asm"
.include "ZM_U_itemGrab.asm"

.org 0x8304054 ;Croco GFX, unused

.include "SMControls_Free.asm"
.include "upgradableMissiles_Free.asm"
.include "itemGrab_Free.asm"


.close


Now run this main ASM and all the code should compile together without issue.