Studio's application wrapper exports 256 × 192 images with a two-bit palette. V2 batch mode three produces one animation and mode four numbered individual files; the examined Japanese V1 batch accepts mode three only. Generic encoder helpers do not establish equivalent menu options in every release. [1]
Pixel conversion and scratch ownership
The converter reads two 6,144-byte ink planes, least-significant bit first per byte in row order. Layer one wins overlaps. Empty pixels select paper index zero/one; black ink uses the opposite paper index, red two and blue three. Palette order is black, white, red, blue. Complete original-frame comparisons cover both papers and colour combinations across all four releases. [1]
The apparent 32 KiB allocator actually returns existing framework scratch; its release is a no-op. Dictionary uses the base, indices start at +0x10000, and encoded output alternates +0x20000/+0x2C000 by frame parity. Those addresses do not establish a general encoded-size limit or safe asynchronous lifetime. [1]
GIF structure
The first frame writes GIF89a, little-endian dimensions, a global palette, NETSCAPE2.0 repeat count zero, a graphics-control extension and a full opaque image. There is no transparency or interlace. Let P = 3 × 2^depth: palette begins at thirteen, repeat extension at 13+P, control at 32+P, descriptor at 40+P, minimum code size at 50+P and compressed subblocks at 51+P. Appended images use local palettes and full rectangles rather than pixel-difference regions. Trailer is one byte 0x3B. [1]
Each ordinary encode returns bytes produced by that call. The wrapper's minus-one finalisation returns its cumulative total after adding the trailer and still queries delay, although the trailer has no delay. The file pump must not mistake that total for the trailer's size. [1]
LZW details
The shared 32 KiB dictionary has 8,192 four-byte entries: sixteen-bit prefix, suffix byte and first-symbol byte. Prefixes reset to FFFF, literal symbols retain themselves and others clear. Clear is 1 shifted by depth, end is clear plus one and first free is clear plus two. A clear code starts output. Phrase lookup searches only indices below 256 even while new entries and the counter grow beyond that. An unrestricted dictionary search produces different bytes. [1]
Codes are packed least-significant bit first. Width starts at depth plus one, grows when the next-code count reaches one beyond its power-of-two threshold, and resets on reaching width thirteen: emit clear with twelve bits and return to initial width. Full subblocks contain 254 bytes, not the permitted maximum 255. Finalisation emits retained phrase/end, flushes partial bits and ends with a zero subblock. [1]
Japanese V1's final partial-byte writer reserves an extra length byte when that partial byte completes a full subblock, without initialising it before the following terminator. A controlled ordinary-size fixture therefore depends on the destination's prior byte and fails a targeted structure check, although a tolerant decoder recovers every pixel. V2 does not reserve that extra byte. A successful tolerant decode alone is not proof of structural conformance. [1]
Delays
| Internal index | Delay in centiseconds |
|---|---|
| 0 | 4 |
| 1 | 5 |
| 2 | 9 |
| 3 | 17 |
| 4 | 25 |
| 5 | 50 |
| 6 | 100 |
| 7 | 200 |
For indices zero through six, delay is (integer(1000 / rate) + 9) / 10, using rates 30, 20, 12, 6, 4, 2, 1. Index seven separately returns 200. The fastest export therefore uses forty milliseconds. These are internal indices, not the visible slider order. Speed-byte offsets differ: American three, Japanese V2 two, European six and Japanese V1 zero. [1]
File admission and writes
The American root is sdmc:/private/ds/app/4B475545/gif. Animation replaces/appends .gif; a sequence creates a source-named directory and writes 001.gif onwards into 128-byte path buffers. Only animated frame zero opens the common file. Every individual frame opens separately and encodes as a first image. Terminal animation or sequence writes append one trailer byte. [1]
Before opening, admission reserves archive/path cost plus 4,096 bytes. It walks parent prefixes backwards to the first existing directory, calculates remaining long-name entry/directory costs, rounds them to allocation units and updates available units and sixty-four-bit bytes only when sufficient. Zero allocation-unit product refuses. Archive-info failure requests diagnostic (1, filesystem error); insufficient space (1, 7). The checked normal power-of-two units do not establish arbitrary overflow behaviour or protection against another writer changing the space snapshot. [1]
Creation uses (path, 3, 0); failure continues only on numeric filesystem error eight, whose human-readable meaning is not established here. Open mode is two. A successful open submits generic SDK command thirty-one with zero; nonzero result closes with command eight and refuses. The earlier “length setter” label is not established by this provider evidence. Close submits command eight then returns whether command thirty reports nonzero. [1]
Successful terminal order is write, wait, close, increment output count. The count increments even when close returns false, so a changed count alone does not prove success. Open failure skips pixel conversion; readiness/write failures close without final wait or increment, with error arguments (1, 0) in mode seven or (1, 64) otherwise. Directory creation's result is not independently checked before open. Original codecs, regional delays and connected path-cost logic were tested separately from physical SD media, cancellation and device scheduling. [1]
Archive commands thirty and thirty-one
American V2 GIF export reaches 020B60B8, then generic dispatcher 020B4534. The dispatcher reads the archive from file offset eight and its function table from archive offset thirty-six. Command thirty forwards archive and file; thirty-one also forwards the first argument word from file offset sixteen. An absent provider returns four. The concrete registered archive provider still determines the operation: command thirty-one has not been established as a length setter. [2]
Ordinary completion unlinks the file from the archive queue, stores the result at file offset twenty, clears low command flags and requests a wake. Result 256 keeps the checked asynchronous request pending. Command thirty-five follows a different bitmask policy, so its refusal must not be assigned ordinary completion effects. Twelve cases cover both commands, missing providers, results zero/four/256, argument forwarding and the out-of-range control. They establish dispatch and completion ordering, not physical SD writes, final GIF length, media-removal recovery or cancellation. [2]
