Language…
13 users online: caioskii, Cristian Cardoso, fanfan21, Golden Yoshi, Green Jerry, JezJitzu, Josuke Yoshikage, KoJi, Maw,  Nanako, Shomi, tOaO, yoshi9429 - Guests: 249 - Bots: 287
Users: 64,795 (2,377 active)
Latest user: mathew

Camera hacking

  • Pages:
  • 1
  • 2
Hi, I'm new and I'm also bad at introductions, so I'll just let this be my first post.

I want to make a SM64 hack. I am familiar with all the tools used to do so, I just need to sit down and start brainstorming for level ideas. In the past I've made small ASM hacks to slightly modify the engine to my liking, but this time I want to just focus on pure SM64-style level design.

However, there's one thing that I want to happen before I do this, and it has to do with the camera.

Basically, I want to replace the normal C-left and C-right functions with something like Super Mario Sunshine's camera system. I want Lakitu's camera to not change angle unless you are holding C-left or C-right, in which case it will move for as long as you are holding the button, stopping when you let go. So no more preset angles that Lakitu stops on.

How feasible is this? I think if I could somehow find a RAM address for the instantaneous angle of Lakitu's camera, and maybe the "target" angle which Lakitu is slowly approaching (both of which I think exist somewhere), then it would be possible.

I think I've found everything having to do with the SM64 camera online. There are some gameshark codes here and some various info here but so far I haven't found anything really useful (I'm using NEMU64's debugging tools which I figure is the best way to go about this)

Yes I realize that if anyone already knew how to do this, there'd probably already be a major ROM Hack using it. Still, I wanted to ask just in case, if anyone has any info that might help me find a way to make this hack.

Thanks!
I would say any kind of camera hacking in the way you are describing wouldn't be as feasible at this point of time but I don't personally have any real experience camera hacking to make that kind of judgement. I hope someone here can help answer your question because I'm quite interested in what you are asking.
Actually, that's a good idea, I patched it in:

0x3F330: ORI A2, R0, $0000
0x46F88: NOP
0x46F24: LH T8, $0010 (T7)
0x46F14: ADDIU T6, R0, $0001
0x46FA8: LH T0, $0010 (T9)
0x4700C: NOP

This is just for Mario Cam, I could probably do it for Lakitu Cam too although most levels have unique Lakitu Cam assembly.
Wow, Skelux, that's amazing, thanks! You've saved me a lot of frustrating reverse engineering..

The only thing is, is it supposed to only work for C-right? Or maybe I didn't patch it right (I entered it all manually using a hex editor). Right now, C-left only moves the camera a little bit at a time, you have to keep pressing it over and over to get it to go anywhere. So it's like the patch is only half working for that direction.

Thanks again, I was not expecting anyone to just have the solution so quickly like that!

EDIT: It was my fault, I forgot to patch in one of the lines.

I hope you don't mind, I've written an explanation of what each instruction does, in case it helps anyone.

ROM address: Instruction (Opcode) - Explanation

0x3F330: ORI A2, R0, $0000 (0x34060000) - keep camera angle from resetting after adjusting angle

0x46F88: NOP (0x00000000) - disable C-right sound effect

0x46F24: LH T8, $0010 (T7) (0x85F80010) - change angle for as long as C-right is held (not just when pressed)

0x46F14: ADDIU T6, R0, $0001 (0x240E0001) - change angle in small increments (was ADDIU T6, R0, $1000 or something)

0x46FA8: LH T0, $0010 (T9) (0x87280010) - change angle for as long as C-left is held

0x4700C: NOP (0x00000000) - disable C-left sound effect


Thanks again, I will now use this patch in all of my hacks! But I will make sure to give you credit
Wow, that actually is pretty cool, especially considering I use a right analog stick for my C buttons. The only other thing is trying to apply that to C down.
Originally posted by cpuHacka101
Wow, that actually is pretty cool, especially considering I use a right analog stick for my C buttons. The only other thing is trying to apply that to C down.

I thought about that too,

But then how would you switch to first person view? Maybe the L button could be used to enable/disable it? OR since Lakitu's camera might not be used at all, the R button could be remapped for this purpose (Mario's camera would be default, like in Star Road). Then the R button would be like the Z button in Sunshine, even in the same general place.

I have an idea for how to write this custom C-up/C-down function, I will post here if I have any success!
0x4ADA8:
LWC1 F0, $C528 (AT)
SWC1 F0, $0004 (T7)

This forces the camera to lock on Mario's Y position, fixing the camera during wall jumps.
I did it! It's not perfect, but here it is:

Free-roaming camera patch

It includes Skelux's C-left/C-right code from this thread.

Controls:

C-stick: rotate/zoom camera around Mario.

R trigger: activate "first person" view.


Thanks to Skelux for his C-left/C-right code, which is included in this patch
Thank you very much for those camera codes, guys!! This made my day! These will be very useful for SM64 hacking! Thanks again!! #ab{:D}
maybe it´s possible to make the camera rotate faster?
My Channel - http://www.youtube.com/skilllux64
Originally posted by Skilllux
maybe it´s possible to make the camera rotate faster?


The ROM address 0x46F16 is a 16-bit unsigned integer which controls how fast the camera rotates left and right around Mario. With Skelux's hack, it's normally 0x0001.

As for my up/down hack, I don't understand enough about zooming yet to know how to easily speed the camera up.
Originally posted by unxperinc
I did it! It's not perfect, but here it is:

Free-roaming camera patch

It includes Skelux's C-left/C-right code from this thread.

Controls:

C-stick: rotate/zoom camera around Mario.

R trigger: activate "first person" view.


Thanks to Skelux for his C-left/C-right code, which is included in this patch


Sorry for reviving an old thread, it's just that this sounds like exactly the kind of patch that would make me want to play Super Mario 64 again! So I downloaded a ROM extender, downloaded PPF-O-Matic, extended the ROM, and applied the patch. But when I load up the ROM in PJ64 I get an "In a permanent loop that cannot be exited" error. Am I just patching a bad ROM maybe?

I've tried with and without extending the ROM first.

Thanks in advance!
Originally posted by Binarynova


Sorry for reviving an old thread, it's just that this sounds like exactly the kind of patch that would make me want to play Super Mario 64 again! So I downloaded a ROM extender, downloaded PPF-O-Matic, extended the ROM, and applied the patch. But when I load up the ROM in PJ64 I get an "In a permanent loop that cannot be exited" error. Am I just patching a bad ROM maybe?

I've tried with and without extending the ROM first.

Thanks in advance!


Drag the rom over Chksum64.exe
My Channel - http://www.youtube.com/skilllux64

Hi guys, just went to reply such old thread as this. By the way, in my hack, I compiled Skelux's ASM camera codes. These codes are called "Legend of the Camera Mode". If you want to use this in your hacks, it's okay. Just give credit to me and Skelux. The camera setting is much better.

The code:

//NO CAMERA DISPOSITION
0x3B554: MTC1 R0, F4
0x3B42C: BEQ R0, R0, $0003B4D0
0x4ADA8:
LWC1 F0, $C528 (AT)
SWC1 F0, $0004 (T7)

//NO MARIO CAM
0x437B0: NOP
0x9EB70: NOP
0x43860: NOP
0x437C4: BEQ R0, R0, $00043854

//CAMERA DOES NOT MATCH DIRECTION
0x3F330: ORI A2, R0, $0000

Check out my Facebook page!
And also Twitter!
Official site of SM64 - Legend of the Stars




SM64 - Legend of the Stars currently in progress.
Originally posted by MariosHub
Hi guys, just went to reply such old thread as this. By the way, in my hack, I compiled Skelux's ASM camera codes. These codes are called "Legend of the Camera Mode". If you want to use this in your hacks, it's okay. Just give credit to me and Skelux. The camera setting is much better.

The code:

//NO CAMERA DISPOSITION
0x3B554: MTC1 R0, F4
0x3B42C: BEQ R0, R0, $0003B4D0
0x4ADA8:
LWC1 F0, $C528 (AT)
SWC1 F0, $0004 (T7)

//NO MARIO CAM
0x437B0: NOP
0x9EB70: NOP
0x43860: NOP
0x437C4: BEQ R0, R0, $00043854

//CAMERA DOES NOT MATCH DIRECTION
0x3F330: ORI A2, R0, $0000


Wow! Is that the camera used in Skelux's SM64 Multiplayer notes? Because it actually works a lot better, and functions much like it did in Super Mario Sunshine. It even locks on to wall jumps #ab{:D}

I hope I can edit the camera some more in the upcoming version of the Importer which allows code editing. That would be amazing!

Meh, I'm just thinking of a hard time compiling such Skelux's codes as these. After several tries, these finally worked out. What do you mean SMS? Sorry, but I'm not playing it. By the way, thanks for your concern.

Check out my Facebook page!
And also Twitter!
Official site of SM64 - Legend of the Stars




SM64 - Legend of the Stars currently in progress.
Originally posted by MariosHub
Meh, I'm just thinking of a hard time compiling such Skelux's codes as these. After several tries, these finally worked out. What do you mean SMS? Sorry, but I'm not playing it. By the way, thanks for your concern.


SMS stands for Super Mario Sunshine #ab{:P}

Yes, I know it's Super Mario Sunshine. But like I've said, I'm not playing it.
About the code, however, you should keep pressing C-Left and C-Right buttons to continue moving the camera at any angle. You should also press the C-Up twice to look around. If you press it once, you should take a closer look. I used it in my hack, and put it also in Star Road for the update of v1.2. The update was made by me and me alone.

Check out my Facebook page!
And also Twitter!
Official site of SM64 - Legend of the Stars




SM64 - Legend of the Stars currently in progress.
If you're done trying to steal credit for my work, I'll let it be known that these camera codes are copy-pasted from multiplayer_1.2.txt available here. No credit is necessary for minor modifications such as these.
Originally posted by Skelux
If you're done trying to steal credit for my work, I'll let it be known that these camera codes are copy-pasted from multiplayer_1.2.txt available here. No credit is necessary for minor modifications such as these.


I knew that was from one of your documents...MariosHub shouldn't deserve credit then if he didn't create it himself.
  • Pages:
  • 1
  • 2