--- nono/lib/memorystream.h 2026/04/29 17:05:08 1.1.1.4 +++ nono/lib/memorystream.h 2026/04/29 17:05:15 1.1.1.5 @@ -86,6 +86,21 @@ class MemoryStreamBE Write16(data & 0xffff); } + // LE で2バイト書き込んでポインタを進める。アドレス整列不要。 + void Write16LE(uint32 data) { + Write8(data & 0xff); + Write8(data >> 8); + } + + // 文字列を書き込んでポインタを進める。 + // 書き込む文字列も終端の '\0' まで書く。 + void WriteString(const char *p) { + while (*p) { + Write8(*p++); + } + Write8('\0'); + } + private: uint8 *ptr {}; uint8 *start {};