Post subject: ZXHawk - A Sinclair ZX Spectrum Core
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
Behold, the best 8-bit home computer system of the 1980's (at least in my part of the world). It utilises Alyosha's Z80A CPU implementation and emulates the following Sinclair models: * ZX Spectrum 16K * ZX Spectrum 48K/+ * ZX Spectrum 128K * ZX Spectrum +2 * ZX Spectrum +2a * ZX Spectrum +3 Latest release version: in Bizhawk 2.3.0 Latest dev version: https://ci.appveyor.com/project/zeromus/bizhawk-udexo/build/artifacts Features: * Emulates the Sinclair ZX Spectrum 16k, 48k, 128k, +2, +2A & +3 * Accurate Z80A implementation * Precise screen timing, floating bus, memory contention and port contention for all models * Full keyboard emulation * Kempston, Cursor and Sinclair joysticks emulated * Full beeper and AY-3-3912 sound emulation * Tape device (datacorder) emulation * Internal 3" disk drive emulation (found in the +3 model) * Currently supports the following tape image formats: *.tzx, *.tap, *.pzx, *.csw, *.wav * Currently supports the following disk image formats (+3 only): *.dsk * Fully integrated into the Bizhawk ecosystem * See the ZXSpectrum menu for all available configuration options Firmware ZXHawk ships with the official ZX Spectrum ROMs embedded (licensed by Amstrad). Amstrad have kindly given their permission for the redistribution of their copyrighted material but retain that copyright http://www.worldofspectrum.org/permits/amstrad-roms.txt How to I run a game? By default the 'Auto-Load tape' option is ON. This means ZXHawk will start and stop the tape device when needed during load or multi-load periods. You still have to put the spectrum in 'load' mode though... The 128K emulated models all come with a start menu embedded in the system ROM. So loading a tape is easy. Just press 'Enter' once the core has started up. For the 48K/16K machines you just get dumped to a BASIC prompt. In order to go into tape mode here, you need to enter 'load ""[enter]'. Because a BASIC keyword is assigned to every key on the 48K keyboard (and there is no inverted comma key), you actually have to type this (with default bizhawk bindings): J CTRL-P CTRL-P [ENTER] The tape should then auto-load. Any questions/issues, either post here or open an issue on the github issue tracker. Thanks! -Asni
Alyosha
He/Him
Editor, Expert player (3522)
Joined: 11/30/2014
Posts: 2728
Location: US
Hurray new core! I consider this a pretty big advancement for BizHawk, it's not very often that a totally new system becomes available for TASing written from the ground up. The Spectrum also uses the z80 much more extensively, and has much more rigorous hardware testing programs available then SMS or colecovision. So along with the new system core it can be used to push the z80 core to be a truly cycle accurate core in pretty much all respects. (but that's a little way off still.) Great work putting this together Asnivor!
Joined: 7/17/2012
Posts: 530
Location: Switzerland
Great to see ZX Spectrum support! Now all that's missing is the integration of WinUAE, a CPC core and a few other machines! :D How exactly does it work? What bios/firmwire do we need? How to launch a game in.zip or.tap format? How long can we expect to load a tape, +/- like a C64 tape? Between 2 and 15 minutes? Which parameters (core, joystick and non-sync) are recommended? Will other formats like .z80 and.sna be supported in the future? Sorry for these basic questions, I think the only ZX Spectrum emulator I tried was Spectaculator or Fuse, a long time ago. Excellent work Asnivor anyway! I won't forget to test all this in the next few days!
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
phoenix1291 wrote:
Great to see ZX Spectrum support! Now all that's missing is the integration of WinUAE, a CPC core and a few other machines! :D
That would be nice :) Right, let me try and answer some of these questions. * What bios/firmwire do we need? You don't. All the system ROM images are embedded in BizHawk. Amstrad many years ago allowed the distribution (for the purposes of non-commercial emulation) of the Sinclair ROMs that they purchased back in the '80s. * How to launch a game in.zip or.tap format? Just open your *.tap, *.tzx or *.zip (containing either of the first two types) in bizhawk. Both file types are automatically detected as Spectrum tapes based on headers. The core will then open automatically. You can even use the multi-disk-bundler tool (or whatever its called) to load sets of tapes (or tape sides in). There are configurable controls for switching between tapes in-emulator. * How exactly does it work? Open your game. By default ZXHawk starts up emulating a 48K machine (this can be changed in the ZX Spectrum menu > Core Emulation Settings ). Configure Controllers as usual - Joystick1 and default keyboard mappings are already setup but you might want to change them. Then just load a game. On the 16k/48k models this is achieved by the command: Load "" [enter] But the early model spectrums had each key assigned to a BASIC command, so you actually have to type: J Ctrl-P Ctrl-P [enter] On the 128k and up models you just press [enter] on the Tape Loader menu option. By default ZXHawk is setup to Auto-load tapes once a CPU tape-trap is detected (although this can be reverted to manual loading in the settings - there is a tab under controller settings for the Datacorder device where you can configure manual controls). * How long can we expect to load a tape, +/- like a C64 tape? Between 2 and 15 minutes? As always it depends on the game. Typically it is similar to the C64 at realtime speeds. 2 to 15 minutes. But the core actually seems pretty fast. So you can disable Clock or Audio throttle under the config > speed/skip during tape loading and the tape should load pretty quickly (I was seeing a hefty jump from the PAL 50fps to about 350fps on my 4 year old i5 at home). * Which parameters (core, joystick and non-sync) are recommended? I usually favour the 128k or +2 (for the games that support the AY PSG and allow you to load the whole tape into memory at once rather than using multi-load). You may find that some old 48k games have compatibility issues though and you will have to use the 48k core (or find a re-release of the game). You can probably stick with the defaults for everything else (by default Kempston joystick is assigned to Joystick 1). * Will other formats like .z80 and.sna be supported in the future? This is a possibility I guess. Although I imagine it would need to be strictly implemented only when DeterministicEmulation is set to FALSE. * Sorry for these basic questions, I think the only ZX Spectrum emulator I tried was Spectaculator or Fuse, a long time ago. Not a problem. Hope you get on OK with it! Thanks, -Asni
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11267
Location: RU
Please add the dev build link to the OP, yelling that it's where you get the latest dev build. This matter is always so confusing that it's the best to highlight it as hard as you can.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 7/17/2012
Posts: 530
Location: Switzerland
Wow, thanks for all the information! I still have some questions (and probably others later, yes, I'm very annoying:D) For example, R-type load well, but after loading and everything, you have to rewind side 2, how do you do that? (R-Type (1988)(Electric Dreams Software).tzx MDR: 2096D83692994086A98E1E5856C477FF) 128k seems to be a good option:) (with 128, it loads The Adams Family (MD5: F455C8D696A95A2DCAC143178EAF36F0), whereas it doesn't seem to be the case with 128Plus3, like what, more it's not always better:D) It may be complicated (or useless) but, would it be possible to have a recall of the machine used here (or somewhere else), for exemple?
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
phoenix1291 wrote:
Wow, thanks for all the information! I still have some questions (and probably others later, yes, I'm very annoying:D) For example, R-type load well, but after loading and everything, you have to rewind side 2, how do you do that? (R-Type (1988)(Electric Dreams Software).tzx MDR: 2096D83692994086A98E1E5856C477FF)
A lot of tzx files will come in a zip that has 2 tzx files in it (sides 1 & 2). You have to use the multi-disk bundler to create a '2-tape' object to pass to the core. Then under controller settings you can change the 'next tape' and 'previous tape' buttons to switch between tapes.
phoenix1291 wrote:
128k seems to be a good option:) (with 128, it loads The Adams Family (MD5: F455C8D696A95A2DCAC143178EAF36F0), whereas it doesn't seem to be the case with 128Plus3, like what, more it's not always better:D)
Yes. 128k (iirc) should load all the r-type levels in one go as well. the +3 always had some compatibility issues with certain games anyway. It featured a completely new memory paging system.
phoenix1291 wrote:
It may be complicated (or useless) but, would it be possible to have a recall of the machine used here (or somewhere else), for exemple?
Thats a great idea. I should look into whether that is possible.
Joined: 7/17/2012
Posts: 530
Location: Switzerland
Asnivor wrote:
A lot of tzx files will come in a zip that has 2 tzx files in it (sides 1 & 2). You have to use the multi-disk bundler to create a '2-tape' object to pass to the core.
Ah, I only have one tzx file, even in my ZX Spectrum zip games folder, there seems to be only one tzx or sna file, I don't know exactly anymore but it's supposed to be "good dump". Maybe I should take another source. Is there a reliable site for game information? If they are in 1 or 2 sides, with which version of the ZX Spectrum are they most compatible, etc? "A bit like it exists for MSX", for example, http://www.generation-msx.nl/ under "software"? Maybe worldofspectrum? Sorry, I don't know much about the ZX Spectrum, and I know it's a pride of England :)
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
phoenix1291 wrote:
Asnivor wrote:
A lot of tzx files will come in a zip that has 2 tzx files in it (sides 1 & 2). You have to use the multi-disk bundler to create a '2-tape' object to pass to the core.
Ah, I only have one tzx file, even in my ZX Spectrum zip games folder, there seems to be only one tzx or sna file, I don't know exactly anymore but it's supposed to be "good dump". Maybe I should take another source. Is there a reliable site for game information? If they are in 1 or 2 sides, with which version of the ZX Spectrum are they most compatible, etc? "A bit like it exists for MSX", for example, http://www.generation-msx.nl/ under "software"? Maybe worldofspectrum? Sorry, I don't know much about the ZX Spectrum, and I know it's a pride of England :)
World of spectrum is the go-to place. Unfortunately though (presumably) iREM denied distribution at some point: http://www.worldofspectrum.org/infoseekid.cgi?id=0004256 Looking through my TOSEC collection, even they have only side-A for most of the tzx releases (presumably the result of WoS and the TZXVault not distributing - they did most of the tzx dumps over the years). Their *.tap version of the game does include the multi-load levels as a part of the same file. Auto-tape traps are not detected though for some reason, so you have to do all the tape work manually. I'll PM you later and take a look at these traps.
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
Auto-tape traps are now fixed in the latest dev build: https://ci.appveyor.com/project/zeromus/bizhawk-udexo/build/artifacts
Joined: 7/17/2012
Posts: 530
Location: Switzerland
So the roms on World of spectrum are distributed with the agreement of the rights holders? Or like many websites, they are distributed until a rightful claimant asks to remove the files? Yes, I also have the TOSEC pack. I found a version of R-Type with both tzx files in a pack named "ZX Spectrum - Super Collection 2011 - Arcade Games #-Z". Everything worked very well (I used the 128k), I mounted both files with the Multi-Disk bundler and launched the xml file. After each level, it searches for the next level and once found, loads it, and then I must manually validate to go to the next level. I used the rewind function a bit and the savestates a bit, and everything went well during the playback of the movie file. On the other hand, f*ck, the loading times take 3/4 of the video, if not more:D I used this version of BizHawk Link to video And I just saw your private message, thank you! I post the hotkeys here, it might help the others too: F10 - Flashes an OSD message up about the tape device (whether it's playing or not, block number, position in the current block etc..) F5 & F6 - Insert Previous or Next tape into the tape device (useful if you have used the multi-disk bundler method) F7 & F8 - Skip to previous or next block on the current tape F1 - Start the tape manually (only really useful when autotape loading is off) F2 - Stop the tape manually (only really useful when autotape loading is off) F3 - Rewinds the current tape to the beginning Thanks again for all this information! I'll test with the file you sent me. And yes, I saw on appveyor that you had made changes again, I would follow that closely. Is it common to find roms that contain both sides directly in one file? Thank you for all your work!
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
phoenix1291 wrote:
So the roms on World of spectrum are distributed with the agreement of the rights holders? Or like many websites, they are distributed until a rightful claimant asks to remove the files?
Yeah, the original people who started WoS made a point of contacting sofware houses or individuals to obtain permission or denial. Everything got put up unless a denial was received.
phoenix1291 wrote:
After each level, it searches for the next level and once found, loads it, and then I must manually validate to go to the next level. I used the rewind function a bit and the savestates a bit, and everything went well during the playback of the movie file.
Cool. That rumbling sound that you can hear in the back whilst playing. I believe that is the tape device playing in the background as it did not auto-stop. This should now be resolved in the latest dev release (let me know if it isnt).
phoenix1291 wrote:
Is it common to find roms that contain both sides directly in one file?
Kind of. When spectrum emulation first graduated past using memory snapshot files for games, they started using *.tap tape images. *.tap files are limited because they can only contain a "standard data block" data, and dont have accurate post-block pause information. They can also be concatenated easily (hence why some old tap files have more than one tape side per file). The TZX format was developed later on. This has a whole different range of data block formats it supports, as well as (potentially) accurate timing information for each tape. It should support any spectrum tape and pretty much any fancy loading/protection scheme. If you can find it, a *.tzx file or files is usually the best way to go as it is supposed to represent an accurate copy of the source tape. Thanks, -Asni
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
Oh, and thanks for making a video! This is not something I have ever done before so was waiting for other folks to test this :)
Joined: 7/17/2012
Posts: 530
Location: Switzerland
Asnivor wrote:
Yeah, the original people who started WoS made a point of contacting sofware houses or individuals to obtain permission or denial. Everything got put up unless a denial was received.
Ah, nice!
Asnivor wrote:
That rumbling sound that you can hear in the back whilst playing. I believe that is the tape device playing in the background as it did not auto-stop. This should now be resolved in the latest dev release (let me know if it isnt).
Okay, thank you! I'll test and tell you again!
Asnivor wrote:
Kind of. When spectrum emulation first graduated past using memory snapshot files for games, they started using *.tap tape images. *.tap files are limited because they can only contain a "standard data block" data, and dont have accurate post-block pause information. They can also be concatenated easily (hence why some old tap files have more than one tape side per file). The TZX format was developed later on. This has a whole different range of data block formats it supports, as well as (potentially) accurate timing information for each tape. It should support any spectrum tape and pretty much any fancy loading/protection scheme. If you can find it, a *.tzx file or files is usually the best way to go as it is supposed to represent an accurate copy of the source tape.
Thank you for these clarifications! In terms of loading and other, are the two file types the same? I downloaded the latest revision, Out Run which didn't seem to launch on the previous version that I had work very well now! However, I have a small problem, at 100% speed with this version I am at ~25fps, while with the old version I was at normal speed. I don't know if it's because my computer is too old and not in good condition, if it's because of the fact that I have 50'000 things open, between files, software etc, or if it really comes from emulation...
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
phoenix1291 wrote:
Thank you for these clarifications! In terms of loading and other, are the two file types the same?
Pretty much. Some of the turbo or speedloading schemes present in tzx files can be faster loading.
phoenix1291 wrote:
However, I have a small problem, at 100% speed with this version I am at ~25fps, while with the old version I was at normal speed. I don't know if it's because my computer is too old and not in good condition, if it's because of the fact that I have 50'000 things open, between files, software etc, or if it really comes from emulation...
Thats odd. If you havent accidentally decreased the speed to 50% (by hitting the minus key for example) then I would say you probably need a reboot. On the latest dev build i'm hitting pretty decent unclocked framerates on my old i5: https://i.imgur.com/Rwet9Id.png
Joined: 7/17/2012
Posts: 530
Location: Switzerland
Asnivor wrote:
Pretty much. Some of the turbo or speedloading schemes present in tzx files can be faster loading.
ok, thanks! For speed, it's probably a version issue, I guess. Out Run (1988)(Kixx)[re-release].tzx MD5: FD37F0510C4A263D9F05994D443F1DA5 Speed set to 100% = ~20-25fps Out Run (1988)(US Gold)(128k).tzx MD5: 0B09E4CEC90EB60A152DE7DC61285E63 Speed set to 100% = ~25-30fps Out Run (1990)(Erbe Software)[re-release].xml Out Run (1990)(Erbe Software)[re-release](Side A).tzx MD5: E209CDBD090911FAAA03483EF8459037 Out Run (1990)(Erbe Software)[re-release](Side B).tzx MD5: DE380A5A7CF8A1D09B7E10809BBA62B9 Speed set to 100% = 50fps Don't know why...
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
Hmm, that's really weird, I cannot replicate it on my machine, and have no idea what would cause that. Sorry :( If you go into Config > Speed/Skip and enable 'unthrottled' what happens between those different outrun versions you posted?
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
Also, looks like there are still tape trap issues with outrun. I'll look at that again today.
Joined: 7/17/2012
Posts: 530
Location: Switzerland
Asnivor wrote:
If you go into Config > Speed/Skip and enable 'unthrottled' what happens between those different outrun versions you posted?
With 'unthrottled' enabled, it remains the same speed as posted previously, more or less Well, I must say that I have an old laptop that is no longer in very good condition too... That's why I don't know if it's a problem with my computer, the version of the game, maybe, or the emulation. But after all, it works, and that's the main thing:) But it's amazing that depending on the version of the game it goes from single to double.
Asnivor wrote:
Also, looks like there are still tape trap issues with outrun. I'll look at that again today.
Thanks for your amazing work! I will be testing other games in the next few days as well.
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
phoenix1291 wrote:
Asnivor wrote:
Well, I must say that I have an old laptop that is no longer in very good condition too... That's why I don't know if it's a problem with my computer, the version of the game, maybe, or the emulation. But after all, it works, and that's the main thing:) But it's amazing that depending on the version of the game it goes from single to double.
It's probably a lot to do with your old laptop. Maybe DirectX vs GDI++. That kind of thing. The 48k emulated model doesnt have the AY-3-8912 chip present, so on an old machine you might see a performance benefit using that rather than 128k machine. But obviously you lose the 128k benefits. Different versions of the same game can potentially be very different in how they are structured I guess. Different loading schemes, more (or less) z80 IN instructions per frame. What is actually more likely (thinking about it), is that because the tape trap issue isnt solved, the tape device is playing away (almost) silently in the background whilst you are playing. Performance-wise this is probably unnoticeable on a newer machine, but its not inconceivable that you would notice on an old laptop. If I dont have a new dev build out that fixes the tape trap issue by the time you next test, try hitting the F2 key when outrun shows the title screen (once the initial load has completed). This will manually stop the tape. I would be interested to see if this has an affect on framerate. Thanks, -Asni
Joined: 7/17/2012
Posts: 530
Location: Switzerland
I use of course DirexctX and not GDI++ My computer is old and not in good shape, but I guess that's enough to run a ZX Spectrum emulator correctly. I have a GeForce GT 630M with 2 Go memory chip I'll try the same Outrun versions as before with the 48k model instead of the 128k to see if it makes a difference. I will also test with the F2 key. Thanks again!
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
phoenix1291 wrote:
I'll try the same Outrun versions as before with the 48k model instead of the 128k to see if it makes a difference. I will also test with the F2 key. Thanks again!
So I *think* the tape trap stuff is finally working now in the latest dev build: https://ci.appveyor.com/project/zeromus/bizhawk-udexo/build/artifacts This should means you shouldnt need to touch F1 or F2 at all. The 128k Outrun AY music is actually quite nice, so I would always go for that instead if given the option :) Your computer specs don't actually look that bad. Try with the latest build and see if it improves anything (maybe I did something silly with an earlier build). Thanks, -Asni
Joined: 7/17/2012
Posts: 530
Location: Switzerland
Yes, I saw that you still made some modifications on appveyor, and thank you! I guess I'll just keep using the 128k. The next games I'll try are Out Run, of course, but also Moon Patrol (yes, I love this game, which is quite basic though:D) Road Fighter, Commando, River Raid, Green Beret, Ikari warriors and Power Drift. (arcade classics, yes, it's not that risky) Once I'm a little familiar with the ZX Spetrum, I'll try other games a little more... unknown.... I don't know if you have any recommendations, because the top 10 or whatever always quote the same games.
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Asnivor
He/Him
Editor
Joined: 11/27/2017
Posts: 86
Location: United Kingdom
phoenix1291 wrote:
I don't know if you have any recommendations, because the top 10 or whatever always quote the same games.
Depends on what kind of games you are in to :) The YourSinclair readers top 100 had quite a few of the old classics for the system: http://www.worldofspectrum.org/ystop100.html My personal top 10 though (in no particular order) are: Rebelstar II Chaos Colony Way of the Exploding Fist Target Renegade Renegade Death Wish 3 Fantasy World Dizzy Super Robin Hood Elite I was never a massive fan of all the coin-op conversions (although some of them were very good) :)
Joined: 7/17/2012
Posts: 530
Location: Switzerland
Thanks for the link! It's true that in video or for a more personal use the kind of games are not necessarily the same, an rts in video, it's quickly boring, for example. In your list, I only know Chaos, Renegade and Elite, I think. Good, that makes me a lot of games to discover:) I'll post the videos of the games I tried here. I think a trained eye and ear, like yours, will detect if there is a problem in the video or audio emulation, which I would be unable to do on this machine.
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291