Welcome to Emulationworld

Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: oh my gawd... Reply to this message
Posted byerikduijs
Posted on08/08/04 05:57 PM



> MAME's code actually does something extremely smart for a processor as complex
> as the 68000: it's a generator. Meaning you write a program that outputs the
> actual emulator source in your desired language. That means you can generate
> the emulator in various configurations without ugly #ifdefs or the like, and it
> also reduces the chance of things like copy/paste typos.
>

Yes, that is smart :-)
I think STonX does something like that too.
What I'm trying to do is using OOP to create objects that will execute the instructions (from classes implementing an 'Instruction' interface, which is basically nothing more that 'void exec()'). The constructor of the Instruction classes will define how they will actually behave at runtime, ie it will set the size of a move, the istruction mode, the affected registers etc. In the end, the created objects will have no or almost no branches in their 'exec()' method. Then I create an array (of I think 1024) of all instruction objects at initialization, and do something like the following at runtime:

while (cyclesLeft > 0) {
int iw = fetchInstructionWord();
Instruction i = instructionArray[iw];
i.exec();
// do the rest here...
}

I think (hope) it's going to work out.



-
Entire Thread
Subject  Posted byPosted On
*Some 68k questions  erikduijs08/03/04 10:55 AM
.*Re: Some 68k questions  finaldave08/04/04 05:42 AM
..*Here's another link that might be helpful  erikduijs08/13/04 07:31 PM
..*Re: Link to user manual with timing info  Jan_Klaassen08/04/04 12:21 PM
...*Re: Link to user manual with timing info  finaldave08/05/04 05:32 AM
.*oh my gawd...  erikduijs08/04/04 03:29 AM
..*Re: oh my gawd...  Bart T.08/04/04 10:44 AM
...*Re: oh my gawd...  erikduijs08/04/04 06:00 PM
....*Re: oh my gawd...  R. Belmont08/05/04 11:09 PM
......Re: oh my gawd...  erikduijs08/08/04 05:57 PM
.*Re: Some 68k questions  Jan_Klaassen08/03/04 02:13 PM
..*Re: Some 68k questions  Bart T.08/03/04 02:23 PM
...*Re: Some 68k questions  R. Belmont08/03/04 07:35 PM
....*Re: Some 68k questions  Riff08/04/04 03:16 PM
.....*Re: Some 68k questions  finaldave08/05/04 05:43 AM
....*Re: Some 68k questions  ElSemi08/04/04 05:11 AM
.....*Re: Some 68k questions  R. Belmont08/04/04 06:42 PM
.....*Re: Some 68k questions  erikduijs08/04/04 05:48 AM
....*Re: Some 68k questions  erikduijs08/04/04 03:05 AM