Repository navigation
Memo Plus Version 6
Memo+ is a sidecar file format created by King Mayro. It applies color on top of animations created in Flipnote Studio for the DSi (PPM). The format and specification were improved in collaboration with Austin Burk (Sudomemo).
A Memo+ file uses the .mplus file extension. It must have the same base filename as its corresponding PPM file.
Example:
F27F69_18AF803D7D80D_011.ppm
F27F69_18AF803D7D80D_011.mplus
The header is 17 bytes long. This document defines Memo+ version 6.
| Offset | Size | Type | Info |
|---|---|---|---|
| 0x0 | 4 | CHAR4 | File magic. Must be PPM+. |
| 0x4 | 1 | UINT8 | Memo+ version number |
| 0x5 | 4 | UINT32 | Size of palette data in bytes. |
| 0x9 | 4 | UINT32 | Size of creation tool mark data in bytes. Must be 0 if there is no mark. |
| 0xD | 4 | UINT32 | Size of author comment data in bytes. Must be 0 if there is no comment. |
Parsers use these size fields to determine where each section begins and ends. They should not rely on fixed offsets beyond the header.
The total file size must equal the header size plus all section sizes declared in the header. Files with inconsistent sizes must be rejected.
Parsers should reject files with a version number higher than the highest version they support. This prevents newer format features from being interpreted incorrectly by older software.
Palette data begins immediately after the header, at offset 0x11, and continues for the number of bytes specified by the palette data size in the header.
Each palette entry applies to a specific frame. Its changes remain in effect for subsequent frames until another entry modifies the same color slot. A Memo+ file does not need to know the length of its associated Flipnote animation. Entries referencing frames beyond the end of the animation are never triggered and have no effect.
Frame indices must be less than 999. Any entry with a frame index greater than or equal to 999 must cause the file to be rejected.
Palette entries must be ordered by strictly increasing frame index. Each entry must reference a unique frame index. Files with out-of-order or duplicate frame indices must be rejected.
All color slots begin in their default state at frame 0. Default colors are determined by the renderer, not by the Memo+ file format. The following values are provided as references for Flipnote animations only:
| Color | Hex value |
|---|---|
| White | #FFFFFF |
| Black | #000000 |
| Red | #FF0000 |
| Blue | #0000FF |
Palette entries can override color slots or return them to their default state. Slots not affected by an entry keep their current state.
Each palette entry is variable-length and has the following structure:
| Offset | Size | Type | Description |
|---|---|---|---|
| +0x0 | 2 | UINT16 | Frame index. Frame numbering begins at 0 and the value must be less than 999. |
| +0x2 | 1 | UINT8 | Set mask. Each set bit indicates that a replacement color for the corresponding slot follows in the color data, and that the slot should be overridden. |
| +0x3 | 1 | UINT8 | Clear mask. Each set bit indicates that the corresponding slot should return to its default state. Cleared slots have no color data. |
| +0x4 | N | BYTE3[] | Replacement colors for the slots indicated by the set mask, in ascending bit order. |
The following color slots correspond to Flipnote palette entries. Bit positions are the same in both the set and clear masks.
| Bit | Color |
|---|---|
| 0 | White |
| 1 | Black |
| 2 | Red |
| 3 | Blue |
| 4 | Green (Unused) |
| 5 | Yellow (Unused) |
| 6-7 | (Unused) |
Unused bits are reserved for future expansion of the format. Encoders must set unused bits to 0. Parsers must ignore reserved and unused bits. The set mask and clear mask must not share any set bits. In other words, a bitwise AND of the two masks must equal 0. Entries that violate this rule must be rejected.
Each color is encoded as 3 bytes (RGB888), corresponding to the hex format #RRGGBB.
The color data for an entry must be exactly popcount(set_mask) * 3 bytes long, where popcount is the number of set bits in the set mask. Colors must appear in ascending bit order (for example: white, black, red, blue).
If the palette section does not contain enough remaining bytes for an entry's color data, the file must be rejected.
Palette entries are applied in the order they appear in the file. When the decoder reaches a frame whose index matches an entry, it applies that entry in this order:
- For each bit set in the clear mask, return the corresponding slot to its default state.
- For each bit set in the set mask, override the corresponding slot using the RGB value from the entry's color data.
All other slots keep their current state. The resulting palette state remains active for later frames until another entry changes it.
An entry with both masks set to 0 is valid and makes no changes to the palette.
The following example shows set and clear operations across multiple entries, and how slot states persist between them.
Assume a file with three palette entries:
Entry 1 — Frame 0
- Set mask:
0x04(bit 2: red) - Clear mask:
0x00 - Color data:
0xFF 0x80 0x00(#FF8000, orange)
Entry 2 — Frame 5
- Set mask:
0x01(bit 0: white) - Clear mask:
0x00 - Color data:
0xF0 0xF0 0xF0(#F0F0F0, light grey)
Entry 3 — Frame 10
- Set mask:
0x00 - Clear mask:
0x04(bit 2: red) - Color data: none
The resulting palette state is:
| Frame range | White | Black | Red | Blue |
|---|---|---|---|---|
| 0–4 | <default> |
<default> |
#FF8000 |
<default> |
| 5–9 | #F0F0F0 |
<default> |
#FF8000 |
<default> |
| 10+ | #F0F0F0 |
<default> |
<default> |
<default> |
Entry 3 has no color data because its set mask is 0. Its clear mask returns the red slot to its default state without affecting any other slot. The white override from frame 5 remains active.
The creation tool mark section begins immediately after the palette data. It is absent if its declared size is 0.
The section contains a UTF-8 encoded string. Its length is given by the corresponding header size field, and it is not null-terminated. The creation tool mark is optional. It allows Memo+ tools or encoders to leave their mark without using the author comment field.
Implementations must reject creation tool mark sections larger than 65,536 bytes (64 KiB).
The author comment section begins immediately after the creation tool mark section. It is absent if its declared size is 0.
The section contains a UTF-8 encoded string. Its length is given by the corresponding header size field, and it is not null-terminated.
Implementations must reject author comment sections larger than 65,536 bytes (64 KiB).