Jump to content

Which language is ocarina of time written in?

zindan

Hi, many of you are probably familiar with the nintendo 64 emulator called project 64. There is a game (ROM) you can play on pj64 that is called Ocarina of time. I am currently learning how to code and I want to be able to modify some of the things in the game, therefor I am wondering which language the game is written in. 

Thankful for help, thanks.

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, zindan said:

Hi, many of you are probably familiar with the nintendo 64 emulator called project 64. There is a game (ROM) you can play on pj64 that is called Ocarina of time. I am currently learning how to code and I want to be able to modify some of the things in the game, therefor I am wondering which language the game is written in. 

Thankful for help, thanks.

C with a different structure, if this site is to be believed.

 

http://n64.icequake.net/doc/n64intro/kantan/step2/index1.html

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, PineyCreek said:

C with a different structure, if this site is to be believed.

 

http://n64.icequake.net/doc/n64intro/kantan/step2/index1.html

I believe that is the Nintendo 64 programing language. The "Project 64" I think is different. I think they recoded the nintendo games in a differente language on the pc.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, zindan said:

I believe that is the Nintendo 64 programing language. The "Project 64" I think is different. I think they recoded the nintendo games in a differente language on the pc.

Project 64 is an emulator written in C.  N64 games are written in C with a different structure.  ROMs are backup images of the complete cartridge structure, multiple files.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, PineyCreek said:

Project 64 is an emulator written in C.  N64 games are written in C with a different structure.  ROMs are backup images of the complete cartridge structure, multiple files.

Oh well darnit. I don't think I will be able to learn C fairly easy. I am currently learning java. I don't know how much C differs from Java.

Link to comment
Share on other sites

Link to post
Share on other sites

47 minutes ago, zindan said:

Oh well darnit. I don't think I will be able to learn C fairly easy. I am currently learning java. I don't know how much C differs from Java.

not by that much, it's just a bit more clunky

Link to comment
Share on other sites

Link to post
Share on other sites

I can give an example.  Not sure how relevant it is to you though.  When I was in university my Java programming class was freshman year.  My C/C++ class was my sophomore year.

 

It's a different programming language...syntax, libraries, capabilities, etc.

 

I don't program in either language any more.  Some things may have changed.  Haven't really touched either in over a decade.

 

I love dabbling with Python though.

Link to comment
Share on other sites

Link to post
Share on other sites

As far as I know the source code for the game isn't available, so even if you were comfortable with C you wouldn't be able to modify the code. All that you can access is the compiled binary, which is exceptionally hard to change in any useful way. 

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, zindan said:

Hi, many of you are probably familiar with the nintendo 64 emulator called project 64. There is a game (ROM) you can play on pj64 that is called Ocarina of time. I am currently learning how to code and I want to be able to modify some of the things in the game, therefor I am wondering which language the game is written in. 

Thankful for help, thanks.

As other's have said I am not sure there is any of the source available...that isn't to say you can't modify the game though, it just takes a lot more knowledge and time.  (Since you need to modify the compiled work)...although it depends what you want to modify (if it happens to be just like the amount of hearts you have, it may be drastically simpler...as it could potentially be only a few bytes of code change...but it is about finding it which is where tools like cheatengine would come in or memory analyzing).

 

Ultimately though I think this reddit post may give insight into how indepth it could be to modify a compiled n64 game.

 

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, Epimetheus said:

not by that much, it's just a bit more clunky

i think you are confusing C with C++ here. Java to C++ is not that far. but C it's a huge gap.

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, zindan said:

therefor I am wondering which language the game is written in. 

Unless you can get an n64 compiler/decompiler, knowing what language the game was originally written in does you no good at all.

The ROM can be viewed as essentially a hex dump of instruction codes and data: You will need to know MIPSIII and be very, very familiar with the layout of the n64.

This is not a beginners project.

One possible toolchain is to use a tool like N64Split, which can read a ROM and output MIPSIII. Then, you can use a MIPS decompiler to get C or C++ source out of it. But that's not all you need, because the ROM would need to be rebuilt with an N64 specific compiler/linker.

This is a very difficult workflow that, unfortunately, a beginner is not going to be able to do. Reverse Engineering is generally regarded as one of the most difficult fields in Computer Science/Engineering.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Franck said:

i think you are confusing C with C++ here. Java to C++ is not that far. but C it's a huge gap.

I'm studying all 3 languages + python on my own, and i think on a complexity level c++ is far easier to understand than both c and java. Idk about the structures and such and i only program on a basic level for know (i know up to objects and classes)

Link to comment
Share on other sites

Link to post
Share on other sites

15 hours ago, Epimetheus said:

I'm studying all 3 languages + python on my own, and i think on a complexity level c++ is far easier to understand than both c and java. Idk about the structures and such and i only program on a basic level for know (i know up to objects and classes)

Really? And here I thought C++ is overly complicated. For reference, I can proficiently code in java, JavaScript, C++, python, and recently C. None gives me more learner's headache than C++. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, wasab said:

Really? And here I thought C++ is overly complicated. For reference, I can proficiently code in java, JavaScript, C++, python, and recently C. None gives me more learner's headache than C++. 

Don\t worry, the headaches goes away after a decade or two ?

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, wasab said:

Really? And here I thought C++ is overly complicated. For reference, I can proficiently code in java, JavaScript, C++, python, and recently C. None gives me more learner's headache than C++. 

How can you code proficiently in c but not c++? Dude, all of the overly complicated things c++ has it has carried on from c

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/9/2019 at 11:12 PM, zindan said:

Oh well darnit. I don't think I will be able to learn C fairly easy. I am currently learning java. I don't know how much C differs from Java.

The biggest difference is C applications run directly on the host. Java applications typically run on a virtual machine or some other runtime environment and not directly on the host.

 

4 hours ago, Epimetheus said:

How can you code proficiently in c but not c++? Dude, all of the overly complicated things c++ has it has carried on from c

C is much simpler than C++. There's nothing overly complicated about C.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Mira Yurizaki said:

C is much simpler than C++. There's nothing overly complicated about C.

I don't know much about the advanced stuff so I guess you're right?

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Epimetheus said:

How can you code proficiently in c but not c++? Dude, all of the overly complicated things c++ has it has carried on from c

Because C++ is different from C and a lot more additional features?

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/10/2019 at 8:00 AM, zindan said:

I am currently learning how to code and I want to be able to modify some of the things in the game, therefor I am wondering which language the game is written in.

 

On 11/10/2019 at 8:12 AM, zindan said:

Oh well darnit. I don't think I will be able to learn C fairly easy. I am currently learning java. I don't know how much C differs from Java.

You're asking the wrong question. A game ROM doesn't contain C code, it contains compiled binaries. You can't modify the original code because you simply don't have it. And you can't just run your code on the hardware without compiling it. If you're learning Java, consider the difference between what you write and the jar file that comes out when you build it - one can be edited but not run, the other can be run but not edited (at least not as you would edit java code).

 

You can mod ROMs with disassemblers and game sharks but you'd need to learn how to do that specifically, knowing C won't help you much.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Sauron said:

 

You're asking the wrong question. A game ROM doesn't contain C code, it contains compiled binaries. You can't modify the original code because you simply don't have it. And you can't just run your code on the hardware without compiling it. If you're learning Java, consider the difference between what you write and the jar file that comes out when you build it - one can be edited but not run, the other can be run but not edited (at least not as you would edit java code).

 

You can mod ROMs with disassemblers and game sharks but you'd need to learn how to do that specifically, knowing C won't help you much.

I wonder how they make those game boy and Nintendo DS/3DS rom hacks. Surely they had better ways to do this than reverse engineering. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, wasab said:

I wonder how they make those game boy and Nintendo DS/3DS rom hacks. Surely they had better ways to do this than reverse engineering. 

Typically you would emulate the bios and cpu instructions and then run the original binary rom. If you do have the knowledge of the architecture you just write your own game and compile and it works on the emulator right away.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Franck said:

Typically you would emulate the bios and cpu instructions and then run the original binary rom. If you do have the knowledge of the architecture you just write your own game and compile and it works on the emulator right away.

I mean modding the actual game, not emulating the device these games run on. I used to play many Pokemon rom hack of leaf green and fire red if you want examples. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, wasab said:

I wonder how they make those game boy and Nintendo DS/3DS rom hacks. Surely they had better ways to do this than reverse engineering. 

Someone did the reverse engineering and built tools to make ROM hacks easier. There is no other way, but through collaboration and effort it's feasible, after all machine code is still code. Also, for ROM hacks you don't usually need to change too much of that and changing assets is simpler.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, wasab said:

I mean modding the actual game, not emulating the device these games run on. I used to play many Pokemon rom hack of leaf green and fire red if you want examples. 

Most ROM hacks tend to edit the data in the game, which is easily modifiable once you find the location of said data. Plus the data is usually structured. They tend to not touch the actual executable code.

 

ROM hacks that do modify the executable code is basically done with assembly programming.

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/10/2019 at 1:22 PM, Epimetheus said:

I'm studying all 3 languages + python on my own, and i think on a complexity level c++ is far easier to understand than both c and java. Idk about the structures and such and i only program on a basic level for know (i know up to objects and classes)

Then you should continue studying.

 

C by design (As it is not a OOP language) is the easiest to understand. Then Java, for being the higher level OOP language of the 3, then C++

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×