RPG Maker a guide to the PlayStation original

How it works#

This is the technical page: the programs on the disc, how RPG Maker loads its code, where things sit in memory, what a save file holds, how an event runs, how a frame is drawn, how the music plays and where the random numbers come from. The other pages say what you see; this one says how the program does it. Addresses are RAM addresses in RPG3.EXE unless a line says otherwise, and numbers with 0x are hexadecimal.

4programs: the boot program, the launcher, RPG Maker and Anime Maker
899entries in COMDATA.BIN, the pictures and tables
25sections in OVERLAY.BIN, loaded when needed
57task classes run the whole program
92event opcodes behind the 27 commands
534slots in the ordering table of a frame

The disc and its programs#

The disc holds three programs and their data. The PlayStation starts SLUS_006.40, a small boot program: it shows the ASCII logo, plays Kuusou Kagaku's logo movie, shows the Spline and agetec logos, and then loads MAIN.EXE, the launcher with the title picture and the menu (Getting started). The launcher starts RPG3.EXE (RPG Maker) or ANIM.EXE (Anime Maker), and both go back to it when you leave: RPG Maker's RETURN runs LoadExec("cdrom:\MAIN.EXE;1"). The name RPG3 is the Japanese original's: RPG Tsukuru 3 (Compared with RPG Tsukuru 3).

FileSizeWhat it is
SLUS_006.40178,176The boot program: the ASCII logo, the Kuusou Kagaku movie, the Spline and agetec logos, then MAIN.EXE
KUUSOU.STR270 framesKuusou Kagaku's logo movie: 320 × 240 at 30 frames a second, mono XA sound, 9 seconds
DUMMY.STR59 framesASCII SOFT's old knight-on-horse logo, 15 frames a second; never meant to play (hidden)
TIM_BOOT.LPK3 picturesThe three boot logos, LZSS-packed TIMs
MAIN.EXE157,696The launcher: its title picture and menu, then RPG3.EXE or ANIM.EXE
TIM_TT.LPKThe launcher's title picture, menu sheet and NOW LOADING tiles
ANM_OPN.APK2,028A small packed file the launcher names
RPG3\RPG3.EXE1,079,296RPG Maker itself: the top menu, EDIT, GAME and Test Play
RPG3\COMDATA.BIN8,220,672899 entries: map sets, wallpapers, characters, objects, monsters, fonts, effects, title pictures, the sample game, tables
RPG3\SOUND0.BIN4,202,496110 entries: the sound banks, the jingles, the 35 songs
RPG3\OVERLAY.BIN1,034,24025 sections of code and data, read in when needed: the editors, the battle engine, the field menu, the card pages
ANIM\ANIM.EXE514,048Anime Maker
ANIM\…Anime Maker's own files: TIM.LPK (51 pictures), ANM.APK, ANIM.VB, the sample library SAMPLE.DAT with its index SAMPLE.IDX

The boot program has no random numbers in it: the logos always come in the same order, and a button pressed during the first logo skips straight to the launcher. Why a horse sometimes shows up anyway is told on Hidden and unused.

SLUS_006.40 boot: logos and a movie MAIN.EXE the launcher ANIM.EXE Anime Maker RPG3.EXE RPG Maker: top menu, EDIT, GAME, Test Play RETURN back COMDATA.BIN 899 entries: pictures, tables SOUND0.BIN 110 entries: banks, songs OVERLAY.BIN 25 sections of code and data read by (archive, entry) requests to the CD OVERLAY.BIN in RAM: one section at a time at 0x80104000; the battle engine at 0x80117000 00 Configuration 01 Dungeon Edit 02 Gameplay Edit 03 Monster Appearance 04 Event Edit 05 Field Edit 06 Main Characters 07 Item 08 Skill 09 Magic 0A Monster 0B Parameter Name 0C Scenario Game Info 0D System Game Info 0E Title Edit 11 the field menu 14 MEMORY CARD pages 0F battle engine 12 auto-connect table 16 PC-host browser never loaded: 10, 13, 15, 17, 18 editor play battle data dormant
The programs on the disc and how RPG3.EXE finds the rest. Grey dashes: data, not code; red dashes: reachable only by patching (Hidden and unused).

The three archives#

RPG Maker keeps almost everything in three archive files in the RPG3 folder. RPG3.EXE holds a directory for each: a count, the CD path, the developers' PC path (C:\PTCL\GAME\DATA\COMDATA.BIN and the like, never used on a disc), and then one {offset, size} pair per entry. Every load is a request for (archive, entry), queued to the CD drive with the address to read it to, and the drive seeks to the archive's first sector plus the offset ÷ 2,048. Archive 0 is COMDATA, 1 SOUND0, 2 OVERLAY.

Overlays: the code that loads when needed#

RPG3.EXE itself holds the front end, the field, the event interpreter, the text engine, the sound layer and everything a game needs while walking around. The rest is in OVERLAY.BIN's sections, which are plain, uncompressed MIPS code and data, loaded at fixed addresses. All the editors and the menus of play share one window at 0x80104000, so only one is in memory at a time; the battle engine loads higher, at 0x80117000, so that Battle Test can run beside Monster Appearance.

Edit Data. Each entry loads its own OVERLAY section into the window at 0x80104000, unless that section is already there.123456789101112131415
Edit Data. Each entry loads its own OVERLAY section into the window at 0x80104000, unless that section is already there.
  1. 1 Title: Title Edit section 0E
  2. 2 Configuration: Configuration section 00
  3. 3 Gameplay Edit: Gameplay Edit section 02
  4. 4 Parameter Name: Parameter Name section 0B
  5. 5 Magic: the Magic editor section 09
  6. 6 Item: the Item editor section 07
  7. 7 Main Characters: the Character editor section 06
  8. 8 Skill: the Skill editor section 08
  9. 9 Monster: the Monster editor section 0A
  10. 10 Dungeon: Dungeon Edit section 01
  11. 11 Field: Field Edit section 05
  12. 12 Monster Appearance: Monster Appearance section 03, and 0F for Battle Test
  13. 13 Game Info: Set System Data section 0D
  14. 14 Event: Event Edit section 04
  15. 15 Game Info: Set Scenario Data section 0C
SectionSize (bytes)Loaded atWhatOpened from
005,2480x80104000ConfigurationEdit Data → Configuration
0187,5840x80104000Dungeon EditEdit Data → Dungeon
024,7360x80104000Gameplay EditEdit Data → Gameplay Edit
0351,1340x80104000Monster Appearance (Battle Test loads 0F beside it)Edit Data → Monster Appearance
04211,3760x80104000Event Edit, the largestEdit Data → Event
0571,2490x80104000Field EditEdit Data → Field
0635,5760x80104000Character editorEdit Data → Main Characters
0748,7840x80104000Item editorEdit Data → Item
0840,5120x80104000Skill editorEdit Data → Skill
0949,6440x80104000Magic editorEdit Data → Magic
0A50,2560x80104000Monster editorEdit Data → Monster
0B4,5400x80104000Parameter NameEdit Data → Parameter Name
0C2,6080x80104000Set Scenario DataEdit Data → Scenario Data's Game Info
0D4,0400x80104000Set System DataEdit Data → System Data's Game Info
0E5,4640x80104000Title EditEdit Data → Title
0F103,9520x80117000the battle engineevery battle, and Battle Test
102,392nevera text-rendering testnothing (hidden)
1155,8360x80104000the field menu (Item, Magic, Status, Equip …)the field menu
1270,8620x807E6F78Field Edit's auto-connect table (data, not code)Field Edit, as it opens
13, 15, 184 eachneverplaceholders, one word eachnothing
1461,0570x80104000the MEMORY CARD pages: Load, Save, Import, Delete, the Utility, Load SampleEDIT → MEMORY CARD, Load Sample, GAME → Continue and Start, a Save Point
1613,2600x80104000a PC-host file browser for the developersnothing (hidden)
1727,418neverthe Japanese name-entry keyboard's gridsnothing (hidden)

Choosing an entry in Edit Data calls the overlay loader with the entry's number, which picks a load descriptor ({archive 2, section, address}) and reads the section, unless it is already the one in the window. Then the editor's task is started. Three sections (0x10, 0x13, 0x17) are named by no load descriptor at all, two more (0x15, 0x18) are four-byte placeholders, and the developers' file browser (0x16) has a descriptor that nothing passes: they are on Hidden and unused.

The state machine and the task system#

Modes#

main is a single loop: g_ModeStepTables[g_Mode][g_Step](). The mode (0x800F09AC) says which part of the program is running, the step (0x800F0988) where it is in it, and a mode change resets the step to 0. There are twelve modes; half of them do nothing but move on.

ModeWhat runsGoes to
0–3, 8, 9nothing: each just moves on to the next modethe next mode
4start-up: the video hardware and the graphics5
5the game systems set up again10 after Test Play, otherwise 6
6the top menu: GAME, EDIT, RETURN7, 10 or 11
7a game: GAME and Test Play both5
10the EDIT menu, Edit Data and the editors6, or 7 for Test Play
11RETURN: back to MAIN.EXEthe launcher

GAME and Test Play are the same mode with the same root task; they differ in the window that starts them and in a flag. A byte that lasts across modes, at 0x80010011 just above the BIOS area, carries what each mode must know about the others:

Bit Means
0x01 a System Data image is loaded
0x02 this editor visit has changed something (Event Edit uses 0x10)
0x04 the System Data has changes not saved to a card
0x08 a Scenario Data image is loaded
0x20 the Scenario Data has changes not saved to a card
0x40 after this game, go back to the EDIT menu (set by Test Play)

Leaving EDIT tests 0x04 and 0x20 together: that is the "Current Data will not be Saved" question (Memory cards and saves).

Tasks#

Inside a mode, everything is a task: the top menu, every window, the field controller, each moving character, the event that is running, a fade, the music loader. Tasks come from a pool of about 180 records of 0xA4 bytes at 0x800E9570. Each has a class, one of 57 in the class table at 0x80093C64, and a state. A class's update is usually a one-line dispatcher into its state table, so each task is a small state machine of its own. A menu state opens a window as a child task and waits until the child has closed, then reads its answer.

Every task is on three lists: all tasks in the order they were made, the tasks of its layer, and the draw callbacks. Only the movement tasks (class 6) are on layer 1; everything else is on layer 0. That's how an event freezes the world: its first frame sets the update filter to layer 0 only, so no one walks until it ends.

One frame of a scene goes like this:

  1. read the pad;
  2. update the tasks (all of them, or only the layers in the filter, which is latched at the start of the frame); a task made during the walk is added at the end and runs in the same frame;
  3. swap the double buffer and clear the ordering table (534 slots);
  4. run every draw callback; each adds its primitives to the ordering table;
  5. wait for the GPU and the vertical blank, set the display, and draw the ordering table.

On a dungeon map the update order is the game root, the CD service, the field controller, the palette cycles, the party's four movement tasks, the event objects' movement tasks, and then whatever was made later: the event task, its windows, the text printer, the fade, the music loader. An event command's helpers therefore run in the same frame as the command, right after it.

Memory#

Main RAM#

The PlayStation has 2 MB of main RAM, and RPG Maker gives every part of it a fixed job. The figures below were measured over 232 saved emulator states, covering a whole playthrough, every editor and Battle Test.

physical 0x000000 BIOS kernel 64 KB 0x010000 RPG3.EXE code and data from 0x80010080 (game code, then Sony's libraries), then its variables and heap 0x104000 overlay window editors, field menu and card pages at 0x80104000; battle engine at 0x80117000 0x13E000 save block the player-save image, 0x8073E200 System Data header 0x80740000, image 0x80740200 (0x1DE00 bytes) 0x15E000 Scenario Data header 0x8075E000, image 0x8075E200 0x17C000 CD and sound buffers, work areas sound ring 0x8077C000, song banks and SEQ buffers 0x1B1B90 import heap the Anime Maker characters, monsters and title pictures a game imports 0x1E1000 work area and stack card buffer 0x807E1000, game state 0x807E8254, editor records, clipboard 0x200000 The game reaches everything from 0x13E000 up through the RAM mirror at 0x80700000 + offset (0x8073E200 … 0x807FFFFF).
The 2 MB of main RAM as the game uses it, to scale (measured over 232 emulator states). System and Scenario Data always sit at the same addresses, which is why their sizes are fixed.

The fixed places are why RPG Maker's limits are what they are. System Data has 0x1DE00 bytes (122,368) and no more, because the Scenario area starts right after it; the MEM counters in the editors count down what is left of these two areas (Limits). The game addresses the upper half of RAM through its fourth mirror (0x8073E200 and up are the same bytes as 0x8013E200), and nothing in any program uses the mirror below the save block, so the overlay window and the data areas never share memory.

Video memory#

Video memory is 1,024 × 512 sixteen-bit pixels. Pictures sit in it as 4-bit or 8-bit pages with their palettes (CLUTs, one row of 16 or 256 colours each), and every sprite on screen is drawn from there.

frame buffer 1 drawn at x 4–315, y 8–231 frame buffer 2 the two swap each frame object tiles 2AB, 2AC map set pages 3 × 100 tiles palettes (CLUT rows) character sheets 7 pages, COMDATA 315–31B imports font 2A9 wall- paper effect pictures 354, 8 bit magic sheet 0 256 512 768 1024 0 256 512
Video memory (1,024 × 512 sixteen-bit pixels) during play on a dungeon map. Other scenes reuse the space: a battle copies the last field frame to (0, 256) and loads the monsters at (704, 256); the title screen's picture loads at (704, 256) over the effect pictures, which are read again after it.

Memory card files and the save compression#

Every file RPG Maker writes is named BASLUS-00640 plus a kind and a slot letter or a name. A card has 15 blocks of 8 KB for files, after the directory block.

Name after BASLUS-00640WhatBlocksBody
RMSYS + letterSystem Data1–15word-LZ compressed (stored plain if it won't shrink)
RMSCE + letterScenario Data1–15word-LZ compressed (the same)
RMGAM + lettera player's save1the 7,680-byte save block, plain
RMGAT + lettera Test Play save1the same
C_ + namean Anime Maker character1the picture, plain
M_ + namean Anime Maker monster1–4 by size (S to LL), fewer when packedplain, or byte LZSS when packed
B_ + namean Anime Maker title picture2plain, or byte LZSS when packed
A memory card: 16 blocks of 8 KB dir BASLUS-00640RMSYSA: System Data, 13 blocks GAM free 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 One System Data file (the header not to scale) SC, blocks 000 title 004 icon 060 checksum 180 stored 184 RAM size 188 flag 18C password 190 author 1A0 name 1B2 the compressed stream, to the end of the last block 200 Up to 0x180: the standard PS1 header, which the BIOS shows. From 0x180: RPG Maker's own. The checksum covers only the stored stream; Load checks the password copy at 0x190, not the one inside the data. The word-LZ stream, one 32-bit token at a time 0 length × 2 even: copy the next length words as they are 1 distance (16 bits) | length (15 bits) odd: copy length words from distance words back 0 zero: the end Decompressed and checked, in RAM: the System Data image at 0x80740200 game info 12 section headers 0–3 Magic Items Chars Skills Monsters Field Dungeon maps appear Each section header maps a database number to a storage slot; record = data + slot × record size. Slot 0 is the editor's "New" template. A Scenario file is the same container around the Scenario image at 0x8075E200: a table of 991 map blocks, the start point, the event blocks.
Anatomy of a System Data save, from the card down to the RAM image (the bottom bar roughly in the proportions of Arc Arath's System). The project's full map of every field is the figure below.

The container#

A System or Scenario save starts with the standard PlayStation header (the "SC" mark, the icon, the block count and a 64-byte Shift-JIS title such as RPG Maker SYS A … hhh:mm). At 0x180 come RPG Maker's own fields: a checksum, the stored size, the size of the image in RAM and a flag that says whether it is compressed. At 0x190 is the password (16 bytes, up to eight button masks), then the author's name (the first staff name of the System Data) and the game or scenario name, which the card lists show. The data starts at 0x200.

Word-LZ compression#

The data is compressed with an LZ77 variant that works in whole 32-bit words. The stream is a list of little-endian 32-bit tokens:

The compressor is Okumura's binary-tree LZSS, the classic one, run on words with a window of 2,048 words. If the stream would come out larger than the image, the image is stored as it is, with the flag 0, and Load just copies it. The project's tools rebuild every System and Scenario save in the fan archive byte for byte with the same rules.

It compresses badly. A match has to start on a word boundary in both copies, and almost everything in a save is made of bytes: text, tiles, stats, 12-byte names. A repeated phrase only matches when both copies happen to sit at the same offset mod 4.

Images Word LZ (the game) Byte LZSS zlib -9
168 System Data saves of the archive (median) 61 % 42 % 31 %
284 Scenario saves (median) 86 % 50 % 38 %

With Anime Maker's own byte LZSS the same Scenario saves would take about 40 % fewer blocks. Arc Arath's first scenario packs to 96 % of its size, 15 blocks, against 57 % and 9 blocks.

The project's full map of the card format, drawn early in the study. Two things have changed since: the bytes it shows as unused from 0x190 hold the password, the author and the name (above), and its orange fields have been settled: the System Data's tables below and the System Data and database pages give the current names.
The project's full map of the card format, drawn early in the study. Two things have changed since: the bytes it shows as unused from 0x190 hold the password, the author and the name (above), and its orange fields have been settled: the System Data's tables below and the System Data and database pages give the current names.

Player saves#

A save made at a Save Point is one block, uncompressed: the header, then a 7,680-byte copy of the save block at 0x8073E200. The block is packed from the live game state (party, switches, treasure flags, bag, Gold, position, the 16 characters, the play clock, the Ending's snapshots) when you save and at Next Scenario, and unpacked into a cleared game state at a new game, at Continue, and at Game Over. That is why a Game Over puts the party back where it last saved or last changed scenario, not at the scenario's start (Playing a game).

The live game state is 0x514 bytes at 0x807E8254, followed by 16 character records of 100 bytes. The switches are its bytes 6 to 0x44: switch n is bit n AND 7 of byte 6 + n ÷ 8, with the editor's 001–500 stored as 0–499.

System and Scenario data in outline#

System Data#

The System Data image at 0x80740200 is a 0x200-byte game info block, twelve linked section headers, and the twelve sections packed one after the other.

SectionRecord (bytes)NumbersEdited in
0Title screen16—Title Edit
1Configuration6—Configuration
2Gameplay switches1—Gameplay Edit
3Parameter names22 × 6—Parameter Name
4Magic40231 (0 is the "New" template)Magic
5Items24251Item
6Characters260, after a 124-byte prefix16Main Characters
7Skills5216Skill
8Monsters52251Monster
9Field maps275 + 21 a town + 7 a path9Field
10Dungeon mapsvaries991 (0–990)Dungeon
11Monster Appearance, one per dungeon2 + 13 an area991Monster Appearance

The fields of each database record are on The database; the settings sections on System Data.

Scenario Data#

The Scenario image at 0x8075E200 starts with its password, its name and the length of its event data. Then comes a table of 991 map numbers, each giving the map's place in a chain of event blocks (0 = the map has no events and uses an empty block every scenario starts with), the start point (map, x, y; the game always starts facing down), and the chain itself.

A Treasure event's switch conditions read the 256 treasure flags instead of the switches, and Next Scenario clears those, so treasures belong to one scenario. How to use all this is on Events.

The event bytecode and its interpreter#

A page's commands are a byte stream. Each command starts with a one-byte opcode, 0x00 to 0x5B, and Event Edit's 27 commands are 92 opcodes once their options are split (Switch ON and Switch OFF are two). Numbers of more than a byte are little-endian and unaligned. A table in RPG3.EXE (0x80094278) gives each opcode's length; three are variable: Display Message (its lines end in a zero byte), the 2 and 3 Messages choices, and Effect, whose length depends on the picture.

OpcodesCommand (Event Edit's name)One opcode perBytes
0027 Exit Event—1
012 Move Locationdestination: a dungeon, or a field and town (bit 15 of the map number)6
029 Wait—2
03–066 SwitchingSwitch ON, Switch OFF, a range ON, a range OFF3, 3, 5, 5
07–0E7 Change ScreenShift Screen, Default Screen, Flash, Swing, Change Color Slow / Quick, Default Color Slow / Quick3, 1, 1, 1, 5, 5, 1, 1
0F3 Take Over—3
101 Display Message— (the type is a byte inside: Normal, two balloons, Message 1, Message 2)varies
11, 13–1516 BGMChange BGM, volume, tempo, reverb2, 2, 2, 3
12, 1617 Sound Effectsound only, sound with pitch2, 3
17, 2D–2F18 ShopInn, Item Shop, Skills Selection Shop, Trade Shop3, 9, 9, 9
18, 1920 Game SystemON, OFF2
1A–1C8 InventoryAdd Item, Remove Item, Gold2, 2, 4
1D–23, 2B, 2C, 4D15 Character StatusSTR, DEF, STA, INT, AGI, Luck, M DEF; Learn Magic; Change Skill; Remove Equip4 (stats), 3, 3, 2
24–2A14 Party StatusHP, MP, EXP, Poison, Paralyze, Petrify, Restore3, 3, 4, 1, 1, 1, 1
30, 3119 Battletill the end, ending after n turns8, 9
3221 Effect— (12 pictures; the sub-type sets the length)3–5
33, 34, 35, 37, 394 2 Way ChoiceYes / No, Win / Loss, 2 Messages, Probability; 39 marks [Choice 2]1, 1, varies, 2, 1
36, 38, 3A5 3 Way Choice3 Messages, Probability; 3A marks [Choice 3]varies, 3, 1
3B–3E, 56— (the engine's own)restore the map's BGM, fade in after Move Location, choose every event's page again, run a pending Take Over, Game Over1
3F25 Save Point—1
40–4411 Party DisplayDisappear, Default, Flashing, Main Character graphic, Ghost1, 1, 2, 4, 1
45–4812 Party MembersAdd, Remove, Change Whole Party, Move to Front2, 2, 5, 2
49–4C13 Move PartyCharacter Direction, Move Party, Move Party to Point, Gather Party Members2, 3, 3, 1
4E–5510 Event StatusEvent Direction, Move Event, Move to Point, Flashing, Turn Right, Turn Left, Change Event Graphic, Unable to Execute2, 4, 4, 2, 1, 1, 3, 1
5722 Display Title—1
5824 Prohibit Escape—1
5926 Next Scenario— (the scenario's name, 18 bytes)19
5A, 5B23 EndingEnding, Snapshot2, 1

Five opcodes are the engine's own: Event Edit never offers them and has no text for them. The engine runs its map transitions as tiny event streams of its own that use them: after a Move Location it runs 3B 3C (map music, fade in), or 3B 3D 3C 3E when the Intro Event did a Take Over; a lost battle runs 56. Opcode 0x5C has neither a handler nor an editor entry.

A trigger Touch, Check, a key, an item or Move Location arrives the map's Intro Event Event task spawned its first frame freezes movement handler = table[opcode] the opcode under the pc next frame returns 1 its next state, same frame Event_AdvancePC next opcode, or a branch done returns 0 wait for the next frame still running pc moves on next frame at the end of the stream Event ends end of page, 00, a marker every page chosen again next frame; walking at +3 A command ends on a frame of its own: the handler that advances always returns 0, so two commands never share a frame.
The event interpreter. Each page is a byte stream; the task's pc points at the next opcode, and a table of 92 handlers does the work.

The interpreter is a loop over a table of 92 handlers at 0x80095268: it calls the handler for the opcode under the event's pc, and goes on while the handler returns 1. Every command ends by advancing and returning 0, so the next one starts on the next frame: a command takes at least one frame, and two commands never run in the same frame. Wait t takes 6t frames, a Slow colour change 82, a Swing 17, a message as long as you take.

Nothing checks a switch number: Switch ON and OFF take any 16-bit number, and a number past 499 writes a bit of whatever follows the switches (the treasure flags, the bag's counts, Gold, the camera). The engine's page-refresh opcode 0x3D also runs in an ordinary event. Neither can be typed in the editor; how they were used to build a frame buffer of event pages is on Event techniques and Limits.

The field renderer#

A dungeon frame is drawn by the field controller's draw callback. The camera's window is 14 × 11 cells of 24 pixels (13 across and about 9⅓ rows show); the map has two layers, A and B, over a background that is either a wallpaper fixed on screen or a tile repeated in the empty cells.

A live frame in IN CRIB (Arc Arath), one of 31 the project drew from RAM and compared with the console pixel for pixel: the counter's top covers the character standing behind it, the objects on the shelves sort with the characters by row.
A live frame in IN CRIB (Arc Arath), one of 31 the project drew from RAM and compared with the console pixel for pixel: the counter's top covers the character standing behind it, the objects on the shelves sort with the characters by row.
Drawn last, on top fade tile slot 0x215 the screen fade's subtract or add tile, over everything text, title picture slot 0x214 messages and windows; the title screen's picture and name layer B "top" parts slot 0x206 attribute 0x20: roofs and light shafts, over every sprite characters, row by row slot sy + 0x115 event characters, the party, then layer B "front" parts (0x10) and front object parts object parts, row by row slot sy + 0x14 event Objects without the front flag: under every character map layer B slot 3 ordinary layer-B parts, drawn flat map layer A slot 2 the floor and walls background slot 1 the wallpaper (fixed on screen) or the BG tile Drawn first, at the bottom: the ordering table runs from slot 0 up; within a slot the last primitive added is drawn first. sy is a cell's screen y, so a lower row lands in a later slot: things further down the screen cover things above them.
A dungeon frame's draw order, from the 534-slot ordering table (checked pixel for pixel against the console on 88 captures).

Palette cycling#

Water, lava, fire, torches and lights move by rotating runs of colours inside 16-colour palette rows in video memory. Three tasks do it: one for the common objects (started at the first dungeon of a session and never restarted, so its phase depends on how long you've played), one for the map set and one for the wallpaper (both restarted at every arrival). A cycle is a five-byte record: the palette row, the period in vertical blanks, the direction, the first colour and the count. Each frame a cycle adds the vertical blanks since the last frame (at most 10) and rotates its run once when the sum reaches the period. All shipped cycles rotate the same way; two other modes, stepping through stored palettes and ping-pong, have their code but nothing uses them (Hidden and unused).

Arc Arath's Nin11 (map set 5) drawn by the project's model with its cycles running from a fresh start; the model behind it replayed 30,770 of the console's logged rotations and resets without a mismatch.
Arc Arath's Nin11 (map set 5) drawn by the project's model with its cycles running from a fresh start; the model behind it replayed 30,770 of the console's logged rotations and resets without a mismatch.

Nothing cycles on the world map. More on the sets that cycle: Map sets and tiles.

Screen fades#

Every map change, the Inn, Save Points, Display Title, Next Scenario, the Ending and the return from battle use one fade task with eight types. Types 0 and 1 fade in from black or white by drawing a subtract or add tile over the normal frame. Types 2 to 7 fade out over a copy of the previous frame: while they run, the field draws nothing new. Move Location's method picks the type: Black and White are plain fades, Black Melt and White Melt melt the picture away; each takes about 80 frames, and after the map loads it fades in from black (or from white, after White and White Melt) over 80 more. A fade asked for while another runs is ignored.

The fade counts vertical blanks (up to four at a time), not frames, so a slow frame doesn't slow it. The two jitter types that no method in the editor reaches, and the crash past them, are on Hidden and unused.

The text engine#

Event text is one byte a character, with no control codes: 0x20–0x7E are ASCII, a handful of codes from 0xA1 to 0xDF are symbols (♂ ♀, the heart ♡ at 0xA3, arrows, boxes and button marks, the tall N the editor puts in its default names), and the rest print placeholders.

The message font in its eight colours, both layers.
The message font in its eight colours, both layers.

How each message type looks is on Events.

The sound driver#

Everything below the game's own sound code is Sony's library, libsnd, and the console's sound chip (the SPU).

The songs, jingles and sounds themselves, with players: Music and sound.

The random numbers#

RPG Maker has one source of chance: the BIOS rand(), a linear congruential generator.

The seed is set to 1 once, when the program starts, and never again. Everything draws from the same stream: battles (turn order, hits, criticals, damage spread, the monsters' AI, which draws numbers even while it only weighs its options), random encounters, the Probability choices, Random movement, the Swing Screen, the jitter fade (1,248 draws a frame) and even the field menu's windows, which take three draws each as they fly in or out. So from power-on, the same buttons on the same frames play the same game: that is how the project replayed whole playthroughs in the emulator and compared them frame by frame. It also means a skipped animation can change the next battle. The odds themselves are on How battles work.

How the study checked all this#

Three kinds of evidence, from the weakest to the strongest:

PartHow it was checkedResult
Disc, executables, overlays, modes and tasksstatic, with traces in the emulatorthe update order of a frame logged task by task
Card files and the word-LZ compressioncorpus and emulatorall 462 distinct System and Scenario saves of the fan archive, 99 player saves and 773 Anime Maker saves rebuilt byte for byte; cards written by the project's tools loaded and played by the game
Event bytecodecorpus and emulator14,853 pages of 8,269 events in 985 maps parse exactly; every command's length in frames measured
The field rendereremulator57 snapshot captures and 31 live frames equal to the console's, pixel for pixel
Palette cyclingemulator30,770 rotations and resets replayed, 0 mismatches
Screen fadesemulator76 frames of all 8 types: 72 exact, 4 differ only under a message window
Text and windowsemulatorwhole frame sequences exact
Soundemulator265,936 sound-chip register writes over 28,287 ticks replayed, 0 mismatches
Battles and the random numbersemulator1,362 decisions of 9 logged battles replayed from the logged random numbers, 0 mismatches
The editorsemulator1,427 editor screens captured; every write checked byte for byte against a model
Hidden featuresstatic, then patched runsa scan of every reference in every program image, each find run in the emulator where it could be

The models the project wrote (of the renderer, the fades, the text, the sound driver, the battle engine, each editor) are judged only by their output: they pass when they draw, play or write exactly what the console does, on every frame tried. How the study was done, and by whom in outline, is on Behind the scenes.