I've always been fascinated by the idea of producing an emulator but the inner-workings of computers and consoles has always been alien to me. In college, I studied Computing and it only skimmed the surface of how the computer functions. Essential concepts such as the fetch-execute cycle, interrupts, stacks, assembly language were only ever touched upon so that we as students had appreciation for them and their use, but not a clear, indepth understanding of how they work. I also studied Pascal at college and I feel I have mastered it at least at the level that was taught to us.
Now I'm roughly half-way into my first term at University (I'm studying Computer Science). The following is the content I have covered thus far:
-Vectors/Matrix Algebra
-The entire procedural side of Java. Presently starting the object orientated side of things.
-Have been introduced to boolean logic, logic gates, circuits.
-Have been introduced to assembly language.
-Naive set theory (which I must admit I only understand about 30% of)
Given that I have this knowledge, what further knowledge do I need to be able to even begin to consider creating an emulator. Specifically I want to code a TurboGrafx16/PC Engine emulator (yes I know several excellent ones already exist but its just something that I've been wanting to do for ages).
I've been told that the very first step in emulating console hardware is to successfully emulate the CPU (i'm probably wrong, but I'm here to be corrected). However this STILL sounds alien to me. I guess what I'm asking is: where do I start? What resources do I need. Once I do my research and identify all the components of the PC Engine architecture, how do I begin to analyse how each one works (bearing in mind I do not own the hardware) and consider how to implement them via a high-level language. And is Java adequate or should I learn a more usual suspect language such as C or assembler?
I'm not asking how to emulate the PC Engine or any console hardware. What I'm asking is : what do I need in terms of knowledge and resource to be in a positition to embark on such a project?
Thank you for reading. And double thanks if you reply!
Comments
Someone asked about Emulator programming on June 10, 2002 in this Console board. That should help you out.
Also check out this site to get Java code for a GameBoy emulator:
http://www.btinternet.com/~davidwinchurch/applets/GameBoyEmu/GameBoyEmu.html
I've never made an emulator so I might be wrong, here. I've made an interpreter that does something vaguely similar, though. You can probably think of an emulator as a machine code interpreter.
Making an emulator would involve knowing the assembly language and the instruction list for the hardware you are emulating, very thoroughly.
First of all, you have to be able to disassemble the machine code for programs and games that would run on the hardware. After doing this, you just need to set up a way to loop through all of the machine code instructions and execute them one by one in a case statement or something. You'd probably use memory addresses instead of registers(from the original hardware) to store some information.
Another thing you can do(more complicated), that makes the programs run faster is basically recompiling the program for the PC platform. You could make a program to disassemble the rom and reassemble it using registers, memory, instructions that work on the other platform(win32 or whatever). This will let the computer execute the game or program directly instead of having it execute through your emulator. This is very useful if you emulated something like an XBox because it would run terribly or require a super computer if you did it the other way.
I think the most important thing about making an emulator is probably just understanding assembly and machine code. You don't have to make the emulator in assembly but you have to understand it to know how to execute instructions as a processor does.
: I've always been fascinated by the idea of producing an emulator but the inner-workings of computers and consoles has always been alien to me. In college, I studied Computing and it only skimmed the surface of how the computer functions. Essential concepts such as the fetch-execute cycle, interrupts, stacks, assembly language were only ever touched upon so that we as students had appreciation for them and their use, but not a clear, indepth understanding of how they work. I also studied Pascal at college and I feel I have mastered it at least at the level that was taught to us.
:
: Now I'm roughly half-way into my first term at University (I'm studying Computer Science). The following is the content I have covered thus far:
:
: -Vectors/Matrix Algebra
: -The entire procedural side of Java. Presently starting the object orientated side of things.
: -Have been introduced to boolean logic, logic gates, circuits.
: -Have been introduced to assembly language.
: -Naive set theory (which I must admit I only understand about 30% of)
:
: Given that I have this knowledge, what further knowledge do I need to be able to even begin to consider creating an emulator. Specifically I want to code a TurboGrafx16/PC Engine emulator (yes I know several excellent ones already exist but its just something that I've been wanting to do for ages).
:
: I've been told that the very first step in emulating console hardware is to successfully emulate the CPU (i'm probably wrong, but I'm here to be corrected). However this STILL sounds alien to me. I guess what I'm asking is: where do I start? What resources do I need. Once I do my research and identify all the components of the PC Engine architecture, how do I begin to analyse how each one works (bearing in mind I do not own the hardware) and consider how to implement them via a high-level language. And is Java adequate or should I learn a more usual suspect language such as C or assembler?
:
: I'm not asking how to emulate the PC Engine or any console hardware. What I'm asking is : what do I need in terms of knowledge and resource to be in a positition to embark on such a project?
:
: Thank you for reading. And double thanks if you reply!
:
: