Kjetil's Information Center: A Blog About My Projects

More CP/M Emulator Ports

I decided to port my "kaytil" Z80 CP/M 2.2 emulator to even more platforms to see if it could be done. It can now be compiled for DOS by using the DJGPP toolchain or Windows by using the MinGW toolchain. In order to support Windows, I needed to make a curses based implementation of the console interface and this can also be used to compile an alternative Linux version based on (n)curses instead.

Since DJGPP is actually a 32-bit environment the DOS version also requires a 32-bit CPU to run and will use the CWSDPMI.EXE extender. The CPU needs to be fast as well, at least a Pentium II, to get acceptable speeds. But in order to not run too fast, a slowdown mechanism exists in the emulator as well. This slowdown mechanism is just a busy-wait since DOS has no multitasking concept and will just keeps the entire CPU to itself anyway.

I ran a simple benchmark for the DOS version by using "BASIC-80 Rev. 5.21" and the following BASIC program:

10 FOR I=0 TO 10000 STEP 1
20 PRINT I
30 NEXT I
          


Here are the results:

|----------------------|---------------------|
|                      |      Slowdown       |
|System                | Enabled    Disabled |
|----------------------|----------|----------|
|QEMU (AMD Ryzen 9)    | 1m11s    | 0m21s    |
|DOSBox (AMD Ryzen 9)  | 1m11s    | -        |        
|Pentium 166MHz        | 2m01s    | 1m59s    |        
|486SX 25MHz           | 19m16s   | -        |
|----------------------|----------|----------|
          


So it is possible to run it on a 486 CPU but it will be very slow.

The updated source code can be found here or at the Git repo here. Instructions for building is on the README.md within, but for convenience, here is a binary of the DOS version and Windows version.

Topic: Open Source, by Kjetil @ 14/10-2022, Article Link