<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.specnext.dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Johnnyo</id>
	<title>SpecNext Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.specnext.dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Johnnyo"/>
	<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/Special:Contributions/Johnnyo"/>
	<updated>2026-08-01T02:22:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Memory_map&amp;diff=41981</id>
		<title>Memory map</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Memory_map&amp;diff=41981"/>
		<updated>2026-07-29T21:03:39Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: added NextRegNo|$8E note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Next supports two memory management models which operate in tandem. One is a unique memory management system for the Next. The other is an expanded version of the memory manager from the original Spectrum 128 and +2/+3 series.&lt;br /&gt;
&lt;br /&gt;
== Global Memory Map ==&lt;br /&gt;
&lt;br /&gt;
The total available RAM space of the Next is 768k on an unexpanded Next, or 1792k on a Next expanded to 2Mb. (The base Next has 1mb of memory but 256k of it is reserved for the ROMs and firmware.)&lt;br /&gt;
&lt;br /&gt;
The Z80 processor in the Next can access only 64k of memory at a time, and so the memory is divided into &#039;&#039;banks&#039;&#039; which are used in determining which memory it sees. Spectrum 128k memory management, and [[NextBASIC]], use 16k banks. Next memory management via machine code uses 8k banks.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 16k-bank !! 8k-bank !! True Address !! Size !! Description || FPGA Core Selector&lt;br /&gt;
|-&lt;br /&gt;
| - || - || $000000-$00ffff || 64K || ZX Spectrum ROM ||  A20:A16 = 00000&lt;br /&gt;
|-&lt;br /&gt;
| - || - || $010000-$011fff || 8K || divMMC ROM || A20:A16 = 00001,000&lt;br /&gt;
|-&lt;br /&gt;
| - || - || $012000-$013fff || 8K || Reserved for future Alt ROM2 +3 || A20:A16 = 00001,001&lt;br /&gt;
|-&lt;br /&gt;
| - || - || $014000-$017fff || 16K || Multiface ROM,RAM || A20:A16 = 00001,01&lt;br /&gt;
|-&lt;br /&gt;
| - || - || $018000-$01bfff || 16K || Alt ROM0 128k || A20:A16 = 00001,10&lt;br /&gt;
|-&lt;br /&gt;
| - || - || $01c000-$01ffff || 16K || Alt ROM1 48k  || A20:A16 = 00001,11&lt;br /&gt;
|-&lt;br /&gt;
| - || - || $020000-$03ffff || 128K || divMMC RAM || A20:A16 = 00010&lt;br /&gt;
|-&lt;br /&gt;
| 0-7 || 0-15 || $040000-$05ffff || 128K || ZX Spectrum RAM || A20:A16 = 00100&lt;br /&gt;
|-&lt;br /&gt;
| 8-15 || 16-31 || $060000-$07ffff || 128K || Extra RAM ||&lt;br /&gt;
|-&lt;br /&gt;
| 16-47 || 32-95 || $080000-$0fffff || 512K || 1st extra IC RAM (available on unexpanded Next) ||&lt;br /&gt;
|-&lt;br /&gt;
| 48-79 || 96-159 || $100000-$17ffff || 512K || 2nd extra IC RAM (only available on expanded Next) ||&lt;br /&gt;
|-&lt;br /&gt;
| 80-111 || 160-223 || $180000-$1fffff || 512K || 3rd extra IC RAM (only available on expanded Next) ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally, the first few pages have certain uses and traits summarised below:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 16k-banks !! 8k-banks !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0-1 || Standard RAM, maybe used by esxDOS.  Initially mapped to $c000-$ffff.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2-3 || Standard RAM, contended on 128, may be used by esxDOS, RAMdisk on NextZXOS.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 4-5 || Standard RAM.  Initially mapped to $8000-$bfff.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 6-7 || Standard RAM, contended on 128, may be used by esxDOS, RAMdisk on NextZXOS.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 8-9 || Standard RAM, contended on +2/+3, RAMdisk on NextZXOS.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 10-11 || ULA Screen, contended except on Pentagon, cannot be used by [[NextBASIC]] commands.  Initially mapped to $4000-$7fff.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 12-13 || Standard RAM, contended on +2/+3, RAMdisk on NextZXOS.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 14-15 || ULA Shadow Screen, contended except on Pentagon, NextZXOS Workspace, cannot be used by [[NextBASIC]] commands&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 16-17 || Next RAM, Default Layer 2, NextZXOS screen and extra data, cannot be used by [[NextBASIC]] commands&lt;br /&gt;
|-&lt;br /&gt;
| 9-10 || 18-21 || Next RAM, Rest of default Layer 2&lt;br /&gt;
|-&lt;br /&gt;
| 11-13 || 22-27 || Next RAM, Default Layer 2 Shadow Screen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Please note that NextZXOS moves the Layer 2 bank assignments. Therefore, Layer 2, after NextZXOS boots, is mapped to 16k-banks 9-11 (8k-banks 18-23). The Layer 2 shadow memory is also assigned to 16k-banks 9-11 (8k-banks 18-23).&lt;br /&gt;
&lt;br /&gt;
== Z80 Visible Memory map ==&lt;br /&gt;
&lt;br /&gt;
At start up, the 16-bit address space of the Z80 is mapped to memory as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Area !! 16k-slot !! 8k-slot !! Default 16k-bank !! Default 8k-bank !! Description&lt;br /&gt;
|-&lt;br /&gt;
| $0000-$1fff || rowspan=2 | 1 || 0 || rowspan=2 | ROM || ROM (255) || Normally ROM. R/W redirect by [[Layer 2]]. IRQ and NMI routines here.&lt;br /&gt;
|-&lt;br /&gt;
| $2000-$3fff || 1 || ROM (255) || Normally ROM. R/W redirect by [[Layer 2]].&lt;br /&gt;
|-&lt;br /&gt;
| $4000-$5fff || rowspan=2 | 2 || 2 || rowspan=2 | 5 || 10 || Normally used for normal/shadow ULA screen. &lt;br /&gt;
|-&lt;br /&gt;
| $6000-$7fff || 3 || 11 || Timex ULA extended attribute/graphics area.&lt;br /&gt;
|-&lt;br /&gt;
| $8000-$9fff || rowspan=2 | 3 || 4 || rowspan=2 | 2 || 4 || Free RAM. &lt;br /&gt;
|-&lt;br /&gt;
| $a000-$bfff || 5 || 5 || Free RAM.&lt;br /&gt;
|-&lt;br /&gt;
| $c000-$dfff || rowspan=2 | 4 || 6 || rowspan=2 | 0 || 0 || Free RAM. Only this area is remappable by 128 memory management.&lt;br /&gt;
|-&lt;br /&gt;
| $e000-$ffff || 7 || 1 || Free RAM. Only this area is remappable by 128 memory management.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Memory decoding order ===&lt;br /&gt;
&lt;br /&gt;
(check also current [https://gitlab.com/SpectrumNext/ZX_Spectrum_Next_FPGA/-/blob/master/cores/zxnext/src/zxnext.vhd#L2918 VHDL source])&lt;br /&gt;
&lt;br /&gt;
The 0-16k area could be remapped by several different mechanics, the priority order of these (from highest priority to lowest):&lt;br /&gt;
# bootrom&lt;br /&gt;
# multiface&lt;br /&gt;
# divmmc&lt;br /&gt;
# layer 2 mapping&lt;br /&gt;
# mmu&lt;br /&gt;
# config mode&lt;br /&gt;
# romcs expansion bus&lt;br /&gt;
# rom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The 16k-48k area is either mapped by MMU or overshadowed by Layer2 mapping:&lt;br /&gt;
# layer 2 mapping&lt;br /&gt;
# mmu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally the remaining top 16k, the 48k-64k area is mapped only by MMU.&lt;br /&gt;
&lt;br /&gt;
Additionally, there&#039;s 16KB + 8KB KB which exist in two instances: as an &amp;quot;internal bram&amp;quot; and as an &amp;quot;external sram&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
Accesses to (the RAM of 16KB) &amp;quot;bank 5&amp;quot; or (the first 8KB RAM of the RAM of 16KB) &amp;quot;bank 7&amp;quot; always go to internal bram with the following three exceptions:&lt;br /&gt;
&lt;br /&gt;
1 &#039;&#039;Layer 2 itself has a direct connection to external sram&#039;&#039; so while (the core is) reading bytes to generate video, all bytes read (for Layer 2) come from external sram.  It (Layer 2) has no connection to internal bram so its &amp;quot;bank 5&amp;quot; or &amp;quot;bank 7&amp;quot; accesses are from external sram and not internal bram.&lt;br /&gt;
&lt;br /&gt;
2 &#039;&#039;Layer 2 mapping is a mapping to external sram only.&#039;&#039;  So (in the context of Layer 2 mapping) &amp;quot;bank 5&amp;quot; or &amp;quot;bank 7&amp;quot; will not come from internal bram but from external sram which is how the cpu can uncover that otherwise hidden memory in external sram.&lt;br /&gt;
&lt;br /&gt;
3 The config mapping is also an external sram mapping.&lt;br /&gt;
&lt;br /&gt;
== Paging techniques ==&lt;br /&gt;
&lt;br /&gt;
=== 128-style memory management ===&lt;br /&gt;
&lt;br /&gt;
128-style memory management can only alter the bank addressed at $c000 (16k-slot 4, or 8k-slot 7-8). The active 16k-bank at $c000 is selected by writing the 3 LSBs of the 16k-bank number to the bottom 3 bits of [[Memory_Paging_Control | Port $7FFD]], and the 3 MSBs to the bottom 3 bits of [[Next_Memory_Bank_Select | Port $DFFD]]. (The reason for the division is that the original Spectrum 128, having only 128k of memory, only needed 3 bits.)&lt;br /&gt;
&lt;br /&gt;
On an unexpanded Next, this allows any 16k-bank to be paged in at $c000. On an expanded Next, there are not enough bits available to access the banks at the bottom of the expanded memory, so Next memory management must be used to access these.&lt;br /&gt;
&lt;br /&gt;
If you are using the standard interrupt handler or OS routines, then any time you write to [[Memory_Paging_Control | Port $7FFD]] you should also store the value at $5B5C. Any time you write to [[Plus_3_Memory_Paging_Control | Port $1FFD]] you should also store the value at $5B67. There is no corresponding system variable for the Next-only [[Next_Memory_Bank_Select | Port $DFFD]] and standard OS routines may not support the extended banks properly.&lt;br /&gt;
&lt;br /&gt;
=== 128 Special Paging Mode ===&lt;br /&gt;
&amp;quot;Special paging mode&amp;quot; (also called &amp;quot;AllRam mode&amp;quot; or &amp;quot;CP/M mode&amp;quot;) is enabled by writing a value with the LSB set to [[Plus_3_Memory_Paging_Control | Port $1FFD]]. Depending on the 3 low bits of this value a memory configuration is selected as follows:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bits !! Slot 1 !! Slot 2 !! Slot 3 || Slot 4 &lt;br /&gt;
|-&lt;br /&gt;
| %001 || 0 || 1 || 2 || 3 &lt;br /&gt;
|-&lt;br /&gt;
| %011 || 4 || 5 || 6 || 7&lt;br /&gt;
|-&lt;br /&gt;
| %101 || 4 || 5 || 6 || 3&lt;br /&gt;
|-&lt;br /&gt;
| %111 || 4 || 7 || 6 || 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Layer 2 Switching ===&lt;br /&gt;
Layer 2 switching can allow one of the 16k-banks to be &#039;&#039;written to&#039;&#039; or &#039;&#039;read from&#039;&#039; in 16k-slot 1, by writing the 16k-bank number to {{NextRegNo|$12}} and then enabling Layer 2 paging by setting the paging bits in [[Layer_2_Access_Port | Port $123B]]. You can use also the {{NextRegNo|$13}} for the same purpose (change of register $12 is immediately visible at display, while register $13 is not related to display in any way, it works only as bank selector for writing into slot 1). Since core 3.0 you can page not only first 16kiB, but whole 48kiB of Layer 2 to address region $0000..$BFFF).&lt;br /&gt;
&lt;br /&gt;
Writing to/reading from this paging area will then write/read the appropriate area of memory, whereas the other operation may remain unaffected and use the area mapped by other memory management.&lt;br /&gt;
&lt;br /&gt;
Layer 2 is actually 3 banks big, so using Layer 2 controls to access different &amp;quot;sections&amp;quot; of Layer 2 can access the two following banks after the one selected in register $12/$13.&lt;br /&gt;
&lt;br /&gt;
=== Next Memory Management ===&lt;br /&gt;
The 8k-bank accessed in an 8k-slot is selected by writing the 8k-bank number to bits 7-0 of the 8 Next registers from {{NextRegNo|$50}} upwards. $50 addresses 8k-slot 0, $51 addresses 8k-slot 1, and so on.&lt;br /&gt;
&lt;br /&gt;
In addition, in 8k-slots 0 and 1 only, the ROM can be paged in by selecting the otherwise nonexistent 8k-page $FF. Whether the high or the low 8k of the ROM is mapped is determined by which 8k-slot is used.&lt;br /&gt;
&lt;br /&gt;
Also note that since core 3.1.1 there&#039;s {{NextRegNo|$8E}}, and it affects the same memory mapping aspects as explained in 128-style memory management and all the related ports .&lt;br /&gt;
&lt;br /&gt;
=== Interactions between paging methods ===&lt;br /&gt;
In normal mode, changes made in 128 style and Next style memory management are synchronized. The most recent change always has priority. This means that using 128-style memory management to select a new 16k-bank in 16k-slot 4 will update the MMU registers for the two 8k-slots with the corresponding 8k-bank numbers.&lt;br /&gt;
&lt;br /&gt;
However, enabling 128 special paging mode (AllRam mode) mode will &#039;&#039;&#039;override the Next MMU&#039;&#039;&#039;. The bank selections from the AllRam mode table will override the set pages in the Next registers. The MMU registers can still be changed, but they will have no effect until special paging mode is disabled.&lt;br /&gt;
&lt;br /&gt;
Since the 128-style memory management ports are not readable, there is no synchronization applicable in the other direction.&lt;br /&gt;
&lt;br /&gt;
== ROM paging and selection ==&lt;br /&gt;
$0000-$3fff is usually mapped to ROM. This area can only be fully remapped using Next memory management. ROM is not considered one of the numbered banks; it is mapped to the two 8k-banks by default, or by setting their 8k-bank numbers to 255. &lt;br /&gt;
&lt;br /&gt;
The 128k Spectrum has 2 ROM pages. Which of these is mapped is selected by altering Bit 4 of [[Memory_Paging_Control | Port $7FFD]]. The +2a/+3 has 4 ROM pages; the extra bit needed to select between these is bit 2 of [[Plus_3_Memory_Paging_Control | Port $1FFD]]. This maintains compatibility with the original machines&#039; ROM paging as long as the ROM is not paged out.&lt;br /&gt;
&lt;br /&gt;
=== Paging out ROM ===&lt;br /&gt;
ROM can be paged out by enabling AllRam mode, or by using Next memory management. Beware that some programs may assume that they can find ROM service routines at fixed addresses between $0000-$3fff. More importantly, if the default interrupt mode (IM 1) is set, the Z80 &#039;&#039;&#039;will&#039;&#039;&#039; jump the program counter to $0038 every frame expecting to find an interrupt handler there. If it does not, pain and suffering will likely result. [[Extended Z80 instruction set#DI|DI]] is your friend. On the plus side, this does allow you to write your own interrupt handler without the nuisance of using IM 2.&lt;br /&gt;
&lt;br /&gt;
Activating [[Layer 2]]&#039;s paging will not affect ROM operation, because it only remaps &#039;&#039;writes&#039;&#039;, not reads. With core 3.0 you can now enable this paging also for &#039;&#039;read&#039;&#039; operation, that will hide ROM data and for example IM 1 interrupt request will execute the data from the Layer 2 bank.&lt;br /&gt;
&lt;br /&gt;
== Screen ==&lt;br /&gt;
16k-Bank 5 is the bank read by the ULA to determine what to show on screen. The ULA connects directly to the larger memory space ignoring mapping; the screen is always 16k-Bank 5, no matter where in memory it is (or if it is switched in at all). Setting bit 3 of [[Memory_Paging_Control | Port $7FFD]] will have the ULA read from 16k-bank 7 (the &amp;quot;shadow screen&amp;quot;) instead, which can be used as an alternate screen. Beware that &#039;&#039;&#039;this does not map 16k-bank 7 into RAM&#039;&#039;&#039;; to alter 16k-bank 7 it must be mapped by other means.&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Memory_Mapping_Register&amp;diff=41980</id>
		<title>Memory Mapping Register</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Memory_Mapping_Register&amp;diff=41980"/>
		<updated>2026-07-29T20:59:12Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: slight reformatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NextRegister&lt;br /&gt;
|Number=$8E&lt;br /&gt;
|Readable=Yes&lt;br /&gt;
|Writable=Yes&lt;br /&gt;
|ShortDesc=Control classic 128K Spectrum memory mapping&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
    bit 7 = port 0xdffd bit 0         \  RAM&lt;br /&gt;
    bits 6:4 = port 0x7ffd bits 2:0   /  bank 0-15&lt;br /&gt;
    R bit 3 = 1&lt;br /&gt;
    W bit 3 = 1 to change RAM bank,&lt;br /&gt;
            = 0 no change to mmu6 / mmu7 / RAM bank in ports 0x7ffd, 0xdffd&lt;br /&gt;
    bit 2 = port 0x1ffd bit 0            paging mode&lt;br /&gt;
    If bit 2 = paging mode = 0 (normal)&lt;br /&gt;
     bit 1 = port 0x1ffd bit 2         \  ROM&lt;br /&gt;
     bit 0 = port 0x7ffd bit 4         /  select&lt;br /&gt;
    If bit 2 = paging mode = 1 (special allRAM)&lt;br /&gt;
     bit 1 = port 0x1ffd bit 2         \  all&lt;br /&gt;
     bit 0 = port 0x1ffd bit 1         /  RAM&lt;br /&gt;
&lt;br /&gt;
: Writes can affect all ports  {{PortNo|$7FFD}},  {{PortNo|$DFFD}},  {{PortNo|$1FFD}}&lt;br /&gt;
: Writes always change the ROM / allRAM mapping&lt;br /&gt;
: Writes immediately change the current mmu mapping as if by port write&lt;br /&gt;
&lt;br /&gt;
(new register since core 3.1.1)&lt;br /&gt;
&lt;br /&gt;
(note: Next registers with number higher than $7F are inaccessible from Copper code)&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41979</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41979"/>
		<updated>2026-07-24T09:58:47Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: emulation of non-next targets out of scope of here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
(The following table is ordered alphabetically)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/jorgegv/jnext JNext]||[https://github.com/jorgegv Jorge González]|| ||An emulator with debugger and automated control for CI/CD. Currently in beta.||Any||[https://github.com/jorgegv/jnext Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go. Early in development but improves. Its documentation still claims more than it actually does: many games don&#039;t run or run wrong, even the simple ones. (Note: The status of emulation of non-Next Spectrums irrelevant for this wiki -- hundreds of emulators are intentionally not listed). ||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41978</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41978"/>
		<updated>2026-07-21T08:20:00Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: keeping the table in alphabetical order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
(The following table is ordered alphabetically)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/jorgegv/jnext JNext]||[https://github.com/jorgegv Jorge González]|| ||An emulator with debugger and automated control for CI/CD. Currently in beta.||Any||[https://github.com/jorgegv/jnext Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go. Early in development but improves. Its documentation still claims more than it actually does: many games don&#039;t run or run wrong, even the simple ones. (Note: The status of emulation of non-Next Spectrums irrelevant for this wiki -- hundreds of emulators are intentionally not listed). ||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41977</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41977"/>
		<updated>2026-07-21T08:17:33Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: removing what&amp;#039;s obvious from the &amp;quot;Any&amp;quot; entry in the table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
(The following table is ordered alphabetically)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go. Early in development but improves. Its documentation still claims more than it actually does: many games don&#039;t run or run wrong, even the simple ones. (Note: The status of emulation of non-Next Spectrums irrelevant for this wiki -- hundreds of emulators are intentionally not listed). ||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/jorgegv/jnext JNext]||[https://github.com/jorgegv Jorge González]|| ||An emulator with debugger and automated control for CI/CD. Currently in beta.||Any||[https://github.com/jorgegv/jnext Yes]||Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41975</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41975"/>
		<updated>2026-07-10T05:45:26Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: zx_go clarify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
(The following table is ordered alphabetically)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go. Early in development but improves. Its documentation still claims more than it actually does: many games don&#039;t run or run wrong, even the simple ones. (Note: The status of emulation of non-Next Spectrums irrelevant for this wiki -- hundreds of emulators are intentionally not listed). ||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41974</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41974"/>
		<updated>2026-07-10T05:43:46Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: clarify the note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
(The following table is ordered alphabetically)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go. Its documentation still claims more than it actually does: many games don&#039;t run or run wrong, even the simple ones. (Note: The status of emulation of non-Next Spectrums irrelevant for this wiki -- hundreds of emulators are intentionally not listed). ||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41973</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41973"/>
		<updated>2026-07-10T05:40:57Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: more true zx_go description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
(The following table is ordered alphabetically)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go. Its documentation still claims more than it actually does: many games don&#039;t run or run wrong, even the simple ones. Emulation of non-Next Spectrums irrelevant here. ||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41972</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41972"/>
		<updated>2026-07-10T05:40:26Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* WARNING: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
(The following table is ordered alphabetically)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go. Comprehensive debugger. Its documentation still claims more than it actually does: many games don&#039;t run or run wrong, even the simple ones. Emulation of non-Next Spectrums irrelevant here. ||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41969</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41969"/>
		<updated>2026-06-18T23:27:06Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: keeping the table in alphabetical order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
(The following table is ordered alphabetically)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go, seemingly still in its early development phase. Boots into the NextZXOS. Fails to open the tap file. NextBASIC Invaders game (from the distro) doesn&#039;t work, and many other games.||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41968</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41968"/>
		<updated>2026-06-18T23:23:38Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: wording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go, seemingly still in its early development phase. Boots into the NextZXOS. Fails to open the tap file. NextBASIC Invaders game (from the distro) doesn&#039;t work, and many other games.||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41967</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41967"/>
		<updated>2026-06-18T19:58:48Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* WARNING: */ MAME has at least &amp;quot;good&amp;quot; Next support now.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with good Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go, seemingly still in its early development phase. Boots into the NextZXOS. Fails to open the tap file. NextBASIC Invaders don&#039;t work, and many other games.||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41966</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41966"/>
		<updated>2026-06-18T19:56:39Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: minimizing more&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with relatively recent Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go, seemingly still in its early development phase. Boots into the NextZXOS. Fails to open the tap file. NextBASIC Invaders don&#039;t work, and many other games.||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41965</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41965"/>
		<updated>2026-06-18T17:47:15Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: more honest zx_go state&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with relatively recent Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go, seemingly still in its early development phase. Boots into the NextZXOS, but doesn&#039;t show all directories. Fails to open the tap file. Fails to start .ls dot command. Writes to the disk go missing (e.g. welcome is not renamed).||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41964</id>
		<title>Emulators</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Emulators&amp;diff=41964"/>
		<updated>2026-06-18T17:38:29Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* WARNING: */ removing non-Next relevant feature list from zx_go, honest state&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===== WARNING: =====&lt;br /&gt;
&lt;br /&gt;
The current Next emulators are work-in-progress, missing several features of real HW Next, and emulating other features in less than cycle-accurate way (which become a &amp;quot;norm&amp;quot; for classic ZX Spectrum after two decades of emulators development). The differences in results between real Next and CSpect or ZEsarUX are to be expected - as a developer test your SW also with real HW to find any problems early. It may also help to read the known-bugs pages to have some rough idea what works and how accurately. There&#039;re also multiple test-suites and free games and demos which you can try to go through and compare the emulator output with real machine, to get familiar with the differences and adjust your workflow and expectations.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure to explore the command line options and configuration of each emulator, as there are multiple ways how to run them with different fidelity of emulation. When in doubt, you are welcome to join the official ZX Spectrum Next discord chat and ask for help at #emulator-help channel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently the most UI and performance friendly emulator seems to be #CSpect, the most accurate and performant emulator is MAME.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Name||Author||Known bugs||Description||OS||Source||Maintained&lt;br /&gt;
|-&lt;br /&gt;
|[https://mdf200.itch.io/cspect CSpect]||[https://lemmings.info/about/ Mike Dailly]||[[CSpect:known bugs|List]]||Emulates many features of the Next and includes a fully featured debugger, complete with 24bit breakpoints and an assembler||Windows ([https://lemmings.info/installing-cspect-on-a-mac/ mac]/[[Development_Tools:Linux_setup##CSpect_emulator|linux]] with mono - mostly works)||No||[https://www.patreon.com/posts/crash-and-cspect-143597332 Statement of maintenance and support]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.mamedev.org/ MAME]||[https://github.com/holub holub] (Next), many contributors (MAME)||[[MAME:known bugs|List]]‎||Mature multi-system emulator with relatively recent Next support. See [[MAME:Installing|installation notes]].||Any||[https://github.com/mamedev/mame Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://gitlab.com/garrylancaster/zenext ZENext]||[https://github.com/chernandezba César Hernández Bañó], [https://gitlab.com/garrylancaster Garry Lancaster]|| |||ZX Next-only fork of ZEsarUX emulating most of the core 3.1.10 features to make it run NextZXOS 2.07 or 2.09 (missing some features like CTC timers). See [[ZENext:Installing|installation notes]]||Any (more easily: only Linux)||[https://gitlab.com/garrylancaster/zenext Yes]||Occasionally&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/chernandezba/zesarux/releases ZEsarUX]||César Hernández Bañó|||[[ZEsarUX:known bugs|List]]||A full feature emulator including a debugger - sometimes updated to support Next (TBBlue)||Any||[https://github.com/chernandezba/zesarux Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 ZESERUse]||César Hernández Bañó, [https://github.com/ped7g Peter Helcmanovsky]||[[ZESERUse:known bugs|List]]||Fork of older ZEsarUX 8.2 with improved emulation accuracy of (rather old) core 3.1.5||Any||[https://github.com/ped7g/zesarux/tree/tbblue_small_fixes2 Yes]||Rarely&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/conorarmstrong/zx_go zx_go]||Conor Armstrong|| ||An emulator written in Go, seemingly still in its early development phase. Boots into the NextZXOS, but doesn&#039;t show all directories. Fails to open the tap file. Fails to start .ls dot command.||Any||[https://github.com/conorarmstrong/zx_go Yes]||Yes&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.desdes.com/products/oldfiles/zeus.htm Zeus]||[https://www.desdes.com/ Simon Brattel]|| || A PC cross-assembler which includes an IDE and Spectrum 48/128/+2/+3 emulator. Includes support for Next MMU banking, sprites and UART only, with remote debugging on Next hardware.||Windows||No||No&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=CTC&amp;diff=41960</id>
		<title>CTC</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=CTC&amp;diff=41960"/>
		<updated>2026-06-09T15:36:16Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CTC&lt;br /&gt;
&lt;br /&gt;
The CTC has been temporarily reduced to four channels from eight.&lt;br /&gt;
&lt;br /&gt;
Eight independent CTC channels are available on ports 0x183B through 0x1F3B.  These perform counter / timer functions that can be used to generate timer interrupts or to generate interrupts on behalf of physical signals.&lt;br /&gt;
&lt;br /&gt;
The CTC is a standard Zilog part.  Its datasheet can be found at http://www.zilog.com/docs/z80/ps0181.pdf and the user manual at &amp;quot;Z80 CPU Peripherals User Manual UM0081&amp;quot; http://www.zilog.com/docs/z80/um0081.pdf The Zilog documentation is ambiguous around how soft resets are treated so the following clarifies some points in the Next&#039;s implementation.&lt;br /&gt;
&lt;br /&gt;
: 1. Hard reset requires a control word to be written with D2 = 1 (time constant follows) otherwise the channel effectively ignores the control word and will remain in the hard reset state.&lt;br /&gt;
&lt;br /&gt;
: 2. Soft reset is generated when the control word&#039;s D1 = 1.  if D2 = 0, the channel will enter the hard reset state.  If D2 = 1 the channel expects a time constant to be written next and after that the counter/timer will run as expected.&lt;br /&gt;
&lt;br /&gt;
: 3. Changing the trigger edge selection in bit 4 counts as a clock edge. A timer waiting for a clock edge to start will start and in counter mode, the count will be decremented.&lt;br /&gt;
&lt;br /&gt;
: 4. ZC/TO is asserted for one clock cycle and not for the entire duration that the count is at zero.&lt;br /&gt;
&lt;br /&gt;
To soft reset a particular channel that is in an unknown state, a soft reset control word should be written twice with D2 = 0 (no time constant follows).&lt;br /&gt;
&lt;br /&gt;
At the moment, the ZC/TO output of each channel is fed into the CLK/TRG input of the succeeding channel so that time and count periods can be cascaded.  Channel 3&#039;s ZC/TO output is divided by two and drives the joystick&#039;s clock in io mode.&lt;br /&gt;
&lt;br /&gt;
The rate of clock input to the CTC&#039;s timer is not affected by the value in the NextReg 7.&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=CTC&amp;diff=41959</id>
		<title>CTC</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=CTC&amp;diff=41959"/>
		<updated>2026-06-09T15:35:38Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: user manual&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CTC&lt;br /&gt;
&lt;br /&gt;
The CTC has been temporarily reduced to four channels from eight.&lt;br /&gt;
&lt;br /&gt;
Eight independent CTC channels are available on ports 0x183B through 0x1F3B.  These perform counter / timer functions that can be used to generate timer interrupts or to generate interrupts on behalf of physical signals.&lt;br /&gt;
&lt;br /&gt;
The CTC is a standard Zilog part.  Its datasheet can be found at http://www.zilog.com/docs/z80/ps0181.pdf and the user manual at http://www.zilog.com/docs/z80/um0081.pdf The Zilog documentation is ambiguous around how soft resets are treated so the following clarifies some points in the Next&#039;s implementation.&lt;br /&gt;
&lt;br /&gt;
: 1. Hard reset requires a control word to be written with D2 = 1 (time constant follows) otherwise the channel effectively ignores the control word and will remain in the hard reset state.&lt;br /&gt;
&lt;br /&gt;
: 2. Soft reset is generated when the control word&#039;s D1 = 1.  if D2 = 0, the channel will enter the hard reset state.  If D2 = 1 the channel expects a time constant to be written next and after that the counter/timer will run as expected.&lt;br /&gt;
&lt;br /&gt;
: 3. Changing the trigger edge selection in bit 4 counts as a clock edge. A timer waiting for a clock edge to start will start and in counter mode, the count will be decremented.&lt;br /&gt;
&lt;br /&gt;
: 4. ZC/TO is asserted for one clock cycle and not for the entire duration that the count is at zero.&lt;br /&gt;
&lt;br /&gt;
To soft reset a particular channel that is in an unknown state, a soft reset control word should be written twice with D2 = 0 (no time constant follows).&lt;br /&gt;
&lt;br /&gt;
At the moment, the ZC/TO output of each channel is fed into the CLK/TRG input of the succeeding channel so that time and count periods can be cascaded.  Channel 3&#039;s ZC/TO output is divided by two and drives the joystick&#039;s clock in io mode.&lt;br /&gt;
&lt;br /&gt;
The rate of clock input to the CTC&#039;s timer is not affected by the value in the NextReg 7.&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41957</id>
		<title>MAME:Installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41957"/>
		<updated>2026-06-02T20:55:08Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* 1. Get MAME */ make the items as the lists&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.mamedev.org/ MAME] (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, later expanded to include video game consoles, old computers and other systems in software on modern personal computers and other platforms.&lt;br /&gt;
&lt;br /&gt;
MAME has supported the ZX Spectrum Next since version 0.267. The existing implementation is based on the v3.02.04 core and implements most of the features.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
You will need to install MAME, provide it with the Next firmware (&#039;ROM&#039;), and get the NextZXOS image:&lt;br /&gt;
&lt;br /&gt;
=== 1. Get MAME ===&lt;br /&gt;
Start with these official MAME releases. If you encounter crashes or other bugs, try replacing the MAME executable with holub&#039;s latest Continuous Integration (CI) builds as described at the end of this article.&lt;br /&gt;
&lt;br /&gt;
MAME for macOS now requires the SDL3 library.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Windows:&#039;&#039;&#039; Download [https://www.mamedev.org/release.html MAME for Windows].&lt;br /&gt;
* &#039;&#039;&#039;macOS:&#039;&#039;&#039; Download the [https://github.com/libsdl-org/SDL/releases/latest SDL3 library], and copy its &#039;&#039;&#039;SDL3.xcframework&#039;&#039;&#039; and &#039;&#039;&#039;share&#039;&#039;&#039; folders to ~/Library/Frameworks, as instructed in the included INSTALL.md file. Then download [https://sdlmame.lngn.net/ MAME for macOS].&lt;br /&gt;
* &#039;&#039;&#039;Linux:&#039;&#039;&#039; Install MAME from the flatpak repositories by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo flatpak install org.mamedev.MAME&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Windows and macOS will likely prevent you from launching MAME (and the SDL3 framework) directly for security reasons. See below on how to solve this.&lt;br /&gt;
&lt;br /&gt;
Alternatively, for the MAME platform as a whole, you can also check your package manager, or [https://docs.mamedev.org/initialsetup/compilingmame.html build from sources].&lt;br /&gt;
&lt;br /&gt;
* Git of official MAME: [https://github.com/mamedev/mame/ https://github.com/mamedev/mame/]&lt;br /&gt;
&lt;br /&gt;
* Git of Holub&#039;s fork: [https://github.com/holub/mame https://github.com/holub/mame] (may contain extra fixes and features before they are merged to official repository, from the Actions page, if you&#039;re logged in, the most recent executables could be downloaded).&lt;br /&gt;
&lt;br /&gt;
=== 2. Get TBBLUE (the Next &#039;boot ROM&#039;) ===&lt;br /&gt;
Put the file  [https://github.com/Threetwosevensixseven/NexCreator/raw/master/bootroms/tbblue.zip tbblue.zip] into MAME&#039;s &amp;lt;code&amp;gt;roms&amp;lt;/code&amp;gt; folder. Don&#039;t extract it; MAME will look for the zip file when the &amp;quot;tbblue&amp;quot; machine is selected.&lt;br /&gt;
&lt;br /&gt;
Note: The ROMs in this zip are what is embedded inside the FPGA core on real Next hardware. They&#039;re different from any ZX Spectrum machine ROMs you may be used to using, that are on the distro, SD card or SD image file.&lt;br /&gt;
&lt;br /&gt;
=== 3. Get the NextZXOS Image ===&lt;br /&gt;
Get an SD card image file of [https://www.specnext.com/latestdistro/ NextZXOS]. Note that &#039;&#039;&#039;some disk images published  on the official SpecNext.com site do not work with some emulators currently&#039;&#039;&#039; (the &amp;lt;code&amp;gt;latestdistro&amp;lt;/code&amp;gt; link points to the official location where the latest distribution can be found), but &#039;&#039;&#039;all images from &amp;lt;code&amp;gt;https://zxnext.uk/hosted/&amp;lt;/code&amp;gt; work with both MAME and CSpect&#039;&#039;&#039;, like [https://zxnext.uk/hosted/index_files/hdfimages/cspect-next-2gb.zip this SD card image in the zip archive]. Extract the image &amp;lt;code&amp;gt;cspect-next-2gb.img&amp;lt;/code&amp;gt; from the archive to use it, then point MAME to this SD card image with the &amp;lt;code&amp;gt;-hard1&amp;lt;/code&amp;gt; option (or select that file from the menu inside MAME).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
MAME looks for its configuration and helper files in specific (configurable) folders. By default, these are relative to the current working directory (cwd), i.e., from where you launched the executable. The &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file and folders like &amp;lt;code&amp;gt;roms, bgfx, plugins, language, ...&amp;lt;/code&amp;gt; are expected there, unless the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file specifies other paths. When launching through a desktop icon or menu, depending on the OS, the working directory is often defined by the properties of that launch shortcut. When launching MAME from the command line, the current directory is &amp;quot;cwd&amp;quot; (doh). On Linux, MAME will look for &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; first in the &amp;lt;code&amp;gt;~/.mame&amp;lt;/code&amp;gt; folder. You can use the option &amp;lt;code&amp;gt;-inipath&amp;lt;/code&amp;gt; to point MAME to a different path for the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
However, the fastest way to run a machine with a desired configuration is from the command prompt, without requiring a &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file. Most of the features are also available through MAME&#039;s UI, although that takes more time to configure.&lt;br /&gt;
&lt;br /&gt;
As an example, this invocation enables the UI, uses &amp;quot;crisp pixels&amp;quot;, starts in a window, doesn&#039;t display the starting gameinfo window (it can still be displayed interactively from the UI), disables the mouse, confirms before exiting MAME, and specifies the disk image (remember to adjust the path to it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mame -ui_active -nounevenstretch -aspect 2:1 -video bgfx  -bgfx_screen_chains unfiltered -window -skip_gameinfo -mouse_device none -confirm_quit tbblue -hard1 /path/to/cspect-next-2gb.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s cover some useful options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run inside a window and with no mouse support, until you get familiar with the UI keys:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; mame tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
To launch the Linux flatpak version using the same options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; flatpak run org.mamedev.MAME tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Activate UI keys on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -ui_active&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Don&#039;t show the info popup on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -skip_gameinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Run with debugger. If you don&#039;t request this on startup, you won&#039;t have access to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -debug&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Use &amp;quot;crisp&amp;quot; pixels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -nounevenstretch -aspect 2:1 -video bgfx -bgfx_screen_chains unfiltered&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;No joystick connected to PC (having this may slightly speed up MAME&#039;s startup, but &#039;&#039;remember to remove this part from the command line and the corresponding setting in the ini file if you do want to use a joystick&#039;&#039;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -joystickprovider none&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ask for confirmation when exiting MAME (otherwise it&#039;s easy to exit MAME accidentally by hitting ESC, especially when playing games or navigating menus):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -confirm_quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-universal official MAME documentation] for more advanced usage.&lt;br /&gt;
&lt;br /&gt;
= Security: Allowing MAME to Run on Windows and macOS =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Windows,&#039;&#039;&#039; you will need to confirm that you want to launch MAME by clicking &amp;quot;Run Anyway&amp;quot; on first launch. &#039;&#039;(More details needed here.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On macOS,&#039;&#039;&#039; MAME will not open at first. Instead, a dialog will appear saying:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;“mame” Not Opened. Apple could not verify “mame” is free of malware that may harm your Mac or compromise your privacy.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Click “Done”. Then open &#039;&#039;&#039;System Settings -&amp;gt; Privacy &amp;amp; Security&#039;&#039;&#039;, and scroll down to the message &#039;&#039;mame was blocked to protect your Mac.&#039;&#039; Click “Allow Anyway”.&lt;br /&gt;
&lt;br /&gt;
Now launch MAME again. A dialog will ask once more if you want to open “mame”. Click “Open Anyway”, and enter your password or use Touch ID when prompted by macOS.&lt;br /&gt;
&lt;br /&gt;
You will then need to &#039;&#039;&#039;repeat this process for the SDL3 framework.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From now on, you can launch this version of MAME without warnings. However, you &#039;&#039;&#039;will&#039;&#039;&#039; need to repeat this each time you update MAME or the SDL3 framework.&lt;br /&gt;
&lt;br /&gt;
= Keys =&lt;br /&gt;
&lt;br /&gt;
Keys are emulated in two modes: either to control the MAME emulator or completely dedicated to the emulated system (the Next). You can toggle between these two keyboard modes with ScrLk (on Win and Linux) or fn+delete (on Mac).&lt;br /&gt;
&lt;br /&gt;
Some UI keys:&lt;br /&gt;
* F3 - soft reset&lt;br /&gt;
* Shift+F3 - hard reset&lt;br /&gt;
* F4 - sprites/tiles/font viewer (Enter, ], [)&lt;br /&gt;
* F5 - pause emulation&lt;br /&gt;
* F6 - save state&lt;br /&gt;
* F7 - load state&lt;br /&gt;
* Tab - emulator settings&lt;br /&gt;
* ~ - menu&lt;br /&gt;
* ` (backtick) - debugger (when enabled by starting MAME with &amp;lt;code&amp;gt;-debug&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; on the command line)&lt;br /&gt;
* PgDwn (Linux/Mac), fn-Downarrow (MacBooks) or Insert (Win) - hold down to fast-forward emulation at maximum speed, e.g., to speed up booting the Next&lt;br /&gt;
* Esc - exit (exits menus but also the entire emulator - see &amp;lt;code&amp;gt;-confirm_quit&amp;lt;/code&amp;gt; option above)&lt;br /&gt;
* F11 - DivMMC NMI&lt;br /&gt;
* F12 - Multiface NMI&lt;br /&gt;
&lt;br /&gt;
Check [https://docs.mamedev.org/usingmame/defaultkeys.html default keys documentation] for more.&lt;br /&gt;
&lt;br /&gt;
= Changing the UI toggle key =&lt;br /&gt;
&lt;br /&gt;
Some laptops don&#039;t have a Scroll Lock key, so you may not be able to exit MAME if you run it in full-screen mode. In these cases, you can change the UI toggle key as follows:&lt;br /&gt;
&lt;br /&gt;
* Run MAME without any command line arguments (except maybe -window) to open its GUI.&lt;br /&gt;
* Push TAB and enter the General Settings menu.&lt;br /&gt;
* Go to Input Assignments -&amp;gt; User Interface -&amp;gt; Toggle UI controls and select a new key. I use Right Alt / Alt GR.&lt;br /&gt;
* Return to the previous menu twice, then choose Save Settings&lt;br /&gt;
&lt;br /&gt;
= Creating and manipulating NextZXOS SD card image =&lt;br /&gt;
&lt;br /&gt;
Most users wanting to emulate the Next using MAME will be fine using a pre-built SD card image downloaded from the site hosting best pre-made images (currently, [https://zxnext.uk/hosted zxnext.uk/hosted] ) website. The following guide is provided for anyone wanting to create a NextZXOS SD card image from scratch.&lt;br /&gt;
&lt;br /&gt;
Download the [https://www.specnext.com/latestdistro/ latest NextZXOS distribution zip file] (named something like sn-complete-WX.YZ.zip) and extract it into a new, empty directory.&lt;br /&gt;
&lt;br /&gt;
== Creating and populating a SD card image using hdfmonkey jjjs build ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.specnext.com/forum/viewtopic.php?t=2604 hdfmonkey &amp;quot;jjjs build&amp;quot;] is a variant of hdfmonkey tool which includes some unique features and its main archive (at the previously given link) also contains pre-built binaries for Windows x64, MacOS x64, MacOS Apple Silicon and Linux x64. (Alternatively, the process to build a local Linux version of the executable is described [[Development_Tools:Linux_setup#hdfmonkey_tool | here]] )&lt;br /&gt;
&lt;br /&gt;
If you extracted sn-complete-WX.YZ.zip into a subdirectory named &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt;, and you want to create a 1GB image called &amp;lt;code&amp;gt;NextZXOS.img&amp;lt;/code&amp;gt; and you have a jjjs build&amp;quot; of hdfmonkey, then it&#039;s enough to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hdfmonkey create NextZXOS.img 1G&lt;br /&gt;
hdfmonkey putdir NextZXOS.img snWXYZ /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line creates an empty 1GB image and formats it with the best FAT parameters suited to the size of the image.&lt;br /&gt;
&lt;br /&gt;
The second line recursively copies all the content of the directory &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt; to the image, preserving the directory structure inside, starting from the &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; in the image.&lt;br /&gt;
&lt;br /&gt;
One of the advantages of this method is that even if the image has a capacity of 1GB, it will use much less space on your hard drive until you fill up the image. On Linux or MacOS, a command &amp;lt;code&amp;gt;du -h NextZXOS.img&amp;lt;/code&amp;gt; shows the actual amount of disk space used by the image. On Windows the same information can be seen in the File Properties dialog.&lt;br /&gt;
&lt;br /&gt;
The fastest way to transfer a file or a directory (including its content, recursively) into an image is by using a single &amp;lt;code&amp;gt;put&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;putdir&amp;lt;/code&amp;gt;, if it&#039;s to transfer the directory file content to an existing directory) command of hdfmonkey.&lt;br /&gt;
&lt;br /&gt;
The most convenient tool to copy of all the content from the image to a folder outside of the image is 7-zip. On Windows, just use the 7-zip GUI. On MacOS and Linux, see: [[Development_Tools:Linux_setup#Extracting_all_files_from_the_sd-card_image]].&lt;br /&gt;
&lt;br /&gt;
=MAME Plugins and Scripts=&lt;br /&gt;
&lt;br /&gt;
Some MAME plugins and scripts that may be useful for Next developers and end users are listed [[MAME:Plugins_and_Scripts|here]]. They let you speed up the Next boot time, profile your NextBASIC or assembler code, and more.&lt;br /&gt;
&lt;br /&gt;
=Continuous Integration MAME Builds=&lt;br /&gt;
&lt;br /&gt;
MAME is updated on a release schedule, but due to the ongoing nature of development, including for the MAME Next machine, it can sometimes be useful to install a more recent build if it contains a new feature or bugfix you are interested in. Sometimes, this ongoing work is discussed on social media, such as the [https://discordapp.com/channels/556228195767156758/752197165891321886 Next Developer Discord].&lt;br /&gt;
&lt;br /&gt;
Continuous Integration (CI) builds are available from the GitHub Action pages of both:&lt;br /&gt;
&lt;br /&gt;
* the [https://github.com/mamedev/mame/actions https://github.com/mamedev/mame/actions -- primary MAME repo Actions pagee] and &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/holub/mame/actions https://github.com/holub/mame/actions -- Holub&#039;s GitHub repo Actions page].&lt;br /&gt;
&lt;br /&gt;
Both are newer builds than the latest official release, and Holub&#039;s repo still tends to contain the fixes still waiting to be accepted to the primary repo. MAME CI builds are available for Windows, Linux, and macOS and are updated automatically whenever code is committed by a maintainer or pushed to the primary repo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You need to be logged in to github&#039;&#039;&#039; to download CI artifacts, so [https://github.com/login sign in] or [https://github.com/signup sign up].&lt;br /&gt;
&lt;br /&gt;
To try out a CI build (more precisely, the resulting binary executable, which is a produced &amp;quot;artifact&amp;quot; of the build process) , first do a full MAME install from the [https://www.mamedev.org/release.html latest release] if you have not already done so. Then back up your main binary from its installation location - these are called something like &amp;lt;code&amp;gt;mame.exe&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;mame&amp;lt;/code&amp;gt;. You&#039;re backing it up to be able to restore it if the CI build doesn&#039;t work, or if you don&#039;t like how the CI build behaves.&lt;br /&gt;
&lt;br /&gt;
Then visit one of your preferred &amp;quot;Actions page&amp;quot; links above and find a workflow run item for your platform. Workflow items are the things in the list. The tags are flagged as &amp;lt;code&amp;gt;CI (Windows)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CI (Linux)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CI (macOS)&amp;lt;/code&amp;gt; in the second row of each workflow item in the list (not the filter in the left hand nav menu). Click on a &#039;&#039;completed workfow item&#039;&#039; (only items with green checkmarks will have created downloadable binaries yet), find the Artifacts section at the bottom (note again: &#039;&#039;you need to be signed up to see that section and/or download the artifact&#039;&#039;), then click the Download button. Unzip the downloaded file and find the main binary (with the same name as above). Copy the main binary to the install location, overwriting the original one, and run MAME the same way you were running it before. On Windows and macOS, you need to repeat the security steps above to trust the new MAME executable.&lt;br /&gt;
&lt;br /&gt;
= More MAME related links =&lt;br /&gt;
&lt;br /&gt;
MAME [https://docs.mamedev.org/ documentation].&lt;br /&gt;
&lt;br /&gt;
Report any issues with MAME on the [https://mametesters.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;Linux&#039;&#039;&#039; users there are more tips (how to compile MAME from source, how to configure it to not use CWD as starting path for resource directories, how to mount or create image file) at [[Development_Tools:Linux_setup]] page.&lt;br /&gt;
&lt;br /&gt;
[https://docs.mamedev.org/advanced/devicemap.html MAMEDEV.ORG MAME Stable Controller IDs].&lt;br /&gt;
By default, MAME does not assign stable numbers to input devices. For instance, a game pad controller may be assigned to “Joy 1” initially, but after restarting, the same game pad may be reassigned to “Joy 3”.&lt;br /&gt;
Here a some hints how to fixate MAME´s Joystick-Detection to specific Controllers: [https://www.youtube.com/watch?v=YmjfwLuZ_X0 Youtube - Mapping your controllers for stable IDs]&lt;br /&gt;
and: [https://forums.launchbox-app.com/topic/89296-stable-controller-ids-for-mame/ Stable Controller IDs for MAME]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41956</id>
		<title>MAME:Installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41956"/>
		<updated>2026-06-02T20:54:29Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Installation */ removed links to the single cpp source, not needed in the intro&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.mamedev.org/ MAME] (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, later expanded to include video game consoles, old computers and other systems in software on modern personal computers and other platforms.&lt;br /&gt;
&lt;br /&gt;
MAME has supported the ZX Spectrum Next since version 0.267. The existing implementation is based on the v3.02.04 core and implements most of the features.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
You will need to install MAME, provide it with the Next firmware (&#039;ROM&#039;), and get the NextZXOS image:&lt;br /&gt;
&lt;br /&gt;
=== 1. Get MAME ===&lt;br /&gt;
Start with these official MAME releases. If you encounter crashes or other bugs, try replacing the MAME executable with holub&#039;s latest Continuous Integration (CI) builds as described at the end of this article.&lt;br /&gt;
&lt;br /&gt;
MAME for macOS now requires the SDL3 library.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Windows:&#039;&#039;&#039; Download [https://www.mamedev.org/release.html MAME for Windows].&lt;br /&gt;
* &#039;&#039;&#039;macOS:&#039;&#039;&#039; Download the [https://github.com/libsdl-org/SDL/releases/latest SDL3 library], and copy its &#039;&#039;&#039;SDL3.xcframework&#039;&#039;&#039; and &#039;&#039;&#039;share&#039;&#039;&#039; folders to ~/Library/Frameworks, as instructed in the included INSTALL.md file. Then download [https://sdlmame.lngn.net/ MAME for macOS].&lt;br /&gt;
* &#039;&#039;&#039;Linux:&#039;&#039;&#039; Install MAME from the flatpak repositories by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo flatpak install org.mamedev.MAME&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Windows and macOS will likely prevent you from launching MAME (and the SDL3 framework) directly for security reasons. See below on how to solve this.&lt;br /&gt;
&lt;br /&gt;
Alternatively, for the MAME platform as a whole, you can also check your package manager, or [https://docs.mamedev.org/initialsetup/compilingmame.html build from sources].&lt;br /&gt;
&lt;br /&gt;
Git of official MAME: [https://github.com/mamedev/mame/ https://github.com/mamedev/mame/]&lt;br /&gt;
&lt;br /&gt;
Git of Holub&#039;s fork: [https://github.com/holub/mame https://github.com/holub/mame] (may contain extra fixes and features before they are merged to official repository, from the Actions page, if you&#039;re logged in, the most recent executables could be downloaded).&lt;br /&gt;
&lt;br /&gt;
=== 2. Get TBBLUE (the Next &#039;boot ROM&#039;) ===&lt;br /&gt;
Put the file  [https://github.com/Threetwosevensixseven/NexCreator/raw/master/bootroms/tbblue.zip tbblue.zip] into MAME&#039;s &amp;lt;code&amp;gt;roms&amp;lt;/code&amp;gt; folder. Don&#039;t extract it; MAME will look for the zip file when the &amp;quot;tbblue&amp;quot; machine is selected.&lt;br /&gt;
&lt;br /&gt;
Note: The ROMs in this zip are what is embedded inside the FPGA core on real Next hardware. They&#039;re different from any ZX Spectrum machine ROMs you may be used to using, that are on the distro, SD card or SD image file.&lt;br /&gt;
&lt;br /&gt;
=== 3. Get the NextZXOS Image ===&lt;br /&gt;
Get an SD card image file of [https://www.specnext.com/latestdistro/ NextZXOS]. Note that &#039;&#039;&#039;some disk images published  on the official SpecNext.com site do not work with some emulators currently&#039;&#039;&#039; (the &amp;lt;code&amp;gt;latestdistro&amp;lt;/code&amp;gt; link points to the official location where the latest distribution can be found), but &#039;&#039;&#039;all images from &amp;lt;code&amp;gt;https://zxnext.uk/hosted/&amp;lt;/code&amp;gt; work with both MAME and CSpect&#039;&#039;&#039;, like [https://zxnext.uk/hosted/index_files/hdfimages/cspect-next-2gb.zip this SD card image in the zip archive]. Extract the image &amp;lt;code&amp;gt;cspect-next-2gb.img&amp;lt;/code&amp;gt; from the archive to use it, then point MAME to this SD card image with the &amp;lt;code&amp;gt;-hard1&amp;lt;/code&amp;gt; option (or select that file from the menu inside MAME).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
MAME looks for its configuration and helper files in specific (configurable) folders. By default, these are relative to the current working directory (cwd), i.e., from where you launched the executable. The &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file and folders like &amp;lt;code&amp;gt;roms, bgfx, plugins, language, ...&amp;lt;/code&amp;gt; are expected there, unless the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file specifies other paths. When launching through a desktop icon or menu, depending on the OS, the working directory is often defined by the properties of that launch shortcut. When launching MAME from the command line, the current directory is &amp;quot;cwd&amp;quot; (doh). On Linux, MAME will look for &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; first in the &amp;lt;code&amp;gt;~/.mame&amp;lt;/code&amp;gt; folder. You can use the option &amp;lt;code&amp;gt;-inipath&amp;lt;/code&amp;gt; to point MAME to a different path for the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
However, the fastest way to run a machine with a desired configuration is from the command prompt, without requiring a &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file. Most of the features are also available through MAME&#039;s UI, although that takes more time to configure.&lt;br /&gt;
&lt;br /&gt;
As an example, this invocation enables the UI, uses &amp;quot;crisp pixels&amp;quot;, starts in a window, doesn&#039;t display the starting gameinfo window (it can still be displayed interactively from the UI), disables the mouse, confirms before exiting MAME, and specifies the disk image (remember to adjust the path to it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mame -ui_active -nounevenstretch -aspect 2:1 -video bgfx  -bgfx_screen_chains unfiltered -window -skip_gameinfo -mouse_device none -confirm_quit tbblue -hard1 /path/to/cspect-next-2gb.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s cover some useful options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run inside a window and with no mouse support, until you get familiar with the UI keys:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; mame tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
To launch the Linux flatpak version using the same options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; flatpak run org.mamedev.MAME tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Activate UI keys on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -ui_active&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Don&#039;t show the info popup on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -skip_gameinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Run with debugger. If you don&#039;t request this on startup, you won&#039;t have access to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -debug&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Use &amp;quot;crisp&amp;quot; pixels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -nounevenstretch -aspect 2:1 -video bgfx -bgfx_screen_chains unfiltered&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;No joystick connected to PC (having this may slightly speed up MAME&#039;s startup, but &#039;&#039;remember to remove this part from the command line and the corresponding setting in the ini file if you do want to use a joystick&#039;&#039;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -joystickprovider none&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ask for confirmation when exiting MAME (otherwise it&#039;s easy to exit MAME accidentally by hitting ESC, especially when playing games or navigating menus):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -confirm_quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-universal official MAME documentation] for more advanced usage.&lt;br /&gt;
&lt;br /&gt;
= Security: Allowing MAME to Run on Windows and macOS =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Windows,&#039;&#039;&#039; you will need to confirm that you want to launch MAME by clicking &amp;quot;Run Anyway&amp;quot; on first launch. &#039;&#039;(More details needed here.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On macOS,&#039;&#039;&#039; MAME will not open at first. Instead, a dialog will appear saying:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;“mame” Not Opened. Apple could not verify “mame” is free of malware that may harm your Mac or compromise your privacy.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Click “Done”. Then open &#039;&#039;&#039;System Settings -&amp;gt; Privacy &amp;amp; Security&#039;&#039;&#039;, and scroll down to the message &#039;&#039;mame was blocked to protect your Mac.&#039;&#039; Click “Allow Anyway”.&lt;br /&gt;
&lt;br /&gt;
Now launch MAME again. A dialog will ask once more if you want to open “mame”. Click “Open Anyway”, and enter your password or use Touch ID when prompted by macOS.&lt;br /&gt;
&lt;br /&gt;
You will then need to &#039;&#039;&#039;repeat this process for the SDL3 framework.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From now on, you can launch this version of MAME without warnings. However, you &#039;&#039;&#039;will&#039;&#039;&#039; need to repeat this each time you update MAME or the SDL3 framework.&lt;br /&gt;
&lt;br /&gt;
= Keys =&lt;br /&gt;
&lt;br /&gt;
Keys are emulated in two modes: either to control the MAME emulator or completely dedicated to the emulated system (the Next). You can toggle between these two keyboard modes with ScrLk (on Win and Linux) or fn+delete (on Mac).&lt;br /&gt;
&lt;br /&gt;
Some UI keys:&lt;br /&gt;
* F3 - soft reset&lt;br /&gt;
* Shift+F3 - hard reset&lt;br /&gt;
* F4 - sprites/tiles/font viewer (Enter, ], [)&lt;br /&gt;
* F5 - pause emulation&lt;br /&gt;
* F6 - save state&lt;br /&gt;
* F7 - load state&lt;br /&gt;
* Tab - emulator settings&lt;br /&gt;
* ~ - menu&lt;br /&gt;
* ` (backtick) - debugger (when enabled by starting MAME with &amp;lt;code&amp;gt;-debug&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; on the command line)&lt;br /&gt;
* PgDwn (Linux/Mac), fn-Downarrow (MacBooks) or Insert (Win) - hold down to fast-forward emulation at maximum speed, e.g., to speed up booting the Next&lt;br /&gt;
* Esc - exit (exits menus but also the entire emulator - see &amp;lt;code&amp;gt;-confirm_quit&amp;lt;/code&amp;gt; option above)&lt;br /&gt;
* F11 - DivMMC NMI&lt;br /&gt;
* F12 - Multiface NMI&lt;br /&gt;
&lt;br /&gt;
Check [https://docs.mamedev.org/usingmame/defaultkeys.html default keys documentation] for more.&lt;br /&gt;
&lt;br /&gt;
= Changing the UI toggle key =&lt;br /&gt;
&lt;br /&gt;
Some laptops don&#039;t have a Scroll Lock key, so you may not be able to exit MAME if you run it in full-screen mode. In these cases, you can change the UI toggle key as follows:&lt;br /&gt;
&lt;br /&gt;
* Run MAME without any command line arguments (except maybe -window) to open its GUI.&lt;br /&gt;
* Push TAB and enter the General Settings menu.&lt;br /&gt;
* Go to Input Assignments -&amp;gt; User Interface -&amp;gt; Toggle UI controls and select a new key. I use Right Alt / Alt GR.&lt;br /&gt;
* Return to the previous menu twice, then choose Save Settings&lt;br /&gt;
&lt;br /&gt;
= Creating and manipulating NextZXOS SD card image =&lt;br /&gt;
&lt;br /&gt;
Most users wanting to emulate the Next using MAME will be fine using a pre-built SD card image downloaded from the site hosting best pre-made images (currently, [https://zxnext.uk/hosted zxnext.uk/hosted] ) website. The following guide is provided for anyone wanting to create a NextZXOS SD card image from scratch.&lt;br /&gt;
&lt;br /&gt;
Download the [https://www.specnext.com/latestdistro/ latest NextZXOS distribution zip file] (named something like sn-complete-WX.YZ.zip) and extract it into a new, empty directory.&lt;br /&gt;
&lt;br /&gt;
== Creating and populating a SD card image using hdfmonkey jjjs build ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.specnext.com/forum/viewtopic.php?t=2604 hdfmonkey &amp;quot;jjjs build&amp;quot;] is a variant of hdfmonkey tool which includes some unique features and its main archive (at the previously given link) also contains pre-built binaries for Windows x64, MacOS x64, MacOS Apple Silicon and Linux x64. (Alternatively, the process to build a local Linux version of the executable is described [[Development_Tools:Linux_setup#hdfmonkey_tool | here]] )&lt;br /&gt;
&lt;br /&gt;
If you extracted sn-complete-WX.YZ.zip into a subdirectory named &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt;, and you want to create a 1GB image called &amp;lt;code&amp;gt;NextZXOS.img&amp;lt;/code&amp;gt; and you have a jjjs build&amp;quot; of hdfmonkey, then it&#039;s enough to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hdfmonkey create NextZXOS.img 1G&lt;br /&gt;
hdfmonkey putdir NextZXOS.img snWXYZ /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line creates an empty 1GB image and formats it with the best FAT parameters suited to the size of the image.&lt;br /&gt;
&lt;br /&gt;
The second line recursively copies all the content of the directory &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt; to the image, preserving the directory structure inside, starting from the &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; in the image.&lt;br /&gt;
&lt;br /&gt;
One of the advantages of this method is that even if the image has a capacity of 1GB, it will use much less space on your hard drive until you fill up the image. On Linux or MacOS, a command &amp;lt;code&amp;gt;du -h NextZXOS.img&amp;lt;/code&amp;gt; shows the actual amount of disk space used by the image. On Windows the same information can be seen in the File Properties dialog.&lt;br /&gt;
&lt;br /&gt;
The fastest way to transfer a file or a directory (including its content, recursively) into an image is by using a single &amp;lt;code&amp;gt;put&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;putdir&amp;lt;/code&amp;gt;, if it&#039;s to transfer the directory file content to an existing directory) command of hdfmonkey.&lt;br /&gt;
&lt;br /&gt;
The most convenient tool to copy of all the content from the image to a folder outside of the image is 7-zip. On Windows, just use the 7-zip GUI. On MacOS and Linux, see: [[Development_Tools:Linux_setup#Extracting_all_files_from_the_sd-card_image]].&lt;br /&gt;
&lt;br /&gt;
=MAME Plugins and Scripts=&lt;br /&gt;
&lt;br /&gt;
Some MAME plugins and scripts that may be useful for Next developers and end users are listed [[MAME:Plugins_and_Scripts|here]]. They let you speed up the Next boot time, profile your NextBASIC or assembler code, and more.&lt;br /&gt;
&lt;br /&gt;
=Continuous Integration MAME Builds=&lt;br /&gt;
&lt;br /&gt;
MAME is updated on a release schedule, but due to the ongoing nature of development, including for the MAME Next machine, it can sometimes be useful to install a more recent build if it contains a new feature or bugfix you are interested in. Sometimes, this ongoing work is discussed on social media, such as the [https://discordapp.com/channels/556228195767156758/752197165891321886 Next Developer Discord].&lt;br /&gt;
&lt;br /&gt;
Continuous Integration (CI) builds are available from the GitHub Action pages of both:&lt;br /&gt;
&lt;br /&gt;
* the [https://github.com/mamedev/mame/actions https://github.com/mamedev/mame/actions -- primary MAME repo Actions pagee] and &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/holub/mame/actions https://github.com/holub/mame/actions -- Holub&#039;s GitHub repo Actions page].&lt;br /&gt;
&lt;br /&gt;
Both are newer builds than the latest official release, and Holub&#039;s repo still tends to contain the fixes still waiting to be accepted to the primary repo. MAME CI builds are available for Windows, Linux, and macOS and are updated automatically whenever code is committed by a maintainer or pushed to the primary repo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You need to be logged in to github&#039;&#039;&#039; to download CI artifacts, so [https://github.com/login sign in] or [https://github.com/signup sign up].&lt;br /&gt;
&lt;br /&gt;
To try out a CI build (more precisely, the resulting binary executable, which is a produced &amp;quot;artifact&amp;quot; of the build process) , first do a full MAME install from the [https://www.mamedev.org/release.html latest release] if you have not already done so. Then back up your main binary from its installation location - these are called something like &amp;lt;code&amp;gt;mame.exe&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;mame&amp;lt;/code&amp;gt;. You&#039;re backing it up to be able to restore it if the CI build doesn&#039;t work, or if you don&#039;t like how the CI build behaves.&lt;br /&gt;
&lt;br /&gt;
Then visit one of your preferred &amp;quot;Actions page&amp;quot; links above and find a workflow run item for your platform. Workflow items are the things in the list. The tags are flagged as &amp;lt;code&amp;gt;CI (Windows)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CI (Linux)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CI (macOS)&amp;lt;/code&amp;gt; in the second row of each workflow item in the list (not the filter in the left hand nav menu). Click on a &#039;&#039;completed workfow item&#039;&#039; (only items with green checkmarks will have created downloadable binaries yet), find the Artifacts section at the bottom (note again: &#039;&#039;you need to be signed up to see that section and/or download the artifact&#039;&#039;), then click the Download button. Unzip the downloaded file and find the main binary (with the same name as above). Copy the main binary to the install location, overwriting the original one, and run MAME the same way you were running it before. On Windows and macOS, you need to repeat the security steps above to trust the new MAME executable.&lt;br /&gt;
&lt;br /&gt;
= More MAME related links =&lt;br /&gt;
&lt;br /&gt;
MAME [https://docs.mamedev.org/ documentation].&lt;br /&gt;
&lt;br /&gt;
Report any issues with MAME on the [https://mametesters.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;Linux&#039;&#039;&#039; users there are more tips (how to compile MAME from source, how to configure it to not use CWD as starting path for resource directories, how to mount or create image file) at [[Development_Tools:Linux_setup]] page.&lt;br /&gt;
&lt;br /&gt;
[https://docs.mamedev.org/advanced/devicemap.html MAMEDEV.ORG MAME Stable Controller IDs].&lt;br /&gt;
By default, MAME does not assign stable numbers to input devices. For instance, a game pad controller may be assigned to “Joy 1” initially, but after restarting, the same game pad may be reassigned to “Joy 3”.&lt;br /&gt;
Here a some hints how to fixate MAME´s Joystick-Detection to specific Controllers: [https://www.youtube.com/watch?v=YmjfwLuZ_X0 Youtube - Mapping your controllers for stable IDs]&lt;br /&gt;
and: [https://forums.launchbox-app.com/topic/89296-stable-controller-ids-for-mame/ Stable Controller IDs for MAME]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41955</id>
		<title>MAME:Installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41955"/>
		<updated>2026-06-02T20:52:17Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Installation */ the Actions page in the first mention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.mamedev.org/ MAME] (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, later expanded to include video game consoles, old computers and other systems in software on modern personal computers and other platforms.&lt;br /&gt;
&lt;br /&gt;
MAME has supported the ZX Spectrum Next since version 0.267. The existing implementation is based on the v3.02.04 core and implements most of the features.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
You will need to install MAME, provide it with the Next firmware (&#039;ROM&#039;), and get the NextZXOS image:&lt;br /&gt;
&lt;br /&gt;
=== 1. Get MAME ===&lt;br /&gt;
Start with these official MAME releases. If you encounter crashes or other bugs, try replacing the MAME executable with holub&#039;s latest Continuous Integration (CI) builds as described at the end of this article.&lt;br /&gt;
&lt;br /&gt;
MAME for macOS now requires the SDL3 library.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Windows:&#039;&#039;&#039; Download [https://www.mamedev.org/release.html MAME for Windows].&lt;br /&gt;
* &#039;&#039;&#039;macOS:&#039;&#039;&#039; Download the [https://github.com/libsdl-org/SDL/releases/latest SDL3 library], and copy its &#039;&#039;&#039;SDL3.xcframework&#039;&#039;&#039; and &#039;&#039;&#039;share&#039;&#039;&#039; folders to ~/Library/Frameworks, as instructed in the included INSTALL.md file. Then download [https://sdlmame.lngn.net/ MAME for macOS].&lt;br /&gt;
* &#039;&#039;&#039;Linux:&#039;&#039;&#039; Install MAME from the flatpak repositories by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo flatpak install org.mamedev.MAME&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Windows and macOS will likely prevent you from launching MAME (and the SDL3 framework) directly for security reasons. See below on how to solve this.&lt;br /&gt;
&lt;br /&gt;
Alternatively, for the MAME platform as a whole, you can also check your package manager, or [https://docs.mamedev.org/initialsetup/compilingmame.html build from sources].&lt;br /&gt;
&lt;br /&gt;
Git of official MAME: [https://github.com/mamedev/mame/ https://github.com/mamedev/mame/] [https://github.com/mamedev/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp]&lt;br /&gt;
&lt;br /&gt;
Git of holub&#039;s fork: [https://github.com/holub/mame https://github.com/holub/mame] [https://github.com/holub/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp] (may contain extra fixes and features before they are merged to official repository, from the Actions page, if you&#039;re logged in, the most recent executables could be downloaded).&lt;br /&gt;
&lt;br /&gt;
=== 2. Get TBBLUE (the Next &#039;boot ROM&#039;) ===&lt;br /&gt;
Put the file  [https://github.com/Threetwosevensixseven/NexCreator/raw/master/bootroms/tbblue.zip tbblue.zip] into MAME&#039;s &amp;lt;code&amp;gt;roms&amp;lt;/code&amp;gt; folder. Don&#039;t extract it; MAME will look for the zip file when the &amp;quot;tbblue&amp;quot; machine is selected.&lt;br /&gt;
&lt;br /&gt;
Note: The ROMs in this zip are what is embedded inside the FPGA core on real Next hardware. They&#039;re different from any ZX Spectrum machine ROMs you may be used to using, that are on the distro, SD card or SD image file.&lt;br /&gt;
&lt;br /&gt;
=== 3. Get the NextZXOS Image ===&lt;br /&gt;
Get an SD card image file of [https://www.specnext.com/latestdistro/ NextZXOS]. Note that &#039;&#039;&#039;some disk images published  on the official SpecNext.com site do not work with some emulators currently&#039;&#039;&#039; (the &amp;lt;code&amp;gt;latestdistro&amp;lt;/code&amp;gt; link points to the official location where the latest distribution can be found), but &#039;&#039;&#039;all images from &amp;lt;code&amp;gt;https://zxnext.uk/hosted/&amp;lt;/code&amp;gt; work with both MAME and CSpect&#039;&#039;&#039;, like [https://zxnext.uk/hosted/index_files/hdfimages/cspect-next-2gb.zip this SD card image in the zip archive]. Extract the image &amp;lt;code&amp;gt;cspect-next-2gb.img&amp;lt;/code&amp;gt; from the archive to use it, then point MAME to this SD card image with the &amp;lt;code&amp;gt;-hard1&amp;lt;/code&amp;gt; option (or select that file from the menu inside MAME).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
MAME looks for its configuration and helper files in specific (configurable) folders. By default, these are relative to the current working directory (cwd), i.e., from where you launched the executable. The &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file and folders like &amp;lt;code&amp;gt;roms, bgfx, plugins, language, ...&amp;lt;/code&amp;gt; are expected there, unless the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file specifies other paths. When launching through a desktop icon or menu, depending on the OS, the working directory is often defined by the properties of that launch shortcut. When launching MAME from the command line, the current directory is &amp;quot;cwd&amp;quot; (doh). On Linux, MAME will look for &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; first in the &amp;lt;code&amp;gt;~/.mame&amp;lt;/code&amp;gt; folder. You can use the option &amp;lt;code&amp;gt;-inipath&amp;lt;/code&amp;gt; to point MAME to a different path for the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
However, the fastest way to run a machine with a desired configuration is from the command prompt, without requiring a &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file. Most of the features are also available through MAME&#039;s UI, although that takes more time to configure.&lt;br /&gt;
&lt;br /&gt;
As an example, this invocation enables the UI, uses &amp;quot;crisp pixels&amp;quot;, starts in a window, doesn&#039;t display the starting gameinfo window (it can still be displayed interactively from the UI), disables the mouse, confirms before exiting MAME, and specifies the disk image (remember to adjust the path to it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mame -ui_active -nounevenstretch -aspect 2:1 -video bgfx  -bgfx_screen_chains unfiltered -window -skip_gameinfo -mouse_device none -confirm_quit tbblue -hard1 /path/to/cspect-next-2gb.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s cover some useful options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run inside a window and with no mouse support, until you get familiar with the UI keys:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; mame tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
To launch the Linux flatpak version using the same options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; flatpak run org.mamedev.MAME tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Activate UI keys on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -ui_active&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Don&#039;t show the info popup on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -skip_gameinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Run with debugger. If you don&#039;t request this on startup, you won&#039;t have access to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -debug&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Use &amp;quot;crisp&amp;quot; pixels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -nounevenstretch -aspect 2:1 -video bgfx -bgfx_screen_chains unfiltered&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;No joystick connected to PC (having this may slightly speed up MAME&#039;s startup, but &#039;&#039;remember to remove this part from the command line and the corresponding setting in the ini file if you do want to use a joystick&#039;&#039;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -joystickprovider none&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ask for confirmation when exiting MAME (otherwise it&#039;s easy to exit MAME accidentally by hitting ESC, especially when playing games or navigating menus):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -confirm_quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-universal official MAME documentation] for more advanced usage.&lt;br /&gt;
&lt;br /&gt;
= Security: Allowing MAME to Run on Windows and macOS =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Windows,&#039;&#039;&#039; you will need to confirm that you want to launch MAME by clicking &amp;quot;Run Anyway&amp;quot; on first launch. &#039;&#039;(More details needed here.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On macOS,&#039;&#039;&#039; MAME will not open at first. Instead, a dialog will appear saying:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;“mame” Not Opened. Apple could not verify “mame” is free of malware that may harm your Mac or compromise your privacy.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Click “Done”. Then open &#039;&#039;&#039;System Settings -&amp;gt; Privacy &amp;amp; Security&#039;&#039;&#039;, and scroll down to the message &#039;&#039;mame was blocked to protect your Mac.&#039;&#039; Click “Allow Anyway”.&lt;br /&gt;
&lt;br /&gt;
Now launch MAME again. A dialog will ask once more if you want to open “mame”. Click “Open Anyway”, and enter your password or use Touch ID when prompted by macOS.&lt;br /&gt;
&lt;br /&gt;
You will then need to &#039;&#039;&#039;repeat this process for the SDL3 framework.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From now on, you can launch this version of MAME without warnings. However, you &#039;&#039;&#039;will&#039;&#039;&#039; need to repeat this each time you update MAME or the SDL3 framework.&lt;br /&gt;
&lt;br /&gt;
= Keys =&lt;br /&gt;
&lt;br /&gt;
Keys are emulated in two modes: either to control the MAME emulator or completely dedicated to the emulated system (the Next). You can toggle between these two keyboard modes with ScrLk (on Win and Linux) or fn+delete (on Mac).&lt;br /&gt;
&lt;br /&gt;
Some UI keys:&lt;br /&gt;
* F3 - soft reset&lt;br /&gt;
* Shift+F3 - hard reset&lt;br /&gt;
* F4 - sprites/tiles/font viewer (Enter, ], [)&lt;br /&gt;
* F5 - pause emulation&lt;br /&gt;
* F6 - save state&lt;br /&gt;
* F7 - load state&lt;br /&gt;
* Tab - emulator settings&lt;br /&gt;
* ~ - menu&lt;br /&gt;
* ` (backtick) - debugger (when enabled by starting MAME with &amp;lt;code&amp;gt;-debug&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; on the command line)&lt;br /&gt;
* PgDwn (Linux/Mac), fn-Downarrow (MacBooks) or Insert (Win) - hold down to fast-forward emulation at maximum speed, e.g., to speed up booting the Next&lt;br /&gt;
* Esc - exit (exits menus but also the entire emulator - see &amp;lt;code&amp;gt;-confirm_quit&amp;lt;/code&amp;gt; option above)&lt;br /&gt;
* F11 - DivMMC NMI&lt;br /&gt;
* F12 - Multiface NMI&lt;br /&gt;
&lt;br /&gt;
Check [https://docs.mamedev.org/usingmame/defaultkeys.html default keys documentation] for more.&lt;br /&gt;
&lt;br /&gt;
= Changing the UI toggle key =&lt;br /&gt;
&lt;br /&gt;
Some laptops don&#039;t have a Scroll Lock key, so you may not be able to exit MAME if you run it in full-screen mode. In these cases, you can change the UI toggle key as follows:&lt;br /&gt;
&lt;br /&gt;
* Run MAME without any command line arguments (except maybe -window) to open its GUI.&lt;br /&gt;
* Push TAB and enter the General Settings menu.&lt;br /&gt;
* Go to Input Assignments -&amp;gt; User Interface -&amp;gt; Toggle UI controls and select a new key. I use Right Alt / Alt GR.&lt;br /&gt;
* Return to the previous menu twice, then choose Save Settings&lt;br /&gt;
&lt;br /&gt;
= Creating and manipulating NextZXOS SD card image =&lt;br /&gt;
&lt;br /&gt;
Most users wanting to emulate the Next using MAME will be fine using a pre-built SD card image downloaded from the site hosting best pre-made images (currently, [https://zxnext.uk/hosted zxnext.uk/hosted] ) website. The following guide is provided for anyone wanting to create a NextZXOS SD card image from scratch.&lt;br /&gt;
&lt;br /&gt;
Download the [https://www.specnext.com/latestdistro/ latest NextZXOS distribution zip file] (named something like sn-complete-WX.YZ.zip) and extract it into a new, empty directory.&lt;br /&gt;
&lt;br /&gt;
== Creating and populating a SD card image using hdfmonkey jjjs build ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.specnext.com/forum/viewtopic.php?t=2604 hdfmonkey &amp;quot;jjjs build&amp;quot;] is a variant of hdfmonkey tool which includes some unique features and its main archive (at the previously given link) also contains pre-built binaries for Windows x64, MacOS x64, MacOS Apple Silicon and Linux x64. (Alternatively, the process to build a local Linux version of the executable is described [[Development_Tools:Linux_setup#hdfmonkey_tool | here]] )&lt;br /&gt;
&lt;br /&gt;
If you extracted sn-complete-WX.YZ.zip into a subdirectory named &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt;, and you want to create a 1GB image called &amp;lt;code&amp;gt;NextZXOS.img&amp;lt;/code&amp;gt; and you have a jjjs build&amp;quot; of hdfmonkey, then it&#039;s enough to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hdfmonkey create NextZXOS.img 1G&lt;br /&gt;
hdfmonkey putdir NextZXOS.img snWXYZ /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line creates an empty 1GB image and formats it with the best FAT parameters suited to the size of the image.&lt;br /&gt;
&lt;br /&gt;
The second line recursively copies all the content of the directory &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt; to the image, preserving the directory structure inside, starting from the &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; in the image.&lt;br /&gt;
&lt;br /&gt;
One of the advantages of this method is that even if the image has a capacity of 1GB, it will use much less space on your hard drive until you fill up the image. On Linux or MacOS, a command &amp;lt;code&amp;gt;du -h NextZXOS.img&amp;lt;/code&amp;gt; shows the actual amount of disk space used by the image. On Windows the same information can be seen in the File Properties dialog.&lt;br /&gt;
&lt;br /&gt;
The fastest way to transfer a file or a directory (including its content, recursively) into an image is by using a single &amp;lt;code&amp;gt;put&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;putdir&amp;lt;/code&amp;gt;, if it&#039;s to transfer the directory file content to an existing directory) command of hdfmonkey.&lt;br /&gt;
&lt;br /&gt;
The most convenient tool to copy of all the content from the image to a folder outside of the image is 7-zip. On Windows, just use the 7-zip GUI. On MacOS and Linux, see: [[Development_Tools:Linux_setup#Extracting_all_files_from_the_sd-card_image]].&lt;br /&gt;
&lt;br /&gt;
=MAME Plugins and Scripts=&lt;br /&gt;
&lt;br /&gt;
Some MAME plugins and scripts that may be useful for Next developers and end users are listed [[MAME:Plugins_and_Scripts|here]]. They let you speed up the Next boot time, profile your NextBASIC or assembler code, and more.&lt;br /&gt;
&lt;br /&gt;
=Continuous Integration MAME Builds=&lt;br /&gt;
&lt;br /&gt;
MAME is updated on a release schedule, but due to the ongoing nature of development, including for the MAME Next machine, it can sometimes be useful to install a more recent build if it contains a new feature or bugfix you are interested in. Sometimes, this ongoing work is discussed on social media, such as the [https://discordapp.com/channels/556228195767156758/752197165891321886 Next Developer Discord].&lt;br /&gt;
&lt;br /&gt;
Continuous Integration (CI) builds are available from the GitHub Action pages of both:&lt;br /&gt;
&lt;br /&gt;
* the [https://github.com/mamedev/mame/actions https://github.com/mamedev/mame/actions -- primary MAME repo Actions pagee] and &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/holub/mame/actions https://github.com/holub/mame/actions -- Holub&#039;s GitHub repo Actions page].&lt;br /&gt;
&lt;br /&gt;
Both are newer builds than the latest official release, and Holub&#039;s repo still tends to contain the fixes still waiting to be accepted to the primary repo. MAME CI builds are available for Windows, Linux, and macOS and are updated automatically whenever code is committed by a maintainer or pushed to the primary repo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You need to be logged in to github&#039;&#039;&#039; to download CI artifacts, so [https://github.com/login sign in] or [https://github.com/signup sign up].&lt;br /&gt;
&lt;br /&gt;
To try out a CI build (more precisely, the resulting binary executable, which is a produced &amp;quot;artifact&amp;quot; of the build process) , first do a full MAME install from the [https://www.mamedev.org/release.html latest release] if you have not already done so. Then back up your main binary from its installation location - these are called something like &amp;lt;code&amp;gt;mame.exe&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;mame&amp;lt;/code&amp;gt;. You&#039;re backing it up to be able to restore it if the CI build doesn&#039;t work, or if you don&#039;t like how the CI build behaves.&lt;br /&gt;
&lt;br /&gt;
Then visit one of your preferred &amp;quot;Actions page&amp;quot; links above and find a workflow run item for your platform. Workflow items are the things in the list. The tags are flagged as &amp;lt;code&amp;gt;CI (Windows)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CI (Linux)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CI (macOS)&amp;lt;/code&amp;gt; in the second row of each workflow item in the list (not the filter in the left hand nav menu). Click on a &#039;&#039;completed workfow item&#039;&#039; (only items with green checkmarks will have created downloadable binaries yet), find the Artifacts section at the bottom (note again: &#039;&#039;you need to be signed up to see that section and/or download the artifact&#039;&#039;), then click the Download button. Unzip the downloaded file and find the main binary (with the same name as above). Copy the main binary to the install location, overwriting the original one, and run MAME the same way you were running it before. On Windows and macOS, you need to repeat the security steps above to trust the new MAME executable.&lt;br /&gt;
&lt;br /&gt;
= More MAME related links =&lt;br /&gt;
&lt;br /&gt;
MAME [https://docs.mamedev.org/ documentation].&lt;br /&gt;
&lt;br /&gt;
Report any issues with MAME on the [https://mametesters.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;Linux&#039;&#039;&#039; users there are more tips (how to compile MAME from source, how to configure it to not use CWD as starting path for resource directories, how to mount or create image file) at [[Development_Tools:Linux_setup]] page.&lt;br /&gt;
&lt;br /&gt;
[https://docs.mamedev.org/advanced/devicemap.html MAMEDEV.ORG MAME Stable Controller IDs].&lt;br /&gt;
By default, MAME does not assign stable numbers to input devices. For instance, a game pad controller may be assigned to “Joy 1” initially, but after restarting, the same game pad may be reassigned to “Joy 3”.&lt;br /&gt;
Here a some hints how to fixate MAME´s Joystick-Detection to specific Controllers: [https://www.youtube.com/watch?v=YmjfwLuZ_X0 Youtube - Mapping your controllers for stable IDs]&lt;br /&gt;
and: [https://forums.launchbox-app.com/topic/89296-stable-controller-ids-for-mame/ Stable Controller IDs for MAME]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41954</id>
		<title>MAME:Installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41954"/>
		<updated>2026-06-02T20:43:54Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Continuous Integration MAME Builds */ Actions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.mamedev.org/ MAME] (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, later expanded to include video game consoles, old computers and other systems in software on modern personal computers and other platforms.&lt;br /&gt;
&lt;br /&gt;
MAME has supported the ZX Spectrum Next since version 0.267. The existing implementation is based on the v3.02.04 core and implements most of the features.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
You will need to install MAME, provide it with the Next firmware (&#039;ROM&#039;), and get the NextZXOS image:&lt;br /&gt;
&lt;br /&gt;
=== 1. Get MAME ===&lt;br /&gt;
Start with these official MAME releases. If you encounter crashes or other bugs, try replacing the MAME executable with holub&#039;s latest Continuous Integration (CI) builds as described at the end of this article.&lt;br /&gt;
&lt;br /&gt;
MAME for macOS now requires the SDL3 library.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Windows:&#039;&#039;&#039; Download [https://www.mamedev.org/release.html MAME for Windows].&lt;br /&gt;
* &#039;&#039;&#039;macOS:&#039;&#039;&#039; Download the [https://github.com/libsdl-org/SDL/releases/latest SDL3 library], and copy its &#039;&#039;&#039;SDL3.xcframework&#039;&#039;&#039; and &#039;&#039;&#039;share&#039;&#039;&#039; folders to ~/Library/Frameworks, as instructed in the included INSTALL.md file. Then download [https://sdlmame.lngn.net/ MAME for macOS].&lt;br /&gt;
* &#039;&#039;&#039;Linux:&#039;&#039;&#039; Install MAME from the flatpak repositories by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo flatpak install org.mamedev.MAME&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Windows and macOS will likely prevent you from launching MAME (and the SDL3 framework) directly for security reasons. See below on how to solve this.&lt;br /&gt;
&lt;br /&gt;
Alternatively, for the MAME platform as a whole, you can also check your package manager, or [https://docs.mamedev.org/initialsetup/compilingmame.html build from sources].&lt;br /&gt;
&lt;br /&gt;
Git of official MAME: [https://github.com/mamedev/mame/ https://github.com/mamedev/mame/] [https://github.com/mamedev/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp]&lt;br /&gt;
&lt;br /&gt;
Git of holub&#039;s fork: [https://github.com/holub/mame https://github.com/holub/mame] [https://github.com/holub/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp] (may contain extra fixes and features before they are merged to official repository)&lt;br /&gt;
&lt;br /&gt;
=== 2. Get TBBLUE (the Next &#039;boot ROM&#039;) ===&lt;br /&gt;
Put the file  [https://github.com/Threetwosevensixseven/NexCreator/raw/master/bootroms/tbblue.zip tbblue.zip] into MAME&#039;s &amp;lt;code&amp;gt;roms&amp;lt;/code&amp;gt; folder. Don&#039;t extract it; MAME will look for the zip file when the &amp;quot;tbblue&amp;quot; machine is selected.&lt;br /&gt;
&lt;br /&gt;
Note: The ROMs in this zip are what is embedded inside the FPGA core on real Next hardware. They&#039;re different from any ZX Spectrum machine ROMs you may be used to using, that are on the distro, SD card or SD image file.&lt;br /&gt;
&lt;br /&gt;
=== 3. Get the NextZXOS Image ===&lt;br /&gt;
Get an SD card image file of [https://www.specnext.com/latestdistro/ NextZXOS]. Note that &#039;&#039;&#039;some disk images published  on the official SpecNext.com site do not work with some emulators currently&#039;&#039;&#039; (the &amp;lt;code&amp;gt;latestdistro&amp;lt;/code&amp;gt; link points to the official location where the latest distribution can be found), but &#039;&#039;&#039;all images from &amp;lt;code&amp;gt;https://zxnext.uk/hosted/&amp;lt;/code&amp;gt; work with both MAME and CSpect&#039;&#039;&#039;, like [https://zxnext.uk/hosted/index_files/hdfimages/cspect-next-2gb.zip this SD card image in the zip archive]. Extract the image &amp;lt;code&amp;gt;cspect-next-2gb.img&amp;lt;/code&amp;gt; from the archive to use it, then point MAME to this SD card image with the &amp;lt;code&amp;gt;-hard1&amp;lt;/code&amp;gt; option (or select that file from the menu inside MAME).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
MAME looks for its configuration and helper files in specific (configurable) folders. By default, these are relative to the current working directory (cwd), i.e., from where you launched the executable. The &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file and folders like &amp;lt;code&amp;gt;roms, bgfx, plugins, language, ...&amp;lt;/code&amp;gt; are expected there, unless the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file specifies other paths. When launching through a desktop icon or menu, depending on the OS, the working directory is often defined by the properties of that launch shortcut. When launching MAME from the command line, the current directory is &amp;quot;cwd&amp;quot; (doh). On Linux, MAME will look for &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; first in the &amp;lt;code&amp;gt;~/.mame&amp;lt;/code&amp;gt; folder. You can use the option &amp;lt;code&amp;gt;-inipath&amp;lt;/code&amp;gt; to point MAME to a different path for the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
However, the fastest way to run a machine with a desired configuration is from the command prompt, without requiring a &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file. Most of the features are also available through MAME&#039;s UI, although that takes more time to configure.&lt;br /&gt;
&lt;br /&gt;
As an example, this invocation enables the UI, uses &amp;quot;crisp pixels&amp;quot;, starts in a window, doesn&#039;t display the starting gameinfo window (it can still be displayed interactively from the UI), disables the mouse, confirms before exiting MAME, and specifies the disk image (remember to adjust the path to it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mame -ui_active -nounevenstretch -aspect 2:1 -video bgfx  -bgfx_screen_chains unfiltered -window -skip_gameinfo -mouse_device none -confirm_quit tbblue -hard1 /path/to/cspect-next-2gb.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s cover some useful options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run inside a window and with no mouse support, until you get familiar with the UI keys:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; mame tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
To launch the Linux flatpak version using the same options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; flatpak run org.mamedev.MAME tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Activate UI keys on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -ui_active&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Don&#039;t show the info popup on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -skip_gameinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Run with debugger. If you don&#039;t request this on startup, you won&#039;t have access to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -debug&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Use &amp;quot;crisp&amp;quot; pixels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -nounevenstretch -aspect 2:1 -video bgfx -bgfx_screen_chains unfiltered&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;No joystick connected to PC (having this may slightly speed up MAME&#039;s startup, but &#039;&#039;remember to remove this part from the command line and the corresponding setting in the ini file if you do want to use a joystick&#039;&#039;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -joystickprovider none&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ask for confirmation when exiting MAME (otherwise it&#039;s easy to exit MAME accidentally by hitting ESC, especially when playing games or navigating menus):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -confirm_quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-universal official MAME documentation] for more advanced usage.&lt;br /&gt;
&lt;br /&gt;
= Security: Allowing MAME to Run on Windows and macOS =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Windows,&#039;&#039;&#039; you will need to confirm that you want to launch MAME by clicking &amp;quot;Run Anyway&amp;quot; on first launch. &#039;&#039;(More details needed here.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On macOS,&#039;&#039;&#039; MAME will not open at first. Instead, a dialog will appear saying:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;“mame” Not Opened. Apple could not verify “mame” is free of malware that may harm your Mac or compromise your privacy.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Click “Done”. Then open &#039;&#039;&#039;System Settings -&amp;gt; Privacy &amp;amp; Security&#039;&#039;&#039;, and scroll down to the message &#039;&#039;mame was blocked to protect your Mac.&#039;&#039; Click “Allow Anyway”.&lt;br /&gt;
&lt;br /&gt;
Now launch MAME again. A dialog will ask once more if you want to open “mame”. Click “Open Anyway”, and enter your password or use Touch ID when prompted by macOS.&lt;br /&gt;
&lt;br /&gt;
You will then need to &#039;&#039;&#039;repeat this process for the SDL3 framework.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From now on, you can launch this version of MAME without warnings. However, you &#039;&#039;&#039;will&#039;&#039;&#039; need to repeat this each time you update MAME or the SDL3 framework.&lt;br /&gt;
&lt;br /&gt;
= Keys =&lt;br /&gt;
&lt;br /&gt;
Keys are emulated in two modes: either to control the MAME emulator or completely dedicated to the emulated system (the Next). You can toggle between these two keyboard modes with ScrLk (on Win and Linux) or fn+delete (on Mac).&lt;br /&gt;
&lt;br /&gt;
Some UI keys:&lt;br /&gt;
* F3 - soft reset&lt;br /&gt;
* Shift+F3 - hard reset&lt;br /&gt;
* F4 - sprites/tiles/font viewer (Enter, ], [)&lt;br /&gt;
* F5 - pause emulation&lt;br /&gt;
* F6 - save state&lt;br /&gt;
* F7 - load state&lt;br /&gt;
* Tab - emulator settings&lt;br /&gt;
* ~ - menu&lt;br /&gt;
* ` (backtick) - debugger (when enabled by starting MAME with &amp;lt;code&amp;gt;-debug&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; on the command line)&lt;br /&gt;
* PgDwn (Linux/Mac), fn-Downarrow (MacBooks) or Insert (Win) - hold down to fast-forward emulation at maximum speed, e.g., to speed up booting the Next&lt;br /&gt;
* Esc - exit (exits menus but also the entire emulator - see &amp;lt;code&amp;gt;-confirm_quit&amp;lt;/code&amp;gt; option above)&lt;br /&gt;
* F11 - DivMMC NMI&lt;br /&gt;
* F12 - Multiface NMI&lt;br /&gt;
&lt;br /&gt;
Check [https://docs.mamedev.org/usingmame/defaultkeys.html default keys documentation] for more.&lt;br /&gt;
&lt;br /&gt;
= Changing the UI toggle key =&lt;br /&gt;
&lt;br /&gt;
Some laptops don&#039;t have a Scroll Lock key, so you may not be able to exit MAME if you run it in full-screen mode. In these cases, you can change the UI toggle key as follows:&lt;br /&gt;
&lt;br /&gt;
* Run MAME without any command line arguments (except maybe -window) to open its GUI.&lt;br /&gt;
* Push TAB and enter the General Settings menu.&lt;br /&gt;
* Go to Input Assignments -&amp;gt; User Interface -&amp;gt; Toggle UI controls and select a new key. I use Right Alt / Alt GR.&lt;br /&gt;
* Return to the previous menu twice, then choose Save Settings&lt;br /&gt;
&lt;br /&gt;
= Creating and manipulating NextZXOS SD card image =&lt;br /&gt;
&lt;br /&gt;
Most users wanting to emulate the Next using MAME will be fine using a pre-built SD card image downloaded from the site hosting best pre-made images (currently, [https://zxnext.uk/hosted zxnext.uk/hosted] ) website. The following guide is provided for anyone wanting to create a NextZXOS SD card image from scratch.&lt;br /&gt;
&lt;br /&gt;
Download the [https://www.specnext.com/latestdistro/ latest NextZXOS distribution zip file] (named something like sn-complete-WX.YZ.zip) and extract it into a new, empty directory.&lt;br /&gt;
&lt;br /&gt;
== Creating and populating a SD card image using hdfmonkey jjjs build ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.specnext.com/forum/viewtopic.php?t=2604 hdfmonkey &amp;quot;jjjs build&amp;quot;] is a variant of hdfmonkey tool which includes some unique features and its main archive (at the previously given link) also contains pre-built binaries for Windows x64, MacOS x64, MacOS Apple Silicon and Linux x64. (Alternatively, the process to build a local Linux version of the executable is described [[Development_Tools:Linux_setup#hdfmonkey_tool | here]] )&lt;br /&gt;
&lt;br /&gt;
If you extracted sn-complete-WX.YZ.zip into a subdirectory named &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt;, and you want to create a 1GB image called &amp;lt;code&amp;gt;NextZXOS.img&amp;lt;/code&amp;gt; and you have a jjjs build&amp;quot; of hdfmonkey, then it&#039;s enough to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hdfmonkey create NextZXOS.img 1G&lt;br /&gt;
hdfmonkey putdir NextZXOS.img snWXYZ /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line creates an empty 1GB image and formats it with the best FAT parameters suited to the size of the image.&lt;br /&gt;
&lt;br /&gt;
The second line recursively copies all the content of the directory &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt; to the image, preserving the directory structure inside, starting from the &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; in the image.&lt;br /&gt;
&lt;br /&gt;
One of the advantages of this method is that even if the image has a capacity of 1GB, it will use much less space on your hard drive until you fill up the image. On Linux or MacOS, a command &amp;lt;code&amp;gt;du -h NextZXOS.img&amp;lt;/code&amp;gt; shows the actual amount of disk space used by the image. On Windows the same information can be seen in the File Properties dialog.&lt;br /&gt;
&lt;br /&gt;
The fastest way to transfer a file or a directory (including its content, recursively) into an image is by using a single &amp;lt;code&amp;gt;put&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;putdir&amp;lt;/code&amp;gt;, if it&#039;s to transfer the directory file content to an existing directory) command of hdfmonkey.&lt;br /&gt;
&lt;br /&gt;
The most convenient tool to copy of all the content from the image to a folder outside of the image is 7-zip. On Windows, just use the 7-zip GUI. On MacOS and Linux, see: [[Development_Tools:Linux_setup#Extracting_all_files_from_the_sd-card_image]].&lt;br /&gt;
&lt;br /&gt;
=MAME Plugins and Scripts=&lt;br /&gt;
&lt;br /&gt;
Some MAME plugins and scripts that may be useful for Next developers and end users are listed [[MAME:Plugins_and_Scripts|here]]. They let you speed up the Next boot time, profile your NextBASIC or assembler code, and more.&lt;br /&gt;
&lt;br /&gt;
=Continuous Integration MAME Builds=&lt;br /&gt;
&lt;br /&gt;
MAME is updated on a release schedule, but due to the ongoing nature of development, including for the MAME Next machine, it can sometimes be useful to install a more recent build if it contains a new feature or bugfix you are interested in. Sometimes, this ongoing work is discussed on social media, such as the [https://discordapp.com/channels/556228195767156758/752197165891321886 Next Developer Discord].&lt;br /&gt;
&lt;br /&gt;
Continuous Integration (CI) builds are available from the GitHub Action pages of both:&lt;br /&gt;
&lt;br /&gt;
* the [https://github.com/mamedev/mame/actions https://github.com/mamedev/mame/actions -- primary MAME repo Actions pagee] and &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/holub/mame/actions https://github.com/holub/mame/actions -- Holub&#039;s GitHub repo Actions page].&lt;br /&gt;
&lt;br /&gt;
Both are newer builds than the latest official release, and Holub&#039;s repo still tends to contain the fixes still waiting to be accepted to the primary repo. MAME CI builds are available for Windows, Linux, and macOS and are updated automatically whenever code is committed by a maintainer or pushed to the primary repo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You need to be logged in to github&#039;&#039;&#039; to download CI artifacts, so [https://github.com/login sign in] or [https://github.com/signup sign up].&lt;br /&gt;
&lt;br /&gt;
To try out a CI build (more precisely, the resulting binary executable, which is a produced &amp;quot;artifact&amp;quot; of the build process) , first do a full MAME install from the [https://www.mamedev.org/release.html latest release] if you have not already done so. Then back up your main binary from its installation location - these are called something like &amp;lt;code&amp;gt;mame.exe&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;mame&amp;lt;/code&amp;gt;. You&#039;re backing it up to be able to restore it if the CI build doesn&#039;t work, or if you don&#039;t like how the CI build behaves.&lt;br /&gt;
&lt;br /&gt;
Then visit one of your preferred &amp;quot;Actions page&amp;quot; links above and find a workflow run item for your platform. Workflow items are the things in the list. The tags are flagged as &amp;lt;code&amp;gt;CI (Windows)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CI (Linux)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CI (macOS)&amp;lt;/code&amp;gt; in the second row of each workflow item in the list (not the filter in the left hand nav menu). Click on a &#039;&#039;completed workfow item&#039;&#039; (only items with green checkmarks will have created downloadable binaries yet), find the Artifacts section at the bottom (note again: &#039;&#039;you need to be signed up to see that section and/or download the artifact&#039;&#039;), then click the Download button. Unzip the downloaded file and find the main binary (with the same name as above). Copy the main binary to the install location, overwriting the original one, and run MAME the same way you were running it before. On Windows and macOS, you need to repeat the security steps above to trust the new MAME executable.&lt;br /&gt;
&lt;br /&gt;
= More MAME related links =&lt;br /&gt;
&lt;br /&gt;
MAME [https://docs.mamedev.org/ documentation].&lt;br /&gt;
&lt;br /&gt;
Report any issues with MAME on the [https://mametesters.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;Linux&#039;&#039;&#039; users there are more tips (how to compile MAME from source, how to configure it to not use CWD as starting path for resource directories, how to mount or create image file) at [[Development_Tools:Linux_setup]] page.&lt;br /&gt;
&lt;br /&gt;
[https://docs.mamedev.org/advanced/devicemap.html MAMEDEV.ORG MAME Stable Controller IDs].&lt;br /&gt;
By default, MAME does not assign stable numbers to input devices. For instance, a game pad controller may be assigned to “Joy 1” initially, but after restarting, the same game pad may be reassigned to “Joy 3”.&lt;br /&gt;
Here a some hints how to fixate MAME´s Joystick-Detection to specific Controllers: [https://www.youtube.com/watch?v=YmjfwLuZ_X0 Youtube - Mapping your controllers for stable IDs]&lt;br /&gt;
and: [https://forums.launchbox-app.com/topic/89296-stable-controller-ids-for-mame/ Stable Controller IDs for MAME]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41953</id>
		<title>MAME:Installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41953"/>
		<updated>2026-06-02T20:30:58Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Continuous Integration MAME Builds */ improving? links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.mamedev.org/ MAME] (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, later expanded to include video game consoles, old computers and other systems in software on modern personal computers and other platforms.&lt;br /&gt;
&lt;br /&gt;
MAME has supported the ZX Spectrum Next since version 0.267. The existing implementation is based on the v3.02.04 core and implements most of the features.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
You will need to install MAME, provide it with the Next firmware (&#039;ROM&#039;), and get the NextZXOS image:&lt;br /&gt;
&lt;br /&gt;
=== 1. Get MAME ===&lt;br /&gt;
Start with these official MAME releases. If you encounter crashes or other bugs, try replacing the MAME executable with holub&#039;s latest Continuous Integration (CI) builds as described at the end of this article.&lt;br /&gt;
&lt;br /&gt;
MAME for macOS now requires the SDL3 library.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Windows:&#039;&#039;&#039; Download [https://www.mamedev.org/release.html MAME for Windows].&lt;br /&gt;
* &#039;&#039;&#039;macOS:&#039;&#039;&#039; Download the [https://github.com/libsdl-org/SDL/releases/latest SDL3 library], and copy its &#039;&#039;&#039;SDL3.xcframework&#039;&#039;&#039; and &#039;&#039;&#039;share&#039;&#039;&#039; folders to ~/Library/Frameworks, as instructed in the included INSTALL.md file. Then download [https://sdlmame.lngn.net/ MAME for macOS].&lt;br /&gt;
* &#039;&#039;&#039;Linux:&#039;&#039;&#039; Install MAME from the flatpak repositories by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo flatpak install org.mamedev.MAME&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Windows and macOS will likely prevent you from launching MAME (and the SDL3 framework) directly for security reasons. See below on how to solve this.&lt;br /&gt;
&lt;br /&gt;
Alternatively, for the MAME platform as a whole, you can also check your package manager, or [https://docs.mamedev.org/initialsetup/compilingmame.html build from sources].&lt;br /&gt;
&lt;br /&gt;
Git of official MAME: [https://github.com/mamedev/mame/ https://github.com/mamedev/mame/] [https://github.com/mamedev/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp]&lt;br /&gt;
&lt;br /&gt;
Git of holub&#039;s fork: [https://github.com/holub/mame https://github.com/holub/mame] [https://github.com/holub/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp] (may contain extra fixes and features before they are merged to official repository)&lt;br /&gt;
&lt;br /&gt;
=== 2. Get TBBLUE (the Next &#039;boot ROM&#039;) ===&lt;br /&gt;
Put the file  [https://github.com/Threetwosevensixseven/NexCreator/raw/master/bootroms/tbblue.zip tbblue.zip] into MAME&#039;s &amp;lt;code&amp;gt;roms&amp;lt;/code&amp;gt; folder. Don&#039;t extract it; MAME will look for the zip file when the &amp;quot;tbblue&amp;quot; machine is selected.&lt;br /&gt;
&lt;br /&gt;
Note: The ROMs in this zip are what is embedded inside the FPGA core on real Next hardware. They&#039;re different from any ZX Spectrum machine ROMs you may be used to using, that are on the distro, SD card or SD image file.&lt;br /&gt;
&lt;br /&gt;
=== 3. Get the NextZXOS Image ===&lt;br /&gt;
Get an SD card image file of [https://www.specnext.com/latestdistro/ NextZXOS]. Note that &#039;&#039;&#039;some disk images published  on the official SpecNext.com site do not work with some emulators currently&#039;&#039;&#039; (the &amp;lt;code&amp;gt;latestdistro&amp;lt;/code&amp;gt; link points to the official location where the latest distribution can be found), but &#039;&#039;&#039;all images from &amp;lt;code&amp;gt;https://zxnext.uk/hosted/&amp;lt;/code&amp;gt; work with both MAME and CSpect&#039;&#039;&#039;, like [https://zxnext.uk/hosted/index_files/hdfimages/cspect-next-2gb.zip this SD card image in the zip archive]. Extract the image &amp;lt;code&amp;gt;cspect-next-2gb.img&amp;lt;/code&amp;gt; from the archive to use it, then point MAME to this SD card image with the &amp;lt;code&amp;gt;-hard1&amp;lt;/code&amp;gt; option (or select that file from the menu inside MAME).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
MAME looks for its configuration and helper files in specific (configurable) folders. By default, these are relative to the current working directory (cwd), i.e., from where you launched the executable. The &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file and folders like &amp;lt;code&amp;gt;roms, bgfx, plugins, language, ...&amp;lt;/code&amp;gt; are expected there, unless the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file specifies other paths. When launching through a desktop icon or menu, depending on the OS, the working directory is often defined by the properties of that launch shortcut. When launching MAME from the command line, the current directory is &amp;quot;cwd&amp;quot; (doh). On Linux, MAME will look for &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; first in the &amp;lt;code&amp;gt;~/.mame&amp;lt;/code&amp;gt; folder. You can use the option &amp;lt;code&amp;gt;-inipath&amp;lt;/code&amp;gt; to point MAME to a different path for the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
However, the fastest way to run a machine with a desired configuration is from the command prompt, without requiring a &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file. Most of the features are also available through MAME&#039;s UI, although that takes more time to configure.&lt;br /&gt;
&lt;br /&gt;
As an example, this invocation enables the UI, uses &amp;quot;crisp pixels&amp;quot;, starts in a window, doesn&#039;t display the starting gameinfo window (it can still be displayed interactively from the UI), disables the mouse, confirms before exiting MAME, and specifies the disk image (remember to adjust the path to it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mame -ui_active -nounevenstretch -aspect 2:1 -video bgfx  -bgfx_screen_chains unfiltered -window -skip_gameinfo -mouse_device none -confirm_quit tbblue -hard1 /path/to/cspect-next-2gb.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s cover some useful options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run inside a window and with no mouse support, until you get familiar with the UI keys:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; mame tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
To launch the Linux flatpak version using the same options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; flatpak run org.mamedev.MAME tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Activate UI keys on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -ui_active&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Don&#039;t show the info popup on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -skip_gameinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Run with debugger. If you don&#039;t request this on startup, you won&#039;t have access to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -debug&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Use &amp;quot;crisp&amp;quot; pixels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -nounevenstretch -aspect 2:1 -video bgfx -bgfx_screen_chains unfiltered&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;No joystick connected to PC (having this may slightly speed up MAME&#039;s startup, but &#039;&#039;remember to remove this part from the command line and the corresponding setting in the ini file if you do want to use a joystick&#039;&#039;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -joystickprovider none&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ask for confirmation when exiting MAME (otherwise it&#039;s easy to exit MAME accidentally by hitting ESC, especially when playing games or navigating menus):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -confirm_quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-universal official MAME documentation] for more advanced usage.&lt;br /&gt;
&lt;br /&gt;
= Security: Allowing MAME to Run on Windows and macOS =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Windows,&#039;&#039;&#039; you will need to confirm that you want to launch MAME by clicking &amp;quot;Run Anyway&amp;quot; on first launch. &#039;&#039;(More details needed here.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On macOS,&#039;&#039;&#039; MAME will not open at first. Instead, a dialog will appear saying:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;“mame” Not Opened. Apple could not verify “mame” is free of malware that may harm your Mac or compromise your privacy.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Click “Done”. Then open &#039;&#039;&#039;System Settings -&amp;gt; Privacy &amp;amp; Security&#039;&#039;&#039;, and scroll down to the message &#039;&#039;mame was blocked to protect your Mac.&#039;&#039; Click “Allow Anyway”.&lt;br /&gt;
&lt;br /&gt;
Now launch MAME again. A dialog will ask once more if you want to open “mame”. Click “Open Anyway”, and enter your password or use Touch ID when prompted by macOS.&lt;br /&gt;
&lt;br /&gt;
You will then need to &#039;&#039;&#039;repeat this process for the SDL3 framework.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From now on, you can launch this version of MAME without warnings. However, you &#039;&#039;&#039;will&#039;&#039;&#039; need to repeat this each time you update MAME or the SDL3 framework.&lt;br /&gt;
&lt;br /&gt;
= Keys =&lt;br /&gt;
&lt;br /&gt;
Keys are emulated in two modes: either to control the MAME emulator or completely dedicated to the emulated system (the Next). You can toggle between these two keyboard modes with ScrLk (on Win and Linux) or fn+delete (on Mac).&lt;br /&gt;
&lt;br /&gt;
Some UI keys:&lt;br /&gt;
* F3 - soft reset&lt;br /&gt;
* Shift+F3 - hard reset&lt;br /&gt;
* F4 - sprites/tiles/font viewer (Enter, ], [)&lt;br /&gt;
* F5 - pause emulation&lt;br /&gt;
* F6 - save state&lt;br /&gt;
* F7 - load state&lt;br /&gt;
* Tab - emulator settings&lt;br /&gt;
* ~ - menu&lt;br /&gt;
* ` (backtick) - debugger (when enabled by starting MAME with &amp;lt;code&amp;gt;-debug&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; on the command line)&lt;br /&gt;
* PgDwn (Linux/Mac), fn-Downarrow (MacBooks) or Insert (Win) - hold down to fast-forward emulation at maximum speed, e.g., to speed up booting the Next&lt;br /&gt;
* Esc - exit (exits menus but also the entire emulator - see &amp;lt;code&amp;gt;-confirm_quit&amp;lt;/code&amp;gt; option above)&lt;br /&gt;
* F11 - DivMMC NMI&lt;br /&gt;
* F12 - Multiface NMI&lt;br /&gt;
&lt;br /&gt;
Check [https://docs.mamedev.org/usingmame/defaultkeys.html default keys documentation] for more.&lt;br /&gt;
&lt;br /&gt;
= Changing the UI toggle key =&lt;br /&gt;
&lt;br /&gt;
Some laptops don&#039;t have a Scroll Lock key, so you may not be able to exit MAME if you run it in full-screen mode. In these cases, you can change the UI toggle key as follows:&lt;br /&gt;
&lt;br /&gt;
* Run MAME without any command line arguments (except maybe -window) to open its GUI.&lt;br /&gt;
* Push TAB and enter the General Settings menu.&lt;br /&gt;
* Go to Input Assignments -&amp;gt; User Interface -&amp;gt; Toggle UI controls and select a new key. I use Right Alt / Alt GR.&lt;br /&gt;
* Return to the previous menu twice, then choose Save Settings&lt;br /&gt;
&lt;br /&gt;
= Creating and manipulating NextZXOS SD card image =&lt;br /&gt;
&lt;br /&gt;
Most users wanting to emulate the Next using MAME will be fine using a pre-built SD card image downloaded from the site hosting best pre-made images (currently, [https://zxnext.uk/hosted zxnext.uk/hosted] ) website. The following guide is provided for anyone wanting to create a NextZXOS SD card image from scratch.&lt;br /&gt;
&lt;br /&gt;
Download the [https://www.specnext.com/latestdistro/ latest NextZXOS distribution zip file] (named something like sn-complete-WX.YZ.zip) and extract it into a new, empty directory.&lt;br /&gt;
&lt;br /&gt;
== Creating and populating a SD card image using hdfmonkey jjjs build ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.specnext.com/forum/viewtopic.php?t=2604 hdfmonkey &amp;quot;jjjs build&amp;quot;] is a variant of hdfmonkey tool which includes some unique features and its main archive (at the previously given link) also contains pre-built binaries for Windows x64, MacOS x64, MacOS Apple Silicon and Linux x64. (Alternatively, the process to build a local Linux version of the executable is described [[Development_Tools:Linux_setup#hdfmonkey_tool | here]] )&lt;br /&gt;
&lt;br /&gt;
If you extracted sn-complete-WX.YZ.zip into a subdirectory named &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt;, and you want to create a 1GB image called &amp;lt;code&amp;gt;NextZXOS.img&amp;lt;/code&amp;gt; and you have a jjjs build&amp;quot; of hdfmonkey, then it&#039;s enough to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hdfmonkey create NextZXOS.img 1G&lt;br /&gt;
hdfmonkey putdir NextZXOS.img snWXYZ /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line creates an empty 1GB image and formats it with the best FAT parameters suited to the size of the image.&lt;br /&gt;
&lt;br /&gt;
The second line recursively copies all the content of the directory &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt; to the image, preserving the directory structure inside, starting from the &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; in the image.&lt;br /&gt;
&lt;br /&gt;
One of the advantages of this method is that even if the image has a capacity of 1GB, it will use much less space on your hard drive until you fill up the image. On Linux or MacOS, a command &amp;lt;code&amp;gt;du -h NextZXOS.img&amp;lt;/code&amp;gt; shows the actual amount of disk space used by the image. On Windows the same information can be seen in the File Properties dialog.&lt;br /&gt;
&lt;br /&gt;
The fastest way to transfer a file or a directory (including its content, recursively) into an image is by using a single &amp;lt;code&amp;gt;put&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;putdir&amp;lt;/code&amp;gt;, if it&#039;s to transfer the directory file content to an existing directory) command of hdfmonkey.&lt;br /&gt;
&lt;br /&gt;
The most convenient tool to copy of all the content from the image to a folder outside of the image is 7-zip. On Windows, just use the 7-zip GUI. On MacOS and Linux, see: [[Development_Tools:Linux_setup#Extracting_all_files_from_the_sd-card_image]].&lt;br /&gt;
&lt;br /&gt;
=MAME Plugins and Scripts=&lt;br /&gt;
&lt;br /&gt;
Some MAME plugins and scripts that may be useful for Next developers and end users are listed [[MAME:Plugins_and_Scripts|here]]. They let you speed up the Next boot time, profile your NextBASIC or assembler code, and more.&lt;br /&gt;
&lt;br /&gt;
=Continuous Integration MAME Builds=&lt;br /&gt;
&lt;br /&gt;
MAME is updated on a release schedule, but due to the ongoing nature of development, including for the MAME Next machine, it can sometimes be useful to install a more recent build if it contains a new feature or bugfix you are interested in. Sometimes, this ongoing work is discussed on social media, such as the [https://discordapp.com/channels/556228195767156758/752197165891321886 Next Developer Discord].&lt;br /&gt;
&lt;br /&gt;
Continuous Integration (CI) builds are available from both :&lt;br /&gt;
&lt;br /&gt;
* the [https://github.com/mamedev/mame/actions https://github.com/mamedev/mame/actions -- primary MAME repo Actions pagee] and &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/holub/mame/actions https://github.com/holub/mame/actions -- Holub&#039;s GitHub repo Actions page].&lt;br /&gt;
&lt;br /&gt;
Both are newer builds than the latest official release, and Holub&#039;s repo still tends to contain the fixes still waiting to be accepted to the primary repo. MAME CI builds are available for Windows, Linux, and macOS and are updated automatically whenever code is committed by a maintainer or pushed to the primary repo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You need to be logged in to github&#039;&#039;&#039; to download CI artifacts, so [https://github.com/login sign in] or [https://github.com/signup sign up].&lt;br /&gt;
&lt;br /&gt;
To try out a CI build (more precisely, the resulting binary executable, which is a produced &amp;quot;artifact&amp;quot; of the build process) , first do a full MAME install from the [https://www.mamedev.org/release.html latest release] if you have not already done so. Then back up your main binary from its installation location - these are called something like &amp;lt;code&amp;gt;mame.exe&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;mame&amp;lt;/code&amp;gt;. You&#039;re backing it up to be able to restore it if the CI build doesn&#039;t work, or if you don&#039;t like how the CI build behaves.&lt;br /&gt;
&lt;br /&gt;
Then visit one of the links above and find a workflow run item for your platform. Workflow items are the things in the list. The tags are flagged as &amp;lt;code&amp;gt;CI (Windows)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CI (Linux)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CI (macOS)&amp;lt;/code&amp;gt; in the second row of each workflow item in the list (not the filter in the left hand nav menu). Click on a completed workfow item (only items with green checkmarks will have created downloadable binaries yet), find the Artifacts section at the bottom (note again: you need to be signed up to see that section and/or download the artifact), then click the Download button. Unzip the downloaded file and find the main binary (with the same name as above). Copy the main binary to the install location, overwriting the original one, and run MAME the same way you were running it before. On Windows and macOS, you need to repeat the security steps above to trust the new MAME executable.&lt;br /&gt;
&lt;br /&gt;
= More MAME related links =&lt;br /&gt;
&lt;br /&gt;
MAME [https://docs.mamedev.org/ documentation].&lt;br /&gt;
&lt;br /&gt;
Report any issues with MAME on the [https://mametesters.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;Linux&#039;&#039;&#039; users there are more tips (how to compile MAME from source, how to configure it to not use CWD as starting path for resource directories, how to mount or create image file) at [[Development_Tools:Linux_setup]] page.&lt;br /&gt;
&lt;br /&gt;
[https://docs.mamedev.org/advanced/devicemap.html MAMEDEV.ORG MAME Stable Controller IDs].&lt;br /&gt;
By default, MAME does not assign stable numbers to input devices. For instance, a game pad controller may be assigned to “Joy 1” initially, but after restarting, the same game pad may be reassigned to “Joy 3”.&lt;br /&gt;
Here a some hints how to fixate MAME´s Joystick-Detection to specific Controllers: [https://www.youtube.com/watch?v=YmjfwLuZ_X0 Youtube - Mapping your controllers for stable IDs]&lt;br /&gt;
and: [https://forums.launchbox-app.com/topic/89296-stable-controller-ids-for-mame/ Stable Controller IDs for MAME]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41952</id>
		<title>MAME:Installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41952"/>
		<updated>2026-06-02T20:16:35Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Continuous Integration MAME Builds */ official&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.mamedev.org/ MAME] (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, later expanded to include video game consoles, old computers and other systems in software on modern personal computers and other platforms.&lt;br /&gt;
&lt;br /&gt;
MAME has supported the ZX Spectrum Next since version 0.267. The existing implementation is based on the v3.02.04 core and implements most of the features.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
You will need to install MAME, provide it with the Next firmware (&#039;ROM&#039;), and get the NextZXOS image:&lt;br /&gt;
&lt;br /&gt;
=== 1. Get MAME ===&lt;br /&gt;
Start with these official MAME releases. If you encounter crashes or other bugs, try replacing the MAME executable with holub&#039;s latest Continuous Integration (CI) builds as described at the end of this article.&lt;br /&gt;
&lt;br /&gt;
MAME for macOS now requires the SDL3 library.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Windows:&#039;&#039;&#039; Download [https://www.mamedev.org/release.html MAME for Windows].&lt;br /&gt;
* &#039;&#039;&#039;macOS:&#039;&#039;&#039; Download the [https://github.com/libsdl-org/SDL/releases/latest SDL3 library], and copy its &#039;&#039;&#039;SDL3.xcframework&#039;&#039;&#039; and &#039;&#039;&#039;share&#039;&#039;&#039; folders to ~/Library/Frameworks, as instructed in the included INSTALL.md file. Then download [https://sdlmame.lngn.net/ MAME for macOS].&lt;br /&gt;
* &#039;&#039;&#039;Linux:&#039;&#039;&#039; Install MAME from the flatpak repositories by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo flatpak install org.mamedev.MAME&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Windows and macOS will likely prevent you from launching MAME (and the SDL3 framework) directly for security reasons. See below on how to solve this.&lt;br /&gt;
&lt;br /&gt;
Alternatively, for the MAME platform as a whole, you can also check your package manager, or [https://docs.mamedev.org/initialsetup/compilingmame.html build from sources].&lt;br /&gt;
&lt;br /&gt;
Git of official MAME: [https://github.com/mamedev/mame/ https://github.com/mamedev/mame/] [https://github.com/mamedev/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp]&lt;br /&gt;
&lt;br /&gt;
Git of holub&#039;s fork: [https://github.com/holub/mame https://github.com/holub/mame] [https://github.com/holub/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp] (may contain extra fixes and features before they are merged to official repository)&lt;br /&gt;
&lt;br /&gt;
=== 2. Get TBBLUE (the Next &#039;boot ROM&#039;) ===&lt;br /&gt;
Put the file  [https://github.com/Threetwosevensixseven/NexCreator/raw/master/bootroms/tbblue.zip tbblue.zip] into MAME&#039;s &amp;lt;code&amp;gt;roms&amp;lt;/code&amp;gt; folder. Don&#039;t extract it; MAME will look for the zip file when the &amp;quot;tbblue&amp;quot; machine is selected.&lt;br /&gt;
&lt;br /&gt;
Note: The ROMs in this zip are what is embedded inside the FPGA core on real Next hardware. They&#039;re different from any ZX Spectrum machine ROMs you may be used to using, that are on the distro, SD card or SD image file.&lt;br /&gt;
&lt;br /&gt;
=== 3. Get the NextZXOS Image ===&lt;br /&gt;
Get an SD card image file of [https://www.specnext.com/latestdistro/ NextZXOS]. Note that &#039;&#039;&#039;some disk images published  on the official SpecNext.com site do not work with some emulators currently&#039;&#039;&#039; (the &amp;lt;code&amp;gt;latestdistro&amp;lt;/code&amp;gt; link points to the official location where the latest distribution can be found), but &#039;&#039;&#039;all images from &amp;lt;code&amp;gt;https://zxnext.uk/hosted/&amp;lt;/code&amp;gt; work with both MAME and CSpect&#039;&#039;&#039;, like [https://zxnext.uk/hosted/index_files/hdfimages/cspect-next-2gb.zip this SD card image in the zip archive]. Extract the image &amp;lt;code&amp;gt;cspect-next-2gb.img&amp;lt;/code&amp;gt; from the archive to use it, then point MAME to this SD card image with the &amp;lt;code&amp;gt;-hard1&amp;lt;/code&amp;gt; option (or select that file from the menu inside MAME).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
MAME looks for its configuration and helper files in specific (configurable) folders. By default, these are relative to the current working directory (cwd), i.e., from where you launched the executable. The &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file and folders like &amp;lt;code&amp;gt;roms, bgfx, plugins, language, ...&amp;lt;/code&amp;gt; are expected there, unless the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file specifies other paths. When launching through a desktop icon or menu, depending on the OS, the working directory is often defined by the properties of that launch shortcut. When launching MAME from the command line, the current directory is &amp;quot;cwd&amp;quot; (doh). On Linux, MAME will look for &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; first in the &amp;lt;code&amp;gt;~/.mame&amp;lt;/code&amp;gt; folder. You can use the option &amp;lt;code&amp;gt;-inipath&amp;lt;/code&amp;gt; to point MAME to a different path for the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
However, the fastest way to run a machine with a desired configuration is from the command prompt, without requiring a &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file. Most of the features are also available through MAME&#039;s UI, although that takes more time to configure.&lt;br /&gt;
&lt;br /&gt;
As an example, this invocation enables the UI, uses &amp;quot;crisp pixels&amp;quot;, starts in a window, doesn&#039;t display the starting gameinfo window (it can still be displayed interactively from the UI), disables the mouse, confirms before exiting MAME, and specifies the disk image (remember to adjust the path to it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mame -ui_active -nounevenstretch -aspect 2:1 -video bgfx  -bgfx_screen_chains unfiltered -window -skip_gameinfo -mouse_device none -confirm_quit tbblue -hard1 /path/to/cspect-next-2gb.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s cover some useful options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run inside a window and with no mouse support, until you get familiar with the UI keys:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; mame tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
To launch the Linux flatpak version using the same options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; flatpak run org.mamedev.MAME tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Activate UI keys on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -ui_active&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Don&#039;t show the info popup on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -skip_gameinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Run with debugger. If you don&#039;t request this on startup, you won&#039;t have access to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -debug&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Use &amp;quot;crisp&amp;quot; pixels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -nounevenstretch -aspect 2:1 -video bgfx -bgfx_screen_chains unfiltered&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;No joystick connected to PC (having this may slightly speed up MAME&#039;s startup, but &#039;&#039;remember to remove this part from the command line and the corresponding setting in the ini file if you do want to use a joystick&#039;&#039;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -joystickprovider none&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ask for confirmation when exiting MAME (otherwise it&#039;s easy to exit MAME accidentally by hitting ESC, especially when playing games or navigating menus):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -confirm_quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-universal official MAME documentation] for more advanced usage.&lt;br /&gt;
&lt;br /&gt;
= Security: Allowing MAME to Run on Windows and macOS =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Windows,&#039;&#039;&#039; you will need to confirm that you want to launch MAME by clicking &amp;quot;Run Anyway&amp;quot; on first launch. &#039;&#039;(More details needed here.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On macOS,&#039;&#039;&#039; MAME will not open at first. Instead, a dialog will appear saying:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;“mame” Not Opened. Apple could not verify “mame” is free of malware that may harm your Mac or compromise your privacy.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Click “Done”. Then open &#039;&#039;&#039;System Settings -&amp;gt; Privacy &amp;amp; Security&#039;&#039;&#039;, and scroll down to the message &#039;&#039;mame was blocked to protect your Mac.&#039;&#039; Click “Allow Anyway”.&lt;br /&gt;
&lt;br /&gt;
Now launch MAME again. A dialog will ask once more if you want to open “mame”. Click “Open Anyway”, and enter your password or use Touch ID when prompted by macOS.&lt;br /&gt;
&lt;br /&gt;
You will then need to &#039;&#039;&#039;repeat this process for the SDL3 framework.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From now on, you can launch this version of MAME without warnings. However, you &#039;&#039;&#039;will&#039;&#039;&#039; need to repeat this each time you update MAME or the SDL3 framework.&lt;br /&gt;
&lt;br /&gt;
= Keys =&lt;br /&gt;
&lt;br /&gt;
Keys are emulated in two modes: either to control the MAME emulator or completely dedicated to the emulated system (the Next). You can toggle between these two keyboard modes with ScrLk (on Win and Linux) or fn+delete (on Mac).&lt;br /&gt;
&lt;br /&gt;
Some UI keys:&lt;br /&gt;
* F3 - soft reset&lt;br /&gt;
* Shift+F3 - hard reset&lt;br /&gt;
* F4 - sprites/tiles/font viewer (Enter, ], [)&lt;br /&gt;
* F5 - pause emulation&lt;br /&gt;
* F6 - save state&lt;br /&gt;
* F7 - load state&lt;br /&gt;
* Tab - emulator settings&lt;br /&gt;
* ~ - menu&lt;br /&gt;
* ` (backtick) - debugger (when enabled by starting MAME with &amp;lt;code&amp;gt;-debug&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; on the command line)&lt;br /&gt;
* PgDwn (Linux/Mac), fn-Downarrow (MacBooks) or Insert (Win) - hold down to fast-forward emulation at maximum speed, e.g., to speed up booting the Next&lt;br /&gt;
* Esc - exit (exits menus but also the entire emulator - see &amp;lt;code&amp;gt;-confirm_quit&amp;lt;/code&amp;gt; option above)&lt;br /&gt;
* F11 - DivMMC NMI&lt;br /&gt;
* F12 - Multiface NMI&lt;br /&gt;
&lt;br /&gt;
Check [https://docs.mamedev.org/usingmame/defaultkeys.html default keys documentation] for more.&lt;br /&gt;
&lt;br /&gt;
= Changing the UI toggle key =&lt;br /&gt;
&lt;br /&gt;
Some laptops don&#039;t have a Scroll Lock key, so you may not be able to exit MAME if you run it in full-screen mode. In these cases, you can change the UI toggle key as follows:&lt;br /&gt;
&lt;br /&gt;
* Run MAME without any command line arguments (except maybe -window) to open its GUI.&lt;br /&gt;
* Push TAB and enter the General Settings menu.&lt;br /&gt;
* Go to Input Assignments -&amp;gt; User Interface -&amp;gt; Toggle UI controls and select a new key. I use Right Alt / Alt GR.&lt;br /&gt;
* Return to the previous menu twice, then choose Save Settings&lt;br /&gt;
&lt;br /&gt;
= Creating and manipulating NextZXOS SD card image =&lt;br /&gt;
&lt;br /&gt;
Most users wanting to emulate the Next using MAME will be fine using a pre-built SD card image downloaded from the site hosting best pre-made images (currently, [https://zxnext.uk/hosted zxnext.uk/hosted] ) website. The following guide is provided for anyone wanting to create a NextZXOS SD card image from scratch.&lt;br /&gt;
&lt;br /&gt;
Download the [https://www.specnext.com/latestdistro/ latest NextZXOS distribution zip file] (named something like sn-complete-WX.YZ.zip) and extract it into a new, empty directory.&lt;br /&gt;
&lt;br /&gt;
== Creating and populating a SD card image using hdfmonkey jjjs build ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.specnext.com/forum/viewtopic.php?t=2604 hdfmonkey &amp;quot;jjjs build&amp;quot;] is a variant of hdfmonkey tool which includes some unique features and its main archive (at the previously given link) also contains pre-built binaries for Windows x64, MacOS x64, MacOS Apple Silicon and Linux x64. (Alternatively, the process to build a local Linux version of the executable is described [[Development_Tools:Linux_setup#hdfmonkey_tool | here]] )&lt;br /&gt;
&lt;br /&gt;
If you extracted sn-complete-WX.YZ.zip into a subdirectory named &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt;, and you want to create a 1GB image called &amp;lt;code&amp;gt;NextZXOS.img&amp;lt;/code&amp;gt; and you have a jjjs build&amp;quot; of hdfmonkey, then it&#039;s enough to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hdfmonkey create NextZXOS.img 1G&lt;br /&gt;
hdfmonkey putdir NextZXOS.img snWXYZ /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line creates an empty 1GB image and formats it with the best FAT parameters suited to the size of the image.&lt;br /&gt;
&lt;br /&gt;
The second line recursively copies all the content of the directory &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt; to the image, preserving the directory structure inside, starting from the &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; in the image.&lt;br /&gt;
&lt;br /&gt;
One of the advantages of this method is that even if the image has a capacity of 1GB, it will use much less space on your hard drive until you fill up the image. On Linux or MacOS, a command &amp;lt;code&amp;gt;du -h NextZXOS.img&amp;lt;/code&amp;gt; shows the actual amount of disk space used by the image. On Windows the same information can be seen in the File Properties dialog.&lt;br /&gt;
&lt;br /&gt;
The fastest way to transfer a file or a directory (including its content, recursively) into an image is by using a single &amp;lt;code&amp;gt;put&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;putdir&amp;lt;/code&amp;gt;, if it&#039;s to transfer the directory file content to an existing directory) command of hdfmonkey.&lt;br /&gt;
&lt;br /&gt;
The most convenient tool to copy of all the content from the image to a folder outside of the image is 7-zip. On Windows, just use the 7-zip GUI. On MacOS and Linux, see: [[Development_Tools:Linux_setup#Extracting_all_files_from_the_sd-card_image]].&lt;br /&gt;
&lt;br /&gt;
=MAME Plugins and Scripts=&lt;br /&gt;
&lt;br /&gt;
Some MAME plugins and scripts that may be useful for Next developers and end users are listed [[MAME:Plugins_and_Scripts|here]]. They let you speed up the Next boot time, profile your NextBASIC or assembler code, and more.&lt;br /&gt;
&lt;br /&gt;
=Continuous Integration MAME Builds=&lt;br /&gt;
&lt;br /&gt;
MAME is updated on a release schedule, but due to the ongoing nature of development, including for the MAME Next machine, it can sometimes be useful to install a more recent build if it contains a new feature or bugfix you are interested in. Sometimes, this ongoing work is discussed on social media, such as the [https://discordapp.com/channels/556228195767156758/752197165891321886 Next Developer Discord].&lt;br /&gt;
&lt;br /&gt;
Continuous Integration (CI) builds are available from both :&lt;br /&gt;
&lt;br /&gt;
* the [https://github.com/mamedev/mame/actions https://github.com/mamedev/mame/actions primary MAME repo Actions pagee] and &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/holub/mame/actions https://github.com/holub/mame/actions Holub&#039;s GitHub repo Actions page].&lt;br /&gt;
&lt;br /&gt;
Both are newer builds than the latest official release, and Holub&#039;s repo still tends to contain the fixes still waiting to be accepted to the primary repo. MAME CI builds are available for Windows, Linux, and macOS and are updated automatically whenever code is committed by a maintainer or pushed to the primary repo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You need to be logged in to github&#039;&#039;&#039; to download CI artifacts, so [https://github.com/login sign in] or [https://github.com/signup sign up].&lt;br /&gt;
&lt;br /&gt;
To try out a CI build (more precisely, the resulting binary executable, which is a produced &amp;quot;artifact&amp;quot; of the build process) , first do a full MAME install from the [https://www.mamedev.org/release.html latest release] if you have not already done so. Then back up your main binary from its installation location - these are called something like &amp;lt;code&amp;gt;mame.exe&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;mame&amp;lt;/code&amp;gt;. You&#039;re backing it up to be able to restore it if the CI build doesn&#039;t work, or if you don&#039;t like how the CI build behaves.&lt;br /&gt;
&lt;br /&gt;
Then visit one of the links above and find a workflow run item for your platform. Workflow items are the things in the list. The tags are flagged as &amp;lt;code&amp;gt;CI (Windows)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CI (Linux)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CI (macOS)&amp;lt;/code&amp;gt; in the second row of each workflow item in the list (not the filter in the left hand nav menu). Click on a completed workfow item (only items with green checkmarks will have created downloadable binaries yet), find the Artifacts section at the bottom (note again: you need to be signed up to see that section and/or download the artifact), then click the Download button. Unzip the downloaded file and find the main binary (with the same name as above). Copy the main binary to the install location, overwriting the original one, and run MAME the same way you were running it before. On Windows and macOS, you need to repeat the security steps above to trust the new MAME executable.&lt;br /&gt;
&lt;br /&gt;
= More MAME related links =&lt;br /&gt;
&lt;br /&gt;
MAME [https://docs.mamedev.org/ documentation].&lt;br /&gt;
&lt;br /&gt;
Report any issues with MAME on the [https://mametesters.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;Linux&#039;&#039;&#039; users there are more tips (how to compile MAME from source, how to configure it to not use CWD as starting path for resource directories, how to mount or create image file) at [[Development_Tools:Linux_setup]] page.&lt;br /&gt;
&lt;br /&gt;
[https://docs.mamedev.org/advanced/devicemap.html MAMEDEV.ORG MAME Stable Controller IDs].&lt;br /&gt;
By default, MAME does not assign stable numbers to input devices. For instance, a game pad controller may be assigned to “Joy 1” initially, but after restarting, the same game pad may be reassigned to “Joy 3”.&lt;br /&gt;
Here a some hints how to fixate MAME´s Joystick-Detection to specific Controllers: [https://www.youtube.com/watch?v=YmjfwLuZ_X0 Youtube - Mapping your controllers for stable IDs]&lt;br /&gt;
and: [https://forums.launchbox-app.com/topic/89296-stable-controller-ids-for-mame/ Stable Controller IDs for MAME]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41951</id>
		<title>MAME:Installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41951"/>
		<updated>2026-06-02T20:14:58Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Continuous Integration MAME Builds */ actions pages more prominent&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.mamedev.org/ MAME] (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, later expanded to include video game consoles, old computers and other systems in software on modern personal computers and other platforms.&lt;br /&gt;
&lt;br /&gt;
MAME has supported the ZX Spectrum Next since version 0.267. The existing implementation is based on the v3.02.04 core and implements most of the features.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
You will need to install MAME, provide it with the Next firmware (&#039;ROM&#039;), and get the NextZXOS image:&lt;br /&gt;
&lt;br /&gt;
=== 1. Get MAME ===&lt;br /&gt;
Start with these official MAME releases. If you encounter crashes or other bugs, try replacing the MAME executable with holub&#039;s latest Continuous Integration (CI) builds as described at the end of this article.&lt;br /&gt;
&lt;br /&gt;
MAME for macOS now requires the SDL3 library.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Windows:&#039;&#039;&#039; Download [https://www.mamedev.org/release.html MAME for Windows].&lt;br /&gt;
* &#039;&#039;&#039;macOS:&#039;&#039;&#039; Download the [https://github.com/libsdl-org/SDL/releases/latest SDL3 library], and copy its &#039;&#039;&#039;SDL3.xcframework&#039;&#039;&#039; and &#039;&#039;&#039;share&#039;&#039;&#039; folders to ~/Library/Frameworks, as instructed in the included INSTALL.md file. Then download [https://sdlmame.lngn.net/ MAME for macOS].&lt;br /&gt;
* &#039;&#039;&#039;Linux:&#039;&#039;&#039; Install MAME from the flatpak repositories by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo flatpak install org.mamedev.MAME&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Windows and macOS will likely prevent you from launching MAME (and the SDL3 framework) directly for security reasons. See below on how to solve this.&lt;br /&gt;
&lt;br /&gt;
Alternatively, for the MAME platform as a whole, you can also check your package manager, or [https://docs.mamedev.org/initialsetup/compilingmame.html build from sources].&lt;br /&gt;
&lt;br /&gt;
Git of official MAME: [https://github.com/mamedev/mame/ https://github.com/mamedev/mame/] [https://github.com/mamedev/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp]&lt;br /&gt;
&lt;br /&gt;
Git of holub&#039;s fork: [https://github.com/holub/mame https://github.com/holub/mame] [https://github.com/holub/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp] (may contain extra fixes and features before they are merged to official repository)&lt;br /&gt;
&lt;br /&gt;
=== 2. Get TBBLUE (the Next &#039;boot ROM&#039;) ===&lt;br /&gt;
Put the file  [https://github.com/Threetwosevensixseven/NexCreator/raw/master/bootroms/tbblue.zip tbblue.zip] into MAME&#039;s &amp;lt;code&amp;gt;roms&amp;lt;/code&amp;gt; folder. Don&#039;t extract it; MAME will look for the zip file when the &amp;quot;tbblue&amp;quot; machine is selected.&lt;br /&gt;
&lt;br /&gt;
Note: The ROMs in this zip are what is embedded inside the FPGA core on real Next hardware. They&#039;re different from any ZX Spectrum machine ROMs you may be used to using, that are on the distro, SD card or SD image file.&lt;br /&gt;
&lt;br /&gt;
=== 3. Get the NextZXOS Image ===&lt;br /&gt;
Get an SD card image file of [https://www.specnext.com/latestdistro/ NextZXOS]. Note that &#039;&#039;&#039;some disk images published  on the official SpecNext.com site do not work with some emulators currently&#039;&#039;&#039; (the &amp;lt;code&amp;gt;latestdistro&amp;lt;/code&amp;gt; link points to the official location where the latest distribution can be found), but &#039;&#039;&#039;all images from &amp;lt;code&amp;gt;https://zxnext.uk/hosted/&amp;lt;/code&amp;gt; work with both MAME and CSpect&#039;&#039;&#039;, like [https://zxnext.uk/hosted/index_files/hdfimages/cspect-next-2gb.zip this SD card image in the zip archive]. Extract the image &amp;lt;code&amp;gt;cspect-next-2gb.img&amp;lt;/code&amp;gt; from the archive to use it, then point MAME to this SD card image with the &amp;lt;code&amp;gt;-hard1&amp;lt;/code&amp;gt; option (or select that file from the menu inside MAME).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
MAME looks for its configuration and helper files in specific (configurable) folders. By default, these are relative to the current working directory (cwd), i.e., from where you launched the executable. The &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file and folders like &amp;lt;code&amp;gt;roms, bgfx, plugins, language, ...&amp;lt;/code&amp;gt; are expected there, unless the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file specifies other paths. When launching through a desktop icon or menu, depending on the OS, the working directory is often defined by the properties of that launch shortcut. When launching MAME from the command line, the current directory is &amp;quot;cwd&amp;quot; (doh). On Linux, MAME will look for &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; first in the &amp;lt;code&amp;gt;~/.mame&amp;lt;/code&amp;gt; folder. You can use the option &amp;lt;code&amp;gt;-inipath&amp;lt;/code&amp;gt; to point MAME to a different path for the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
However, the fastest way to run a machine with a desired configuration is from the command prompt, without requiring a &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file. Most of the features are also available through MAME&#039;s UI, although that takes more time to configure.&lt;br /&gt;
&lt;br /&gt;
As an example, this invocation enables the UI, uses &amp;quot;crisp pixels&amp;quot;, starts in a window, doesn&#039;t display the starting gameinfo window (it can still be displayed interactively from the UI), disables the mouse, confirms before exiting MAME, and specifies the disk image (remember to adjust the path to it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mame -ui_active -nounevenstretch -aspect 2:1 -video bgfx  -bgfx_screen_chains unfiltered -window -skip_gameinfo -mouse_device none -confirm_quit tbblue -hard1 /path/to/cspect-next-2gb.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s cover some useful options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run inside a window and with no mouse support, until you get familiar with the UI keys:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; mame tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
To launch the Linux flatpak version using the same options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; flatpak run org.mamedev.MAME tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Activate UI keys on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -ui_active&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Don&#039;t show the info popup on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -skip_gameinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Run with debugger. If you don&#039;t request this on startup, you won&#039;t have access to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -debug&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Use &amp;quot;crisp&amp;quot; pixels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -nounevenstretch -aspect 2:1 -video bgfx -bgfx_screen_chains unfiltered&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;No joystick connected to PC (having this may slightly speed up MAME&#039;s startup, but &#039;&#039;remember to remove this part from the command line and the corresponding setting in the ini file if you do want to use a joystick&#039;&#039;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -joystickprovider none&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ask for confirmation when exiting MAME (otherwise it&#039;s easy to exit MAME accidentally by hitting ESC, especially when playing games or navigating menus):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -confirm_quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-universal official MAME documentation] for more advanced usage.&lt;br /&gt;
&lt;br /&gt;
= Security: Allowing MAME to Run on Windows and macOS =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Windows,&#039;&#039;&#039; you will need to confirm that you want to launch MAME by clicking &amp;quot;Run Anyway&amp;quot; on first launch. &#039;&#039;(More details needed here.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On macOS,&#039;&#039;&#039; MAME will not open at first. Instead, a dialog will appear saying:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;“mame” Not Opened. Apple could not verify “mame” is free of malware that may harm your Mac or compromise your privacy.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Click “Done”. Then open &#039;&#039;&#039;System Settings -&amp;gt; Privacy &amp;amp; Security&#039;&#039;&#039;, and scroll down to the message &#039;&#039;mame was blocked to protect your Mac.&#039;&#039; Click “Allow Anyway”.&lt;br /&gt;
&lt;br /&gt;
Now launch MAME again. A dialog will ask once more if you want to open “mame”. Click “Open Anyway”, and enter your password or use Touch ID when prompted by macOS.&lt;br /&gt;
&lt;br /&gt;
You will then need to &#039;&#039;&#039;repeat this process for the SDL3 framework.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From now on, you can launch this version of MAME without warnings. However, you &#039;&#039;&#039;will&#039;&#039;&#039; need to repeat this each time you update MAME or the SDL3 framework.&lt;br /&gt;
&lt;br /&gt;
= Keys =&lt;br /&gt;
&lt;br /&gt;
Keys are emulated in two modes: either to control the MAME emulator or completely dedicated to the emulated system (the Next). You can toggle between these two keyboard modes with ScrLk (on Win and Linux) or fn+delete (on Mac).&lt;br /&gt;
&lt;br /&gt;
Some UI keys:&lt;br /&gt;
* F3 - soft reset&lt;br /&gt;
* Shift+F3 - hard reset&lt;br /&gt;
* F4 - sprites/tiles/font viewer (Enter, ], [)&lt;br /&gt;
* F5 - pause emulation&lt;br /&gt;
* F6 - save state&lt;br /&gt;
* F7 - load state&lt;br /&gt;
* Tab - emulator settings&lt;br /&gt;
* ~ - menu&lt;br /&gt;
* ` (backtick) - debugger (when enabled by starting MAME with &amp;lt;code&amp;gt;-debug&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; on the command line)&lt;br /&gt;
* PgDwn (Linux/Mac), fn-Downarrow (MacBooks) or Insert (Win) - hold down to fast-forward emulation at maximum speed, e.g., to speed up booting the Next&lt;br /&gt;
* Esc - exit (exits menus but also the entire emulator - see &amp;lt;code&amp;gt;-confirm_quit&amp;lt;/code&amp;gt; option above)&lt;br /&gt;
* F11 - DivMMC NMI&lt;br /&gt;
* F12 - Multiface NMI&lt;br /&gt;
&lt;br /&gt;
Check [https://docs.mamedev.org/usingmame/defaultkeys.html default keys documentation] for more.&lt;br /&gt;
&lt;br /&gt;
= Changing the UI toggle key =&lt;br /&gt;
&lt;br /&gt;
Some laptops don&#039;t have a Scroll Lock key, so you may not be able to exit MAME if you run it in full-screen mode. In these cases, you can change the UI toggle key as follows:&lt;br /&gt;
&lt;br /&gt;
* Run MAME without any command line arguments (except maybe -window) to open its GUI.&lt;br /&gt;
* Push TAB and enter the General Settings menu.&lt;br /&gt;
* Go to Input Assignments -&amp;gt; User Interface -&amp;gt; Toggle UI controls and select a new key. I use Right Alt / Alt GR.&lt;br /&gt;
* Return to the previous menu twice, then choose Save Settings&lt;br /&gt;
&lt;br /&gt;
= Creating and manipulating NextZXOS SD card image =&lt;br /&gt;
&lt;br /&gt;
Most users wanting to emulate the Next using MAME will be fine using a pre-built SD card image downloaded from the site hosting best pre-made images (currently, [https://zxnext.uk/hosted zxnext.uk/hosted] ) website. The following guide is provided for anyone wanting to create a NextZXOS SD card image from scratch.&lt;br /&gt;
&lt;br /&gt;
Download the [https://www.specnext.com/latestdistro/ latest NextZXOS distribution zip file] (named something like sn-complete-WX.YZ.zip) and extract it into a new, empty directory.&lt;br /&gt;
&lt;br /&gt;
== Creating and populating a SD card image using hdfmonkey jjjs build ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.specnext.com/forum/viewtopic.php?t=2604 hdfmonkey &amp;quot;jjjs build&amp;quot;] is a variant of hdfmonkey tool which includes some unique features and its main archive (at the previously given link) also contains pre-built binaries for Windows x64, MacOS x64, MacOS Apple Silicon and Linux x64. (Alternatively, the process to build a local Linux version of the executable is described [[Development_Tools:Linux_setup#hdfmonkey_tool | here]] )&lt;br /&gt;
&lt;br /&gt;
If you extracted sn-complete-WX.YZ.zip into a subdirectory named &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt;, and you want to create a 1GB image called &amp;lt;code&amp;gt;NextZXOS.img&amp;lt;/code&amp;gt; and you have a jjjs build&amp;quot; of hdfmonkey, then it&#039;s enough to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hdfmonkey create NextZXOS.img 1G&lt;br /&gt;
hdfmonkey putdir NextZXOS.img snWXYZ /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line creates an empty 1GB image and formats it with the best FAT parameters suited to the size of the image.&lt;br /&gt;
&lt;br /&gt;
The second line recursively copies all the content of the directory &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt; to the image, preserving the directory structure inside, starting from the &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; in the image.&lt;br /&gt;
&lt;br /&gt;
One of the advantages of this method is that even if the image has a capacity of 1GB, it will use much less space on your hard drive until you fill up the image. On Linux or MacOS, a command &amp;lt;code&amp;gt;du -h NextZXOS.img&amp;lt;/code&amp;gt; shows the actual amount of disk space used by the image. On Windows the same information can be seen in the File Properties dialog.&lt;br /&gt;
&lt;br /&gt;
The fastest way to transfer a file or a directory (including its content, recursively) into an image is by using a single &amp;lt;code&amp;gt;put&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;putdir&amp;lt;/code&amp;gt;, if it&#039;s to transfer the directory file content to an existing directory) command of hdfmonkey.&lt;br /&gt;
&lt;br /&gt;
The most convenient tool to copy of all the content from the image to a folder outside of the image is 7-zip. On Windows, just use the 7-zip GUI. On MacOS and Linux, see: [[Development_Tools:Linux_setup#Extracting_all_files_from_the_sd-card_image]].&lt;br /&gt;
&lt;br /&gt;
=MAME Plugins and Scripts=&lt;br /&gt;
&lt;br /&gt;
Some MAME plugins and scripts that may be useful for Next developers and end users are listed [[MAME:Plugins_and_Scripts|here]]. They let you speed up the Next boot time, profile your NextBASIC or assembler code, and more.&lt;br /&gt;
&lt;br /&gt;
=Continuous Integration MAME Builds=&lt;br /&gt;
&lt;br /&gt;
MAME is updated on a release schedule, but due to the ongoing nature of development, including for the MAME Next machine, it can sometimes be useful to install a more recent build if it contains a new feature or bugfix you are interested in. Sometimes, this ongoing work is discussed on social media, such as the [https://discordapp.com/channels/556228195767156758/752197165891321886 Next Developer Discord].&lt;br /&gt;
&lt;br /&gt;
Continuous Integration (CI) builds are available from both :&lt;br /&gt;
&lt;br /&gt;
* the [https://github.com/mamedev/mame/actions https://github.com/mamedev/mame/actions primary MAME repo Actions pagee] and &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/holub/mame/actions https://github.com/holub/mame/actions Holub&#039;s GitHub repo Actions page].&lt;br /&gt;
&lt;br /&gt;
Both are newer builds than the latest release, and Holub&#039;s repo still tends to contain the fixes still waiting to be accepted to the primary repo. MAME CI builds are available for Windows, Linux, and macOS and are updated automatically whenever code is committed by a maintainer or pushed to the primary repo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You need to be logged in to github&#039;&#039;&#039; to download CI artifacts, so [https://github.com/login sign in] or [https://github.com/signup sign up].&lt;br /&gt;
&lt;br /&gt;
To try out a CI build (more precisely, the resulting binary executable, which is a produced &amp;quot;artifact&amp;quot; of the build process) , first do a full MAME install from the [https://www.mamedev.org/release.html latest release] if you have not already done so. Then back up your main binary from its installation location - these are called something like &amp;lt;code&amp;gt;mame.exe&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;mame&amp;lt;/code&amp;gt;. You&#039;re backing it up to be able to restore it if the CI build doesn&#039;t work, or if you don&#039;t like how the CI build behaves.&lt;br /&gt;
&lt;br /&gt;
Then visit one of the links above and find a workflow run item for your platform. Workflow items are the things in the list. The tags are flagged as &amp;lt;code&amp;gt;CI (Windows)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CI (Linux)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CI (macOS)&amp;lt;/code&amp;gt; in the second row of each workflow item in the list (not the filter in the left hand nav menu). Click on a completed workfow item (only items with green checkmarks will have created downloadable binaries yet), find the Artifacts section at the bottom (note again: you need to be signed up to see that section and/or download the artifact), then click the Download button. Unzip the downloaded file and find the main binary (with the same name as above). Copy the main binary to the install location, overwriting the original one, and run MAME the same way you were running it before. On Windows and macOS, you need to repeat the security steps above to trust the new MAME executable.&lt;br /&gt;
&lt;br /&gt;
= More MAME related links =&lt;br /&gt;
&lt;br /&gt;
MAME [https://docs.mamedev.org/ documentation].&lt;br /&gt;
&lt;br /&gt;
Report any issues with MAME on the [https://mametesters.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;Linux&#039;&#039;&#039; users there are more tips (how to compile MAME from source, how to configure it to not use CWD as starting path for resource directories, how to mount or create image file) at [[Development_Tools:Linux_setup]] page.&lt;br /&gt;
&lt;br /&gt;
[https://docs.mamedev.org/advanced/devicemap.html MAMEDEV.ORG MAME Stable Controller IDs].&lt;br /&gt;
By default, MAME does not assign stable numbers to input devices. For instance, a game pad controller may be assigned to “Joy 1” initially, but after restarting, the same game pad may be reassigned to “Joy 3”.&lt;br /&gt;
Here a some hints how to fixate MAME´s Joystick-Detection to specific Controllers: [https://www.youtube.com/watch?v=YmjfwLuZ_X0 Youtube - Mapping your controllers for stable IDs]&lt;br /&gt;
and: [https://forums.launchbox-app.com/topic/89296-stable-controller-ids-for-mame/ Stable Controller IDs for MAME]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41950</id>
		<title>MAME:Installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=MAME:Installing&amp;diff=41950"/>
		<updated>2026-06-01T23:13:53Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: core 3.02.04&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.mamedev.org/ MAME] (formerly an acronym of Multiple Arcade Machine Emulator) is a free and open-source emulator designed to emulate the hardware of arcade games, later expanded to include video game consoles, old computers and other systems in software on modern personal computers and other platforms.&lt;br /&gt;
&lt;br /&gt;
MAME has supported the ZX Spectrum Next since version 0.267. The existing implementation is based on the v3.02.04 core and implements most of the features.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
You will need to install MAME, provide it with the Next firmware (&#039;ROM&#039;), and get the NextZXOS image:&lt;br /&gt;
&lt;br /&gt;
=== 1. Get MAME ===&lt;br /&gt;
Start with these official MAME releases. If you encounter crashes or other bugs, try replacing the MAME executable with holub&#039;s latest Continuous Integration (CI) builds as described at the end of this article.&lt;br /&gt;
&lt;br /&gt;
MAME for macOS now requires the SDL3 library.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Windows:&#039;&#039;&#039; Download [https://www.mamedev.org/release.html MAME for Windows].&lt;br /&gt;
* &#039;&#039;&#039;macOS:&#039;&#039;&#039; Download the [https://github.com/libsdl-org/SDL/releases/latest SDL3 library], and copy its &#039;&#039;&#039;SDL3.xcframework&#039;&#039;&#039; and &#039;&#039;&#039;share&#039;&#039;&#039; folders to ~/Library/Frameworks, as instructed in the included INSTALL.md file. Then download [https://sdlmame.lngn.net/ MAME for macOS].&lt;br /&gt;
* &#039;&#039;&#039;Linux:&#039;&#039;&#039; Install MAME from the flatpak repositories by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo flatpak install org.mamedev.MAME&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that Windows and macOS will likely prevent you from launching MAME (and the SDL3 framework) directly for security reasons. See below on how to solve this.&lt;br /&gt;
&lt;br /&gt;
Alternatively, for the MAME platform as a whole, you can also check your package manager, or [https://docs.mamedev.org/initialsetup/compilingmame.html build from sources].&lt;br /&gt;
&lt;br /&gt;
Git of official MAME: [https://github.com/mamedev/mame/ https://github.com/mamedev/mame/] [https://github.com/mamedev/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp]&lt;br /&gt;
&lt;br /&gt;
Git of holub&#039;s fork: [https://github.com/holub/mame https://github.com/holub/mame] [https://github.com/holub/mame/blob/master/src/mame/sinclair/next/specnext.cpp specnext.cpp] (may contain extra fixes and features before they are merged to official repository)&lt;br /&gt;
&lt;br /&gt;
=== 2. Get TBBLUE (the Next &#039;boot ROM&#039;) ===&lt;br /&gt;
Put the file  [https://github.com/Threetwosevensixseven/NexCreator/raw/master/bootroms/tbblue.zip tbblue.zip] into MAME&#039;s &amp;lt;code&amp;gt;roms&amp;lt;/code&amp;gt; folder. Don&#039;t extract it; MAME will look for the zip file when the &amp;quot;tbblue&amp;quot; machine is selected.&lt;br /&gt;
&lt;br /&gt;
Note: The ROMs in this zip are what is embedded inside the FPGA core on real Next hardware. They&#039;re different from any ZX Spectrum machine ROMs you may be used to using, that are on the distro, SD card or SD image file.&lt;br /&gt;
&lt;br /&gt;
=== 3. Get the NextZXOS Image ===&lt;br /&gt;
Get an SD card image file of [https://www.specnext.com/latestdistro/ NextZXOS]. Note that &#039;&#039;&#039;some disk images published  on the official SpecNext.com site do not work with some emulators currently&#039;&#039;&#039; (the &amp;lt;code&amp;gt;latestdistro&amp;lt;/code&amp;gt; link points to the official location where the latest distribution can be found), but &#039;&#039;&#039;all images from &amp;lt;code&amp;gt;https://zxnext.uk/hosted/&amp;lt;/code&amp;gt; work with both MAME and CSpect&#039;&#039;&#039;, like [https://zxnext.uk/hosted/index_files/hdfimages/cspect-next-2gb.zip this SD card image in the zip archive]. Extract the image &amp;lt;code&amp;gt;cspect-next-2gb.img&amp;lt;/code&amp;gt; from the archive to use it, then point MAME to this SD card image with the &amp;lt;code&amp;gt;-hard1&amp;lt;/code&amp;gt; option (or select that file from the menu inside MAME).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
MAME looks for its configuration and helper files in specific (configurable) folders. By default, these are relative to the current working directory (cwd), i.e., from where you launched the executable. The &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file and folders like &amp;lt;code&amp;gt;roms, bgfx, plugins, language, ...&amp;lt;/code&amp;gt; are expected there, unless the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file specifies other paths. When launching through a desktop icon or menu, depending on the OS, the working directory is often defined by the properties of that launch shortcut. When launching MAME from the command line, the current directory is &amp;quot;cwd&amp;quot; (doh). On Linux, MAME will look for &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; first in the &amp;lt;code&amp;gt;~/.mame&amp;lt;/code&amp;gt; folder. You can use the option &amp;lt;code&amp;gt;-inipath&amp;lt;/code&amp;gt; to point MAME to a different path for the &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
However, the fastest way to run a machine with a desired configuration is from the command prompt, without requiring a &amp;lt;code&amp;gt;mame.ini&amp;lt;/code&amp;gt; file. Most of the features are also available through MAME&#039;s UI, although that takes more time to configure.&lt;br /&gt;
&lt;br /&gt;
As an example, this invocation enables the UI, uses &amp;quot;crisp pixels&amp;quot;, starts in a window, doesn&#039;t display the starting gameinfo window (it can still be displayed interactively from the UI), disables the mouse, confirms before exiting MAME, and specifies the disk image (remember to adjust the path to it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mame -ui_active -nounevenstretch -aspect 2:1 -video bgfx  -bgfx_screen_chains unfiltered -window -skip_gameinfo -mouse_device none -confirm_quit tbblue -hard1 /path/to/cspect-next-2gb.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s cover some useful options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run inside a window and with no mouse support, until you get familiar with the UI keys:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; mame tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
To launch the Linux flatpak version using the same options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; flatpak run org.mamedev.MAME tbblue -window -mouse_device none -hard1 /path/to/next-distribution.img&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Activate UI keys on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -ui_active&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Don&#039;t show the info popup on startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -skip_gameinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Run with debugger. If you don&#039;t request this on startup, you won&#039;t have access to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -debug&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Use &amp;quot;crisp&amp;quot; pixels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -nounevenstretch -aspect 2:1 -video bgfx -bgfx_screen_chains unfiltered&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;No joystick connected to PC (having this may slightly speed up MAME&#039;s startup, but &#039;&#039;remember to remove this part from the command line and the corresponding setting in the ini file if you do want to use a joystick&#039;&#039;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -joystickprovider none&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Ask for confirmation when exiting MAME (otherwise it&#039;s easy to exit MAME accidentally by hitting ESC, especially when playing games or navigating menus):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; ... -confirm_quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-universal official MAME documentation] for more advanced usage.&lt;br /&gt;
&lt;br /&gt;
= Security: Allowing MAME to Run on Windows and macOS =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Windows,&#039;&#039;&#039; you will need to confirm that you want to launch MAME by clicking &amp;quot;Run Anyway&amp;quot; on first launch. &#039;&#039;(More details needed here.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On macOS,&#039;&#039;&#039; MAME will not open at first. Instead, a dialog will appear saying:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;“mame” Not Opened. Apple could not verify “mame” is free of malware that may harm your Mac or compromise your privacy.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Click “Done”. Then open &#039;&#039;&#039;System Settings -&amp;gt; Privacy &amp;amp; Security&#039;&#039;&#039;, and scroll down to the message &#039;&#039;mame was blocked to protect your Mac.&#039;&#039; Click “Allow Anyway”.&lt;br /&gt;
&lt;br /&gt;
Now launch MAME again. A dialog will ask once more if you want to open “mame”. Click “Open Anyway”, and enter your password or use Touch ID when prompted by macOS.&lt;br /&gt;
&lt;br /&gt;
You will then need to &#039;&#039;&#039;repeat this process for the SDL3 framework.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From now on, you can launch this version of MAME without warnings. However, you &#039;&#039;&#039;will&#039;&#039;&#039; need to repeat this each time you update MAME or the SDL3 framework.&lt;br /&gt;
&lt;br /&gt;
= Keys =&lt;br /&gt;
&lt;br /&gt;
Keys are emulated in two modes: either to control the MAME emulator or completely dedicated to the emulated system (the Next). You can toggle between these two keyboard modes with ScrLk (on Win and Linux) or fn+delete (on Mac).&lt;br /&gt;
&lt;br /&gt;
Some UI keys:&lt;br /&gt;
* F3 - soft reset&lt;br /&gt;
* Shift+F3 - hard reset&lt;br /&gt;
* F4 - sprites/tiles/font viewer (Enter, ], [)&lt;br /&gt;
* F5 - pause emulation&lt;br /&gt;
* F6 - save state&lt;br /&gt;
* F7 - load state&lt;br /&gt;
* Tab - emulator settings&lt;br /&gt;
* ~ - menu&lt;br /&gt;
* ` (backtick) - debugger (when enabled by starting MAME with &amp;lt;code&amp;gt;-debug&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; on the command line)&lt;br /&gt;
* PgDwn (Linux/Mac), fn-Downarrow (MacBooks) or Insert (Win) - hold down to fast-forward emulation at maximum speed, e.g., to speed up booting the Next&lt;br /&gt;
* Esc - exit (exits menus but also the entire emulator - see &amp;lt;code&amp;gt;-confirm_quit&amp;lt;/code&amp;gt; option above)&lt;br /&gt;
* F11 - DivMMC NMI&lt;br /&gt;
* F12 - Multiface NMI&lt;br /&gt;
&lt;br /&gt;
Check [https://docs.mamedev.org/usingmame/defaultkeys.html default keys documentation] for more.&lt;br /&gt;
&lt;br /&gt;
= Changing the UI toggle key =&lt;br /&gt;
&lt;br /&gt;
Some laptops don&#039;t have a Scroll Lock key, so you may not be able to exit MAME if you run it in full-screen mode. In these cases, you can change the UI toggle key as follows:&lt;br /&gt;
&lt;br /&gt;
* Run MAME without any command line arguments (except maybe -window) to open its GUI.&lt;br /&gt;
* Push TAB and enter the General Settings menu.&lt;br /&gt;
* Go to Input Assignments -&amp;gt; User Interface -&amp;gt; Toggle UI controls and select a new key. I use Right Alt / Alt GR.&lt;br /&gt;
* Return to the previous menu twice, then choose Save Settings&lt;br /&gt;
&lt;br /&gt;
= Creating and manipulating NextZXOS SD card image =&lt;br /&gt;
&lt;br /&gt;
Most users wanting to emulate the Next using MAME will be fine using a pre-built SD card image downloaded from the site hosting best pre-made images (currently, [https://zxnext.uk/hosted zxnext.uk/hosted] ) website. The following guide is provided for anyone wanting to create a NextZXOS SD card image from scratch.&lt;br /&gt;
&lt;br /&gt;
Download the [https://www.specnext.com/latestdistro/ latest NextZXOS distribution zip file] (named something like sn-complete-WX.YZ.zip) and extract it into a new, empty directory.&lt;br /&gt;
&lt;br /&gt;
== Creating and populating a SD card image using hdfmonkey jjjs build ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.specnext.com/forum/viewtopic.php?t=2604 hdfmonkey &amp;quot;jjjs build&amp;quot;] is a variant of hdfmonkey tool which includes some unique features and its main archive (at the previously given link) also contains pre-built binaries for Windows x64, MacOS x64, MacOS Apple Silicon and Linux x64. (Alternatively, the process to build a local Linux version of the executable is described [[Development_Tools:Linux_setup#hdfmonkey_tool | here]] )&lt;br /&gt;
&lt;br /&gt;
If you extracted sn-complete-WX.YZ.zip into a subdirectory named &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt;, and you want to create a 1GB image called &amp;lt;code&amp;gt;NextZXOS.img&amp;lt;/code&amp;gt; and you have a jjjs build&amp;quot; of hdfmonkey, then it&#039;s enough to do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hdfmonkey create NextZXOS.img 1G&lt;br /&gt;
hdfmonkey putdir NextZXOS.img snWXYZ /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line creates an empty 1GB image and formats it with the best FAT parameters suited to the size of the image.&lt;br /&gt;
&lt;br /&gt;
The second line recursively copies all the content of the directory &amp;lt;code&amp;gt;snWXYZ&amp;lt;/code&amp;gt; to the image, preserving the directory structure inside, starting from the &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; in the image.&lt;br /&gt;
&lt;br /&gt;
One of the advantages of this method is that even if the image has a capacity of 1GB, it will use much less space on your hard drive until you fill up the image. On Linux or MacOS, a command &amp;lt;code&amp;gt;du -h NextZXOS.img&amp;lt;/code&amp;gt; shows the actual amount of disk space used by the image. On Windows the same information can be seen in the File Properties dialog.&lt;br /&gt;
&lt;br /&gt;
The fastest way to transfer a file or a directory (including its content, recursively) into an image is by using a single &amp;lt;code&amp;gt;put&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;putdir&amp;lt;/code&amp;gt;, if it&#039;s to transfer the directory file content to an existing directory) command of hdfmonkey.&lt;br /&gt;
&lt;br /&gt;
The most convenient tool to copy of all the content from the image to a folder outside of the image is 7-zip. On Windows, just use the 7-zip GUI. On MacOS and Linux, see: [[Development_Tools:Linux_setup#Extracting_all_files_from_the_sd-card_image]].&lt;br /&gt;
&lt;br /&gt;
=MAME Plugins and Scripts=&lt;br /&gt;
&lt;br /&gt;
Some MAME plugins and scripts that may be useful for Next developers and end users are listed [[MAME:Plugins_and_Scripts|here]]. They let you speed up the Next boot time, profile your NextBASIC or assembler code, and more.&lt;br /&gt;
&lt;br /&gt;
=Continuous Integration MAME Builds=&lt;br /&gt;
&lt;br /&gt;
MAME is updated on a release schedule, but due to the ongoing nature of development, including for the MAME Next machine, it can sometimes be useful to install a more recent build if it contains a new feature or bugfix you are interested in. Sometimes, this ongoing work is discussed on social media, such as the [https://discordapp.com/channels/556228195767156758/752197165891321886 Next Developer Discord].&lt;br /&gt;
&lt;br /&gt;
Continuous Integration (CI) builds are available from both the [https://github.com/mamedev/mame/actions primary MAME repo] and [https://github.com/holub/mame/actions holub&#039;s GitHub repo]. Both are considered bleeding-edge, with the primary MAME repo slightly less so. MAME CI builds are available for Windows, Linux, and macOS and are updated automatically whenever code is committed by a maintainer or pushed to the primary repo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You need to be logged in to github&#039;&#039;&#039; to download CI artifacts, so [https://github.com/login sign in] or [https://github.com/signup sign up].&lt;br /&gt;
&lt;br /&gt;
To try out a CI build (more precisely, the resulting binary executable, which is a produced &amp;quot;artifact&amp;quot; of the build process) , first do a full MAME install from the [https://www.mamedev.org/release.html latest release] if you have not already done so. Then back up your main binary from its installation location - these are called something like &amp;lt;code&amp;gt;mame.exe&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;mame&amp;lt;/code&amp;gt;. You&#039;re backing it up to be able to restore it if the CI build doesn&#039;t work, or if you don&#039;t like how the CI build behaves.&lt;br /&gt;
&lt;br /&gt;
Then visit one of the links above and find a workflow run item for your platform. Workflow items are the things in the list. The tags are flagged as &amp;lt;code&amp;gt;CI (Windows)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CI (Linux)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;CI (macOS)&amp;lt;/code&amp;gt; in the second row of each workflow item in the list (not the filter in the left hand nav menu). Click on a completed workfow item (only items with green checkmarks will have created downloadable binaries yet), find the Artifacts section at the bottom (note again: you need to be signed up to see that section and/or download the artifact), then click the Download button. Unzip the downloaded file and find the main binary (with the same name as above). Copy the main binary to the install location, overwriting the original one, and run MAME the same way you were running it before. On Windows and macOS, you need to repeat the security steps above to trust the new MAME executable.&lt;br /&gt;
&lt;br /&gt;
= More MAME related links =&lt;br /&gt;
&lt;br /&gt;
MAME [https://docs.mamedev.org/ documentation].&lt;br /&gt;
&lt;br /&gt;
Report any issues with MAME on the [https://mametesters.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;Linux&#039;&#039;&#039; users there are more tips (how to compile MAME from source, how to configure it to not use CWD as starting path for resource directories, how to mount or create image file) at [[Development_Tools:Linux_setup]] page.&lt;br /&gt;
&lt;br /&gt;
[https://docs.mamedev.org/advanced/devicemap.html MAMEDEV.ORG MAME Stable Controller IDs].&lt;br /&gt;
By default, MAME does not assign stable numbers to input devices. For instance, a game pad controller may be assigned to “Joy 1” initially, but after restarting, the same game pad may be reassigned to “Joy 3”.&lt;br /&gt;
Here a some hints how to fixate MAME´s Joystick-Detection to specific Controllers: [https://www.youtube.com/watch?v=YmjfwLuZ_X0 Youtube - Mapping your controllers for stable IDs]&lt;br /&gt;
and: [https://forums.launchbox-app.com/topic/89296-stable-controller-ids-for-mame/ Stable Controller IDs for MAME]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41949</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41949"/>
		<updated>2026-05-31T10:18:15Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* ZX Spectrum Books and Documentation */  ZX Spectrum BASIC Programming&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
The Next project is continuously improved, so it&#039;s a good practice to check for the most recent updates of the manuals, documents and Next-specific books.&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
(The Next specific books are typically written under assumption that the reader is already familiar enough with the low-level hardware programming aspects relevant to the original ZX Spectrum, so the readers who aren&#039;t should also check the books about the &amp;quot;classic&amp;quot; ZX Spectrum too)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
Many books were written since 1982, this is just a selection.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;Sinclair ZX Spectrum BASIC Programming&#039;&#039; by Steven Vickers (1982) ==&lt;br /&gt;
&lt;br /&gt;
* https://worldofspectrum.net/ZXBasicManual/ The book included in the original package of ZX Spectrum 48K. Wealth of information in a single book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;Step-by-Step Programming ZX Spectrum&#039;&#039; Series ==&lt;br /&gt;
* Book One, by Ian Graham (1984) https://worldofspectrum.net/item/2001330/&lt;br /&gt;
* Book Two, by Ian Graham (1984) https://worldofspectrum.net/item/2001331/&lt;br /&gt;
* Book Three, by Piers Letcher (1985) https://worldofspectrum.net/item/2000385/&lt;br /&gt;
* Book Four, by Piers Letcher (1985) https://worldofspectrum.net/item/2000460/&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games (Since 2006, updated recently)&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan (2020) ==&lt;br /&gt;
* The motivation for writing this book in 2020 was the release of the Sinclair ZX Spectrum Next, even if it (mostly?) covers the assembly which would work on the original ZX Spectrum: http://ped.7gods.org/z80.pdf&lt;br /&gt;
== &#039;&#039;Understanding Your Spectrum&#039;&#039; by Dr. Ian Logan (1982) ==&lt;br /&gt;
* https://spectrumcomputing.co.uk/entry/2000400/Book/Understanding_Your_Spectrum&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41948</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41948"/>
		<updated>2026-05-23T13:39:29Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Step-by-Step Programming ZX Spectrum Series */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
The Next project is continuously improved, so it&#039;s a good practice to check for the most recent updates of the manuals, documents and Next-specific books.&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
(The Next specific books are typically written under assumption that the reader is already familiar enough with the low-level hardware programming aspects relevant to the original ZX Spectrum, so the readers who aren&#039;t should also check the books about the &amp;quot;classic&amp;quot; ZX Spectrum too)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
Many books were written since 1982, this is just a selection.&lt;br /&gt;
== Step-by-Step Programming ZX Spectrum Series ==&lt;br /&gt;
* Book One, by Ian Graham (1984) https://worldofspectrum.net/item/2001330/&lt;br /&gt;
* Book Two, by Ian Graham (1984) https://worldofspectrum.net/item/2001331/&lt;br /&gt;
* Book Three, by Piers Letcher (1985) https://worldofspectrum.net/item/2000385/&lt;br /&gt;
* Book Four, by Piers Letcher (1985) https://worldofspectrum.net/item/2000460/&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games (Since 2006, updated recently)&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan (2020) ==&lt;br /&gt;
* The motivation for writing this book in 2020 was the release of the Sinclair ZX Spectrum Next, even if it (mostly?) covers the assembly which would work on the original ZX Spectrum: http://ped.7gods.org/z80.pdf&lt;br /&gt;
== &#039;&#039;Understanding Your Spectrum&#039;&#039; by Dr. Ian Logan (1982) ==&lt;br /&gt;
* https://spectrumcomputing.co.uk/entry/2000400/Book/Understanding_Your_Spectrum&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41947</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41947"/>
		<updated>2026-05-23T13:35:04Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Step-by-Step Programming ZX Spectrum Series */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
The Next project is continuously improved, so it&#039;s a good practice to check for the most recent updates of the manuals, documents and Next-specific books.&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
(The Next specific books are typically written under assumption that the reader is already familiar enough with the low-level hardware programming aspects relevant to the original ZX Spectrum, so the readers who aren&#039;t should also check the books about the &amp;quot;classic&amp;quot; ZX Spectrum too)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
Many books were written since 1982, this is just a selection.&lt;br /&gt;
== Step-by-Step Programming ZX Spectrum Series ==&lt;br /&gt;
* Book One, by Ian Graham https://worldofspectrum.net/item/2001330/&lt;br /&gt;
* Book Two, by Ian Graham  https://worldofspectrum.net/item/2001331/&lt;br /&gt;
* Book Three, by Piers Letcher   https://worldofspectrum.net/item/2000385/&lt;br /&gt;
* Book Four, by Piers Letcher  https://worldofspectrum.net/item/2000460/&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games (Since 2006, updated recently)&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan (2020) ==&lt;br /&gt;
* The motivation for writing this book in 2020 was the release of the Sinclair ZX Spectrum Next, even if it (mostly?) covers the assembly which would work on the original ZX Spectrum: http://ped.7gods.org/z80.pdf&lt;br /&gt;
== &#039;&#039;Understanding Your Spectrum&#039;&#039; by Dr. Ian Logan (1982) ==&lt;br /&gt;
* https://spectrumcomputing.co.uk/entry/2000400/Book/Understanding_Your_Spectrum&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41946</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41946"/>
		<updated>2026-05-23T13:34:49Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* ZX Spectrum Books and Documentation */ Step-by-Step Programming ZX Spectrum Series&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
The Next project is continuously improved, so it&#039;s a good practice to check for the most recent updates of the manuals, documents and Next-specific books.&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
(The Next specific books are typically written under assumption that the reader is already familiar enough with the low-level hardware programming aspects relevant to the original ZX Spectrum, so the readers who aren&#039;t should also check the books about the &amp;quot;classic&amp;quot; ZX Spectrum too)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
Many books were written since 1982, this is just a selection.&lt;br /&gt;
== Step-by-Step Programming ZX Spectrum Series ==&lt;br /&gt;
* Book One, by Ian Graham https://worldofspectrum.net/item/2001330/&lt;br /&gt;
* Book Two, by Ian Graham  https://worldofspectrum.net/item/2001331/&lt;br /&gt;
* Book Three, by Piers Letcher   https://worldofspectrum.net/item/2000385/&lt;br /&gt;
* Book Four, by Piers Letcher  https://worldofspectrum.net/item/2000460/&lt;br /&gt;
&lt;br /&gt;
https://worldofspectrum.net/item/2001330/&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games (Since 2006, updated recently)&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan (2020) ==&lt;br /&gt;
* The motivation for writing this book in 2020 was the release of the Sinclair ZX Spectrum Next, even if it (mostly?) covers the assembly which would work on the original ZX Spectrum: http://ped.7gods.org/z80.pdf&lt;br /&gt;
== &#039;&#039;Understanding Your Spectrum&#039;&#039; by Dr. Ian Logan (1982) ==&lt;br /&gt;
* https://spectrumcomputing.co.uk/entry/2000400/Book/Understanding_Your_Spectrum&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41945</id>
		<title>Layer 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41945"/>
		<updated>2026-05-20T00:39:10Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: rewording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Layer 2 provides an additional screen layer at 256x192 256 colours, 320x256 256 colours or 640x256 16 colours in which every pixel is individually coloured. Layer 2 may appear in place of, behind, or above the ULA-generated/Tilemap layer.&lt;br /&gt;
&lt;br /&gt;
The palette used to show the Layer 2 is selected by the bit 2 of the {{NextRegNo|$43}}.&lt;br /&gt;
&lt;br /&gt;
The Layer 2 screen occupies 48kiB or 80kiB, spreading over 3, or 5, consecutive 16K [[Memory map|banks]]. By the NextZXOS/NextBASIC default, the same banks 9-11 are used for both the visible and the &amp;quot;shadow&amp;quot; Layer 2 screen (the core, after power-on but before the NextZXOS boots set its defaults to 8-10 for the displayed Layer 2 screen and 11-13 for the shadow screen, but these settings are modified during the boot of NextZXOS). The starting bank of the main Layer 2 screen can be changed using {{NextRegNo|$12}} and and the starting bank for the shadow Layer 2 screen can be changed using {{NextRegNo|$13}} (avoid using banks 5, 7 and 8 for the Layer 2 screen, unless you are familiar with SRAM and BRAM of the board and how the ULA screen memory has special treatment in Next&#039;s FPGA).&lt;br /&gt;
&lt;br /&gt;
Each pixel of Layer 2 takes one byte of video memory in 8bpp modes or half a byte in 4bpp mode, so the Layer 2 needs 48kiB for 256x192 mode or 80kiB for 320x256-8bit or 640x256-4bit mode. The Layer 2 256x192 mode is divided &#039;&#039;&#039;horizontally&#039;&#039;&#039; into 3 16kiB banks of 64 &#039;&#039;&#039;lines&#039;&#039;&#039; each. The modes 320x256 and 640x256 are divided &#039;&#039;&#039;vertically&#039;&#039;&#039; into 5 16kiB  banks of 64 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 320x256 mode or 128 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 640x256 mode.&lt;br /&gt;
&lt;br /&gt;
Layer 2 is controlled via {{PortNo|$123B}} and {{NextRegNo|$70}}, the port is bit mapped as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-6 || Video RAM bank select (write/read paging)&lt;br /&gt;
|-&lt;br /&gt;
| 5-4 || Reserved, write 0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Use Shadow Layer 2 for paging - {{NextRegNo|$13}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Enable Layer 2 read-only paging&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Layer 2 visible - {{NextRegNo|$12}}&lt;br /&gt;
Since core 3.0 this bit has mirror in {{NextRegNo|$69}}&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Enable Layer 2 write-only paging&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When bit 0 of $123B is set to 1, the appropriate area of Layer 2 video memory (as set by bits 6-7) is accessed by &#039;&#039;&#039;writes&#039;&#039;&#039; into slot 1, ie memory area $0000-$3fff (see [[Memory map]]). This prevents any conflict since this area would normally be ROM and thus useless to write to. However, you &#039;&#039;&#039;cannot READ the contents of Layer 2 via this mapping!&#039;&#039;&#039; Reading addresses in this range will read the values from the ROM page (or RAM bank if in AllRam mode) that would be mapped there normally if Layer 2 paging was disabled.&lt;br /&gt;
&lt;br /&gt;
When bit 2 of $123B is set to 1 (new feature of core 3.0), the same area $0000-$3fff is remapped for read, allowing read access into Layer 2 bank selected by bits 3,6 and 7 (while write will still go into the regular ROM/RAM page).&lt;br /&gt;
&lt;br /&gt;
With both bits 0 and 2 set you are creating alternative read+write mapping of RAM (technically identical to mapping done by MM0+MMU1 registers).&lt;br /&gt;
&lt;br /&gt;
Bank 5 and first half of Bank 7, when being accessed by regular means (MMU paging, default memory mapping, DMA), are overshadowed by fast BRAM memory inside the FPGA chip, which is then used to generate ULA screen and [[Tilemap]] graphics (aka &amp;quot;Layer 3&amp;quot;) - not using the SRAM memory chip in that particular area. This Layer 2 (mapping and visible data) is the only exception, circumventing this mechanism and accessing the Bank 5 and Bank 7 in the main memory SRAM chip (giving you extra 16+8kiB of &amp;quot;secret&amp;quot; memory and further headache to emulators&#039; authors). If you are not sure what this means, just avoid using bank 5 and 7 for Layer 2, use values greater/equal to 8 (and avoid also Bank 8, unless you want to destroy NextBASIC warm-restart/soft-reset variables).&lt;br /&gt;
&lt;br /&gt;
Bits 6 and 7 contain the number which third of Layer 2 should be mapped (0..2), or (new feature of core 3.0) when value 3 is set, whole 48kiB of Layer 2 is mapped into area $0000-$bfff (make sure your code, stack and interrupts will cope well with such new mapping).&lt;br /&gt;
&lt;br /&gt;
There is one more new functionality in latest 3.x cores, allowing to set bank-offset variable from 0 to 7. This offset is further applied to the bank selected for write/read (by writing value 0..7 to the port with bit4 set (so it&#039;s value 16..23). If you did set for example 16kiB write mapping of first bank, the first bank is 9, and use value 21 for bank-offset setup (+5 offset), the bank mapped into $0000..$3FFF address area will be 14 (9+5). This way you can map full 80kiB of pixel data into the bottom 16kiB window (or bottom 48kiB window), using different offsets.&lt;br /&gt;
&lt;br /&gt;
Use {{NextRegNo|$70}} to select particular Layer2 mode, and to modify palette offset (added to top four bits of each pixel). Don&#039;t forget to set up Layer 2 clip window correctly for each mode ({{NextRegNo|$18}}).&lt;br /&gt;
&lt;br /&gt;
You can still use also the regular [[Memory map|banking]] ports to switch in one of the Layer 2 banks in slot for at $C000 (or use the ZX Next MMU registers to map that RAM in other regions). This will allow you to read and write the memory as usual. The ability to write to Layer 2 via writes into slot 1 is provided for convenience and to allow graphics data to be easily copied from extended RAM banks.&lt;br /&gt;
&lt;br /&gt;
Pixels are drawn to Layer 2 by writing to the appropriate area of RAM. Layer 2 pixels in 256x192 mode are in English reading order with no ULA-style interlacing. Since there are 256 pixels per line, and when using access via slot 1 the memory port starts at $0000, the upper byte of the address exactly equals the Y coordinate (within the selected third of the screen) and the lower byte exactly equals the X coordinate.&lt;br /&gt;
&lt;br /&gt;
In mode 320x256 (8bpp) the pixels are stored in memory going from top to bottom and left to right (second byte is first pixel on second line, 256th byte is second pixel on first line). Since there are 256 pixels per column, the upper byte of address could represent the X coordinate (only specific range of them, as whole 0..319 range does not fit into 8 bits), and the lower byte of address is Y coordinate. The total pixel memory is 80kiB (five 16kiB banks), and could be mapped into memory either by MMU or by bank-offset feature of {{PortNo|$123B}}.&lt;br /&gt;
&lt;br /&gt;
In mode 640x256 (4bpp) the pixels are stored identically to 320x256 mode, but every byte contains two pixels. The top nibble (top four bits) form &amp;quot;left&amp;quot; pixel, and the bottom nibble form &amp;quot;right&amp;quot; pixel, so first 256 bytes will display as two columns on screen, not one.&lt;br /&gt;
&lt;br /&gt;
Note that you will need to manually clear the Layer 2 screen before drawing on it, as it may contain random data when the machine starts up.&lt;br /&gt;
&lt;br /&gt;
System registers {{NextRegNo|$16}}, {{NextRegNo|$71}} and {{NextRegNo|$17}} apply a pixel shift to all content in Layer &lt;br /&gt;
2, allowing scrolling effects to be created.&lt;br /&gt;
&lt;br /&gt;
Since core 3.0 the visibility of Layer 2 is not affected by usage of ZX128 ULA-shadow (Bank 7) screen.&lt;br /&gt;
&lt;br /&gt;
Obsolete info for core 2.x (limitation was lifted in core 3.0): &amp;lt;del&amp;gt;the visible Layer 2 will cause the slow down of CPU to 7MHz.&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use double-buffered scheme for Layer 2, think about {{NextRegNo|$12}} being display related (i.e. has to be changed to display new Layer 2, when the new image is already prepared) (or it may be modified also during frame to compose final image from various memory areas), while {{NextRegNo|$13}} is related only to write-over-ROM paging functionality ({{PortNo|$123B}}).&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41944</id>
		<title>Layer 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41944"/>
		<updated>2026-05-20T00:37:52Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: rewording starting REG 12 / 13&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Layer 2 provides an additional screen layer at 256x192 256 colours, 320x256 256 colours or 640x256 16 colours in which every pixel is individually coloured. Layer 2 may appear in place of, behind, or above the ULA-generated/Tilemap layer.&lt;br /&gt;
&lt;br /&gt;
The palette used to show the Layer 2 is selected by the bit 2 of the {{NextRegNo|$43}}.&lt;br /&gt;
&lt;br /&gt;
The Layer 2 screen occupies 48kiB or 80kiB, which is stored in 3 (or 5) consecutive 16K [[Memory map|banks]]. By NextZXOS/NextBASIC default, the same banks 9-11 are used for both the visible and &amp;quot;shadow&amp;quot; Layer 2 screen (the core, after power-on but before the NextZXOS boots set its defaults to 8-10 for the displayed Layer 2 screen and 11-13 for the shadow screen, but these settings are modified during the boot of NextZXOS). The starting bank of the main Layer 2 screen can be changed using {{NextRegNo|$12}} and and the starting bank for the shadow Layer 2 screen can be changed using {{NextRegNo|$13}} (avoid using banks 5, 7 and 8 for the Layer 2 screen, unless you are familiar with SRAM and BRAM of the board and how the ULA screen memory has special treatment in Next&#039;s FPGA).&lt;br /&gt;
&lt;br /&gt;
Each pixel of Layer 2 takes one byte of video memory in 8bpp modes or half a byte in 4bpp mode, so the Layer 2 needs 48kiB for 256x192 mode or 80kiB for 320x256-8bit or 640x256-4bit mode. The Layer 2 256x192 mode is divided &#039;&#039;&#039;horizontally&#039;&#039;&#039; into 3 16kiB banks of 64 &#039;&#039;&#039;lines&#039;&#039;&#039; each. The modes 320x256 and 640x256 are divided &#039;&#039;&#039;vertically&#039;&#039;&#039; into 5 16kiB  banks of 64 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 320x256 mode or 128 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 640x256 mode.&lt;br /&gt;
&lt;br /&gt;
Layer 2 is controlled via {{PortNo|$123B}} and {{NextRegNo|$70}}, the port is bit mapped as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-6 || Video RAM bank select (write/read paging)&lt;br /&gt;
|-&lt;br /&gt;
| 5-4 || Reserved, write 0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Use Shadow Layer 2 for paging - {{NextRegNo|$13}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Enable Layer 2 read-only paging&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Layer 2 visible - {{NextRegNo|$12}}&lt;br /&gt;
Since core 3.0 this bit has mirror in {{NextRegNo|$69}}&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Enable Layer 2 write-only paging&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When bit 0 of $123B is set to 1, the appropriate area of Layer 2 video memory (as set by bits 6-7) is accessed by &#039;&#039;&#039;writes&#039;&#039;&#039; into slot 1, ie memory area $0000-$3fff (see [[Memory map]]). This prevents any conflict since this area would normally be ROM and thus useless to write to. However, you &#039;&#039;&#039;cannot READ the contents of Layer 2 via this mapping!&#039;&#039;&#039; Reading addresses in this range will read the values from the ROM page (or RAM bank if in AllRam mode) that would be mapped there normally if Layer 2 paging was disabled.&lt;br /&gt;
&lt;br /&gt;
When bit 2 of $123B is set to 1 (new feature of core 3.0), the same area $0000-$3fff is remapped for read, allowing read access into Layer 2 bank selected by bits 3,6 and 7 (while write will still go into the regular ROM/RAM page).&lt;br /&gt;
&lt;br /&gt;
With both bits 0 and 2 set you are creating alternative read+write mapping of RAM (technically identical to mapping done by MM0+MMU1 registers).&lt;br /&gt;
&lt;br /&gt;
Bank 5 and first half of Bank 7, when being accessed by regular means (MMU paging, default memory mapping, DMA), are overshadowed by fast BRAM memory inside the FPGA chip, which is then used to generate ULA screen and [[Tilemap]] graphics (aka &amp;quot;Layer 3&amp;quot;) - not using the SRAM memory chip in that particular area. This Layer 2 (mapping and visible data) is the only exception, circumventing this mechanism and accessing the Bank 5 and Bank 7 in the main memory SRAM chip (giving you extra 16+8kiB of &amp;quot;secret&amp;quot; memory and further headache to emulators&#039; authors). If you are not sure what this means, just avoid using bank 5 and 7 for Layer 2, use values greater/equal to 8 (and avoid also Bank 8, unless you want to destroy NextBASIC warm-restart/soft-reset variables).&lt;br /&gt;
&lt;br /&gt;
Bits 6 and 7 contain the number which third of Layer 2 should be mapped (0..2), or (new feature of core 3.0) when value 3 is set, whole 48kiB of Layer 2 is mapped into area $0000-$bfff (make sure your code, stack and interrupts will cope well with such new mapping).&lt;br /&gt;
&lt;br /&gt;
There is one more new functionality in latest 3.x cores, allowing to set bank-offset variable from 0 to 7. This offset is further applied to the bank selected for write/read (by writing value 0..7 to the port with bit4 set (so it&#039;s value 16..23). If you did set for example 16kiB write mapping of first bank, the first bank is 9, and use value 21 for bank-offset setup (+5 offset), the bank mapped into $0000..$3FFF address area will be 14 (9+5). This way you can map full 80kiB of pixel data into the bottom 16kiB window (or bottom 48kiB window), using different offsets.&lt;br /&gt;
&lt;br /&gt;
Use {{NextRegNo|$70}} to select particular Layer2 mode, and to modify palette offset (added to top four bits of each pixel). Don&#039;t forget to set up Layer 2 clip window correctly for each mode ({{NextRegNo|$18}}).&lt;br /&gt;
&lt;br /&gt;
You can still use also the regular [[Memory map|banking]] ports to switch in one of the Layer 2 banks in slot for at $C000 (or use the ZX Next MMU registers to map that RAM in other regions). This will allow you to read and write the memory as usual. The ability to write to Layer 2 via writes into slot 1 is provided for convenience and to allow graphics data to be easily copied from extended RAM banks.&lt;br /&gt;
&lt;br /&gt;
Pixels are drawn to Layer 2 by writing to the appropriate area of RAM. Layer 2 pixels in 256x192 mode are in English reading order with no ULA-style interlacing. Since there are 256 pixels per line, and when using access via slot 1 the memory port starts at $0000, the upper byte of the address exactly equals the Y coordinate (within the selected third of the screen) and the lower byte exactly equals the X coordinate.&lt;br /&gt;
&lt;br /&gt;
In mode 320x256 (8bpp) the pixels are stored in memory going from top to bottom and left to right (second byte is first pixel on second line, 256th byte is second pixel on first line). Since there are 256 pixels per column, the upper byte of address could represent the X coordinate (only specific range of them, as whole 0..319 range does not fit into 8 bits), and the lower byte of address is Y coordinate. The total pixel memory is 80kiB (five 16kiB banks), and could be mapped into memory either by MMU or by bank-offset feature of {{PortNo|$123B}}.&lt;br /&gt;
&lt;br /&gt;
In mode 640x256 (4bpp) the pixels are stored identically to 320x256 mode, but every byte contains two pixels. The top nibble (top four bits) form &amp;quot;left&amp;quot; pixel, and the bottom nibble form &amp;quot;right&amp;quot; pixel, so first 256 bytes will display as two columns on screen, not one.&lt;br /&gt;
&lt;br /&gt;
Note that you will need to manually clear the Layer 2 screen before drawing on it, as it may contain random data when the machine starts up.&lt;br /&gt;
&lt;br /&gt;
System registers {{NextRegNo|$16}}, {{NextRegNo|$71}} and {{NextRegNo|$17}} apply a pixel shift to all content in Layer &lt;br /&gt;
2, allowing scrolling effects to be created.&lt;br /&gt;
&lt;br /&gt;
Since core 3.0 the visibility of Layer 2 is not affected by usage of ZX128 ULA-shadow (Bank 7) screen.&lt;br /&gt;
&lt;br /&gt;
Obsolete info for core 2.x (limitation was lifted in core 3.0): &amp;lt;del&amp;gt;the visible Layer 2 will cause the slow down of CPU to 7MHz.&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use double-buffered scheme for Layer 2, think about {{NextRegNo|$12}} being display related (i.e. has to be changed to display new Layer 2, when the new image is already prepared) (or it may be modified also during frame to compose final image from various memory areas), while {{NextRegNo|$13}} is related only to write-over-ROM paging functionality ({{PortNo|$123B}}).&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41943</id>
		<title>Layer 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41943"/>
		<updated>2026-05-20T00:32:54Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: wording re starting banks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Layer 2 provides an additional screen layer at 256x192 256 colours, 320x256 256 colours or 640x256 16 colours in which every pixel is individually coloured. Layer 2 may appear in place of, behind, or above the ULA-generated/Tilemap layer.&lt;br /&gt;
&lt;br /&gt;
The palette used to show the Layer 2 is selected by the bit 2 of the {{NextRegNo|$43}}.&lt;br /&gt;
&lt;br /&gt;
The Layer 2 screen occupies 48kiB or 80kiB, which is stored in 3 (or 5) consecutive 16K [[Memory map|banks]]. By NextZXOS/NextBASIC default, banks 9-11 are used for the visible and &amp;quot;shadow&amp;quot; Layer 2 screen (the HW after power-on defaults to 8-10 for displayed and 11-13 for shadow screen, but that gets modified by NextZXOS booting up). The starting bank of the main Layer 2 screen can be changed using {{NextRegNo|$12}} and and the starting bank for the shadow Layer 2 screen can be changed using {{NextRegNo|$13}} (avoid using banks 5, 7 and 8 for the Layer 2 screen, unless you are familiar with SRAM and BRAM of the board and how the ULA screen memory has special treatment in Next&#039;s FPGA).&lt;br /&gt;
&lt;br /&gt;
Each pixel of Layer 2 takes one byte of video memory in 8bpp modes or half a byte in 4bpp mode, so the Layer 2 needs 48kiB for 256x192 mode or 80kiB for 320x256-8bit or 640x256-4bit mode. The Layer 2 256x192 mode is divided &#039;&#039;&#039;horizontally&#039;&#039;&#039; into 3 16kiB banks of 64 &#039;&#039;&#039;lines&#039;&#039;&#039; each. The modes 320x256 and 640x256 are divided &#039;&#039;&#039;vertically&#039;&#039;&#039; into 5 16kiB  banks of 64 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 320x256 mode or 128 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 640x256 mode.&lt;br /&gt;
&lt;br /&gt;
Layer 2 is controlled via {{PortNo|$123B}} and {{NextRegNo|$70}}, the port is bit mapped as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-6 || Video RAM bank select (write/read paging)&lt;br /&gt;
|-&lt;br /&gt;
| 5-4 || Reserved, write 0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Use Shadow Layer 2 for paging - {{NextRegNo|$13}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Enable Layer 2 read-only paging&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Layer 2 visible - {{NextRegNo|$12}}&lt;br /&gt;
Since core 3.0 this bit has mirror in {{NextRegNo|$69}}&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Enable Layer 2 write-only paging&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When bit 0 of $123B is set to 1, the appropriate area of Layer 2 video memory (as set by bits 6-7) is accessed by &#039;&#039;&#039;writes&#039;&#039;&#039; into slot 1, ie memory area $0000-$3fff (see [[Memory map]]). This prevents any conflict since this area would normally be ROM and thus useless to write to. However, you &#039;&#039;&#039;cannot READ the contents of Layer 2 via this mapping!&#039;&#039;&#039; Reading addresses in this range will read the values from the ROM page (or RAM bank if in AllRam mode) that would be mapped there normally if Layer 2 paging was disabled.&lt;br /&gt;
&lt;br /&gt;
When bit 2 of $123B is set to 1 (new feature of core 3.0), the same area $0000-$3fff is remapped for read, allowing read access into Layer 2 bank selected by bits 3,6 and 7 (while write will still go into the regular ROM/RAM page).&lt;br /&gt;
&lt;br /&gt;
With both bits 0 and 2 set you are creating alternative read+write mapping of RAM (technically identical to mapping done by MM0+MMU1 registers).&lt;br /&gt;
&lt;br /&gt;
Bank 5 and first half of Bank 7, when being accessed by regular means (MMU paging, default memory mapping, DMA), are overshadowed by fast BRAM memory inside the FPGA chip, which is then used to generate ULA screen and [[Tilemap]] graphics (aka &amp;quot;Layer 3&amp;quot;) - not using the SRAM memory chip in that particular area. This Layer 2 (mapping and visible data) is the only exception, circumventing this mechanism and accessing the Bank 5 and Bank 7 in the main memory SRAM chip (giving you extra 16+8kiB of &amp;quot;secret&amp;quot; memory and further headache to emulators&#039; authors). If you are not sure what this means, just avoid using bank 5 and 7 for Layer 2, use values greater/equal to 8 (and avoid also Bank 8, unless you want to destroy NextBASIC warm-restart/soft-reset variables).&lt;br /&gt;
&lt;br /&gt;
Bits 6 and 7 contain the number which third of Layer 2 should be mapped (0..2), or (new feature of core 3.0) when value 3 is set, whole 48kiB of Layer 2 is mapped into area $0000-$bfff (make sure your code, stack and interrupts will cope well with such new mapping).&lt;br /&gt;
&lt;br /&gt;
There is one more new functionality in latest 3.x cores, allowing to set bank-offset variable from 0 to 7. This offset is further applied to the bank selected for write/read (by writing value 0..7 to the port with bit4 set (so it&#039;s value 16..23). If you did set for example 16kiB write mapping of first bank, the first bank is 9, and use value 21 for bank-offset setup (+5 offset), the bank mapped into $0000..$3FFF address area will be 14 (9+5). This way you can map full 80kiB of pixel data into the bottom 16kiB window (or bottom 48kiB window), using different offsets.&lt;br /&gt;
&lt;br /&gt;
Use {{NextRegNo|$70}} to select particular Layer2 mode, and to modify palette offset (added to top four bits of each pixel). Don&#039;t forget to set up Layer 2 clip window correctly for each mode ({{NextRegNo|$18}}).&lt;br /&gt;
&lt;br /&gt;
You can still use also the regular [[Memory map|banking]] ports to switch in one of the Layer 2 banks in slot for at $C000 (or use the ZX Next MMU registers to map that RAM in other regions). This will allow you to read and write the memory as usual. The ability to write to Layer 2 via writes into slot 1 is provided for convenience and to allow graphics data to be easily copied from extended RAM banks.&lt;br /&gt;
&lt;br /&gt;
Pixels are drawn to Layer 2 by writing to the appropriate area of RAM. Layer 2 pixels in 256x192 mode are in English reading order with no ULA-style interlacing. Since there are 256 pixels per line, and when using access via slot 1 the memory port starts at $0000, the upper byte of the address exactly equals the Y coordinate (within the selected third of the screen) and the lower byte exactly equals the X coordinate.&lt;br /&gt;
&lt;br /&gt;
In mode 320x256 (8bpp) the pixels are stored in memory going from top to bottom and left to right (second byte is first pixel on second line, 256th byte is second pixel on first line). Since there are 256 pixels per column, the upper byte of address could represent the X coordinate (only specific range of them, as whole 0..319 range does not fit into 8 bits), and the lower byte of address is Y coordinate. The total pixel memory is 80kiB (five 16kiB banks), and could be mapped into memory either by MMU or by bank-offset feature of {{PortNo|$123B}}.&lt;br /&gt;
&lt;br /&gt;
In mode 640x256 (4bpp) the pixels are stored identically to 320x256 mode, but every byte contains two pixels. The top nibble (top four bits) form &amp;quot;left&amp;quot; pixel, and the bottom nibble form &amp;quot;right&amp;quot; pixel, so first 256 bytes will display as two columns on screen, not one.&lt;br /&gt;
&lt;br /&gt;
Note that you will need to manually clear the Layer 2 screen before drawing on it, as it may contain random data when the machine starts up.&lt;br /&gt;
&lt;br /&gt;
System registers {{NextRegNo|$16}}, {{NextRegNo|$71}} and {{NextRegNo|$17}} apply a pixel shift to all content in Layer &lt;br /&gt;
2, allowing scrolling effects to be created.&lt;br /&gt;
&lt;br /&gt;
Since core 3.0 the visibility of Layer 2 is not affected by usage of ZX128 ULA-shadow (Bank 7) screen.&lt;br /&gt;
&lt;br /&gt;
Obsolete info for core 2.x (limitation was lifted in core 3.0): &amp;lt;del&amp;gt;the visible Layer 2 will cause the slow down of CPU to 7MHz.&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use double-buffered scheme for Layer 2, think about {{NextRegNo|$12}} being display related (i.e. has to be changed to display new Layer 2, when the new image is already prepared) (or it may be modified also during frame to compose final image from various memory areas), while {{NextRegNo|$13}} is related only to write-over-ROM paging functionality ({{PortNo|$123B}}).&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41942</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41942"/>
		<updated>2026-05-19T23:40:18Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* ZX Spectrum Next Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
The Next project is continuously improved, so it&#039;s a good practice to check for the most recent updates of the manuals, documents and Next-specific books.&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
(The Next specific books are typically written under assumption that the reader is already familiar enough with the low-level hardware programming aspects relevant to the original ZX Spectrum, so the readers who aren&#039;t should also check the books about the &amp;quot;classic&amp;quot; ZX Spectrum too)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
Many books were written since 1982, this is just a selection.&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games (Since 2006, updated recently)&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan (2020) ==&lt;br /&gt;
* The motivation for writing this book in 2020 was the release of the Sinclair ZX Spectrum Next, even if it (mostly?) covers the assembly which would work on the original ZX Spectrum: http://ped.7gods.org/z80.pdf&lt;br /&gt;
== &#039;&#039;Understanding Your Spectrum&#039;&#039; by Dr. Ian Logan (1982) ==&lt;br /&gt;
* https://spectrumcomputing.co.uk/entry/2000400/Book/Understanding_Your_Spectrum&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41941</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41941"/>
		<updated>2026-05-19T23:38:20Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* ZX Spectrum Books and Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
(The Next specific books are typically written under assumption that the reader is already familiar enough with the low-level hardware programming aspects relevant to the original ZX Spectrum, so the readers who aren&#039;t should also check the books about the &amp;quot;classic&amp;quot; ZX Spectrum too)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
Many books were written since 1982, this is just a selection.&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games (Since 2006, updated recently)&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan (2020) ==&lt;br /&gt;
* The motivation for writing this book in 2020 was the release of the Sinclair ZX Spectrum Next, even if it (mostly?) covers the assembly which would work on the original ZX Spectrum: http://ped.7gods.org/z80.pdf&lt;br /&gt;
== &#039;&#039;Understanding Your Spectrum&#039;&#039; by Dr. Ian Logan (1982) ==&lt;br /&gt;
* https://spectrumcomputing.co.uk/entry/2000400/Book/Understanding_Your_Spectrum&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41940</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41940"/>
		<updated>2026-05-19T23:31:13Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* First Steps in Z80 Assembly Language (for ZX Spectrum) by Darryl Sloan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
(The Next specific books are typically written under assumption that the reader is already familiar enough with the low-level hardware programming aspects relevant to the original ZX Spectrum, so the readers who aren&#039;t should also check the books about the &amp;quot;classic&amp;quot; ZX Spectrum too)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan ==&lt;br /&gt;
* Listed here as the motivation for writing this book in 2020 was the release of the Sinclair ZX Spectrum Next, even if it (mostly?) covers the assembly which would work on the original ZX Spectrum: http://ped.7gods.org/z80.pdf&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41939</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41939"/>
		<updated>2026-05-19T23:29:15Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Next-specific Books */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
(The Next specific books are typically written under assumption that the reader is already familiar enough with the low-level hardware programming aspects relevant to the original ZX Spectrum, so the readers who aren&#039;t should also check the books about the &amp;quot;classic&amp;quot; ZX Spectrum too)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan ==&lt;br /&gt;
* http://ped.7gods.org/z80.pdf&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41938</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41938"/>
		<updated>2026-05-19T23:24:23Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* ZX Spectrum Books and Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;br /&gt;
== &#039;&#039;First Steps in Z80 Assembly Language&#039;&#039; (for ZX Spectrum) by Darryl Sloan ==&lt;br /&gt;
* http://ped.7gods.org/z80.pdf&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41937</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41937"/>
		<updated>2026-05-19T20:32:41Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* ZX Spectrum Next Assembly Developer Guide by Tomaž Kragelj */ &amp;quot;or as a&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or as a printed coil bound book.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41936</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Bibliography&amp;diff=41936"/>
		<updated>2026-05-18T09:06:07Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* docs Directory of the Distribution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ZX Spectrum Next Documentation =&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum Next Manual == &lt;br /&gt;
&lt;br /&gt;
* Available online: [[FAQ#Where_can_I_download_a_copy_of_the_manual?]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;docs&#039;&#039; Directory of the Distribution == &lt;br /&gt;
* https://gitlab.com/thesmog358/tbblue/-/tree/master/docs , especially note the [https://gitlab.com/thesmog358/tbblue/-/tree/master/docs/nextzxos nextzxos] folder written and kept up to date by the author of NextZXOS and NextBASIC.&lt;br /&gt;
&lt;br /&gt;
= Next-specific Books =&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Assembly Developer Guide&#039;&#039; by Tomaž Kragelj ==&lt;br /&gt;
* Available as a free to download PDF  https://github.com/tomaz/zx-next-dev-guide/ or a printed coil bound book.&lt;br /&gt;
== &#039;&#039;ZX Spectrum Next Programming Notes&#039;&#039; by Theodore (Alex) Evans ==&lt;br /&gt;
* https://github.com/varmfskii/zxnext_code/tree/master/zx_next_notes&lt;br /&gt;
&lt;br /&gt;
= ZX Spectrum Books and Documentation =&lt;br /&gt;
== &#039;&#039;How to Write Spectrum Games&#039;&#039; by Jonathan Cauldwell ==&lt;br /&gt;
* https://jonathan-cauldwell.itch.io/how-to-write-spectrum-games&lt;br /&gt;
== &#039;&#039;comp.sys.sinclair FAQ&#039;&#039; ==&lt;br /&gt;
* https://worldofspectrum.org/faq/reference/reference.htm&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Compilers&amp;diff=41935</id>
		<title>Compilers</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Compilers&amp;diff=41935"/>
		<updated>2026-05-14T11:13:20Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* ZX Basic Studio */ link to a text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BASIC ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://zxbasic.readthedocs.io/ Boriel Basic (ZX Basic)]&#039;&#039; ===&lt;br /&gt;
: A Basic to Z80 compiler with extensions added to Sinclair Basic.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/boriel-basic/ZXBasicStudio/releases ZX Basic Studio]&#039;&#039; ===&lt;br /&gt;
: A multiplatform IDE for Boriel BASIC, with itegration with emulators for ZX Spectrum Next (CSpect, ZEsarUX and MAME), GDU and font editor, Sprite editor with import from external images, Colour palette editor for ZX Spectrum Next. Its [https://boriel-basic.net/page/preparing-the-development-environment installer] allows an easy start on Windows, Linux and MacOS.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/em00k/NextBuild NextBuild v7]&#039;&#039; ===&lt;br /&gt;
: NextBuild is a suite of tools for Windows which uses Boriel&#039;s ZX Basic Compiler. It comes with a Next library of routines to take advantage of the Nexts hardware. Examples included.&lt;br /&gt;
: See [[NextBuild:Main Page| NextBuild dedicated Wiki section]].&lt;br /&gt;
&lt;br /&gt;
== C ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;z88dk-scc80&#039;&#039; and &#039;&#039;z88dk-zsdcc&#039;&#039; === &lt;br /&gt;
: Via the &amp;quot;zcc&amp;quot;, the [https://github.com/z88dk/z88dk Z88dk] toolchain&#039;s front end, two compilers could be invoked &amp;lt;ref&amp;gt; [https://github.com/z88dk/z88dk/wiki z88dk wiki] &amp;lt;/ref&amp;gt;:&lt;br /&gt;
: &amp;quot;z88dk-scc80&amp;quot;, a small C derived C compiler that is nearly C90 compliant with a few notable exceptions.  Emphasis is on small code.&lt;br /&gt;
: &amp;quot;z88dk-zsdcc&amp;quot;, a fork of [[#SDCC]].&lt;br /&gt;
: A Next target is present and under development.  Output file types include tap, sna, and esxdos dot commands.&lt;br /&gt;
: [[Calling convention notes]]&lt;br /&gt;
: The tutorial for the &amp;quot;newlib&amp;quot; for ZX Spectrum mentions some important details about the possibilities of programs written for Next too: [https://github.com/z88dk/z88dk/blob/master/doc/target/zx/02_HelloWorld.md  ZX Hello World] &lt;br /&gt;
: The selection of the CRT is by startup=n number.  The crts are in the range 0-31, some mentioned in the above Hello World text, and some in the sources like [https://github.com/z88dk/z88dk/tree/master/libsrc/newlib/target/zxn/startup newlib zxn startup]. (internally: The factors of 256 are added by subtype=? on the compile line: base 0 numbers have no assumptions about the output type, i.e. for binaries that will be tap/nex/.. Base 256 is for dot commands, base 512 is for dotx command (not appropriate for the Next), base 768 is dotn).&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;SDCC&#039;&#039; === &lt;br /&gt;
&lt;br /&gt;
: [https://sdcc.sourceforge.net/ Small Device C Compiler, SDCC] is an open-source retargettable, optimizing Standard C (ANSI C89, ISO C99, ISO C11, ISO C23) compiler suite that targets a lot of mostly 8-bit microprocessors &amp;lt;ref&amp;gt;[https://sdcc.sourceforge.net/ SDCC targets as of February 2026]: the Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim (formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 based (hc08, s08), Zilog Z80 based MCUs (Z80, Z80N, Z180, SM83, Rabbit 2000, 2000A, 3000A, SM83, TLCS-90, eZ80, R800), Padauk (pdk14, pdk15), STMicroelectronics STM8, MOS 6502 and WDC 65C02. Work is in progress on supporting the Rabbit 4000, 5000, 6000, Padauk pdk13 and the f8 and f8l targets; Microchip PIC16 and PIC18 targets are unmaintained.  SDCC can be retargeted for other microprocessors.&amp;lt;/ref&amp;gt; including a Z80N target.&lt;br /&gt;
&lt;br /&gt;
: The compiler, assembler and linker are GNU GPL &amp;lt;ref&amp;gt;[https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU GPL 2] , [https://www.gnu.org/licenses/gpl-3.0.html GNU GPL 3]&amp;lt;/ref&amp;gt; licensed and the compiler&#039;s libraries are GNU GPL licensed with a special exception.&lt;br /&gt;
&lt;br /&gt;
: Developed as separate projects there are: a development kit for SDCC for creating small NextZXOS DOT programs and a [https://github.com/retro-vault/libcpm3-z80 library for CP/M 3]&lt;br /&gt;
&lt;br /&gt;
: Firmware and loader sources in the tbblue repository were made to be compiled with SDCC.&lt;br /&gt;
&lt;br /&gt;
== C-like ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://taylorza.itch.io/znc-compiler ZNC Native compiler]&#039;&#039; ===&lt;br /&gt;
: ZNC is a language and compiler for the ZX Spectrum Next. The language is closely modeled after the C programming language.&lt;br /&gt;
: The language suite includes the compiler, an optimizer, assembler and text editor to support native development on the Next. It also include a frontend that makes managing source files and building your projects easier.&lt;br /&gt;
&lt;br /&gt;
== Forth ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;VForth Next&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
: [https://github.com/mattsteeldue/vforth-next VForth Next] is a Z80N Forth system suitable to run on the ZX Spectrum Next&lt;br /&gt;
&lt;br /&gt;
== Pascal ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;Pasta80&#039;&#039; ===&lt;br /&gt;
: [https://github.com/pleumann/pasta80 Pasta80] is a Turbo Pascal 3.0-compatible compiler that generates machine code for classic and modern Z80 machines (currently ZX Spectrum 48K/128K/Next and CP/M). &lt;br /&gt;
: GNU GPL 3 license with a linking exception.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;OmniPas&#039;&#039; ===&lt;br /&gt;
: [https://syntaxerrorsoftware.itch.io/omnipas OmniPas] is a Windows‑based Pascal cross‑compiler that targets multiple platforms, including the ZX Spectrum and ZX Spectrum Next.&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/speccyorg/bas2tap bas2tap CLI]&#039;&#039; ===&lt;br /&gt;
: The utility to convert `BASIC in an ASCII file&#039; to a TAP tape image file (can be loaded by emulator or Next as regular BASIC program).&lt;br /&gt;
: Comes complete with portable C source. With full BASIC syntax checking!&lt;br /&gt;
: (does not support NextBASIC extensions)&lt;br /&gt;
: (for NextBASIC you can use the NextZXOS dot commands .txt2bas and .bas2txt directly on the Next)&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/remy/txt2bas txt2bas &amp;amp; bas2txt CLI]&#039;&#039; ===&lt;br /&gt;
: Cross platform command line tool to convert NextBASIC to +3dos .bas file and convert .bas files to plain text.&lt;br /&gt;
: The tool also includes verbose validation, tap and 3dos, BANK compatible and headerless export and import support&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Compilers&amp;diff=41934</id>
		<title>Compilers</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Compilers&amp;diff=41934"/>
		<updated>2026-05-14T11:12:07Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* BASIC */ zx basic studio&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BASIC ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://zxbasic.readthedocs.io/ Boriel Basic (ZX Basic)]&#039;&#039; ===&lt;br /&gt;
: A Basic to Z80 compiler with extensions added to Sinclair Basic.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/boriel-basic/ZXBasicStudio/releases ZX Basic Studio]&#039;&#039; ===&lt;br /&gt;
: A multiplatform IDE for Boriel BASIC, with itegration with emulators for ZX Spectrum Next (CSpect, ZEsarUX and MAME), GDU and font editor, Sprite editor with import from external images, Colour palette editor for ZX Spectrum Next&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/em00k/NextBuild NextBuild v7]&#039;&#039; ===&lt;br /&gt;
: NextBuild is a suite of tools for Windows which uses Boriel&#039;s ZX Basic Compiler. It comes with a Next library of routines to take advantage of the Nexts hardware. Examples included.&lt;br /&gt;
: See [[NextBuild:Main Page| NextBuild dedicated Wiki section]].&lt;br /&gt;
&lt;br /&gt;
== C ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;z88dk-scc80&#039;&#039; and &#039;&#039;z88dk-zsdcc&#039;&#039; === &lt;br /&gt;
: Via the &amp;quot;zcc&amp;quot;, the [https://github.com/z88dk/z88dk Z88dk] toolchain&#039;s front end, two compilers could be invoked &amp;lt;ref&amp;gt; [https://github.com/z88dk/z88dk/wiki z88dk wiki] &amp;lt;/ref&amp;gt;:&lt;br /&gt;
: &amp;quot;z88dk-scc80&amp;quot;, a small C derived C compiler that is nearly C90 compliant with a few notable exceptions.  Emphasis is on small code.&lt;br /&gt;
: &amp;quot;z88dk-zsdcc&amp;quot;, a fork of [[#SDCC]].&lt;br /&gt;
: A Next target is present and under development.  Output file types include tap, sna, and esxdos dot commands.&lt;br /&gt;
: [[Calling convention notes]]&lt;br /&gt;
: The tutorial for the &amp;quot;newlib&amp;quot; for ZX Spectrum mentions some important details about the possibilities of programs written for Next too: [https://github.com/z88dk/z88dk/blob/master/doc/target/zx/02_HelloWorld.md  ZX Hello World] &lt;br /&gt;
: The selection of the CRT is by startup=n number.  The crts are in the range 0-31, some mentioned in the above Hello World text, and some in the sources like [https://github.com/z88dk/z88dk/tree/master/libsrc/newlib/target/zxn/startup newlib zxn startup]. (internally: The factors of 256 are added by subtype=? on the compile line: base 0 numbers have no assumptions about the output type, i.e. for binaries that will be tap/nex/.. Base 256 is for dot commands, base 512 is for dotx command (not appropriate for the Next), base 768 is dotn).&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;SDCC&#039;&#039; === &lt;br /&gt;
&lt;br /&gt;
: [https://sdcc.sourceforge.net/ Small Device C Compiler, SDCC] is an open-source retargettable, optimizing Standard C (ANSI C89, ISO C99, ISO C11, ISO C23) compiler suite that targets a lot of mostly 8-bit microprocessors &amp;lt;ref&amp;gt;[https://sdcc.sourceforge.net/ SDCC targets as of February 2026]: the Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim (formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 based (hc08, s08), Zilog Z80 based MCUs (Z80, Z80N, Z180, SM83, Rabbit 2000, 2000A, 3000A, SM83, TLCS-90, eZ80, R800), Padauk (pdk14, pdk15), STMicroelectronics STM8, MOS 6502 and WDC 65C02. Work is in progress on supporting the Rabbit 4000, 5000, 6000, Padauk pdk13 and the f8 and f8l targets; Microchip PIC16 and PIC18 targets are unmaintained.  SDCC can be retargeted for other microprocessors.&amp;lt;/ref&amp;gt; including a Z80N target.&lt;br /&gt;
&lt;br /&gt;
: The compiler, assembler and linker are GNU GPL &amp;lt;ref&amp;gt;[https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU GPL 2] , [https://www.gnu.org/licenses/gpl-3.0.html GNU GPL 3]&amp;lt;/ref&amp;gt; licensed and the compiler&#039;s libraries are GNU GPL licensed with a special exception.&lt;br /&gt;
&lt;br /&gt;
: Developed as separate projects there are: a development kit for SDCC for creating small NextZXOS DOT programs and a [https://github.com/retro-vault/libcpm3-z80 library for CP/M 3]&lt;br /&gt;
&lt;br /&gt;
: Firmware and loader sources in the tbblue repository were made to be compiled with SDCC.&lt;br /&gt;
&lt;br /&gt;
== C-like ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://taylorza.itch.io/znc-compiler ZNC Native compiler]&#039;&#039; ===&lt;br /&gt;
: ZNC is a language and compiler for the ZX Spectrum Next. The language is closely modeled after the C programming language.&lt;br /&gt;
: The language suite includes the compiler, an optimizer, assembler and text editor to support native development on the Next. It also include a frontend that makes managing source files and building your projects easier.&lt;br /&gt;
&lt;br /&gt;
== Forth ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;VForth Next&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
: [https://github.com/mattsteeldue/vforth-next VForth Next] is a Z80N Forth system suitable to run on the ZX Spectrum Next&lt;br /&gt;
&lt;br /&gt;
== Pascal ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;Pasta80&#039;&#039; ===&lt;br /&gt;
: [https://github.com/pleumann/pasta80 Pasta80] is a Turbo Pascal 3.0-compatible compiler that generates machine code for classic and modern Z80 machines (currently ZX Spectrum 48K/128K/Next and CP/M). &lt;br /&gt;
: GNU GPL 3 license with a linking exception.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;OmniPas&#039;&#039; ===&lt;br /&gt;
: [https://syntaxerrorsoftware.itch.io/omnipas OmniPas] is a Windows‑based Pascal cross‑compiler that targets multiple platforms, including the ZX Spectrum and ZX Spectrum Next.&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/speccyorg/bas2tap bas2tap CLI]&#039;&#039; ===&lt;br /&gt;
: The utility to convert `BASIC in an ASCII file&#039; to a TAP tape image file (can be loaded by emulator or Next as regular BASIC program).&lt;br /&gt;
: Comes complete with portable C source. With full BASIC syntax checking!&lt;br /&gt;
: (does not support NextBASIC extensions)&lt;br /&gt;
: (for NextBASIC you can use the NextZXOS dot commands .txt2bas and .bas2txt directly on the Next)&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/remy/txt2bas txt2bas &amp;amp; bas2txt CLI]&#039;&#039; ===&lt;br /&gt;
: Cross platform command line tool to convert NextBASIC to +3dos .bas file and convert .bas files to plain text.&lt;br /&gt;
: The tool also includes verbose validation, tap and 3dos, BANK compatible and headerless export and import support&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Compilers&amp;diff=41933</id>
		<title>Compilers</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Compilers&amp;diff=41933"/>
		<updated>2026-05-14T11:08:35Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* ZX Basic */ Boriel&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BASIC ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://zxbasic.readthedocs.io/ Boriel Basic (ZX Basic)]&#039;&#039; ===&lt;br /&gt;
: A Basic to Z80 compiler with extensions added to Sinclair Basic.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/em00k/NextBuild NextBuild v7]&#039;&#039; ===&lt;br /&gt;
: NextBuild is a suite of tools for Windows which uses Boriel&#039;s ZX Basic Compiler. It comes with a Next library of routines to take advantage of the Nexts hardware. Examples included.&lt;br /&gt;
: See [[NextBuild:Main Page| NextBuild dedicated Wiki section]].&lt;br /&gt;
&lt;br /&gt;
== C ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;z88dk-scc80&#039;&#039; and &#039;&#039;z88dk-zsdcc&#039;&#039; === &lt;br /&gt;
: Via the &amp;quot;zcc&amp;quot;, the [https://github.com/z88dk/z88dk Z88dk] toolchain&#039;s front end, two compilers could be invoked &amp;lt;ref&amp;gt; [https://github.com/z88dk/z88dk/wiki z88dk wiki] &amp;lt;/ref&amp;gt;:&lt;br /&gt;
: &amp;quot;z88dk-scc80&amp;quot;, a small C derived C compiler that is nearly C90 compliant with a few notable exceptions.  Emphasis is on small code.&lt;br /&gt;
: &amp;quot;z88dk-zsdcc&amp;quot;, a fork of [[#SDCC]].&lt;br /&gt;
: A Next target is present and under development.  Output file types include tap, sna, and esxdos dot commands.&lt;br /&gt;
: [[Calling convention notes]]&lt;br /&gt;
: The tutorial for the &amp;quot;newlib&amp;quot; for ZX Spectrum mentions some important details about the possibilities of programs written for Next too: [https://github.com/z88dk/z88dk/blob/master/doc/target/zx/02_HelloWorld.md  ZX Hello World] &lt;br /&gt;
: The selection of the CRT is by startup=n number.  The crts are in the range 0-31, some mentioned in the above Hello World text, and some in the sources like [https://github.com/z88dk/z88dk/tree/master/libsrc/newlib/target/zxn/startup newlib zxn startup]. (internally: The factors of 256 are added by subtype=? on the compile line: base 0 numbers have no assumptions about the output type, i.e. for binaries that will be tap/nex/.. Base 256 is for dot commands, base 512 is for dotx command (not appropriate for the Next), base 768 is dotn).&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;SDCC&#039;&#039; === &lt;br /&gt;
&lt;br /&gt;
: [https://sdcc.sourceforge.net/ Small Device C Compiler, SDCC] is an open-source retargettable, optimizing Standard C (ANSI C89, ISO C99, ISO C11, ISO C23) compiler suite that targets a lot of mostly 8-bit microprocessors &amp;lt;ref&amp;gt;[https://sdcc.sourceforge.net/ SDCC targets as of February 2026]: the Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim (formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 based (hc08, s08), Zilog Z80 based MCUs (Z80, Z80N, Z180, SM83, Rabbit 2000, 2000A, 3000A, SM83, TLCS-90, eZ80, R800), Padauk (pdk14, pdk15), STMicroelectronics STM8, MOS 6502 and WDC 65C02. Work is in progress on supporting the Rabbit 4000, 5000, 6000, Padauk pdk13 and the f8 and f8l targets; Microchip PIC16 and PIC18 targets are unmaintained.  SDCC can be retargeted for other microprocessors.&amp;lt;/ref&amp;gt; including a Z80N target.&lt;br /&gt;
&lt;br /&gt;
: The compiler, assembler and linker are GNU GPL &amp;lt;ref&amp;gt;[https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU GPL 2] , [https://www.gnu.org/licenses/gpl-3.0.html GNU GPL 3]&amp;lt;/ref&amp;gt; licensed and the compiler&#039;s libraries are GNU GPL licensed with a special exception.&lt;br /&gt;
&lt;br /&gt;
: Developed as separate projects there are: a development kit for SDCC for creating small NextZXOS DOT programs and a [https://github.com/retro-vault/libcpm3-z80 library for CP/M 3]&lt;br /&gt;
&lt;br /&gt;
: Firmware and loader sources in the tbblue repository were made to be compiled with SDCC.&lt;br /&gt;
&lt;br /&gt;
== C-like ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://taylorza.itch.io/znc-compiler ZNC Native compiler]&#039;&#039; ===&lt;br /&gt;
: ZNC is a language and compiler for the ZX Spectrum Next. The language is closely modeled after the C programming language.&lt;br /&gt;
: The language suite includes the compiler, an optimizer, assembler and text editor to support native development on the Next. It also include a frontend that makes managing source files and building your projects easier.&lt;br /&gt;
&lt;br /&gt;
== Forth ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;VForth Next&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
: [https://github.com/mattsteeldue/vforth-next VForth Next] is a Z80N Forth system suitable to run on the ZX Spectrum Next&lt;br /&gt;
&lt;br /&gt;
== Pascal ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;Pasta80&#039;&#039; ===&lt;br /&gt;
: [https://github.com/pleumann/pasta80 Pasta80] is a Turbo Pascal 3.0-compatible compiler that generates machine code for classic and modern Z80 machines (currently ZX Spectrum 48K/128K/Next and CP/M). &lt;br /&gt;
: GNU GPL 3 license with a linking exception.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;OmniPas&#039;&#039; ===&lt;br /&gt;
: [https://syntaxerrorsoftware.itch.io/omnipas OmniPas] is a Windows‑based Pascal cross‑compiler that targets multiple platforms, including the ZX Spectrum and ZX Spectrum Next.&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/speccyorg/bas2tap bas2tap CLI]&#039;&#039; ===&lt;br /&gt;
: The utility to convert `BASIC in an ASCII file&#039; to a TAP tape image file (can be loaded by emulator or Next as regular BASIC program).&lt;br /&gt;
: Comes complete with portable C source. With full BASIC syntax checking!&lt;br /&gt;
: (does not support NextBASIC extensions)&lt;br /&gt;
: (for NextBASIC you can use the NextZXOS dot commands .txt2bas and .bas2txt directly on the Next)&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/remy/txt2bas txt2bas &amp;amp; bas2txt CLI]&#039;&#039; ===&lt;br /&gt;
: Cross platform command line tool to convert NextBASIC to +3dos .bas file and convert .bas files to plain text.&lt;br /&gt;
: The tool also includes verbose validation, tap and 3dos, BANK compatible and headerless export and import support&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Hw_im2_mode&amp;diff=41932</id>
		<title>Hw im2 mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Hw_im2_mode&amp;diff=41932"/>
		<updated>2026-05-12T19:25:38Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: bit 0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;hw im2 mode is enabled by the bit 0 of {{NextRegNo|$C0}}.&lt;br /&gt;
&lt;br /&gt;
If not in hw im2 mode, i.e. normal Spectrum behaviour, then all devices that generate an interrupt do it by asserting /int low for around 30 cycles and that&#039;s it.&lt;br /&gt;
&lt;br /&gt;
If you are in hw im2 mode, then all interrupting devices including the ULA have an im2 state machine attached.  If an interrupt is generated, the state machine remembers this as it moves to an assert /int state.  Recognition of RETI for the specific device moves the state machine to a place where another /int from the device can be accepted. &lt;br /&gt;
&lt;br /&gt;
For recognition of RETI:&lt;br /&gt;
&lt;br /&gt;
reti instruction has been detected active in T3 for rising edge of T4 &lt;br /&gt;
&lt;br /&gt;
so on rising edge of T4, the hw will move to a state where it will see a new int event from the device.  /int events are edge detected so you can&#039;t hold /int low forever and keep generating interrupts.&lt;br /&gt;
&lt;br /&gt;
That does mean, e.g., that if multiple events occur while the isr still hasn&#039;t executed RETI then you&#039;re not going to see more than the one current interrupt.  If the DMA is taking a long time, multiple CTC interrupts on a channel only generate one channel interrupt when the dma ultimately gives up the bus.  If you have the CTC interrupting DMA op, then you&#039;ll see them all most likely.&lt;br /&gt;
&lt;br /&gt;
= The background =&lt;br /&gt;
&lt;br /&gt;
Zilog defines what IM2 mode is.. the hardware is in a physically ordered daisy chain with each interrupting device using that chain to know which has highest priority.  The devices put vectors on the bus during int ack so that the z80 can jump directly to a specific device&#039;s ISR.&lt;br /&gt;
&lt;br /&gt;
Sinclair does not support that and instead the ula is a like a traditional 8080 device with one int signal going to one ISR in im1 mode.  There is no intelligence in the ula for interrupts, just a notion of asserting the int line low for about 30 cycles.&lt;br /&gt;
&lt;br /&gt;
Even when you put the z80 in im2 mode, the devices don&#039;t obey Zilog&#039;s im2 scheme.  That&#039;s why you need 257 bytes in the vector table that are all the same.  The ula does not provide a vector.&lt;br /&gt;
&lt;br /&gt;
For backwards compatibility, the Next&#039;s devices normally work in the spectrum mode where they know nothing about interrupts other than pulling into low for about 30 cycles.&lt;br /&gt;
&lt;br /&gt;
You can choose to operate in hw im2 mode where the hw switches to implementing Zilog&#039;s im2 scheme via the bit 0 in {{NextRegNo|$C0}}.  That&#039;s when you have prioritized interrupts and unique vectors/ISRs for each interrupting device.  What&#039;s new in the Next is that these interrupts can also be set to interrupt a dma operation via nextreg in the CC range (see e.g. {{NextRegNo|$CC}})  AFAIK (says AA) that&#039;s not been done anywhere else.&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Hw_im2_mode&amp;diff=41931</id>
		<title>Hw im2 mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Hw_im2_mode&amp;diff=41931"/>
		<updated>2026-05-12T19:24:20Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: nextreg CC&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;hw im2 mode is enabled by the bit 0 of {{NextRegNo|$C0}}.&lt;br /&gt;
&lt;br /&gt;
If not in hw im2 mode, i.e. normal Spectrum behaviour, then all devices that generate an interrupt do it by asserting /int low for around 30 cycles and that&#039;s it.&lt;br /&gt;
&lt;br /&gt;
If you are in hw im2 mode, then all interrupting devices including the ULA have an im2 state machine attached.  If an interrupt is generated, the state machine remembers this as it moves to an assert /int state.  Recognition of RETI for the specific device moves the state machine to a place where another /int from the device can be accepted. &lt;br /&gt;
&lt;br /&gt;
For recognition of RETI:&lt;br /&gt;
&lt;br /&gt;
reti instruction has been detected active in T3 for rising edge of T4 &lt;br /&gt;
&lt;br /&gt;
so on rising edge of T4, the hw will move to a state where it will see a new int event from the device.  /int events are edge detected so you can&#039;t hold /int low forever and keep generating interrupts.&lt;br /&gt;
&lt;br /&gt;
That does mean, e.g., that if multiple events occur while the isr still hasn&#039;t executed RETI then you&#039;re not going to see more than the one current interrupt.  If the DMA is taking a long time, multiple CTC interrupts on a channel only generate one channel interrupt when the dma ultimately gives up the bus.  If you have the CTC interrupting DMA op, then you&#039;ll see them all most likely.&lt;br /&gt;
&lt;br /&gt;
= The background =&lt;br /&gt;
&lt;br /&gt;
Zilog defines what IM2 mode is.. the hardware is in a physically ordered daisy chain with each interrupting device using that chain to know which has highest priority.  The devices put vectors on the bus during int ack so that the z80 can jump directly to a specific device&#039;s ISR.&lt;br /&gt;
&lt;br /&gt;
Sinclair does not support that and instead the ula is a like a traditional 8080 device with one int signal going to one ISR in im1 mode.  There is no intelligence in the ula for interrupts, just a notion of asserting the int line low for about 30 cycles.&lt;br /&gt;
&lt;br /&gt;
Even when you put the z80 in im2 mode, the devices don&#039;t obey Zilog&#039;s im2 scheme.  That&#039;s why you need 257 bytes in the vector table that are all the same.  The ula does not provide a vector.&lt;br /&gt;
&lt;br /&gt;
For backwards compatibility, the Next&#039;s devices normally work in the spectrum mode where they know nothing about interrupts other than pulling into low for about 30 cycles.&lt;br /&gt;
&lt;br /&gt;
You can choose to operate in hw im2 mode where the hw switches to implementing Zilog&#039;s im2 scheme via the bit in nextreg 0xc0.  That&#039;s when you have prioritized interrupts and unique vectors/ISRs for each interrupting device.  What&#039;s new in the Next is that these interrupts can also be set to interrupt a dma operation via nextreg in the CC range (see e.g. {{NextRegNo|$CC}})  AFAIK (says AA) that&#039;s not been done anywhere else.&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Hw_im2_mode&amp;diff=41930</id>
		<title>Hw im2 mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Hw_im2_mode&amp;diff=41930"/>
		<updated>2026-05-12T19:22:23Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: The background&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;hw im2 mode is enabled by the bit 0 of {{NextRegNo|$C0}}.&lt;br /&gt;
&lt;br /&gt;
If not in hw im2 mode, i.e. normal Spectrum behaviour, then all devices that generate an interrupt do it by asserting /int low for around 30 cycles and that&#039;s it.&lt;br /&gt;
&lt;br /&gt;
If you are in hw im2 mode, then all interrupting devices including the ULA have an im2 state machine attached.  If an interrupt is generated, the state machine remembers this as it moves to an assert /int state.  Recognition of RETI for the specific device moves the state machine to a place where another /int from the device can be accepted. &lt;br /&gt;
&lt;br /&gt;
For recognition of RETI:&lt;br /&gt;
&lt;br /&gt;
reti instruction has been detected active in T3 for rising edge of T4 &lt;br /&gt;
&lt;br /&gt;
so on rising edge of T4, the hw will move to a state where it will see a new int event from the device.  /int events are edge detected so you can&#039;t hold /int low forever and keep generating interrupts.&lt;br /&gt;
&lt;br /&gt;
That does mean, e.g., that if multiple events occur while the isr still hasn&#039;t executed RETI then you&#039;re not going to see more than the one current interrupt.  If the DMA is taking a long time, multiple CTC interrupts on a channel only generate one channel interrupt when the dma ultimately gives up the bus.  If you have the CTC interrupting DMA op, then you&#039;ll see them all most likely.&lt;br /&gt;
&lt;br /&gt;
= The background =&lt;br /&gt;
&lt;br /&gt;
Zilog defines what IM2 mode is.. the hardware is in a physically ordered daisy chain with each interrupting device using that chain to know which has highest priority.  The devices put vectors on the bus during int ack so that the z80 can jump directly to a specific device&#039;s ISR.&lt;br /&gt;
&lt;br /&gt;
Sinclair does not support that and instead the ula is a like a traditional 8080 device with one int signal going to one ISR in im1 mode.  There is no intelligence in the ula for interrupts, just a notion of asserting the int line low for about 30 cycles.&lt;br /&gt;
&lt;br /&gt;
Even when you put the z80 in im2 mode, the devices don&#039;t obey Zilog&#039;s im2 scheme.  That&#039;s why you need 257 bytes in the vector table that are all the same.  The ula does not provide a vector.&lt;br /&gt;
&lt;br /&gt;
For backwards compatibility, the Next&#039;s devices normally work in the spectrum mode where they know nothing about interrupts other than pulling into low for about 30 cycles.&lt;br /&gt;
&lt;br /&gt;
You can choose to operate in hw im2 mode where the hw switches to implementing Zilog&#039;s im2 scheme via the bit in nextreg 0xc0.  That&#039;s when you have prioritized interrupts and unique vectors/ISRs for each interrupting device.  What&#039;s new in the Next is that these interrupts can also be set to interrupt a dma operation via nextreg in the CC range.  AFAIK (says AA) that&#039;s not been done anywhere else.&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Hw_im2_mode&amp;diff=41929</id>
		<title>Hw im2 mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Hw_im2_mode&amp;diff=41929"/>
		<updated>2026-05-12T18:28:20Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: wording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;hw im2 mode is enabled by the bit 0 of {{NextRegNo|$C0}}.&lt;br /&gt;
&lt;br /&gt;
If not in hw im2 mode, i.e. normal Spectrum behaviour, then all devices that generate an interrupt do it by asserting /int low for around 30 cycles and that&#039;s it.&lt;br /&gt;
&lt;br /&gt;
If you are in hw im2 mode, then all interrupting devices including the ULA have an im2 state machine attached.  If an interrupt is generated, the state machine remembers this as it moves to an assert /int state.  Recognition of RETI for the specific device moves the state machine to a place where another /int from the device can be accepted. &lt;br /&gt;
&lt;br /&gt;
For recognition of RETI:&lt;br /&gt;
&lt;br /&gt;
reti instruction has been detected active in T3 for rising edge of T4 &lt;br /&gt;
&lt;br /&gt;
so on rising edge of T4, the hw will move to a state where it will see a new int event from the device.  /int events are edge detected so you can&#039;t hold /int low forever and keep generating interrupts.&lt;br /&gt;
&lt;br /&gt;
That does mean, e.g., that if multiple events occur while the isr still hasn&#039;t executed RETI then you&#039;re not going to see more than the one current interrupt.  If the DMA is taking a long time, multiple CTC interrupts on a channel only generate one channel interrupt when the dma ultimately gives up the bus.  If you have the CTC interrupting DMA op, then you&#039;ll see them all most likely.&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41926</id>
		<title>Layer 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41926"/>
		<updated>2026-05-07T15:46:33Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: half a byte&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Layer 2 provides an additional screen layer at 256x192 256 colours, 320x256 256 colours or 640x256 16 colours in which every pixel is individually coloured. Layer 2 may appear in place of, behind, or above the ULA-generated/Tilemap layer.&lt;br /&gt;
&lt;br /&gt;
The palette used to show the Layer 2 is selected by the bit 2 of the {{NextRegNo|$43}}.&lt;br /&gt;
&lt;br /&gt;
The Layer 2 screen occupies 48kiB or 80kiB, which is stored in 3 (or 5) consecutive [[Memory map|banks]]. By NextZXOS/NextBASIC default, banks 9-11 are used for the visible and &amp;quot;shadow&amp;quot; Layer 2 screen (the HW after power-on defaults to 8-10 for displayed and 11-13 for shadow screen, but that gets modified by NextZXOS booting up). These can be set using {{NextRegNo|$12}} and {{NextRegNo|$13}} (avoid banks 5, 7 and 8 to be used as Layer 2 screen, unless you are familiar with SRAM and BRAM of the board and how the ULA screen memory has special treatment in Next&#039;s FPGA).&lt;br /&gt;
&lt;br /&gt;
Each pixel of Layer 2 takes one byte of video memory in 8bpp modes or half a byte in 4bpp mode, so the Layer 2 needs 48kiB for 256x192 mode or 80kiB for 320x256-8bit or 640x256-4bit mode. The Layer 2 256x192 mode is divided &#039;&#039;&#039;horizontally&#039;&#039;&#039; into 3 16kiB banks of 64 &#039;&#039;&#039;lines&#039;&#039;&#039; each. The modes 320x256 and 640x256 are divided &#039;&#039;&#039;vertically&#039;&#039;&#039; into 5 16kiB  banks of 64 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 320x256 mode or 128 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 640x256 mode.&lt;br /&gt;
&lt;br /&gt;
Layer 2 is controlled via {{PortNo|$123B}} and {{NextRegNo|$70}}, the port is bit mapped as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-6 || Video RAM bank select (write/read paging)&lt;br /&gt;
|-&lt;br /&gt;
| 5-4 || Reserved, write 0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Use Shadow Layer 2 for paging - {{NextRegNo|$13}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Enable Layer 2 read-only paging&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Layer 2 visible - {{NextRegNo|$12}}&lt;br /&gt;
Since core 3.0 this bit has mirror in {{NextRegNo|$69}}&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Enable Layer 2 write-only paging&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When bit 0 of $123B is set to 1, the appropriate area of Layer 2 video memory (as set by bits 6-7) is accessed by &#039;&#039;&#039;writes&#039;&#039;&#039; into slot 1, ie memory area $0000-$3fff (see [[Memory map]]). This prevents any conflict since this area would normally be ROM and thus useless to write to. However, you &#039;&#039;&#039;cannot READ the contents of Layer 2 via this mapping!&#039;&#039;&#039; Reading addresses in this range will read the values from the ROM page (or RAM bank if in AllRam mode) that would be mapped there normally if Layer 2 paging was disabled.&lt;br /&gt;
&lt;br /&gt;
When bit 2 of $123B is set to 1 (new feature of core 3.0), the same area $0000-$3fff is remapped for read, allowing read access into Layer 2 bank selected by bits 3,6 and 7 (while write will still go into the regular ROM/RAM page).&lt;br /&gt;
&lt;br /&gt;
With both bits 0 and 2 set you are creating alternative read+write mapping of RAM (technically identical to mapping done by MM0+MMU1 registers).&lt;br /&gt;
&lt;br /&gt;
Bank 5 and first half of Bank 7, when being accessed by regular means (MMU paging, default memory mapping, DMA), are overshadowed by fast BRAM memory inside the FPGA chip, which is then used to generate ULA screen and [[Tilemap]] graphics (aka &amp;quot;Layer 3&amp;quot;) - not using the SRAM memory chip in that particular area. This Layer 2 (mapping and visible data) is the only exception, circumventing this mechanism and accessing the Bank 5 and Bank 7 in the main memory SRAM chip (giving you extra 16+8kiB of &amp;quot;secret&amp;quot; memory and further headache to emulators&#039; authors). If you are not sure what this means, just avoid using bank 5 and 7 for Layer 2, use values greater/equal to 8 (and avoid also Bank 8, unless you want to destroy NextBASIC warm-restart/soft-reset variables).&lt;br /&gt;
&lt;br /&gt;
Bits 6 and 7 contain the number which third of Layer 2 should be mapped (0..2), or (new feature of core 3.0) when value 3 is set, whole 48kiB of Layer 2 is mapped into area $0000-$bfff (make sure your code, stack and interrupts will cope well with such new mapping).&lt;br /&gt;
&lt;br /&gt;
There is one more new functionality in latest 3.x cores, allowing to set bank-offset variable from 0 to 7. This offset is further applied to the bank selected for write/read (by writing value 0..7 to the port with bit4 set (so it&#039;s value 16..23). If you did set for example 16kiB write mapping of first bank, the first bank is 9, and use value 21 for bank-offset setup (+5 offset), the bank mapped into $0000..$3FFF address area will be 14 (9+5). This way you can map full 80kiB of pixel data into the bottom 16kiB window (or bottom 48kiB window), using different offsets.&lt;br /&gt;
&lt;br /&gt;
Use {{NextRegNo|$70}} to select particular Layer2 mode, and to modify palette offset (added to top four bits of each pixel). Don&#039;t forget to set up Layer 2 clip window correctly for each mode ({{NextRegNo|$18}}).&lt;br /&gt;
&lt;br /&gt;
You can still use also the regular [[Memory map|banking]] ports to switch in one of the Layer 2 banks in slot for at $C000 (or use the ZX Next MMU registers to map that RAM in other regions). This will allow you to read and write the memory as usual. The ability to write to Layer 2 via writes into slot 1 is provided for convenience and to allow graphics data to be easily copied from extended RAM banks.&lt;br /&gt;
&lt;br /&gt;
Pixels are drawn to Layer 2 by writing to the appropriate area of RAM. Layer 2 pixels in 256x192 mode are in English reading order with no ULA-style interlacing. Since there are 256 pixels per line, and when using access via slot 1 the memory port starts at $0000, the upper byte of the address exactly equals the Y coordinate (within the selected third of the screen) and the lower byte exactly equals the X coordinate.&lt;br /&gt;
&lt;br /&gt;
In mode 320x256 (8bpp) the pixels are stored in memory going from top to bottom and left to right (second byte is first pixel on second line, 256th byte is second pixel on first line). Since there are 256 pixels per column, the upper byte of address could represent the X coordinate (only specific range of them, as whole 0..319 range does not fit into 8 bits), and the lower byte of address is Y coordinate. The total pixel memory is 80kiB (five 16kiB banks), and could be mapped into memory either by MMU or by bank-offset feature of {{PortNo|$123B}}.&lt;br /&gt;
&lt;br /&gt;
In mode 640x256 (4bpp) the pixels are stored identically to 320x256 mode, but every byte contains two pixels. The top nibble (top four bits) form &amp;quot;left&amp;quot; pixel, and the bottom nibble form &amp;quot;right&amp;quot; pixel, so first 256 bytes will display as two columns on screen, not one.&lt;br /&gt;
&lt;br /&gt;
Note that you will need to manually clear the Layer 2 screen before drawing on it, as it may contain random data when the machine starts up.&lt;br /&gt;
&lt;br /&gt;
System registers {{NextRegNo|$16}}, {{NextRegNo|$71}} and {{NextRegNo|$17}} apply a pixel shift to all content in Layer &lt;br /&gt;
2, allowing scrolling effects to be created.&lt;br /&gt;
&lt;br /&gt;
Since core 3.0 the visibility of Layer 2 is not affected by usage of ZX128 ULA-shadow (Bank 7) screen.&lt;br /&gt;
&lt;br /&gt;
Obsolete info for core 2.x (limitation was lifted in core 3.0): &amp;lt;del&amp;gt;the visible Layer 2 will cause the slow down of CPU to 7MHz.&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use double-buffered scheme for Layer 2, think about {{NextRegNo|$12}} being display related (i.e. has to be changed to display new Layer 2, when the new image is already prepared) (or it may be modified also during frame to compose final image from various memory areas), while {{NextRegNo|$13}} is related only to write-over-ROM paging functionality ({{PortNo|$123B}}).&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41925</id>
		<title>Layer 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41925"/>
		<updated>2026-05-06T13:38:24Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: rewording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Layer 2 provides an additional screen layer at 256x192 256 colours, 320x256 256 colours or 640x256 16 colours in which every pixel is individually coloured. Layer 2 may appear in place of, behind, or above the ULA-generated/Tilemap layer.&lt;br /&gt;
&lt;br /&gt;
The palette used to show the Layer 2 is selected by the bit 2 of the {{NextRegNo|$43}}.&lt;br /&gt;
&lt;br /&gt;
The Layer 2 screen occupies 48kiB or 80kiB, which is stored in 3 (or 5) consecutive [[Memory map|banks]]. By NextZXOS/NextBASIC default, banks 9-11 are used for the visible and &amp;quot;shadow&amp;quot; Layer 2 screen (the HW after power-on defaults to 8-10 for displayed and 11-13 for shadow screen, but that gets modified by NextZXOS booting up). These can be set using {{NextRegNo|$12}} and {{NextRegNo|$13}} (avoid banks 5, 7 and 8 to be used as Layer 2 screen, unless you are familiar with SRAM and BRAM of the board and how the ULA screen memory has special treatment in Next&#039;s FPGA).&lt;br /&gt;
&lt;br /&gt;
Each pixel of Layer 2 takes one byte of video memory in 8bpp modes or a half byte in 4bpp mode, so the Layer 2 needs 48kiB for 256x192 mode or 80kiB for 320x256-8bit or 640x256-4bit mode. The Layer 2 256x192 mode is divided &#039;&#039;&#039;horizontally&#039;&#039;&#039; into 3 16kiB banks of 64 &#039;&#039;&#039;lines&#039;&#039;&#039; each. The modes 320x256 and 640x256 are divided &#039;&#039;&#039;vertically&#039;&#039;&#039; into 5 16kiB  banks of 64 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 320x256 mode or 128 &#039;&#039;&#039;columns&#039;&#039;&#039; each for 640x256 mode.&lt;br /&gt;
&lt;br /&gt;
Layer 2 is controlled via {{PortNo|$123B}} and {{NextRegNo|$70}}, the port is bit mapped as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-6 || Video RAM bank select (write/read paging)&lt;br /&gt;
|-&lt;br /&gt;
| 5-4 || Reserved, write 0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Use Shadow Layer 2 for paging - {{NextRegNo|$13}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Enable Layer 2 read-only paging&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Layer 2 visible - {{NextRegNo|$12}}&lt;br /&gt;
Since core 3.0 this bit has mirror in {{NextRegNo|$69}}&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Enable Layer 2 write-only paging&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When bit 0 of $123B is set to 1, the appropriate area of Layer 2 video memory (as set by bits 6-7) is accessed by &#039;&#039;&#039;writes&#039;&#039;&#039; into slot 1, ie memory area $0000-$3fff (see [[Memory map]]). This prevents any conflict since this area would normally be ROM and thus useless to write to. However, you &#039;&#039;&#039;cannot READ the contents of Layer 2 via this mapping!&#039;&#039;&#039; Reading addresses in this range will read the values from the ROM page (or RAM bank if in AllRam mode) that would be mapped there normally if Layer 2 paging was disabled.&lt;br /&gt;
&lt;br /&gt;
When bit 2 of $123B is set to 1 (new feature of core 3.0), the same area $0000-$3fff is remapped for read, allowing read access into Layer 2 bank selected by bits 3,6 and 7 (while write will still go into the regular ROM/RAM page).&lt;br /&gt;
&lt;br /&gt;
With both bits 0 and 2 set you are creating alternative read+write mapping of RAM (technically identical to mapping done by MM0+MMU1 registers).&lt;br /&gt;
&lt;br /&gt;
Bank 5 and first half of Bank 7, when being accessed by regular means (MMU paging, default memory mapping, DMA), are overshadowed by fast BRAM memory inside the FPGA chip, which is then used to generate ULA screen and [[Tilemap]] graphics (aka &amp;quot;Layer 3&amp;quot;) - not using the SRAM memory chip in that particular area. This Layer 2 (mapping and visible data) is the only exception, circumventing this mechanism and accessing the Bank 5 and Bank 7 in the main memory SRAM chip (giving you extra 16+8kiB of &amp;quot;secret&amp;quot; memory and further headache to emulators&#039; authors). If you are not sure what this means, just avoid using bank 5 and 7 for Layer 2, use values greater/equal to 8 (and avoid also Bank 8, unless you want to destroy NextBASIC warm-restart/soft-reset variables).&lt;br /&gt;
&lt;br /&gt;
Bits 6 and 7 contain the number which third of Layer 2 should be mapped (0..2), or (new feature of core 3.0) when value 3 is set, whole 48kiB of Layer 2 is mapped into area $0000-$bfff (make sure your code, stack and interrupts will cope well with such new mapping).&lt;br /&gt;
&lt;br /&gt;
There is one more new functionality in latest 3.x cores, allowing to set bank-offset variable from 0 to 7. This offset is further applied to the bank selected for write/read (by writing value 0..7 to the port with bit4 set (so it&#039;s value 16..23). If you did set for example 16kiB write mapping of first bank, the first bank is 9, and use value 21 for bank-offset setup (+5 offset), the bank mapped into $0000..$3FFF address area will be 14 (9+5). This way you can map full 80kiB of pixel data into the bottom 16kiB window (or bottom 48kiB window), using different offsets.&lt;br /&gt;
&lt;br /&gt;
Use {{NextRegNo|$70}} to select particular Layer2 mode, and to modify palette offset (added to top four bits of each pixel). Don&#039;t forget to set up Layer 2 clip window correctly for each mode ({{NextRegNo|$18}}).&lt;br /&gt;
&lt;br /&gt;
You can still use also the regular [[Memory map|banking]] ports to switch in one of the Layer 2 banks in slot for at $C000 (or use the ZX Next MMU registers to map that RAM in other regions). This will allow you to read and write the memory as usual. The ability to write to Layer 2 via writes into slot 1 is provided for convenience and to allow graphics data to be easily copied from extended RAM banks.&lt;br /&gt;
&lt;br /&gt;
Pixels are drawn to Layer 2 by writing to the appropriate area of RAM. Layer 2 pixels in 256x192 mode are in English reading order with no ULA-style interlacing. Since there are 256 pixels per line, and when using access via slot 1 the memory port starts at $0000, the upper byte of the address exactly equals the Y coordinate (within the selected third of the screen) and the lower byte exactly equals the X coordinate.&lt;br /&gt;
&lt;br /&gt;
In mode 320x256 (8bpp) the pixels are stored in memory going from top to bottom and left to right (second byte is first pixel on second line, 256th byte is second pixel on first line). Since there are 256 pixels per column, the upper byte of address could represent the X coordinate (only specific range of them, as whole 0..319 range does not fit into 8 bits), and the lower byte of address is Y coordinate. The total pixel memory is 80kiB (five 16kiB banks), and could be mapped into memory either by MMU or by bank-offset feature of {{PortNo|$123B}}.&lt;br /&gt;
&lt;br /&gt;
In mode 640x256 (4bpp) the pixels are stored identically to 320x256 mode, but every byte contains two pixels. The top nibble (top four bits) form &amp;quot;left&amp;quot; pixel, and the bottom nibble form &amp;quot;right&amp;quot; pixel, so first 256 bytes will display as two columns on screen, not one.&lt;br /&gt;
&lt;br /&gt;
Note that you will need to manually clear the Layer 2 screen before drawing on it, as it may contain random data when the machine starts up.&lt;br /&gt;
&lt;br /&gt;
System registers {{NextRegNo|$16}}, {{NextRegNo|$71}} and {{NextRegNo|$17}} apply a pixel shift to all content in Layer &lt;br /&gt;
2, allowing scrolling effects to be created.&lt;br /&gt;
&lt;br /&gt;
Since core 3.0 the visibility of Layer 2 is not affected by usage of ZX128 ULA-shadow (Bank 7) screen.&lt;br /&gt;
&lt;br /&gt;
Obsolete info for core 2.x (limitation was lifted in core 3.0): &amp;lt;del&amp;gt;the visible Layer 2 will cause the slow down of CPU to 7MHz.&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use double-buffered scheme for Layer 2, think about {{NextRegNo|$12}} being display related (i.e. has to be changed to display new Layer 2, when the new image is already prepared) (or it may be modified also during frame to compose final image from various memory areas), while {{NextRegNo|$13}} is related only to write-over-ROM paging functionality ({{PortNo|$123B}}).&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Assemblers&amp;diff=41918</id>
		<title>Assemblers</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Assemblers&amp;diff=41918"/>
		<updated>2026-05-05T08:03:44Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: /* Native tools (running on Next) */ specasm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Any Z80 assembler can produce code suitable for the Next. However the raw blocks of Z80 code may be not as convenient to use with Next or emulators, so a Next specific tools may be useful for creating one of the supported [[File Formats]].&lt;br /&gt;
&lt;br /&gt;
== Cross-platform tools (running on PC) ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[http://www.desdes.com/products/oldfiles/zeus.htm Zeus-ish]&#039;&#039; ===&lt;br /&gt;
: Provides a complete Z80 IDE and Macro assembler, scripted disassember plus an integrated Z80 emulator for a range of machines including partial Next support&lt;br /&gt;
: Supports the Next opcodes directly&lt;br /&gt;
: Supports remote debugging on the Next using ParaSys across a serial link&lt;br /&gt;
: Supports MMU paging in the integrated emulator&lt;br /&gt;
: Supports sprites (core versions prior to 2.00.26) in the integrated emulator&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[http://pasmo.speccy.org/ Pasmo]&#039;&#039; ===&lt;br /&gt;
: A long established Z80 assembler, but has been mostly out of development for a long time (0.5.4-beta2 released in 2008, 0.5.5 in 2022)&lt;br /&gt;
: Supports all currently known Next extension opcodes in the 0.5.4-beta2-based 2018 version of [https://github.com/spec-chum/pasmo Pasmo modified by Russ McNulty and Tony Thompson] (also producing .sna files which were at that time used by CSpect).&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;SNasm&#039;&#039; ===&lt;br /&gt;
: Included with the [https://mdf200.itch.io/cspect #CSpect] emulator&lt;br /&gt;
: Full macro assembler&lt;br /&gt;
: Full bank control via Segment management&lt;br /&gt;
: Supports the Next extension opcodes directly&lt;br /&gt;
: Generates full 24bit map files for use in CSpect&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;z80asm&#039;&#039; ===&lt;br /&gt;
: Part of [https://github.com/z88dk/z88dk Z88dk]&#039;&#039;&lt;br /&gt;
: Supports the Next extension opcodes directly, linking assembler with large z80 library, targets any memory configuration&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/z00m128/sjasmplus z00m&#039;s fork of sjasmplus]&#039;&#039; ===&lt;br /&gt;
: Supports all (core2.00.28) Next extension opcodes, ZXN memory model (8 memory slots with 8ki pages and 1.75MiB virtual device memory), SAVENEX to build NEX files directly from ASM source (NEX version V1.2 (and experimental extension &amp;quot;V1.3&amp;quot;)), MAP files for [https://mdf200.itch.io/cspect #CSpect] emulator, SLD tracing files for [https://github.com/maziac/DeZog DeZog] and [https://github.com/Ckirby101/NDS-NextDevSystem NDS-NextDevSystem] and it is under active development (feedback is welcome).&lt;br /&gt;
: Open source project (&amp;quot;BSD-3-Clause&amp;quot; license), &#039;&#039;&#039;windows executables available at [https://github.com/z00m128/sjasmplus/releases/latest releases]&#039;&#039;&#039;, mac and linux users are expected to simply build from source (both make and CMake are supported).&lt;br /&gt;
: [http://z00m128.github.io/sjasmplus/documentation.html Documentation], latest stable release v1.23.0 2026-04-23&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;zmac&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
: [http://48k.ca/zmac.html zmac - Z-80 Macro Cross Assembler]&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/CatpainBlack/FantASM FantASM]&#039;&#039; ===&lt;br /&gt;
: FantASM is a two pass non optimising assembler for the Z80 processor by [https://github.com/CatpainBlack Guy &#039;CatpainBlack&#039; Black].&lt;br /&gt;
&lt;br /&gt;
:It supports all undocumented op-codes and the extended instruction set of the ZX Next and additional pseudo opcodes used by the CSpect emulator to control debugging.&lt;br /&gt;
&lt;br /&gt;
== Native tools (running on Next) ==&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://gitlab.com/next-tools/odin Odin]&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
Work-in-progress Next-specific assembler written by Matt Davies, used also in video tutorials presented by Jim Bagley, the best way to acquire the binary is to join the official ZX Next discord server and check channel &amp;lt;code&amp;gt;#odin&amp;lt;/code&amp;gt; - pinned messages, where you can also discuss any issues and get how-to hints.&lt;br /&gt;
&lt;br /&gt;
: supports most of the undocumented opcodes, all official Z80 and Next-extended instructions&lt;br /&gt;
: supports nested includes and binary includes&lt;br /&gt;
: source is stored in tokenised form (smaller file), up to 48kiB of source in single file&lt;br /&gt;
: assembling can produce 32kiB of machine code (enough to produce simpler dot command)&lt;br /&gt;
: includes also editor and console modules (debugger is planned)&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://www.solarisite.com/spectrumnext.html Sol]&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
Sol is an assembler and editor written by Solaris, that runs natively on the Next. Manual, assembler binary and assembler source can be downloaded [https://www.solarisite.com/spectrumnext.html here].&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://gitlab.com/thesmog358/tbblue/-/tree/master/tools/dev/Zeus ZEUS]&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
Classic ZEUS native assembler by Simon Brattel, extended and included directly in the ZX Next distro.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://gitlab.com/thesmog358/tbblue/-/tree/master/tools/dev/SPED SPED]&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
Classic SPED assembler by César Hernández Bañó, included directly in the ZX Next distro, see [https://gitlab.com/thesmog358/tbblue/-/raw/master/docs/apps/dev/SPED53readme.txt README].&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://github.com/markdryan/specasm specasm]&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
Mark Ryan&#039;s specasm assembler suite which includes an editor, an assembler, a linker and a tap file generator.&lt;br /&gt;
.specasm command launches an integrated editor/assembler.&lt;br /&gt;
Supports all the Z80n instructions.  All mnemonics are entered in lower case. The edited files are .x files, which are annotated object files, with the instructions pre-assembled.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;[https://taylorza.itch.io/nextbasic-inline-assembler NextBASIC Inline Assembler]&#039;&#039;===&lt;br /&gt;
Enables you to write inline assembly code in your NextBASIC application. The assembler can be downloaded from [https://taylorza.itch.io/nextbasic-inline-assembler HERE] with documentation available [https://github.com/taylorza/zxn-inlineasm-doc/blob/main/README.md HERE]&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
	<entry>
		<id>https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41917</id>
		<title>Layer 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.specnext.dev/index.php?title=Layer_2&amp;diff=41917"/>
		<updated>2026-05-04T13:40:39Z</updated>

		<summary type="html">&lt;p&gt;Johnnyo: palette detail&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Layer 2 provides an additional screen layer at 256x192 256 colours, 320x256 256 colours or 640x256 16 colours in which every pixel is individually coloured. Layer 2 may appear in place of, behind, or above the ULA-generated/Tilemap layer.&lt;br /&gt;
&lt;br /&gt;
The palette used to show the Layer 2 is selected by the bit 2 of the {{NextRegNo|$43}}.&lt;br /&gt;
&lt;br /&gt;
The Layer 2 screen occupies 48kiB or 80kiB, which is stored in 3 (or 5) consecutive [[Memory map|banks]]. By NextZXOS/NextBASIC default, banks 9-11 are used for the visible and &amp;quot;shadow&amp;quot; Layer 2 screen (the HW after power-on defaults to 8-10 for displayed and 11-13 for shadow screen, but that gets modified by NextZXOS booting up). These can be set using {{NextRegNo|$12}} and {{NextRegNo|$13}} (avoid banks 5, 7 and 8 to be used as Layer 2 screen, unless you are familiar with SRAM and BRAM of the board and how the ULA screen memory has special treatment in Next&#039;s FPGA).&lt;br /&gt;
&lt;br /&gt;
Each pixel of Layer 2 is assigned 1 byte of video memory (in 8bpp modes). This means Layer 2 consumes a total of 48kiB (256x192) or 80kiB (320x256). Since the Spectrum banks are 16kiB, Layer 2 256x192 mode is divided horizontally into 3 banks of 64 lines each, each of which is exactly 16kiB. The mode 320x256 (and 640x256) is divided vertically into 5 banks of 64 (128) columns each.&lt;br /&gt;
&lt;br /&gt;
Layer 2 is controlled via {{PortNo|$123B}} and {{NextRegNo|$70}}, the port is bit mapped as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-6 || Video RAM bank select (write/read paging)&lt;br /&gt;
|-&lt;br /&gt;
| 5-4 || Reserved, write 0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Use Shadow Layer 2 for paging - {{NextRegNo|$13}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Enable Layer 2 read-only paging&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Layer 2 visible - {{NextRegNo|$12}}&lt;br /&gt;
Since core 3.0 this bit has mirror in {{NextRegNo|$69}}&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Enable Layer 2 write-only paging&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When bit 0 of $123B is set to 1, the appropriate area of Layer 2 video memory (as set by bits 6-7) is accessed by &#039;&#039;&#039;writes&#039;&#039;&#039; into slot 1, ie memory area $0000-$3fff (see [[Memory map]]). This prevents any conflict since this area would normally be ROM and thus useless to write to. However, you &#039;&#039;&#039;cannot READ the contents of Layer 2 via this mapping!&#039;&#039;&#039; Reading addresses in this range will read the values from the ROM page (or RAM bank if in AllRam mode) that would be mapped there normally if Layer 2 paging was disabled.&lt;br /&gt;
&lt;br /&gt;
When bit 2 of $123B is set to 1 (new feature of core 3.0), the same area $0000-$3fff is remapped for read, allowing read access into Layer 2 bank selected by bits 3,6 and 7 (while write will still go into the regular ROM/RAM page).&lt;br /&gt;
&lt;br /&gt;
With both bits 0 and 2 set you are creating alternative read+write mapping of RAM (technically identical to mapping done by MM0+MMU1 registers).&lt;br /&gt;
&lt;br /&gt;
Bank 5 and first half of Bank 7, when being accessed by regular means (MMU paging, default memory mapping, DMA), are overshadowed by fast BRAM memory inside the FPGA chip, which is then used to generate ULA screen and [[Tilemap]] graphics (aka &amp;quot;Layer 3&amp;quot;) - not using the SRAM memory chip in that particular area. This Layer 2 (mapping and visible data) is the only exception, circumventing this mechanism and accessing the Bank 5 and Bank 7 in the main memory SRAM chip (giving you extra 16+8kiB of &amp;quot;secret&amp;quot; memory and further headache to emulators&#039; authors). If you are not sure what this means, just avoid using bank 5 and 7 for Layer 2, use values greater/equal to 8 (and avoid also Bank 8, unless you want to destroy NextBASIC warm-restart/soft-reset variables).&lt;br /&gt;
&lt;br /&gt;
Bits 6 and 7 contain the number which third of Layer 2 should be mapped (0..2), or (new feature of core 3.0) when value 3 is set, whole 48kiB of Layer 2 is mapped into area $0000-$bfff (make sure your code, stack and interrupts will cope well with such new mapping).&lt;br /&gt;
&lt;br /&gt;
There is one more new functionality in latest 3.x cores, allowing to set bank-offset variable from 0 to 7. This offset is further applied to the bank selected for write/read (by writing value 0..7 to the port with bit4 set (so it&#039;s value 16..23). If you did set for example 16kiB write mapping of first bank, the first bank is 9, and use value 21 for bank-offset setup (+5 offset), the bank mapped into $0000..$3FFF address area will be 14 (9+5). This way you can map full 80kiB of pixel data into the bottom 16kiB window (or bottom 48kiB window), using different offsets.&lt;br /&gt;
&lt;br /&gt;
Use {{NextRegNo|$70}} to select particular Layer2 mode, and to modify palette offset (added to top four bits of each pixel). Don&#039;t forget to set up Layer 2 clip window correctly for each mode ({{NextRegNo|$18}}).&lt;br /&gt;
&lt;br /&gt;
You can still use also the regular [[Memory map|banking]] ports to switch in one of the Layer 2 banks in slot for at $C000 (or use the ZX Next MMU registers to map that RAM in other regions). This will allow you to read and write the memory as usual. The ability to write to Layer 2 via writes into slot 1 is provided for convenience and to allow graphics data to be easily copied from extended RAM banks.&lt;br /&gt;
&lt;br /&gt;
Pixels are drawn to Layer 2 by writing to the appropriate area of RAM. Layer 2 pixels in 256x192 mode are in English reading order with no ULA-style interlacing. Since there are 256 pixels per line, and when using access via slot 1 the memory port starts at $0000, the upper byte of the address exactly equals the Y coordinate (within the selected third of the screen) and the lower byte exactly equals the X coordinate.&lt;br /&gt;
&lt;br /&gt;
In mode 320x256 (8bpp) the pixels are stored in memory going from top to bottom and left to right (second byte is first pixel on second line, 256th byte is second pixel on first line). Since there are 256 pixels per column, the upper byte of address could represent the X coordinate (only specific range of them, as whole 0..319 range does not fit into 8 bits), and the lower byte of address is Y coordinate. The total pixel memory is 80kiB (five 16kiB banks), and could be mapped into memory either by MMU or by bank-offset feature of {{PortNo|$123B}}.&lt;br /&gt;
&lt;br /&gt;
In mode 640x256 (4bpp) the pixels are stored identically to 320x256 mode, but every byte contains two pixels. The top nibble (top four bits) form &amp;quot;left&amp;quot; pixel, and the bottom nibble form &amp;quot;right&amp;quot; pixel, so first 256 bytes will display as two columns on screen, not one.&lt;br /&gt;
&lt;br /&gt;
Note that you will need to manually clear the Layer 2 screen before drawing on it, as it may contain random data when the machine starts up.&lt;br /&gt;
&lt;br /&gt;
System registers {{NextRegNo|$16}}, {{NextRegNo|$71}} and {{NextRegNo|$17}} apply a pixel shift to all content in Layer &lt;br /&gt;
2, allowing scrolling effects to be created.&lt;br /&gt;
&lt;br /&gt;
Since core 3.0 the visibility of Layer 2 is not affected by usage of ZX128 ULA-shadow (Bank 7) screen.&lt;br /&gt;
&lt;br /&gt;
Obsolete info for core 2.x (limitation was lifted in core 3.0): &amp;lt;del&amp;gt;the visible Layer 2 will cause the slow down of CPU to 7MHz.&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use double-buffered scheme for Layer 2, think about {{NextRegNo|$12}} being display related (i.e. has to be changed to display new Layer 2, when the new image is already prepared) (or it may be modified also during frame to compose final image from various memory areas), while {{NextRegNo|$13}} is related only to write-over-ROM paging functionality ({{PortNo|$123B}}).&lt;/div&gt;</summary>
		<author><name>Johnnyo</name></author>
	</entry>
</feed>