Intel 8080 Emulator
Intel 8080 Emulator
Hey guys, not finding much fiddling with emulation in these forums. So releasing my project for fiddlers.
8080 emulation is possible up to 250mhz on my desktop(Fastest I have found anywhere on net).
The machine the 8080 runs on is the space invaders motherboard circa 1978(The machine itself needs work)
Most of debug coding is commented out. I'm stopping the project to build a realtime optimized disassembler for cores. Then moving on to other processors, perhaps 6502 and NES hardware.
The project started by porting codes from many sources, but ended up as a total rewrite from scratch as all 8080 emulator code I found was improper and untested on a real 8080 processor. 8080 Core is tested against Russian 8080 copy with assembly test source included. I originally tested against mame, but was given access to a Russian hobby computer for testing.
The core is 8080A-1, motherboard SpaceInvader Midway machine, 1978, if you want to write code for it.(The machine is barely emulated, just barebones to test cpu)
The download should contain all that is needed to compile on 4.51. Please note, Assembly optimizations were made by reading assembler output to make sure registers weren't corrupted with purebasic 4.51 runtime core. As such, not guaranteed to compile on any purebasic version besides 4.51.
https://sites.google.com/site/ajtaji/st ... ects=0&d=1
Enjoy, and be sure to post back any fixes.
8080 emulation is possible up to 250mhz on my desktop(Fastest I have found anywhere on net).
The machine the 8080 runs on is the space invaders motherboard circa 1978(The machine itself needs work)
Most of debug coding is commented out. I'm stopping the project to build a realtime optimized disassembler for cores. Then moving on to other processors, perhaps 6502 and NES hardware.
The project started by porting codes from many sources, but ended up as a total rewrite from scratch as all 8080 emulator code I found was improper and untested on a real 8080 processor. 8080 Core is tested against Russian 8080 copy with assembly test source included. I originally tested against mame, but was given access to a Russian hobby computer for testing.
The core is 8080A-1, motherboard SpaceInvader Midway machine, 1978, if you want to write code for it.(The machine is barely emulated, just barebones to test cpu)
The download should contain all that is needed to compile on 4.51. Please note, Assembly optimizations were made by reading assembler output to make sure registers weren't corrupted with purebasic 4.51 runtime core. As such, not guaranteed to compile on any purebasic version besides 4.51.
https://sites.google.com/site/ajtaji/st ... ects=0&d=1
Enjoy, and be sure to post back any fixes.
Re: Intel 8080 Emulator
Great, thx.
I will take a look at the source. I never did a emulator but it's very interresting.
How do you do a proper timing?
I will take a look at the source. I never did a emulator but it's very interresting.
How do you do a proper timing?
Re: Intel 8080 Emulator
Good machines and good software use interrupts for timing. If software uses software loops for timing, it will more than likely malfunction in an emulator. Interupts should be used in all software timing, so hardware owners can change the cpu if needed. The new cpu may run at different speed.
My timing on this machine is only guesstimated. It has two interrupts (Vstart and vBlanc). Timed by using a float reference by 60hz on where it should occur with the pixel clock.
The processor clock nor interupts nor pixel clock are connected to a master clock like they are on the motherboard.
The machine itself is only emulated enough to run my cpu core. Which the emulator can run space invaders, and Part II just fine, plus any of the custom software I wrote for it for testing.
My timing on this machine is only guesstimated. It has two interrupts (Vstart and vBlanc). Timed by using a float reference by 60hz on where it should occur with the pixel clock.
The processor clock nor interupts nor pixel clock are connected to a master clock like they are on the motherboard.
The machine itself is only emulated enough to run my cpu core. Which the emulator can run space invaders, and Part II just fine, plus any of the custom software I wrote for it for testing.
-
- Addict
- Posts: 1676
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Intel 8080 Emulator
I hope that rom in your package is in the Public Domain....
Re: Intel 8080 Emulator
The 8k rom is an assembled version of this page: http://computerarcheology.com/spaceinva ... s.txt.html
The other roms are written and compiled by myself.
Any other complaints??
The other roms are written and compiled by myself.
Any other complaints??
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: Intel 8080 Emulator
Great work. I did an emulator for the 8080 on for the PSX once, it ran at about 6x speed on a 17Mhz MIPS... I ran full whack and used interrupts to match the timing. It ran a few machines, see: http://computingdata.com/consoles/emulators maybe you could get the same machines working without much work?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: Intel 8080 Emulator
Indeed impressive, but I believe most of those machines used the z-80 3.5 mhz. Though the z-80 can run most 8080 code unmodified, there are some differences(small but critical), there is an extended opcode set it uses which are not implemented in this current processor core. They would reside in the instruction unknowns in the current jump table with a few modifications to the core microcode I have implemented as the flags are affected just a little different on z-80. The chips clock and interrupts could be implemented using rtsd read from the processor clock if dynamic speed was turned off on the I686 processors.It ran a few machines, see: http://computingdata.com/consoles/emulators maybe you could get the same machines working without much work?
A laptop with dynamic processor clock would definitely not be useful in this area and emulator would malfunction.
Basicly the above paragraph of nonsense states this is quite possibly above my head alone.
I am going to try to implement the sound portion of the Nintendo 2A03 processor chip instead to see how accurate interrupts can fire in windows.
The custom Virtual computer I am going to build for fun is going to require some type of sound chip for it to be any fun... and is a step towards NES emulation in the process.
I am very please to find someone interested in emulation in these forums. Anyone interested is welcome to join or drop tips or tricks on emulation techniques here.
Thanks
Booger
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: Intel 8080 Emulator
Yes, I started with basic 8080 emulation then added the z80 enhancements. The original aim was to get Phoenix running at 60hz vertical (monitor on its side) on a psx with no frameskip or slowdown, etc... It worked with plenty of time to spare. In fact the Phoenix emulator on top of a psx emulator running on Windows usually looks better than the direct MAME version! 

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
- Addict
- Posts: 1676
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Intel 8080 Emulator
Booger wrote:The 8k rom is an assembled version of this page: http://computerarcheology.com/spaceinva ... s.txt.html
The other roms are written and compiled by myself.
Any other complaints??
Nope. But you didn't mention that before, so I rightfully questioned it.
Re: Intel 8080 Emulator
Sorry, though I've been fooling around with countless emulators over the years, I'm not much into programming them 

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
-
- Addict
- Posts: 1676
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Intel 8080 Emulator
Something I always was interested in myself.. But I think far too advanced a topic for me.
Goes without saying knowing ASM for the CPU you want to work with is a big requirement
Goes without saying knowing ASM for the CPU you want to work with is a big requirement

Re: Intel 8080 Emulator
This uses nasty tricks to get around PB register usage... as such it only works with pb 4.51... for those never seen it work a compiled version is here:
https://dl.dropboxusercontent.com/u/540 ... ulator.rar
This is a total hack job...
https://dl.dropboxusercontent.com/u/540 ... ulator.rar
This is a total hack job...
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Intel 8080 Emulator
Very nice....return in my 14 years old
Thanks for sharing

Thanks for sharing


Not a destination