What's new

Some new N64 on PS2 questions

Toasty

Sony battery
I know there's been some talk about this on the forums here, but as a newbie, I've got a few new questions. Note that all these questions are concerning real-time emulation.

1. Is emulation for the N64 on PS2 possible? If not, why not? (Also if not, ignore all my other questions.)
2. What are some reasons why this hasn't been done yet?
3. The main CPU on the N64 has instructions that are (almost?) completely backwards compatible with the instructions on the PS2's main CPU, right? (MIPS III) Would this at least somewhat simplify main CPU emulation? Also, wouldn't this make LLE nearly as feasible (if not more so) as HLE?
4. N64 emulation on the GameCube is obviously possible. What factors would make it harder/easier to accomplish on the PS2?
5. A few years ago, lack of documentation hindered many N64 emulator writers. Has the situation improved at all?

Thanks in advance for answering any of the questions above. I know the topic has been discussed before, but the previous posts didn't quite satisfy my curiosity.
 

Hacktarux

Emulator Developer
Moderator
1. Is emulation for the N64 on PS2 possible? If not, why not? (Also if not, ignore all my other questions.)

I can't be sure if it's possible or not but i know that you will have high difficulties to manage memory. You have a lot more to store in memory than just the n64 ram, especially if you want to optimize your emulator.

3. The main CPU on the N64 has instructions that are (almost?) completely backwards compatible with the instructions on the PS2's main CPU, right? (MIPS III) Would this at least somewhat simplify main CPU emulation? Also, wouldn't this make LLE nearly as feasible (if not more so) as HLE?

Simplify isn't the exact word.... it would open door for a lot of possible optimizations ;) A well written dynarec would be very fast i think (but don't forget that the cpu is only one part of the emulator... and the gfx tasks take an important amount of time to emulate).

In current emulators, no HLE is used for cpu emulation, so it wouldn't change many things. And for gfx and sound, i highly suggest using HLE on a ps2, you wouldn't have enough power to low level emulate the RSP.
 

PsyMan

Just Another Wacko ;)
1) Yes it is.
2) It takes time (a lot of it) to develop the project so much that it can run N64 games at reasonable speed and it needs enough knowledge of the PS2 and N64 hardware.
3) You can't know that unless you completely understand how both N64's and PS2's CPUs work. If they are "compatible" enough it would make the CPU emulation faster.
4) It's harder to accomplish it on PS2 because you're not working on hardware that you know so well as Nintendo does for GC and N64, PS2 is not as fast as GC and PS2's GFX chip is not as "evolved" as GC's GFX chip. It could be easier if PS2's and N64's CPUs are similar enough.
5) There were enough improvements in the last few years. Everything (apart from the GFX) can now be low level emulated from at least one plugin (or emulator); compatibility and speed are increased a lot (in games like yoshi story, Mystical ninja and Cruis'n USA). The only missing things are the emulation of some Lucas arts games such as Indiana Jones (due to lack of documentation?) and low level GFX emulation due to the need of very high system requirements.
 
Last edited:

Azimer

Emulator Developer
Moderator
PS2's main processor and N64's main processor are very similar. You also have two vector units to use for graphics manipulation and another processor for audio emulation. It is very hard to say for sure what is possible.
 
OP
Toasty

Toasty

Sony battery
OK, time for another newbie question. I get the basics of HLE and LLE, but am a little hazy about the details (I'm very new to emulation). If you use dynamic (or static) recompilation, shouldn't the main speed drawback be the recompiling time and not the speed of the code being executed? I can understand why, for general purpose machines (IE PCs), where there are APIs and abstractions between the CPU and GPU, HLE would have significant benefits, but when emulating on a console where a the CPU is designed to work on a low-level with the GPU, would LLE be so bad? Don't consoles have more in common with eachother than they do with PCs (for the most part)? Again, I'm new - I know very little, so bare with me. :p If anyone knows a good link or something that explains the pros/cons and details of LLE/HLE that would be most helpful!
 

Hacktarux

Emulator Developer
Moderator
Toasty said:
OK, time for another newbie question. I get the basics of HLE and LLE, but am a little hazy about the details (I'm very new to emulation). If you use dynamic (or static) recompilation, shouldn't the main speed drawback be the recompiling time and not the speed of the code being executed? I can understand why, for general purpose machines (IE PCs), where there are APIs and abstractions between the CPU and GPU, HLE would have significant benefits, but when emulating on a console where a the CPU is designed to work on a low-level with the GPU, would LLE be so bad? Don't consoles have more in common with eachother than they do with PCs (for the most part)? Again, I'm new - I know very little, so bare with me. :p If anyone knows a good link or something that explains the pros/cons and details of LLE/HLE that would be most helpful!

The n64 has two processors to produce graphics : RSP and RDP. The RSP is a vector processor and that's what is emulated by HLE in current emulators. I know the ps2 has some vectors processors too but i think it would just take too much time and memory to emulate the RSP at low level (a large part of the emulation would still have to be made by the main CPU).
 
OP
Toasty

Toasty

Sony battery
Currently, the largest N64 ROMs are 32MB (256 Mbits) right? Just out of curiosity, on the average, how much of that would you guess is code and how much is data? I'm sure it probably can vary a lot from game to game, but an educated guess is close enough.

Then, an N64 architecture question: The N64's CPU and GPU share the same 4MB (or 8MB when expanded) memory right? If my guess is right, this would complicate emulation for expansion pak games on PS2, wouldn't it? (As the PS2 only has 4MB graphics memory.) Or can the PS2's GPU also access main memory? I'm obviously a very long way off from attempting this project. :p Thanks for helping out a newbie!
 
OP
Toasty

Toasty

Sony battery
Wow. So, typically what percentage of a ROM is code and how much is data? If it just varies too much from game to game, then for example in Zelda OOT and/or Mario 64? I could probably put my newbish powers to work and find out on my own, but it would probably take a long time unless someone knows a good method of finding this out.
 

Slougi

New member
Most of the data is probably sound and data; I guess after that it's meshes and the code. Not sure though :) Just an assumption. Also AFAIK lots of N64 games use lots of "midi" sound stuff.
 

Cyberman

Moderator
Moderator
Toasty said:
So, any idea how much of an average ROM is code and how much is data?
Well you have several problems with emulation but first this question needs to be answered right? For a game like NWN as an example about 10% code and 90% data. It's more like 20% 80% for most games. Data from the roms can be addressed a number of ways. I believe it's memory maped (the ROM).

In order to emulate the N64 well you have a few interesting situations.
1) Your graphics and audio subsystem are handled by a coprocessor for the MIPS, this is a BAD thing since the PS2 uses the coprocessor slots as well. You can't run the code DIRECTLY this means, it means you MUST perform dynamic recompilation. I believe you can handle this by fetching the code and converting it to similar PS2 opcodes and data to be sent to the graphics and audio subsystem.
2) Accessing IO at low level is an absolute no no for the PS2, and will likely mean it won't work on all PS2's. This is actually written into the developers agreement for making games for the PS<N> platform. This includes the upcoming PS3.
3) You must know the PS2 hardware very well, as well as or better than the N64. Namely the graphics and audio subsystem.
4) Start with using Mario64 as your reference. Why? Because it's not huge (memory) and it uses a lot of the N64 features.

It's possible to do you just have to consider things for a while and think things through. Work with pencil paper and gather information about both platforms. Spend a few months planing and developing ideas before you try creating the whole thing. In fact I suggest experimenting by making the emulator on the PC first and examining behavior code output etc. It's too bad PCSX2 is not further along than it is. However PCSX2 is pretty slow :) You might have to wait a while to see much with it ;) hehehe.

Cyb
 
OP
Toasty

Toasty

Sony battery
Thanks Cyberman, you answered my question and pointed out some good info (not that the others didn't, thanks to them too). It seems that the generally accepted position of most people is that N64 emulation on the PS2 is possible, but would take very intimate knowledge of both systems and would take a lot of time and hard work. Is there presently enough documentation available on the two systems to aquire the needed knowledge? If not, would you anticipate there being enough soon? As soon as I have some experience with writing emulators, I'd love to attempt the project, but I know that I have to be realistic and not get too deeply into something if there aren't enough resources (documentation, for example) to complete it. Even though I couldn't start out working on the project for quite a while, it wouldn't hurt to start looking over some info about the systems now - does anyone know some good links to some info about either one? (Can be anything that would eventually help - opcodes, architecture, coprocessor info, the list goes on...) Also, never having done any serious emulation, I'm a little hazy about the relation between the CPU and its coprocessors. As I understand it, all instructions are fed to the CPU and it then distributes the appropriate instructions to the coprocessors, kinda like floating-point operations on a x86 processor. Is that correct, or is the execution of instructions on the coprocessors more explicit from the programmer's perspective? (Basically, I just want to know, does every instruction get sent through the CPU, or can it send a whole bunch of instructions over to its coprocessors "in bulk" without reviewing each one?) Thanks again - inquiring minds want to know. :)
 

Cyberman

Moderator
Moderator
Toasty said:
Thanks Cyberman, you answered my question and pointed out some good info (not that the others didn't, thanks to them too). It seems that the generally accepted position of most people is that N64 emulation on the PS2 is possible, but would take very intimate knowledge of both systems and would take a lot of time and hard work. Is there presently enough documentation available on the two systems to aquire the needed knowledge?
For the N64? Yes for the PS2? I don't believe so. You might want to look at PCSX2's source to determine this aspect.
Toasty said:
If not, would you anticipate there being enough soon? As soon as I have some experience with writing emulators, I'd love to attempt the project, but I know that I have to be realistic and not get too deeply into something if there aren't enough resources (documentation, for example) to complete it.
Well now this is a familiar sounding thing. In all emulators case the pioneering works are done with system that aren't fully understood.
Toasty said:
Even though I couldn't start out working on the project for quite a while, it wouldn't hurt to start looking over some info about the systems now - does anyone know some good links to some info about either one? (Can be anything that would eventually help - opcodes, architecture, coprocessor info, the list goes on...)
Well I'm not sure specifcally which variant of the MIPS archetecture the PS2 has. This is quite important because they do have different behavior inspite of the fact execution is downward compatible.
Toasty said:
Also, never having done any serious emulation, I'm a little hazy about the relation between the CPU and its coprocessors. As I understand it, all instructions are fed to the CPU and it then distributes the appropriate instructions to the coprocessors, kinda like floating-point operations on a x86 processor. Is that correct, or is the execution of instructions on the coprocessors more explicit from the programmer's perspective? (Basically, I just want to know, does every instruction get sent through the CPU, or can it send a whole bunch of instructions over to its coprocessors "in bulk" without reviewing each one?) Thanks again - inquiring minds want to know. :)
I would start at MIPS technologies web page. I believe the PS2 uses the R5K series the N64 uses the R4K series. (warning lots of reading to do on the products page).

Cyb
 

Azimer

Emulator Developer
Moderator
Hence the initial debate... is it possible? Though code will need to be altered (some dynamic adjustments like replacing SW/LW from hardware registers into JALs with EA lookup on location)... use of some sense will at least make demos run at full speed. The hard part will be getting the vector processors to pump out the graphics at full speed with the more complicated games.
 
OP
Toasty

Toasty

Sony battery
Although CPU emulation is only a fraction of the whole process, the fact that even PCs in the 300 MHz range can do some N64 emulation is one reason it seems possible to me. And of course, the PS2's CPU is a lot more similar to the N64's CPU than an x86 processor. So, am I pretty correct in understanding that if an attempt at this were made, the easiest (or least difficult) part would probably be emulating the CPU itself? Graphics, sound and IO would require a lot more work, but emulating the CPU itself would be almost trivial given the almost completely backwards-compatible instruction set, right? I know there's probably some differences in the instructions that get issued to the coprocessors, but just emulating the instructions that the CPU itself takes care of.
 

protozerox

New member
I'm pretty much a noob, but i think i got a point to make. The Snes station emu thing for the ps2 is based on snes 9x, perhaps it's possible to do the same with project 64 or something. Though i guess it'll need some MAJOR tweakin, hahaha.
 

Top