This utility works with the following models of Spectrum:
The ZX ROM Cartridge Creator is a Windows based utility that allows the generation of Sinclair Spectrum ZX Interface 2 ROM cartridge files for use on 16K, 48K, 128K and +2 models. The files are intended for use with the ZXC1, ZXC2, ZXC3 and ZXC4 ROM cartridge PCBs, and are suitable for direct programming into PROMs. This page details those facilities applicable to the ZXC2.
The utility supports four file types:
- PC-based emulator snapshot files (.Z80, .SNA, .SZX)
- ROM image files (.ROM and .BIN)
- ZX80 program files (.O, .P80, and .80) for emulation on the Spectrum 128
- ZX81 program files (.P, .P81, and .81) for emulation on the Spectrum 128
A multi-program compilation may support any combination of these file types subject to the available space within the destination PROM. The utility will automatically determine which is the smallest capacity required for the chosen selection of programs. Snapshot, ZX80 and ZX81 programs are stored in a compressed format, thereby maximising the use of the available space.
PC-based emulator snapshot files (.Z80, .SNA and .SZX) allow the majority of 16K, 48K and 128K cassette based software titles to be converted into ROM cartridges. For most efficient results, the snapshot of a 16K game should be taken on emulated 16K machine and the snapshot of a 48K game taken on an emulated 48K machine. On a Spectrum 128, snapshots of programs taken while in 128 BASIC mode may fail to run properly on a Spectrum +2, and vice versa. This is due to routine relocations within the Editor ROM of the Spectrum +2.
To convert a snapshot, a few bytes of RAM are required and the safest place to attempt to obtain these from is the stack. Although this will work fine for the majority of programs, some might become corrupted if there is not enough stack space spare. If such an error is encountered then it might be possible to overcome it by taking a snapshot at a different stage within the program, preferably when there is little activity occurring, e.g. when showing a menu instead of during the game play.
ROM image files (.ROM and .BIN) can be incorporated into a multi-program cartridge, thereby allowing programs such as back-ups of the original retail cartridges or any of my new cartridge programs to be included.
|ZX80 Program Files|
ZX80 program files (.O, .P80, and .80) can be selected and will run using my ZX80 emulator ROM cartridge program (which will be included automatically). There are a couple of variants of the ZX80 emulator and each ZX80 program can be assigned to use one or other of them. Note that ZX80 programs are only supported on 128K Spectrums.
|ZX81 Program Files|
ZX81 program files (.P, .P81, and .81) can also be selected and will run using my ZX81 emulator ROM cartridge program (which will be included automatically). A number of variants of the ZX81 emulator also exist and each ZX81 program can be assigned to use a particular version. As with ZX80 programs, ZX81 programs are only supported on 128K Spectrums.
|Creating a Program Compilation|
To create a compilation for the ZXC2, select the target type as 'Spectrum' and 'ZXC2'. The Memory Type field is populated with the choice of applicable ROM types for the chosen cartridge, which is just 'PROM' for a ZXC2.
Once the target type has been chosen, programs can be selected via the Add button located on the toolbar (or from the Edit menu). It is also possible to drag-and-drop files from Windows Explorer into the compilation list area. A range of sub-options allow direct selection of a particular program type, e.g. snapshots only. Programs can also be adding by pressing the Insert key. Programs can be removed via the Remove button in the toolbar, from the Edit menu, or by pressing the Delete key. When Add is clicked, a dialog window is displayed which allows selection of the programs to insert and allows only files of the chosen type to be shown. The utility remembers the file type selected and will default to this next time the dialog is invoked. Once one or more programs have been selected, they are added to the compilation list within the middle area of the utility's window. This area shows a summary of details for each program. Fields show the file name of the program, the size the program occupies within the ROM image, the RAM required to run it, its type (e.g. a Z80 snapshot), and the text to use for the program within the automatically generated menu system (the default text is based on the program's file name). The remaining fields allow the name of the publisher, the year of release and a reference code (such as a version number or catalogue number) to be set. These details will be displayed by the menu system produced for the cartridge compilation. The menu entry text and the other fields shown for the program can be set via the options presented in the Program Details area, as described later.
When more than one program is inserted into a compilation then a start up menu will automatically be created and embedded within the cartridge image. This menu will be displayed when the cartridge is powered on and provides a method for selecting which program to run.
The menu displays the title of the cartridge, followed by a list all programs within the cartridge. The title text can be set via the entry in the Cartridge Details area (as described later). The cursor up and down keys (or just keys 7 and 6) are used to navigate the menu items and ENTER (or SPACE) is used to run the highlighted program. If there are more programs than can fit on the screen then indicators will be displayed to show that the menu can be scrolled. Scrolling past the end or beginning of the compilation list will cause a wrap around. To aid navigation, the cursor up and down keys will auto-repeat if held down. When navigating the menu, details about the currently selected program are displayed at the bottom of the screen. This consists of the text specified for the Publisher, Year and Reference fields for the program.
The menu system always contains a Disable ROM Cartridge entry, which allows the internal Spectrum ROM to be run. The cartridge will be completely disabled and avoids the need to physically remove the cartridge in order to use the Spectrum without it.
The Cartridge Creator utility also provides functions to re-arrange the order that the programs appear within the menu. This does not affect how the programs are actually stored within the PROM. All variable length programs are packed into the PROM space first, i.e. snapshots, ZX80 and ZX81 programs, and then after this appear all ROM image programs. This is because ROM image programs always need to begin in their own bank and are deemed to be multiples of 16K, and hence can be placed in adjacent banks without leaving any voids. The utility also provides functions for sorting the list of programs based on one of the fields: Title, Program Type, RAM, Publisher, Reference or Year.
The menu system also provides support for a couple of short-cut keys. Holding down the CAPS SHIFT key as the Spectrum is powered on causes the cartridge to be disabled and passes control to the Spectrum's internal ROM. Holiding down the SYMBOL SHIFT key as powering on the Spectrum is powered on causes the RAM Tester utlitity (if present in the compilation) to be run directly without the menu appearing. The menu system uses RAM but if the RAM is faulty then it might not be possible to select the RAM Tester from the list. The direct run facility therefore overcomes this problem.
|Create Data File|
Once a list of programs has been defined, the compilation can be written to a file by selecting the Create button. It produces a binary ROM file suitable for direct programming into a PROM of the minimum size stated (or larger) using an EPROM programmer.
The Cartridge Creator utility also provides functions for saving the current program compilation, loading a previously saved compilation, and for creating a new blank compilation. A compilation can also be loaded by dragging it in to the file list area of the Cartridge Creator, or by double clicking a .zxc compilation file.
The Cartridge Creator utility is aware of the range of ROM cartridge programs available from this website (excluding 3rd party titles) and will automatically insert details for all known programs. The programs are identified by their file name and so these should not be changed.
|Cartridge Details Area|
The Cartridge Details area contains a number of fields relating to the current compilation:
|Title||This field allows the text to use as the program title within the cartridge menu to be specified.|
|Memory Type||This field allows the ROM type to be selected for the target ROM cartridge. For the ZXC2, only PROMs are supported.|
|Include Chars||This field selects whether to embed bitmaps for the character set or access those within the Spectrum's ROM. If the target ROM cartridge does not have paging circuitry fitted (it is optional on the ZXC2, but is generally fitted), then it is necessary to embed a copy of the bitmaps.|
|Include Programmer||This field is always set to 'No' for the ZXC2.|
|Start-up Type||By default a menu is only included within a cartridge compilation if there is more than one program included. For a compilation consisting of a single program, a smaller block of start-up code is used instead of the menu. This start-up code performs any initialisation required and then proceeds to run the program. Both the menu code and the start-up code check the CAPS SHIFT key to disable the cartridge, and before running a program they will check to ensure that the Spectrum has the minimum amount of RAM required by the program. However, it may be desired that the menu system is included even when there is only a single program in the compilation. If so then this can be achieved by changing the Start-up Type field from 'Auto' to 'Menu'.|
|Programs||This read-only field displays the number of programs included within the compilation.|
|Required Memory||This read-only field shows the smallest capacity ROM required to contain the compilation.|
|Program Data||This read-only field displays how much space is being occupied by all of the inserted programs.|
|Menu Code||This read-only field shows how much menu or start-up code is required.|
|Programmer Code||This read-only field displays much space is occupied by the Flash Programmer utilty.|
|Free Space||This read-only field shows how much space is available for further programs.|
|Program Details Area|
The Program Details area contains a number of fields related to the program currently highlighted within the compilation list. These will appear at bottom of the screen when a program is highlighted in the menu.
|Name||This mandatory field allows the text that is used in the menu system for the program to be specified. There are no formatting requirements for this field.|
|Publisher||This optional field allows the name of the producer of the program to be set. There are no formatting requirements for this field.|
|Year||This field allows the year the program was released to be specified. The field only allows entry of values between 1980 and the current year, either selected via from the drop down list or by direct typing.|
|Ref||This optional field allows additonal reference information about the program to be set, e.g. a version number or a catalogue number, etc. There are no formatting requirements for this field.|
|RAM||This field is mandatory and is used to specify the minimum amount of RAM required by the program. For snapshot files, the amount of RAM needed is determined automatically. For ROM images, the RAM size will default to 16K but may be increased to 48K or 128K as required. ZX80 and ZX81 programs will only run on a 128K Spectrum and so the RAM field is used instead to specify the amount of emulated RAM, e.g. a 16K RAM pack.|
|Type||This read-only field indicates the nature of the program, e.g. a snapshot, ROM image, ZX80 program or ZX81 program.|
|File||This read-only field displays the full path and file name of the program.|
|Data||This read-only field shows how much space the program occupies within the PROM, taking into account any compression that has occurred.|
|Menu||This read-only field displays the amount of space taken to add the program into the menu, and so this figure will vary with the lengths of text entered into the Title, Publisher, Ref and Year fields.|
|Paging||This read-only field indicates how much space within the span of the program's storage area is unavailable due to the ZXC memory mapped paging mechanism. The paging mechanism utilises the last 64 bytes of each 16K bank of the PROM and so is unavailable for programs (with the exception of ROM images that fit within a single bank and do not require use of the paging facilities).|
|Padding||This read-only field shows the amount of other space contained within the program's span in the PROM that could not be used for storing the program. For example, a snapshot is stored as a compressed data block followed by a routine to uncompress this data into RAM. This structure repeats in each subsequent 16K bank used to hold the snapshot. After the last block, a restart routine is included which initialises all CPU registers before activating the program that now resides in RAM. The restart routine cannot be split across banks and so if there is not enough room in the last used bank then it will be shifted into the start of the next bank. This therefore introduces a void area within the span of ROM space used to hold the program. Another cause of a void area is to ensure that a connected ZX Interface 1 is not inadvertently invoked, i.e. by executing code from addresses $0008 and $1708. It is necessary to ensure that the uncompress and restart routines do not span these addresses, and so voids can occur around these locations. Void areas may also be introduced by inserting ROM images that are not exactly multiples of 16K. For example, the System Test Cartridge is only 8K is size and so padding will be inserted until the next 16K bank is reached.|
This field can be used to force a program to wait for a key press after loading. It is useful for programs that display a loading screen but clear it immediately upon running.
Creating a suitable snapshot is easy to do if the program loads using the standard Spectrum cassette routine:
|Emulator||This field is only used with ZX80 and ZX81 programs and selects which version of the ZX80 emulator or ZX81 emulator to run the selected program with. For example, there are variants of the ZX81 emulator that mimic the two editions of the ZX81 ROM and others that mimic add-on hardware such as the dk'tronics Graphics ROM module. As a ZX80 or ZX81 program is added into the compilation list, an emulator to run it is automatically inserted. By default this will be the standard ROM version for the ZX80 emulator and the edition 2 ROM version for the ZX81 emulator. The emulator will appear in the compilation list but will be displayed greyed out to indicate that it is only there in a supporting role, and hence it will not appear as a separate entry within the menu. As additional ZX80 or ZX81 programs are added, they will all share the same default instance of the ZX80 or ZX81 emulator. The type of emulator used by each program can subsequently be changed via the Emulator field. The newly chosen emulator is inserted into the list, and the old one removed unless other programs are still using it. Each emulator typically occupies one 16K bank but some require two banks, and as a result there may not always be enough space available to change the type of emulator used by a program. Selecting an emulator within the compilation list will highlight all programs that are using it by colouring them in red.|
|In Menu||This field applies to ZX80 and ZX81 programs and is used to allow an automatically inserted emulator to appear in the menu as an independent entry. The emulator can therefore be selected directly from the menu, without pre-loading a ZX80 or ZX81 program. Since additional space is required for storing the text that will be displayed within the menu, it may not be possible to make an emulator 'visible' within a very full PROM. If an emulator is inserted directly via the Add button but already exists greyed out in the list then the existing entry is upgraded to be visible within the menu.|
|Auto-Run Line||This field is only used with ZX80 and ZX81 programs and displays the line number that the program will start running from when loaded. The ZX80 did not support an auto-run facility and some ZX81 programs may not be configured to auto-run, and so the Auto-Run Line field will display 'None' for such programs. The field consists of a drop down list containing all the BASIC line numbers detected within the program and can be used to specify the line that the program should start running from when loaded. For ZX81 programs, they can be made to auto-run by simply setting the address of the line into one of the system variables. For the ZX80, it is necessary for the restart code to contain additional instructions to force the ZX80 to run the selected line. Note that the field will be disabled for ZX81 programs that already have an auto-run line number set.||Paging Locked||This field indicates whether the Spectrum 128 paging mechanism will be locked and/or the ZX Cartridge paging mechanism will be locked. There are four combinations denoted by the text 'None', '128 Only', 'ZXC Only' and '128 + ZXC'. For snapshots, the utility automatically determines whether the program is intended for a Spectrum 128, and hence whether the Spectrum 128 paging mechanism should remain unlocked. A snapshot conversion operates by transferring the program into RAM, then re-enabling the Spectrum ROM and disabling the ROM cartridge. The ZXC ROM cartridge paging mechanism will therefore always be disabled for a snapshot. A ZX80 or ZX81 program runs via the automatically included emulator, and this emulator will always require the Spectrum 128 paging mechanism to be unlocked. The ZXC ROM cartridge paging mechanism will be locked for all 16K versions of the emulators but unlocked for all 32K versions, e.g. ZX81 emulator with dk'tronics Graphics ROM support. The Paging Locked field is mainly used by ROM image programs, since it is not possible to automatically ascertain which mode is required. ROM images, such as back-ups of some of the original retail cartridges, require access to the full 16K ROM space and so the ZXC ROM cartridge paging mechanism must be locked. The default option for for ROM images is for the Paging Locked field is for both the Spectrum 128 and the ROM cartridge paging mechanisms to be unlocked. This setting avoids the need for additional software to be inserted to configure the paging mechanism(s) and hence allows ROM images up to the full PROM size to be selected. However, the Paging Locked field remains enabled since some ROM image programs may require different settings. For example, the original retail cartridges pre-date the Spectrum 128 and hence are unaware of its paging mechanism, and as a result the Jet Pac and Tranz Am cartridges inadvertently switch to the Spectrum 128's second display screen. To allow these ROM images to be used on a Spectrum 128, both the Spectrum 128 paging mechanism and the ZXC ROM cartridge paging mechanism must be set to be locked. This adds a start up routine that performs the locking before running the ROM image. Since the ROM image must reside at the start of a bank, the start up routine must be placed in a preceding bank and therefore means that 32K is required for these games.|
A snapshot file contains a complete dump of the Spectrum's RAM and also the state of the CPU's registers. As a result, snapshots becomes specific to the model of Spectrum on which they are taken. So for example, a snapshot of a 16K program taken using an emulated 48K Spectrum will not run on a real 16K Spectrum when converted to a ROM cartridge. Therefore a snapshot should be taken on the lowest model of Spectrum supported by the program.
Snapshots of 128K programs may also be specific to the model of emulated 128K Spectrum used to create them. This is due to relocation of routines within the Editor ROM of the Spectrum +2 compared to the Spectrum 128. Programs that use 128K BASIC will have different addresses stored on the stack and so snapshots of these programs will be specific to model of Spectrum that they were taken on. A similar issue applies to the Spanish Spectrum 128, which has a dramatically different Editor ROM than the UK Spectrum 128 and the UK, Spanish and French versions of the Spectrum +2. However, any 128K program that uses pure machine code and does not access any of the Editor ROM routines will work correctly on all 128K models when converted to a ROM cartridge.
Snapshots of programs that utilise the facilities of the ZX Interface 1 may also become specific to the edition of the Interface 1 ROM being emulated. Such a program might only perform a check for the Interface 1 ROM edition when it first runs. If a snapshot is taken after this point then the snapshot becomes specific to a particular ROM edition of the Interface 1. It is therefore important to take snapshots of such programs before any attempt is made by the program to run machine code. Snapshots taken when the CPU is running the ROM code within the Interface 1 should be avoided since the Cartridge Creator utility does not attempt to page in the Interface 1 ROM before it runs the loaded program. Therefore always take snapshots at a point in the program when Interface 1 facilities are not being actively used.
|Click here to download the ZX ROM Cartridge Creator utility.|