Jump to content


Photo

ZX80 Spectrum Emulator


  • Please log in to reply
34 replies to this topic

Re: ZX80 Spectrum Emulator #21 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 7 May 2020 - 08:56

Hi @s3n0

 

Binary executable files are indeed dependent on the destination architecture this is why you need to compile your own binary files under OpenPli develop branch or any other openembedded like tree using my bitbake recipes.

Please note, this is something new which does not exists yet anywhere else, i am talking about fuse port to SDL2 , bitbake recipes and the SDL2 remote control patches as well.

 

Please provide more details about what interface it is clumsy.

 

ARM cpu include compatible families as well, but this should not be trusted as there are involved a lot of other things, for example provided SDL2 on Vu Solo4K works only with directfb video driver

 

Nice, me too, i was and i am still fascinated by assembly language, those days i am fooling around with microchip microcontrollers.

 

The Z80 CPU itself can be emulated on python too :)

 

The emulator is not builded by me, i had worked only to add SDL2 support and port the code to my Solo4K and create bitbake recipes

- Libspectrum is a library which contain a lot of helpers to manipulate files formats .z80, .tap, .tzx etc as well as some image and sound formats specific to Z80 and other platforms and periferals.

- fuse itself is the emulator

- SDL2 is the graphical interface to display on screen the emulator, also used to emualte  the joystick, rc keys and some people use the audio through sdl too

- libaudio is used by libspectrum

- enigma2 plugin it is used to start the fuse under enigma2, fuse itself works wihout enigma but will be easier  to start the emulator with a plugin


Edited by serdeliuk, 7 May 2020 - 08:58.

init 2 && init 3


Re: ZX80 Spectrum Emulator #22 s3n0

  • Senior Member
  • 673 posts

+62
Good

Posted 7 May 2020 - 12:28

Emulating the machine code of the Z80 processor via Python is not enough, because the entire ZX-Spectrum platform consists not only of the processor, but also of other chips (and principles).

An example is the principle of work of video memory and graphic output ZX-Spectrum - video memory was divided into 2 parts: the first part of black and white graphics and the second part of attributes (colors). However, one attribute was always the whole square for 8x8 graphic bits.

 

In that first part of the video memory, black and white graphics were placed in bytes (8 bit long "lines"), in a row on several interlaced lines in a row. However, at the same time, this graphic part was further divided into 3 integral proportions. The very operation of the graphics chip is a problem to simulate. It's complicated and there's a lot.

 

You don't have to explain to me how the machine code works for the living God or what a binary file is. After all, I used to program 8080 and 80x86 processors a long time ago. Didn't I write it clearly enough? : D I mentioned binaries only because there is complete chaos in them. It's like importing 5 modules into Python code instead of using a simple algorithm for a simple thing. I tend to create algorithms still in the form of Assembler :). Additional modules and libraries, if I don't have to. For example, many programmers import 10 modules for one short function ... for XML parsing, for example. But sometimes you really don't need to use an XML parser or foreign modules and libraries.

 

There are already countless ARM processors on the market and their compatibility between them is still very poor. In the case of ARM processors, it is better to talk about the chipset as a whole. Even in the case of the Linux set-top box platform, ARMs are divided into many types:

 

armv7
armv7-neon
armv7athf-neon

cortexa9hf-neon

cortexa15hf-neon-vfpv4
aarch64 (64bit - cortexa53)

 

Yes ... of course the machine code can be compiled with some compiler arguments set, but no one can set it to maintain compatibility with old ARM types. It also depends on the linux kernels (I've written this before). And you probably don't know how to set up an ARM code compiler, because you want to know the type of my set top box and Enigma distribution. Create a compatible binary for all mips32el processors - as the most used and compatible mipsel family and don't worry! :-D MIPSEL is not ARM! You don't need to know the details of the chipset in the case of mipsels.

 

MIPSEL processors (32 bit) still maintain compatibility. There are not so many differences. Of course, these also differ slightly in detail, but the compatibility of the used machine code (binaries) is very good, unlike ARM processors.

 

As I wrote above, I don't know what principle this emulator works on, because I didn't study the emulator code (I don't mean your recipes). It feels like an emulator that emulates another emulator.



Re: ZX80 Spectrum Emulator #23 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 7 May 2020 - 13:39

Well, on some parts you are wrong, on other ones just rude. Beside this, actually i have a working Z80 emulator just in python without entering the details here as are out of scope of this thread.

However on most parts you are right but are not related to the scope of  this thread.

 

To clarify, i asked about your machine model, not about your CPU, thinking i am helping you not entering in dissertation, simply knowing your machine i am able to build the ipk for you machine under OpenPli without thinking of CPU.

 

In regards fuse emulator you can find more infos on their SF page, you can ask them why they built it in this manner.


init 2 && init 3


Re: ZX80 Spectrum Emulator #24 s3n0

  • Senior Member
  • 673 posts

+62
Good

Posted 7 May 2020 - 16:20

Emulator of the ZX-Spectrum 8-bit platform, or at least the Zilog-80 CPU emulator, could work in Python, because the processors in today's set-top boxes carry a clock frequency of around 750MHz and rarely also 1-2GHz. However, this still does not mean that it is enough. However, you admit that this is why you need so many libraries and modules :), because Python alone would not really be enough for this purpose.

 

You really don't need to know the machine model from me. Just know that this is the current set-top box, based on MIPS/32/EL. Most currently manufactured Linux set-top boxes have an almost identical processor in the installed chipsets. MIPS/32/EL is doing very well in terms of compatibility. On the contrary, as I have already mentioned, in the case of ARM it is not so clear-cut. Until recently, SH4 was also used, but somehow it has already disappeared from the trade market.

 

I only wanted two binaries for MIPSEL, listed above, which I did not find compiled for the Enigma platform (linux kernel in ATV 6.4 or PLi 7.2 with reference to the available libraries in these two Enigma distributions). I found everything else for MIPSEL (on the PLi-7 feed server).


Edited by s3n0, 7 May 2020 - 16:20.


Re: ZX80 Spectrum Emulator #25 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 7 May 2020 - 17:15

I think we hit a language barrier, as english is not my natal tongue, however, just to be sure i am very clear.

 

In order to compile anything under OpenPli environment it is REQUIRED / MANDATORY to set in local.conf or to pass an argument, the MACHINE TYPE

 For example in my case

MACHINE=vusolo4k

the rest is done by the bitbake * preset environment for this MACHINE, at this point I don't even care what CPU have this MACHINE.

So, if you need those binaries for your MACHINE you need to tell me which machine to put there, i hope now is more clearer.

 

And now for something completely different and just for the sake of the argument, why do you think a python app is not able to emulate a Z80 CPU, an AY audio chip and the most contorsionated video memory in the world?


Edited by serdeliuk, 7 May 2020 - 17:22.

init 2 && init 3


Re: ZX80 Spectrum Emulator #26 WanWizard

  • PLi® Core member
  • 70,563 posts

+1,816
Excellent

Posted 7 May 2020 - 17:21

Any app is able to emulate a CPU.

 

For my end-work decades ago I had to write a parser and compiler in Pascal, running on a Motorola 6800, which was fed a Z80 assembler file by the prof to validate it worked.

 

The main question is would it run the application has it would run on the original hardware? ;)


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: ZX80 Spectrum Emulator #27 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 7 May 2020 - 17:30

Haha, nice, you hit the red button, i think that is the most complicated task in the world of hardware emulations and will never work perfectly, as on the original hardware.


init 2 && init 3


Re: ZX80 Spectrum Emulator #28 s3n0

  • Senior Member
  • 673 posts

+62
Good

Posted 7 May 2020 - 17:41

In the case of the ZX-Spectrum, the CPU was very simple, but overall this platform was not. We still forgot about the Joystick connection interface or computer mouse and their solutions :).



Re: ZX80 Spectrum Emulator #29 WanWizard

  • PLi® Core member
  • 70,563 posts

+1,816
Excellent

Posted 7 May 2020 - 17:52

I've missed that fun.

 

My Z80 platform was a Tandy TRS-80 Model 3 and a Philips P2000 (both the T and the C model), after I got tired of my 6502 Commodore-64.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: ZX80 Spectrum Emulator #30 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 7 May 2020 - 17:59

I had a HC84 a clone of a Sinclair spectrum made by the mighty communists in their glorious era, i don't want to remember how hard those days were to find documentation i was in love with electronics and that computer changed my life


init 2 && init 3


Re: ZX80 Spectrum Emulator #31 s3n0

  • Senior Member
  • 673 posts

+62
Good

Posted 7 May 2020 - 20:01

I had my first PC as a young boy. It was ZX Spectrum - the "rubber" as it was sometimes called. When I stopped enjoying playing games, after a few years, I also started programming on it (still as a young boy). As first in Basic simple language and later in Assembler (very similiar to intel 8080). This also implies my logo + some of my colleagues. :) As an eternal relationship to ZX Spectrum 48k. I will never forget the initials after turning on the computer, in the bottom line on the CRT TV, ha ha:

 

©1982 Sinclair Research Ltd



Re: ZX80 Spectrum Emulator #32 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 7 May 2020 - 20:11

Or the clear message

 

R Tape Loading error, 0:1


Edited by serdeliuk, 7 May 2020 - 20:12.

init 2 && init 3


Re: ZX80 Spectrum Emulator #33 Erik Slagter

  • PLi® Core member
  • 46,969 posts

+542
Excellent

Posted 8 May 2020 - 16:55

The most interesting challenge is to emulate the (platform) hardware, not the processor. On i386 there is memory and io virtualisation, the ARM and MIPS processors in our STB's don't have it. That means every call to an I/O address (we're talking Z80 here...) or a memory address needs to be detected and then the respective action of the hardware needs to be emulated. If you don't have virtualisation it means every instruction needs to be (partly) decoded and checked for every possible address. For load-and-store and load-execute-store instructions (which the Z80 has both of) it's extra complex, especially if both source and destination addresses have additional effects. What makes it even more interesting is that I/O adresses are only partly decoded and some ranges of memory too. That means that if you write to address x and read from address x + (memory window), you should see the same value. It's even more interesting, in that three versions of the ZX Spectrum exist, which are not completely the same on hardware level. There is no problem if you only use BASIC, of course, but once you start doing direct I/O access, you may see different behaviour. Some programs depended on that behaviour  :ph34r:

 

The Sinclair QL (the successor) was even worse in this respect, much worse even, many different version with quite some changes in both hardware and software. But there it wasn't a problem because all hardware was abstracted in the operating system. There was even a collection of library functions in ROM that where vector-indexed, so it didn't matter what hardware or firmware version you were using.


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: ZX80 Spectrum Emulator #34 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 8 May 2020 - 17:31

I remember that back in '84 i had my Sinclair clone serviced by a friend and he added Opus assembled/dissassembler to the eprom and a switch on a side, before powering the computer with switch on one position the basic started then on the other one the Opus which i can recall it had an eagle as logo.

 

Does anyone know if i can find this software somewhere?


init 2 && init 3


Re: ZX80 Spectrum Emulator #35 serdeliuk

  • Senior Member
  • 333 posts

+18
Neutral

Posted 8 May 2020 - 18:40

Hahaha, this memory and how twist the reality, i found it, it seems that the logo is not an eagle but an owl.

I never knew that was programmed by a fellow Romanian under the Comunists :)

 

http://cismas.net/Co...oject/opus.html

 

 

snapshot01.png


init 2 && init 3



2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users