Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
#110212 - 07/07/17 06:37 PM Going old-school  
Joined: Feb 2004
Posts: 1,864
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member

Joined: Feb 2004
Posts: 1,864
Sydney, Australia
For lulz, I decided to rewrite MAME’s Intel 4004 CPU core and add support for most 4040 features. The new CPU core operates at the bus cycle level, and exposes most useful signals. It also uses lots of address spaces for all the different kinds of memory and I/O it supports (thanks OG). Some CPU core bugs were fixed along the way - notably intra-page jumps on page boundaries were broken.

One nice benefit we get from this is being able to hook up the I/O for the Bally/Nutting solid-state Flicker pinball prototype (supposedly the first microprocessor-controled pinball machine) how the hardware actually worked. I also hooked up the playfield lamp matrix as outputs and the operator adjustments as machine configuration while I was at it. We need a proper thermal model of a lamp with PWM dimming support before that part can be declared perfect. (It previously used a hack, pulling the low bits of RC out of the CPU using the state interface. This worked due to a quirk of the game program, and there was no way to implement it properly without the 4004 CM-RAM signals being exposed.)

Possibly more interestingly, we can now emulate the Intel INTELLEC® 4/MOD 40 development system. There seem to be very few surviving examples of this system, but fortunately we've got monitor PROM dumps, and there's some information floating around the web. It has interesting debugging features on the front panel. There’s a scanned manual, but the schematics are very poor quality. However, with some idea of how it works, it’s possible to work out what all the chips are supposed to be. That’s the fun part. Turning it into MAME code isn’t as much fun, but it’s doable.

The front panel looks like this:
[Linked Image]

That requires clickable artwork for the switches and outputs for the LEDs to get a usable experience (writing the MAME XML layout really isn’t fun). There’s a simple monitor in PROM, designed to be used with an ASCII teleprinter with paper tape reader and punch (e.g. a Teletype Model 33 ASR). MAME’s RS-232 video terminal will have to do as a substitute for that.

If you get bleeding edge MAME (i.e. built from source no more than a day or so old), you can try it out in emulation. Did you ever wonder how developers may have debugged 4004 code in the mid to late ’70s? Well even if you didn’t, now you can find out.

The front panel looks like this in emulation (without the explanatory labels), and by default MAME shows the video terminal below this:
[Linked Image]

All those LEDs are functional, and all those switches are clickable and visually reflect their current state.

So how would you actually use it in practice? That’s where this brief instruction manual on the MAMEdev wiki comes in. It’s complete with examples of how some of the monitor commands and front panel debugging features can be used. It’s marked NOT_WORKING in MAME for now because you need to manually set up the terminal the first time you use it, and I haven’t finished implementing the universal slots and storage cards. But you can do all the things described on that page.

Does anyone care? Probably not. Will anyone actually even try this system out in MAME? Probably not (apart from Robbbbbbbert). But this is another example of something that you can only do in MAME, and how completely unrelated systems can both benefit from emulating the same chip properly. It also gets rid of one previously unavoidable hack, and gets us one step closer to feature parity with EmuAllSystems.

#110213 - 07/07/17 07:33 PM Re: Going old-school [Re: Vas Crabb]  
Joined: Feb 2004
Posts: 1,864
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member

Joined: Feb 2004
Posts: 1,864
Sydney, Australia
There was supposedly an INTELLEC 4/MOD 4 as well, with a 4004 CPU rather than a 4040, and a different front panel and control board because the 4004 lacks the stop/single step and interrupt features that the 4040 added. It runs the same monitor program, though.

#110214 - 07/07/17 09:52 PM Re: Going old-school [Re: Vas Crabb]  
Joined: Jul 2015
Posts: 33
anikom15 Offline
Member
anikom15  Offline
Member

Joined: Jul 2015
Posts: 33
Wow good job. In regards to a thermal model of a lamp, I may be able to come up with something. But what kind of lamps are we talking about?

#110216 - 07/07/17 10:18 PM Re: Going old-school [Re: Vas Crabb]  
Joined: Jan 2011
Posts: 161
Al Kossow Offline
Senior Member
Al Kossow  Offline
Senior Member

Joined: Jan 2011
Posts: 161
Originally Posted by Vas Crabb

Possibly more interestingly, we can now emulate the Intel INTELLEC® 4/MOD 40 development system. There seem to be very few surviving examples of this system, but fortunately we've got monitor PROM dumps, and there's some information floating around the web. It has interesting debugging features on the front panel. There’s a scanned manual, but the schematics are very poor quality. However, with some idea of how it works, it’s possible to work out what all the chips are supposed to be. That’s the fun part.


http://www.computerhistory.org/collections/catalog/102704114

users manual

http://bitsavers.org/pdf/intel/mcs4/Intel_Intellec_4_and_Micro_Computer_Modules_Jan74.pdf

#110218 - 07/07/17 10:55 PM Re: Going old-school [Re: anikom15]  
Joined: Mar 2002
Posts: 868
hap Offline
Senior Member
hap  Offline
Senior Member

Joined: Mar 2002
Posts: 868
Originally Posted by anikom15
Wow good job. In regards to a thermal model of a lamp, I may be able to come up with something. But what kind of lamps are we talking about?
LEDs, 7segs, lightbulbs, VFD, etc. My handheld and chesscomputer drivers need this too, currently I have a simple but effective anti flicker routine for each driver. Some games, eg. the old blip football games, rely on (appearance of)brightness difference.

https://github.com/mamedev/mame/issues/729

Last edited by hap; 07/07/17 10:57 PM.
#110222 - 07/08/17 12:08 AM Re: Going old-school [Re: Vas Crabb]  
Joined: Jul 2015
Posts: 33
anikom15 Offline
Member
anikom15  Offline
Member

Joined: Jul 2015
Posts: 33
Okay so one thing we'd want is for this to work at the refresh rate of the display device rather than the system.

I'm pretty sure the persistence of things like lamps and VFDs all follow a similar function as phosphors do, i.e. exponential, with some random processes that may create longer tails. Simulating the color of the lamps as they decay will be the fun part smile

LEDs don't really decay as far as I know. I believe low pass filters are employed to prevent a PWM signal from causing too much flicker. I'll have to look more into it though.

Last edited by anikom15; 07/08/17 12:11 AM.
#110224 - 07/08/17 04:07 AM Re: Going old-school [Re: Al Kossow]  
Joined: Feb 2004
Posts: 1,864
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member

Joined: Feb 2004
Posts: 1,864
Sydney, Australia
Any lamp model needs to integrate with the output and artwork system, not the video system.



Well, it's nice that you have one, but I can't see any way to actually see it.



I get a 404 from the mirror if I use that link, but I can get it here. It shows the MOD 4 front panel. Key differences appear to be a CPU LED rather than a RUN LED, and HOLD and ONE SHOT switches for controlling the CPU TEST line where the MOD 40 has STOP and SINGLE STEP. The block diagram shows a 4004/4008/4009 chipset rather than the MOD 40's 4040/4289. There's probably enough clues to emulate this…

#110234 - 07/09/17 09:48 AM Re: Going old-school [Re: Vas Crabb]  
Joined: Feb 2004
Posts: 1,864
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member

Joined: Feb 2004
Posts: 1,864
Sydney, Australia
Well, MOD 4 is supported as well now. It's not as much fun without STOP and SINGLE STEP, but the front-panel debugging is all still there.

MAMEdev wiki page URL moved since it covers MOD 4, too: http://wiki.mamedev.org/index.php/Driver:INTELLEC_4

#110266 - 07/12/17 06:13 PM Re: Going old-school [Re: Vas Crabb]  
Joined: Feb 2004
Posts: 1,864
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member

Joined: Feb 2004
Posts: 1,864
Sydney, Australia
Added support for the front-panel PROM programmer (-promimage/-prom media). Files must be exactly 256 bytes. You can create an unprogrammed file with the internal File Manager menu. Front panel and rear panel (Machine Configuration) switches muse be set correctly for PROM programming to work (should be obvious what the right settings are, but the manual describes it anyway).

Also added support for the optional high-speed paper tape reader that the monitor program supports as a slot card device (ptreader, installed in slot -j7 by default). This doesn't appear in any of the manuals/catalogs, but it must've existed in some form for Intel to include support for it in the monitor program. You can load BNPF or Intel HEX files as -punchtape/-ptap media – select it with the J command.

All front panel LEDS and switches are now present (ignoring the keyswitch for power, which can be represented by starting and stopping MAME), and all monitor commands are now usable. The manual has been updated to document all monitor commands and driver functionality. I haven't updated the front panel image to show the additional switch.

Before I mark it working I want to finish off the bus and implement another card or two.

#110267 - 07/12/17 06:39 PM Re: Going old-school [Re: Vas Crabb]  
Joined: Mar 2001
Posts: 15,752
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,752
USA
Actually supporting an (E)PROM socket is a level of perversion I hadn't considered. There are many Apple II (E)PROM writer cards, I'll have to wire up a few if I can find the software.

Page 1 of 2 1 2

Who's Online Now
2 registered members (Edstrom, 1 invisible), 15 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,435
Posts109,387
Members4,764
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.026s Queries: 14 (0.007s) Memory: 5.0221 MB (Peak: 5.2509 MB) Zlib enabled. Server Time: 2017-11-18 12:17:15 UTC