December 27, 2013
i hope you had some nice christmas holidays and that you are looking forward to a smooth transition to a happy next year.
The next version of zxsp is delayed:
A friend of mine has had an apoplectic stroke and is only very slowly recovering recently, left half of body eventually remaining paralyzed. He's not the guy who had many friends, so every friend is important now and i visit him every day in hospital. This currently consumes most of my spare time and i have worked only little on zxsp. But with a little luck i'll at least release a new version which fixes tape i/o related errors in the TS2068 emulation within this year.
Wish me luck,
and wish him luck!
... Kio !
November 25, 2013
Keep zxsp Running and Collect Karma Points
i have added my Bitcoin wallet as a method for donations. I'm pretty new to this stuff, but i think i have done it right. If you have a wallet on your smartphone then you can scan the QR code, else click on the Bitcoin link or copy&paste my Bitcoin address into your wallet app.
What are your donations for? Besides of cheering me up and encouraging me to keep on working on zxsp, i will probably use them to get a paid Apple developer account which is US$99 per annum. It is required to put an app – free, free to play, or paid – in Apple's app store (plus 30% of any revenue).
With Mavericks they have tightened the screws once more: Now developers must register, or OSX will refuse to start their application unless the user has expressively allowed installation from any source. So i have considered to pay US$99 per year now, just to give away zxsp for free.
So, what are your donations for? Mostly for Apple, probably. :-/
... Kio !
If you have a Bitcoin wallet on your smartphone use the QR code to the left, else click on this link: 1BJ9kY9qm7Mg2UKj9eZxPyK42mzkqe1LKf or copy&paste the link into your wallet application. If you have a Litecoin wallet on your smartphone use the QR code to the right, or click on the link: LZtPuXCwjM11XKEexrdArGmNSqXPjzmXCP or copy&paste the link into your wallet application.
You can also donate with PayPal:
Add a comment which feature you'd like to see next or just say thank you. :-)
Donations will be used to cheer me up and keep me working on zxsp.
November 23, 2013
and on it goes: 3 new models added! Ok, basically it's only one model which comes in 3 flavours:
The Timex Sinclair 2068 Family
- The Timex Sinclair 2068 (USA)
- The Timex Computer 2068 (Portugal)
- The unipolbrit 2086 (Poland)
The US version runs with 60 Hz, the European variants with 50 Hz frame rate.
The Polish version had only one joystick port, the right port was replaced by a parallel "Centromix" port. But, *wonder*wonder*, *my* U2086 had 2 joystick ports! So currently the U2086 is also emulated with 2 joystick ports and no parallel printer port. I currently don't know of any software using the printer port anyway. Even the precise usage of some control pins are still discussed.
|TCC dock inspector|
Note: if someone has games or demos which use the AY sound chip and joysticks of these machines could he please be so kind and send me a copy? Thanks in advance!
Some people say that the "86" in unipolbrit 2086 is not a spelling error but a pun on 8086 or an indication of the year of release – but then "Centromix" is probably no spelling error either... B-)
Update: Instant load tape files is currently broken on these machines. You must disable instant tape loading and load them in realtime. This will be fixed in the next release.
Other ChangesI have added recent-files menus to the SPECTRA and Sinclair Interface II inspector as well to the Dock inspector. Inserting a rom now also adds it to the global "recent files" list as well so that CMD-R reloads it.
The TK95 got a rear-side joystick connector image and a real photo of the keyboard – not sure whether this is an improvement thou.
November 1, 2013
bad news: i can't make up my mind for a picture. A blog post without a photo? – wait – there will be one, at the end of the post, maybe. :-)
New in this version:
misc. old stuff"misc." consists of the following:
Video Beam Indicator
Load assembler source
Load .rom and .scr files
Load .tap and .dsk files
Loading a tape like a snapshot vs. inserting a tape into the tape recorder
Tapes and disks are no snapshots. They contain the data of their respective represented media. When you double-click or open a tape or disk file with "open file", then zxsp secretly loads a snapshot which was saved at a point where it started to load a program from tape or disk and inserts the requested tape or disk into the respective drive. Additionally, it sets the tape recorder to instant-load. The result is, that it looks like zxsp is loading the tape or disk like a snapshot, though you now know it isn't.
This is a convenience feature, though. Normally you should launch the desired model, insert the tape into the tape recorder (or the disk into the disk drive) and type LOAD "" or similar. Then you get back more of the original feeling. You can select instant-load and auto-start-stop the tape here as well.
Load .tap files into the Jupiter Ace
You may not know it, but the Jupiter Ace had no load tape command with wildcard and it had no auto-start feature. So zxsp takes some effort to supply the tape loader snapshot with the required name. But it does not know which command is required to start the game or to load subsequent data blocks. Once the first dictionary is loaded you are alone. You may open the tape recorder and wind the tape fore and back to see the names of following blocks, but you'll have to pick the info on how to load them and how to start the game from it's documentation.
Display parameters for the b&w Ulas
Select 50 Hz or 60 Hz model for the TK clones
An image, an image ...
October 18, 2013
|Using Lenslok to decode the scrambled pattern|
This brings Lenslok support to the ZX Spectrum models and clones.
The Lenslok can be found in the Extensions menu. Drag it over the screen, follow the instructions to adjust the width of the 'H', click on the Lenslok to rotate it (and fold the hinges, but that's hard to see ;-) ) adjust position, type in the code and you are in! :-)) Click outside the Lenslok to dismiss it.
It works much better than the original device! If it was like that it'd had been fun to use. :-)
The virtual Lenslok has a tiny bit of magic built in to select the proper version for the current game, but in case the magic fails you can select the right game from the context menu of the lens.
October 10, 2013
|Timex Sinclair TS2020|
Jupiter AceSome errors in handling .tap files for Jupiter Ace have been eliminated. .tap files can be 'instant loaded' now. .ace snapshots can be loaded and saved. I have included 'WORMS' from the Jupiter Cantab demonstration tape in this release. A tiny game, just to show it works. To load it, type load worms get graphics game. There is no wildcard load and no auto-start on the Jupiter Ace!
Timex Sinclair TS2020The b&w machines now use a TS2020 for their tape recorder. Not sure whether i should also use it for all other machines as well, except for those with built-in tape recorder. What's your opinion?
As with the +2 / +2A recorder, the pause button is used in conjunction with wind and rewind to auto-stop at block boundaries.
All tape recordersI have added sound effects to the tape recorders. I hope you like it. :-)
I have also added new menu entries to the context menu, including a 'recent tapes...' menu.
New Qt versionThis is the first release which uses Qt 5.x. This enables me to send bug reports for the current version. B-) The only visible difference (to my knowing) is the superfluous animation when starting/leaving full screen mode.
September 10, 2013
zxsp 0.8.0pre18 is out now!
New supported machines in zxsp:ZX Spectrum +3 English and Spanish version.
|ZX Spectrum +3 disc drive|
*) The FDC in my +3 is a Zilog Z0765A.
Supported file format is currently .dsk only, others will follow in the next release.
The disc drive is the first item with sound effects! :-) I had a hard time making recordings of the various sounds. I have at least 10 microphones at home (telephone, cellphone, iPad, iMac, even ZX Spectrum recording hardware) but nothing really good or in working order. I finally resorted to the recordings i made with my iPad except for the stepping noise, which is 'hand crafted'.
In the floppy disc controller window you can insert and eject the disc by clicking on the slot or the eject button. The context menu provides options for creation of new discs and access to recently used discs.
Discs can be flipped side B up by clicking on the "B" label. You probably have to format most discs on this side before you can use it. This is done in Basic with:
where "A:" is the drive, not the side. ;-)
Discs can and probably should mostly be write protected. This can be checked and toggled in the context menu, when a disc is "inserted" or "ejected". (The "ejected" state is as shown in the above image.) The write protection state is simply the write protection state of the disc file.
If you double-click a .dsk file it will mostly open in a ZX Spectrum +3, except if your default machine or the currently open machine is a Spanish +3.
Please test the +3 disc emulation and report any problems. (or whether it works for you.)
... Kio !
July 16, 2013
Kio's backup daemon
It is now feature-complete and most bugs are eliminated so i think i can offer it for testing to others. If you feel awkward when you think of your backup and the 'worst case', then it may well be worth a try.
- console application, no GUI. You can make it auto-start whenever you login and hide it in the dock.
- Backup: synchronize a remote directory with your local directory in regular intervals.
- File transfer: maintain 'push' and 'pull' folders for automatic transfer of files between you to your friend(s).
- Encrypted connection, backups are stored encrypted, file and directory names are encrypted as well.
- Upload speed limiter.
- Daily snapshots of backups, except if hard links are not supported. (mostly NAS)
- Include and exclude files or subdirectories from uploading.
- Upload to a peer over the internet
- Synchronize a backup folder locally, e.g. a DropBox folder, NAS or external drive.
- a domain name. Use any dynamic name service you like.
- an open port, forwarded by your router, if any.
- a friend
- WebDAV shares.
Behavior of sync type "backup"
In this mode the daemon tries to synchronize a local directory with a remote directory. Files which vanished remotely are deleted locally too, modified files or new files are downloaded. Once per day a snapshot is created which contains hard-linked files to other snapshots and the current backup, therefore using only very little additional space on the disk. Files which vanished are moved to the last snapshot if no previous copy exists.
This works well with local disks, but not so good with Network Attached Storage 'NAS', because within the last ten years Apple did not find the time to add a 'hard link' command to the Apple File Protocol 'AFP'. So basically, this does not work with NAS. In this case the backup daemon still creates snapshot directories, but they will only contain the deleted files. Just in case that you need to recreate them.
You can circumvent this problem in the same way as Time Machine does: With Apple's DiskUtility create a SparseImage on the NAS and mount this image locally. Determine the mount point and use this path for your backup destination.
Currently 'backup' folders are polled every 12 hours.
Behavior of sync type "push" / "pull"
In this mode the daemon downloads all new files i finds in the remote folder. Once download is complete, the file is added to a done list which is stored in "~/.backup_daemon/NAME.done".
So you can remove the file from the receiving folder without triggering a second download of this file.
Files which vanish remotely are not deleted locally, so the sender can remove his files at some point as well.
Currently 'pull' folders are polled ever 30 minutes.
Command line arguments
While the daemon can be started just 'as is', it may be started with one of two command arguments as well:
's' (single character 's'): Only the server is started.
'c' (single character 'c'): Only the clients are started.
This can be used to start 2 instances which can be debugged or stopped independently.
Settings in ~/.backup_daemon/config.txt
All changes to the config file only take effect when the backup daemon starts. So if you update something here you must stop and restart the daemon. For an example also see ~/.backup_daemon/config.txt.
verbose : NUMBER
Defines how much log output will be produced.
Possible values are: 0 (nearly none) to 4 (each file transferred produces a log line)
upload_speed : NUMBER
Defines a speed limit for sent data. Setting this to 0 disables the limit.
The speed is set in bits per second and may be followed by a unit 'k' or 'M'.
For a typical ADSL connection with 1500 kbit/sec upload speed this might be set to 1000k.
Defines how many client workers are created. 'clients' handle the receive side of a connection. 4 clients are recommended.
Define how many servers are started at most. A server handles the send side of a connection. They are created whenever a client connect to this daemon. If more than N clients try to connect at the same time, only N connections are granted and the others are rejected and will retry later. There should be at least 10 servers allowed.
self : n=MY_NAME : h=MY_ADDRESS : p=MY_SERVER_PORT : secret="MY_LOGIN_SECRET"
Defines some settings concerning your own computer.
MY_NAME is your nickname. Any client connecting to you will check this name.
MY_ADDRESS is your static IP address or your static or dynamic server name. Remote clients must know this address to connect to your server.
- x="" excludes all files
- x="." excludes all hidden files in the root level of this push folder.
- x="aa" excludes all files starting with "aa"
- x="a/bb" excludes all files starting with "bb" in folder "a"
- x="*.txt" excludes all files in all folders which end on ".txt"
- x="" i="Documents" excludes everything except (probably) folder "Documents"
- i="photos" x="photos/private" exports all 'photos' except (probably) folder 'photos/private'
Restore from a backup
What to do when the worst case happens and you need your data back from your friend?
- Stop your backup daemon and ask your friend to stop his backup daemon.
- Ask your friend to replace the backup pull job by a push job with identical settings, except the path must be extended with "/current_backup".
- Replace your backup push job by a pull job with identical settings, except you might want to change the destination path.
- Start your backup daemon and ask your friend to do the same.
- Add the backup daemon as a start item to your login profile.
- You can test that restoring your backup will work if your friend also adds a push job for the backup folder and you a pull job to a temp directory, eventually with an include/exclude filter.
sometimes things don't work, it's not your fault and you cannot fix it. And sometimes this comes in close succession. So here is my 2nd annual rant for this year:
I'm working on a backup daemon, because i'd like to have a copy of important data outside of my home, just in case. As usual this takes some days until it works, i make local tests and fix bugs and try to move the software to a good state. Then tests with a connection over the internet; and finally this works too.
After that i thought of reasonable extensions to the daemon. 5 GB of webspace come to mind. They are mounted via WebDAV and can be accesses as any local file system. Nearly.
First i had to adjust the character set for encrypted file names until this seemed to be no longer the cause of transmission problems.
Then: symbolic links are not supported. Ok, it's mostly for files only anyway, so i accepted this.
Next is: i cannot set the modification date on files. I use this as a flag whether the file is fully synced. If mdate and file length match, then the file is not further scrutinized but deemed to be up to date. I modified the backup daemon to accept any mdate which is newer than the original file's mdate.
Next is: frequent errors, irregular with no pattern. Except: 9 of 10 errors are timeout errors. I work around to catch and retry in case of timeout and this seems to work. Running the daemon for some time updated more and more files to there final size. But some files failed over and over again.
Common pattern: long files. Approx. 15 files and they all were in range 10 to 50 MB. I examined the problem further: It seems that data written to a WebDAV file is not uploaded immediately, but only buffered internally. When the file is closed all data is uploaded. And, unbelievable, the close() system call has a timeout. It's generous: 1 minute. And then it fails with timeout error... and nothing is saved! So there's no real chance to upload long files this way.
I tried to enforce upload in chunks by calling fsync() after each chunk of data. What the WebDAV driver does here is: it uploads all the current file, not only the modified data, and now, after a long while, while it uploads the growing file again and again, it fails with timeout error when it reaches the critical file size. :-/
Here i gave up. WebDAV is not supported.
That was last week. This week i developed the idea, that i could make daily snapshots of the current backup and hard link the files to save space. After all, 'Time Machine' does it as well. And we are Unix, aren't we? After two days it worked, tested locally. What i got back from my friend was:
June 18, 2013
faster than anybody thought, especially myself, the next version of zxsp is released. This version fixes some bugs discovered in the SPECTRA emulation and re-enables the possibility to run more than one machine instance at the same time.
The SPECTRA emulation had some bugs in border colours and in .z80 file reading. Also it triggered a sleeping error in the Z80 emulation, where under certain circumstances, e.g. when the SPECTRA interface was attached B-), wait cycles were inserted anytime the CPU was reading from contended memory. According to the location of this bug this should also have occurred when the memory access inspector was open.
Multiple instances: You now can open as many machine instances as you like ... and your Mac can execute. There are probably still some bugs left in here, but i have discovered nothing severe.
... Kio !
p.s.: summer has arrived here. B-)
p.p.s.: i have included a test rom which demonstrates the colour capabilities of the SPECTRA interface. On Paul Farrow's site there is probably a newer version. Just in case.
June 15, 2013
I replaced the default external AY extension, which was an AY-Magic, with the Didaktik Melodik, because i didn't get answer to my request for admittance to use the AY-Magic image.
Now to the big add-on:
Paul Farrow's SPECTRA video interface
|Paul Farrow's SPECTRA video interface|
It also incorporates new colour modes, a rom slot with Interface1-compatible paging, a Kempston joystick interface and an Interface1-compatible RS232 port.
Of course the "better image" is not emulated in zxsp, because you already get the best quality here :-) but colour modes, rom and joystick interface are emulated. The RS232 port is postponed for a while.
The new colour modes
|Screenshot made with zxsp|
- extra colours: provides 64 colours
- half cell mode: set colours for left and right 4 pixels in character cell separately
- 2-byte attributes: doubles the available information which can be stored for attributes
- 8, 4, 2 and 1-line mode: increase vertical colour resolution
In addition the interface contains 2 x 16 kByte of ram which allows double buffering of video drawing.
All colour modes are supported by zxsp, you can also make GIF images and movies in these modes.
The interface has a Sinclair Interface 2-like rom slot or, optionally, a DIL socket, but zxsp basically emulates the IF2 slot. There is the option to enable rom switching on the 3 positions where the Sinclair Interface 1 pages in and out. So you can "insert" an Interface 1 rom or a rom which is somehow based on this rom. You can test that it works if you enter the Basic command
which doesn't pass the parser of the plain Basic rom but works when an Interface 1 rom is inserted and the rom hooks are enabled, though it will only tell you that the microdrive 1 is not present.
The interface contains a Kempston-style joystick port and is emulated by zxsp.
The interface contains a RS232 port which works identical to the Interface 1 port, except that it only supports the RS232 mode of this port. This is not yet emulated in zxsp.
.Z80 file support
I have extended the .Z80 file standard to contain the SPECTRA interface. I just dump the information here, so that everybody who is interested can add support to his own emulator:
- Bit 3 in Byte "rldiremu'".
- Byte "spectra_bits" and
- Byte "spectra_port_7fdf".
- Bit 0: new colour modes enabled
- Bit 1: RS232 enabled
- Bit 2: Joystick enabled
- Bit 3: IF1 rom hooks enabled
- Bit 4: rom paged in
- Bit 5: port 239: Comms out bit
- Bit 6: port 239: CTS out bit
- Bit 7: port 247: Data out bit
- Page 12: rom data of inserted rom
- Page 13: ram data of ram bank 0
- Page 14: ram data of ram bank 1
... Kio !
p.s.: Someone promised a download link here, so here's a link to the official download page: http://k1.spdns.de/Develop/projects/zxsp-osx/distributions/. The downloads are at the end of the page.
June 6, 2013
i was busy working on GIF file export in zxsp, which i had temporarily disabled in 0.8.0pre14. GIF file export is now working for all models, that is, in addition to the ZX Spectrum compatible models you now can make screen shots from the TC2048 and ZX80, ZX81 and Jupiter ACE screens.
For the TC2048 i decided on a compromise, after i ran into a widely unsupported feature of gif files, the pixel aspect ratio. Screenshots of the TC2048 are made in the same 1x size as those of a ZX Spectrum. In most cases you will probably use the standard 32 column mode anyway and then this is what you want. If you make a screenshot when (parts of) the display is in 64 column mode, the image will be smoothly scaled down to 256 pixels width.
|Weird Science Overscan Demo|
While i was over the b&w gif movie support i also fixed some errors in the display of the ZX80 and ZX81 compatible machines, especially in 60 Hz mode.
|TC2048 64 Column Mode||ZX81 Silly Basic Demo|
... Kio !
June 4, 2013
I have debugged yesterday a piece of code which i had an older version of, which worked, and a new one which didn't. It took me some time to find out what made the difference:
-2 != -2
There are some crap design jokes in C / C++, but this is really special.
If you apply the unary negation operator on an unsigned int, the result is still an unsigned int. Really, approximately in nearly 100% of all cases not what you want.
The other "highlight" in C / C++, which actually made it verbatim into quite a lot of other languages, e.g. Java, is the totally broken operator precedence hierarchy.
A sane precedence order must account of three distinct groups of operators:
- ops which take 2 numbers and yield a numeric result,
- ops which take two numbers and yield a boolean result, and
- ops which take 2 boolean values and yield a boolean result.
But that was not the only thing that made me feel bad yesterday. I again ran into the especially good support for gif files in all today's real-world apps.
After i got lately response from some Mozilla cleaning officer, who complained, that the example gifs i made for a 6 year old bug report were no longer available, i now found a well documented, basic and easy feature in gif files which no app i tested did support: pixel size aspect ratio, the ratio of width to height of pixels. I wanted to use pixels with an aspect ratio of 1:2 for screenshots of the TC2048 in 64 column mode. When i displayed them in the OSX image viewer, Xee, Firefox, Chrome or Gimp these looked like double-width scarfs. Only Gimp at least showed a warning. All other ignored the aspect ratio all together. So i had to rewrite my code to produce easier-to-decode images. :-/
sometime these things suck.
May 30, 2013
zxsp 0.8.0 pre14 is out now.
With this version zxsp gets (hopefully) full support for the Portuguese Timex TC2048 computer. Feel free to test it and compare it to a real machine and report any bugs you find. Otherwise they won't be fixed. :-)
As a temporary drawback creation of GIF images and movies is not supported in this version.
|Screenshot from the TC2048Hi-ResColourDemo|
Here are the first screen shots:
|Program used for this demo|
The online editor of Blogger is such a crap thing... sorry...
|Screen with 1:1 zoom|
I'll have a look whether this can be smoothed instead of omitting every other pixel.
|Screen with 2:1 zoom|
May 21, 2013
I have released a new version yesterday.
What's new?I have added animation to the tape recorder windows. Ok, version 0.7.2 had an animated tape recorder too, but for 0.8.0 this is new. :-)
There is the well-known green Walkman-style tape recorder, which is currently used for all models without built-in tape recorder, and internal tape drives for the plus2 and plus2A.
Working with the tape recorder
January 12, 2013
after i had to setup my Mac from backup, there are some bits left worth to note:
Restoring from Time Machine Backup was very reliefing and worked with almost no hassle; ignoring the fact, that for some reason restoring the last snapshot did not work, but the 1 hr older was not really worse. Worse was, that the backup was > 10 days old, because it's done on an external drive which i don't want to power up ever 15 minutes, which it does if left mounted. So it's mostly unmounted.
curious: iMail marked ~ 2000 mails as unread. I had to "read" them again.
silly: Restoring my LAN setting did not work. I had to correct it manually when i discovered that my Mac k1.spdns.de/ was not reachable.
bugger: 2 days later i discovered megabytes of web server error messages, because my script couldn't store preview thumbs in the preview folder. I had to correct permissions. I think this did no harm except that preview images were created anew each time a page was accessed.
that really sucks: Today i noticed that the current download version of zxsp was not in the download folder. :-/ I had to create it anew. Now it's slightly larger again, this really depends on what i have compiled in when i compiled Qt. This is a little bit silly; do i actually need a Qt installation for each project, so that the libs included in the app only contain the binaries the app actually uses? And then, of course, i made an error in the deployment process and built the pre11 app with an internal version of pre12. And some folks have already downloaded it before i noticed this mistake. For that reason there won't be a version pre12, the next will be pre13 for the sake of the "check update" function.
... Kio !
p.p.s.: And there's a new background for the blog. :-)
January 9, 2013
- My Mac is online again.
- There won't be a PowerPC version of zxsp unless something very unlikely happens.
I installed XCode 3.2 aga...
I booted from the Snow Leopard installation disk. ok.
Checked file system. ok.
Restored from Time Machine backup. 1h later: Failed.
Restored from older Time Machine Backup. 3h later: worked.
Checked online state. k1.dyndns.org not responding.
Checked local web server: running & serving.
Checked DynDns IP assignment. ok.
Fixed LAN settings. k1.dyndns.org online again.
Downloaded Qt source. (Qt stuff wasn't in the backup) done.
Compiled Qt. worked.
Compiled zxsp. worked.
Will i give it another try? Not on this Mac.
January 7, 2013
i hope you had a nice trip through 2012 and arrived well in 2013.
What's new in this version?
|Ad-hoc assembling in disass view|
If you choose "Edit" in the button group and then click on a disassembled instruction you can immediately enter a new Z80 assembler opcode. While the line is valid it is shown in green and while it is invalid in red. If you hit "Enter" while it is valid, the current opcode is overwritten with the new data. If the new opcode is shorter or longer than the overwritten opcode, then NOPs are added to align the opcode end to the old opcode boundaries.
- I have fixed some cosmetic issues in the memory editors. Now they zip to a full character size after a short moment after you have resized a window.
- The view which has keyboard focus is highlighted with a light green border and only here a blinking cursor is displayed.
I have checked whether i can make a G4/G5 version based on Qt. This is possible but requires me to build a Qt library from source, with proper settings. I think i'll do it, because there are still some people out there with PowerPCs, but it may take a while.
Switch to Qt 5.0 will take a while too. They have not yet even confirmed the bug. You could do me a favor and vote it up: bugs at qt-project/28804.
I'll suspend work on zxsp for a while to work on my hardware projects. I need a switch to something else now. I'll be back in ~2 months.
... Kio !