Jump to content
IGNORED

Unusable zx Spectrum Emulator (use)


xxl

Recommended Posts

Hmm, I was thinking... Would it be possible to partly emulate CP/M system in such a way? Without any extensions, with the help of disk drive as outer world. Science-fiction? Would it be possible for any of Atari drives to read CP/M specific floppies?

  • Like 1
Link to comment
Share on other sites

  • 8 years later...

@Yautja it would be good that you change what you wrote on the Atariteca website:

From Mariusz only Pentagram is a Z80->6502 the others are ports from C64 so share same 6502.

Saboteur is like these last but with the Tezz entering it uses gfxs and better game logic that were only on the ZX's version but it is still added into the 6502 code, there's no direct port from the Z80 code.

Edited by José Pereira
  • Like 1
Link to comment
Share on other sites

@Yautja it would be good that you change what you wrote on the Atariteca website:

From Mariusz only Pentagram is a Z80->6502 the others are ports from C64 so share same 6502.

Saboteur is like these last but with the Tezz entering it uses gfxs and better game logic that were only on the ZX's version but it is still added into the 6502 code, there's no direct port from the Z80 code.

 

Thanks a lot! I´ve updated the article.

 

- Y -

  • Like 1
Link to comment
Share on other sites

Hi XXL,

Great job with the emulator. I'm really impressed.

A couple of games I have always really wanted to see running on my Atari hardware were Cybernoid and R-Type. I was using Spectacular to create sna files and then trying to run them in the Atari ZX emulator. When I open them up, I only see a frozen image of where I did the snapshot. However, they work fine in Spectacular.

Is there a trick to creating the sna files that will work on your ZX emulator?

 

Thanks

Link to comment
Share on other sites

  • 4 years later...

Fascinated reading about ZX Spectrum emulation and parsing code and building new source and appreciate that is what is needed to get really good conversions to the Atari.  So here is my 10 cents and feel free to shoot me down in flames with this idea, but I wonder if anyone has ALSO considered or done any work previously with the idea of 'twinned' emulators?

 

Basically, an Atari emulator eg. Altirra would have to support a new mechanism to simply also launch another emulator (ie. a specific preferred ZX Spectrum emulator as a background process) and set up a shared memory pipe which is used to share info between the two 'twinned' emulators.  Signals and data can be sent both ways to and from the shared memory pipe between the two machines, and they are simply preceded and separated from the next command using the pipe symbol.

 

The 2nd twinned emulator will have been selected as one with suitable source code available and will of course have been modified to be able to be launched in a special way in order to have no direct keyboard or joystick control from the Windows PC, nor will it even have a 'Windows' screen.  It also plays no sound.  It should appear almost like a background process in Windows, even though it is doing all the work running the Z80 program while all the input info is being received from the Primary Atari emulator.  The Atari emulator will sit in a loop sending any keyboard or joystick information across the shared memory pipe.   The twinned emulator basically also has a loop that sits reading the next command from the pipe and triggering an appropriate key or joystick press routine (that modifies the appropriate local addresses).

 

Every screen refresh, the twinned emulator sends back the entire ZX spectrum screen map and color/attribute map data across the shared memory pipe.  This is the only way the emulators are synchronised, since the ZX spectrum machine will run at 2MHz and the Atari at 1.79Mhz and there is not really much code running on the Atari.  The Atari emulator code (not the code it is running) then has to copy the screen memory in the shared memory pipe DYNAMICALLY into the correct screen memory locations for the Atari and generate any DLI's for creation of the colour map on the fly (for efficiency, the twinned emulator could only send the lot if there is a change to the colour map, ie. don't send otherwise or include a seq no from which the primary can use to detect a change).   It may not need much from the Atari emulator for screen memory handling but to simply copy the screen from the shared pipe to the screen memory inside the Atari emulator, if the Atari emulator itself is already setup running a simple program at launch of twinned emulator mode which puts it in 32 byte wide Mode F and with PMG DMA enabled and PMBASE pointing to the area that the Atari emulator is going to 'fill' to emulate the colour map.  However, it will have to do it's best to generate the color map as PMG.  This will be the trickier part, but there could be help using other mechanisms which we introduce below..

 

The Atari emulator should also use a config file that can be changed per app that maps the ZX colour map values to the Atari version, since sometimes the Atari version will look much better with a colour deviation from the ZX Spectrum.  The program that the Atari emulator runs itself does not have to do much except for have setup the screen details and display the PMG.  The key point though that although it is not running the ZX spectrum code, it's screen is still being 'driven' by the ZX Spectrum emulator running the code at 2Mhz ie. even any scrolling of the screen etc.  The theory would be that you were able to play let's say 75-80% of the Spectrum software on the Atari emulator in this 'twinned' formation.

 

As an example of the shared memory pipe being used, the emulators would send pure text for the commands/data:

Control:

    |START| - An indication to the twinned emulator that it may now start reading the keys/joystick and start sending the screen back from the next screen refresh onwards.

    |STOP| - An indication to the twinnded emulator to terminate cleanly.

 

Inputs:

    | KEYS: {<SHIFT>,A} | - Indications of keyboard activity on the Atari

    | JOY: {UP, RIGHT}| - Indications of joystick activity on the Atari

 

Outputs:

    | SCREEN: {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

                     ........................................................................................} | - Entire screen data sent from the ZX Spectrum emulator to the Atari.

 

    | ATTRIBUTEMAP: { 1,1,1,1,1...............................................................} | - Attribute/color map sent from the ZX Spectrum emulator to the Atari.

 

The advantage of using a shared memory pipe, is that it's easier to modify an existing program to use such a mechanism and it's more portable, since the other emulator could even be written in Python or other language but still use the shared memory pipe.  Later on, there is the possibility of expanding the pipe commands, so the ZX Spectrum could for example send back certain memory location addresses and values that the Primary emulator asks to 'watch'.  This might be useful if on the Atari emulator when playing a game, we wanted to play sounds or run a RMT player playing music but we needed to know precisely when something had changed, ie. the player died, or the level had changed.  To cater for this expansion, we should allow for a different program (other than the default) to be launched inside the Atari emulator on entering 'twinned' mode.  It should also set some virtual 'hardware' register that the Atari code could see, so the music player could change music.

 

As a purist, you may think that the twinned emulators in such a config are not really like an Atari running the code and are of limited value for real HW users, but when used virtually, they could be thought of like a dual processor machine which is nothing new, for example back in the 80's there was the C128 machine that had a Z80 processor that could run CP/M.  Also, if an new up to date Atari HW (ie. video out of HDMI and USB Power supply) was launched like the new "The C64" machine, you can imagine such a 'virtual' mechanism that requires only a license of a 2nd emulator as well as the primary is remarkably cheap and would bring in a much greater audience with so many more titles available.

  • Confused 1
Link to comment
Share on other sites

@TracMan , I can see that you've put a lot of thought into what you've written above and a lot of effort too. So please don't take what I am about to say as a negative, I purely aim to be positive, even if I might not sound it.

 

I can see that this would take a huge amount of effort for Avery/Phaeron to create such a system. And what I have to ask is (sincerely), why? What is it that you want to achieve here? More games being able to be "on" the Atari? Why not simplify it all and just play the game in the Spectrum emulator instead? Once you start contriving something between two emulators and it isn't like a real world system, why do it? No disrespect, but I cannot see why.

 

On a technical front, I am not sure if this would even be possible. I could be wrong here (correct me if so), but I believe that colour mapping isn't quite possible on the Atari. While we can do some nice colour underlays with PMG's, I don't think that it is possible to address every single character with any colour that we want. I believe that all the games that we see with colour underlays have very carefully selected underlays which are hand-crafted and cannot cover every single character. Like I say, I am willing to be corrected, but I don't think so. For example, if we have 5 PMG's (4+combined missiles), all in quad width, that is 5*(4*8)=160 pixels width, however you can only address 4 pixels width at any one time (on or off).

 

In theory, we could create a Windows program which simulates a theoretical 8-bit computer which has never existed. With it, we could program whatever we want, but we'd never be able to play its games without that "emulator". If we could have a ZX Spectrum acting as a master and the Atari as a slave as you mention (with a lot of grunt work from the PC), this could never be done in reality.

 

One thing that your idea does lead my mind towards though, is the thought of a cartridge that plugs into a real Atari and does what you've mentioned. I don't think it'll be able to do the colour mapping, but the ironic thing is that the ZX Spectrum's best games were those in black and white. Maybe those games could easily be handled by a "clever cartridge"?

 

I just want to say though, I love creative thinking, so please continue what you're doing.

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...