cleolibrary / CLEO-Redux

Experimental JavaScript runtime for GTA 3D era games/GTA IV/Bully
https://re.cleo.li
Other
213 stars 20 forks source link

Memory Access does not work in VC/SA in delegate mode (has a workaround) #6

Closed x87 closed 3 years ago

x87 commented 3 years ago

there are multiple Memory.Read/Memory.Write commands in vc.json and sa.json for both CLEO PC and CLEO Android:

https://library.sannybuilder.com/#/vc?q="READ_MEMORY" https://library.sannybuilder.com/#/sa?q="WRITE_MEMORY"

if CLEO runs in delegate mode Memory.Read and Memory.Write use wrong opcodes (0DD8 and 0DD9), leading to the game crash.

To fix that, platform tags should be implemented: https://github.com/sannybuilder/library/issues/38

Temporary solution: delete two commands from vc.json and sa.json:

,
        {
          "input": [
            {
              "name": "address",
              "type": "int"
            },
            {
              "name": "size",
              "type": "int"
            },
            {
              "name": "ib",
              "type": "bool"
            }
          ],
          "output": [
            {
              "name": "result",
              "type": "any",
              "source": "var_any"
            }
          ],
          "id": "0DD8",
          "name": "READ_MEMORY",
          "num_params": 4,
          "class": "Memory",
          "member": "Read",
          "attrs": {
            "is_overload": true,
            "is_static": true
          },
          "short_desc": "Reads a value from the game memory"
        },
        {
          "input": [
            {
              "name": "address",
              "type": "int"
            },
            {
              "name": "value",
              "type": "any"
            },
            {
              "name": "size",
              "type": "int"
            },
            {
              "name": "ib",
              "type": "bool"
            },
            {
              "name": "vp",
              "type": "bool"
            }
          ],
          "id": "0DD9",
          "name": "WRITE_MEMORY",
          "num_params": 5,
          "class": "Memory",
          "member": "Write",
          "attrs": {
            "is_overload": true,
            "is_static": true
          },
          "short_desc": "Writes a value to the game memory"
        }
x87 commented 3 years ago

Fixed in v0.7.4