felipesanches / AnotherWorld_VMTools

Toolchain for software development targeting the virtual machine originally designed for Eric Chahi's Another World game.
21 stars 2 forks source link

`JUNK_xxxx` label must not become `LABEL_xxxx` if junk code references its address #20

Open felipesanches opened 1 year ago

felipesanches commented 1 year ago

Here's an example from msdos bytecode (level_2): Screenshot from 2023-01-21 02-51-36

Address 0x0480 is never called. But its code has a JMP pointing to its own entry point at 0x0480. For that reason the disassembler ended up using the label LABEL_0480 instead of the expected JUNK_0480. For that reason, it becomes unclear that that snipped of disassembly is an unused piece of code.

felipesanches commented 1 year ago

Similarly, there's also the case when a JUNK_xxxx label is not even used at all, like here:

Note: addresses in parentheses are declared as "unused code". AMIGA on the left / MSDOS on the right (0x005B)

Screenshot from 2023-01-21 03-04-25

AMIGA on the left (0x004B) / MSDOS on the right (0x005B)

Screenshot from 2023-01-21 03-05-34

The disassembly would be better if those 4 load instructions were properly identified with labels JUNK_004B (on AMIGA) / JUNK_005B (on MSDOS)

felipesanches commented 1 year ago

For the record, I am using the meld tool to make these visual diffs comparing the disasm output of two different releases, as seen on the screenshots above.

sudo apt-get install meld ;-)