Eschaton GamesRPG Tsukuru 2 an English guide

How it works#

This page is for readers who want the internals: how the cartridge is built, where things are in the ROM and the save, and how the program runs a game. Everything here was read from the program and checked in emulators (the last section says how). Addresses are the console's, bank and offset ($80:8001); offsets into the save are written $0000–$FFFF. Each section ends with the project's note and tool that hold the full detail. They are files in the project that made this guide, not pages of the site.

The cartridge#

SHVC-ZR2J, header title RPG-TCOOL 2. Inside:

Through the second controller port the program also talks to a Turbo File Twin. Just under the ROM header, at $80:FF80, sits the developer's tag, KUSOU KAGAKU DEVELOPMENT SYSTEM VER 2.28 (Behind the scenes).

Notes/RPG Tsukuru 2.md, Notes/Dumps.md.

The program's banks#

In LoROM each bank shows 32 KB of ROM at $8000–$FFFF, so the 2 MB are the 64 banks $80–$BF, bank $80 + n being the file's bytes from n × $8000. Code is in 17 of them, split by use: $80 shared by everything, $81–$85 the game being played and the battle, $86–$87 the demo, the ending and the front end, $88–$8A and $8D the editors, $8E the memory pack, $AD the sound. The rest is data: graphics, the fonts, the sound's samples and songs, the editors' scripts, and in the last two banks the factory save image, the sample game.

$80core$81runtime$82boot, play$83events$84play, menus$85battle$86demo, ending$87front end$88editor shell$89editors$8Aeditors$8Bscripts$8Cscripts$8Deditors$8Ememory pack$8F$90battle data$91$92data$93data$94data$95data$96data$97data$98battle bgs$99battle bgs$9Abattle bgs$9Bbattle bgs$9Cdata$9Dmagic$9Edata$9F$A0sprites$A1sprites$A2characters$A3characters$A4characters$A5map sets$A6map sets$A7map sets$A8map sets$A9data$AAsamples$ABsound data$ACdata$ADsound driver$AE$AFfonts$B0field$B1field$B2data$B3data$B4data$B5data$B6field parts$B7data$B8$B9$BA$BBdata$BCdata$BD$BEsample game$BFsample game65816 code, with its scriptsscripts onlygraphics and fontssoundthe factory savedata, use not settlednever read
The ROM by bank, eight to a row. The banks marked "never read" were touched by none of the logged runs, and no later finding points into them. "Battle bgs" are the battle backgrounds; "map sets" the five part sets and their tables.

The map was made with a code/data log: Mesen marks each ROM byte as it is run or read, and 318 runs (every menu and editor, play in three games, battles, with random presses from 158 saved states) add up to 90,300 bytes of code run. Landmarks:

AddressWhat
$80:8001Reset
$80:802BThe main loop; the mode table at $80:F000
$80:8128, $80:8178NMI, IRQ
$80:86B8Queue a VRAM DMA for the next NMI
$80:8A8A, $80:8AA0The random number generator; the same, mod n
$80:8AC6The decompressor (its methods at $80:F740)
$80:9146Create an object
$80:9D3AThe script VM (ops at $80:BC4C, lengths at $80:BA4C)
$81:A393The event interpreter's step
$83:BEC6, $83:BF80The opcodes' start and continue handlers
$85:8000, $85:828FThe encounter check; the start of a battle
$87:909FThe Turbo File library's one entry
$88:9983The power-on save check
$88:D390Load the sample data
$AD:FF40The sound interface
$AF:A9D0The proportional font's pointers
$BE:8000The factory save image: the sample game

Notes/RPG Tsukuru 2/Program.md; Tools/snes_dis.py (the disassembler, which takes the CPU's register widths from the log), Tools/mesen_cover.py, Tools/rt2_modes.py.

The main loop and its modes#

The reset ($80:8001) sets the stack and the FastROM bit and clears the mode word $B9. The main loop ($80:802B) then waits for each frame and runs the routine for the current mode through the table at $80:F000. A mode with several steps keeps its step in $BB, moving on by adding 4.

ModeEntryWhat
$00$80:803EPower-on: the hardware and the RAM set up
$3C$80:8061Cold or warm boot: a copy of the development tag in RAM tells a reset from a power-on
$40 / $44$82:D8D6Cold boot: the boot screens ($44 on a PAL console, the same code)
$48 / $4C$82:D943Warm boot, after a reset: straight to the demo
$50$86:B79CThe opening demo, a Mode 7 flight
$74$87:A541The front end: the title and its menus; its second step is the save check
$78$88:8248Editing: the Edit menu and every editor
$5C$84:8000Playing a game: the user game, a test play or the sample
$60$86:D4CCThe ending, then back to the demo
$04–$1C, $20–$38Unused: a BRK or a stub, never set

Objects. Every screen is a tree of objects: 128 records of $80 bytes at $7E:4000, each with a 32-byte direct page of its own from $7E:1000, linked to a parent, a child and siblings. Each mode starts by creating a root object ($80:8FEA); an object's routine dispatches on its state byte (+5). Video work is queued: $80:86B8 adds a DMA to a list that the NMI sends to VRAM, and eight HDMA channels are handed out by $80:826A.

Warm and cold boot. At power-on the program copies its development tag into RAM. A reset leaves RAM alone, so finding the copy there tells a reset from a power-on: a reset skips the boot screens and goes straight to the demo. Holding L R START SELECT in play does the same without a reset: back to the title menu, past the save check.

Notes/RPG Tsukuru 2/Program.md, Hidden Content.md.

The SRAM image#

The 64 KB are one uncompressed image at fixed offsets: a header, the three play saves, nine sections (the database, the maps, the heap's directory) and the event heap, which fills both halves of the SRAM. The program reads the image in place, and each editor saves only its own section.

ItemsEnemiesField and mapsEvent heap, part 0Header and play savesMagicHeroesEnemy mapsHeap directoryPack records, unused$70$0000$4C08$7BE0Event heap, part 1Slot 3's pack record, sums; unused$71$8000$FBE0To scale. Navy: the database; green: the maps; red: the events.
The save, its two 32 KB banks drawn to scale. The event heap is one space of 43,960 bytes over both; the tails after it hold the play saves' memory-pack records, and the rest of them is never used.
OffsetBytesSumWhat
$000024The signature SHVC????RPG TKOUL 2, padded with spaces
$00182The total: the nine section sums and the three slot sums added
$001A1The save counter, +1 at every editor's save
$001B72yesSection 1: the title and the credits
$006355The memory-pack data choices, outside every check
$009A5yesSection 0: Config
$009F3 × 544eachThe three play saves
$06FF1,907yesSection 2: 127 items of 15 bytes
$0E72834yesSection 3: 64 spells of 13 bytes
$11B43,850yesSection 4: the land and sea masks, then 96 enemies of 40 bytes
$20BE1,013yesSection 5: the start (party, gold, vehicles, BGM slots, position), then 12 heroes of 81 bytes
$24B32,617yesSection 6: the enemy maps (per screen a 32-enemy mask and a rate), the battle backgrounds, the battle test's party
$2EEC7,180yesSection 7: the field (size, island parts, 256 screen words), the 128 maps' names, types, outside parts and screen masks, the 300 pool screens
$4AF8272yesSection 8: the event heap's directory
$4C0812,248The event heap, part 0
$7BE01,056Play saves 1 and 2's memory-pack records; the rest never used
$800031,712The event heap, part 1
$FBE01,056Play save 3's pack record and the three records' checksums; the rest never used

The database is fixed tables: an item is 15 bytes, a spell 13, an enemy 40 and a hero 81. Fields are packed where they could be: an item's kind shares a byte with who can equip it, a cursed or unsellable item is one bit of its power or price, and an enemy's six stats are stored × 4, with the two spare bits of each holding where it appears (land, sea, both), its colour, and its chest chance, two bits at a time.

In the factory image, the never-used tail of the first bank holds stale bytecode: a development test page that runs through the whole command set (Behind the scenes). The image was copied whole from a development save.

The power-on check#

Every time the game is switched on and reaches the title (the front end's second step, $88:9983), the save is checked:

  1. The 24-byte signature at $0000.
  2. The nine sections: each begins with a word holding the 16-bit sum of the section's other bytes ($88:9B1B).
  3. The three play saves, each with its own sum. A bad play save is cleared on its own.
  4. The total at $0018, the sum of the twelve sums.

Any other failure formats the whole save at once, without a word ($88:99E9): blank sections, new sums, empty play saves. The heap's bytes stay, but its directory is reset, so they can't be reached. The result is an empty project, not the sample game. Every editor's save rewrites its section, the section's sum and the total together, so only a power cut during a save, or a failing battery or contact, can trip the check. That is why a second-hand cartridge's save should be dumped before the cartridge is switched on (Limits).

Play saves#

Three of 544 bytes, at $009F, $02BF and $04DF. Most of a save is a copy of the party's state in RAM ($7E:8000); the heroes' levels, HP, MP, experience and equipment follow, 14 bytes each.

OffsetBytesWhat
+$0002The sum of the other 542 bytes
+$0021$80: in use
+$0031The kind: 0 user game, 1 test play, 2 the sample, 3 a game played from a memory pack. A test play adds bit 6 (invincible) and bit 7 (monsters on)
+$0043Gold
+$0074The party
+$00B32The 240 switches, a bit each
+$02B1Reserved: kept, never set
+$02C254The bag: 127 pairs of item and count
+$12A2Sound; cursor speed
+$12C6Where the party is: the map ($FF the field), x, y
+$13212The three vehicles' positions
+$13E6Their facings; what the party rides; the screen tint and mosaic; the battle message speed
+$14450The places visited, for teleport
+$1771The window colour
+$17812 × 14Each hero: level, HP, MP, experience, status, 5 pieces of equipment

Notes/RPG Tsukuru 2/Save.md; Tools/rt2_save.py (check, dump, build: every field out to text and back, byte for byte).

Text and the fonts#

One byte a character, the same code in the save and in the program's own strings. 00 ends a line or a string; name fields are padded with 40, the space.

Codex0x1x2x3x4x5x6x7x8x9xAxBxCxDxExF
0x(end)(page 2)~♡♪"ⅡⅢ:…/・.,。、
1x剣魔法士神聖女人死城町村王天竜術
2x悪光氷炎地水火風命幻戦者木石本薬
3x0123456789+ー○×?!
4x(space)ABCDEFGHIJKLMNO
5xPQRSTUVWXYZ『』()あ
6xいうえおかきくけこさしすせそたち
7xつてとなにぬねのはひふへほまみむ
8xめもやゆよらりるれろわをんぁぃぅ
9xぇぉゃゅょっアイウエオカキクケコ
Axサシスセソタチツテトナニヌネノハ
Bxヒフヘホマミムメモヤユヨラリルレ
Cxロワヲンァィゥェォャュョッがぎぐ
Dxげござじずぜぞだぢづでどばびぶべ
Exぼガギグゲゴザジズゼゾダヂヅデド
Fxバビブベボヴぱぴぷぺぽパピプペポ

01 xx is a second page: 01 08–01 47 are the 64 kanji a user can type after the 32 at 10–2F (泉野原家今昔勝負, 大中小金上下左右 …), and 01 48–01 F6 are kanji for the program's own menus. The voiced kana have codes of their own (CD–FF), so a name never needs two bytes for one kana.

Three fonts, in bank $AF:

The program's strings are in the same code, almost all inside the screens' scripts (below) and in 32 tables of pointers: 1,768 strings in all. One table no script uses: the Turbo File's 20 error messages, two of which speak of a "TF3".

Notes/RPG Tsukuru 2/Text.md; Tools/rt2_text.py (table, font, names, dump).

The event heap and the bytecode#

All events live in one heap of 43,960 bytes over both SRAM banks: part 0 at $4C08–$7BDF (12,248 bytes), part 1 at $8000–$FBDF (31,712). The field's events come first, then each map's in map order with no gaps. Section 8, the directory, holds the bytes free, where map 1's events start, where the last map's end, and 128 words: each map's byte count. A map's block is found by adding up the counts before it, and no map may pass 12,288 bytes.

One eventsize2x1y1flags1page 44 + 7page 34 + 7page 24 + 7page 14commandspage 4, 3, 2, then 1flags7: person6–4: 03: p12: p21: p30: p4bit 7: person, not object; bits 3–0: pages presenta page's headbyte 0size, low 8byte 1size, classbyte 2graphic − 1byte 3belowbyte 1: the size's top 2 bits; a class only the editor usesbyte 37: face6–4: start method3: face2–0: movementfacing: 0 down, 1 right, 2 up, 3 leftstart: touch, talk, search, automatic, keys A–Dmovement: the 8 types, 0 = stays putconditions, pages 2–4itemparty maskswitchgold at least1213 bytesunset: FF, 0000, FF, FFFFFF; all set must holda page 2–4 with none set is never chosen
An event's record. Only the pages present take space: their heads first, highest page first (pages 2–4 with their 7 bytes of conditions), then their commands in the same order. A page runs until its size is reached; there is no end marker.

Commands are one opcode byte and fixed operands, but for the message and the caption, which carry their text. The editor's 40 commands become 75 opcodes because every direction, tint and step style is an opcode of its own. Text in a message is the one-byte code above, each line ended by 00.

OpCommandBytesOperands
00End the event1
01Message2 + textThe number of lines, then each line's characters and a 00
02 / 03Switch on / off2The switch − 1
04 / 05Item + / −2The item
06 / 07Gold + / −424-bit amount
08Experience +424-bit amount
09–0CHP + / HP − / MP + / MP −316-bit amount
0D / 0EPoison / paralyse1
0F / 10A hero joins / leaves2The hero
11–14The hero faces up / right / down / left1
15–18The hero steps up / right / down / left1
19–1CThe event faces up / right / down / left1
1D–20The event steps up / right / down / left1
21Flash1
22–26Screen brighter / darker / red / blue / monochrome1
27Colour and mosaic back to normal1
28Shake1
29Battle6The BGM, then 4 enemies of the 96 (FF none)
2AWarp4The map (FF the field), x, y
2BInn316-bit price
2CShop98 items (FF none)
2DWait2Tenths of a second
2EThe event vanishes1
2FBGM2The song
30Sound2The effect
31 / 32Yes branch / no branch1
33Save point1
34Ending2The BGM
35Caption2 + textAs 01
36–39The event steps, keeping its facing1
3A–3DThe event steps, not treading1
3EThe event blinks2Tenths of a second
3F / 40The event spins left / right1
41–45Screen green / yellow / purple / light blue / sepia1
46Mosaic, fast1
47Cure poison and paralysis1
48 / 49Screen all black / the ground black1
4AMosaic, slow1

Questions. A message that asks something is followed by 31, the yes branch, 32, then the no branch. Neither branch has an end marker: the yes branch ends at its 32, the no branch at the page's end. So nothing can follow both branches, and a second question can only sit in the no branch.

The interpreter#

Each running event is an object with its pointer at [$0C] and a flag byte at $0F. The step ($81:A393) reads the opcode and calls its start handler ($83:BEC6); while a command is still running (flag bit 1) it calls the continue handler ($83:BF80) once a frame instead. A command that finishes at once costs no frame, so a run of switches, items and gold happens in one frame; a message, a step, a fade or a wait holds the event until it is done.

The interpreter doesn't run commands from the SRAM. Each is first copied into a buffer in RAM ($83:DC51) and ended with $80, and the copy rewrites some: end the event (00) becomes 57, the internal end, and a warp becomes fade out, warp, fade in. The runtime has internal opcodes of its own for this and for its own scripts:

OpWhatPut there by
50Fade inA warp
51Fade out, and the music if the new map's differsA warp
52Gather the party into the leaderBoarding a vehicle
53, 54, 5BBoard the sea, air or land vehicleBoarding a vehicle
55Relative jumpNothing found
56Wait a frameAfter an event's step
57End of the pageIn place of 00; the no branch's 32 jumps to it
58Wait 3 frames
59End at onceNothing found
5AStopThe end of the boarding scripts
5CFade outBoarding the air vehicle

Choosing a page ($81:A8DC when a map loads, $81:AABB after an event has run): for each event, pages 4, 3 and 2 are tried in turn ($83:A1C7), and the first whose conditions all hold is taken; page 1 needs none. A page 2–4 with no condition is never taken. An item condition is met by an item carried or equipped.

Pseudo-events. The start of play, and boarding each vehicle, are small event scripts the runtime keeps at $7F:F800: the start is a warp to the start or the saved place, then a fade in.

Notes/RPG Tsukuru 2/Events.md, Interpreter.md; Tools/rt2_events.py (check, dump, script; make_event and pack write events), Tools/rt2_interp.py.

Map packing#

Maps are built in three levels, so that the SRAM holds little more than part numbers:

chip16 × 16 px2 × 2 tiles8 bytespart64 px4 × 4 chips32 bytesscreen256 px4 × 4 parts16 bytesmap1,024 px4 × 4 screensfrom the poolThe field16 × 16 screens,each a word:island part × 4+ quarter, whichnames 16 fieldparts in the ROMpale: a screennot in use, drawnas the outside part
A map's ground, from the smallest piece. Chips and parts come from the ROM's part sets; only the screens' part numbers and each map's screen list are in the save.

The field keeps 256 screen words instead ($2F38): island part × 4 + the quarter. Each word expands through $B1:8000 into 16 field-part numbers, and each field part points ($B6:AA00) at its 16 chips, from the field's own set in bank $B0.

Layers. In BG mode 1 the ground is BG2 (tilemap at VRAM $7800); object events are BG1 ($7000), one chip a cell from a 64 × 64 byte map that the events fill; windows and text are BG3; people and the party are sprites. One attribute byte per chip says how a cell can be crossed: on maps 0 is walkable and 1 or 2 blocked; on the field it is the terrain, which decides passability by foot, ship and air, and the battle background (Maps and the field). Maps cycle a few colours every 8 frames; the field cycles its sea.

Notes/RPG Tsukuru 2/Maps.md; Tools/rt2_maps.py (render, check, sets, sheet).

The decompressors#

Every compressed block begins with a method byte, and one routine ($80:8AC6) dispatches on it. It can be told to stop after so many units, so a big load is spread over several frames.

MethodRoutineWhatUsed for
$00$80:8AF0Stored: a count, then the bytesNothing found
$04$80:8B3CLZ on bytesOne block of the boot screens
$08$80:8BFDLZ on 16-bit wordsBattle-background tilemaps, enemy arrangements
$10$8A:8000The tile packerEvery tile set: maps, the field, battle backgrounds, enemies, spell animations

The tile packer (method $10, at $8A:8000) works a unit at a time, a unit being 16 bytes or one 32-byte tile. A header gives the unit size, two fill bytes and a code table; a stream of 1- or 2-bit codes then picks, for each unit, one of six ways to build it: copy it whole from the data, fill it from a mask (each bit a fill byte or the next data byte), or repeat the byte or word before it under a mask. A mostly empty tile costs its masks and a few bytes.

The LZ methods ($08 on words, $04 on bytes) read eight tokens to a control byte: a literal, or a copy of 3–18 units from an absolute position in a window that starts 18 zero units before the output.

Where the graphics are. The 71 character sheets are uncompressed, 48 tiles each (8 frames of 16 × 24), through a resource table at $A0:EF00; a character's resource is its editor number + 15. An enemy graphic is a header at $90:8000 + 2 × its number: size, tiles (method $10) and arrangement (method $08), with its four colourings at $90:80CE. The 17 battle backgrounds are listed at $90:8D00, and the spell animations at $90:A000 (tiles), $90:A0E0 (frames) and $90:A140 (timing), all in one 64-colour set (Graphics).

Notes/RPG Tsukuru 2/Graphics.md; Tools/rt2_gfx.py (unpack, chars, enemies, battlebgs, magic).

The object-script VM#

Almost everything RT2 shows is bytecode: the field's windows, the event commands' windows, the battle's flow and its messages, the front end, every editor screen, the boot screens, the demo and the ending. One small virtual machine in bank $80 runs it, as part of an object.

KindOpsWhat
Control01–12If a byte, word or 24-bit variable compares, or a bit is set; else, end if; repeat, do-until, while, switch and case, break, continue. No jump offsets: an untaken branch skips forward counting nesting
Calls13–1AGo to; call native code; call a script and return; wait a frame; end (the object is deleted); halt
The base1B–1EWhere variables are: absolute WRAM, the object's own record, a walk of the object tree, or a pointer slot
Values1F–27, 2E–4D, 70–75, 7FSet, clear, exchange; and, or, eor, not, shifts; increment, decrement, add, subtract, multiply, divide; push and pop
Graphics2B–2D, 62, 66–6B, 7C–7EDecompress; a VRAM DMA; tile blocks, frames and boxes; palette bits over a rectangle; colours to CGRAM
Text4E–61, 63–65, 6C–6F, 76–7BThe window and its VRAM; the cursor, speed, palette, tile base and fill; a character, a string, a string from a table, a new line; numbers
Sub-ops00 nn28 more: copies, lines of a character, waits for frames and buttons, the base, filling VRAM, a call through a table

From the four tables of entry points (the event windows, the field's windows, the battle's scripts, the front end's and the editors' windows) and fifteen fixed starts, 1,634 scripts and subroutines, 202,130 bytes, are reached in banks $82–$8E; banks $8B and $8C hold nothing else. A message is run the same way: the message command compiles its lines into VM code in RAM and calls it, so it prints through the same text op as every menu, at a fixed two frames a character.

Notes/RPG Tsukuru 2/Scripts.md; Tools/rt2_vm.py (ops, scan, check, a disassembler).

The battle#

A battle has eight records of 256 bytes: the party in slots 0–3, the enemies in 4–7. A hero's is the hero's record in RAM ($7E:8200 + 256 × the hero) copied whole; an enemy's is built from its 40 bytes in the save, each stat divided by 4. The flow is a script (the table at $85:967A) calling native routines for the rules.

Each round: the escape roll, the commands, then the turn order, by speed and nothing else (a bubble sort, ties to the party and the lower slot), then each turn: status first, then the choice and the action. There is no hit roll and no variance: an attack does (attack − defence) ÷ 2, at least 1, and a critical hit (1 in 16) attack − defence. An enemy picks one of its battle methods and spells with equal odds. Auto is a fixed list of tests with no random numbers. All the rules, with their formulas: How battles work.

Encounters. Each step on foot or by ship counts up to 17 since the last battle; a battle starts when a random byte falls below the table at $85:805A, by the screen's rate and the steps. The group is drawn from the screen's enemy mask, shuffled by 331 random swaps.

The random number generator#

$80:8A8A: s = s × 5 + $3711, 16 bits at $00A7, returning the high byte. $80:8AA0 takes a step and returns the high byte mod n, by the hardware divider.

Notes/RPG Tsukuru 2/Battle.md; Tools/rt2_battle.py (record, check, show: a battle recorded in the emulator and replayed through a model of the rules).

The sound driver#

RT2 has its own SPC700 driver, a sibling of the one in the SFC Kanadeeru. At power-on the program sends the sound chip a loader, then everything but the song:

FromBytesTo (SPC RAM)What
$AD:D1B95,770$05E0The driver
$AA:800037,629$200044 samples (BRR)
$AB:92FD176$1F00The sample directory
$AB:93AD88$1EA0Each sample's tuning
$AD:E84364$1FC016 vibrato presets
$AD:E883192$1CC048 instruments
$AD:E943288$1D80A 36-drum kit
$AD:EA633,063$B300The 65 sound effects
$AB:B000617–3,645$D000The song playing, sent at each change of song

Notes/RPG Tsukuru 2/Sound.md; Tools/rt2_sound.py (check, song, instruments, samples, rip), Tools/snes_spc.py. Every song and effect is ripped as an .spc (Music and sound).

The Turbo File and the memory pack#

The Turbo File Twin#

Bank $87 from $87:8000 holds a general Turbo File library, the same in all four SFC Tsukuru titles, with one entry (JSL $87:909F, a function number in A: mount, format, find, open, read, write, close, delete …). It speaks the Twin's STF mode: 124 blocks of 1 KB after a 4 KB table, each block's chain and 8-bit sum in the table. Every block is read twice and compared, and a write is read back, nine tries in all. The NMI is off for the whole access.

RT2's file is 62 blocks, so two games fill a Twin exactly:

File offsetBytesWhat
$000024SHVC, ZR2J, RPG-TCOOL2-nn
$001831,720SRAM $0018–$7BFF
$7C0031,744SRAM $8000–$FBFF

The file is the whole user game, play saves included: only the save's signature and the never-used tails are left out. A load reads the whole file into RAM first and copies it to the SRAM only if every block was good; a block with a bad sum makes RT2 delete the file and leave the cartridge alone. An unformatted Twin is formatted without a question.

The memory pack#

An 8 Mbit Satellaview pack is 8 blocks of 128 KB, block b at banks $C0 + 4b onward (bank $8E holds the code). A block counts if it carries a valid Satellaview header (maker B1, a checksum and its complement), and its first four bytes say what it is:

First bytesKindWhat
RPSV1An RT2 game, as RT2 writes it
RPSM, RPSX2, 3Game files RT2 didn't write (broadcast ones, presumably); read exactly as kind 1
RPGR4Graphics data: extra part sets, enemy graphics, palettes
MTTC5Sound data: songs, effects and streamed samples. The SFC Kanadeeru's export file

RT2 writes one game to a block, the first erased one, and a delete erases the whole block:

Block offsetBytesWhat
$000024RPSV, 4 zeros, ASCII TCOOL MEMP
$001831,720SRAM $0018–$7BFF
$7E00432A stub, for a Satellaview that tries to run the file: it says it can't be used on the BS-X cartridge
$7FB048The BS header: maker B1, the title RPGツクール2 ファイル0n, the block mask, a checksum
$7FE032The stub's vectors
$800031,744SRAM $8000–$FBFF

A game on a pack can also be played without loading it: the play save then records the file's title and checksum, and at power-on RT2 looks for the file again wherever it now sits. The sound and graphics files the Data page chooses are found the same way, by a title and checksum kept in the save at $0063–$0099. The graphics file (RPGR) would have supplied map types 5–7, further enemy graphics and more palettes; no such file is known to survive (Behind the scenes).

Notes/RPG Tsukuru 2/Storage.md, Notes/Turbo File.md; Tools/snes_turbofile.py, Tools/snes_mempack.py.

How this was checked#

Every format on this page was written back as well as read, and run in an emulator, so that a reading that was nearly right would show:

WhatHowResult
The saveEvery field dumped and the image rebuilt, for the factory image, both cartridges' saves and a played copyByte for byte; an edited save passed the game's own check
The eventsEvery event and page of the three saves parsedFactory 456 events and 651 pages, cart 1 the same, cart 2 436 and 436; not a byte left over
The interpreterTest events using every opcode, run in MesenEvery opcode's start handler ran but 00's, which the copy turns into 57
The mapsEight places drawn from the save and the ROM, against Mesen's screenPixel for pixel
The battle31 recorded runs replayed turn by turn through a model of the rules1,327 turns, 153 escape rolls and chests, none wrong
Two emulatorsTen battle saves recorded in Mesen and in bsnes, from cleared RAM672 and 670 turns, 101 rolls and chests each, none wrong
The screensSix places compared between the two emulatorsThe same wherever both stand at the same moment
The soundEvery song and effect ripped and played backAll 30 songs and 65 effects run as in the game
The scriptsThe VM's length tables against its operands; every reachable script walkedNo mismatch in 196 ops and 46 sub-ops; 1,634 scripts
Turbo File, memory packSave, load and delete, in MesenCE with a Twin and in Mesen with a packBoth cartridges' games out and back byte for byte

Notes/RPG Tsukuru 2/Second Emulator.md, Analysis Plan.md; Tools/mesen.py, Tools/lr.py, Tools/rt2_xcheck.py.

Fan-made reference material, one of the Eschaton Games Tsukuru guides. Not affiliated with the publishers of the titles it covers.