dMZX Forums: #98485 Freezes on level transition -> Archived MegaZeux Bugs -> Tracker

Jump to content

Report ID 328 Title #98485 Freezes on level transition
Product Archived MegaZeux Bugs Status Fixed (Severity 3 - Medium)
Version GIT Fixed in 2.84
Introduced In Version GITOperating System Windows XP SP3 (x86)

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #328: #98485 Freezes on level transition

#1 User is offline  
Terryn 

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

Posted 09 January 2011 - 04:26 AM

DoZ Q1 2011 entry #98485 (Thanatos Insignia) freezes in the latest GIT, both debytecode and normal MZX. Reach the level boundary at the end of the first level, and the game freezes (save for music) and MZX takes up a full processor core. Freeze appears between 410b0cd and cd95c1e.
angelic stream - shed sanguine - ill-adapt - avis - para/lyser - renaissance - dead tangent - phosphene blur - birth breeds death - ________ - painted glass - lagniappe

<Exophase> HES STEALING MAH AIRSHIP!!!!!!11111111


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 15)

#2 User is offline  
Old-Sckool 

  • megazeux breaker
  • PipPipPipPip
  • Group: Members
  • Posts: 649
  • Joined: 07-June 05
  • Gender:Male

Posted 14 January 2011 - 05:58 AM

The hang-up is caused by this segment of code in the Finish robot.
: "finish"
send "all" to "finish"

<Nadir> mzxers don't make GAMES, usually
<phthalocyanine> they make experiences.
<Nadir> demos, more like
<Nadir> a glimpse into what could have been if mzx wasn't such a bore to work with
<Nadir> actually, i'm being unfair
<Nadir> i would have made mzx games if it was capable of running on more than 20 computers worldwide in 1998
<Nadir> >:D

<%Alice> functor
<%nooodl> i hear C++ has a thing called functors and they're completely different from Haskell functors...
<rorirover> the result is the most horrid thing in C++, it's basically black magic and it transforms any code you're writing into some eldritch monstrosity

#3 User is offline  
Lachesis 

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

Posted 14 January 2011 - 06:42 PM

Can somebody answer me once and for all: Is "all" supposed to be self-inclusive? x(
"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

#4 User is offline  
Terryn 

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

Posted 14 January 2011 - 07:40 PM

And I will explain for the tenth freaking time: YES, it is. It was self-inclusive throughout the entirety of MZX's DOS reign, and was only self-exclusive during the port as a bug, during which I wrote the help file entry describing its then-present action. This was eventually corrected, but I forgot to change the help file to match.
angelic stream - shed sanguine - ill-adapt - avis - para/lyser - renaissance - dead tangent - phosphene blur - birth breeds death - ________ - painted glass - lagniappe

<Exophase> HES STEALING MAH AIRSHIP!!!!!!11111111

#5 User is offline  
Lachesis 

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

Posted 14 January 2011 - 09:03 PM

ok
"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 offline  
Lachesis 

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

Posted 03 August 2011 - 08:22 PM

Taking a look into this since it's what's holding up the release. Robot.c is scary
"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 offline  
Lachesis 

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

Posted 03 August 2011 - 11:14 PM

As a matter of fact, Old-Sckool was right on the mark. Lancer's code broke in that revision due to a change in label caching combined with him forgetting to LOCK SELF. I believe in that same revision code was added to make sure GOTO/SEND ALL actually did something. While I don't have the code in front of me now, from what I recall it'd just keep going since the pointer that is cached is the command after the label. I'm going to try building the two sources and test this hypothesis out, but a compatibility fix would hopefully be as easy as caching next(+1?) instead of i from versions 2.80 to 2.83... I don't know the extent of changes after the fact that rely on this new behavior, though. Alternatively, Lancer could fix his obviously broken code
"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 offline  
Lachesis 

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

Posted 08 August 2011 - 11:20 PM

Proposed fix:

src/run_robot.c line 2052
...
        send_robot(mzx_world, robot_name_buffer, label_buffer, 0);

        // Compatibility fix for self-inclusive send commands directly preceeded by the target label
        if (mzx_world->version <= 0x0253 &&
            cur_robot->cur_prog_line + 2 + cur_robot->program_bytecode[cur_robot->cur_prog_line] == old_pos)
            cur_robot->cur_prog_line = old_pos;

        // Did the position get changed? (send to self)
...


What would be more likely is putting that in a function and calling it for every send command... this only deals with SEND "robot" "label"
"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 offline  
ajs 

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

Posted 15 August 2011 - 05:01 PM

I think you're on the right track; it makes a lot of sense that the compatibility fix we put in would break in this case, and you're also right that it's sloppy code causing the "freeze".

However, I'm not sure adding workaround code to another place is better than just turning off the original compatibility fix (re: label caching) if the world is 2.80 <= version < 2.84.

--ajs.

#10 User is offline  
Lachesis 

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

Posted 15 August 2011 - 05:09 PM

I had considered that, but I ultimately didn't try it because (if I remember correctly) the label caching code had no access to the current MZX world version... probably not a huge deal to change, really, though I haven't investigated it too deep.
"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

#11 User is offline  
Lachesis 

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

Posted 29 April 2012 - 06:26 PM

What's the plan for this? I like the idea of turning off the original fix for 2.80 <= ver < 2.84.
"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

#12 User is offline  
Lachesis 

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

Posted 18 May 2012 - 02:15 AM

Updating version to: None

Here's a dependency tree of the line numbers where every function is called that needs *mzx_world passed through it so this fix can be made in the label-caching code (counting the load robot functions too because I like consistency and those just have a "version" int) unless there is an easier way of getting the world version there for every case. + means that this function currently has access to *mzx_world

cache_robot_labels()
+src/counter.c:2564 
+src/counter.c:2601 in int set_counter_special(struct world *mzx_world, etc)
src/robot.c:277
src/robot.c:349 in void load_robot(struct robot *cur_robot, FILE *fp, int savegame, int version)
src/robot.c:3145 in void prepare_robot_labels(struct robot *cur_robot)


  • void load_robot(struct robot *cur_robot, FILE *fp, int savegame, int version)
    src/robot.c:173 in struct robot *load_robot_allocate(FILE *fp, int savegame, int version)
    +src/world.c:1492 in static void load_world(struct world *mzx_world ...)
    


    • struct robot *load_robot_allocate(FILE *fp, int savegame, int version)
      src/board.c:291 in __editor_maybe_static void load_board_direct(struct board *cur_board, FILE *fp, int savegame, int version)
      +src/mzm.c:447
      +src/mzm.c:464 in int load_mzm(struct world *mzx_world ...)
      


      • __editor_maybe_static void load_board_direct(struct board *cur_board, FILE *fp, int savegame, int version)
        src/board.c:386 in struct board *load_board_allocate(FILE *fp, int savegame, int version)
        


        • struct board *load_board_allocate(FILE *fp, int savegame, int version
          +src/world.c:1485 in static void load_world(struct world *mzx_world ...)
          


  • void prepare_robot_labels(struct robot *cur_robot)
    +src/counter.c:2465
    +src/counter.c:2515 in int set_counter_special(struct world *mzx_world, etc)
    src/robot.c:251 in void load_robot(struct robot *cur_robot, FILE *fp, int savegame, int version)
    src/robot.c:447 in void save_robot(struct robot *cur_robot, FILE *fp, int savegame)
    src/robot.c:1270 in static int send_robot_direct(struct robot *cur_robot, const char *mesg)
    src/robot.c:2821 in static void duplicate_robot_direct(struct robot *cur_robot, struct_robot *copy_robot, int x, int y)
    +src/run_robot.c:921
    +src/run_robot.c:1285 in void run_robot(struct world *mzx_world, etc)
    


    • void save_robot(struct robot *cur_robot, FILE *fp, int savegame)
      src/board.c:552 in int save_board(struct board *cur_board, FILE *fp, int savegame)
      +src/mzm.c:156 in void save_mzm(struct world *mzx_world ...)
      +src/world.c:719 in int save_world(struct world *mzx_world ...)
      


      • int save_board(struct board *cur_board, FILE *fp, int savegame)
        +src/world.c:707 in int save_world(struct world *mzx_world ...)
        


    • static int send_robot_direct(struct robot *cur_robot, const char *mesg)
      +src/robot.c:1383
      +src/robot.c:1391 in void send_robot(struct world *mzx_world ...)
      +src/robot.c:1405 in int send_robot_id(struct world *mzx_world ...)
      +src/robot.c:1411 in int send_robot_self(struct world *mzx_world ...)
      +src/robot.c:1421
      +src/robot.c:1426 in void send_robot_all(struct world *mzx_world ...)
      


    • static void duplicate_robot_direct(struct robot *cur_robot, struct_robot *copy_robot, int x, int y)
      src/robot.c:2884 in int duplicate_robot(struct board *src_board, struct robot *cur_robot)
      src/robot.c:2907 in void replace_robot(struct board *src_board, struct robot *src_robot, int dest_id)
      


      • int duplicate_robot(struct board *src_board, struct robot *cur_robot)
        +src/run_robot.c:501 in static void copy_xy_to_xy(struct world *mzx_world ...)
        +src/run_robot.c:559 in static void copy_board_to_board_buffer(struct world *mzx_world ...)
        +src/run_robot.c:2918
        +src/run_robot.c:2955
        +src/run_robot.c:4282
        +src/run_robot.c:4330 in void run_robot(struct world *mzx_world ...)
        


      • void replace_robot(struct board *src_board, struct robot *src_robot, int dest_id)
        +src/run_robot.c:2826
        +src/run_robot.c:2838
        +src/run_robot.c:2861
        +src/run_robot.c:2888 in void run_robot(struct world *mzx_world ...)
        

"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

#13 User is offline  
Lachesis 

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

Posted 18 May 2012 - 02:17 AM

Updating version to: GIT


That's getting REALLY annoying.
"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

#14 User is offline  
Lachesis 

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

Posted 19 May 2012 - 05:04 AM

Updating status to: Proposed Fix

Fixed in GIT dd7798ac39. I added a copy of mzx_world->version to struct robot through load_robot() so I could add a compatibility fix to the label caching function. Please verify this fix.
"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

#15 User is offline  
Lachesis 

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

Posted 24 May 2012 - 01:08 AM

Updating status to: Fixed
"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

#16 User is offline  
Terryn 

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

Posted 27 May 2012 - 07:31 PM

Moving to: Archived MegaZeux Bugs


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

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


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