Jump to content
IGNORED

ZX Spectrm Emulation on Atari 1200 XL


Poison

Recommended Posts

When I wrote that "there was some progress in the matter", I meant exactly this, and not that the whole program is already complete. It will yet take some time, especially because I cannot sit on it all days. The film demonstrates just the first version which worked less or more correctly. There are still minor glitches and not all the support code (like handling the disk images) has already been written. Patience, please :)

 

Some other stuff:

 

To get an idea what is the approximate processing power of the emulated Z80 in comparison to a real one, I got an Eratosthenes sieve benchmark doing 100 iterations, and also tried a small loop in BASIC-80 v.5.2. Trub (who btw. is preparing the DLT CP/M BIOS) was kind enough to run the same test on the LDW Super 2000 (an Indus GT clone) and Indus CP/M. We used the same binaries, of course, both of the BASIC and the sieve.

 

The BASIC "program" was this:

 

FOR X=1 TO 10000:NEXT X

 

The sieve benchmark came with the source, it was supposedly compiled with Hisoft C, but I failed to compile it anew. The src is this:

 

/* This is the well-known Sieve of Erathostenes, as used in the */
/* BYTE Benchmarks (BYTE, june 1988). Only difference: Small C  */
/* in my version does not accept for..next loops, so I changed  */
/* them to whiles.                                              */

/* Performance measurements:                                    */
/*      - a 386/40 running MYZ80 CP/M emulator: 284 seconds     */
/*      - IBM PC, 4.77Mhz original, MS-DOS:     298 seconds   */

/* I'd like your CP/M system's score! (No, I don't know why     */
/* either..) Send results to:                                   */
/* Oscar Vermeulen, oscar@contrast.wlink.nl or 2:281/527.18     */

#include <stdio.h>

#define size 8190
#define LOOP 100
#define TRUE 1
#define FALSE 0


char flags [8191];

main()
{
        int     i, prime, k, count, iter;

        printf("BYTE sieve Benchmark, %d iterations\n", LOOP);

/*      gtime   */

        iter=1; while(iter<=LOOP)
        {

                count = 0;

		i=0; while (i<=size)
                {       flags[i] = TRUE; i++;   }

                i=0; while (i<=size)
                {
                        if (flags[i]==TRUE)
                        {
                                prime = i+i+3;
/*                              printf("\n%d", prime);  */

                                k=i+prime; while (k<=size)
                                {       flags[k] = FALSE;
                                        k=k+prime;
                                }
                        }
                i++; count++;
                }
        iter++;
        }

        printf("\nEND. %d primes found\n", count);
}
The actual binary below.

 

The results are a bit puzzling, because the BASIC was faster on Indus, but the sieve was sligthly faster on the emulator. Like this:

 

       Indus GT   CP/Emu
BASIC  10 sec.     11.5 sec
Sieve  472 sec.    462 sec.
I wonder if anyone has a real CP/M system handy and could let me know how does it perform, just for reference. The Indus/LDW/CA drives contain a Z80 clocked at 4 MHz.

 

The attachment, i.e. the sieve benchmark, a zipped COM file for CP/M:

beh.zip

Edited by drac030
Link to comment
Share on other sites

I have to add my name to the list of many WOWs!

 

Burning brain cells just trying to come up with reasons why this would have been important in the day and why it would be important today. Would'a could' should'a: I remember logging into Citidel BBS, as I recall they were rock solid and ran on Z80 systems. It would have been nice to have it as an option to AMIS. Ditto for just about everything software back in the telephone line era. Now and then, it would have been nice to have access to all the development tools like BASIC compilers, C language, and Pascal written for the Z80/CPM. I imagine even today people could use it for archival purposes for extracting old compression and storage techniques. I know when I was fooling with my ATR8000 I ended up having to do a lot of work using an emulator to extract disk images.

Lets not forget COBOL, FORTRAN, APL, MODULA 2, ALGOL, MUMPS...

Link to comment
Share on other sites

When I wrote that "there was some progress in the matter", I meant exactly this, and not that the whole program is already complete. It will yet take some time, especially because I cannot sit on it all days. The film

...

The results are a bit puzzling, because the BASIC was faster on Indus, but the sieve was sligthly faster on the emulator. Like this:

 

       Indus GT   CP/Emu
BASIC  10 sec.     11.5 sec
Sieve  472 sec.    462 sec.
I wonder if anyone has a real CP/M system handy and could let me know how does it perform, just for reference. The Indus/LDW/CA drives contain a Z80 clocked at 4 MHz.

 

The attachment, i.e. the sieve benchmark, a zipped COM file for CP/M:

 

Don't be too puzzled. If the compiler uses some of the slower instructions such as those using the index registers, it may actually be faster under emulation.

I'd guess a modern cross compiler would favor the Z80 across the board.

 

Link to comment
Share on other sites

Let me pass on the sieve benchmark.

 

The BASIC-80 loop: FOR X=1 TO 10000:NEXT X

 

1.77 MHz with VBXE: 148 seconds

 

1.77 MHz without VBXE: 199 seconds.

 

@Stephen: thanks for the offer, but currently the emulator is not yet at the stage where you can easily feed it "external" software. I can virtually only use what I already have on ATRs, and these are mostly backup copies I once did with my Indus CP/M.

 

But if you have something interesting on such ATRs (DD only for now), I am of course highly interested.

  • Like 1
Link to comment
Share on other sites

Let me pass on the sieve benchmark.

 

The BASIC-80 loop: FOR X=1 TO 10000:NEXT X

 

1.77 MHz with VBXE: 148 seconds

 

1.77 MHz without VBXE: 199 seconds.

 

@Stephen: thanks for the offer, but currently the emulator is not yet at the stage where you can easily feed it "external" software. I can virtually only use what I already have on ATRs, and these are mostly backup copies I once did with my Indus CP/M.

 

But if you have something interesting on such ATRs (DD only for now), I am of course highly interested.

So roughly the equivalent of a .3 MHz Z80. :D

*edit*

That puts a a standard Apple IIGS at around .5MHz.

To be very usable I'd say you'd need to be running around 8MHz.

Edited by JamesD
Link to comment
Share on other sites

  • 3 months later...

An updated versin of the ZX Spectrum emulator (0.9.3) is available for download at my website.

 

The CP/Emu (the unreleased yet CP/M emulator) allowed me to run a series of compatibility tests on the Z80 engine (which is the same in both programs). This revealed that the emulation of 11 (!) Z80 instructions had to be corrected.

 

Also, there is a new binary in the archive, ZXR.EXE. This is the same emulator just with the R register emulation enabled in the Z80 engine. It is a bit slower, so you probably still want to use the regular ZX.EXE, and switch to the ZXR only for these programs which do not want to start on that compile.

  • Like 3
Link to comment
Share on other sites

  • 1 month later...

For a good start of the New Year there is a new version (0.9.4) of the ZX Spectrum emulator available for download at my website.

 

For those who do not own a hardware add-on with an AY-3-8910 (or YM-2149) sound chip, the emulator will now replay the AY/YM tunes on stereo Pokey, when it detects its availability.

 

The AY/YM sound chip was built into ZX Spectrum 128, but adding the AY/YM to a ZX Spectrum 48 is quite popular thing. Therefore even 48k games and (mostly) demos play music tunes on the AY. I recommend the in-game tune from the Crapbert :)

 

Examples are included in the added software pack (zxprog.tar.gz), which has also been a bit updated.

Edited by drac030
  • Like 5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...