Register - Login
Views: 86579246
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - JCS - Stats - Latest Posts - Color Chart - Smilies
10-22-17 12:42:36 AM

Jul - SM64 Hacking - How to make Star Road Custom Level Multiplayer New poll - New thread - New reply
Pages: 1 2Next newer thread | Next older thread
RedToad
User
Level: 10


Posts: 13/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-18-15 05:03:02 PM Link | Quote
Yes I have 6.03. I am running it on Windows Vista if that makes any difference.
Ri4300
Random nobody
Level: 6


Posts: 5/8
EXP: 698
For next: 209

Since: 03-13-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 10:40:58 AM (last edited by Ri4300 at 03-19-15 01:03:46 PM) Link | Quote
Originally posted by RedToad
I have a major problem with cajeASM. I wrote the code in Notepad++ and I have MIPS highlighting on and it shows no errors but I try to assemble it to a rom and it doesn't change the rom at all. It says it was successful but nothing happened. I am running it as administrator and it is still doing it.

Here is my code from the manual:

.ORG 0x00000000
LUI T0, 0x254D
ADDIU T0, T1, 0x2899
NOP
J 0x0033008
NOP

I check to see if it did anything to the rom in lemASM and nothing was changed. Please help Cajetan!


why are you setting the location at 00000? Have you tried assembling anything that would be obvious by emulating? Such as "Hello World" because I'm pretty sure you can just 100% c/p ASM code into cajeasm.

RedToad
User
Level: 10


Posts: 14/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 10:56:17 AM Link | Quote
Yes I have tried Hello World in Super Mario 64 and the file select screen works but right when I choose the file the rom crashes. The cajeasm doesn't even show that it is changing anything. I downloaded my cajeasm version from Romhacking. Is there any other primary source I can download it from? Maybe the version I downloaded is messed up.
Cajetan
Member
Level: 20


Posts: 78/86
EXP: 37984
For next: 4455

Since: 08-06-11
From: Binary

Since last post: 2.0 years
Last activity: 362 days

Posted on 03-19-15 11:33:41 AM (last edited by Cajetan at 03-19-15 11:33:59 AM) Link | Quote
Originally posted by RedToad
Yes I have tried Hello World in Super Mario 64 and the file select screen works but right when I choose the file the rom crashes. The cajeasm doesn't even show that it is changing anything. I downloaded my cajeasm version from Romhacking. Is there any other primary source I can download it from? Maybe the version I downloaded is messed up.


Try to download it from my blog:
http://sm64-hacks.square7.ch/CajeASM%20v6.03.zip

And yeah, it's unnecessary to put an .org 0x00000000 to the beginning of your ASM hack as it would (without .org) put it to 0x00000000 anyway.
RedToad
User
Level: 10


Posts: 15/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 12:48:03 PM (last edited by RedToad at 03-19-15 01:22:55 PM) Link | Quote
Still doesn't work. Does the rom have to be extended or expanded for this to work? Also can you guys give me a already made .asm file, maybe I am making those wrong.

EDIT: WHAT THE F**K! It just started working! I can't believe it!!! I moved the stinking folder on my desktop and it worked. Stupid Windows Vista permissions!!!

EDIT #2: It wasn't the permissions, I found a glitch in the program itself. Once you pick your rom and asm file and click assemble it will assemble it just fine in the command prompt. But what I did after was I clicked the X in the right hand corner when I should have pushed enter on the keyboard. Because If you click the X it screws up the whole process. I ran it without being admin and it still worked. You might want to fix that bug, because it is hell trying to find it. Try it out for yourself.
Ri4300
Random nobody
Level: 6


Posts: 6/8
EXP: 698
For next: 209

Since: 03-13-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 01:02:28 PM (last edited by Ri4300 at 03-19-15 01:52:26 PM) Link | Quote
I think CajeASM works with regular non-extended sm64 roms too but I always use the regular Extended Rom 1.3.

.org 0x861C0
ADDIU SP, SP, 0xFFE8
SW RA, 0x14(SP)

ORI A0, R0, 0x70
ORI A1, R0, 0x70
LUI A2, 0x802C
JAL 0x802D66C0
ORI A2, A2, 0xB23C

LW RA, 0x14(SP)
JR RA
ADDIU SP, SP, 0x18

.org 0x8623C
.asciiz "Hello World"

When you Assemble this, make sure you let CajeASM run chksum and the crc thing. Then open lemasm open the rom go to 861c0.


Edit: Congrats

Edit: I clicked X and it still worked.
RedToad
User
Level: 10


Posts: 16/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 01:36:52 PM (last edited by RedToad at 03-19-15 01:46:12 PM) Link | Quote
Here is the solution so you won't be stupid like me:




It wasn't the permissions, I found a glitch in the program itself. Once you pick your rom and asm file and click assemble it will assemble it just fine in the command prompt. But what I did after was I clicked the X in the right hand corner when I should have pushed enter on the keyboard. Because If you click the X it screws up the whole process. I ran it without being admin and it still worked. You might want to fix that bug, because it is hell trying to find it. Try it out for yourself.

Problem Solved!
RedToad
User
Level: 10


Posts: 17/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 02:24:47 PM (last edited by RedToad at 03-19-15 03:13:30 PM) Link | Quote
Originally posted by Ri4300


Edit: I clicked X and it still worked.


Really? Well it didn't for me. Maybe you should add a message that says press any key to continue in the command prompt. Or just change the readme to tell users if it is not working to press a key instead of the X. I am running windows vista by the way. What system are you using?

Edit: Did some more researching and found that I couldn't do the Hello World mod because you need a extended rom for that. I don't think it will work with the normal 8 mb rom. Try the Hello World patch on the regular Super Mario 64 rom and see what happens. I also found something very odd. I tried to patch the beginning of the rom on a extended rom with the same code i tried from the manual. I pressed the X to close command prompt and let it do its crc stuff, and it DIDN'T work. Until I tried it again and pressed enter like I did last time.

The weirdest part about it is that the Hello World code works even if I press the X or press enter, as long as I am using the extended rom. What is going on here? There must be a glitch in the program when dealing with the beginning of the code of the rom. You might want to look into it.
Cajetan
Member
Level: 20


Posts: 79/86
EXP: 37984
For next: 4455

Since: 08-06-11
From: Binary

Since last post: 2.0 years
Last activity: 362 days

Posted on 03-19-15 03:31:10 PM (last edited by Cajetan at 03-19-15 03:34:09 PM) Link | Quote
Originally posted by RedToad
Originally posted by Ri4300


Edit: I clicked X and it still worked.


Really? Well it didn't for me. Maybe you should add a message that says press any key to continue in the command prompt. Or just change the readme to tell users if it is not working to press a key instead of the X. I am running windows vista by the way. What system are you using?

Edit: Did some more researching and found that I couldn't do the Hello World mod because you need a extended rom for that. I don't think it will work with the normal 8 mb rom. Try the Hello World patch on the regular Super Mario 64 rom and see what happens. I also found something very odd. I tried to patch the beginning of the rom on a extended rom with the same code i tried from the manual. I pressed the X to close command prompt and let it do its crc stuff, and it DIDN'T work. Until I tried it again and pressed enter like I did last time.

The weirdest part about it is that the Hello World code works even if I press the X or press enter, as long as I am using the extended rom. What is going on here? There must be a glitch in the program when dealing with the beginning of the code of the rom. You might want to look into it.


I've tried it on a fresh, 8MB ROM. It works. It doesn't matter if you have an extended ROM or not, because 0x861C0 is a subroutine for mario's behavior (a 0x0C command, which calls a function for the behavior. The function is inside a loop (in behavior scripts), which also explains why the message is supposed to be displayed over and over again and therefore it stands there until mario's behavior is either changed to another behavior or you remove the 0x0C call to the RAM Address containing your code) which exists in the original too, it's not compressed or anything.



Either you downloaded a weird ROM or your download was somehow corrupted or did you eventually tried to use the same ROM where you assembled the code to 0x00000000 already? There are many possibilities. But it definitely works with original ROM, extended and extended+expanded+patched (obj_import) ROM. I test out the stuff always before releasing it. But still, I re-uploaded my CajeASM v6.03 (from my folder) for you here, but I doubt that it would work now. If it really does, then well, possible that I forgot something:

http://fbe.am/w21
RedToad
User
Level: 10


Posts: 18/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 03:46:50 PM Link | Quote
It might be because my rom has a .n64 extension. Would this affect the assembling process in any way?
Cajetan
Member
Level: 20


Posts: 80/86
EXP: 37984
For next: 4455

Since: 08-06-11
From: Binary

Since last post: 2.0 years
Last activity: 362 days

Posted on 03-19-15 03:52:03 PM (last edited by Cajetan at 03-19-15 03:54:29 PM) Link | Quote
Originally posted by RedToad
It might be because my rom has a .n64 extension. Would this affect the assembling process in any way?


This might explain it:


Yes, blame me for not adding support for the other extensions. As soon as more people get interest into MIPS ASM Hacking, I guess I re-code CajeASM a fifth time and add more features including the support of the other extensions. Maybe I start it in a week or two. But well, the more people are interested to it, the more likely I'm motivated enough to work on it again. Other way it wouldn't make sense to re-code the tool if only 3 or 4 people use it. For a quite while now the only one who really used CajeASM a lot was kaze. The rest basically ignored it. That demotivates me sometimes.

I guess you better get a SM64 with a .z64 extension.
RedToad
User
Level: 10


Posts: 19/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 03:55:59 PM (last edited by RedToad at 03-19-15 04:23:03 PM) Link | Quote
YAY! We figured it out!!! I guess I will have to find a .z64 rom until you add the support for the .n64 file type. Thanks for all of your help. I think I am back in business now!!! I will continue my work on making the Super Star Road Multiplayer 1.3 again. That's a load off my mind!

EDIT: More research! I don't even have to find a .z64 rom! I can just convert it with tool64.

Found it on epforums: http://www.epforums.org/showthread.php?93152-Super-Mario-64-romhack-problems

Going to test it soon!

Link For Tool64: http://www.mediafire.com/download/l2ljd4l7n6esnbl/tool64_v1.11.zip
Cajetan
Member
Level: 20


Posts: 81/86
EXP: 37984
For next: 4455

Since: 08-06-11
From: Binary

Since last post: 2.0 years
Last activity: 362 days

Posted on 03-19-15 04:45:02 PM (last edited by Cajetan at 03-19-15 05:12:38 PM) Link | Quote
Originally posted by RedToad
YAY! We figured it out!!! I guess I will have to find a .z64 rom until you add the support for the .n64 file type. Thanks for all of your help. I think I am back in business now!!! I will continue my work on making the Super Star Road Multiplayer 1.3 again. That's a load off my mind!

EDIT: More research! I don't even have to find a .z64 rom! I can just convert it with tool64.

Found it on epforums: http://www.epforums.org/showthread.php?93152-Super-Mario-64-romhack-problems

Going to test it soon!

Link For Tool64: http://www.mediafire.com/download/l2ljd4l7n6esnbl/tool64_v1.11.zip


Ah, yes. Totally forgot about the tool you can use to convert the ROM to big endian. Wish you good luck.
RedToad
User
Level: 10


Posts: 20/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 05:19:04 PM Link | Quote
I'm afraid I've got some bad news and some good news. The good news is when I converted my .n64 rom to .z64 it solved the issue with the Hello World Code, it works perfectly now! But the bad news is that I still have the glitch when I try to modify the start of the rom code. It only works when I press a key at the command prompt and doesn't work when I press the X. Expanding/ extending it doesn't help either. I just don't get it! Is there any way that I can try the rom that you have? Maybe that will give us some answers.
Cajetan
Member
Level: 20


Posts: 82/86
EXP: 37984
For next: 4455

Since: 08-06-11
From: Binary

Since last post: 2.0 years
Last activity: 362 days

Posted on 03-19-15 05:33:09 PM Link | Quote
Originally posted by RedToad
I'm afraid I've got some bad news and some good news. The good news is when I converted my .n64 rom to .z64 it solved the issue with the Hello World Code, it works perfectly now! But the bad news is that I still have the glitch when I try to modify the start of the rom code. It only works when I press a key at the command prompt and doesn't work when I press the X. Expanding/ extending it doesn't help either. I just don't get it! Is there any way that I can try the rom that you have? Maybe that will give us some answers.


I'm going to PM it to you. It's not allowed to post ROMs here.
RedToad
User
Level: 10


Posts: 21/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 06:26:56 PM (last edited by RedToad at 03-19-15 06:58:24 PM) Link | Quote
Nope it still does it. Oh well I will just use the trick that I found that works for me. I will just push the enter key after it is done assembling. It's weird that I have to do that. It might be a glitch with Windows Vista, maybe.

EDIT: I figured it out now. For some reason It works when I specify the end of the code. Like this

NOP
NOP
.ORG 0x00000008

This code will work without me having to push the enter key at the command prompt.

These codes will not work unless I push the enter key at the command prompt:

NOP
NOP

.ORG 0x00000000
NOP
NOP

Your code that you gave me for the Hello World had the .ORG at the front and .ORG at the back of the code which made it work, see:

.org 0x861C0
ADDIU SP, SP, 0xFFE8
SW RA, 0x14(SP)

ORI A0, R0, 0x70
ORI A1, R0, 0x70
LUI A2, 0x802C
JAL 0x802D66C0
ORI A2, A2, 0xB23C

LW RA, 0x14(SP)
JR RA
ADDIU SP, SP, 0x18

.org 0x8623C
.asciiz "Hello World"

In your readme it also says:

1. Make use of the .ORG directive if you want your code to be written to a specific address.

When you put in this code:

.ORG 0x00000000
LUI T0, 0x254D
ADDIU T0, T1, 0x2899
NOP
J 0x0033008
NOP

Did you add .ORG 0x00000014 at the end? If you did then that is why it worked for you and not for me.

It was partially my fault for not putting in the code right and us not knowing that .n64 wasn't compatible.

So long story short I have to push enter if I didn't specify where I wanted CajeASM to write to and I don't have to push enter if I used the .ORG directive. I think this is a bug, at least for me.
What do you think?
Ri4300
Random nobody
Level: 6


Posts: 7/8
EXP: 698
For next: 209

Since: 03-13-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 07:42:48 PM (last edited by Ri4300 at 03-19-15 07:43:59 PM) Link | Quote
Originally posted by RedToad
Nope it still does it. Oh well I will just use the trick that I found that works for me. I will just push the enter key after it is done assembling. It's weird that I have to do that. It might be a glitch with Windows Vista, maybe.

EDIT: I figured it out now. For some reason It works when I specify the end of the code. Like this

NOP
NOP
.ORG 0x00000008

This code will work without me having to push the enter key at the command prompt.

These codes will not work unless I push the enter key at the command prompt:

NOP
NOP

.ORG 0x00000000
NOP
NOP

Your code that you gave me for the Hello World had the .ORG at the front and .ORG at the back of the code which made it work, see:

.org 0x861C0
ADDIU SP, SP, 0xFFE8
SW RA, 0x14(SP)

ORI A0, R0, 0x70
ORI A1, R0, 0x70
LUI A2, 0x802C
JAL 0x802D66C0
ORI A2, A2, 0xB23C

LW RA, 0x14(SP)
JR RA
ADDIU SP, SP, 0x18

.org 0x8623C
.asciiz "Hello World"

In your readme it also says:

1. Make use of the .ORG directive if you want your code to be written to a specific address.

When you put in this code:

.ORG 0x00000000
LUI T0, 0x254D
ADDIU T0, T1, 0x2899
NOP
J 0x0033008
NOP

Did you add .ORG 0x00000014 at the end? If you did then that is why it worked for you and not for me.

It was partially my fault for not putting in the code right and us not knowing that .n64 wasn't compatible.

So long story short I have to push enter if I didn't specify where I wanted CajeASM to write to and I don't have to push enter if I used the .ORG directive. I think this is a bug, at least for me.
What do you think?


To put it simply, it's because you're adding the .org, simply remove it entirely and it'll "work".



Also it's doing this because your rom has an 'improper' byte order, reference this thread - http://jul.rustedlogic.net/thread.php?id=11769

RedToad
User
Level: 10


Posts: 22/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-19-15 08:20:46 PM Link | Quote
I tried removing .org but it still doesn't apply unless I push enter at the command prompt. What I am trying to say is that it works just in a weird way. Because I have already converted the bytes to .z64 it fixes the code applying problems so essentially I think I can continue it's just that I wanted to know why it was doing it.
Cajetan
Member
Level: 20


Posts: 83/86
EXP: 37984
For next: 4455

Since: 08-06-11
From: Binary

Since last post: 2.0 years
Last activity: 362 days

Posted on 03-20-15 09:32:17 AM Link | Quote
Originally posted by RedToad
I tried removing .org but it still doesn't apply unless I push enter at the command prompt. What I am trying to say is that it works just in a weird way. Because I have already converted the bytes to .z64 it fixes the code applying problems so essentially I think I can continue it's just that I wanted to know why it was doing it.


It's simple. My CajeASM is actually a big-endian assembler and starts from the most significant byte to the less significant byte. Right to Left.

ADDIU SP, SP, 0xFFE8

Would be:
27 BD FF E8

in Binary:
100111 10111 10111 11111111101000

100111 = ADDIU
10111 = SP (Stack Pointer)
11111111101000 = Immediate Value = 0xFFE8

Now, in little-endian order it would look like this:
BD 27 E8 FF

in Binary:
10111101001001111110100011111111

Each N64 ROM is dumped from some the backup copy devices you could use for the N64 to copy a game and (later) distribute it. Those devices read either little-endian or big-endian. The Mr. Backup Z64 reads big-endian and saves it as big-endian ROM (.z64). Obviously if we now assemble code to a .n64 ROM which is assembled as big-endian the emulator can't read it because the emulator assumes that the .n64 ROM is little-endian and so it reads your code in little-endian too.

So, no matter what you do. My assembler is (unfortunately) only assembling code in big-endian format. Yeah, I totally forget about it while I coded CajeASM and thought I had implemented the other byte orders already, but I didn't. In CajeASM v7.0 (completely re-coded) I'm definitely adding support for the other n64 file formats.
RedToad
User
Level: 10


Posts: 23/23
EXP: 3407
For next: 1007

Since: 03-12-15


Since last post: 2.0 years
Last activity: 2.0 years

Posted on 03-20-15 10:52:06 AM Link | Quote
Oh I get it now. Thanks for the explanation! Also thanks for all of your help, without you I probably wouldn't have figured all of this out. You are the best at figuring out ASM code!
Pages: 1 2Next newer thread | Next older thread
Jul - SM64 Hacking - How to make Star Road Custom Level Multiplayer New poll - New thread - New reply




Rusted Logic

Acmlmboard - commit 2f1bc75 [2017-08-27]
©2000-2017 Acmlm, Xkeeper, Inuyasha, et al.

28 database queries, 17 query cache hits.
Query execution time: 0.145859 seconds
Script execution time: 0.017086 seconds
Total render time: 0.162945 seconds