X128 W.I.P. Page
DISCLAIMER: I give no guarantees that I will ever implement/complete/release anything on this page.
Latest version: X128 V0.95C (2) Open Alpha (DOS & Windows) (28/02/2014)
My life is very complicated at the moment. The need to care for multiple family members (and tangle with bureaucracy) makes me wonder if I will ever finish a project again. It seems I have reached the phase of my life where dreams must be put aside and I must perform my duties until I am the one who needs to be cared for.
I had promised to help get TZX files working in an MSX emulator. I had planned to add some old Multi code into X128, so I could emulate a simple MSX-1 system and play TZX files. Unfortunately, the Multi code is very old and partially incompatible with the new X128 codebase, so it needs quite a lot of modifications. Still, it would be nice to see it working.
I will concentrate on that for now, when time permits.
A little bit of Macronics FIZ archaeology!
When you look through the old magazines (especially those before 1986), you do find an awful lot of hardware. A fair amount of it has been lost in the mists of time, including a surprising number of third-party disk interfaces.
I have been looking through WoS and various magazine databases and come up with a hypothesis - that the Macronics FIZ has a number of incarnations.
I have come up with a list, based upon various descriptions, such as: using 8K of RAM, the number of files per disk side (39), that it only supports 1 file per track, that it stores 2,816 bytes per track (despite being single-density), UDGs are saved along with BASIC programs, the very unusual BASIC commands and the fact that there is a maximum file size (so they provide a special bit of software that can save the full Spectrum memory, excluding the screen).
|Company||Product Name||Magazine References||ROM Available?||Filename Length||Comment|
|Macronics||FIZ||??.82-12.83||Y||6||Manual (Over 100K storage, 8K RAM used, 2,816 bytes per track, 1 file per track, 39 files, uses f$ in BASIC).|
|Interactive Instruments||Viscount Disk Drive System||02.84-06.84||N||6||8K RAM used, Macronics copyright message, 107K per side and 2,816 bytes per track, 1 file per track, uses f$ in BASIC|
|Primordial Peripherals?||?||08.84?||N||6||"P2L or Primordial Peripherals Ltd. showed me a complicated but impressive system aimed at the small business owner. Priced at £249.95 with a drive unit (£79.95 for the interface) it was fast and efficient, although it needed a bit of study to get to grips with the operating system. It used 2K of RAM for the DOS and a further 6K workspace."|
|Statacom||Datafax Disk System and Datafax Spectrum Disk Interface||09.84-12.84||N||5||"Regular readers of Sinclair User will remember one of the first disc systems for the Spectrum, that from Interactive Instruments - later taken over by Primordial Peripherals. Those that do will immediately feel at home with the Statacom interface." (8K RAM used, 39 files, 1 file per track, 2,816 bytes per track, 107.25K storage, uses f$ in BASIC) and 100K per side. " A special loading procedure allows you to pack in the largest of programs, although you lose the screen display in the process".|
|Servicon Dynamics||Crescent 401||02.85-03.85||N||?||Uses 8K RAM, 100K per side, 39 files per side. "The manual contains a machine code program which allows 48K programs to be loaded and saved".|
|Omnitronix||Pacer Disk Interface||06.85-01.86||N||?||" It is instantly recognisable by users of the Primordial Peripherals and Statacom systems." Early versions are the usual "107.25K, 39 files, 2,816 bytes per track, uses f$ in BASIC", but later models claim up to 400K and support DS and 80 tracks.|
This is a list of disk interfaces that, I believe, may be of one single design. Each device is advertised or reviewed with comments that suggest that they are very similar. It is possible that they may sound similar, by coincidence. In the absence of further information, it is impossible to say whether they all are. There is certainly a clear chain from the Macronics FIZ to the Omnitronix Pacer, based upon the various magazine references and the dates of the magazines as well - they seem to form an order where they never overlap. The Primordial period has no advertising dates (although there is a mention of it in 08.84). The Servicon Dynamics device is only linked by the claims made in the (very few) adverts they placed.
I've been asked to release an updated version of X128 Open Alpha by a few people. Unfortunately, I have limited time to work on it and my brain is useless just now.
There are some big bugs in the code. The Betadisk 48 code has stopped working (again). The FDC code is now merged. Previously, the DISCiPLE/+D and SAM Coupe disk code was handled by a very, very old version of SimCoupe's FDC code. Now it's handled by the normal FDC code (which runs almost everything else, apart from the +3 disk emulation). It works pretty well and allows much more flexibility with disk formats, but is a little less compatible in a small number of cases. It's trying to emulate the whole FDC range from WD1770 to WD2797, so I guess it's bound to happen. I've also come to the conclusion that I'll need to emulate some sort of timing in the FDC, if all of the disk interfaces are ever to work properly. For example, the Swift Disc seems to require the timing gap between sectors, otherwise the NMI routine will keep reading bytes until the end of the track (overflowing its sector buffer and writing into the hardware registers).
I've also been asked to emulate the Logitek Proceed 1 disk interface and the SDI (Spectrum Disk Interface). A reasonable request, as I can't think of anyone else on the planet who is trying to emulate old Spectrum disk interfaces.
Both are interesting devices that let you connect a Commodore 1541 drive to a Spectrum 48K. However, the drive is nearly a computer in itself - a 6502 with ROM, RAM and a serial port. It can be emulated in a much simpler way, though without full compatibility. There are a number of drive types. The 1541, 1571, 1581, FD-2000, FD-4000 and many more older ones to consider...
Finally, I noticed that the Macronics FIZ interface has had its ROM dumped: speccy4ever (not to be confused with the Facebook group of the same name). There's also a circuit diagram and it's remarkable - it has no FDC! It has some circuitry to handle byte reading and writing and everything else is a direct connection to the disk drive!
I have the NMI buttons working (via a hack, each ROM has a slightly different entry point). This enables access to the various DOS versions, which allow you to do everything you want with your disks, as well as load and save snapshots. It looks very powerful, but the FDC isn't being emulated well enough for anything to work.
I can just imagine using this system to put all your games on disk, then playing them all without even having to reset the machine. It must've been pretty luxurious!
Various Swift Disc DOSes
The Sixword Swift Disc is an interesting interface. It looks rather powerful and existed in the same time period as the DISCiPLE, but it seems to be rather rare (I have never seen a screenshot of it running, for example). It has a snapshot button, which is very common, but that button takes you to a DOS system, which isn't common. The first model has 16K ROM and 8K RAM, which is better than the usual "squash everything into the first 16K" technique used by most other interfaces of the time.
There are two versions of it, both have the most unusual ROM banking systems I have ever seen. Additionally, the way the FDC code has been written requires very, very good FDC emulation (which I don't have!). It's a complicated system and there are so many unknowns, that I'm not sure if I'll be able to emulate it properly. I don't even have any disk images for it. In the meantime, this screenshot of a catalogue of "no disk" is as far as I can get.
As much as you can get from the Swift Disc 1!
Denienced part 2? A scandal erupts over ULAplus and modes 3, 5, 7 and 9!
I promised Cesar Hernandez (author of ZEsarUX) that I would include modes 5, 7 and 9. These are like Radastan mode, but with the resolutions 256x96, 128x192 and 256x192. They are implemented in ZEsarUX and a new Spectrum clone - The ZX Prism. I also promised that I'd release a version of X128 including it, but I will have to tidy it up first.
Here is a screenshot!
The highest-resolution Neula
I haven't been able to update much. My mum has mixed dementia and significant mobility problems, which takes a lot of my time and energy.
In the meantime, I noticed "Radastan" mode had been invented as an extension to ULA+ on the new ZX-Uno Spectrum clone. I couldn't resist a quick emulation of it (two hours), although there is probably more to emulate - I don't have the full details. It's a 128x96x16 colour mode, which reminds me of a rather more colourful CoCo/Dragon display. Happy new year!
Images in "Radastan" mode
Thanks to Phill Harvey-Smith for the Kempston Disc 2.0 ROM and a couple of disk images! I now have a partial emulation of the Kempston Disc interface! It can page in the ROM and you can enter commands, however the disks are not detected.
Eugenio Ciceri provided the MF1-KDOS ROM (see the Multiface page for information and pictures for that). He also provided some interesting information... There was a version of the Kempston Disc interface exported to Italy and rebranded as the "Sandy DiscoVers3". It used KDOS 2.1 and had a localised version of the ROM too. I will post more about this later.
Using DOSBOX, I have determined that the DOS version of X128 currently requires 8 MBs of RAM. That's too high for something that's supposed to run on a 486. 4 MBs would be more realistic.
I have added a link to the latest work-in-progress version at the top of the page.
Open Alpha V0.95c includes SPECTRA support. Even the DOS version (it's been a while since I wrote some Intel IA-32 code), but the DOS version is buggy in some other matters (Opus and some other drives don't work, etc).
There's also a bug where you have to reset twice before the SAM Coupe emulation works.
I can now load some of the TZX V1.20 files (no CSW support yet).
Also... behold the latest pics of SPECTRA Blitz by LCD.
Some emulation of the SPECTRA interface video modes. Amongst other things, it allows a choice of higher-resolution attributes and a selection of 64 colours. Some of the video modes are a bit odd, due to the limitations of the hardware itself.
Snake 4x4 Extra Colours
Snake 2x2 Basic Colours
SPECTRA Highest Resolution Basic Colours
SPECTRA Highest Resolution Extra Colours
SPECTRA Image Viewer 4x1 Double Attribute Extra Colours
Vision TR-DOS and DDR CP/M.
Vision TR-DOS (using the Betadisk 48 interface) and CP/M emulation, as used in the former East Germany. The CP/M requires the LEC 80K RAM modification (not quite the same as the larger LEC RAM system I'd emulated earlier) which was popular in some places. All the details were thanks to Porthos, who also did some fabulous testing for me. We exchanged broken EXEs for days on end until I discovered the DirectX bug I had in the code all this time (it thought that any bitmap mode with alpha bits was actually a palettised mode).
Did you know that there was a disk interface in South Africa called Rocky Gush? It was named after its maker. I implemented a partial emulation of it a while back, but I'm having terrible timing troubles with it. It also implements a number of BASIC extensions in it as well (including a 64-column mode), it's a curious interface.
Rocky Gush bootup
OK, clearly I spoke too soon. Further information was found, it is possible to get to BASIC without a bootdisk and I was able to emulate it further than before. Here is a picture of a SpeccyDOS 4.1 directory listing! The boot disk would still be very useful though, as the snapshot button software is installed into RAM from it, so there is no NMI fun yet.
I've been so busy, I haven't had a chance to update this page.
First of all, Watford SPDOS... This buggy picture is the first ever of SPDOS and possibly the last, if a boot disk is never found! SPDOS/KDOS need a boot disk, otherwise they just get stuck and you can't get into BASIC. The normal behaviour is to stick at the dull white screen looking for a drive and disk.
First and last?
Secondly, support for the Opus Discovery and Betadisk 48:
TR-DOS 4.11 is just 8K, while TR-DOS 3.0 is a measly 4K! Note that TR-DOS 3.0 is asking for a password, a feature that was phased out in later versions. Thanks to Velesoft for finding the older Betadisk 48 ROMs.
I have decided to move the Multiface stuff onto a separate page. Hopefully it'll be possible to find some of those missing ROM versions and build up the full list.
Multiface ROM Collection Project
After a little bit of work, it is easy enough to support the "old" Betadisk interface and to support the Opus Discovery by allowing a more complicated byte read routine in my Z80 engine (as much as I want to avoid it though).
The Kempston Disc interface (which was formerly sold as the Watford SPDOS interface) is a much harder job. The system is loaded from the drive when the computer is switched on or reset - it will not go to BASIC if it can't find it. As a result, you can do nothing at all if you don't have a drive and disks! One (uncorrupted) ROM of SpeccyDOS 4.1 is available, but it would also need a disk image (at the minimum) to try and emulate it. (NOTE: It later turned out that SpeccyDOS was unrelated to SPDOS!)
TZX files loaded as TAPs for the first time... will be better when it can do a bit of edge loading mixed in too. The new conversion of Majikazo uses the unofficial instruction "RES 0,(IY+004),A", which I hadn't bothered emulating... there's always one isn't there, so I added that one instruction in place of a proper fix for all those DDCB/FDCB special instructions.
I remembered that I briefly had a Multiface 128 that could save to "hypertape" and Opus Discovery. I got it, but it wouldn't work with my DISCiPLE interface so it had to be sent back. A replacement arrived with a newer ROM which supported the DISCiPLE/+D but lost the hypertape support. So I found the various versions and instructions and looked at the drives they supported...
Multiface ROM Collection Project
An interesting chronological record of support for various devices... There was a huge range of third party storage devices available in the early days and the ones listed here seem to be the most popular of them.
I don't support the Opus Discovery, Wafadrive or Kempston Disk or the older Betadisk it seems to use (the $3C00 entry point version). So, I thought I'd have a quick go at this, although it's far from perfect:
There is a grand total of... one wafadrive cartridge that has been dumped. There's the directory of it up there! I don't think it's a perfect dump, the original would've been on a "16K" wafer, which would've loaded a bit quicker.
I have reintroduced the old beep interpolation, as certain games (using Wham Music Box-style routines) have high-pitched beeps in them. I've also rejigged all the tape loading/saving code so that I can add extra functionality to it (most of which hasn't been done yet). ZX80 "O" file loading/saving, ZX81 "P/81/T81" loading and ZX81 "P/T81" saving implemented, which is a bit pointless as the screen still rolls around like crazy. You can now also read a tape from 16-bit VOCs, 16-bit WAVs, (some) 24-bit WAVs and 32-bit WAVs. Although this is really pointless, just a side-effect of tidying up some routines.
OK, having a lack of time, I've decided to go for an "open alpha", so that anyone can try it out. Please note that this version is far from complete and is probably not much use for the inexperienced Spectrum emulatist. The ZIP contains both DOS and Windows versions, so you can have "fun" trying them out. The text file is probably the best way to find out what's new, but it does waffle on a bit.
X128 V0.95B Open Alpha (DOS & Windows)
The DOS version now supports PS/2 wheel mice for the emulation of the wheeled Kempston mouse! The CuteMouse driver is the only DOS driver capable of supporting the hardware required.
Did you know that sound output under Windows can go up to 192 Khz, 32 bit, stereo (or more if you have a surround sound setup)? Well, so can x128. All those soundchip emulation imperfections can now be heard in far too much detail, in a manner that would require a platinum ear to be able to hear the difference. WAV files can be output in those formats too, some of which can't be played on Windows Media Player and require something like GoldWave instead. The DOS version has been updated to support SB16 16-bit output and 16-bit VOC file output - you love it!
Finally managed to get my Win'98 machine working. X128 Windows runs from double clicking, but not from the command line (windowed or otherwise). It ran normal Spectrum stuff at just about the right side of 100% on the AMD K6-2 400, which is not terrible but could be a lot better.
A slight reduction in available features, as Quazar-produced hardware is off the agenda.
I dug out my old PCs to try the latest version on. The 486 had a flat BIOS battery but was able to run it at about 30%. The AMD K6-2 400 wouldn't boot up at all. I hope the reduction in speed is purely down to emulating too many soundchips at the same time. I'm not an expert with Windows message handlers, but I've finally made one that doesn't use up all the CPU time in a single core, with the benefit that my laptop fan no longer zooms up to top speed.
SAM TAP loading added (takes ages), probably not at the right speed, but the ROM tape loading routines are robust enough to handle it. Also, SID card emulation added to the SAM, no filters and slightly suspect white noise though. I've done a bit of ATM Turbo 2+, but it's not quite ready yet.
Finally, I've fixed up the SAM FDC enough so that Prince of Persia works now!
SAM tape loading
SAM Prince of Persia Title
SAM Prince of Persia
Peeep... ATM Turbo and LEC 528K. The ATM Turbo has a 640x200 mode with 8x1 attributes and a 320x200 mode with one colour per pixel using 16 colours from a palette of 64.
ATM Turbo Menu
ATM Turbo Prince of Persia Title
ATM Turbo Prince of Persia
ATM Turbo Personal Nightmare Demo
ATM Turbo Personal Nightmare Demo
ATM Turbo Personal Nightmare Demo
ATM Turbo Personal Nightmare Demo
LEC CP/M Loading
Peeep... A bit of SAM. The sound and disk controller still need improving.
SAM Manic Miner
ZX81 emulation is a nightmare! I've totally rewritten it, but it still rolls and wobbles all over the place. I've added the "correct" volumes for the AY chip (I think) as well as the YM version. As a bonus, Turbosound AY is now working. The YM2203 FM status register is faked so that demos that use it can be played without freezing (but without the lovely FM sound).
Microdrive support finally added (for IF1 ROM v1 only, though). AMX and AY mouse fixed. Kempston Slave and Atari mouse added. The Windows version does not have proper mouse support yet (not capturing the mouse input) but the buttons and mousewheel do register. Currah Microspeech, Cheetah Sweet Talker, Fuller Orator and DK'Tronics Speech Synthesiser support! My sample set will need to be tidied up a bit though. The hardware menu (F3) now goes to three pages. More flexible number of tracks allowed in TRD files, so Robocop 1024 works.
Peeep... A tiny snippet of the Pentagon 1024SL supported - a 256x192 mode with one colour per pixel using the fixed 16 (15 unique) colour palette.
Borntro 2008 16C
Ball Quest 16C
Ball Quest 16C
Peeep. ULA+ site.
Sgt Helmet ULA+
Sgt Helmet ULA+
C64 converted piccy ULA+
A little bit of news! X128 V0.5 has been ported to the Atari Falcon by Peter Persson! It was shown for the first time at the Nordic Atari Show. It's a bit slow and needs a fast machine, but future versions should have much faster screen rendering.
("Follow the link" to get to the NAS2007 downloads).
Generally, I have been too busy with work to do anything on my projects for several months now. :(
But I have upgraded my 486 to 66 Mhz and 28 MBs! I've also bought a network card for it, so that I can compile on a faster machine and copy it across easily - eBay is good for something. ;)
Some people have been wondering if a new version of X128 will be released. I do want to make a brand new version, I feel that an up-to-date DOS emulator would be very useful for old laptops, etc. Additionally, I do want to make the code more portable, so I want to finish off a Windows version and maybe a console version (still trying to get an N64 version of gcc up and running).
Not a great deal (time constraints). The DOS and Windows projects have been reorganised so that they share as much source as possible. This allows me to write something in one version and be able to compile it straight into the other one.
The Windows version now runs at full frame rate on a P400, although the DOS version has got a bit slower, due to adding support for Covox, Stereo Covox, Soundrive and Specdrum audio (and the more generic mixer code, that has to handle a variable number of channels and convert them down into whatever the output format is).
The DOS version is partially through an attempt to get it to output 16-bit sound (handy when you're mixing 11 channels), but it never quite works... I can get it to sound OK at half-speed or playing half-correct/half-random noise at full speed. Due to the way the new sound code works, I suppose I could actually try and use the proper volumes for the AY chip... maybe.
I just thought I'd say a few words about x128w. It now works (the ZX80 and ZX81 aren't running very well, but they're not running very well in the DOS version either) and with sound! It needs to be a bit faster, as it needs frame 1/2 on a P400. "In-game" the keys are all working fine, but the front end key handling needs more work done to it. I also need to add some fiddly little FE screens that handle some control and video options in a way that I think Windows applications should handle them. (Although I tend to download DOS versions of software, so maybe other emulators have these things implemented already!)
Tests show that it runs under Win'98, but not XP! I don't know why.
I guess I couldn't put it off any longer... The tidying up of the code finally reached a stage where I could start work on the Windows version. It's at the early stages, less than two weeks old.
Not very exciting, but what did you expect?
It looks mostly like the DOS version, but can (optionally) run in a Window. All bit-depths are handled, except for 8-bit palletised on the desktop (which I'll try to fix).
Keyboard input works (needs a bit of debounce to stop the menus from affecting the game), but not joystick or mouse.
Parameters passed in don't work yet. Sound isn't being played, but is still being generated.
It's been a long time since I updated this page...
Anyway, I've added ye-olde VGA text mode (nicked from Z80), which should hopefully allow older machines to get a better frame rate. I tried it on my old 486SX-25 and it did indeed allow me to run at a higher, more playable, frame rate.
The other thing I've done is added support for banked VESA 1.1 modes (yes, I really am going backwards through time). I'd implemented it so that VESA 1.2 drivers would be supported, only to find that my old 486SX-25 only had a VESA 1.1 driver... A bit of modification and (really) slow compiling later, and it was astounding to see that old machine run 640x400, 640x480, 800x600 and 1024x768 resolutions, providing all the usual options that anyone who likes to have fun with shift-F11 will know about. Not very quickly (obviously), but not too bad. Just imagine what it'd be like if I stuck a 486DX2-66 Overdrive chip in it!
One snag is that X128 clearly uses up too much memory. It used to be happy in 640K (many versions ago) but now it looks like it needs roughly 4 or 5 free megabytes of RAM. I must try and reduce it, preferably to run on a 4MB machine (with or without a clean boot).
Oh, one other thing I'm doing is adding ZX81 tape support via VOC files. I've never actually owned a ZX81 (or a decent technical document), so it's not as easy as I thought it would be. There are some beneficial side effects....
Nice, but attempting to load VOCs in ZX81 mode, just shows up the weaknesses of my ZX81 emulation, for the moment.
I didn't think I'd do it, but I did! I changed it to deal with all disk images (internally) as if they were FDIs. This lets FDI, FDD and funny sized TRD files (80T SS, 40T SS, 40T DS) be used as well as the old TRD (80T DS). Although 40 track disks only work if you type "40" into the TR-DOS prompt. TR-DOS thinks that a 40 track disk is in an 80 track drive and automatically compensates by accessing TRACK*2 (which is not what I want in this case)...
I then went a step further, so now SCL and $? (Hobeta) files can be loaded by the automatic creation of a temporary TRD file in the background! So, 5 formats in all, I had to change my file selector to accept more extensions (there is now no limit, I pass it the same double zero terminated string that the Windows load/save dialogue box uses). Until I hear otherwise, that's every "Russian" format catered for.
The WD1793 code can now be used in either x128 or Multi with only 2 lines being changed (one of these is because of x128's old Z80 core and the other is because of a minor incompatibility issue with the Didaktik). When opening a disk, the addresses of get_track and get_data routines are passed to the function, this is what allows most of the portability and the ability to handle any uncompressed format thrown at it (including the MSX's DSK). The drive select/side select/motor/etc bits are made more generic by a cheapo method which really will have to be improved.
General emulation quality of the WD1793 has also been improved slightly, but not enough to get the Refresh demo working or to get round the protection system which is called "ARS PROTECTION" (ahem) in AnyTank (also used, in one form or another, in other demos/mags). Whether the FDI support is really working to it's full capacity is unknown. I don't do anything with the CRC bits and the only two FDI files that I managed to find were quite happy to work after they'd been converted to TRD files. I haven't managed to find any IS-DOS disks yet. "ADS 2.0p" now thinks that disks have 81 tracks instead of an infinite number, so: better, but not perfect.
And I probably shouldn't be calling it the WD1793. WD2793 might be a better name for it.
I have a limited amount of information on this, I know the ports that it uses and I know that it uses the same FDC as the Betadisk interface. I also know it's memory layout and I think I've finally figured out where I should be putting my patches so that it pages in. Unfortunately, all I get is "X Bad Device" error when I try to load a sector. The sector does load, it's just that some flags somewhere make it generate an error in BASIC. I do get the correct "Retry" and "Write Protect" messages when I leave the disk (image) out or write protect it when I attempt to write to it. Mind you, I don't have a D40/D80 disk to insert, so I just use a TR-DOS formatted disk... I have some documents on the disk format and the commands, so I could (...) generate a disk.
It takes ages to load one sector because the interface has the DRQ line attached to the NMI line and my Z80 core only allows NMIs every so often! A good excuse to rewrite the Z80 core... (Hmm, that "rewrite" word again...)
I've found some games in .000 format, but I don't know much about that either. It looks just like the output you'd get by saving to tape, but with an extra byte at the start.
Unfortunately this screenshot doesn't do anything to make this webpage look any less black and white.
Partial emulation - working well in slow mode, dodgy in hi-res games and rolling wildly in fast mode. The grey border is left behind from the file selector (which is still using the Spectrum screen). Some games lock up the emulator...
This is not very useful, it allows you to play Arcadia (which only supports Fuller joystick (and keys)) and you can play Matchday or International Matchday with any joystick! I'll add a "redefine keys" joystick later, except that I'll allow more than one fire button (Gryzor here we come). I'm also wondering whether "DK Australian" is a tongue-in-cheek name....
All this won't fit into an old-style .Z80 snapshot, so..... a new snap format may be required.
Considering (in a really hypothetical way...):
(Please remove the TURKEYSLICES to reply).
(C) James McKay, 2017.