The config.ini, menu.ini and menu.def files
-------------------------------------------
Author:  Phoebus R. Dokos (based on documentation by: Garry Lancaster &
                           Alvin Albrecht)
Date:	 2026-11-08
License: CC BY-NC-SA
Version: 1.9

Changelog
---------
2018-09-24: 1.0 Initial version
2019-06-24: 1.1 Major update due to FW changes
2020-02-29: 1.2 Update to reflect new folder
                locations and esxDOS ROM file
                name
2020-03-05: 1.3 Minor update
2020-04-28: 1.4 Added new config.ini options
2020-04-28: 1.5 Corrected some descriptions (with input from Garry Lancaster,
                                             Alvin Albrecht and Darran Rimron)
2020-04-30: 1.6 Updated for FW v1.29 changes (Garry Lancaster)
2020-04-30: 1.7 Updated for FW v1.29b changes (Garry Lancaster)
2026-10-27: 1.8 Corrected to match the firmware (FW v1.45): the psgmode
                values and default, the stereomode default, the joystick
                types and defaults, the 48K Multiface ROM name, the kmouse
                values, and the espreset setting, which was missing
2026-10-30: 1.9 Updated for FW v1.46: the boot screen and its keys, config mode
                (Select Personality and the Settings pages, which now also
                set the video mode), the new expbus and pidebug settings,
                and the boot from a NEX file (boot.nex, boot.nxi, boot.cnf)
2026-11-01: 1.9 The Info page's systems and UARTs; on a KS1, the timing
                setting starts the Next core's VGA or HDMI build; each
                setting's line in config mode, and the ROMs of Select
                Personality
2026-11-02: 1.9 The Info page tells NextPi from AlpineNext on the Pi's
                UART
2026-11-03: 1.9 The Info page shows config.ini's video mode; the text boot
                screen shows "Press I for info" on a Next and its clones
2026-11-04: 1.9 F3 (or NMI+3) changes 50/60 Hz in every personality; up to
                32 menu= lines; a menu= line's own 50 or 60 Hz, set with H in
                Select Personality
2026-11-05: 1.9 The About page, A on the Info page: the scrolling credits
2026-11-08: 1.9 On a KS1, N-Go or X-Berry Pi the Info page holds the ESP in
                reset after it asks it


Introduction
============
Configuration of your ZX Spectrum Next computer can be done in two ways:
1 a. Via config mode (by pressing <SPACEBAR> at the boot screen, then <SPACE>
     for the Settings; see "The boot screen and config mode" below)
  b. Automatically upon boot specifically for the screen detection/adjustment
     (the test card)
2. Via the config.ini or menu.ini files

The second method provides access to some settings not found in config mode,
adding a machine personality, changing the machine type for said
personality, provide alternate ROM images and even more importantly setting
your monitor if it doesn't work out of the box.


The boot screen and config mode
===============================
From FW v1.46, on a ZX Spectrum Next the boot screen shows "ZX Spectrum Next",
the keys, the firmware's and the core's versions, and then writes in the
"sinclair" logo with a short tune. (Other machines keep the text boot screen
of earlier firmware.) The keys are:

  SPACE    config mode (below)
  C        the extra cores (see extracoresinstructions.txt)
  I        the Info page: the machine, its board and memory, the RTC, the
           WiFi (ESP) and a Pi Zero if they answer (and whether the Pi
           runs NextPi or AlpineNext), the video mode config.ini asks for
           (for example "Video: HDMI, 60 Hz"), and the SD cards with
           their partitions, the NextZXOS version on each card, and FreeDOS
           or DOS 7.1 on a partition that holds it. The two UARTs are
           left as they were found: their speed, data bits and flow
           control, and which one is selected. On a KS1, N-Go or X-Berry
           Pi the ESP is held in reset after the page asks it. A starts the
           About page (below). BREAK goes back to the boot screen.
  A, D,    the test card, to set the video mode: all modes, digital (HDMI),
  V, R     VGA or RGB
  U        the updater, if TBBLUE.TBU is on the card; otherwise the screen
           says "No TBBLUE.TBU on the card"
  N and X  held together: reset config.ini to its defaults

A key pressed while the logo is being written in is acted on, even a short
press. Then, in place of the keys, the screen lists the files that this boot
loads, each lit up as it loads. If a file is missing the boot stops, with its
name in orange; the only exception is a missing Multiface ROM, which turns the
Multiface off and lets the boot go on.

Config mode opens on "Select Personality": the menu= lines of menu.ini (or of
menu.def), with the default one marked. Its keys are:

  6, 7     move by a line (5, 8 by a page)
  ENTER    make the line the default, and start it
  H        give the line its own 50 Hz, then 60 Hz, then the setting's
           again; it is saved in the menu file (menu.ini or menu.def, the
           one named at the top right) when you leave config mode, with
           ENTER or BREAK
  SPACE    the Settings
  BREAK    leave config mode, with the default as it was

Under the list, the selected line's ROMs are shown: the main ROM, the divMMC
ROM and the NMI/Multiface ROM. A ROM that the line does not give is the one
the boot loads: esxmmc.bin with divmmc=1, and with mf=1 the Multiface ROM of
the machine type (mf1.rom for a 48K, mf128.rom for a 128K or a Pentagon,
mf3.rom for a +2A/+3). With the setting off, or <none> on the line, it says
"none". Last is the line's Frequency: its own 50 Hz or 60 Hz, or the
setting's (for example "50 Hz, Settings"). A line with its own frequency
shows it in cyan at the right of the list.

The Settings page has four groups: "Machine-wide settings", then, under the
yellow heading "Other settings", Sound, Joysticks and Hardware. Open one
with ENTER; in a group, 6 and 7 move, SPACE (or 8) gives the next value and
5 the one before, and BREAK goes back. The line under the list says what
the selected setting does. The settings, with their config.ini names and
those lines, are:

  Machine-wide settings (all personalities, and some cores)
    Output (timing)          Video mode set by the test card: VGA 0 to
                             VGA 6, HDMI, or test card
    Frequency (50_60hz)      Monitor refresh. 50 Hz is the most compatible
    Scandoubler              Turn off for an RGB/SCART (15 kHz) screen
    Scanlines                CRT image emulation
    Keyboard (keyb_issue)    Issue 2 for a few old games
    PS/2 port (ps2)          keyboard first or mouse first: select primary
                             PS/2 device (for both use Y-splitter)
    Mouse speed (mousedpi)   Adjust the mouse pointer speed
    Mouse buttons            Swaps the mouse buttons' function
      (buttonswap)
    Internal speaker         Enables output from the internal speaker
    Beeper (beepmode)        On every audio output, or the internal speaker
                             only
    HDMI sound (hdmisound)   Turns the audio on the HDMI port on or off
    Stereo (stereomode)      Stereophonic placement of the AY channels
    ESP reset (espreset)     Resets the WiFi module at each boot
    SPI Debug via Pi0        Only applicable to cores >= 3.03.00
      (pidebug)
  Sound (other personalities)
    Turbosound               Three AY chips in place of one
    PSG mode (psgmode)       YM, AY or ZXN-8950
    AY in 48K (ay48)         Enable access to the AY in 48K personalities
    DACs (dac)               Enable/Disable Specdrum and Covox sound
  Joysticks (other personalities)
    Left joystick            The line says what the chosen type does; for
      (joystick1),           Keyjoy: "Maps keys to the joystick; Need addn.
    Right joystick           assignment"
      (joystick2)
  Hardware (other personalities)
    divMMC ROM (divmmc)      The divMMC's automatic ROM paging
    divMMC ports (divports)  Enables/Disables the divMMC ports 0xE3 and 0xE7
    Multiface (mf)           Enables Multiface hardware - Requires user ROM
    DMA (dma)                Enables/Disables the zxn(D)DMA/Z80DMA
                             controller
    UART and I2C (uart_i2c)  Enables/Disables UART and I2C ports
    Timex modes (timex)      Enables/Disables TS2068 compatible screen modes
    ULAplus (ulaplus)        Enables/Disables ULAplus extensions
    Kempston mouse (kmouse)  Enables/Disables the mouse
    Expansion bus (expbus)   Enables/Disables the Expansion Bus (non-Next
                             only). Once it is changed, a flashing red
                             warning takes the line's place: "Power off
                             first to plug a peripheral in or out."

"Other personalities" are the personalities that are not NextZXOS: NextZXOS
sets these itself. Leaving the Machine group applies the scandoubler, the
frequency and the scanlines at once; the other settings take effect when the
personality starts. When a setting has changed, leaving config mode asks "Save
the changes?": Y writes config.ini, N leaves the settings as they were (a new
default chosen with ENTER is still saved), BREAK goes back.
config.ini keeps every setting, including those config mode does not show
(turbokey, default).

The About page (A on the Info page) shows the credits, scrolling up: each
person's picture, name and work. At the end come the thanks to the backers,
the Original Superbackers, and the page "Designed in Britain, Built for the
World", which stays. SPACE stops the scroll and starts it again; BREAK goes
back to the boot screen.


Booting from a NEX file
=======================
From FW v1.46, a ZX Spectrum Next can boot straight into a program, a .NEX
file, with its own picture on the boot screen. Put these two files in the
root of the SD card:

  boot.nex  the program, a NEX file (format V1.2 or V1.3)
  boot.nxi  the picture shown in place of the "sinclair" logo

With both files there, the firmware does this at each boot:

1. The first time, there is no boot.cnf: the test card runs, and the video
   mode you choose with it is written to boot.cnf in the root of the card
   (config.ini is not changed). The Next then restarts.
2. With boot.cnf there, its video mode is set. The boot screen shows "ZX
   Spectrum Next" and boot.nxi written in where the logo goes, with the
   logo's tune. No other text is shown, and no key is acted on: config mode,
   the extra cores, the test card keys, the updater and N with X cannot be
   reached. To reach them again, take boot.nex or boot.nxi off the card.
3. The program is loaded and started. NextZXOS does not run under it: the
   48K BASIC ROM is at 0x0000 (ROM 3 of enNextZX.rom, which must still be in
   c:/machines/next/), with the 128K paging, the Next's registers and
   28 MHz as .nexload sets them. So a program that reads more files from the
   card cannot work this way; one whose header asks for its file to be left
   open is refused.

This needs core 3.03.00 or later. With an older core the screen says "This
core version is not supported by this software; you MUST update", and then
the core update screen follows (U starts the updater if TBBLUE.TBU is on
the card).

boot.cnf holds the video mode as config.ini does (timing=, 50_60hz= and
scandoubler=); any other config.ini line in it is taken too, after
config.ini's. To choose the video mode again, delete boot.cnf.

boot.nxi is a picture of 308 x 78 pixels: a 512-byte palette (256 entries,
two bytes each, as nextreg 0x44 takes them), then the pixels column by
column, each column from the top: 24,536 bytes. Palette entries 0 to 31 are
the boot screen's and are not loaded; the picture may use entries 0 to 15
(the fixed colours) and its own colours from entry 32. tools/nxi.py in the
firmware's sources makes one from a BMP or PNG:

  python3 tools/nxi.py picture.png boot.nxi

Config.ini, menu.ini and menu.def are regular text files, located in the
c:/machines/next/ folder of your boot SD Card and read upon first boot after
an F1 reset or cold boot.


Global settings: config.ini
===========================
The config.ini file contains global settings that apply to ALL the machine
personalities. This file is not initially provided on the SD card supplied
with your Next, but it will be automatically created when you first select
your desired video mode on the testcard screen. It will also be created or
updated whenever you save a change to the settings in config mode (ie by
pressing <SPACEBAR> at the boot screen, then <SPACE> for the Settings).

The global settings in the config.ini file are set one-per-line with each
setting's name followed by an '=' sign followed by the value of the setting

Note: Starting with FW version 1.10b, if you modify the config.ini and enter 
non-acceptable values for each setting, the FW upon boot will replace these
values with the smallest acceptable one.

Note: Most hardware features are enabled in the ZX Spectrum Next personality
by NextZXOS, regardless of the global settings. Settings which indicate personal
preferences (such as joystick modes, scanlines, video mode etc) are respected.

The global settings are:


1. scandoubler
This sets the scandoubler ON (1) or OFF (0). 
Scandoubler must be ON for VGA displays and OFF for RGB type monitors (or SCART
connections). It changes the horizontal scanrate from 30kHz (VGA) to 15KHz
(RGB). If you're using a  PS/2 keyboard this setting can also be changed on the 
fly by pressing F2 otherwise on a Spectrum membrane keyboard you'll need to 
press NMI (on the side of the machine) + 2. This function key responds differently
on digital displays as it forces a resync.

Default setting:
scandoubler=1


2.50_60hz 
This sets the main frequency of the display to 50Hz(0) or 60Hz(1). 
60Hz should be avoided whenever possible and as a setting it is only there for 
those whose displays cannot work below 60Hz (usually monitors specifically made 
for PCs). 50Hz retains the proper frame rate for Spectrum software and software
that requires very strict timings so it's advisable you always use that.
This setting can also be changed on the fly by pressing NMI+3 (or F3 on a 
PS/2 keyboard), in every personality.

Default setting:
50_60hz=0


3. timex 
This enables Timex modes (HiRes and Multicolour) if set to (1)

Default setting:
timex=1


4.psgmode
psgmode sets the on board PSG mode to YM (0), AY (1), ZXN-8950 (2) or all AY
chips held in reset (3).
Note: To truly disable AY the port addresses should be disabled and reset will
silence it (See relevant NextREG documentation, nextreg 0x06)

Default setting:
psgmode=1


5.stereomode
stereomode changes the stereophonic (Left-Center-Right) ordering of the PSG 
channels from ABC (0) to ACB (1)

Default setting:
stereomode=0


6.intsnd

Intsnd enables (1) or disables (0) the internal beeper.

Default setting:
intsnd=1


7.turbosound
Turbosound disables(0) or enables(1) the additional 2 AYs to give you either an 
option of 3 or 9 channels of PSG audio

Default setting:
turbosound=1


8.dac
This setting enables (1) or disables (0) ALL onboard SpecDRUM / Covox 
Soundrive compatible DAC hardware. Individual DAC hardware can be selectively
disabled/enabled by the relevant NextREG. See the NextREG documentation for
details.
For the Soviet Timings personality only, Soundrive mode 2 is disabled as this
clashes with the Pentagon/ATM DAC.

Default setting:
dac=1


9.divmmc
This enables (1) or disables (0) the onboard divMMC. This won't affect boot but
will make the divMMC hardware unavailable to the selected personality. If this 
is enabled, then *if* the setting is *NOT* overriden by the per-personality 
settings as outlined in the following section, then a ROM image file named 
esxmmc.bin is expected to be located in c:/machines/next/.

Default setting:
divmmc=0


10.divports
This enables(1) access to the DivMMC i/o ports. For the +3e personality to 
operate properly, this needs to be set, as it needs access to these ports even 
though the DivMMC ROM is not loaded/used. 

Default setting:
divports=1


11. mf
This enables (1) or disables (0) the onboard MF-compatible hardware. It, too can
be overridden by the per-personality setting as outlined in the following 
section. If it is however enabled and the ROM filename is NOT overriden, then it
can be one of the following according to selected machine type. If machine type 
is 0 (48K) then the rom filename expected is mf1.rom, if machine type is 1
(128K) or 3 (Soviet clone timings) then the rom filename expected is mf128.rom
and if it's 2 (+2/+3) then the expected rom filename is mf3.rom. These rom
image files must be user provided and then placed in the c:/machines/next/
folder.

Default setting:
mf=0


12. joystick1
joystick1 (and joystick2 that follows) sets the first port joystick type to one
of the following options: 
0 = Sinclair 2 (12345)
1 = Kempston 1 (port 0x1F)
2 = Cursor (56780)
3 = Sinclair 1 (67890)
4 = Kempston 2 (port 0x37)
5 = MD 1 (3 or 6 button joystick port 0x1F)
6 = MD 2 (3 or 6 button joystick port 0x37)
-or-
7 = User defined keys joystick (Keyjoy). The keys are programmed through
    nextreg 0x28, 0x29 and 0x2B (see the NextREG documentation, nextreg 0x05);
    the firmware starts every personality with no keys mapped.


Default setting:
joystick1=1


13. joystick2
This setting is as the previous one and accepts the same options (some of which 
are mutually exclusive i.e. if you select a Kempston 1 for joystick1 you cannot 
select a Kempston 1 for the second port as well)

Default setting:
joystick2=3


14. ps2
This setting rewires internally the PS/2 port to have the mouse connector as 
first PS/2 device(1) rather than the default which is keyboard(0). This 
facilitates plugging in a PS/2 mouse without a Y-splitter cable if you already 
have a membrane keyboard attached or a regular cased Next.

Default setting:
ps2=1 (cased next)
ps2=0 (board backers' distribution)


15. scanlines
This setting produces a cosmetic scanline-like effect of variable intensity from
totally disabled (0), to 50% (1), 25% (2) and 12.5% (3).
Scanlines are also controlled on the fly with the F7 key on the PS/2 keyboard 
(or NMI+7)

Default setting:
scanlines=0


16. turbokey
turbokey, enables(1) or disables (0) access to speeds over the standard 3.58Mhz.
If enabled, speed can be also overriden on the fly with the F8 key on a PS/2 
keyboard (or NMI+8)

Default setting:
turbokey=1


17. timing
timing sets a global screenmode setting from 0..7 for all menu items that have a
screen mode set to 8 and it's set automatically from the new testcard video
setting module upon boot. If a menu item contains a video mode different from 
8 then this setting is overridden. An express setting of timing=8 forces the
appearance of the TestCard. From FW v1.46 it can also be set in config mode
(Settings, Machine, Output), where 8 is "test card". The extra cores get the
Next's own video settings (timing, scandoubler, 50_60hz), so the test card
also sets their video mode. On an Issue 2 or 3 (KS1) with the Next core's
VGA build in slot 2, timing 0 to 6 starts the VGA build and timing 7 the
HDMI build (see extracoresinstructions.txt, "The Next's own core on an
Issue 2 or 3").

Default setting (new distribution):
timing=8


18. default
this setting bridges the global configuration section with the per-personality 
configuration section/menu and selects which of the machine personalities that 
follow will be the one that boots by default. Entries are 0-based so the default
(0) actually means the 1st entry in the list

Default setting:
default=0


19. dma
This setting enables(1) or disables (0) the onboard DMA controller. 
The controller type is determined by which port is accessed and can be either 
Z80DMA or ZXNDMA. See the NextREG and zxnDMA documentation for details.

default=0


20. keyb_issue
This setting enables Issue 2 (1) keyboard emulation or selects the default 
Issue 3 (0). Only applies to very old software.

default=0


21. ay48
This setting enables (1) or disables  (0) the presence of the base (128K style)
AY chip while in 48K mode. This is needed for certain programs that identify 
erroneously a 48K personality as 128K.

default=0


22. uart_i2c
This setting enables (1) or disables (0) the I2C and UART devices

default=1


23. kmouse
This setting enables (1) or disables (0) the Kempston Mouse.
default=1


24. ulaplus
This setting enables (1) or disables (0) support for the ULA+ ULA extensions

default=1


25. hdmisound
This settings enables (1) or disables (0) sound output from the digital video
port. Sound is still being output by the audio out jack in the back.

default=1


26. beepmode
This setting disables (1) or enables (0) mixing of the beeper channel in the 
audio stream output. If set to disabled, beeper audio will only come from the 
internal speaker.

default=0


27. buttonswap
This setting enables (1) or disables (0) swapping of the left/right mouse
buttons.

default=0


28. mousedpi
This setting selects the sensitivity to mouse movement:
0 = Low DPI mouse
1 = Normal DPI mouse
2 = Medium DPI mouse
3 = High DPI mouse

default=1


29. espreset
This setting (1) asserts and holds the reset of the ESP WiFi module and the
expansion bus when the firmware starts the chosen personality (nextreg 0x02,
bit 7). With the default (0) they are not held in reset.

default=0


30. expbus
(From FW v1.46.) This setting turns the expansion bus on (1) or off (0) for
the personalities that are not NextZXOS's; NextZXOS sets the bus itself, so
a personality whose main ROM is NextZXOS's (enNextZX.rom, enNextLG.rom) is
not changed by it. With the bus on, the CPU runs at 3.5 MHz. Power the Next
off before you plug a peripheral into the expansion bus, or take one out.
Older firmware ignores this setting, and drops it when it writes config.ini.

default=0


31. pidebug
(From FW v1.46.) This setting (1) turns on the core's debug interface for a
Raspberry Pi Zero on the Pi header, for every personality: the firmware sets
nextreg 0xA0 to 2 before it starts the personality. The Pi can then pause
the CPU, step it, and read or write its registers, the memory and the
nextregs while the machine runs. Only a core of 3.03.00 or later is changed
by it; with an older core, or with the default (0), nextreg 0xA0 is not
written. While the interface is on, the Pi header's SPI pins (GPIO 7 to 11)
belong to the Pi, so a program cannot use them as an SPI master. A hard
reset turns the interface off again. Older firmware ignores this setting,
and drops it when it writes config.ini.

default=0


Per-Personality Settings: menu.ini and menu.def
===============================================
The per-personality settings group serves three functions:
1. Create a boot menu entry per-line
2. Describe each machine personality's type as well as the display that's 
   connected to it
3. Override -if required- some global settings specifically for that personality

The SD card supplied with your Next comes with a default set of peronsality
menu items in the menu.def file. This file will be replaced whenever you
update your SD card from a new distribution, so it is advisable that you do
not change it.

If you want to add or remove personalities from the menu, first you should
copy or rename the menu.def file to menu.ini, and then make all your desired
changes to the menu.ini file.

When booting, the Next will use the menu.ini file if it is present; only if it
is missing will the default menu file (menu.def) be used.


You will need one line starting with "menu=" per-personality up to a maximum of 
32 lines as follows:

menu="Name of machine",Type,Display,Main_ROM_Image_File,
      divMMC_ROM_Image_File,MF_ROM_Image_File,Frequency

"Name of machine" is a meaninful name describing what this machine-personality 
                  is. 
                  Note: Make sure that the name is 32 characters long or shorter
                  as specifically for the Boot menu/Editor modules only standard
                  Spectrum resolution and fonts are supported.

e.g. ZX Spectrum 128K UK

Type can be one of the following: 0 (48K Spectrum), 
                                  1 (128K/+2 -grey- Spectrum), 
                                  2 (+2A/+3/Next), 
                                  3 (Soviet clone-style timings 128K Spectrum)
                                  
The machine type controls what roms are loaded (so it will prevent paging in 
non-existent roms via ports 7ffd, 1ffd) and which multiface model is implemented
The Firmware can use that information to further modify the machine's timing 
model to accurately reflect the operation of the specific personality chosen.

Display can be a number from 0 to 6 for VGA or 7 for Digital. This takes as a 
base the 50_60hz setting in the Global settings group and modifies the sync 
frequency in steps of approximately 1Hz to facilitate screen "lock" according to
your monitor. As the number is increased, the realtime speed of the machine 
increases with frame rates rising with it toward a rate VGA monitors may be able
to accept.  The relative timings of all the hardware remains intact so that the
machine will continue to generate a correct display with the spectrum's original
video frame.. Setting 7 (Digital) completely modifies the timings to make the 
display compatible with modern HDMI/DVI monitors as well as changing the aspect 
ratio and border size (Especially for the 60Hz Digital setting 7). 
Many HDMI/DVI monitors will work with a setting of 0 to 6 however ALL HDMI/DVI
monitors will work with a setting of 7.
A setting of 8 allows the video testing boot module to set the screen according
to the user's input during boot (See timing setting above)

Main_ROM_Image_File is a ROM image file that's appropriate for the machine type
you've selected in the previous setting e.g. 48.rom for a standard 48K ZX 
Spectrum and which MUST be located in c:/machines/next/.

divMMC_ROM_Image_File. If this is set, then the global divMMC setting is 
overriden and the filename defined is used in lieu of the default esxmmc.bin. 
This rom image file is also expected to be found in c:/machines/next/ and lastly,

MF_ROM_Image_File, if this is set then the Global configuration for MF hardware 
is overriden, the hardware is enabled and the rom image file used is the one you
specify. This file should also be located in c:/machines/next/

Frequency, if it is 50 or 60, is the personality's own: the machine starts
at 50 Hz or 60 Hz whatever the 50_60hz setting is. Leave it out to use the
setting. Leave the ROM fields before it empty to use their defaults, e.g.
menu=Microdigital TK90X v1,0,8,tk90x1.rom,,,60
for a 60 Hz machine. FW 1.45 and earlier ignore this field.


e.g. menu=ZX Spectrum 128K,1,7,128Kalt.rom 
will add a boot menu entry that's enabling the 128K toastrack type with a bug 
fixed rom named 128Kal.rom and Digital display type. If divMMC is enabled in 
global settings this will require the presence of an esxDOS rom and if MF is 
enabled then it will require the presence of MF128.ROM
