diff --git a/docs/changelog.txt b/docs/changelog.txt index a59db93ff..15798ee67 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -275,6 +275,8 @@ USERS FWRITE_APPEND) is now stored in save files. This fixes a bug where the output file would be reopened in the wrong mode (ab) when reloading a saved game. ++ Fixed dragon random movement behavior. A compatibility check + has been added for 2.80 to 2.92 non-random dragon movement. + save_slots is now enabled by default for consoles. (Spectere) + editor_show_thing_toggles is now enabled by default. - board_editor_hide_help and robot_editor_hide_help are no diff --git a/src/game_update_board.c b/src/game_update_board.c index 9bea7e6f9..75eb1a2dc 100644 --- a/src/game_update_board.c +++ b/src/game_update_board.c @@ -31,6 +31,7 @@ #include "idarray.h" #include "idput.h" #include "robot.h" +#include "world.h" #include "util.h" #include "audio/sfx.h" @@ -468,7 +469,6 @@ void update_board(context *ctx) } break; } - // Cw/Ccw case CW_ROTATE: case CCW_ROTATE: @@ -787,21 +787,25 @@ void update_board(context *ctx) { if(!slow_down) { - // This is pretty weird, but I have to go by the ASM for now int spread_speed = current_param & 0x03; - int current_cycle = (current_param & 0x3C) >> 2; - - spread_speed |= spread_speed << 1; + int current_cycle = (current_param & 0x3C) >> 2; + + // This was changed from speed*5 some time between 2.04 and 2.07. + // Despite MegaZeux 2.x having changed the speed setting range + // from 1-4 to 1-8, this setting has always been two bits. + // BUG: The newer behavior seems to be a broken attempt at speed*3. + if(mzx_world->version >= V251) + spread_speed |= spread_speed << 1; + else + spread_speed |= spread_speed << 2; if(spread_speed == current_cycle) { int new_x, new_y; current_color = level_color[level_offset]; // Clear cycle - // BUG: This leaves the lowest cycle count bit set, which can't - // be fixed right now (compatibility). Seems like Alexis planned - // to extend the speed range in 2.00 but didn't fully implement - // it; the param dialog has the "wrong" bound too... + // BUG: This leaves the lowest cycle count bit set. + // This bug exists even in MegaZeux 1.x. current_param &= 0xC7; // Put slimes all around @@ -838,6 +842,7 @@ void update_board(context *ctx) else { // Increase cycle + // BUG: corrupting overflow. level_param[level_offset] = current_param + 4; } } @@ -951,6 +956,9 @@ void update_board(context *ctx) level_param[level_offset] = current_param & 0xE7; // One out of 8 moves is random + // This was broken in the port for a long time. + if(mzx_world->version < VERSION_PORT || mzx_world->version >= V293) + rval = Random(8); if(!(rval & 0x07)) { @@ -1496,7 +1504,7 @@ void update_board(context *ctx) level_param[level_offset] = 0x20; } - level_id[level_offset] = 38; + level_id[level_offset] = (char)EXPLOSION; play_sfx(mzx_world, SFX_EXPLOSION); } else diff --git a/src/legacy_rasm.c b/src/legacy_rasm.c index 1fdef036d..fd17e0df5 100644 --- a/src/legacy_rasm.c +++ b/src/legacy_rasm.c @@ -2968,10 +2968,10 @@ boolean legacy_convert_v1_program(char **_dest, int *_dest_len, if(!dest) return false; + dest[0] = 0xff; + dest[1] = 0; *_dest = dest; *_dest_len = 2; - *_dest[0] = 0xff; - *_dest[1] = 0; *_cur_prog_line = 0; return true; } diff --git a/testworlds/1.00/008 slimeblob.mzx b/testworlds/1.00/008 slimeblob.mzx new file mode 100644 index 000000000..d324c2c2d Binary files /dev/null and b/testworlds/1.00/008 slimeblob.mzx differ diff --git a/testworlds/1.00/008 slimeblob.txt b/testworlds/1.00/008 slimeblob.txt new file mode 100644 index 000000000..bbfe1f3fc --- /dev/null +++ b/testworlds/1.00/008 slimeblob.txt @@ -0,0 +1,3 @@ +Title: Slime Spread Speed Test +Author: Alice Rowan +Desc: Test MegaZeux 1.x slime spread speeds 1-4 and '5-8', including bugs. diff --git a/testworlds/2.51/013 slimeblob.mzx b/testworlds/2.51/013 slimeblob.mzx new file mode 100644 index 000000000..1f7c2873a Binary files /dev/null and b/testworlds/2.51/013 slimeblob.mzx differ diff --git a/testworlds/2.51/013 slimeblob.txt b/testworlds/2.51/013 slimeblob.txt new file mode 100644 index 000000000..8e3c665c8 --- /dev/null +++ b/testworlds/2.51/013 slimeblob.txt @@ -0,0 +1,3 @@ +Title: Slime Spread Speed Test +Author: Alice Rowan +Desc: Test MegaZeux 2.x slime spread speeds 1-4 and '5-8', including bugs. This test does NOT work prior to 2.07, as older versions use 1.x slime speeds. diff --git a/testworlds/2.93/008 Dragon Random.mzx b/testworlds/2.93/008 Dragon Random.mzx new file mode 100644 index 000000000..ce83cc7ea Binary files /dev/null and b/testworlds/2.93/008 Dragon Random.mzx differ