Author Topic: DS/Steam Location Event Command Differences  (Read 72 times)

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1765
    • View Profile
DS/Steam Location Event Command Differences
« on: April 16, 2025, 09:34:49 pm »
The DS version made various changes to the event commands that makes most extracted events incompatible with Temporal Flux, as well as introducing some new commands. This is a partial documentation of what I've found so far. (Location events for the ports are held in Atel_xxx.dat files.)

Text
B8 (StringIndex) now takes a single byte as the index number of the text file for the area.

All stringbox commands take a 16-bit number for the string index.

Change Location

The change location commands have an extra byte between the location number and the coordinates. The "facing" value that was stored in the same bytes as the location number has been split off into this new byte, probably so that the bits it took up could be used to expand the range of locations. (This applies to location and overworld exits too, though the exact placement of the extra byte varies).

The possible exception is E2, which loads from memory addresses and is only used to return you to Crono's room or the Truce inn after resting.

Memory Assignment
All the memory assignment commands that took full 24-bit addresses (49, 49, 4A, 4B, 4C, 4D) no longer do. Instead of reading from or writing to anywhere in RAM, it's limited to predefined memory addresses with an added offset. The first  parameter is the index number of the memory range, the second the offset to add. There appear to be special cases for reading/writing to the addresses for party equipment and techs learned, beyond specifying the equivalent ranges in the first place. That is, after calculating the target address, it redirects it to the true new location of those variables.

Examples
  • 4800007F06 Assign(Mem.StorylineCtr, Mem.7F020C, One)->48 3D 00 06
  • 48A1007F15 Assign(Mem.7F00A1, Mem.7F022A, One)-> 48 3D A1 15
  • 4881297E0F Assign(Mem.PC2, Mem.7F021E, One)-> 48 2D 01 0F
  • 4903267E0C Assign(Mem.7E2603, Mem.7F0218, Two)->49 2A 03 0C

Several blocks are dedicated to just a few game state variables, but that doesn't mean the bytes of memory right after are the same as in the SNES version. So some memory reading/hacking tricks may not work.

Additional note: Not an actual change to the event command's behavior. DS/Steam has only one number text variable. So it has to zero out the upper bytes of the temporary number memory address. In the DS/Steam version, a one-byte memory assignment there will be followed by a two-byte value assignment of 0 where there wasn't one in the SNES version.

Enemies

Enemies are now a 16-bit range instead of an 8-bit range.

Items (Commands CA, CB, C9, D5)
Items take up two bytes rather than one, but it's not a simple expansion after the original item range. Items are divided up into the categories seen in the DS/Steam's version menu (weapons, armor, helmets, accessories, consumables, and key items), determined by the second byte.

0x00 = Weapon
0x10 = Armor
0x20 = Helmet
0x30 = Accessory
0x40 = Consumable
0x50 = Key Item

Each category starts with a null item in the 00 slot. The text file sfc_item in the mobile/Steam versions marks the items by category and their number within that category.

Examples
  • The Power Tab event in Guardia Forest, originally CA CD in the SNES version, becomes CA 11 40
  • Taban Vest: CA 79 -> CA 1F 10
  • Prism Dress: CA 6C -> CA 12 10
  • Taban Helm: CA 8B -> CA 10 20
  • Prism Helm: CA 86 -> CA 0B 20
  • PrismSpecs: CA BB -> CA 27 30
  • Pendant: CA D6 -> CA 07 50
  • Magic Cave Masamune Cutscene: D5 04 3D -> D5 04 3D 00, CB 52-> CB 52 00

New commands

The DS/Steam versions have a block of memory for its new variables/event flags, outside what can be accessed through the original memory assignment commands.
"Temp memory" refers to the block of memory that started at $7F0200 in the SNES version.

3A vv aa Store value vv to extended variable aa

3D oo aa Transfer an 8-bit value from temp memory + oo * 2 to an extended variable

45 bb aa set bit in extended memory

46 bb aa reset bit in extended memory

6E aa vv oo jj
Checks a value in the new memory range. Works identically to the original command 0x16 (Value-to mem Comparison), where oo is the type of comparison to perform

70 pp oo Store pary slot pp to temp memory + oo * 2

FD ?? Purpose not yet determined

The following were found by hacking/debugging, their usage in-game is not yet confirmed.

3E aa oo Copy value from from extended variable aa to oo * 2 of temp memory
74 aa oo Copy two-byte value from extended variable aa to oo * 2 temp memory
78 oo aa Copy two-byte value from temp memory + oo * 2 to extended variable aa
« Last Edit: April 16, 2025, 10:37:03 pm by Vehek »