Super MegaZeux: Difference between revisions

From MZXWiki
Jump to navigation Jump to search
No edit summary
 
(53 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''SMZX Mode''' is the name for an alternative graphics mode accessible through MegaZeux. Its first mode (SMZX Mode 1) was first introduced by [[MadBrain]] in a fork of 2.51s3.2; this original version was referred to as Super MegaZeux 100 Alpha (smzx100a). It relied on a little-documented [[text mode]] supported almost exclusively by nVidia and ATi chipsets. SMZX Mode 1 was induced into [[MegaZeux#MZXak|MZXAk]], only to be removed in 2.60. SMZX only returned on the release of MZX 2.69, sporting the original mode plus the more advanced Mode 2. Mode 3 was introduced in [[MegaZeux#SDL Port|2.80]], since it did not correlate to an actual hardware text mode and MZX no longer actually used text mode.
{{Game
|title = Super MegaZeux
|image = And.png
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]
|company = n/a
|released = n/a
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69
|vault = n/a
}}


In the most recent versions of MegaZeux, SMZX Mode can be accessed by setting the SMZX_MODE counter to 1, 2, or 3. In the editor, one can change SMZX Mode by pressing F11.
'''Super MegaZeux''' (or '''SMZX mode''') is the name for an alternative graphics mode accessible through MegaZeux. Its first mode (SMZX mode 1) was first introduced by [[MadBrain]] in a fork of 2.51s3.2; this original version was referred to as Super MegaZeux 100 Alpha (smzx100a). It relied on a little-documented [[text mode]] supported by NVIDIA, C&T, ATI, and possibly other chipsets. SMZX mode 1 was included in [[MegaZeux#MZXak|MZXAk]], but not in any other MZX releases until MZX 2.69, which sported the original mode plus the more advanced mode 2. Mode 3 was introduced in [[MegaZeux#SDL Port|2.80]], and does not correlate to an actual hardware text mode (as MZX no longer actually relied on text mode).


===How It Works===
SMZX mode can be accessed by setting the '''SMZX_MODE''' counter to 1, 2, or 3. In the editor, the current SMZX mode can be changed with the Select Screen Mode dialog (F11).
SMZX Mode halves the vertical screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.


Each pixel in SMZX can be either color I (represented in MZX mode as two 'off' chars), color II ('on' and 'off), color III ('off' and 'on') ad color IV (both 'on').
==How it works==
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.


Mode 1, the original mode, simply blended every two horizontal pixels together. This allowed each character to have the original foreground and background colors plus two intermediate blends. The usefulness of this was at first only shown in making smooth gradient fills and grayscale images.
Each "pixel" in SMZX is derived from a horizontally adjacent pair of text mode pixels in the following manner:
{|class="wikitable"
|+
!Color
!Left pixel
!Right pixel
|-
|Color I
|'''off'''
|'''off'''
|-
|Color II
|'''on'''
|'''off'''
|-
|Color III
|'''off'''
|'''on'''
|-
|Color IV
|'''on'''
|'''on'''
|}


Mode 2 was the first to allow 4 distinct colors for each character. It works like this:
If colors II and III seem backwards to experienced programmers, it is not a mistake; this is how the original DOS versions defined these colors.


* All colors are defined in pairs of 2 hex digits.
* Color I uses the background color as both digits.
* Color II uses the foreground color as the first digit and the background as the second.
* Color III uses the background color as the first digit and the foreground as the second.
* Color IV uses the foreground color as both digits.


Mode 3, which was added with the SDL port, uses a palette of 256 separate colors as opposed to 16 foreground and 16 background colors (each color, in hex, is a 2-digit pair consisting of the background color and the foreground color) Characters can access these as following:
===SMZX Mode 1===
SMZX mode 1, the original mode, generates two new palette colors as intermediates of the two normal-mode colors specified by the palette. This is the simplest Super MegaZeux mode to use, and is used in conjunction with a standard 16 color MZX palette. The example below uses the default palette for simplicity.


* Color I is the color itself, for example a character set to color 16 (which would normally be foreground 0 and background 1, hence 0x10) will show color 16 as color I.
{|class="wikitable"
* Color II is the color plus 1
|+SMZX Mode 1
* Color III is the color plus 2
!Palette color
* Color IV is the color plus 3
!Derived by
!Example (c4F)
|-
|Color I
|Background of specified palette
|42, 0, 0 (color 4)
|-
|Color II
|1/3 between BG and FG colors
|49, 21, 21
|-
|Color III
|2/3 between BG and FG colors
|56, 42, 42
|-
|Color IV
|Foreground of specified palette
|63, 63, 63 (color 15)
|}


hence yielding a set of 64 unique color palettes. The colors wrap around, so a character set to color 255 (0xFF) will use color 0 for color II, etc. When using mode 3, the protected UI colors are overwritten, causing the MegaZeux UI to mess up somewhat.


===Notable games that use SMZX mode===
===SMZX Mode 2===
SMZX mode 2 was the first mode to allow full user control over the 256 color palette.  It is internally identical to SMZX mode 1, but instead of generating the new colors from a user-defined 16 color palette, it allows direct reading and writing of all 256 colors either through the '''set color # to # # #''' command or with the counters '''SMZX_Rn''', '''SMZX_Gn''', and '''SMZX_Bn'''.
 
All colors are defined in pairs of 2 hex digits, represented below by 0xNN.  Given the same example palette as before, c4F, the colors are referenced as such:
 
{|class="wikitable"
|+SMZX Mode 2
!Palette color
!Derived by
!Example (c4F)
|-
|Color I
|Uses the background color for both hex digits
|Color #0x44 (68 decimal)
|-
|Color II
|Uses the FG for the most significant hex digit and the BG for the least significant hex digit
|Color #0xF4 (244 decimal)
|-
|Color III
|Uses the BG for the most significant hex digit and the FG for the least significant hex digit
|Color #0x4F (79 decimal)
|-
|Color IV
|Uses the foreground color for both hex digits
|Color #0xFF (255 decimal)
|}
 
(Note that colors II and III are backwards here to compensate for the backwards definitions of colors II and III from the character data. In practice, this won't matter to most users.)
 
 
===SMZX Mode 3===
SMZX mode 3, which was added with the SDL port, uses a palette of 256 completely independent colors as opposed to the effective 16 "base" colors of modes 1 and 2. By default, the colors for each subpalette cXX are defined as:
 
{|class="wikitable"
|+SMZX Mode 3
!Palette Color
!Derived by
!Example (c4F)
|-
|Color I
|The color in the palette specified by cXX
|Color #0x4F (79 decimal)
|-
|Color II
|Color I plus 1
|Color #0x50 (80 decimal)
|-
|Color III
|Color I plus 2
|Color #0x51 (81 decimal)
|-
|Color IV
|Color I plus 3
|Color #0x52 (82 decimal)
|}
 
Subpalettes 253 through 255 "wrap around" the palette, so e.g. subpalette 253 will contain colors 253, 254, 255, and 0.
 
As of MegaZeux 2.90, the color mappings of all 256 subpalettes in SMZX mode 3 can be customized either by using the '''SMZX_IDXx,y''' counter or by reassigning them in the SMZX [[palette editor]].
 
==Hardware details==
 
Super MegaZeux modes 1 and 2 are derived from a quirk of VGA (Video Graphics Array) compatible video adapters. In the video adapters that support SMZX, enabling the 8-bit color flag (0x40) of the Attribute Mode Control register (port 0x3C0 register 0x10) will combine two adjacent 4-bit EGA palette indices into a single 8-bit VGA palette index. This flag is intended for mode 13h only; enabling this in 14p text mode is undefined behavior. Most graphics chips do not render this 8-bit color text mode hack "correctly".
 
Example: given the text mode character byte 0x2d:
 
░░▓░▓▓░▓
 
With the palette 0x4F, this text mode byte is typically expanded to 4-bit color indices (hex):
 
4 4 f 4 f f 4 f
 
When the 8-bit color flag is enabled, two adjacent 4-bit indices are combined in a big endian manner to create a single 8-bit index (hex):
 
44  f4  ff  4f
 
These 8-bit indices are used to index the VGA palette. This is a "normal" SMZX mode implementation.
 
===Variations===
 
When combined with horizontal pixel panning (port 0x3C0 register 0x13), this combination usually behaves unexpectedly. For example, with a pixel panning value of 0x01 (shift left one pixel), and values ''x'' and ''y'' as 4-bit colors inherited from the neighboring characters, this same character combines into different colors:
 
x 4 4 f 4 f f 4 f y
 
x4  4f  4f  f4  fy
 
Another complication is that 9-pixel wide text modes will switch combination "parity" every other character (extra pixels in brackets):
 
4 4 f 4 f f 4 f [4] 4 4 f 4 f f 4 f [4]
 
44  f4  ff  4f  [4]4  4f  4f  f4  f[4]
 
Typically laptop adapters that perform forced 9-pixel or wider text mode scaling can have this behavior disabled with an Fn+function key combination.
 
===Vendors===
 
Chips & Technologies (all models that have been tested), NVIDIA adapters (from between some time in the '90s and some time in the late '00s), and the later VIA S3 Graphics "Chrome" adapters implement "normal" SMZX text mode as described above. No compatibility hacks are required for these vendors.
 
ATI graphics cards (from some time in the mid '90s until 2006) shift their text mode to the right by one pixel and seem to combine the 4-bit colors in a ''little'' endian manner, i.e. "4 f" are combined into "f4". To correct this, MegaZeux applies a horizontal pixel panning value of 0x01 and reverses the index nibbles of all SMZX colors when sending them to the VGA.
 
''Some'' early Oak Technologies chips seem to combine the 4-bit colors in a little endian manner as well, but without the unusual pixel shift that ATI cards had. This needs more testing. MegaZeux currently has no method of detecting this.
 
See the compatibility tables below for more info.
 
==Compatibility==
 
There are some minor and/or past issues with SMZX mode:
 
* Modes 1 and 2 only work on selected video hardware in DOS versions. Most DOS emulators, including DOSBox, do not support SMZX. Mode 3 was invented for the SDL port and has no hardware equivalent.
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an "ati_fix" file in the same directory as the MegaZeux executable was required. This causes MegaZeux to tweak the horizontal pixel shift register and reverse the nibble order of each color. Newer versions of MegaZeux attempt automatic detection.
** In MegaZeux 2.93 and above, the SVGA renderer can be used to draw SMZX in software. This enables its use on any SVGA-compatible graphics card, albeit at a performance cost compared to the EGA renderer.
* Prior to MegaZeux 2.90, the Super MegaZeux modes did not leave room in the palette for the reserved UI colors, and thus the UI borrowed the game colors. This resulted in the UI palette looking corrupted, especially in SMZX mode 3. As of MegaZeux 2.90, the UI is almost always drawn in normal mode with the protected palette.
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.
 
===Compatible hardware===
{|class="wikitable"
|+Hardware with Working SMZX Support
!Video Adapter
!Year
!Device(s)
!Last tested MZX version
!Reverse nibbles?
!Horizontal shift hack?
!Reported by
!Notes
|-
| ATI Mobility Radeon X300
| 2005
| ThinkPad T43
| smzxtest
| Yes
| Yes
| pagerorgy
|
|-
| ATI Radeon 7000 (AGP)
| 2001
| -
| smzxtest
| Yes
| Yes
| [https://tenforward.social/@kepstin/112034280088829489 kepstin]
|
|-
| ATI Radeon 8500
| 2001
| -
| 2.70
| Yes
| Yes
| ?
| ati_fix
|-
| ATI Radeon 9100
| 2003
| -
| smzxtest
| Yes
| Yes
| asie
|-
| ATI Radeon 9200 SE
| 2003
| -
| smzxtest
| Yes
| Yes
| [https://tenforward.social/@kepstin/112034114772189201 kepstin]
|
|-
| ATI Radeon 9550
| 2003
| -
| smzxtest
| Yes
| Yes
| [https://mastodon.social/@Vyothric/112129189285549784 Vyothric]
|
|-
| ATI Rage Mobility-P (AGP)
| 1999
| -
| smzxtest
| Yes
| Yes
| [https://tenforward.social/@kepstin/112034067154516729 kepstin]
|
|-
| ATI Rage XL (AGP)
| 1998
| -
| smzxtest
| Yes
| Yes
| [https://tenforward.social/@kepstin/112034187074718574 kepstin]
|
|-
| C&T CT65548
| 1995
| Toshiba Satellite 100CS
| 2.70
| No
| No
| Lachesis
|
|-
| C&T F65554
| 1997
| Toshiba Satellite Pro 465CDX
| 2.70
| No
| No
| [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]
|
|-
| NVIDIA GeForce 2 MX100/200/400
| 2001
| -
| 2.70, smzxtest
| No
| No
| Terryn, [https://tenforward.social/@kepstin/112034219820312089 kepstin]
|
|-
| NVIDIA GeForce 4 MX420
| 2002
| -
| smzxtest
| No
| No
| [https://tenforward.social/@kepstin/112034159810882881 kepstin]
|
|-
| NVIDIA GeForce FX 5200 (AGP)
| 2003
| -
| smzxtest
| No
| No
| [https://tenforward.social/@kepstin/112040355023624578 kepstin]
|
|-
| NVIDIA GeForce 6200 (AGP)
| 2005
| -
| 2.93
| No
| No
| [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]
|
|-
| NVIDIA GeForce 7600 GS (AGP)
| 2006
| -
| 2.93
| No
| No
| asie
|
|-
| NVIDIA RIVA TNT2
| 1999
| -
| 2.70
| No
| No
| ?
|
|-
| Oak Technology OTi037C
| 1988
| -
| smzxtest
| Yes
| No
| [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]
|
|-
| S3 UniChrome Pro (VIA VT3344)
| 2006
| Neoware CA21 (VIA CN700)
| 2.93
| No
| No
| Lachesis
|
|-
| Trident TVGA8900C
| 1991
| -
| smzxtest
| No
| No
| [https://mastodon.social/@Vyothric/112129321941807738 Vyothric]
|
|}
 
===Incompatible hardware===
 
The most common failure mode for SMZX in video adapters seems to be a "pseudo-SMZX" mode with a 320x350 resolution where, for every pair of text mode pixels, the left 4-bit color is selected instead of combining their respective 4-bit colors into an 8-bit color.
 
{|class="wikitable"
|+Hardware with No SMZX Support
!Video Adapter
!Year
!Device(s)
!Last tested MZX version
!Reported by
!Notes
|-
| 3dfx Voodoo 3 2000 (AGP)
| 1999
| -
| smzxtest
| [https://tenforward.social/@kepstin/112034014921477716 kepstin]
| Doubles left pixel.
|-
| ATI Mobility Radeon X1300
| 2006
| IBM ThinkPad T60
| smzxtest
| pagerorgy
| No doubling. (ATI detected)
|-
| ATI Radeon HD 3450 (B629)
| 2007
| -
| 2.93
| Lachesis
| No doubling. (ATI detected)
|-
| Cirrus Logic CL-GD5426
| 1993
| -
| smzxtest
| [https://mas.to/@dukeboitans/112100827940981639 dukeboitans]
| Doubles right pixel.
|-
| Cirrus Logic CL-GD5429
| 1994
| -
| smzxtest
| [https://mastodon.social/@Vyothric/112129058113328265 Vyothric]
| Doubles right pixel.
|-
| Cirrus Logic CL-GD5440
| 1995
| -
| smzxtest
| asie
| Doubles right pixel.
|-
| Intel 852GMV
| 2004
| Dell Inspiron 1150
| 2.93
| Lachesis
| Doubles left pixel.
|-
| Intel GMA 3100 (Intel G33)
| 2007
| Dell Inspiron 530
| 2.93
| Lachesis
| Doubles left pixel.
|-
| Intel HD Graphics 520
| 2016
| Acer Aspire E 15 E5-575G-53VG (Core i5-6200U)
| smzxtest
| Lachesis
| Doubles left pixel.
|-
| Intel HD Graphics 2000
| 2011
| Intel Core i5-2400
| smzxtest
| Lachesis
| Doubles left pixel.
|-
| Intel i740
| 1998
| -
| smzxtest
| [https://mastodon.social/@Vyothric/112129037636343700 Vyothric]
| Doubles left pixel.
|-
| Matrox MGA Millenium
| 1995
| -
| smzxtest
| [https://tenforward.social/@kepstin/112034329123345918 kepstin]
| No doubling.
|-
| Matrox Millenium G200 (AGP)
| 1998
| -
| smzxtest
| pagerorgy
| No doubling.
|-
| Matrox Mystique
| 1996
| -
| smzxtest
| asie
| No doubling.
|-
| NeoMagic MagicGraph128XD (NM2160)
| 1998
| IBM ThinkPad 560X
| 2.93
| Lachesis
| Doubles left pixel.
|-
| NeoMagic MagicGraph256AV (NM2200)
| 1998
| IBM ThinkPad 380Z
| smzxtest
| [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]
| Doubles left pixel.
|-
| NeoMagic MagicGraph256ZX (NM2360)
| 1999
| IBM ThinkPad 600X
| 2.93
| Lachesis
| Doubles left pixel.
|-
| NVIDIA GeForce GTX 660
| 2012
| -
| smzxtest
| Lachesis
| Doubles left pixel.
|-
| Paradise/Western Digital SVGA (unknown model)
| 1994
| Compaq LTE Elite 4/50CX
| 2.70
| [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]
| Doubles left pixel.
|-
| S3 86C805-P
| 1993
| -
| smzxtest
| [https://mastodon.social/@Vyothric/112129283018122906 Vyothric]
| No doubling
|-
| S3 Savage 2000
| 1999
| -
| smzxtest
| [https://mastodon.social/@Vyothric/112129105464362419 Vyothric]
| Doubles left pixel.
|-
| S3 Trio64V
| 1995
| Compaq 4704
| 2.93
| Elig
| Doubles left pixel.
|-
| S3 Trio64V2/DX
| 1996
| HP Brio 8314
| smzxtest
| [https://misskey.resonite.love/notes/9qwod5kpd2 GreaseMonkey]
| No doubling
|-
| S3 ViRGE 325
| 1995
| -
| smzxtest
| [https://mastodon.social/@Vyothric/112129242425621315 Vyothric]
| No doubling
|-
| SiS 530
| 1998
| Compaq Presario 5184
| smzxtest
| [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]
| Doubles left pixel.
|-
| Tseng Labs ET4000 AX (ISA)
| 1989
| -
| smzxtest
| [https://mas.to/@dukeboitans/112100818549265679 dukeboitans]
| No doubling.
|}
 
==Notable games that use SMZX mode==
* [[&]] by [[Lancer-X]]
* [[Celestial Altar]] by [[Lancer-X]]
* [[red]] by [[Lancer-X]]
* [[Ultima IV]] (port) by [[Lancer-X]]
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above
* [[Kaboink!]] by [[Logicow]]
* [[Kaboink!]] by [[Logicow]]

Latest revision as of 19:13, 20 March 2024

Super MegaZeux
And.png
Author MadBrain, Akwende, Exophase
Company n/a
Release Date n/a
Genre MegaZeux Fork, regular feature since 2.69
Download DMZX Archive

Super MegaZeux (or SMZX mode) is the name for an alternative graphics mode accessible through MegaZeux. Its first mode (SMZX mode 1) was first introduced by MadBrain in a fork of 2.51s3.2; this original version was referred to as Super MegaZeux 100 Alpha (smzx100a). It relied on a little-documented text mode supported by NVIDIA, C&T, ATI, and possibly other chipsets. SMZX mode 1 was included in MZXAk, but not in any other MZX releases until MZX 2.69, which sported the original mode plus the more advanced mode 2. Mode 3 was introduced in 2.80, and does not correlate to an actual hardware text mode (as MZX no longer actually relied on text mode).

SMZX mode can be accessed by setting the SMZX_MODE counter to 1, 2, or 3. In the editor, the current SMZX mode can be changed with the Select Screen Mode dialog (F11).

How it works

SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.

Each "pixel" in SMZX is derived from a horizontally adjacent pair of text mode pixels in the following manner:

Color Left pixel Right pixel
Color I off off
Color II on off
Color III off on
Color IV on on

If colors II and III seem backwards to experienced programmers, it is not a mistake; this is how the original DOS versions defined these colors.


SMZX Mode 1

SMZX mode 1, the original mode, generates two new palette colors as intermediates of the two normal-mode colors specified by the palette. This is the simplest Super MegaZeux mode to use, and is used in conjunction with a standard 16 color MZX palette. The example below uses the default palette for simplicity.

SMZX Mode 1
Palette color Derived by Example (c4F)
Color I Background of specified palette 42, 0, 0 (color 4)
Color II 1/3 between BG and FG colors 49, 21, 21
Color III 2/3 between BG and FG colors 56, 42, 42
Color IV Foreground of specified palette 63, 63, 63 (color 15)


SMZX Mode 2

SMZX mode 2 was the first mode to allow full user control over the 256 color palette. It is internally identical to SMZX mode 1, but instead of generating the new colors from a user-defined 16 color palette, it allows direct reading and writing of all 256 colors either through the set color # to # # # command or with the counters SMZX_Rn, SMZX_Gn, and SMZX_Bn.

All colors are defined in pairs of 2 hex digits, represented below by 0xNN. Given the same example palette as before, c4F, the colors are referenced as such:

SMZX Mode 2
Palette color Derived by Example (c4F)
Color I Uses the background color for both hex digits Color #0x44 (68 decimal)
Color II Uses the FG for the most significant hex digit and the BG for the least significant hex digit Color #0xF4 (244 decimal)
Color III Uses the BG for the most significant hex digit and the FG for the least significant hex digit Color #0x4F (79 decimal)
Color IV Uses the foreground color for both hex digits Color #0xFF (255 decimal)

(Note that colors II and III are backwards here to compensate for the backwards definitions of colors II and III from the character data. In practice, this won't matter to most users.)


SMZX Mode 3

SMZX mode 3, which was added with the SDL port, uses a palette of 256 completely independent colors as opposed to the effective 16 "base" colors of modes 1 and 2. By default, the colors for each subpalette cXX are defined as:

SMZX Mode 3
Palette Color Derived by Example (c4F)
Color I The color in the palette specified by cXX Color #0x4F (79 decimal)
Color II Color I plus 1 Color #0x50 (80 decimal)
Color III Color I plus 2 Color #0x51 (81 decimal)
Color IV Color I plus 3 Color #0x52 (82 decimal)

Subpalettes 253 through 255 "wrap around" the palette, so e.g. subpalette 253 will contain colors 253, 254, 255, and 0.

As of MegaZeux 2.90, the color mappings of all 256 subpalettes in SMZX mode 3 can be customized either by using the SMZX_IDXx,y counter or by reassigning them in the SMZX palette editor.

Hardware details

Super MegaZeux modes 1 and 2 are derived from a quirk of VGA (Video Graphics Array) compatible video adapters. In the video adapters that support SMZX, enabling the 8-bit color flag (0x40) of the Attribute Mode Control register (port 0x3C0 register 0x10) will combine two adjacent 4-bit EGA palette indices into a single 8-bit VGA palette index. This flag is intended for mode 13h only; enabling this in 14p text mode is undefined behavior. Most graphics chips do not render this 8-bit color text mode hack "correctly".

Example: given the text mode character byte 0x2d:

░░▓░▓▓░▓

With the palette 0x4F, this text mode byte is typically expanded to 4-bit color indices (hex):

4 4 f 4 f f 4 f

When the 8-bit color flag is enabled, two adjacent 4-bit indices are combined in a big endian manner to create a single 8-bit index (hex):

44  f4  ff  4f

These 8-bit indices are used to index the VGA palette. This is a "normal" SMZX mode implementation.

Variations

When combined with horizontal pixel panning (port 0x3C0 register 0x13), this combination usually behaves unexpectedly. For example, with a pixel panning value of 0x01 (shift left one pixel), and values x and y as 4-bit colors inherited from the neighboring characters, this same character combines into different colors:

x 4 4 f 4 f f 4 f y
x4  4f  4f  f4  fy

Another complication is that 9-pixel wide text modes will switch combination "parity" every other character (extra pixels in brackets):

4 4 f 4 f f 4 f [4] 4 4 f 4 f f 4 f [4]
44  f4  ff  4f  [4]4  4f  4f  f4  f[4]

Typically laptop adapters that perform forced 9-pixel or wider text mode scaling can have this behavior disabled with an Fn+function key combination.

Vendors

Chips & Technologies (all models that have been tested), NVIDIA adapters (from between some time in the '90s and some time in the late '00s), and the later VIA S3 Graphics "Chrome" adapters implement "normal" SMZX text mode as described above. No compatibility hacks are required for these vendors.

ATI graphics cards (from some time in the mid '90s until 2006) shift their text mode to the right by one pixel and seem to combine the 4-bit colors in a little endian manner, i.e. "4 f" are combined into "f4". To correct this, MegaZeux applies a horizontal pixel panning value of 0x01 and reverses the index nibbles of all SMZX colors when sending them to the VGA.

Some early Oak Technologies chips seem to combine the 4-bit colors in a little endian manner as well, but without the unusual pixel shift that ATI cards had. This needs more testing. MegaZeux currently has no method of detecting this.

See the compatibility tables below for more info.

Compatibility

There are some minor and/or past issues with SMZX mode:

  • Modes 1 and 2 only work on selected video hardware in DOS versions. Most DOS emulators, including DOSBox, do not support SMZX. Mode 3 was invented for the SDL port and has no hardware equivalent.
    • Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an "ati_fix" file in the same directory as the MegaZeux executable was required. This causes MegaZeux to tweak the horizontal pixel shift register and reverse the nibble order of each color. Newer versions of MegaZeux attempt automatic detection.
    • In MegaZeux 2.93 and above, the SVGA renderer can be used to draw SMZX in software. This enables its use on any SVGA-compatible graphics card, albeit at a performance cost compared to the EGA renderer.
  • Prior to MegaZeux 2.90, the Super MegaZeux modes did not leave room in the palette for the reserved UI colors, and thus the UI borrowed the game colors. This resulted in the UI palette looking corrupted, especially in SMZX mode 3. As of MegaZeux 2.90, the UI is almost always drawn in normal mode with the protected palette.
    • Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.
    • 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.
  • SMZX modes are not supported by the (fairly limited) Nintendo DS port.

Compatible hardware

Hardware with Working SMZX Support
Video Adapter Year Device(s) Last tested MZX version Reverse nibbles? Horizontal shift hack? Reported by Notes
ATI Mobility Radeon X300 2005 ThinkPad T43 smzxtest Yes Yes pagerorgy
ATI Radeon 7000 (AGP) 2001 - smzxtest Yes Yes kepstin
ATI Radeon 8500 2001 - 2.70 Yes Yes ? ati_fix
ATI Radeon 9100 2003 - smzxtest Yes Yes asie
ATI Radeon 9200 SE 2003 - smzxtest Yes Yes kepstin
ATI Radeon 9550 2003 - smzxtest Yes Yes Vyothric
ATI Rage Mobility-P (AGP) 1999 - smzxtest Yes Yes kepstin
ATI Rage XL (AGP) 1998 - smzxtest Yes Yes kepstin
C&T CT65548 1995 Toshiba Satellite 100CS 2.70 No No Lachesis
C&T F65554 1997 Toshiba Satellite Pro 465CDX 2.70 No No Jon Campbell
NVIDIA GeForce 2 MX100/200/400 2001 - 2.70, smzxtest No No Terryn, kepstin
NVIDIA GeForce 4 MX420 2002 - smzxtest No No kepstin
NVIDIA GeForce FX 5200 (AGP) 2003 - smzxtest No No kepstin
NVIDIA GeForce 6200 (AGP) 2005 - 2.93 No No BFeely
NVIDIA GeForce 7600 GS (AGP) 2006 - 2.93 No No asie
NVIDIA RIVA TNT2 1999 - 2.70 No No ?
Oak Technology OTi037C 1988 - smzxtest Yes No SpindleyQ
S3 UniChrome Pro (VIA VT3344) 2006 Neoware CA21 (VIA CN700) 2.93 No No Lachesis
Trident TVGA8900C 1991 - smzxtest No No Vyothric

Incompatible hardware

The most common failure mode for SMZX in video adapters seems to be a "pseudo-SMZX" mode with a 320x350 resolution where, for every pair of text mode pixels, the left 4-bit color is selected instead of combining their respective 4-bit colors into an 8-bit color.

Hardware with No SMZX Support
Video Adapter Year Device(s) Last tested MZX version Reported by Notes
3dfx Voodoo 3 2000 (AGP) 1999 - smzxtest kepstin Doubles left pixel.
ATI Mobility Radeon X1300 2006 IBM ThinkPad T60 smzxtest pagerorgy No doubling. (ATI detected)
ATI Radeon HD 3450 (B629) 2007 - 2.93 Lachesis No doubling. (ATI detected)
Cirrus Logic CL-GD5426 1993 - smzxtest dukeboitans Doubles right pixel.
Cirrus Logic CL-GD5429 1994 - smzxtest Vyothric Doubles right pixel.
Cirrus Logic CL-GD5440 1995 - smzxtest asie Doubles right pixel.
Intel 852GMV 2004 Dell Inspiron 1150 2.93 Lachesis Doubles left pixel.
Intel GMA 3100 (Intel G33) 2007 Dell Inspiron 530 2.93 Lachesis Doubles left pixel.
Intel HD Graphics 520 2016 Acer Aspire E 15 E5-575G-53VG (Core i5-6200U) smzxtest Lachesis Doubles left pixel.
Intel HD Graphics 2000 2011 Intel Core i5-2400 smzxtest Lachesis Doubles left pixel.
Intel i740 1998 - smzxtest Vyothric Doubles left pixel.
Matrox MGA Millenium 1995 - smzxtest kepstin No doubling.
Matrox Millenium G200 (AGP) 1998 - smzxtest pagerorgy No doubling.
Matrox Mystique 1996 - smzxtest asie No doubling.
NeoMagic MagicGraph128XD (NM2160) 1998 IBM ThinkPad 560X 2.93 Lachesis Doubles left pixel.
NeoMagic MagicGraph256AV (NM2200) 1998 IBM ThinkPad 380Z smzxtest bartitsu59 Doubles left pixel.
NeoMagic MagicGraph256ZX (NM2360) 1999 IBM ThinkPad 600X 2.93 Lachesis Doubles left pixel.
NVIDIA GeForce GTX 660 2012 - smzxtest Lachesis Doubles left pixel.
Paradise/Western Digital SVGA (unknown model) 1994 Compaq LTE Elite 4/50CX 2.70 Jon Campbell Doubles left pixel.
S3 86C805-P 1993 - smzxtest Vyothric No doubling
S3 Savage 2000 1999 - smzxtest Vyothric Doubles left pixel.
S3 Trio64V 1995 Compaq 4704 2.93 Elig Doubles left pixel.
S3 Trio64V2/DX 1996 HP Brio 8314 smzxtest GreaseMonkey No doubling
S3 ViRGE 325 1995 - smzxtest Vyothric No doubling
SiS 530 1998 Compaq Presario 5184 smzxtest indigoparadox Doubles left pixel.
Tseng Labs ET4000 AX (ISA) 1989 - smzxtest dukeboitans No doubling.

Notable games that use SMZX mode