>>Features Added in 2.92<<
Emscripten Port
There's also a new experimental Emscripten port (thanks asie), which is a pretty big deal, as it means DMZX will have a web player in the near future and you may also soon be able to set up your MZX game as an embedded webapp on itch.io or the like.
However, the front end that would make embedding user-friendly is still pending, and there won't be an official release package until it's done. Board and Robotic performance may be terrible at best depending on your device; this is a problem that's currently being worked on and should be largely resolved by the next minor version release at latest.
Android Port
There's also a new experimental Android port (thanks asie). No build for this yet, but it'll be up in the near future hopefully. Currently requires a keyboard to use, minimum API level 16 (Android 4.1).
Switch Port
There's a new Switch port, complete with a build and ready to go! Wow! You probably already saw the link above.
Joystick Improvements
NOTE: much of this is also in this document in more detail which you should also read.
Aside from the ports, this is likely the biggest new feature of 2.92. MegaZeux can now automatically detect many USB/Bluetooth gamepads on PC and automatically map them to a new feature called "joystick actions", which correspond largely to XInput buttons/axes. These actions can be detected directly via Robotic and have separate UI behavior, and should make it possible to design a game for gamepad support without worrying about joystick-specific binding as in previous MZX versions.
The joystick actions available and their default in-game configuration (derived from Caverns of Zeux) are as follows:
joy[1,16].a = key_space
joy[1,16].b = key_delete
joy[1,16].x = key_return
joy[1,16].y = key_s
joy[1,16].start = key_return
joy[1,16].select = key_escape
joy[1,16].lshoulder = key_insert
joy[1,16].rshoulder = key_p
joy[1,16].ltrigger = key_f3
joy[1,16].rtrigger = key_f4
# dpad
joy[1,16].up = key_up
joy[1,16].down = key_down
joy[1,16].left = key_left
joy[1,16].right = key_right
# Analog sticks
joy[1,16].l_up = key_up
joy[1,16].l_down = key_down
joy[1,16].l_left = key_left
joy[1,16].l_right = key_right
joy[1,16].r_up = key_up
joy[1,16].r_down = key_down
joy[1,16].r_left = key_left
joy[1,16].r_right = key_right
The
start and
select actions have a special global default behavior that opens the main menu or game menu by default. The main menu and game menu are real menus again and allow access to the exit, help, settings, save, and load menus (if allowed by their respective counters/settings), and they override any other provided mapping for
start and
select unless both ENTER_MENU and ESCAPE_MENU are set to 0 (this is why there's a second mapping for "key_return" on
x by default).
The
rshoulder action will not be mapped by consoles that use a button to activate their onscreen keyboard (NDS and 3DS).
The console port releases of MZX have also been updated to use the joystick actions instead of hardcoded keys. The Nintendo consoles move a/b/x/y to match the button labeling for those consoles, and the PSP and GP2X default mappings have a similar face button positioning.
For older games, it is possible to use the game.cnf file to map actions to keys instead of mapping joystick axes/buttons to keys. For example, a Demon Earth config might look like:
joy[1,16].a = key_a
joy[1,16].b = key_s
joy[1,16].x = key_return
joy[1,16].y = key_return
joy[1,16].lshoulder = key_space
joy[1,16].rshoulder = key_space
The joystick axis theshold for simulated keypresses can now be globally configured with the "joy_axis_threshold" config setting. By default, it is 10000 (the same as before).
The main thing here though is that joysticks can now be read directly from Robotic.
This counter enables or disables the default simulated key press functionality for joysticks. If your game is reading joystick inputs directly, you'll probably want to use this. Note this doesn't disable the
start and
select special features mentioned above, which only go away if ENTER_MENU and ESCAPE_MENU are both set to 0.
set "joy_simulate_keys" to 0
This counter checks if a joystick (1 through 16) is active. Returns 1 if it's active, 0 if it isn't, and -1 if the joystick number is invalid.
if "joy1active" = 1 then "is_active"
This counter reads joystick (1 through 16) inputs. Available actions are those listed above, which return 1 if pressed, 0 if not pressed, or -1 if the counter has been used incorrectly.
if "joy1.a" = 1 then "select"
Also available are axes
axis_lx,
axis_ly,
axis_rx,
axis_ry,
axis_ltrigger, and
axis_rtrigger, which return values in the range of [-32768,32767] (or -1 if the counter has been used incorrectly).
if "joy1.axis_lx" < -10000 "#go_left"
if "joy1.axis_lx" > 10000 "#go_right"
if "joy1.axis_ly" < -10000 "#go_up"
if "joy1.axis_ly" > 10000 "#go_down"
Finally, some platform specific enhancements:
- NDS dpad is now a hat instead of buttons.
- 3DS dpad is now a hat instead of buttons, and the circle pad uses axes 1 and 2.
- Wii Classic Controller and Gamecube controller triggers now have analog axes. A bug with the Guitar Hero controller's whammy bar axis has been fixed.
For the NDS, 3DS, PSP, Wii, and GP2X, some button behaviors have been altered due to the new enhancements, but they should now generally all be consistent with each other. Some notable differences between platforms are that the Wii/GC triggers are L/R (as these are the analog triggers) instead of ZL/ZR/Z, and that many axes and buttons simply do not exist on some platforms.
Reality Adlib Tracker (RAD) Music
By "popular" "demand", MegaZeux can now play RAD files. Both v1 and v2 files are supported natively, and all files available from the RAD public fileserver have been tested and play. All files are played with the Opal OPL emulator supplied with the official RAD player. There are currently no plans to add support for any other Adlib formats.
Renderer Enhancements
- Fake fullscreen is now available with the "fullscreen_windowed" config option. Set this config option to 1 to enable fake fullscreen. The provided fullscreen resolution will be ignored with this setting, and MZX will instead use the current desktop resolution.
- Mouse grabbing can now be enabled with the "grab_mouse" config option. Set this config option to 1 to enable this (disabled by default). It's nice mainly for playing mouse-driven action games in windowed mode.
- A new scaling shader has been added for the GLSL renderer called "sai". It is an implementation of Scale 2xSaI that uses a sigmoid function to make it look less blurry and more like the regular 2xSaI algorithm.
- The overlay renderers have been replaced with the new "softscale" renderer in builds using SDL2 (i.e. any official build). This renderer should run MUCH faster than the overlay renderers and not cause crashes. Windows users might see a little bit of a boost over opengl1 due to Direct3D being used as a backend, and Mac users might see a bigger boost over opengl1 due to native YUV texture support (including subsampling a la overlay2 if force_bpp=16 is provided). This is the default renderer used by the new Switch port.
- Crashes in the software renderer have been fixed.
- The opengl1 renderer no longer uses NPOT textures, which should increase performance a little on some older systems.
- The current renderer can now be changed from the Settings menu. This feature is experimental.
Robotic Enhancements
- Added TIME_MILLIS counter. This counter returns the milliseconds component of the current time (TIME_SECONDS etc).
- Added FREAD_LENGTH and FWRITE_LENGTH counters. These counters return the current length of the read or write file.
- Added MOD_LOOPSTART and MOD_LOOPEND counters. These counters can be used to change the loop positions of the current playing OGG or WAV file. They do not modify the existing file (when the file is reloaded the loop positions will reset to the originals).
- Added the SPR#_Z counter. This counter can be used to influence the order sprites are displayed in on the screen; higher SPR#_Z values will result in the sprite being drawn over sprites with lower SPR#_Z values.
- SPR#_OFF is now readable.
- Added SET $string SAVE_ROBOT. Like with the regular SAVE_ROBOT, the data output by this counter may change in future versions, and should only be relied upon to be SOME source code representation of the Robot's current program. Particularly, label zaps and appending separate programs with this feature MAY (but not necessarily WILL) conflict with future features.
- Fixed a long-standing bug where IF &$string& and COPY BLOCK X Y W H &$string& T could not resolve to IF $string or COPY BLOCK $string, which was inconsistent with all other commands that could specially take a string for a parameter. No compatibility layer is currently provided as the buggy behavior was pretty useless and probably never intentionally or accidentally used.
- Fixed a long-standing bug where various features relying on a robot's X and Y position would use an out-of-date position instead of the robot's real position. This only affects worlds saved from MZX 2.92 or later.
- Fixed a long-standing bug where FWRITE on an unset or zero-length $string would not write the delimiter. This only affects worlds saved from MZX 2.92 or later.
- The MOD SAM works again. Currently only works with libxmp and the command is version locked to DOS worlds because seriously, who even uses MOD SAM?
- Fixed numerous other bugs and compatibility issues.
General Enhancements
- Loaded OGG files can now use the LOOPEND tag instead of the LOOPLENGTH tag. For compatibility, if both are present LOOPLENGTH will be preferred over LOOPEND. LOOPEND will be ignored if it is a smaller value than LOOPSTART.
- The default boot.dol for the Wii port is now the MegaZeux executable instead of MZXRun.
- The updater should now always be able to determine the executable path.
- Massive improvements to checkres.
- Experimental OpenBSD pledge(2) and unveil(2) support, plus several OpenBSD-specific compile warnings have been resolved. Pledge support is enabled by default for the utils and disabled by default for MegaZeux and MZXRun.