Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

8 bit Z80 compatible build version of Unity needed for Spectrum Next....

Discussion in 'General Discussion' started by Arowx, Jul 17, 2017.

Thread Status:
Not open for further replies.
  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194

    There is a Kickstarter for a re-make of the ZX Spectrum called the Spectrum Next.

    https://www.kickstarter.com/projects/1835143999/zx-spectrum-next



    They are about 3 times over their 250,000 goal so it looks like it's happening.



    Hardware specs include:
    • Processor: Z80 3.5Mhz and 7Mhz modes
    • Memory: 512Kb RAM (expandable to 1.5Mb internally and 2.5Mb externally)
    • Video: Hardware sprites, 256 colours mode, Timex 8x1 mode etc.
    • Video Output: RGB, VGA, HDMI
    • Storage: SD Card slot, with DivMMC-compatible protocol
    • Audio: 3x AY-3-8912 audio chips with stereo output + FM sound
    • Joystick: DB9 compatible with Cursor, Kempston and Interface 2 protocols (selectable)
    • PS/2 port: Mouse with Kempston mode emulation and an external keyboard
    • Special: Multiface functionality for memory access, savegames, cheats etc.
    • Tape support: Mic and Ear ports for tape loading and saving
    • Expansion: Original external bus expansion port and accelerator expansion port
    • Accelerator board (optional): GPU / 1Ghz CPU / 512Mb RAM
    • Network (optional): Wi Fi module
    • Extras: Real Time Clock (optional), internal speaker (optional)
    The question is could Unity ever run on hardware at this level, is Unity modular enough to trim down to a core of components that could run on low spec hardware?

    Could an ILM to CPP to Z80 compilation process be made to work?

    Personally I think Unity should do it, partly for a fun exercise but also I bet it would bring improvements in performance and memory usage to all aspects of Unity, (e.g. super slim WebGL builds) what do you think?
     
    dogzerx2 likes this.
  2. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Here we go, a quality Arowx thread!

    I have no opinion on the matter.
     
    carking1996, FMark92 and hippocoder like this.
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    No. Absolutely impossible.

    No technique, practice or algorithm you could possibly attempt would ever allow unity produce zx-spectrum-compatible builds. modular, ILCPP, whatever -> can't be done, period.

    ZX-Spectrum runs at 3.5 Mhz (Megaherz) clock rate and 32 kilobytes of memory.

    ZX-spectrum also does not really support floating point operations (you can run them at ridiculously low speeds by calling bios subroutines, but you really don't want to), has no real concepts of "file", "thread" or "process", and has no graphic or sound apis.

    So, unity is out of question. You'll have to stick with Z80 assembly and maybe C.

    To put it simply, your have similar chance of getting unity to run on an arithmometer.
     
    zapposh and neoshaman like this.
  4. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Why would you even want it to? Any kind of Middleware engine overhead would be overwhelmingly large anyway
     
    angrypenguin likes this.
  5. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Will Unity build for my Antikythera?
     
    superpig and angrypenguin like this.
  6. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    I demand a builder for Symbian s60 because it's still objectivelly more widely used that spectrum.

    Also with the chip they are using (the Spartan FPGA) they are simulating the Z80 arch. Pretty interesting. But I hope They "bake" it eventually (to it's own dedicated chip), they could even achieve better speeds and I hope they eventually increase memory. I wouldn't limit myself to z80 arch in their place.
     
  7. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,954
    Do you seriously believe anyone who is interested in funding this Kickstarter project has any interests whatsoever in a game engine that is designed to make life easier?
     
    alexzzzz, jc_lvngstn and QFSW like this.
  8. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    To be honest, I'm kinda surprised that this project even exists.

    ZX Spectrums are not that hard to build, and I think there were several alternative projects to make a ZX Spectrum clone, improved or not (some of them loading from flash drive).

    For a small toy computer raspberry pi would be a better choice.
     
    neoshaman likes this.
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,954
    Building one yourself is time consuming though and you're unlikely to have the same range of features that it provides for the cost it's providing them. Additionally with how many they've sold there will be a sizeable community for it.

    http://www.specnext.com/product/zx-spectrum-next-computer/

    Wouldn't be nostalgic.
     
  10. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    I still take time out to play Atic Attack, JSW, and a host of other old Speccy games. Funnily enough, the game-play on these ancient games was often better than on a lot of modern offerings. When you had less to work with, the UX had to be good (with some classic notable exceptions - E.T, Purple Rain, Horace goes Skiing, et al).
     
  11. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Erm. 210 gbp? One of the advanced clones I heard of was at least 50 gbp cheaper. No Wifi on it, though.

    At this price, I think raspberry pi is a better idea, nostalgia or not.
     
  12. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,042
    It's just a toy/nostalgia thing. If someone made a PET, I would totally back it, and buy it. (and probably play with for about an hour and put it on the shelf).

    Here, I made a venn diagram showing the relationship:
    upload_2017-7-17_8-23-40.png

    Honestly, it the whole idea is... dumb. It is so completely illogical and senseless, I surprised anyone would ever even consider it. (or surprised that anyone would say it out loud). Its a toy hardware project for nostalgia, it is not a platform. People are going to play with it use the tools from that era for fun. Using modern tools to develop for misses the point completely.
     
    neoshaman, passerbycmc and Ryiah like this.
  13. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Had to look this one up.
    https://en.wikipedia.org/wiki/Commodore_PET

    Honestly, though, the set of hardware features is odd. Extending spectrum with WIFI, hardware sprites and FM synth ... that's not exaclty nostalgia.
    And if someone wanted to make an amiga clone (https://en.wikipedia.org/wiki/Amiga ), I'm not sure why they would use spectrum as a platform.
    (I worked with Spectrum 48 clone, and remember what the device was capable of).
     
  14. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,042
    I'm guessing the wifi is cheaper and easier than trying to do a modem. The rest is probably just for fun. The target is most likely hardware enthusiasts, not really developers. It's odd and pretty niche.
     
  15. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,954
    zombiegorilla likes this.
  16. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    The idea of these old systems having wifi just tickles me pink. The wifi controller is almost guaranteed to have more power and memory than the rest of the system.
     
    zombiegorilla likes this.
  17. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,042
    Deleted User likes this.
  18. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    You can barely run unity on Rpi, last time I checked it runs on software video driver, I will checked now if they fixed the driver ... you can make a game with no hardware dependency for 60€ units and still have a profit ... the casing, cable, battery and input are the thing that sunk all the cost.
     
  19. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Yeah I agree with @Ryiah the people who are interested in this I just can't see them wanting to use something like Unity. A few might I suppose but for the most part I think they'd want to dig in there and program directly. And they'd want to buy games that were developed that way.

    That is one thing I really am loving about this retro resurgence we've been seeing. These communities are growing. I've noticed some of them have attracted teenagers now who actually bought an old C64 (from eBay or wherever) or other old computers / consoles and are getting into playing and making games on them. That's pretty cool I think!

    I still have it in the back of my head to make a C64 or Amiga game again sometime before I die. lol
     
    quantumsheep and Ryiah like this.
  20. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    However, Raspberry PI is damn suitable for libSDL programming in C++. I recall older models being able to run Quake 3 at FullHD.

    Honestly, I think it should be possible to just stick spectrum emulator into Raspberry and get decent performance - it is at least several hundred times (if not a thousand times) more powerful than spectrum was.
     
    Ryiah likes this.
  21. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    Guys I have an idea for a kickstarter.

    Setting up a village somewhere outback where people have to make everything themselves. work the farms 24/7 just to survive the winter, tooth rot kills you and the only contact with civilization is airliner trails. Also periodical exile of intelligent people so that nothing changes.

    I actually have a friend that wants and strives to live like this (and he gave me this horrible idea), so nostalgia/cave society fetish is there. and market for it would still be bigger than the spectrum clone.
     
    EternalAmbiguity likes this.
  22. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Often developers have harnessed more powerful computers and systems to build games for simpler lower spec hardware. Could Unity be used as a tool to build a ZX Spectrum or C64 game?

    Or could you make a PICO8 style tool in Unity that can port to ZX80 or C64?
     
  23. kengeary

    kengeary

    Joined:
    Jul 26, 2013
    Posts:
    10
    Heck...can we also get a version of Unity for the Amiga ?
     
    xeleh likes this.
  24. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    It could be done. But what you could make would be very limited.
    It wouldn't even be Unity anymore. It would just be some kind of visual/flow chart programming... thing ...that would convert everything into "as highly efficient as possible" Sinclair BASIC. And you will be limited to 128K of code on a very limited instruction set.

    Personally I don't think it would be profitable for unity team to struggle with such implementation.
     
  25. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    If you expect C# scripts to run on this kind of hardware, it isn't happening. The hardware is too weak to support anything required by unity engine.
     
  26. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well we both know C# is capable of making code a cpu that can address 512mb will be able to chew through given the compiler for it is good enough :D It's not really the language that's the problem. Would it be useful? doubtful....
     
  27. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    Better question to ask, who would this be for? The people who want to develop for old hardware like this, are also the ones that would want to use the tools of that time as well. I see no money to be made for unity, definitely not enough to offset the massive cost of doing so. If it was possible, the end result would not even resemble unity anymore.
     
  28. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Dude, do you have some sort of thread quota? Who would want this? Why would we want Unity spending their limited resources and time on this instead of improving what we have?
     
  29. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    spectrum has 48 kilobytes of memory and runs at 3.5 Mhz. You probably won't be able to load zlib in there. It also has amazing quirks like not having backbuffer, filesystem, etc. By modern standard it is a brick.
     
    boxhallowed likes this.
  30. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Edit: I read 512mb not kb! well, yes it's useless then. It can go up to 2.5mb apparently. Maybe something could fit. Maybe.
     
  31. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Unity can't spend any time and resources on this even if they wanted to since it's 100% impossible, which anyone with half a clue should understand. If this was a joke/troll thread, it might be mildly amusing, but as an "idea", it's just sad.

    Probably not, since I expect it's using bank switching. Some computers had more memory than the CPU could address at one time, but you could poke around and make it "see" different banks of RAM.

    --Eric
     
  32. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Like the SNES?
     
  33. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    If they use z80 instruction set the only way they could go above 48k is via bank switching, because z80 could only use 16bit addresses. Putting code into switchable banks is going to be a major pain. I recall dos games doing something similar via *.ovl files, but I suspect they usually used those to load graphics for the game.

    Snes and Amiga had hardware accelerated sprites.
    So, basically, an equivalent of a "sprite" object was implemented on hardware level and was drawn by a specialized chip. That was used in arcades, on amiga, etc. Graphical/musical co-processors were widely used before hardware got more powerful.

    The problem here is that original spectrum had no such hardware helpers. Full software render, at 3.5 mhz. It had three 3d games (elite, hard driving and driller), and those with filled surfaces ran roughly at 0.3...1 fps. Elite was faster, because it used wireframe graphics, but it was still running in a slideshow mode.
     
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah I assumed it would address higher ram when I 'read' 512MB...
     
  35. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    You can probably program a zx spectrum and any 8bits computers emulators with unity and it will run too fast.

    You can make tools to generate tedious code or data in unity to spectrum too.



    There is also a python 3d game implementation on rpi.
     
  36. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Floating points... it couldn't even multiply two integers!
     
    neoshaman, Ryiah and neginfinity like this.
  37. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    This is actually true, and I totally forgot about it. No division and multiplication instructions.
     
    GarBenjamin likes this.
  38. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    It was thanks to the Spectrum that I ended up with a severe itch that took Unity decades to come along and scratch!

    One year in the 1980's one of the Spectrum magazines in the UK did an april fools joke that the young version of me totally fell for. They did a feature on this great new software that would help you to make games, far beyond what the one or two existing 'template based' (to be charitable) game creator apps for the spectrum could manage. It awoke my imagination, and then eventually some weeks or maybe even months later, after failing to find it in the shops, I realised it was not real, and I was very sad about that. Decades passed. I got into Unity, the itch was scratched :) However now we are quite far into this era of accessible game creation tools & engine stuff, despite its presence at the start of my personal story, I do not have any wish to apply the modern game creation concepts to the Spectrum of my childhood :D
     
  39. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Sounds like the C64... bit shifting and addition unless you were a newbie and would loop x times adding y. Self modifying code was common. Lookup tables. Ah the good ole days. ... ok not really for the simple stuff. 8-bit cpu and 16-bit product. Advanced stuff. lol

    It was all fun though. :)
     
    Last edited: Jul 20, 2017
  40. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    I'm wondering how much faster a modern quad-core i5 3.5 GHz is compared to Z80 3.5 MHz.

    Considering the clock rate, number of cycles to execute an average instruction, instruction-level parallelism and multiple cores, is it like ~100,000 times faster?
     
  41. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    It is very hard to do an apple to apple comparison... while the modern hardware has many advances there are also additional layers everything is running through. If you mean literally just the hardware then surely it would be phenomenally faster. If you mean the speed increase the developers / users actually get to use then it would still be much faster but not nearly as much as the raw hardware increase. It was just a different time. Everything was done direct with the hardware not through layers of apis, OS, drivers, etc.
     
  42. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,954
    Just looking at instructions per second, the Z80 @ 4MHz is 0.58 MIPS. The i5-2500K @ 3.3GHz is 83,000 MIPS.

    https://en.wikipedia.org/wiki/Instructions_per_second
     
  43. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    Just consider that speed is typically measured in flops. One's in the teraflops range, while the other, as previously mentioned, is zero.
     
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    100$ for super pixel graphics console, you must be a fan, otherwise this money would be better spend on some Raspberry Pi or some second hand 3DS for example.
     
  45. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,954
    After purchasing the necessary hardware to make a Raspberry Pi useful you've basically spent the same amount. :p
     
  46. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    This should be about right. 100000 to 200000 times, if not more.

    For a practical example you could check one of spectrum's 3d games


    ^^^ That's roughly 1 fps.

    And compare with speed you'd get on software rasterized game (Quake1/Quake2, perhaps?) on a modern CPU.
     
  47. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,954
    Or better yet find an emulator that allows you to disable any artificial slowdowns and run the game on it. :p
     
  48. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Nah, you'll get wrong numbers which will be off at least by an order of magnitude. Z80 CPU will need to be emulated, and there will be still overhead for simulating zx-spectrum screen.
     
  49. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,954
    There are ZX Spectrum emulators that have sufficiently low requirements to pull it off (X128 and YASE). Both of them work on hardware as old as a 386 but recommend a 486. Quake at the very least requires a 486 to be playable but a Pentium was the actual stated requirement.

    http://www.worldofspectrum.org/zxspecticle/emulators.htm
     
  50. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    That's not what I meant. I meant that regardless of how efficient emulator is, it'll need to do extra work to emulate spectrum hardware (redrawing the screen isn't free, especially given spectrum's odd screen data format, and if there's music chip, this is extra overhead), and because of this you'll get skewed results. It'll still be faster than original, much faster, but you'll be missing a zero in speed difference.

    Also, Spectrum didn't have a system clock. Meaning that 3d games with limiter off will be unplayable - you'll just get instantn gameover, or camera will spin few thousand times per second. Games were timed based on clock, same applied to music on 48k model.
     
Thread Status:
Not open for further replies.