How it works#
This page is for readers who want the formats: how the cartridge is laid out, how its little file system keeps a novel, every byte of a card, a text, the item file and the saved reading, how the player runs a novel, and how the text, the pictures, the sound and the memory-pack and Turbo File files are stored. Everything here was read from the program and checked in emulators (How this was checked). Where the study only inferred a meaning, or left it open, the page says so.
Addresses are the console's, bank and offset ($00:D800). The program runs its code in banks $00–$3F, the slow mirror of the ROM; the file offset of $bb:aaaa is bb × $8000 + aaaa − $8000. Offsets into a drive (the save, or a novel in the ROM) are written $0000–$FFFF, into a file or a record +0. Each section ends with the project's note and tools that hold the full detail; they are files in the project that made this guide, not pages of the site.
The cartridge#
SHVC-ZSNJ, maker code B1 (the header's B1ZSNJ at $00:FFB0); the title screen shows ©1996 ASCII CORPORATION and ©1996 SUCCESS, the developer. Inside:
- 3 MB of ROM, LoROM. The header's FastROM flag goes unused: every
JSLnames banks$00–$3F, and the reset jumps to$00:805E. The program reads its third megabyte as banks$80–$9F(file 0x200000 + (bank −$80) ×$8000). - 64 KB of battery SRAM, at
$70:0000–$7FFFand$71:0000–$7FFF: one drive of the program's file system (The drive). - A Satellaview memory-pack slot, read at banks
$C0and up as RT2 reads it, and through the second controller port a Turbo File Twin in its STF mode, with the STF driver all four Super Famicom Tsukuru cartridges carry (FAT0at$00:E72B).
The program is its own, not RT2's or Kanadeeru's: only 2–3 % of its bytes are in runs shared with either, most of them in the sound system. What it shares is listed at Compared with Sound Novel Tsukuru 2.
Notes/Sound Novel Tsukuru.md, Program.md.
The ROM#
| Banks | File | What |
|---|---|---|
$00 | 0x000000 | the core: start-up, interrupts, the frame wait, the picture loader, text drawing, the file system ($00:D75C–$00:E5B0), the flash-pack routines, the Turbo File driver |
$01 | 0x008000 | the main loop and the menus, the front end, the memory-pack and Turbo File pages |
$02 | 0x010000 | editor tabs, cards and files; the BGM and SE name lists ($02:EB39, $02:ED25); the sound steps' routines |
$03 | 0x018000 | editor tabs; the editor's two message tables ($03:B020, $03:B3EC); the ASCII mosaic logo ($03:E60E, packed) |
$04 | 0x020000 | the menus' maps, the Data page's windows, the run-length decoder ($04:EF63) |
$05 | 0x028000 | the power-on check and the format prompt, the opening, the Continue question, the name entry in play, an editor tab ($05:8000) |
$06 | 0x030000 | the 8 × 8 menu font ($06:809C) |
$07 | 0x038000 | interrupt handlers, the pack check, the menus' graphics ($07:808C), the window font ($07:B110) and the pack and Turbo File windows |
$08 | 0x040000 | the novel player: the step interpreter and the 29 step routines |
$09 | 0x048000 | an editor tab, play-side code, the effect and tempo name tables |
$0A | 0x050000 | not described by the study's map |
$0B | 0x058000 | drive 11: the staff roll, a novel of 40 files |
$0C–$0F | 0x060000 | the text font: 1,799 glyphs of 16 × 16 |
$10–$37 | 0x080000 | the pictures: 91, uncompressed, behind a directory at $10:8000 |
$38–$39 | 0x1C0000 | drive 1: sample part one |
$3A–$3B | 0x1D0000 | drive 2: sample part two |
$3C–$3E | 0x1E0000 | sound data: the samples' first part, the 60 songs ('SN'), the sample directory, tuning, instruments, vibrato, drum kit |
$3F | 0x1F8000 | the sound module (65816): its entry table, the queue, the effect scripts and their interpreter, the menus' sounds |
$80–$9F | 0x200000 | the third megabyte: the 'SP' container of 125 recordings; in the bank tails the sound driver ($80–$8B) and the samples' second part ($90–$99); the 'SA' container at $9F:C400 |
The third megabyte is one container. File 0x200000–0x2FFFFF is an RT2-style 'SP' container of 125 recorded sounds. RT2's container reader takes $7E00 bytes a bank and skips each bank's last 512, and the build used those skipped tails for fixed uploads: the sound driver sits in the tails of banks $80–$8B and the samples' second part in those of $90–$99 (The sound). Other tails hold pieces of RT2's sound data, left as the build tool's buffer held them (inferred).
The map comes from a code/data log of Mesen's: 63,939 bytes of code, 571 routine entries and 90 indirect jumps from 39 runs from power-on and from saved states on every page, and from which instructions read which bank. A Mesen log files memory-pack reads under ROM offsets past 0x200000, so its flags there are ignored.
Notes/Sound Novel Tsukuru/Program.md; Tools/snes_dis.py snt (the disassembler), Tools/snt_nav.py (keys from a saved state).
The program#
Start-up. The reset ($00:8000) sets native mode and the stack at $1F8F. A power-on clears the work RAM; a warm boot, when $006C holds PO (the program writes it once start-up is done), keeps it and skips the logo, the drive check and the opening, so RESET goes straight to the title. $00:E5B4 puts the interrupt vectors in RAM: the NMI and IRQ vectors point at $0074 and $0078, and each screen swaps in its own handler. Then the video, DMA and the sound start ($3F:FF01, the sound module's entry table), and $01:CE51 runs: the file system's start ($00:D96E) with drive 0 selected, the memory-pack check ($07:FB1E, RT2's flash detection $00:A35B), the logo and the drive check ($05:DB0C), the opening and the title ($05:E532). The title takes A, not START.
The main loop ($01:CECE) runs the main menu ($01:8020), which returns a choice in $0020; Data and Config are handled inside it. The choice indexes a table at $01:CEDF: 0 Game ($01:D0C7: drive 0, or the ROM drives 1 and 2), 1 Edit ($01:CF4F), 2 Turbo File ($01:EA4C), 3 Memory Pack ($01:D34B). There is no mode word as in RT2: each screen is a routine that runs its own loop and returns.
The editor dispatches on its current tab, $0FCF, through $01:CF79: tabs 1–6 go to $03:8000, $03:9A58, $02:8000, $09:8000, $02:9830 and $05:8000. Each returns a code in $0020; $0505 and $05A5 leave the editor.
Parameters pass in fixed direct-page words, $0020–$002E, with long pointers at $0040, $0044 and $0048; results come back in $0020. The most-called routines are the frame wait $00:C09C (134 callers), a menu sound $3F:FF82 (104), the string drawer $00:B776 (71) and the map copier $00:839F (32).
Notes/Sound Novel Tsukuru/Program.md.
The drive#
The program's file system names itself in the first bytes of every drive: ADV TUKOOL ROM/RAMDISK SYSTEM. A drive is 64 KB in 512 clusters of 128 bytes, cluster n at offset n × $80: a header, a directory, a table of clusters, the files' data, and outside it all the configuration. The SRAM is one drive, and so is each sample in the ROM.
$0040 to $FC7F; the last 896 bytes, where the save point and the settings write, are outside both, so playing never has to remake a sum.| Offset | Clusters | What |
|---|---|---|
$0000–$002F | 0 | the name: ADV TUKOOL ROM/RAMDISK SYSTEM S-RAM DRIVE (48 bytes; the ROM drives say S-RAM too) |
$0030–$003B | 0 | zero after a format; the ROM drives hold other bytes here, which nothing seen reads (a Turbo File copy uses three of these words, below) |
$003C | 0 | the data sum: the little-endian words of $0040–$FC7F, plus one |
$003E | 0 | the header sum: the words of $0000–$002F, plus one |
$0040–$1FFF | 0–$3F | the directory: 508 entries of 16 bytes |
$2000–$23FF | $40–$47 | the cluster table: one word for each of the 512 clusters |
$2400–$FC7F | $48–$1F8 | file data: 433 clusters, 55,424 bytes |
$FC80–$FFBF | $1F9–$1FF | outside both sums: the saved reading (below) |
$FFC0–$FFDF | outside both sums: $FFC0–$FFCF zeroed by a format, $FFD0–$FFDF never seen written | |
$FFE0–$FFFF | the configuration, from TS |
The directory and the cluster table#
The directory is 508 entries of 16 bytes from $0040:
| Bytes | What |
|---|---|
| +0–7 | the name: 8 bytes of the menu code (JIS X 0201 kana and ASCII, and the game's five one-byte voiced kana), padded with spaces: SC02ー01, 001Aー1, START. A first word of $0000 marks a free entry |
| +8–9 | the type, two ASCII digits: 01 a card, 02 a text, 03 the item file, 11 START and END |
| +10 | the first cluster |
| +12, +14 | the size in bytes, 32 bits as two words |
A file is found by its 10-byte key, name and type together ($00:DC9C, five word compares over every entry). A first word of $0000 marks a free entry: delete ($00:E0AC) and format clear only that word, so a deleted entry stays readable but for its first two characters. The lists ($00:DD1F) take every entry whose first word is not zero and whose type matches.
The cluster table has a word for each cluster: $FFFF reserved, $0000 free, a value with bit 15 set the end of a chain (the program writes $FF00), anything else the distance to the file's next cluster ($00:E180: next = this + word). The allocator takes the first free cluster, then the first free one after the last ($00:E112, $00:E141), so chains only run forward. Freeing a file zeroes its chain ($00:E1A5); the free count the editor shows is the number of $0000 words ($00:E0EC).
The two sums are each the sum of little-endian words plus one: the header sum over $0000–$002F at $003E, the data sum over $0040–$FC7F at $003C. The power-on check ($00:D800) returns 0 good, 1 header wrong, 2 data wrong; $00:D8F8 makes the data sum again after every write.
Format and free space#
The format ($00:DA00, drive 0 only, then $01:926C) writes the name, zeroes $0030–$003D, makes the header sum, zeroes the first word of each of the 508 entries, sets table words 0–$47 to $FFFF and $48–$1F8 to $0000, then writes 14 words of $FFFF from $70:23F2 for clusters $1F9–$1FF, and 7 of them past the table's end, over the first 14 bytes of cluster $48. That overrun is harmless: the cluster is free, and the first file written there overwrites it. Last come the data sum, $FD00–$FFCF zeroed and the configuration. Everything else on the drive is left as it was.
The editor's first files. Opening the editor on an empty drive makes ITEMFILE (720 bytes, clusters $48–$4D), END ($4E) and START ($4F), and a text at $50 that it deletes again at once: 8 clusters, so the free count goes from 433 to 425.
The drives the program knows#
A table at $00:D75C holds eight drives of 8 bytes each (a 24-bit pointer, padding, a type word); the current one is $0C0F.
| Drive | Where | Type | What |
|---|---|---|---|
| 0 | SRAM $70:0000–$71:7FFF | 0 | the cartridge's novel; the only drive the format writes |
| 1 | ROM $38:8000, file 0x1C0000 | 1 | sample part one: 267 files, 419 clusters used, 13 free |
| 2 | ROM $3A:8000, file 0x1D0000 | 1 | sample part two: 256 files, 431 used, 1 free |
| 3–7 | pack $C1:8000, $C5, $C9, $CD, $D1 | 2 | the memory pack's blocks 0–4, each from the block's second bank, when the block is marked as a novel |
| 11 | ROM $0B:8000, file 0x58000 | (set by the opening) | the staff roll: 40 files; its data sum runs on into the font and doesn't match, and it plays all the same |
Both ROM drives carry the SRAM's header, S-RAM DRIVE included, and pass the same sums. Their slots 316–507 are not entries: the same bytes on both, left by the tool that built them, which no type matches. The deleted entries below slot 316 look like the samples' own history, files removed while they were written (inferred). The cartridge's own save passes the check and holds no novel.
Notes/Sound Novel Tsukuru/Disk.md, Save.md; Tools/snt_disk.py (list, check, extract, format, build: the format and every save the study made rebuild byte for byte).
The novel's files#
A novel is four kinds of file on a drive:
| Type | What | Part one | Part two |
|---|---|---|---|
01 | cards: lists of steps | 46 files, 4,426 bytes | 25, 4,799 |
02 | texts | 218, 32,082 | 228, 36,234 |
03 | ITEMFILE, the items | 1, 744 | 1, 744 |
11 | START (16 bytes) and END (6) | 2, 22 | 2, 22 |
Cards and steps#
A card is a word, the number of steps; a word, the card's type for the editor's list (0 NORMAL, 4 a two-way text choice, 8 a three-way one, + 32 when one of its cards is END, 1 an Item Branch 2; END itself is 1); then the steps; then $FFFF. The type is set when a branch step is added, and nothing in play reads it (inferred: the interpreter takes only the steps).
A step begins with a word whose low byte is an argument and whose high byte is the op, group × 16 + command; the step's fields follow. The interpreter ($08:D3F1) keeps the argument at $1C1C, dispatches on the group through $08:D477, then on the command through each group's own table.
The 29 ops. The editor's 30 commands map onto 29 ops: the two text choices are one op (the argument gives the count), as are the two item branches and the two Choice to Item commands; Set Graphic and Clear Graphic are two ops each (background, or frame and silhouette); and Set Item is $20 or $21 by the item's type. Groups 8–14 go to $08:E5CA, error 1.
| Op | Script | Bytes | Command | The argument and the fields | Routine |
|---|---|---|---|---|---|
$00 | text_area | 6 | Text Area | four bytes: left, top, right, bottom | $08:D4CC |
$01 | text | 10 | Show Text | a text's name; the argument's low nibble is the colour (0–7) | $08:D509 |
$02 | text_clear | 2 | Clear Text | $08:D5B2 | |
$03 | text_pos | 4 | Text Position | column, row | $08:D5BF |
$04 | newline | 2 | New Line | $08:D5E4 | |
$05 | text_speed | 2 | Text Speed | the argument, one less than the speed shown | $08:D611 |
$06 | key_wait | 2 | Wait for Key | $08:D623 | |
$10 | fade_colour | 2 | Fade Colour | the argument: the colour (0 black … 7 white) | $08:D696 |
$11 | fade_in | 2 | Fade In | $08:D6AC | |
$12 | fade_out | 2 | Fade Out | $08:D6CF | |
$13 | background | 4 | Set Graphic: background | a picture word; the argument is the colour variant, 0–5 for A–F | $08:D6F2 |
$14 | background_clear | 2 | Clear Graphic: background | $08:D781 | |
$15 | sprite | 4 | Set Graphic: window frame, silhouette | a picture word; the argument is the colour variant | $08:D7B6 |
$16 | sprite_clear | 2 | Clear Graphic: window frame, silhouette | $08:D824 | |
$17 | colour_change | 2 | Background Colour | the argument's low nibble the colour, $F the picture's own | $08:D853 |
$18 | bg_effect | 2 | Background Effect | the argument's high nibble the effect, its low nibble the setting | $08:D871 |
$19 | staging | 2 | Staging | the same split | $08:D8BC |
$20 | item_set | 14 | Set Item (Yes/No, Number) | an item's name and two value words, copied over the item's first two if the types match (else error 3); 1001 0000 Yes, 1000 0000 No; for a number 2000 + the operator (0 −, 1 =, 2 +) and the number. The copy ignores the operator | $08:D916 |
$21 | item_input | 10 | Set Item (Name) | an item's name: in play, the name entry opens on its value and writes back what the reader types | $08:D972 |
$22 | item_show | 10 | Show Item | an item's name; the argument picks a Yes/No item's wording, 0 アリ/ナシ, 1 オン/オフ | $08:DAB5 |
$30 | text_branch | 12 + 8n | Two-way / Three-way Choice | n in the argument's low 2 bits; two colour bytes (base, chosen); the choice text's name; n card names | $08:DD46 |
$31 | item_branch | 2 + 20n | Item Branch / Item Branch 2 | n conditions, each an item's name, two words and a card: 1000 or 1001 and 0000 for Yes/No; 2000 + the comparison (0 less, 1 equal, 2 more) and the number | $08:DDD2 |
$32 | text_item_choice | 12 + 12n | Two-way / Three-way Choice to Item | n, the two colours, the choice text, then for each choice an item's name and its value words, as $20 | $08:DE0E |
$40 | jump | 10 | Jump | a card's name (END is looked up as type 11) | $08:E22E |
$50 | wait | 4 | Wait | seconds, a word (× 60 for frames) | $08:E34E |
$60 | bgm | 3 | Start BGM | the argument: the tempo (high nibble) and fade-in (low nibble 1); then a byte, the song (60 and up a memory pack's) | $08:E38D |
$61 | bgm_stop | 2 | Stop BGM | 0 at once, 1 fade out | $08:E44A |
$62 | se | 2 | Start SE | the argument: the effect, its number in the SE list | $08:E46B |
$63 | se_stop | 2 | Stop SE | $08:E59E | |
$70 | save_point | 2 | Save Point | writes the reading, not in a test | $08:E5B2 |
$FF | (the end) | 2 | the card's end | $08:E5BE |
Neither sample uses $21 or $32; both were made in the editor, saved and read back. The colours in the argument of $01 and in the two bytes of $30 and $32 run white, red, orange, yellow, green, blue, purple, black (0–7); the fade colours of $10 run black, blue, red, yellow, green, purple, orange, white, in the editor's order.
Texts#
A text is little-endian words, each a character code, an index into the text font (Text and fonts), ended by $FFFF. Three controls are words of their own:
| Word | In a script | What |
|---|---|---|
$FFFC | {k} | wait for a key, ♡ on screen (the same wait as the Wait for Key step) |
$FFFE | {n} | a new line |
$FFFD | {p} | a new page: the text window cleared, as by the Clear Text step |
$FFFF | the text's end |
A choice text is a text like any other, shown by a branch step: its first line is the question, each further line a choice. The player labels them with the glyphs A. B. C. ($6EE–$6F0) and lays them out itself ($08:DF12: the question wrapped at 14 characters, a blank line, each choice wrapped at 12, 12 lines and $401 bytes at most, else error 4). Ruby is not a feature: the sample's ニンフ over 妖精 is a text of its own put above the line with a Text Position step.
START and END#
START(type11, 16 bytes): four zero bytes, a jump step to the first card (00 40and the card's name), and the stamp, a word the editor adds one to each time it writesSTART($02:E083; a fresh drive's00 00becomes01 00). Part one's is1B 30, after the nameSC02ー01; the staff roll's is$0024. The saved reading keeps the start card's name and the stamp, and continues only on a drive whoseSTARTmatches (The saved reading).END(type11, 6 bytes):00 00 01 00 FF FF, a card with no steps and type 1. A jump toEND($08:E318looks a card up as type01, or11forEND) ends the novel: the main menu returns.
The item file#
ITEMFILE (type 03) is records of 24 bytes: an 8-byte name, in the directory's code, and 16 bytes of value. A name whose first word is zero is a deleted record. The editor makes 30 records (720 bytes); both samples have 31 (744). The value's first word carries the type in its top nibble:
| Top nibble | Type | The value |
|---|---|---|
| 1 | Yes/No アリ/ナシ | the flag in bit 0: $1000 No, $1001 Yes; the words after it are left from earlier values |
| 2 | Number スウチ | the number in the second word, sign and magnitude (bit 15 the minus): 2000 3039 is 12345 |
| 0 | Name ネーム | up to eight character codes of the text font, the first of them the first word: 0066 0081 0059 is タロウ |
| 3, 4 | none | 3 stops the editor with FATAL ERROR, 4 lists garbage |
The editor lists records only up to the first empty one, and stops with FATAL ERROR on type 3. In play the item steps work on a copy at $7F:FC00 (30 records, found by name by $08:DC38); a name not found is error 2, a type that doesn't match error 3. Set Item copies its two value words over the item's first two if the type nibbles match, whatever the operator ($08:D916), which is the bug on Limits. Part two's items 000–004 hold its title for Show Item, and its スペシャル02–15 the special thanks the staff roll shows (Behind the scenes).
A novel as a script#
The study's snt_novel.py writes a drive as a script and builds a save from one; every file of both samples, the staff roll and every save the runs made comes back byte for byte. A step is its name from the table above, the argument in hex, then its fields (names in brackets):
start [OPEN] 00 0000
card [OPEN] 4
background 00 0030
fade_in 00
bgm 11 0D
text 00 [T1]
text_branch 02 00 01 [Q] [LEFT] [RIGHT]
card [END] 1 11
items 30
text [Q] どちらへ行きますか?{n}左の道{n}右の道
A novel written so, built into a save, plays in the game: the guide's own example novel for the screenshots was made that way.
Notes/Sound Novel Tsukuru/Novel Format.md; Tools/snt_novel.py (dump, check, build).
The save slot#
A save point writes one reading, for the whole cartridge, into the drive's last bytes, outside both sums ($08:E5B2 → $08:ED75); in a test ($1CAC ≠ 0) it does nothing.
| Offset | What |
|---|---|
$FC80–$FF7F | the items as they stand: the 30 records of 24 bytes the player keeps at $7F:FC00 |
$FF80 | VS |
$FF82 | the word sum of $FF84–$FFCF |
$FF84–$FF92 | the display state, among it the text window's area (00 00 0D 0B by default; inferred from the values) |
$FF94–$FFA5 | the steps that set what is on screen and playing: the background step and its picture, the frame or silhouette, the effects, the BGM step and its song, the endless effect ($FFFF none) |
$FFA6–$FFAF | START's bytes 6–15: the start card's name and the stamp |
$FFB0–$FFB7 | the card the reading is in (the last one jumped to) |
$FFB8, $FFBA | the step after the save point: a pointer into the card's copy at $7F:0000 |
$FFBC, $FFBE | two more words of state ($0B7B, $0B7D) |
Continuing ($05:D27B, $08:EEDE): when a game starts, the slot must hold VS, its ten bytes must match the drive's START (the start card's name and the stamp), and its sum must be right. Then the game offers 最初から始める / 続きから始める (a glyph box at $05:D371), and Continue ($08:EF7F) loads the card, restores the items, the background with its colour variant, the frame or silhouette, the effects, the music and an endless effect, and goes on from the step after the save point. A drive identical but for the stamp starts from the beginning, the reading left in place. The save point was checked in Mesen and in bsnes, with the same bytes written by both.
The configuration is the 32 bytes from $FFE0: TS, then the settings, written by $01:926C (a fresh one is TS 03 01 03 00 00 00 00 01 and zeros). Byte $FFE9 bit 1 is the pack sound, and the chosen file's title follows at $FFEA; the power-on pack check writes $FFE3 and $FFE9. Config's and the editor's System settings live here too; which byte holds each was not mapped.
Notes/Sound Novel Tsukuru/Play.md, Second Emulator.md.
The player#
The novel player is bank $08. Starting a game selects a drive and runs START's jump. The card loader ($08:E320) finds the card by name, copies it to $7F:0000, and in a test checks it against the stopper ($1C0A). The interpreter ($08:D3F1) then reads step after step; the current card's name is kept at $1CA2, the step pointer at $0058, and the steps that set what is on screen and playing (the background, the frame or silhouette, the effects, the BGM, an endless effect) at $1C90–$1CA0, which is what a save point copies.
The reader has one button because the player reads the pad in two places only: the key wait ($08:E5D9, a 120-frame state with ♡ on screen) and the choice ($08:E6EF–$08:E727). The text drawer reads none, so nothing can skip or speed up the text.
Errors ($08:ECE6) show one of seven messages from the editor's message table at $03:B020, then end the play (the main menu, or the editor in a test). The list is on Limits. A game with no START stops earlier, at $05:D253.
The test menu (X, $05:DDD1) opens unless a background effect or a staging effect is running ($1CB0, $1CB2).
The staff roll is a novel too. The opening and the staff roll ($05:E57B) point the drive at file 0x58000 (bank $0B), drive 11, and run the same player on its 40 files: cards オープニング and ア–カ, 30 texts, and an item file of five test items the script never uses (Behind the scenes).
Notes/Sound Novel Tsukuru/Play.md, Novel Format.md, Hidden Content.md.
Text and fonts#
The program has two text codes and three fonts.
The text font is 1,799 glyphs of 16 × 16 at $0C:8000 (file 0x60000–0x7C1BF), glyph n at + n × $40, four 2bpp tiles each (colour 2 the stroke, 1 its shadow), copied to video memory by the DMA queue at $00:BF3E. A novel's texts are words of this code.
| Codes | What |
|---|---|
$000 | the space (full width) |
$001–$056 | hiragana: the 46 in あいうえお order, the voiced and half-voiced ones, ゐ ゑ ー 、 。, then the small ones |
$057–$0AB | katakana, in the same order, with ヴ and ヵ |
$0AC–$0EF | symbols: & * @ … ♪ ± × ÷ =, shapes, 「」『』【】, ≠ |
$0F0–$12D | the digits, then the full-width Latin letters |
$12E–$563 | 1,035 kanji in reading order, a selection of the 常用漢字表 in its order, with 43 shaded heading glyphs among them, one before each reading: they open each reading's group on the text editor's keyboard, and never appear in a text |
$564, $565 | ↵, and the editor's end-of-text mark |
$566–$585 | Ⅰ–Ⅹ, 壱 弐 参 四 … 九 零, ( ), ~, ”, the eight arrows |
$586–$5B6 | extra kanji for horror stories: 超 鬼 闇 怨 呪 魔 謎 妖 霊 … |
$5B7–$5BA | ・ … ♡ 々 |
$5BB–$6BF | more extra kanji, in reading order |
$6C0–$706 | additions: kanji for names (秦 … 篤), /, the choice labels A. B. C. ($6EE–$6F0), ~, 〝, and 17 more kanji (敦 … 烈) |
21 characters have two glyphs (( ) ← → ~, seven kanji numerals and nine kanji drawn again later); a text takes the first. 49 codes have no character: the 43 headings, the end mark and five marks never seen in use. The table was made by matching every glyph against the same characters drawn in four Windows fonts and aligning the main kanji block, by dynamic programming, against the 常用漢字表 in its order; every sheet of 256 was then looked over, and all 446 sample texts decode to plain Japanese.

The menu code is a byte a character, for everything the menus and editors write, and for the names of a drive's files. A table of 256 tilemap words at $00:B936 (and a highlighted copy at $00:BB36) gives each byte its tile in an 8 × 8 menu font at $06:809C; the string drawer $00:B776 writes the words into a copy of the BG3 map at $7E:E800. It has ASCII digits and capitals, the JIS X 0201 kana and marks, and 17 characters of the game's own at $80–$90: 分 岐 作 成 上 下 移 元 行 太 小 同, the kanji of the editor's labels, and the five voiced kana ド ベ ジ バ ゲ in one byte each. The name grid writes those five as single bytes, which is why 30 of part two's names begin with the byte $88: ドア1 … ドアCLOSE. The long-vowel mark ー shows the tile of -.

Ready-made windows. The Turbo File and memory-pack messages, the Data page's questions and a few pickers are not strings but finished BG3 tilemaps (a width, a height, then the words, frame included): 37 of them, at $04:9C46–$04:A0BE and $07:C110–$07:E462. They use a second 8 × 8 font, the window font at $07:B110, the menu font with its last tiles changed: ゛ and ゜ drawn small at the foot of a cell, to sit on the row above the kana they voice, and 、 。. The big headings of the main menu and its pages (ゲーム, サンプルロード …) are none of these: they are 4bpp pictures on BG1.
The power-on lines and the Continue question are glyph boxes in the text font (a width, a row count, then glyph words), drawn by $00:CEE5.
Notes/Sound Novel Tsukuru/Text.md; Tools/snt_charset.txt (every glyph code), Tools/snt_text.py (fonts, menu, strings: 1,298 strings dumped, 93 of 95 read off the screens found).
The pictures#
91 pictures, uncompressed, at file 0x805C0–0x1BB7A2 (banks $10–$37), behind a directory at $10:8000 of 16-byte records ended by $FFFF: the picture's number (the word a step holds), its type (0 background, 1 window frame, 2 silhouette), an offset from $10:8000, and its name in the menu code. Numbers run $00–$41 for the 61 backgrounds, $64–$65 for the frames and $66–$81 for the 28 silhouettes; five are missing from the run ($10, $29, $2E, $31, $40), and a scan of the ROM for the header's fixed words finds exactly these 91, so nothing is hidden.
| Offset | What |
|---|---|
| +0 | the picture's number again (a frame's with $4000 set) |
| +2, +4, +6 | offsets from the picture's start to the palette ($10), the tilemap ($210) and the tiles ($914): the same in all 91 |
| +8 | its name again, 8 bytes |
+$10 | the palette: 256 colours, of which 192 are used: six colour variants of 32 colours (two sub-palettes) each |
+$210 | the tilemap: a width (32), a height (28), then 32 × 28 words |
+$914 | the tiles: their byte count, then 4bpp tiles, as many as the map uses (1 for the flat colour ベタ, up to 879 for ハナ) |
Loading ($00:84BB walks the directory, $00:84E5 turns the offset into an address): the tiles go through the DMA queue in $1000-byte pieces, to tile $90 of its layer for a background and to tile 0 for the others; the map through $00:839F; and $00:862B takes the variant's 64 bytes at +$10 + variant × 64 into palette 2 (a background) or palette 4 (a frame or silhouette). A background's map numbers its tiles from $90 and uses palettes 2 and 3; the others' from 0 with palette 4.
The six colour variants are the steps' argument, A–F: a background in full colour, a darker night version, sepia, red, grey and negative; a silhouette in navy, green, olive, red, grey and light grey (The pictures).
A silhouette is light, not paint. The background is on BG2 and the frame or silhouette on BG1, and colour math adds BG2 to BG1, unhalved ($2130/$2131): the silhouette is the background lit by its colour, so the house shows through the figure. Checked to the pixel: a screen drawn from the ROM alone matches Mesen's frame in all 54,774 pixels outside the text.

The editor dims its wallpaper: the same picture, with each colour channel passed through a fixed table, about 5/8 (the routine was not traced).
The menus' own graphics are raw too: tiles at $07:808C, palettes from $07:8008, maps in bank $04. A run-length code, unpacked by $04:EF63, packs eight blocks of maps loaded just before the title, among them the ASCII mosaic logo at $03:E60E (6,469 bytes, Kanadeeru's byte for byte):
| Code | What |
|---|---|
01 n b | n copies of the byte b |
02 n w | n copies of the word w |
FE n and n bytes | the bytes as they are |
c n and c bytes (any other c) | the c bytes, n times |
FF | the end |
Notes/Sound Novel Tsukuru/Graphics.md; Tools/snt_gfx.py (list, draw, check against Mesen's video memory: tiles byte for byte, maps word for word, palettes the variant named).
The sound#
The music is RT2's sound system: its 44 samples, 48 instruments, 36-drum kit, vibrato and tuning byte for byte, its song format, and a later build of its driver. That build adds what RT2's music never used: recorded sound. Every one of the 256 sound effects is a short script the 65816 runs each frame, which either streams one of 125 recordings into a ring buffer on voice 7, or uploads one of 28 small synthesised effects.
The sound chip's memory#
The start-up ($3F:DDAF) takes a base bank, its own bank − 3 = $3C, and loads these, each checked against the sound chip's memory in play:
| From | Bytes | To | What | Against RT2 |
|---|---|---|---|---|
$3C:8000, a whole bank | $8000 | $2000 | the samples, first part | the same |
the last 512 bytes of banks $90–$99 | $12FD | $A000 | the samples, the rest | the same |
$3D:FE00 | $B0 | $1F00 | the sample directory | the same, 4 bytes repointed in play (sample 1, the stream) |
$3D:FEC0 | $58 | $1EA0 | the samples' tuning | the same |
$3D:FF20 | $C0 | $1CC0 | 48 instruments | the same |
$3E:FE00 | $40 | $1FC0 | 16 vibrato presets | the same |
$3E:FE40 | $120 | $1D80 | the 36-drum kit | the same |
the last 512 bytes of banks $80–$8B | $16E0 | $05E0 | the driver | a later build |
The containers are RT2's: 'S', a letter, a count, then 3-byte offsets, reading $7E00 bytes a bank.
| Container | Where | Entries | What |
|---|---|---|---|
'SN' | $3D:8000 | 60 | the songs, one per BGM number |
'SE' | $3F:C8EE | 1 | one block of 5 effects, uploaded to $B300: the menus' sounds |
| (no tag) | $3F:C989 | 256 | the effect scripts, as offsets from $3F:C989 |
'SP' | $80:8000 | 125 | the recordings, streamed |
'SA' | $9F:C400 | 28 | the uploaded effects |
From a step to the speaker#
The sound module (bank $3F) is rewritten around RT2's: a jump table of 79 entries at $3F:FF01, as in RT2 and Kanadeeru, but only some 1,600 bytes in runs shared with Kanadeeru's and 1,350 with RT2's. A call puts a command and a parameter in a queue of 16 ($1FC0); the frame service $3F:E28E, from the NMI, sends it. Commands $80 and up go to the driver as they are; those below are the module's own:
| Command | Does |
|---|---|
00 n | load ROM song n (the 'SN' entry, to the sound chip's $D000) and start it |
02 n | load song n of a memory pack's 'SN' container (its pointer set by $3F:FF1C) |
04 n, 06 n, 08 n | with the effect voice reset: play recording n, a memory pack's recording n, uploaded effect n |
0A n | play effect n of the SE list: start its script |
0C | stop the effect |
0E, 10 | pause, resume: the music, the stream and the script together |
12, 14 | stop everything; stop the stream |
The steps. Start BGM ($08:E38D → $02:EA21): the step's argument is the tempo in its high nibble, an index into $02:EA62 (150, 100, 200, 60, 240) sent as C5, the driver's tempo divisor, so the song plays at ×1, ×1.5, ×0.75, ×2.5 or ×0.625; its low nibble 1 sends F6, a fade-in. The byte after is the song: below 60 command 00, from 60 a memory pack's song, 60 less (command 02), if the pack's songs were found at power-on. Stop BGM sends EB (at once) or F8 (fade out). Start SE sends 0A with the SE list's number, $00–$FF; Stop SE sends 0C. The menus' five sounds go through $3F:FF82 (FE n): 0 the cursor, 1 A, 3 B, 2 a thing done or a button ignored, 4 a refusal.
The BGM step's two bytes are kept at $1C9C/$1C9E, and the effect at $1CA0 when the table at $08:E49E flags it as continuing (the 87 endless effects and four long runs of footsteps), else $FFFF: that is what a save point keeps, so a continued reading restarts its music and its endless sound.
The driver#
A later build of RT2's driver, at the same place ($05E0, at most $16E0 bytes), reassembled around new variables: one tick per ED, once a frame; 17 channels (0–7 the music, 8–15 the effects, $10 the conductor); one table at $18D6 of the port commands FF down to C4, then the song events C0–F6. There is no play-time counter as in RT2.
- Song events: RT2's 54, with the same operands (every song parses with RT2's reader), and three more: E4 / E5 clear and set a flag under which the right side's volume is inverted, a phase-inverted "surround" (4 uses in the songs), and F6, which resets a channel's volume and pan (the first event of every effect track).
- Port commands: RT2's from FF down (sound effect, mono and stereo, stop, pause, fades, reports; RT2's test-note commands now do nothing), and C4–D4, new, all for the effect voice: voice 7, which an effect takes from the music's track 7 and gives back.
| Command | Does |
|---|---|
DC p | start a stream: take voice 7, at pitch p |
C4 | point sample 1 at the ring |
D9 | BRR blocks from the ports into the ring, $B400–$BFFC (341 blocks of 9 bytes) |
DB | key on voice 7: sample 1, ADSR $8F $E0 |
DA | mark the ring's last block as the end, and loop |
D8 | give voice 7 back to the music |
C6 | key off voice 7 and end the ring at its current block |
D3 | start the uploaded effect at $B400 |
D4 | key off voice 7 |
C8 | stop every effect channel that is sounding |
CA p, D1 v, D2 v, C9 w | the effect voice's pan, its two volume bytes, a word |
CB, CC m | clear, set bits of the effect flags |
CF, D0, C7; CD v, CE s | the effect voice's own fade, beside the music's: in, out, off; its level; its two speeds |
C5 n | the tempo divisor (150 at the start): the Start BGM step's tempo goes here |
The effects#
Each of the 256 effects is a script at $3F:C989 + its offset, run by $3F:EA66 one opcode after another until one waits: even opcode bytes through a table at $3F:EABB, little-endian words, jumps relative to the next opcode.
| Op | Does |
|---|---|
00, 02 | nothing; the end |
04 n; 36 a m | play recording n; recording a + (random & m) |
06 n; 38 a m | the same from a memory pack's 'SP' (no script in the ROM uses them) |
3C n | upload effect n of 'SA' and start it |
34 | end when the stream has played out |
28 w; 42 w m | wait w frames; w + (random & m) |
2A r; 3E r; 40 | jump; call (one deep); return |
2C n; 44 a m; 2E r | set a count; a random one; loop back while it lasts |
32 x; 3A a m | the stream's rate index + x (signed); + a random amount |
30 w | start the next stream from block w |
0A–26, 46–4A | the effect voice's port commands: pan (4 settings), level, volumes, flags, fades, stream off, effects off |
Almost every script first calls a shared preamble (+$200): C6, a frame's wait, uploaded effect 22 (a lone F6 and a rest, which clears voice 7), and the default pan, volume and fade. Then it plays its sound: 230 effects stream a recording, 26 upload an effect. Some use the random ops for variety: *ライメイA picks one of two thunderclaps at a random rate, *セミ (cicadas) chirps a random number of times between pauses. Of the 87 endless effects, 51 loop in their script and 36 through their sound. One recording, 104, is played by no script.
- The recordings (
'SP'): 125 sounds, 1.01 MB, 169 seconds in all, the whole third megabyte. An entry is a 3-byte length, a byte whose bit 7 makes it loop and whose low nibble is a rate index (0 meaning 16), a 3-byte loop offset, then the BRR blocks. Index 12 is 11,211 Hz (112 of them); nine are at 9,336, one at 8,406, three at 7,469; 11 loop; the longest is 7.2 s, カミナリ's. The 65816 feeds a stream to the driver block by block each frame (D9) into the ring at$B400–$BFFC, 341 blocks of 9 bytes, which voice 7 plays as sample 1. - The uploaded effects (
'SA'): 28 small sequenced effects, each one RT2-style effect block uploaded whole to$B400and started with D3. Its one track plays a waveform carried in the block, a single looping BRR block of 16 samples for most: a synthesiser's oscillator. Four play noise and two are silent (22, the preamble's, and 27). They make the electronic sounds: wind *カゼA–C, buzzers, the telephone and its tones, the alarm clock, the sirens. - The menus' sounds (
'SE'): one block of 147 bytes at$B300, five RT2-format effects on voice 6, each a few notes on the sine sample 18.
The 60 songs are RT2-format songs of one subsong each, a tempo in beats a minute, up to eight tracks and a conductor: 14,954 notes, 46 that loop and 14 that end (the jingles). カゼ A–C and アメ A–C are wind and rain made with the music's own instruments (Music and sound). Every song was ripped to an .spc and played against the game: at equal ticks, every track's read pointer is the game's.
Notes/Sound Novel Tsukuru/Sound.md; Tools/snt_sound.py (uploads, list, song, se, check, wav, rip), Tools/snes_spc.py --patch snt.
The memory pack and Turbo File files#
The memory pack#
The pack is RT2's: eight blocks of 128 KB, block b at banks $C0 + 4b to $C0 + 4b + 3, a Satellaview header at +$7FB0 of the block. The flash routines are RT2's too (detection $00:A35B, the byte writer $00:A722). A save is one block ($00:A8DC and the routines before it), in the first free one; the slot's number names the file and nothing else:
| Offset in the block | What |
|---|---|
+$0000 | ADSV, four zeros, ASCII TCOOL MEMP (24 bytes) |
+$0018–$7DFF | $FF |
+$7E00 | a boot stub, $126 bytes of 65816 code that copies a routine to $7F:0000 and jumps there, as RT2's and Kanadeeru's files carry |
+$7FB0 | the Satellaview header and vectors (80 bytes): maker 0, the title, the block mask, the date 10 08, map $20, type $A0, $33, version 2, the sum and its complement |
+$7FC0 | the title: the slot's name, SOUND NOVEL n, padded to 16 |
+$7FD0 | the block mask, 1 << b |
+$7FDC, +$7FDE | the sum's complement and the sum: 16 bits of every byte of the block but +$7FB0–$7FDF |
+$8000–$17C7F | the drive's first $FC80 bytes, byte for byte: header, directory, cluster table, every cluster. Not the reading or the configuration |
| the rest | $FF |
Load copies the $FC80 bytes back over SRAM $0000–$FC7F; the configuration and the saved reading stay the cartridge's. Delete erases the block's first 64 KB (the flash's erase size): the marks, the stub, the header and the drive's first half become $FF, and the second half is left.
What the program reads at power-on ($00:D8AF): the first word of each block. A block whose first four bytes are a novel's mark becomes a drive of its own, from the block's second bank (drives 3–7 are the first five blocks, so at most five, inferred from the table), and its type goes to $0C21:
| First bytes | Kind | What the program does with it |
|---|---|---|
ADSV | — | the program's own save: listed by the Memory Pack page; not a drive |
ADDM | 1 | a novel on the pack: a drive, listed by Game → Sample Game and by Sample Load (checked with a save whose mark was changed and its sum made again) |
ADRD | 2 | a novel to read only: a drive, listed by Sample Game, not by Sample Load (checked the same way) |
TC | 4 | a drive, which no page lists: what it would hold is open |
MTTC | — | Kanadeeru's songs (its Convert file): listed by Data → Memory Pack Sound by its title |
The list builder $01:8F18 has three modes: 0 the ROM samples and kinds 1 and 2 (Game → Sample Game), 1 the samples and kind 1 (Sample Load), 2 kind 4 alone, which only $01:8EF2 asks for, and nothing calls that. The pack sound: choosing an MTTC file stores 3 at $FFE9 and its title at $FFEA; at power-on $01:9210 finds the block again and sets the sound module's pack pointer ($3F:FF1C) to its 'SN' container at $C0 + 4b:8018, keeping the song count in $0C5D. Command 02 n then loads song n exactly as Kanadeeru wrote it, and nothing past the count.
The Turbo File Twin#
The STF driver and its file table are the ones all four Super Famicom Tsukuru cartridges share: 124 blocks of 1 KB after a 4 KB table, FAT0 at its end. The file header template is at $01:FE40. The game code in the file is ADTK, not the cartridge's ZSNJ, as its pack files start AD.
| Part | What |
|---|---|
| the header, 24 bytes | SHVC, ADTK, and the slot's name, SOUND NOVEL 1–3 padded to 16 |
| the drive | from $0000 up to the end of its last used cluster ($F580 for sample part one), the last 1 KB block filled with the SRAM's next bytes |
the drive header's $30 | in this copy only (0 on the cartridge): the end of the copy ($F580 for the sample) |
$32 | the blocks the page asks for: 63 for the sample, whose file takes 62 (an empty drive asks 10) |
$3A | the word sum of $0040 up to the end, which the load checks |
| the size | 10 blocks for an empty drive, 62 for sample part one, 64 for a full drive |
Load ($00:DBF1) reads the file into $7F:0000 and checks the word sum from $0040 to the end at $30 against $3A; if it fails, nothing is copied. Then $0000–$23FF (the header, the directory and the cluster table) goes into SRAM, then each cluster the table marks used, 128 bytes at a time ($00:DC81), and the drive's sums are made again. Free clusters keep whatever the cartridge had, and the reading and the configuration are never touched. The format writes $FF over the table area $000–$FFB and FAT0, and leaves the blocks, as Super Dante's and Kanadeeru's do; Delete sets the file's table entries to $FFFFFFFF and leaves its blocks.
Notes/Sound Novel Tsukuru/Storage.md, Notes/Turbo File.md; Tools/snes_mempack.py snt, Tools/snes_turbofile.py snt (each writes the game's file byte for byte from a drive, and srm gives a drive back).
How this was checked#
Every format on this page was written back as well as read, so that a reading that was nearly right would show:
| Format | Written back by | Checked against |
|---|---|---|
| The drive and its format | snt_disk.py | the format's result on four images; both ROM drives and all 131 saves the runs made, deleted and rewritten file by file as the game does, byte for byte; sample part one built into a save plays as User Game, page for page with the ROM's |
| The novel's files | snt_novel.py | every file of both samples and the staff roll, and the editor's saves, back byte for byte; a novel written as a script plays (a picture, music, text, a choice, two cards, the end), and each step command was made in the editor, saved and read back |
| The saved reading | snt_novel.py build saves | a save point written, then continued, in Mesen and in bsnes: the same bytes in both |
| The text font | snt_charset.txt | all 446 sample texts decode to plain Japanese; 93 of 95 strings read off the screens are found in the dump (the other two are slips of the check) |
| The pictures | snt_gfx.py | Mesen's video memory on five screens: tiles byte for byte, maps word for word, palettes the variant named; the frame buffer to the pixel outside the text |
| The sound | snt_sound.py | every upload against the sound chip's memory; all 60 songs ripped and played against the game, the track pointers the same at equal ticks; a recording and an uploaded effect caught playing on voice 7 |
| The memory pack | snes_mempack.py snt | save, a second save, load, delete in Mesen; the tool's blocks byte for byte as the game wrote them; a pack novel and a pack song played |
| The Turbo File | snes_turbofile.py snt | format, save, load, delete in MesenCE; the tool's file table and blocks byte for byte as the game wrote them |
- The emulators. Mesen 2.1.1, run headless by a script (saved states, pad scripts, memory dumps, screenshots from the frame buffer); MesenCE, a fork of it with the Turbo File Twin; and bsnes 115.1 through its libretro core. The two agree: a sample to its save point, a tool-built novel saved and continued, and a 12-line choice each left the same SRAM in both, but for two configuration bytes the power-on pack check writes (Mesen gives the cartridge an erased pack, bsnes none), and the same screens once a page is drawn. bsnes's memory-pack slot takes no writes and it has no Turbo File, so those ran in Mesen and MesenCE only.
- Not checked, for want of a file or the hardware: a pack's own recordings (script ops 06 and 38; no pack with an
'SP'container is known), what aTCblock holds, and the pack save's boot stub in a BS-X.
The project's tools that read or write these formats:
| Tool | What it does |
|---|---|
snt_disk.py | a drive's files: list, check, extract, format, build a save from files |
snt_novel.py | a novel as a script and back: dump, check, build (also the staff roll, --drive 11) |
snt_text.py, snt_charset.txt | the fonts drawn, a menu string decoded, every string dumped; every glyph code |
snt_gfx.py | the 91 pictures listed, drawn and checked |
snt_sound.py | the uploads, a song's events, an effect's script, the recordings as WAV, the songs as .spc |
snes_mempack.py snt, snes_turbofile.py snt | a drive as the game's pack or Turbo File file, and back |
snes_dis.py snt, snt_nav.py, mesen.py, lr.py | the disassembler; keys from saved states; Mesen run headless; bsnes through libretro |
Notes/Sound Novel Tsukuru/Analysis Plan.md, Second Emulator.md.
Fan-made reference material, one of the Eschaton Games Tsukuru guides. Not affiliated with the publishers of the titles it covers. Corrections and questions: contact@eschaton.games.