Instructions
02/10/2024


Menus:

F1 Help F2 NMI F3 Hardware options F4 Control options F5 Load snapshot F6 Save options F7 Load tape F8 Tape options F9 Save screenshot F10 Quit F11 Sound options F12 Disk select

Shift-F11 Video options

Alt-F1 POKEs/Trainers Alt-F2 Alternate NMI Alt-F7 Tape browser Alt-F8 Pause/Unpause tape

File Formats INI/command line DOS Windows


DOS and trying to get it to work

The DOS version requires 8 MBs of RAM or more, a VGA card or better, and (at least) a SB 2.0 (or clone) which can handle Autoinit DMA commands. Gameports are supported for one or two twin-axis joysticks or joypads. A mouse can be used, as long as a working driver is loaded.

For the CPU, it requires at least a 386, but I categorically don't recommend that (except for curiosity's sake). A (very) high-end 486 or a low-end Pentium will make it much more usable.

If you wish to try the DOS version on a more modern system, there are possibilities by using virtual machines, DOS emulators, or things like VDMSound (for certain versions of Windows).

 

For the DOS version, your first goal is to get it to start... there are a number of ways that it can fail to run (this is DOS, after all) and a number of options that can be tweaked to help it.

The DOS version will use 8.3 filenames by default. There are some circumstances where long filenames may be used (under Windows 9X) and you can change the LongFilenames variable in the INI file to enable this. Note that the emulator cannot load in crucial files if it is wrongly enabled, and will return back to the command prompt. If it does not work, revert back to 8.3 filenames.

It will also detect VESA modes and add them to the Video Modes list that you can use. A VESA driver should be loaded, but later video cards will not need this. However, some detection options may cause a problem and (again) there are options in the INI file to limit it to only use banked VESA modes, or to only use VGA modes.

Also make sure that the BLASTER environment variable is present and accurate, otherwise it will fail to run. The emulator relies upon this for the I/O ports, IRQ, DMA channel, and soundcard type.

In some rare circumstances, a combination of machine and memory manager can cause the 32-bit DOS extender PMODEW to have problems (this is the extender that x128 uses), and that can prevent x128 from even starting at all. In those circumstances, you should try putting DOS4GW.EXE in the same directory as x128 and start it with "DOS4GW X128", but this will not allow the use of IRQ 8 or higher. Alternatively, you could try a different memory manager (EMM386 / QEMM / etc) or just try HIMEM.SYS by itself.

 

There are a number of DOS-specific options that you should look at, in order to get the emulator started or working better.

Things should be ok with the default values. But if you have problems, the safest option is to look at the INI file and make sure the following is set:

LongFilenames = NO
VESA = NO
VESAForceBanked = YES
HostHalt = NO

DetectJoystick = NO

NoLoadingSpeed = YES
SBClone = NO
SampleRate = 22050
SampleBits = 8
SBPro = NO
SB16 = NO

Long filename detection can be unreliable. It only works under Windows 9X, and should be deactivated in all other circumstances, otherwise the emulator will not be able to load anything and will return to the command line.

VESA video mode detection can have a number of issues. VESA = NO will switch the detection off completely, if it is freezing.

Generic VESA drivers can sometimes "over-report" the number of valid video modes. For example, listing video modes that require more video memory than is available (the emulator will try to remove these from the list automatically). Another problem can be declaring that a video mode is available as a linear frame buffer when it is not. VESAForceBanked = YES will force all video modes to be used in banked mode. This will be a little slower, but is essential for those video cards that have this issue. This option also helps when running the emulator under VDMSound.

When the emulator has completed its task for the current frame, it will wait for the next audio interrupt before it will proceed. No other timer is used, which is why it is so vital that a working sound card is detected. However, when running the emulator under a virtual machine or another emulator like DOSBox, you will find the CPU usage will be high, and so will the CPU fan speed.

Setting HostHalt = YES will execute a "hlt" instruction on the host CPU, instead of sitting in a busy loop. This can greatly improve the experience, but there are plenty of circumstances where this could upset the operating system or virtual machine, which could raise an exception.

In some rare circumstances, the emulator could get stuck in a loop trying to detect the gameports. Set DetectJoystick = NO to avoid this.

 

And now, the thorny issue of sound cards... As x128 relies upon the audio interrupt as a timer, it is vital that this is set up correctly. It not, you may see this screen:

I'm drawing a blank here

I'm waiting, audio interrupt

You can advance the emulation by holding the "reverse apostrophe" key to the left of the "1" key on your keyboard. Then, to get back to the command prompt, you need to press F10, then Y.

 

Settings are generally easy for values up to 8-bit, 22050 hz, mono. But once you go above these values you find that different cards behave differently. Getting the sound working and to the settings you want can involve some trial and error. So, to begin with, set SampleRate = 22050, SampleBits = 8, and SBPro = NO.

When using a SB 2.0 / SB Pro (or a clone card) and you go above these values, you sometimes have to send different commands to the sound card to get it to operate as expected. For slower speeds, you need to use command 0x1C. For faster speeds, you need to use command 0x90. If SBClone = NO, then command 0x90 will be used for those faster speeds.

But some clone cards will not accept command 0x90, and will only recognise command 0x1C. Setting SBClone = YES will use command 0x1C regardless of the speed or mono/stereo setting. SBClone is the only option where either YES or NO could cause problems!

If have a SB16, then set SB16 = YES, as this has a different and more reliable set of commands amongst its clones, this allows you to bypass the complexities of setting up the previous commands. If not, set it to NO.

If you set SBPro = YES, then you will have stereo sound (for legacy reasons, you have to set this if you want stereo in SB16 mode too).

 

One feature of the emulator is that when tape loading is taking place, it can switch to a second speed (LoadingSpeed), which can be a different value from the usual speed (Speed). The emulator does this by reprogramming the sound card. In the past, there were circumstances where this could fail. This option is kept just in case. Set NoLoadingSpeed = YES, if the emulator freezes when you try to play a tape (although this could also be an SBClone issue).

 

INI file Command line Notes
LongFilenames = NO | YES /nolfn (deactivates option) Try to detect and use long filenames under Win 9X
VESA = NO | YES /novesa (deactivates option) Try to detect VESA video modes
VESAForceBanked = NO | YES /vesaforcebanked (deactivates option) Force banked video modes instead of linear ones
VESAForce555 = NO | YES /vesaforce555 (enables option) Force 16-bit video modes to use RGB 555
VESAForce565 = NO | YES /vesaforce565 (enables option) Force 16-bit video modes to use RGB 565
HostHalt = NO | YES /hosthalt (enables option) Whether to halt the host CPU while waiting
DetectJoystick = NO | YES /nojoy (deactivates option) Try to detect joysticks
NoLoadingSpeed = NO | YES /nlspeed (enables option) Whether to change speeds when loading
SBClone = NO | YES /sbclone Make a SB 2.0/Pro use a different command
SBPro = NO | YES /sbpro Produce stereo sound
SB16 = NO | YES /sb16 Use SB16 commands
SampleRate = 4000 - 44100 /hz NUMBER The sample rate of the audio output
SampleBits = 8 | 16 | 24 | 32 /16bit /24bit /32bit (8-bit is default) The number of bits of the audio output


INI Options


; Whether to try to detect (and use) long filenames under Win'95/98.
; Set this to NO on NT/2000/XP/Vista/7/DOSBOX.
LongFilenames = NO
		

This option is parsed before all others. It is possible to get a false positive when detecting when long filenames are available. In such a circumstance, the emulator will struggle in accessing the file system and will generally fail to load important files, and not work. Set this to NO, in that circumstance.

 

; Whether to try to detect VESA video modes.
VESA = YES
		

This option can prevent the detection of VESA video modes altogether. Set it to NO, if you have problems.

 

; Whether to force banked VESA modes instead of linear ones.
; (Useful for generic VESA drivers which claim there are more video
; modes than are actually available).
; (Setting YES can also be useful for running under NT/XP/Vista/7/DOSBOX, strangely enough...)
VESAForceBanked = NO
		

This option forces all VESA modes to be used in their "banked" form.

It is possible for some generic VESA drivers to "over-report" the capabilities of the video card. This solves ones of the problems.

 

; Whether to force VESA 16-bit (565) modes into 15-bit (555) modes.
; (I spotted an Acer laptop which reported 565 but it was actually a 555 mode).
VESAForce555 = NO
		

If you select a video mode marked as "16 bit" and the colours are wrong, try this option.

 

; Whether to force VESA 15-bit (555) modes into 16-bit (565) modes.
; (Not seen anywhere, just added for completeness).
VESAForce565 = NO
		

If you select a video mode marked as "15 bit" and the colours are wrong, try this option.

 

; Whether to halt the host CPU while waiting.
; (This can reduce your CPU time under a virtual machine, but will raise an exception under Win NT/2K/XP/etc)
HostHalt = NO
		

This option executes a "hlt" instuction on the host CPU, instead of sitting in a loop waiting for the next audio interrupt.

Using it can greatly reduce your CPU load and fan speed, when running under a virtual machine or a DOS emulator. However, there are situations where it could raise an exception. Under certain versions of Windows running VDMSound, for example.

 

; Use this if soundcard causes problems when trying to go above 22050hz.
; Also try this if x128 crashes on exit.
SBclone = NO
;SBclone = YES
        

This determines the type of commands that are sent to a SB 2.0 / SB Pro, or clone card. See above for the complexities.

 

; For SB version, set this AND have T4 in your BLASTER environment variable.
; To get 8-bit stereo.
SBpro = YES
        

This gives you stereo sound, if available. It also uses the SB Pro mixer chip, if not in SB16 mode.

 

; Use SB16 commands to generate sound. Useful if you have problems getting
; samplerates above 22050 or with getting stereo. You have to set SBpro to
; yes (as well) in order to get stereo.
SB16 = YES
        

This lets you use SB16 commands (if available), which are much more compatible. It also allows you to generate 16-bit sound. You must have T5 (or higher) in your BLASTER environment variable.

 

; Samplerate can be from 4000 to 44100.  Some soundcards can't go lower than
; 5000 and some may have difficulty above 22050.
; Some Windows cards can go up to 192000 hz!
;SampleRate = 4000
SampleRate = 22050
;SampleRate = 44100
;SampleRate = 96000
;SampleRate = 192000
        

Simply set the sample rate here. Read the notes about the problems that can occur when going above 22,050 hz.

 

; The number of bits in sample playback.  8, 16, 24 and 32 bits supported.
; ...but 24 and 32 bits are not supported under DOS!
; It will try to scale back to a reasonable value, should you pick an invalid one.
;SampleBits = 8
SampleBits = 16
;SampleBits = 24
;SampleBits = 32
        

Set the number of bits you want here. 24 and 32-bits are not available under DOS.

You will also have to set SB16 = YES to use 16 bits.

 


Getting the DOS version to run faster:

This build of x128 is quite a bit slower than previous versions and uses more memory. The main culprit, for both of those, is a very inefficient audio mixer.

It always statically allocates a large chunk of memory, regardless of the settings, and none of the soundchips go into sleep mode when they aren't being used (nessun dorma). When there are 17 sound sources being emulated, that is a problem. (Most of them are rarely-used DACs and speech chips).

One solution is to lower the audio settings as low as you can bear. 8-bit and mono, for starters. But also, setting the sample rate as low as possible.

Below 22 Khz will start to sound poor, but (for the sake of a bit of speed) you can drop to 8 Khz. Most soundcards should be ok with 5 Khz, some with 4 Khz. The sound quality will be appalling though.

 

The VGA Text Mode (/vmode 6) is the fastest video mode available, using a quarter of the memory bandwidth of the default 320x200 VGA mode. But, it may not work on all video cards and its colour limitations mean that it's only really useful for the default ZX Spectrum modes. Most of the extended video modes added by later Spectrums (and some of the other emulated machines) won't work in this mode.

There are x86 assembly language versions of the ZX Spectrum screen drivers but they aren't being used in this DOS build, so slower C versions are being used instead. This can only be rectified in a later build.

 


(C) Jane McKay, 2024.