dMZX Forums: Conversion of && for counters named after values -> MegaZeux Bugs -> Tracker

Jump to content

Report ID 240 Title Conversion of && for counters named after values
Product MegaZeux Bugs Status Confirmed (Severity 1 - Low)
Version GIT (debytecode) Fixed in -
Introduced In Version GIT (debytecode)Operating System All Platforms

Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

Report ID #240: Conversion of && for counters named after values

#1 User is offline  
Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,961
  • Joined: 12-October 00
  • Gender:Male

Posted 23 January 2010 - 08:58 PM

This is probably best shown as a real-world example. Oppo does a comparison as follows:

set "px" "&playerx&"
set "py" "&playery&"

This sets px and py to the values contained in counters NAMED after the values in playerx and playery (the "10" and "11" counters, respectively). They are both undeclared counters, and therefore have a value of 0. However, this is the same code as parsed by debytecode:

set px to `(playerx)`
set py to `(playery)`

This sets px and py to the values of playerx and playery, respectively. They have respective values of 10 and 11.

This difference in parsing messes up Oppo's death animation.


Page 1 of 1  
  • Cannot start a new Issue
  • You cannot reply to this issue

Replies (1 - 8)

#2 User is offline  
ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 23 January 2010 - 11:25 PM

At the moment I'm not going to do anything about this. The current philosophy in debytecode is to convert any external bytecode input into source, then compile it back when necessary for interpretation. This process is key to any future modification of the bytecode format, optimizer, etc.

With the removal of save_bc and save_robot it is already impossible to apply this method and retain full compatibility. This issue is arguably more serious, but compounds the larger issue. In future, it may be necessary to ship a compatibility "layer" that does not do the conversion to source at runtime. This would eventually include tr_msg(), the expression parser, subset of the bytecode VM, and probably some other stuff I haven't thought of. But I don't want to consider this kind of backward solution until we ascertain how important it is, how many games are broken, etc.

--ajs.

#3 User is offline  
Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 01 October 2010 - 08:19 PM

Sorry I never saw this until now, I should read the bug tracker.

The legacy decompiler's decision here is correct. The `` around the name forces interpolation into a string name, like with the original, not an expression.

The problem here is a limitation in the current bytecode, which stores expressions as names of this format. So it can't disambiguate between the two. If debytecode progressed to the point where it compiled expressions instead (or at least stored them in some other format) this problem would go away.
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx

#4 User is offline  
ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 02 January 2011 - 08:00 PM

Updating status to: Flagged For Future Version

There won't be any workaround for this issue for 2.83b.

--ajs.

#5 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 12 December 2012 - 05:37 PM

Updating version to: None

[terrible idea removed]

:pinkieshrug:
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#6 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 12 December 2012 - 05:38 PM

Updating version to: GIT (debytecode)

$^!$!
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#7 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 29 June 2017 - 07:20 AM

Updating status to: Confirmed

My previous suggestion was really stupid, but this one isn't.

set px to `<>(playerx)`
set py to `<>(playery)`


Since the interpolation brackets are empty, they'll be ignored. Because the name doesn't start with a parenthesis, it will be interpreted as a name instead of an expression.

This hack will only be required until the bytecode representation of names and expressions gets changed, probably in 3.01.

EDIT: tested and works. Just needs to be added to the disassembler.

set local 10
set `10` -10

set a `(local)`
set b `<>(local)`

:l
* "~fa: (a) b: (b)"
cycle 1
goto l

"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#8 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 30 June 2017 - 05:24 AM

Alternatively (and probably a much better idea), this can be detected and the <> can be inserted into the bytecode on compilation.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#9 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 20 January 2018 - 04:34 PM

Update on this: the plan is to replace <> and () interpolation with unified interpolation brackets []. This would open up ()/`()` for expressions and `fn()` for functions.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2024  IPS, Inc.