Vladimir Larkov presents:
Turbo/normal switch for Scorpion ZS-256-Turbo.
...and a few thoughts on software mode switching.
________________________________
The cycle of lectures for soldering iron owners on the topic of modifications to the Scorpion continues. To avoid repetition in the future, I will say right away that I have nothing against reprinting and distributing these lectures "deeper" and "wider" into the masses. At the same time, preserving the volume and authorship will be welcomed with joyful exclamations!
So, let's go. Owners of turbocharged Scorpions have probably noticed that along with the undeniable advantages of the turbo mode on the Scorpion, there are also some inconveniences. I mean the inability to switch modes without using a shadow device for this purpose. And this is not always desirable. Besides the fact that there are some programs that "don't like" the shadow device (actively using the stack, and successfully returning to the program is not possible), there are more and more programs whose authors do not want their code to be viewed through the shadow device, and they "squeeze" the latter. In this case, the user is doomed. And they will not be able to click through the modes while working with such a program.
I hope that despite the ability to switch speeds from the shadow device or programmatically (via RST), I have already convinced you of the necessity and convenience of having a button. Moreover, the button does not interfere with either method, and, unlike both, is immune to all coder's attempts.
So, if you agree with this, it's time to grab the board and heat the soldering iron. To start, you can attach the indicator (I love this). We find a 20-pin microcircuit on the field for modifications, on which the turbocharging is done. In the schematics, it will be named "TURBO". The schematic is the same as for the previous modification, but in case you don't have ZX-FORMAT #1, I will repeat it:
LED
+5V \
────████───── >──┐
300 Ohm / │
│
/──┘
16(TURBO) │/
─────────████─┤ KT315
10 kOhm│\
\ emitter
│
│
─┴─
Now you can appreciate the work done - cool. It immediately became clear in which mode the computer is running - in turbo, the lamp shines so brightly it hurts the eyes...
It's time to tackle the soldering of the button. For this, three microcircuits are needed: LI1, ID7, TM2. Since this is a responsible place, it is recommended to choose faster series.
================================
Turbo/Normal switching schematic for the Scorpion ZS-256 computer:
! DON'T FORGET to first unsolder a couple of wires from pins 12 and 14 of D53 to pins 5 and 6 of TURBO!
14(D53) LI1
─────────────────┐ 1┌──┐
ID7 └──┤& │3 5┌─┐
4┌─┬─┬─┐15 2│ ├────┤ │
┌────────┤E0 │0├─────┤ │ │T│
│ ____ 5│_│ │ │14 4├──┤ │U│
│ WAIT ──┤E1 │1├─────┤& │6 6│R│
│ __ 6│ │ │.│ 5│ ├────┤B│
│ M1 ────┤E2 │.│ ┌───┤ │ 16│O│
│ 1│ │ │.│ │ └──┘ ┌──┤ │
│┌───────┤A0 │.│ │12(D53) │ └─┘
││ 2│ │ │.│ └─────── │
││ ┌─┤A1 │.│ │
││8(D2)│3│ │ │.│ │
││ ────o─┤A2 │7│ │
││ └─┴─┴─┘ │
│└────────────────────────┼────┐
└─────────────┐ ┌─────────┘ │
1kOhm │ │ TM2 │
┌─████── +5V │ │ 13┌──┬┬─┐ │
│ │ │ ┌───oR ││ │9 │
│ TM2 │ │ │ 12├──┤│ ├─ │
│ 1┌──┬──┬─┐ │ └─┼───┤D ││ │ │
o───oR │ │ │6│ │ 11│ ││ │ │
│ 2├──┤ │ O─┘ ┌─┼───/C ││ │8 │
│ ─┤D │ │ │ │ │ 10├──┤│ O──┘
│ 3│ │ │ │ │ o───oS ││ │
│ ─/C │ │ │5 │ │ └──┴┴─┘
│ 4├──┤ │ ├───┘ │
│ ┌─oS │ │ │ │
│ │ └──┴──┴─┘1kOhm │
│ o──────────████─o─ +5V
│ │
│ o ┌───────┐
│ ──o micro switch│
└─o │
─┴─
! PAY ATTENTION to the micro switch - two positions are used! That is, all three contacts. In a resting state (when the micro switch is not pressed), pin 1 of TM2 should connect to ground. !!!
Original idea by Sergey Sewasjanow.
Repaired & corrected by Dmitry Petrov.
================================
Mode switching occurs without glitches and activates upon releasing the button, so you can press the button slowly, without panic (not like magic, for example).
The mode set by this button remains until the reset or magic is pressed (of course, if no one is trying to switch the mode programmatically, but more on that below). After a reset or exiting the shadow device, our beloved shadow service will set the mode chosen in it.
* * *
Now it's time to talk about how to switch turbo/normal programmatically on the Scorpion. This may be necessary if your program uses port #FE for data transmission/reception (Vikomp terminal), uses multicolor (48 Iron), to speed up the work of the IM2 loader, or for many other reasons...
There are two methods.
The first method, which is the simplest, I prefer: to switch modes, the READ command from the ports is used. The port addresses are:
turbo - #7FFD; normal - #1FFD.
the program looks like this, for example:
...
LD BC,#7FFD
IN C,(C) ; turbo ON
...
and
...
LD BC,#1FFD
IN C,(C) ; turbo OFF
...
If necessary to preserve the register pair BC, this fragment is surrounded by PUSH BC, POP BC or EXX commands. This method is convenient in its simplicity and speed; you don't have to know whether it's a Scorpion or not; if it's a Scorpion and it has turbo mode - the mode will switch; if it's not a Scorpion, or a non-turbo Scorpion - nothing will happen.
Theoretically, it is possible to change the addresses of the "turbo ports", practically - this can happen no earlier than a new Scorpion appears, and even then, I personally find it hard to believe (the change of addresses, not the appearance of a new Scorpion), which is why I use this method.
Theoretically, there may also be glitches on old machines with defective decoding that interpret the IN command as an OUT command. Practically - such computers should either be discarded or repaired. If persistence forces you to use this method on such machines - you can add a few commands and it will look approximately like this:
...
LD BC,#1FFD
IN C,(C) ; turbo OFF
LD BC,#7FFD
LD A,desired page
OUT (C),A
...
this rearrangement will eliminate the possibility of glitches on old machines.
The second method.
Theoretically (according to MOA) absolutely correct, but more cumbersome - via RST 8.
...
RST #8
DEFB #87 ;turbo ON
...
and
...
RST #8
DEFB #88 ;turbo OFF
...
When using such commands, you need to REMEMBER that on non-Scorpions this will lead to a crash due to an error. Therefore, it is necessary to protect against this. According to Andrew MOA, this should be done by intercepting ERR_SP so that in case of a non-Scorpion or an old version of the monitor we do not crash but continue executing the program. Those wishing to use this method can call Andrew MOA and personally discuss all the nuances of this method (like: what to do if the 8th bank is dead; or we started with blocking #1FFD (see ZX-FORMAT #1) etc...).
P.S. Sergey Zонов said that theoretically this scheme cannot work, however, this does not prevent it from switching modes on our Scorpions for more than six months practically without a single glitch.
With best wishes, Vladimir.
St.-Petersburg, 30-Nov-1995.
--- iS-EDIT 5.05+
________________
From the ZF editorial office
I would like to add a bit about the variants of switching TURBO. In a personal conversation, Andrey Larchenko, also known as MOA, claimed that using reading from ports may, and even should, lead to data loss in additional banks. However, if you are the owner of a turbo-Scorpion, you may have noticed that in the ZF shell this method is used and we have not noticed any glitches. If you find even one, let us know. We chose this method because of the impossibility of using RST #08 and full protection from "shadow devices" (coders really dislike when their works are studied without permission). The optimal solution from both methods (RST and ports) we consider the third: not to touch at all (this is for coders, and for users - to install the button). Long live complete consensus between producers and consumers!
________________________________
Contents of the publication: ZX Format #02
- IS-DOS
Announcement of a school-ready hardware-software complex by Iskra Soft and Peters, featuring a networked computer class setup on ZX Spectrum with IS-DOS.
- IS-DOS - Владимир Елисеев
Explanation of command line monitor and text editor restart in IS-DOS using mon.com utility as an example.
- IS-DOS
Introduction to IS-DOS system utilities, covering functions like help, user menu, file viewing, editing, and file operations.
- IS-DOS
Detailed description of the eliminat.com program for freeing memory from resident tasks and drivers, featuring interactive mode and command-line keys. Specific channel numbers allocated for task and driver types. Includes usage options and color customization.
- IS-DOS Window System - Владимир Елисеев
Exploration of IS-DOS window system restarts for printing text in windows and absolute screen coordinates. Examples of restart implementations such as lwt, adrwt, lenwt, prstr, str, and lnstr. Continuation to cover auxiliary restarts in next issue.
- Assembler
Introduction to assembly language basics, focusing on flags, arithmetic operations, and register manipulation. Discusses addition, subtraction, and complex operations like multiplication and division through examples. Highlights specific assembly commands and their functions for ZX Spectrum.
- Hardware
Discussion of hardware modifications for Scorpion ZS-256-Turbo, including the implementation of a Turbo/Normal switch. Pros and cons of software-based switching methods. Advice on soldering and circuit adjustments.
- Hardware
Discussion of a new music add-on for ZX Spectrum by X-TRADE and HACKER STINGER, called 'ZX GENERAL SOUND', offering high-quality audio and minimal processor usage.
- Hardware
Discussion on hardware innovations and marketing strategies, focusing on mouse and keyboard interfaces for ZX Spectrum. Critique of competitor's misleading advertising and analysis of serial versus passive mouse technology. Author questions necessity and cost of advanced features.
- Hardware
Discussion of hardware acceleration methods for ZX Spectrum, focusing on turbo-modes and their effects on performance and compatibility.
- Toys
Fantasy tale about magical creatures battling human intrusion. Main character recruits allies for a quest to restore the land's former glory. Challenges include finding tools, overcoming obstacles, and reviving companions.
- Toys
Review of 'Carrier Command' game, focusing on its strategic and simulation aspects. Includes detailed gameplay mechanics, controls, and objectives. Highlights strategies for success and unique features like managing resources and autonomous systems.
- Interview
Interview with Sergey Zonov and Andrey Larchenko discussing their experience with microprocessors and ZX Spectrum development, including the creation of the Scorpion ZS 256 computer.
- Information
Contact information and staff list of ZX-Format No. 2 (1995) including editor, coders, and designers.
- Information
Editor's address to readers of ZX Format, discussing the positive feedback, past errors, and the quest for a cartoonist, with future plans for the magazine.
- Information
Discussion on the new interpretation of the 'PULLDOWN' window menu system for ZX Spectrum, focusing on interface updates and user interaction enhancements.
- Information
Discussion about companies illegally distributing ZX Format, emphasizing the benefits of purchasing official copies.
- Competition
The article discusses the lack of participation in ZX Format's competition, detailing the rules and prizes, and encourages readers to engage with new ideas.
- Let's Relax
A humorous account of a software vendor's challenges dealing with clueless customers, illustrating the nerve-wracking nature of his job.
- Mailbox
Overview of hardware components and prices for ZX Spectrum enthusiasts with ordering details.
- Mailbox
Reader letters section in ZX Format #02 discusses reader feedback, addresses issues with ZX Format features, and offers future improvements.
- Premiere
Guide to Digital Studio v1.12, a music editor for ZX Spectrum, including features, menu navigation, and the use of Digital Studio Compiler.
- For Programmers
Exploration of tools that extend the standard Basic 48, including Renumber for Basic 128, Trace & Speed, Blast Toolkit, and ZXeditor, highlighting their functionalities and utilities.
- Various
History of Amiga computer models and their evolution from A1000 to A4000/60T with specifications and unique features. Explanation of technical terms and differences between chip and fast memory. Mention of new developments like AGA chipset and models for different needs.
- Miscellaneous
The article presents upcoming ZX Spectrum software releases and reviews game innovations like 'Adventures of Winnie the Pooh' and 'UFO 2: Devils of the Abyss'. It highlights features, creators, and technical requirements. It also includes announcements from SOFTLAND and Cracked Masters Group.
- Systems
Discussion of creating music with Instrument 3.01, focusing on digitized sound. Analysis of program's capabilities and conversion from ASC Sound Master. Instructions for composition and conversion.
- What's New
Review of new ZX Spectrum games entering the St. Petersburg market in late 1995. Detailed game descriptions, memory requirements, controls, and music/graphics evaluations. Highlights include Night Hunter, Extreme, Grell & Falla, and more.