How does one being to start making a emulator?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
clessoulis
DCEmu Uncool Newbie
DCEmu Uncool Newbie
Posts: 2718
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Tue Apr 09, 2002 8:09 pm
Location: On top of the World
Has thanked: 0
Been thanked: 0

How does one being to start making a emulator?

Post by clessoulis »

I know your supposed to research the system and try to figure out logically figure out how each part works but I just cant think like that.
Is there some concrete guide they can tell you how to get things going from the get go? Like from setting up all the libraies to examples of the code and heavy explantion of it. Also I would like it if the explanation where all in programing terms. Like maybe lamens terms everyday talk fo how stuff works. I just wanna get my feet wet in the emulation making game. I would like to try making whatever you guys would recomind is the easiest.
DNR the current kickass dc programer. Thanks
for the emulator I've been waiting 2 years for.

Thanks to Reaper2k2 also for showing interest into WSC emulation.

Selfbooting for Noobs
clessoulis
DCEmu Uncool Newbie
DCEmu Uncool Newbie
Posts: 2718
Joined: Tue Apr 09, 2002 8:09 pm
Location: On top of the World
Has thanked: 0
Been thanked: 0

Post by clessoulis »

Ok seeing how nobody seems to know does anyone know a good place to go ask about this stuff?
DNR the current kickass dc programer. Thanks
for the emulator I've been waiting 2 years for.

Thanks to Reaper2k2 also for showing interest into WSC emulation.

Selfbooting for Noobs
User avatar
Wagh
Wagh
Posts: 5746
Joined: Fri Nov 08, 2002 7:59 pm
Location: YSOH
Has thanked: 0
Been thanked: 0
Contact:

Post by Wagh »

Can't find the link any more but look on google for the Chip 8 Emulator guide. It'll explain a lot.
Bush and Hussein together in bed
Giving H-E-A-D head
Y'all motherfuckers heard what we said
Billions made and millions dead
AmadeusZull
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4085
Joined: Wed Oct 17, 2001 7:44 pm
Location: NYC
Has thanked: 0
Been thanked: 0
Contact:

Re: How does one being to start making a emulator?

Post by AmadeusZull »

clessoulis wrote:I know your supposed to research the system and try to figure out logically figure out how each part works but I just cant think like that.
first line tells me you shouldn't even try. maybe later you can try after you develope an apitude for logic in programming. for now, keep smoking and enjoy dreamSnes.
Image

I am no longer an ACE@ite. Never will I kiss his feet is what I don't. And that I don't, is good I do.
clessoulis
DCEmu Uncool Newbie
DCEmu Uncool Newbie
Posts: 2718
Joined: Tue Apr 09, 2002 8:09 pm
Location: On top of the World
Has thanked: 0
Been thanked: 0

Post by clessoulis »

Not finding anything :(
DNR the current kickass dc programer. Thanks
for the emulator I've been waiting 2 years for.

Thanks to Reaper2k2 also for showing interest into WSC emulation.

Selfbooting for Noobs
ZacMc
DCEmu Super Fan
DCEmu Super Fan
Posts: 2715
Joined: Fri Nov 16, 2001 11:16 am
Location: Milwaukee, WI
Has thanked: 0
Been thanked: 0
Contact:

Post by ZacMc »

How does one being to start making a emulator?
Learning how to code would be a good place to start. :wink:
Topic moved to programming discussion.
clessoulis
DCEmu Uncool Newbie
DCEmu Uncool Newbie
Posts: 2718
Joined: Tue Apr 09, 2002 8:09 pm
Location: On top of the World
Has thanked: 0
Been thanked: 0

Post by clessoulis »

ZacMc wrote:
How does one being to start making a emulator?
Learning how to code would be a good place to start. :wink:
Topic moved to programming discussion.
Well i've been coding for about a good 3 months :)
DNR the current kickass dc programer. Thanks
for the emulator I've been waiting 2 years for.

Thanks to Reaper2k2 also for showing interest into WSC emulation.

Selfbooting for Noobs
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

Biggest question is emulating what? I'd suggest either an older console like the Sega Master System (NOT the NES or Atari 2600, because they require stupidly accurate/complex emulation) or an early arcade machine (like Space Invaders or Phoenix). I've seen programming guides written about coding Space Invaders and Phoenix emulators floating around the web - I'll try to dig some of them up.

Just note that you have to know a reasonable ammount of C or assembler (preferably both) to code a good emulator. In C, knowledge of the basics, all the control structures (if, while, switch etc), pointers, data types, all of the operators, how to code for the host system, and be able to write some code without having to keep looking at a guide book. If you can do that, and understand a little about how the emulated system works, you should be able to get something working.
AmadeusZull
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4085
Joined: Wed Oct 17, 2001 7:44 pm
Location: NYC
Has thanked: 0
Been thanked: 0
Contact:

Post by AmadeusZull »

BlackAura wrote: and be able to write some code without having to keep looking at a guide book.
come on you know sometimes you forget a lil snytax and u gotta refer back to the api. heh
Image

I am no longer an ACE@ite. Never will I kiss his feet is what I don't. And that I don't, is good I do.
Veggita2099
Janitor 2nd Class
Janitor 2nd Class
Posts: 9018
Joined: Wed Oct 17, 2001 7:44 pm
Location: Chesapeake, Ohio
Has thanked: 0
Been thanked: 0

Post by Veggita2099 »

I know Qbasic, what can I make?
Wii number: 1227 6854 1080 3665
Shutaro
DCEmu Newbie
DCEmu Newbie
Posts: 5
Joined: Fri Nov 16, 2001 4:23 pm
Has thanked: 0
Been thanked: 0

Post by Shutaro »

clessoulis wrote:Ok seeing how nobody seems to know does anyone know a good place to go ask about this stuff?
Marat Fayzullin wrote a HOWTO many years ago.

Try looking here: http://fms.komkon.org/EMUL8/

Some basic theory, nothing too complex.
clessoulis
DCEmu Uncool Newbie
DCEmu Uncool Newbie
Posts: 2718
Joined: Tue Apr 09, 2002 8:09 pm
Location: On top of the World
Has thanked: 0
Been thanked: 0

Post by clessoulis »

BlackAura wrote:Biggest question is emulating what? I'd suggest either an older console like the Sega Master System (NOT the NES or Atari 2600, because they require stupidly accurate/complex emulation) or an early arcade machine (like Space Invaders or Phoenix). I've seen programming guides written about coding Space Invaders and Phoenix emulators floating around the web - I'll try to dig some of them up.

Just note that you have to know a reasonable ammount of C or assembler (preferably both) to code a good emulator. In C, knowledge of the basics, all the control structures (if, while, switch etc), pointers, data types, all of the operators, how to code for the host system, and be able to write some code without having to keep looking at a guide book. If you can do that, and understand a little about how the emulated system works, you should be able to get something working.
Shit I only know C++ damn!!!. Cant I code in C++? I mean hell ive seen emulator made in VB(granted they sucked) and qbasic(also sucked in fact these didnt seem to even work).
DNR the current kickass dc programer. Thanks
for the emulator I've been waiting 2 years for.

Thanks to Reaper2k2 also for showing interest into WSC emulation.

Selfbooting for Noobs
reaper2k2
DC Developer
DC Developer
Posts: 2648
Joined: Sun Mar 24, 2002 7:48 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by reaper2k2 »

http://fms.komkon.org/EMUL8/HOWTO.html

this is pretty good it was posted up there


TRY porting some think even if you cant it teaches you some think new every time

and learn c i dont like c++ i find it has more over head and slows things down also ive found changing the compiler options can give a %5 speed up for any emu if you know the right commands.....

im so rusty at C and programing its like im starting from the first gate again..... its been ten years since ive done any think

when i was 12 i wrote a arcard game for the C64 called city bomber it was lame and had 4 colours you had a plane that went across the screen and you bombed buildings till there was no more then you had to land the plane....... it had sfx a high score table and not much else and was written in basic and converted to asm .... when big boy gets the Dc64 up and runing i can see it on the dreamcast ahhhhh what a dream lol
http://homebrew.dcemulation.com/dcgames/ *homebrew webbrowser games *

http://r2k2gate.topcities.com *dev site and my releases*
Image
Im' a Commodorian are you?
User avatar
toastman
Iron Fist of Justice
Iron Fist of Justice
Posts: 4933
Joined: Sat Nov 10, 2001 3:08 am
Location: New Orleans
Has thanked: 0
Been thanked: 0
Contact:

Post by toastman »

The first place to start would be the CPU core. Write a disassembler for the machine you want to emulate. Then work your way up from there.
No signature.
clessoulis
DCEmu Uncool Newbie
DCEmu Uncool Newbie
Posts: 2718
Joined: Tue Apr 09, 2002 8:09 pm
Location: On top of the World
Has thanked: 0
Been thanked: 0

Post by clessoulis »

This suck I dont know any C only C++ so it looks like I'll stay away from emulation untill I can take some class's and learn some ASM and C.
DNR the current kickass dc programer. Thanks
for the emulator I've been waiting 2 years for.

Thanks to Reaper2k2 also for showing interest into WSC emulation.

Selfbooting for Noobs
crt0
DC Developer
DC Developer
Posts: 290
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by crt0 »

come on you know sometimes you forget a lil snytax and u gotta refer back to the api. heh
A language reference isn't an API reference. There are differences. An emulator is going to use a lot of the primitive operators present in the language (mathematical and logical operations, control statements, etc), but often very little else, except for abstracting the input/output (display, sound, input) of the system, where by you'd probably be using some library like SDL or Allegro or DirectX to do it. If you were just learning such things, it'd be expected that you wouldn't know them off the back of your hand... however... if you need to look up how a pointer works every time you need to use one, or how to (directly or indirectly) address some piece of memory, or even how to manipulate individual bits, then you probably need to start somewhere else; get that kind of stuff down to the point where you don't need a reference, or you'll be in deep sh*t.

Now as for knowing C++, if you know it well enough, then you know C too. Just forget about streams, classes, templates, etc. That's basically C. The hello world of C is the following:

Code: Select all

#include <stdio.h>

int main (void)
{
    printf("Hello World!\n");
    return 0;
}
I assume that looks much like the C++ you know (I'd hope so, for your sake).
crt0
DC Developer
DC Developer
Posts: 290
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by crt0 »

Also note, unless you plan on coding an emulator for a really underpowered system (read Dreamcast), assembly language really isn't a skill you should worry about looking into. PCs these days should have enough power to run just about any emulator even written entirely in C.
NightHammer
Psychotic DCEmu
Psychotic DCEmu
Posts: 747
Joined: Tue Oct 08, 2002 11:37 am
Location: Back in my little hole in Russ Engineering Center
Has thanked: 0
Been thanked: 0
Contact:

Post by NightHammer »

crt0 wrote:I assume that looks much like the C++ you know (I'd hope so, for your sake).
It looks similar....

Code: Select all

#include <iostream>

int main(void)
{
     cout << "Hello World!!" << endl;
     return 0;
}

Oh, and if I were interested in learning ASM, where would I look?


Later!
NightHammer
All your systems are belong to me
crt0
DC Developer
DC Developer
Posts: 290
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by crt0 »

It all depends on which platform you want to learn it for. One place to look is dmoz.org, under the Computers subcategory... they have references for most of the older processors like 68k, z80, and MIPS. You should be able to find other stuff through Google I'd assume.
User avatar
toastman
Iron Fist of Justice
Iron Fist of Justice
Posts: 4933
Joined: Sat Nov 10, 2001 3:08 am
Location: New Orleans
Has thanked: 0
Been thanked: 0
Contact:

Post by toastman »

NightHammer wrote: Oh, and if I were interested in learning ASM, where would I look?


Later!
NightHammer
There is no one assembler language. Assembly basically refers to the basest language of a processor. Start with something simple like MIPS (that's what they taught in my class :P) Get SPIM, it emulates a MIPS processor and can interpret MIPS ASM source so there is no need to compile. Once you learn a simpler processor, you can take what you learn and teach yourself other assembly languages.
No signature.
Post Reply