UndertaleModTool icon indicating copy to clipboard operation
UndertaleModTool copied to clipboard

Disasembler doesn't include object index for index 0 for dot notation.

Open misternebula opened this issue 8 months ago • 3 comments

Describe the bug

For dot notation (https://manual.gamemaker.io/monthly/en/GameMaker_Language/GML_Overview/Addressing_Variables_In_Other_Instances.htm), using the first game object results in no asset index in the disassembly.

For example, take if (obj_choicer_old.choiced == false). This incorrectly disassembles to:

push.v choiced
pushi.e 0
cmp.i.v EQ

This is because obj_choicer_old is the first Game Object in SURVEY_PROGRAM's Game Object list. If it was instead the fourth game object, it would correctly disassemble to:

push.v 3.choiced
pushi.e 0
cmp.i.v EQ

I'm not sure if this affects pop opcodes too, but it probably does. I've got no proof of that though, so I'll leave this issue just for push.

Reproducing steps

  • Open data.win of SURVEY_PROGRAM
  • Go to gml_Object_obj_schoollobbycutscene_Step_0
  • Go to Disassembly tab
  • Search for choiced
  • Will find push.v choiced instead of expected push.v 0.choiced

Setup Details

  • UTMT Version: 7.0.0.0, also affects 6.x.x.x and 5.x.x.x, and probably all other versions too.
  • OS: Windows 10
  • Game: All games, anything where the first Game Object is used in dot notation. Can test using SURVEY_PROGRAM

misternebula avatar Apr 26 '25 03:04 misternebula

Do you try to retry that with lasted version of UTMT?

Caritusy avatar Jun 04 '25 04:06 Caritusy

~~probably not a disassembler issue, instead most likely either UTMT's or GM's compiler being weird~~ nvm

CST1229 avatar Jun 04 '25 12:06 CST1229

No, this is technically a disassembler issue. (But a very minor/low priority one that we can address if/when we change other assembly syntax.)

colinator27 avatar Jun 04 '25 12:06 colinator27