Режим модерирования
Документы
НОВОСТИ
OPTICAL BROTHERS
ФАЙЛЫ
АРХИВ САЙТОВ
ССЫЛКИ
О САЙТЕ
ФОРУМЫ
ГОСТЕВАЯ КНИГА
Беларуская моваРусский языкEnglish language

Copyright © 2001-2006 Optical Brothers
mc-zx_1_1.zip · mc-zx/README.mdЗакрыть ×
# mc-zx — Midnight Commander plugins for the ZX Spectrum

A set of plugins for [Midnight Commander](https://midnight-commander.org/) (mc) for people who work with ZX
Spectrum files on a PC. Each plugin is a folder of its own, with its program, installer, description and tests,
and can be given away and installed apart from the others. All the programs are written in Python 3 with no
dependencies. They need mc 4.8 or later and run on Linux, macOS and BSD.

| plugin | version | what it does | in mc |
|---|---|---|---|
| [trdos](trdos/) | 1.0 | TR-DOS disk images (`.trd`) and SCL archives as folders: view, extract, add and delete files | Enter on `.trd`/`.scl`, F3 shows the catalog |
| [tape](tape/) | 1.0 | ZX Spectrum tapes (`.tap`, `.tzx`) as folders: view and extract files; on a TAP also add, replace and delete them | Enter on `.tap`/`.tzx`, F3 shows the catalog |
| [sdcard](sdcard/) | 1.0 | SD card and disk images of DivMMC, DivIDE and the Next (`.mmc`, `.img`, `.hdf`, `.vhd`): FAT12/16/32 with long names, read only | Enter on the image, F3 shows the partitions and the root folder |
| [alasm](alasm/) | 1.0 | ALASM 4.4x and 5.0x sources (files of type `H`) as text | F3 and Enter on `.H`/`.$H`, F2 → `l` converts to `.asm` |
| [zx0](zx0/) | 1.0 | packing and unpacking with ZX0 (Einar Saukas) | F2 → `j` / `J`, F3 on `.zx0` |
| [hrust](hrust/) | 1.0 | packing with Hrust 2 as Quick Commander 3.11's `h` did, or smaller with oh2c; unpacking | F2 → `u` / `O` / `N`, F3 on `.p_?`/`.hr2` |
| [hrum](hrum/) | 1.0 | packing with Hrum 3.5 (Hrumer) into a self-extracting block, and unpacking | F2 → `k` / `K`, F3 on `.hrm` |
| [cp866](cp866/) | 1.0 | DOS and Russian Spectrum texts in cp866: viewing, conversion to UTF-8 and back | F2 → `v`, `V`, `W` |

The plugins work together too. Inside a `.trd` image an ALASM source shows as `NAME.H`, and F3 shows it as text.
A tape's files copied from its `hobeta/` folder onto a `.trd` keep their type, start and autostart line, and back
again.

## Installation

You need mc and python3 (3.6 or later).

```
./install.sh                  all the plugins
./install.sh trdos alasm      only these
./install.sh --remove         uninstall all (or --remove and names)
```

Each plugin's installer can also be run from its folder: `trdos/install.sh`. Installing again updates a plugin.
Restart mc after installing.

Each plugin has a version: in its `plugin.conf`, at the top of its README, and in the lines the installer puts in
(`# trdos 1.0, mc-zx`), so you can see which one you have. To update, install the new one over the old.

What goes where:

- the programs into `~/.local/share/mc/zx/`, the trdos, tape and sdcard plugins into `~/.local/share/mc/extfs.d/`;
- the Enter and F3 rules into `~/.config/mc/mc.ext.ini` (before mc 4.8.29: `~/.config/mc/mc.ext`), the F2 menu
  entries into `~/.config/mc/menu`. If you have none of these files yet, the installer starts them from copies of
  the system ones, because a user's file replaces the system one entirely. Each plugin's lines sit between the
  markers `# mc-zx/NAME: begin` and `# mc-zx/NAME: end`; installing again puts the new ones where the old ones
  are, and leaves the file alone if nothing changed. When a file changes, its previous version is kept next to it
  as `.bak`. `--remove` puts the file back as it was, byte for byte; a file that is then the same as the system one
  (the installer's copy) is deleted, so that mc reads the system one again.

The installer checks first and changes nothing if it can't install:

- your own `mc.ext.ini` must have the section `[mc.ext.ini]` with its `Version=` line: mc 4.8.29 and later don't
  read the file without it;
- the folders go into mc's command lines between `"…"`, so a path with `"`, `$`, `` ` ``, `\` or a line break is
  refused (spaces, `&`, `|` and `%` are fine).

## The F2 menu

| key | entry |
|---|---|
| `j` / `J` | ZX0: pack / unpack |
| `u` / `O` / `N` | Hrust: pack / pack (oh2c) / unpack |
| `k` / `K` | Hrum: pack / unpack |
| `l` | ALASM: to text (.asm) |
| `v` | cp866: view text |
| `V` / `W` | cp866: convert to UTF-8 / convert UTF-8 to cp866 |

The entries work on the tagged files, or on the current file if none is tagged. mc runs menu commands only in
ordinary folders, not inside images: copy the file out of the image (F5) and work on the copy.

## What a plugin is made of

A plugin's folder holds:

- the program, one Python 3 file;
- `plugin.conf`: the plugin's name and the list of its programs;
- `mc.ext.ini`, `mc.ext`, `menu`: the lines for mc's files (each of these files is optional). The installer
  replaces `@BIN@` in them with the programs' folder, `@EXTFS@` with `extfs.d`;
- `install.sh`, the same in every plugin;
- `LICENSE`: the MIT License (a port of someone else's code keeps its own licence next to it too);
- `README.md` and `tests/` (run `python3 -B -m unittest discover -s tests` in the plugin's folder).

## Copyright

Copyright © 2026 Andrey Bogdanovich/Spectre (Optical Brothers), https://www.zxby.org

MIT License: see [LICENSE](LICENSE).