MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM
CPU subclassing for fun and profit
01/14/11 05:55 PM


> I didn't think someone could be that dumb, not to spawn off the T-11 core and modify
> it to be a PDP-11 core. I would guess that Mame gets stupid submissions all the time.

Oh, yes

> So lets say I have to modify the T-11 source code into a PDP-11, the first thing to
> do, is change all 5 files names into PDP11(something).X, correct? Then run a search
> and replace on all t11_ to pdp11_ in the source code right? I know there is more to
> it than that, but I found beginning small always the best way in any program. I guess
> then you could add the extra 14 opcodes (plus different modes) which would never be
> used in Galaxy Game since it uses 33 opcodes (and different modes) for a total of 986
> total opcodes, all of which are available in the T-11.

FAIR WARNING: the T-11 core is not "modern" so these instructions are no longer the ideal way to do things, but you work with what you have. Converting the T-11 to C++ is far beyond the scope of this so we'll leave it in "old" form. That won't affect the acceptability of the submission.

That would be one way to do it, yes. I'm not sure you'd actually want to split it completely from the T-11 given that when opcode bugs turn up they'll need to be fixed both places though.

My suggestion would be to add a CPU type to the T-11's context with "PDP11" and "T-11" as possible values (and maybe more in the future - I believe there were multiple models of the PDP-11 with different CPUs, right?). You'll also need a second CPU_GET_INFO function for the PDP-11 which traps the CPU name and reset function and passes all others (default:) to the original handler. The CPU name would return the name for your new CPU and reset would redirect to a new CPU_RESET function which calls the existing one then overrides the CPU type to PDP-11 and makes whatever changes to the initial PC/SP/etc are necessary compared to a T-11 (if any). The original CPU_RESET function should of course set the CPU type to T-11.

In t11.h, copy the "DECLARE_LEGACY_CPU_DEVICE(T11, t11);" and change it to PDP11, pdp11 (the first is your CPU name that'll be used in drivers etc, the second is the name you used for CPU_GET_INFO). In the bottom of t11.c, copy the "DEFINE_LEGACY_CPU_DEVICE(T11, t11)" and do the same thing.

Finally, add the new opcodes but only recognize them if the CPU mode is PDP11. (Don't forget to add them to the disassembler too - it's OK in this case if the disassembler just always knows the extra opcodes).

> One last thought, the PDF spent years on the website doing nothing, until someone who
> was interested in history did something with it, I guess it will spend a few more
> years before it added to MAME, since you said it will take you 18 months to look at
> it. I guess a few more years before some real history is added to Mame.

You have to realize, MAMEdevs are largely people who grew up in the 80s and early 90s on the classic 8 and 16-bit microcomputers. Minicomputers are quite alien to our experience, even moreso than the Apple II or Amiga would be to today's average 20 year old. 8-byte bytes, byte-addressable memory, the high bit being leftmost, ASCII text, those conventions all go out the door when you start dealing with minicomputers. We'll get there eventually (as a certified Unix bigot I'd love to run the various early Bell Labs and BSD versions in MESS) but there's a substantial "everything you know is wrong" factor with those machines that doesn't exist with anything made after about 1976.







Entire thread
Subject Posted by Posted on
* Galaxy Game? Quantum Leaper 01/13/11 06:54 AM
. * Re: Galaxy Game, PDP-11 cpu, and now MESS gregf  02/23/11 09:47 PM
. * Re: Galaxy Game? Lord Nightmare  01/13/11 07:58 AM
. * Re: Galaxy Game? R. Belmont  01/13/11 05:50 PM
. * Re: Galaxy Game? Quantum Leaper  01/13/11 11:23 PM
. * CPU subclassing for fun and profit R. Belmont  01/14/11 05:55 PM
. * Re: CPU subclassing for fun and profit Quantum Leaper  01/16/11 03:09 AM
. * Re: CPU subclassing for fun and profit hap  01/14/11 09:19 PM
. * Re: CPU subclassing for fun and profit Fever  01/15/11 10:25 PM
. * Re: CPU subclassing for fun and profit Quantum Leaper  01/16/11 03:30 AM
. * Re: CPU subclassing for fun and profit ranger_lennier  01/15/11 11:15 PM
. * Re: CPU subclassing for fun and profit Fever  01/15/11 11:47 PM
. * Re: CPU subclassing for fun and profit R. Belmont  01/16/11 12:08 AM
. * Re: CPU subclassing for fun and profit R. Belmont  01/14/11 11:06 PM
. * Re: CPU subclassing for fun and profit hap  01/16/11 11:18 PM
. * Re: CPU subclassing for fun and profit R. Belmont  01/16/11 11:34 PM
. * Re: Galaxy Game? hap  01/14/11 01:29 AM
. * Re: Galaxy Game? etabeta  01/14/11 09:35 AM
. * This is the best thing we can do... MASH  01/15/11 06:09 AM
. * May I? GatKong  01/14/11 12:09 AM
. * Re: May I? Quantum Leaper  01/14/11 06:01 AM
. * Re: May I? ranger_lennier  01/14/11 04:29 AM
. * Re: May I? Quantum Leaper  01/14/11 07:10 AM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 237 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2454