answersLogoWhite

0

How do PS2 emulators Work?

Updated: 10/5/2023
User Avatar

Wiki User

12y ago

Best Answer

An emulator is a program that basically reproduces the behaviour of the hardware of an old machine (ex : video cards, CPU, mainboard, RAM). People that program emulators have to first obtain some information about the console they want to emulate; for example : what are the operations performed by the CPU. How is the RAM divided ?

Emulation is a very a complicated process of an application (emulator) acting like (emulating) another platform/processor/computer/etc.

One commonly emulated platform is the video game console, including systems like the Nintendo Game Boy, Nintendo Entertainment System, Sony Playstation, Sega Genesis, NeoGeo Pocket Color to name a few, although, just about anything can be emulated, from computers, to calculators, to video game consoles. Even the computer used in the spacecraft for the Apollo space missions has been emulated.

The basic process of emulation looks something like this:

  1. Fetch the current instruction from memory (RAM).
  2. Interpret that instruction. (Interpreting is taking an instruction that is supposed to run on another platform and executing or doing the equivalent instruction(s) on the machine that is doing the emulating/running the emulator program.)
  3. Increment the emulated PC (program counter; a register that points to the currently executing instruction) the appropriate amount.
  4. (OPTIONAL) Allow the machine running the emulator program to sleep/rest or stop execution of the emulator for a certain amount of time to regulate frame rate (FPS; Frame Per Second) or the emulated platform's processor speed.
  5. (OPTIONAL) Do any other things that need to be done. (Draw an emulated screen, process emulated audio, etc.)
  6. Repeat the process.

Hopefully that makes some sense to the person who asked this question. Emulation is not the sort of thing that can be explained in detail to a non-programmer or non-techie.

If you want to write an emulator yourself, and feel you know enough to get started, then do the following:

  1. Get as much info on the system you're looking to emulate AS POSSIBLE! This is EXTREMELY important, otherwise you'll have no idea what to do in the next steps.
  2. Pick an appropriate programming language to use. Using a scripting language or a language/tool that is interpreted is probably not the best idea if you're looking to emulate a fast platform.
  3. Figure out how you're going to emulate registers, RAM, etc. One of the simplest ways of emulating RAM is creating a large array to put all the emulated RAM's contents in. Registers can be done in multiple ways, but my WIP GB emulator simply uses char variables, since one char is 8 bits (1 byte) in size, which is the size of most of the GB's registers. (The GB's 16-bit registers are emulated using shorts.)
  4. Start coding! Take it easy though. Make sure you're not making too many mistakes. Assuming you're emulating some kind of "complete" platform (a platform with everything need to run and function), emulation of the CPU and RAM is what you should focus on first. (Remember! Focus on accuracy and proper emulation first. You can speed things up later, when your emulator actually does something!)
  5. Debug. This is what's gonna make you want to shoot yourself. Emulators are going to require a ton of debugging.
  6. Repeat steps 4 and 5 many, many, many, many, many times.

As far as info, you should have several resources available to compare with and get info from. I use Google and Wikipedia to get my info. You might have to search for info for quite a while to get what you want. (I took about two days to find and bookmark enough info that I think I will need.)

You probably want to code your emulator in C/C++ or ASM. I know some people even code emulator in Java, although, don't expect an emulator in Java to run as fast as one in C/C++ or ASM.

If you want, you can look at a very basic version of my code for my WIP GameBoy emulator below (use as you please):

//This is all done in C++ using MinGW and Code::Blocks IDE

//Define our RAM, VRAM, registers, etc:

int InterpretInstruction();

char gb_a, gb_f; //Emulated registers A and F. Sometimes paired as one 16-bit register

char gb_b, gb_c; //More registers. Sometimes paired as one 16-bit register

char gb_d, gb_e; //...

char gb_h, gb_l; //...

short gb_pc; //Emulated Program Counter register (16-bit)

short gb_sp; //Emulated Stack Pointer register

char* gb_ram_main; //Emulated RAM

char* gb_ram_video; //Emulated Video RAM

char* gb_cart_rom; //Emulated contents of the ROM

char* gb_cart_ram; //Emulated RAM in some cartridges

int main ()

{

load_rom_data_bin();

gb_pc = 0x0100;

gb_pc_ = 0x0099;

gb_sp = 0x0000;

gb_ram_main = new char[ 8192 ];

gb_ram_video = new char[ 8192 ];

load_rom_into_ram();

while( true )

{

if( InterpretInstruction() == 0 ) //My interpreting function returns 0 on OK

{

//Nothing. PC incrementing is handled in InterpretInstruction()

}

else

{

exit(1); //Abort if there's an error.

}

}

return 0;

}

int InterpretInstruction()

{

/*

It is said that switch statements are inefficient for a matter like this, but it seems to depend. According to some sources, this only holds true for switches with a small number of cases, which will compile into a chain of if() ... else if() ... statements - whereas with larger numbers of conditions [100-200+] a switch will compile into a jump table, and thus be more efficient than avoiding switch statements.

*/

switch( gb_ram_main[ gb_pc ] )

{

case 0x00: //NOP instruction

{

gb_pc++;

return 0; //Everything went OK

break;

}

case 0xc3: //JMP instruction Jump to the 16-bit address following this instruction

{

gb_pc = Form_16_Bit_Address_Using_Two_Bytes_Ahead_Of_This_Instruction();

return 0;

break;

}

default: //ERROR!

{

return 1;

break;

}

}

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

It depends on the system you want to emulate. Most emulators can be found here:

http://www.ROM-world.com/emulators.php

A lot of roms are also on this site. If the site doesn't have the ROM you're looking for, just try searching it on Google, like 'Legend of Zelda Ocarina of Time Rom Download.'

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

The related links contain some information on how the PCSX2 emulator has been working. My point of few is that since they can not play a game with the ease of a PS2 and should not be considered to be working just because a game can be played on them.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

1.Downlaod game from

www.coolrom.com

onto your pc

2.STart emulator

go to file then open

3.IN the browsing tab open the folder where you downloaded the game,and double click on the game file

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

you get it by downloading it from a googled website. be careful becuase downloading emulators/roms is illegal

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Learn how to program with C++ then Study any emulator and there you have it!

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do PS2 emulators Work?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Where will you put the bios in PS3 emulator?

There are no PS3 emulators and the bios file for the PS3 would not work in a PS2 emulator


You want the best PS2 EMULATOR.?

A complete list of all PS2 emulators, including download links and description is available at www.emuwiki.com


What are the minimum requirements to play smackdown versus raw 09 ps2 on PC?

PS2 games do not play on the PC. See related link on the Problems of PS2 emulators


How can you play Guily Gear Isuka PS2 with your PC?

With an emulator, fair warning emulators arent always legal.Answer 2 Or buy the game for PC its made for both PC and PS2, it'll be much faster since emulators suck


Is downloading ps3 emulator illegal?

There are no working PS3 emulators. The PS2 system has some poorly working emulators that can barely manage to complete some PS2 titles with a lot of work and very poor results on over half the titles. The much more complex PS3 system does not have a working emulator, but it could still be illegal to download Sony Software if it was included in the emulator even if the emulator does not work


Do PlayStation 2 emulators work?

It is possible to use a PlayStation 2 emulator to play PS2 games on your computer. It is only legal to do if you own an original copy of the game.


Can you play PlayStation 2 games on Windows?

yes you can there is 3 emulators for ps2 in the emulator zone


What is the name of that emulators which emulate ps2 games to PC games?

PCSX2 is the best one and free


How you play ps2 game on PC from CD drive?

You do not for a number of reasons. PCs without an emulator do not play PS2 games. PS2 games are not CDs they are DVDs. The emulators run files so the games must be downloaded into the PC harddrive and then played. The emulator uses the PS2 bios to play the game and you must have a PS2 to legally download the PS2 Bios. Games are much easier to be played on your PS2 and the emulator does not work on many PS2 titles


How do you play PlayStation or PS2 games on a PC in DOS mode?

You do not emulators use the PS2 bios to play PS2 games and are difficult to set up and run for someone without any experience or knowledge


Why do some emulators work better than others?

If if the emulators are coded differently, one or the other may work better than the other.


Emulators on the PS3?

The PS3 has an emulator that lets it play most PS1 games Some early models with 4 USB ports had hardware and sometimes Partially software Based Emulators to play PS2 games