What is left in the effect module slots
The attack effects are separate code modules stored in two archives, one module per 0x8000-byte slot. The game reads the whole slot and links only the module at its start. The rest of the slot is not all empty: part of it is old data.
- Where
- effect/B_MODULE.MRG and Z_MODULE.MRG, the bytes after each module in its 0x8000-byte slot
- Read by the game
- Loaded with the module, never used
- Leftover bytes
- 2,867,288 bytes over all 233 slots, 177,971 of them not zero
- Debug messages in the leftovers
- In 44 modules
- Where the leftovers come from
- Probably earlier builds of the same modulesUnconfirmed
Over all 233 slots, 2,867,288 bytes come after the end of a module. None of it is used. Most of it is zero, but every slot has some data left: 10,307 blocks of 32 bytes are not empty. About a quarter of those also occur in the live modules, most of them in the same module’s own code.
Debug messages
The leftovers contain text that appears nowhere in the shipped modules or in the main program. They are printf-style format strings.
| Text | Where |
|---|---|
LOCAL FRM:%04d |
42 modules (37 basic, 5 special) |
USE WORK:%04XH |
the same 42 modules |
USING%3d/%3d |
b050, b120, b159, z008, z175 |
IN_RING2, ACT_RING2 |
b053 |
Time > %d, EffeData Flg > %d, Beam10 Flg > %d |
b178 |
Size = 0x%x, Time > %d, EffeData Flg > %d, Noroi4Z Flg > %d, Target > %d |
z270 |
The names give a little away. Beam10 and Noroi4Z look like working names of effects; noroi (呪い) is Japanese for “curse”. What the effects were is not known.
Two batches of modules
Each module carries a number of its own. Number 7 is z310; numbers 8 to 50 are the other special-attack modules (z) in ascending order, and 51 to 164 the basic-attack modules (b). Then the order starts again: 165 to 170 are six more z modules (z008, z098, z162, z168, z175, z180), and 171 to 239 are 69 more b modules. Numbers 1 to 6 are missing.
The 42 modules with LOCAL FRM and USE WORK are all in that second batch. b178 (number 161) and z270 (number 44) are not, and carry debug messages of their own.
Similar modules, similar leftovers
Modules that share most of their code also have nearly the same leftovers: b000 and b172 match at 99%, as do b008 and b135 or b025 and b040; 34 modules match another module’s leftovers at over 90%. The likeliest reading is that the leftovers are older builds of these modules, written into the slot before the final module was copied over them. That is a guess.
Only a small part of the leftovers matches code of some other module and not the module’s own: 386 blocks of 32 bytes, 351 of them in b178, which holds pieces of the code of the basic-attack funnel effect of b000, b162, b163, b172, b173, b181 and b182.
Two slots with leftovers and no module
In Z_MODULE.MRG, slots 165 and 176 hold no module, yet they are not empty: slot 165 starts with 118 bytes of data and slot 176 with 288. These bytes belong to the slot in front of each one. The leftovers after z164 (974 bytes) and after z175 (4,824 bytes) run past the end of their own slot, and the data carries on without a break into the next slot, as far as 118 and 288 bytes into it. So the two modules were stored together with their leftovers, and that block was longer than the 0x8000 slot.
Like the rest of the leftovers, the bytes look like a module’s link data: relocation entries, each table ended by its end marker, then a module’s import table. The import tables name module numbers 32 (slot 165) and 148 (slot 176), the numbers of today’s z150 and b152. Their offsets are larger than in those shipped modules.
The game never reads these bytes. No monster and no skill card names slot 165 or 176, and loading z164 or z175 reads only their own 0x8000 bytes.
Evidence
The effect loader reads 0x8000 bytes at the slot number (the number in the module’s name, such as 261 for z261) times 0x8000 in the archive and passes only the module to the linker, so whatever follows the module (its sections, import table and relocations) is never touched. Each slot was cut at the end of its module; the remaining bytes, in 32-byte blocks counted from the start of the slot, were compared with every live module, with each other and with the main program, and searched for text. The module numbers come from the modules’ own headers. In slots 164 and 165, and 175 and 176, the 8-byte relocation entries were decoded across the slot boundary: they keep the same alignment and carry on without a gap.