Sega Master System Lemmings Editor
A level editor for Lemmings (Sega Master System)

Built by Squidgy: A custom level editor for the Sega Master System port of Lemmings, designed to replace the original Mappy-based editing with a fully self-contained tool.

---

System Requirements:
OS: Windows 10 or later (64-bit)
Disk space: ~200 MB 
RAM: 512 MB or more
No installation required: the editor is a single portable EXE

---

Getting Started

1. Unzip the contents of the ZIP file.
2. Run Level Editor.exe
3. In the BUILD tab (right panel), select the .asm project file and the levels.txt file - these are included in the ZIP
4. Open or drag-and-drop an .mlm file onto the canvas to start editing - the editor will *try* and guess which tileset you're using, although it can get confused with SAND tilesets.
5. When you're done, click ⬆ Inject Level followed by 🔨 Convert + Compile ROM

Your compiled lemmings.sms will appear in the same folder as your .asm file, ready to test in an emulator.

---

Controls & Keyboard Shortcuts

Tools

| Key | Tool |
|-----|------|
| B | Draw |
| E | Erase |
| F | Flood fill |
| S | Select |
| T | Trap placement |
| D | Deselect active brush |
| R | Toggle reference image visibility |

Drawing

| Action | Effect |
|--------|--------|
| Left-click / drag | Draw with active tile or brush |
| Right-click | Erase (works with any tool) |
| Delete / Backspace | Erase current selection |
| Escape | Cancel paste mode |

File & Session

| Shortcut | Action |
|----------|--------|
| Ctrl+O | Open MLM file |
| Ctrl+E | Export MLM file |
| Ctrl+I | Load custom tileset image |
| Ctrl+S | Sessions menu |
| F12 | Revert map to last saved state |

Edit

| Shortcut | Action |
|----------|--------|
| Ctrl+Z | Undo |
| Ctrl+Y / Ctrl+Shift+Z | Redo |
| Ctrl+C | Copy selection |
| Ctrl+V | Paste |
| Ctrl+B | Save selection as new brush |
| Ctrl+Shift+B | Overwrite selected brush with selection |

View

| Shortcut | Action |
|----------|--------|
| + / = | Zoom in |
| - | Zoom out |
| Ctrl+Alt+Scroll | Zoom in/out with mouse wheel |
| Alt+Drag | Reposition reference image |

---

Level Data

All level properties are set in the LEVEL tab of the right panel. These are saved alongside your session and can be exported or imported as .ini files.

| Field | Notes |
|-------|-------|
| Name | Level name as it appears in-game |
| Rating | Fun / Tricky / Taxing / Mayhem / Extra 1–4 |
| Level Number | 1–30 within the selected rating |
| Tileset | The tileset the level uses (see below) |
| Fall Distance | Max fall before a lemming dies (0–255). Only active for Extra 1–4. |
| Music | Track override 1–17, or 0 for the rating's default |
| Trap Type / X / Y | Trap placement. Only active for Extra 1–4. |

Tileset IDs

| ID | Tileset |
|----|---------|
| 0 | Grass |
| 1 | Sand 1 |
| 2 | Fire |
| 3 | Ice |
| 4 | Brick |
| 5 | Unused |
| 6 | Sand 2 |
| 7 | Sega |

---

Brushes

Brushes are reusable tile patterns saved per tileset.

1. Switch to the Select tool (S) and drag a rectangle over the map
2. Press Ctrl+B to save it as a new brush, or Ctrl+Shift+B to overwrite the selected brush
3. Click a brush in the left panel to use it, then draw on the map as normal

Brushes are stored in %AppData%\Roaming\MLM Editor\brushes\ and a default set is included for each tileset. You can export and import brush packs as .json files to share them with others.

---

Reference Image

Load any PNG as a reference overlay using the 📁 Load button in the left panel. The reference image defaults to 100% scale and can be repositioned by holding Alt and dragging. Toggle its visibility at any time with R.

---

Tilesets

The built-in tilesets can be selected from the ▾ dropdown in the toolbar. To use a custom tileset, click 🖼 Tilesets (or press Ctrl+I) and select any PNG from disk: the editor will remember the file path in your session.

To update a built-in tileset, replace the corresponding PNG in the tilesets/ folder and rebuild the application.

---

Current Limitations

A few things that aren't possible yet in the current version:

- Custom tilesets in-game: the editor supports loading external PNGs for reference, but the game itself only supports the 7 built-in tilesets. Full custom tileset support is planned for a future release.
- Entrance and exit limits: maps support a maximum of 4 entrances and 3 exits. Placing more than this will produce undefined behaviour in-game.
- Traps and custom fall distance: these properties are only applied to levels in the Extra 1–4 rating categories. They have no effect on Fun, Tricky, Taxing, or Mayhem levels.
- Far-left column: tiles placed in the leftmost column of the map may occasionally be clipped in-game. It's recommended to leave this column empty.

---

Build Pipeline

The editor includes a fully self-contained build pipeline in the BUILD tab. No external tools or Python installation are required.

| Button | Action |
|--------|--------|
| ⬆ Inject Level | Writes the current map and level data into the project |
| 🔨 Convert + Compile ROM | Regenerates level data, patches the ASM, assembles, and links |

The WLA-DX assembler and linker (wla-z80 and wlalink) are bundled inside the editor and run automatically. The compiled lemmings.sms will appear in your project folder.

---

Credits

MLM Editor: built by Callum "Squidgy"

MLM file format: created by [Pooty](http://www.lemmingsforums.com), as part of the original SMS Lemmings Level Converter (2011). This editor would not exist without their foundational work on the format.

ROM: dumped from [Emulicious](https://emulicious.net/)

WLA-DX: assembler and linker by [Ville Helin](https://github.com/vhelin/wla-dx)

Electron: cross-platform desktop framework by [OpenJS Foundation](https://openjsf.org/)