<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.digitalmzx.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lachesis</id>
	<title>MZXWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.digitalmzx.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lachesis"/>
	<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/Special:Contributions/Lachesis"/>
	<updated>2026-05-07T10:00:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9211</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9211"/>
		<updated>2024-03-17T01:33:20Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Variations */ Correct combination spacings.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How it works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX is derived from a horizontally adjacent pair of text mode pixels in the following manner:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+&lt;br /&gt;
 !Color&lt;br /&gt;
 !Left pixel&lt;br /&gt;
 !Right pixel&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
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'''.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG for the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
(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.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX mode 3, which was added with the SDL port, uses a palette of 256 completely independent colors as opposed to the effective 16 &amp;quot;base&amp;quot; colors of modes 1 and 2. By default, the colors for each subpalette cXX are defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Subpalettes 253 through 255 &amp;quot;wrap around&amp;quot; the palette, so e.g. subpalette 253 will contain colors 253, 254, 255, and 0.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Hardware details==&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;correctly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example: given the text mode character byte 0x2d:&lt;br /&gt;
&lt;br /&gt;
 ░░▓░▓▓░▓&lt;br /&gt;
&lt;br /&gt;
With the palette 0x4F, this text mode byte is typically expanded to 4-bit color indices (hex):&lt;br /&gt;
&lt;br /&gt;
 4 4 f 4 f f 4 f&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&lt;br /&gt;
 44  f4  ff  4f&lt;br /&gt;
&lt;br /&gt;
These 8-bit indices are used to index the VGA palette. This is a &amp;quot;normal&amp;quot; SMZX mode implementation.&lt;br /&gt;
&lt;br /&gt;
===Variations===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 x 4 4 f 4 f f 4 f y&lt;br /&gt;
&lt;br /&gt;
 x4  4f  4f  f4  fy&lt;br /&gt;
&lt;br /&gt;
Another complication is that 9-pixel wide text modes will switch combination &amp;quot;parity&amp;quot; every other character (extra pixels in brackets):&lt;br /&gt;
&lt;br /&gt;
 4 4 f 4 f f 4 f [4] 4 4 f 4 f f 4 f [4]&lt;br /&gt;
&lt;br /&gt;
 44  f4  ff  4f  [4]4  4f  4f  f4  f[4]&lt;br /&gt;
&lt;br /&gt;
Typically laptop adapters that perform forced 9-pixel or wider text mode scaling can have this behavior disabled with an Fn+function key combination.&lt;br /&gt;
&lt;br /&gt;
===Vendors===&lt;br /&gt;
&lt;br /&gt;
Chips &amp;amp; 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 &amp;quot;Chrome&amp;quot; adapters implement &amp;quot;normal&amp;quot; SMZX text mode as described above. No compatibility hacks are required for these vendors.&lt;br /&gt;
&lt;br /&gt;
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. &amp;quot;4 f&amp;quot; are combined into &amp;quot;f4&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
''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.&lt;br /&gt;
&lt;br /&gt;
See the compatibility tables below for more info.&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X300&lt;br /&gt;
 | 2005&lt;br /&gt;
 | ThinkPad T43&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 7000 (AGP)&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034280088829489 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9100&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | asie&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9200 SE&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034114772189201 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage Mobility-P (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034067154516729 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage XL (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034187074718574 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200/400&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70, smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn, [https://tenforward.social/@kepstin/112034219820312089 kepstin]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4 MX420&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034159810882881 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce FX 5200 (AGP)&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112040355023624578 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 7600 GS (AGP)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | asie&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Oak Technology OTi037C&lt;br /&gt;
 | 1988&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 UniChrome Pro (VIA VT3344)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | Neoware CA21 (VIA CN700)&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | 3dfx Voodoo 3 2000 (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034014921477716 kepstin]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X1300&lt;br /&gt;
 | 2006&lt;br /&gt;
 | IBM ThinkPad T60&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | Cirrus Logic CL-GD5426&lt;br /&gt;
 | 1993&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mas.to/@dukeboitans/112100827940981639 dukeboitans]&lt;br /&gt;
 | Doubles right pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Cirrus Logic CL-GD5440&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | asie&lt;br /&gt;
 | Doubles right pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 520&lt;br /&gt;
 | 2016&lt;br /&gt;
 | Acer Aspire E 15 E5-575G-53VG (Core i5-6200U)&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox MGA Millenium&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034329123345918 kepstin]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Millenium G200 (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Mystique&lt;br /&gt;
 | 1996&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | asie&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256AV (NM2200)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 380Z&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce GTX 660&lt;br /&gt;
 | 2012&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V2/DX&lt;br /&gt;
 | 1996&lt;br /&gt;
 | HP Brio 8314&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://misskey.resonite.love/notes/9qwod5kpd2 GreaseMonkey]&lt;br /&gt;
 | No doubling?&lt;br /&gt;
 |-&lt;br /&gt;
 | SiS 530&lt;br /&gt;
 | 1998&lt;br /&gt;
 | Compaq Presario 5184&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Tseng Labs ET4000 AX (ISA)&lt;br /&gt;
 | 1989&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mas.to/@dukeboitans/112100818549265679 dukeboitans]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9210</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9210"/>
		<updated>2024-03-17T01:30:02Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: Add &amp;quot;Hardware Details&amp;quot; section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How it works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX is derived from a horizontally adjacent pair of text mode pixels in the following manner:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+&lt;br /&gt;
 !Color&lt;br /&gt;
 !Left pixel&lt;br /&gt;
 !Right pixel&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
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'''.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG for the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
(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.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX mode 3, which was added with the SDL port, uses a palette of 256 completely independent colors as opposed to the effective 16 &amp;quot;base&amp;quot; colors of modes 1 and 2. By default, the colors for each subpalette cXX are defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Subpalettes 253 through 255 &amp;quot;wrap around&amp;quot; the palette, so e.g. subpalette 253 will contain colors 253, 254, 255, and 0.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Hardware details==&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;correctly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example: given the text mode character byte 0x2d:&lt;br /&gt;
&lt;br /&gt;
 ░░▓░▓▓░▓&lt;br /&gt;
&lt;br /&gt;
With the palette 0x4F, this text mode byte is typically expanded to 4-bit color indices (hex):&lt;br /&gt;
&lt;br /&gt;
 4 4 f 4 f f 4 f&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&lt;br /&gt;
 44  f4  ff  4f&lt;br /&gt;
&lt;br /&gt;
These 8-bit indices are used to index the VGA palette. This is a &amp;quot;normal&amp;quot; SMZX mode implementation.&lt;br /&gt;
&lt;br /&gt;
===Variations===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 x 4 4 f 4 f f 4 f y&lt;br /&gt;
&lt;br /&gt;
 x4 4f 4f f4 fy&lt;br /&gt;
&lt;br /&gt;
Another complication is that 9-pixel wide text modes will switch combination &amp;quot;parity&amp;quot; every other character (extra pixels in brackets):&lt;br /&gt;
&lt;br /&gt;
 4 4 f 4 f f 4 f [4] 4 4 f 4 f f 4 f [4]&lt;br /&gt;
&lt;br /&gt;
 44 f4 ff 4f [4]4 4f 4f f4 f[4]&lt;br /&gt;
&lt;br /&gt;
Typically laptop adapters that perform forced 9-pixel or wider text mode scaling can have this behavior disabled with an Fn+function key combination.&lt;br /&gt;
&lt;br /&gt;
===Vendors===&lt;br /&gt;
&lt;br /&gt;
Chips &amp;amp; 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 &amp;quot;Chrome&amp;quot; adapters implement &amp;quot;normal&amp;quot; SMZX text mode as described above. No compatibility hacks are required for these vendors.&lt;br /&gt;
&lt;br /&gt;
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. &amp;quot;4 f&amp;quot; are combined into &amp;quot;f4&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
''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.&lt;br /&gt;
&lt;br /&gt;
See the compatibility tables below for more info.&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X300&lt;br /&gt;
 | 2005&lt;br /&gt;
 | ThinkPad T43&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 7000 (AGP)&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034280088829489 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9100&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | asie&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9200 SE&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034114772189201 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage Mobility-P (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034067154516729 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage XL (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034187074718574 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200/400&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70, smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn, [https://tenforward.social/@kepstin/112034219820312089 kepstin]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4 MX420&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034159810882881 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce FX 5200 (AGP)&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112040355023624578 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 7600 GS (AGP)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | asie&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Oak Technology OTi037C&lt;br /&gt;
 | 1988&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 UniChrome Pro (VIA VT3344)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | Neoware CA21 (VIA CN700)&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | 3dfx Voodoo 3 2000 (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034014921477716 kepstin]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X1300&lt;br /&gt;
 | 2006&lt;br /&gt;
 | IBM ThinkPad T60&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | Cirrus Logic CL-GD5426&lt;br /&gt;
 | 1993&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mas.to/@dukeboitans/112100827940981639 dukeboitans]&lt;br /&gt;
 | Doubles right pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Cirrus Logic CL-GD5440&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | asie&lt;br /&gt;
 | Doubles right pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 520&lt;br /&gt;
 | 2016&lt;br /&gt;
 | Acer Aspire E 15 E5-575G-53VG (Core i5-6200U)&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox MGA Millenium&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034329123345918 kepstin]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Millenium G200 (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Mystique&lt;br /&gt;
 | 1996&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | asie&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256AV (NM2200)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 380Z&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce GTX 660&lt;br /&gt;
 | 2012&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V2/DX&lt;br /&gt;
 | 1996&lt;br /&gt;
 | HP Brio 8314&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://misskey.resonite.love/notes/9qwod5kpd2 GreaseMonkey]&lt;br /&gt;
 | No doubling?&lt;br /&gt;
 |-&lt;br /&gt;
 | SiS 530&lt;br /&gt;
 | 1998&lt;br /&gt;
 | Compaq Presario 5184&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Tseng Labs ET4000 AX (ISA)&lt;br /&gt;
 | 1989&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mas.to/@dukeboitans/112100818549265679 dukeboitans]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9209</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9209"/>
		<updated>2024-03-16T20:52:25Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* How It Works */ Clarify and fix typos.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How it works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX is derived from a horizontally adjacent pair of text mode pixels in the following manner:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+&lt;br /&gt;
 !Color&lt;br /&gt;
 !Left pixel&lt;br /&gt;
 !Right pixel&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |'''off'''&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |'''on'''&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
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'''.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG for the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
(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.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX mode 3, which was added with the SDL port, uses a palette of 256 completely independent colors as opposed to the effective 16 &amp;quot;base&amp;quot; colors of modes 1 and 2. By default, the colors for each subpalette cXX are defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Subpalettes 253 through 255 &amp;quot;wrap around&amp;quot; the palette, so e.g. subpalette 253 will contain colors 253, 254, 255, and 0.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X300&lt;br /&gt;
 | 2005&lt;br /&gt;
 | ThinkPad T43&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 7000 (AGP)&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034280088829489 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9100&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | asie&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9200 SE&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034114772189201 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage Mobility-P (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034067154516729 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage XL (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034187074718574 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200/400&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70, smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn, [https://tenforward.social/@kepstin/112034219820312089 kepstin]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4 MX420&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034159810882881 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce FX 5200 (AGP)&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112040355023624578 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 7600 GS (AGP)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | asie&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Oak Technology OTi037C&lt;br /&gt;
 | 1988&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 UniChrome Pro (VIA VT3344)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | Neoware CA21 (VIA CN700)&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | 3dfx Voodoo 3 2000 (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034014921477716 kepstin]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X1300&lt;br /&gt;
 | 2006&lt;br /&gt;
 | IBM ThinkPad T60&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | Cirrus Logic CL-GD5426&lt;br /&gt;
 | 1993&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mas.to/@dukeboitans/112100827940981639 dukeboitans]&lt;br /&gt;
 | Doubles right pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Cirrus Logic CL-GD5440&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | asie&lt;br /&gt;
 | Doubles right pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 520&lt;br /&gt;
 | 2016&lt;br /&gt;
 | Acer Aspire E 15 E5-575G-53VG (Core i5-6200U)&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox MGA Millenium&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034329123345918 kepstin]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Millenium G200 (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Mystique&lt;br /&gt;
 | 1996&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | asie&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256AV (NM2200)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 380Z&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce GTX 660&lt;br /&gt;
 | 2012&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V2/DX&lt;br /&gt;
 | 1996&lt;br /&gt;
 | HP Brio 8314&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://misskey.resonite.love/notes/9qwod5kpd2 GreaseMonkey]&lt;br /&gt;
 | No doubling?&lt;br /&gt;
 |-&lt;br /&gt;
 | SiS 530&lt;br /&gt;
 | 1998&lt;br /&gt;
 | Compaq Presario 5184&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Tseng Labs ET4000 AX (ISA)&lt;br /&gt;
 | 1989&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mas.to/@dukeboitans/112100818549265679 dukeboitans]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9204</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9204"/>
		<updated>2024-03-09T09:51:37Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Incompatible hardware */ Add NVIDIA GeForce GTX 660.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X300&lt;br /&gt;
 | 2005&lt;br /&gt;
 | ThinkPad T43&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 7000 (AGP)&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034280088829489 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9200 SE&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034114772189201 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage Mobility-P (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034067154516729 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage XL (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034187074718574 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200/400&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70, smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn, [https://tenforward.social/@kepstin/112034219820312089 kepstin]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4 MX420&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034159810882881 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce FX 5200 (AGP)&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112040355023624578 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Oak Technology OTi037C&lt;br /&gt;
 | 1988&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 UniChrome Pro (VIA VT3344)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | Neoware CA21 (VIA CN700)&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | 3dfx Voodoo 3 2000 (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034014921477716 kepstin]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X1300&lt;br /&gt;
 | 2006&lt;br /&gt;
 | IBM ThinkPad T60&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 520&lt;br /&gt;
 | 2016&lt;br /&gt;
 | Acer Aspire E 15 E5-575G-53VG (Core i5-6200U)&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox MGA Millenium&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034329123345918 kepstin]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Millenium G200 (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256AV (NM2200)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 380Z&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce GTX 660&lt;br /&gt;
 | 2012&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | SiS 530&lt;br /&gt;
 | 1998&lt;br /&gt;
 | Compaq Presario 5184&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9203</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9203"/>
		<updated>2024-03-05T18:38:18Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Incompatible hardware */ Acer Aspire E 15 was most likely using the Intel HD, not the NVIDIA.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X300&lt;br /&gt;
 | 2005&lt;br /&gt;
 | ThinkPad T43&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 7000 (AGP)&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034280088829489 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9200 SE&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034114772189201 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage Mobility-P (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034067154516729 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage XL (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034187074718574 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200/400&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70, smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn, [https://tenforward.social/@kepstin/112034219820312089 kepstin]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4 MX420&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034159810882881 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce FX 5200 (AGP)&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112040355023624578 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Oak Technology OTi037C&lt;br /&gt;
 | 1988&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 UniChrome Pro (VIA VT3344)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | Neoware CA21 (VIA CN700)&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | 3dfx Voodoo 3 2000 (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034014921477716 kepstin]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X1300&lt;br /&gt;
 | 2006&lt;br /&gt;
 | IBM ThinkPad T60&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 520&lt;br /&gt;
 | 2016&lt;br /&gt;
 | Acer Aspire E 15 E5-575G-53VG (Core i5-6200U)&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox MGA Millenium&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034329123345918 kepstin]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Millenium G200 (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256AV (NM2200)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 380Z&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | SiS 530&lt;br /&gt;
 | 1998&lt;br /&gt;
 | Compaq Presario 5184&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9201</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9201"/>
		<updated>2024-03-04T19:33:19Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Incompatible hardware */ Remove &amp;quot;first 16 colors&amp;quot; since it's not really helpful.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X300&lt;br /&gt;
 | 2005&lt;br /&gt;
 | ThinkPad T43&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 7000 (AGP)&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034280088829489 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 9200 SE&lt;br /&gt;
 | 2003&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034114772189201 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage Mobility-P (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034067154516729 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Rage XL (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034187074718574 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200/400&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70, smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn, [https://tenforward.social/@kepstin/112034219820312089 kepstin]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4 MX420&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034159810882881 kepstin]&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Oak Technology OTi037C&lt;br /&gt;
 | 1988&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 UniChrome Pro (VIA VT3344)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | Neoware CA21 (VIA CN700)&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | 3dfx Voodoo 3 2000 (AGP)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034014921477716 kepstin]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X1300&lt;br /&gt;
 | 2006&lt;br /&gt;
 | IBM ThinkPad T60&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | No doubling. (ATI detected)&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox MGA Millenium&lt;br /&gt;
 | 1995&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://tenforward.social/@kepstin/112034329123345918 kepstin]&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Millenium G200 (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256AV (NM2200)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 380Z&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 940MX&lt;br /&gt;
 | 2016&lt;br /&gt;
 | Acer Aspire E 15 E5-575G-53VG&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | SiS 530&lt;br /&gt;
 | 1998&lt;br /&gt;
 | Compaq Presario 5184&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9199</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9199"/>
		<updated>2024-03-04T05:59:42Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatible hardware */ Add S3 UniChrome Pro.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X300&lt;br /&gt;
 | 2005&lt;br /&gt;
 | ThinkPad T43&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Oak Technology OTi037C&lt;br /&gt;
 | 1988&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 UniChrome Pro (VIA VT3344)&lt;br /&gt;
 | 2006&lt;br /&gt;
 | Neoware CA21 (VIA CN700)&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X1300&lt;br /&gt;
 | 2006&lt;br /&gt;
 | IBM ThinkPad T60&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Displays regular text mode, first 16 colors of VGA palette. The colors are derived from SMZX colors X0h and everything is shifted left by 1 pixel, suggesting ati_fix is being applied. This card needs further testing.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Millenium G200 (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256AV (NM2200)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 380Z&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 940MX&lt;br /&gt;
 | 2016&lt;br /&gt;
 | Acer Aspire E 15 E5-575G-53VG&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | SiS 530&lt;br /&gt;
 | 1998&lt;br /&gt;
 | Compaq Presario 5184&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9198</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9198"/>
		<updated>2024-03-03T22:37:19Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Incompatible hardware */ Add NVIDIA GeForce 940MX.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X300&lt;br /&gt;
 | 2005&lt;br /&gt;
 | ThinkPad T43&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Oak Technology OTi037C&lt;br /&gt;
 | 1988&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://cohost.org/asie/post/4858546-call-to-action-use#comment-7fc117fe-199a-4aca-9dfe-b87fa7234592 SpindleyQ]&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Mobility Radeon X1300&lt;br /&gt;
 | 2006&lt;br /&gt;
 | IBM ThinkPad T60&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Displays regular text mode, first 16 colors of VGA palette. The colors are derived from SMZX colors X0h and everything is shifted left by 1 pixel, suggesting ati_fix is being applied. This card needs further testing.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | Matrox Millenium G200 (AGP)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | -&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | pagerorgy&lt;br /&gt;
 | No doubling.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256AV (NM2200)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 380Z&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://pouet.chapril.org/@bartitsu59/112033087218073323 bartitsu59]&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 940MX&lt;br /&gt;
 | 2016&lt;br /&gt;
 | Acer Aspire E 15 E5-575G-53VG&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | SiS 530&lt;br /&gt;
 | 1998&lt;br /&gt;
 | Compaq Presario 5184&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | [https://mastodon.social/@indigoparadox/112032243607415455 indigoparadox]&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9191</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9191"/>
		<updated>2024-03-03T06:00:46Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Incompatible hardware */ Add Intel HD Graphics 2000.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Displays regular text mode, first 16 colors of VGA palette. The colors are derived from SMZX colors X0h and everything is shifted left by 1 pixel, suggesting ati_fix is being applied. This card needs further testing.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel HD Graphics 2000&lt;br /&gt;
 | 2011&lt;br /&gt;
 | Intel Core i5-2400&lt;br /&gt;
 | smzxtest&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9190</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9190"/>
		<updated>2024-02-26T03:11:27Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Windows with MSYS2 */ Add autotools, cmake, and diffutils.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For developing and testing MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. MSYS2 no longer works on 32-bit Windows and recommends the UCRT64 environment, so that will be used here.&lt;br /&gt;
&lt;br /&gt;
It is no longer recommended to produce release builds with MSYS2, as they have increased the default architecture of MINGW32 to '''pentium4''' and the default architecture of MINGW64 to '''nocona'''. MegaZeux still targets '''i686''' and '''x86-64''' respectively. While most dependencies can be rebuilt, MSYS2 may or may not embed system library stubs that require the newer architectures into the binary (untested). Linux Mingw-w64 cross compilers are now recommended for release builds instead.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2===&lt;br /&gt;
Run '''ucrt64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-pkgconf&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''ucrt64.exe''', add the folder containing your dependencies (generally ''C:\msys64\ucrt64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S autoconf&lt;br /&gt;
 yes Y | pacman -S automake&lt;br /&gt;
 yes Y | pacman -S libtool&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-cmake&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-diffutils&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-imagemagick&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-ntldd&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\ucrt64\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''sdl12-compat-devel'' (''SDL-devel'' for older Fedora releases).&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.93&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Multiarchitecture .app===&lt;br /&gt;
''THIS SECTION IS A WORK IN PROGRESS.'' Please refer to the documentation in arch/darwin/ and docs/platform_matrix.html for more details.&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
This is heavily dependent on the architectures being targeted. For compilation on a Mac, typically select the highest Xcode being targeted as a base and install the lower versions using [https://github.com/devernay/xcodelegacy XcodeLegacy]. Linux cross compilation isn't tested currently.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 ! Architecture&lt;br /&gt;
 ! MegaZeux PREFIX&lt;br /&gt;
 ! SDK version&lt;br /&gt;
 ! OS minimum version&lt;br /&gt;
 ! Xcode toolchain&lt;br /&gt;
 ! Cross toolchain&lt;br /&gt;
 ! Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | arm64&lt;br /&gt;
 | PREFIX_ARM64&lt;br /&gt;
 | 11.0&lt;br /&gt;
 | 11.0&lt;br /&gt;
 | Xcode 12.2 or higher&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Untested.&lt;br /&gt;
 |-&lt;br /&gt;
 | arm64e&lt;br /&gt;
 | PREFIX_ARM64E&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Untested.&lt;br /&gt;
 |-&lt;br /&gt;
 | i686&lt;br /&gt;
 | PREFIX_I686&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.6&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Mac OS X Snow Leopard is targeted to support Core Duo Macs.&lt;br /&gt;
 |-&lt;br /&gt;
 | x86_64&lt;br /&gt;
 | PREFIX_AMD64&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.6&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | x86_64h&lt;br /&gt;
 | PREFIX_AMD64H&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.9&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | OS X Mavericks is the minimum version for this architecture.&lt;br /&gt;
 |-&lt;br /&gt;
 | ppc&lt;br /&gt;
 | PREFIX_PPC&lt;br /&gt;
 | 10.4&lt;br /&gt;
 | 10.4&lt;br /&gt;
 | Xcode 3.2.6&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross/blob/ppc-test/README.PPC-GCC-5.5.0-SDK-10.5.md osxcross (ppc-test)]&lt;br /&gt;
 | Mac OS X Tiger is targeted to support G3 Macs.&lt;br /&gt;
 |-&lt;br /&gt;
 | ppc64&lt;br /&gt;
 | PREFIX_PPC64&lt;br /&gt;
 | 10.5&lt;br /&gt;
 | 10.5&lt;br /&gt;
 | Xcode 3.2.6&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross/blob/ppc-test/README.PPC-GCC-5.5.0-SDK-10.5.md osxcross (ppc-test)]&lt;br /&gt;
 | Mac OS X Leopard is targeted as Objective-C is broken for PowerPC64 in the Tiger SDK.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
WARNING: if targeting PowerPC64 via XcodeLegacy, you need to revert a fix that XcodeLegacy applies to libgcc_s.10.5.dylib.&lt;br /&gt;
&lt;br /&gt;
 cp /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib.vectorfix&lt;br /&gt;
 cp /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib.bak /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib&lt;br /&gt;
&lt;br /&gt;
====Other required tools====&lt;br /&gt;
&lt;br /&gt;
[https://github.com/auriamg/macdylibbundler dylibbundler], which can be installed using MacPorts:&lt;br /&gt;
&lt;br /&gt;
 sudo port install dylibbundler&lt;br /&gt;
&lt;br /&gt;
WARNING: dylibbundler relies on otool and therefore llvm-objdump. LLVM currently lacks support for reading the LC_UNIXTHREAD load commands of PowerPC64 Mach-O executables, so bundling will fail. You may need to have a pre-LLVM Xcode selected to complete a PowerPC64 build.&lt;br /&gt;
&lt;br /&gt;
====Dependencies====&lt;br /&gt;
FIXME!&lt;br /&gt;
&lt;br /&gt;
====Compilation====&lt;br /&gt;
Unlike most other architectures, the prefix is provided PER ARCHITECTURE to a Makefile meta target.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform darwin-dist --enable-release --enable-lto&lt;br /&gt;
&lt;br /&gt;
To compile for a given architecture, provide to Make one or more of the PREFIX variables defined in the table above:&lt;br /&gt;
&lt;br /&gt;
 make PREFIX_I686=~/megazeux-dependencies/macos/i686 PREFIX_AMD64=~/megazeux-dependencies/macos/x86_64&lt;br /&gt;
&lt;br /&gt;
For each architecture, Make will invoke:&lt;br /&gt;
&lt;br /&gt;
 make ARCH=[arch] PREFIX=[prefix] package&lt;br /&gt;
 make ARCH=[arch] PREFIX=[prefix] clean&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;package&amp;quot; target is similar to &amp;quot;all&amp;quot;, except afterward, dylibbundler is used to generate a dependency bundle in &amp;quot;bundles/&amp;quot;, and then all binaries are moved to [binary].[arch].&lt;br /&gt;
&lt;br /&gt;
Finally, Make will perform&lt;br /&gt;
&lt;br /&gt;
 make lipo&lt;br /&gt;
&lt;br /&gt;
to merge all of the currently existing [binary].[arch] files into a new multiarchitecture file [binary].&lt;br /&gt;
&lt;br /&gt;
====Packaging====&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make archive&lt;br /&gt;
You can test the .app files generated in build/darwin-dist/ to make sure they run. A .dmg will appear in build/dist/darwin-dist/ containing the generated .app files, documentation, and multiarchitecture utilities.&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbis wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9189</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9189"/>
		<updated>2024-02-25T06:12:12Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Windows */ Replace MINGW64 and MINGW32 instructions with UCRT64.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For developing and testing MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. MSYS2 no longer works on 32-bit Windows and recommends the UCRT64 environment, so that will be used here.&lt;br /&gt;
&lt;br /&gt;
It is no longer recommended to produce release builds with MSYS2, as they have increased the default architecture of MINGW32 to '''pentium4''' and the default architecture of MINGW64 to '''nocona'''. MegaZeux still targets '''i686''' and '''x86-64''' respectively. While most dependencies can be rebuilt, MSYS2 may or may not embed system library stubs that require the newer architectures into the binary (untested). Linux Mingw-w64 cross compilers are now recommended for release builds instead.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2===&lt;br /&gt;
Run '''ucrt64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-pkgconf&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''ucrt64.exe''', add the folder containing your dependencies (generally ''C:\msys64\ucrt64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-imagemagick&lt;br /&gt;
 yes Y | pacman -S mingw-w64-ucrt-x86_64-ntldd&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\ucrt64\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''sdl12-compat-devel'' (''SDL-devel'' for older Fedora releases).&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.93&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Multiarchitecture .app===&lt;br /&gt;
''THIS SECTION IS A WORK IN PROGRESS.'' Please refer to the documentation in arch/darwin/ and docs/platform_matrix.html for more details.&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
This is heavily dependent on the architectures being targeted. For compilation on a Mac, typically select the highest Xcode being targeted as a base and install the lower versions using [https://github.com/devernay/xcodelegacy XcodeLegacy]. Linux cross compilation isn't tested currently.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 ! Architecture&lt;br /&gt;
 ! MegaZeux PREFIX&lt;br /&gt;
 ! SDK version&lt;br /&gt;
 ! OS minimum version&lt;br /&gt;
 ! Xcode toolchain&lt;br /&gt;
 ! Cross toolchain&lt;br /&gt;
 ! Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | arm64&lt;br /&gt;
 | PREFIX_ARM64&lt;br /&gt;
 | 11.0&lt;br /&gt;
 | 11.0&lt;br /&gt;
 | Xcode 12.2 or higher&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Untested.&lt;br /&gt;
 |-&lt;br /&gt;
 | arm64e&lt;br /&gt;
 | PREFIX_ARM64E&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Untested.&lt;br /&gt;
 |-&lt;br /&gt;
 | i686&lt;br /&gt;
 | PREFIX_I686&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.6&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Mac OS X Snow Leopard is targeted to support Core Duo Macs.&lt;br /&gt;
 |-&lt;br /&gt;
 | x86_64&lt;br /&gt;
 | PREFIX_AMD64&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.6&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | x86_64h&lt;br /&gt;
 | PREFIX_AMD64H&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.9&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | OS X Mavericks is the minimum version for this architecture.&lt;br /&gt;
 |-&lt;br /&gt;
 | ppc&lt;br /&gt;
 | PREFIX_PPC&lt;br /&gt;
 | 10.4&lt;br /&gt;
 | 10.4&lt;br /&gt;
 | Xcode 3.2.6&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross/blob/ppc-test/README.PPC-GCC-5.5.0-SDK-10.5.md osxcross (ppc-test)]&lt;br /&gt;
 | Mac OS X Tiger is targeted to support G3 Macs.&lt;br /&gt;
 |-&lt;br /&gt;
 | ppc64&lt;br /&gt;
 | PREFIX_PPC64&lt;br /&gt;
 | 10.5&lt;br /&gt;
 | 10.5&lt;br /&gt;
 | Xcode 3.2.6&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross/blob/ppc-test/README.PPC-GCC-5.5.0-SDK-10.5.md osxcross (ppc-test)]&lt;br /&gt;
 | Mac OS X Leopard is targeted as Objective-C is broken for PowerPC64 in the Tiger SDK.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
WARNING: if targeting PowerPC64 via XcodeLegacy, you need to revert a fix that XcodeLegacy applies to libgcc_s.10.5.dylib.&lt;br /&gt;
&lt;br /&gt;
 cp /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib.vectorfix&lt;br /&gt;
 cp /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib.bak /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib&lt;br /&gt;
&lt;br /&gt;
====Other required tools====&lt;br /&gt;
&lt;br /&gt;
[https://github.com/auriamg/macdylibbundler dylibbundler], which can be installed using MacPorts:&lt;br /&gt;
&lt;br /&gt;
 sudo port install dylibbundler&lt;br /&gt;
&lt;br /&gt;
WARNING: dylibbundler relies on otool and therefore llvm-objdump. LLVM currently lacks support for reading the LC_UNIXTHREAD load commands of PowerPC64 Mach-O executables, so bundling will fail. You may need to have a pre-LLVM Xcode selected to complete a PowerPC64 build.&lt;br /&gt;
&lt;br /&gt;
====Dependencies====&lt;br /&gt;
FIXME!&lt;br /&gt;
&lt;br /&gt;
====Compilation====&lt;br /&gt;
Unlike most other architectures, the prefix is provided PER ARCHITECTURE to a Makefile meta target.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform darwin-dist --enable-release --enable-lto&lt;br /&gt;
&lt;br /&gt;
To compile for a given architecture, provide to Make one or more of the PREFIX variables defined in the table above:&lt;br /&gt;
&lt;br /&gt;
 make PREFIX_I686=~/megazeux-dependencies/macos/i686 PREFIX_AMD64=~/megazeux-dependencies/macos/x86_64&lt;br /&gt;
&lt;br /&gt;
For each architecture, Make will invoke:&lt;br /&gt;
&lt;br /&gt;
 make ARCH=[arch] PREFIX=[prefix] package&lt;br /&gt;
 make ARCH=[arch] PREFIX=[prefix] clean&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;package&amp;quot; target is similar to &amp;quot;all&amp;quot;, except afterward, dylibbundler is used to generate a dependency bundle in &amp;quot;bundles/&amp;quot;, and then all binaries are moved to [binary].[arch].&lt;br /&gt;
&lt;br /&gt;
Finally, Make will perform&lt;br /&gt;
&lt;br /&gt;
 make lipo&lt;br /&gt;
&lt;br /&gt;
to merge all of the currently existing [binary].[arch] files into a new multiarchitecture file [binary].&lt;br /&gt;
&lt;br /&gt;
====Packaging====&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make archive&lt;br /&gt;
You can test the .app files generated in build/darwin-dist/ to make sure they run. A .dmg will appear in build/dist/darwin-dist/ containing the generated .app files, documentation, and multiarchitecture utilities.&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbis wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9188</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9188"/>
		<updated>2024-02-25T01:43:56Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Incompatible hardware */ Add Intel GMA 3100 and ATI Radeon HD 3450/B629.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon HD 3450 (B629)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Displays regular text mode, first 16 colors of VGA palette. The colors are derived from SMZX colors X0h and everything is shifted left by 1 pixel, suggesting ati_fix is being applied. This card needs further testing.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel GMA 3100 (Intel G33)&lt;br /&gt;
 | 2007&lt;br /&gt;
 | Dell Inspiron 530&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9187</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9187"/>
		<updated>2024-02-23T19:10:49Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatible hardware */ The GeForce 2 was specifically a &amp;quot;MX 100/200&amp;quot; (according to the card or driver itself) and was reported by Terryn.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2 MX100/200&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Terryn&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9186</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9186"/>
		<updated>2024-02-23T19:00:37Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Incompatible hardware */ Add Intel 852GMV.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | Intel 852GMV&lt;br /&gt;
 | 2004&lt;br /&gt;
 | Dell Inspiron 1150&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, first 16 colors of VGA palette.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9185</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9185"/>
		<updated>2024-02-23T08:26:23Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Incompatible hardware */ Add NeoMagic MagicGraph256ZX.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD (NM2160)&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph256ZX (NM2360)&lt;br /&gt;
 | 1999&lt;br /&gt;
 | IBM ThinkPad 600X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9184</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9184"/>
		<updated>2024-02-22T21:46:01Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatible hardware */ Confirmed my old Toshiba model (sadly can't retest it, though).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T CT65548&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Toshiba Satellite 100CS&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9183</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9183"/>
		<updated>2024-02-22T21:20:57Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: Split &amp;quot;Compatibility&amp;quot; from &amp;quot;How It Works&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==Compatibility==&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
===Compatible hardware===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Anecdotal hardware with no known specific version or verification:&lt;br /&gt;
* Lachesis had a Toshiba Satellite Pro—likely 400CDS or 425CDS—with a C&amp;amp;T chip that produced NVIDIA-style hardware SMZX with no issues.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Incompatible hardware===&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9182</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9182"/>
		<updated>2024-02-22T21:20:08Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatibility */ Make the compatible/incompatible hardware tables their own sections.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
====Compatible hardware====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Anecdotal hardware with no known specific version or verification:&lt;br /&gt;
* Lachesis had a Toshiba Satellite Pro—likely 400CDS or 425CDS—with a C&amp;amp;T chip that produced NVIDIA-style hardware SMZX with no issues.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Incompatible hardware====&lt;br /&gt;
&lt;br /&gt;
The most common failure mode for SMZX in video adapters seems to be a &amp;quot;pseudo-SMZX&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9181</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9181"/>
		<updated>2024-02-20T23:00:12Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: Fix NVIDIA and ATI capitalization in the summary (both are always allcaps, see previous edit), add C&amp;amp;T to the list of confirmed vendors supporting SMZX.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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&amp;amp;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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
* Anecdotal hardware with no known specific version or verification:&lt;br /&gt;
** Lachesis had a Toshiba Satellite Pro—likely 400CDS or 425CDS—with a C&amp;amp;T chip that produced NVIDIA-style hardware SMZX with no issues.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9180</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9180"/>
		<updated>2024-02-20T22:57:49Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatibility */ Correct NVIDIA spelling. It is always all-caps, sometimes &amp;quot;nVIDIA&amp;quot; in very old official sources, &amp;quot;Nvidia&amp;quot; in non-official sources like news articles, but never &amp;quot;nVidia&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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 almost exclusively by nVidia and ATi 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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
* Anecdotal hardware with no known specific version or verification:&lt;br /&gt;
** Lachesis had a Toshiba Satellite Pro—likely 400CDS or 425CDS—with a C&amp;amp;T chip that produced NVIDIA-style hardware SMZX with no issues.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NVIDIA RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9179</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9179"/>
		<updated>2024-02-20T21:27:53Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatibility */ Split working/nonworking tables; add Compaq and Toshiba adapters.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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 almost exclusively by nVidia and ATi 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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
* Anecdotal hardware with no known specific version or verification:&lt;br /&gt;
** Lachesis had a Toshiba Satellite Pro—likely 400CDS or 425CDS—with a C&amp;amp;T chip that produced Nvidia-style hardware SMZX with no issues.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with Working SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ?&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | C&amp;amp;T F65554&lt;br /&gt;
 | 1997&lt;br /&gt;
 | Toshiba Satellite Pro 465CDX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Nvidia GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 BFeely]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | ?&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+Hardware with No SMZX Support&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Reported by&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | IBM ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Lachesis&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | Paradise/Western Digital SVGA (unknown model)&lt;br /&gt;
 | 1994&lt;br /&gt;
 | Compaq LTE Elite 4/50CX&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1918121416 Jon Campbell]&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | S3 Trio64V&lt;br /&gt;
 | 1995&lt;br /&gt;
 | Compaq 4704&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Elig&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9178</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9178"/>
		<updated>2024-02-12T18:40:35Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Packaging */  replace with Multiarchitecture .app&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For compiling MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. If you are using a 64-bit operating system, follow the 64-bit instructions below. If you are using a 32-bit operating system, follow the 32-bit instructions below.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (64-bit)===&lt;br /&gt;
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-pkgconf&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (32-bit)===&lt;br /&gt;
Run '''mingw32.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw32 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-pkgconf&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win32&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw32.exe''', add the folder containing your dependencies (generally ''C:\msys32\mingw32\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'' or ''C:\msys32\mingw32\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''sdl12-compat-devel'' (''SDL-devel'' for older Fedora releases).&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.93&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Multiarchitecture .app===&lt;br /&gt;
''THIS SECTION IS A WORK IN PROGRESS.'' Please refer to the documentation in arch/darwin/ and docs/platform_matrix.html for more details.&lt;br /&gt;
&lt;br /&gt;
====Environment Setup====&lt;br /&gt;
This is heavily dependent on the architectures being targeted. For compilation on a Mac, typically select the highest Xcode being targeted as a base and install the lower versions using [https://github.com/devernay/xcodelegacy XcodeLegacy]. Linux cross compilation isn't tested currently.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 ! Architecture&lt;br /&gt;
 ! MegaZeux PREFIX&lt;br /&gt;
 ! SDK version&lt;br /&gt;
 ! OS minimum version&lt;br /&gt;
 ! Xcode toolchain&lt;br /&gt;
 ! Cross toolchain&lt;br /&gt;
 ! Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | arm64&lt;br /&gt;
 | PREFIX_ARM64&lt;br /&gt;
 | 11.0&lt;br /&gt;
 | 11.0&lt;br /&gt;
 | Xcode 12.2 or higher&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Untested.&lt;br /&gt;
 |-&lt;br /&gt;
 | arm64e&lt;br /&gt;
 | PREFIX_ARM64E&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | FIXME&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Untested.&lt;br /&gt;
 |-&lt;br /&gt;
 | i686&lt;br /&gt;
 | PREFIX_I686&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.6&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | Mac OS X Snow Leopard is targeted to support Core Duo Macs.&lt;br /&gt;
 |-&lt;br /&gt;
 | x86_64&lt;br /&gt;
 | PREFIX_AMD64&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.6&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | x86_64h&lt;br /&gt;
 | PREFIX_AMD64H&lt;br /&gt;
 | 10.13&lt;br /&gt;
 | 10.9&lt;br /&gt;
 | Xcode 9.4.1&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross osxcross]&lt;br /&gt;
 | OS X Mavericks is the minimum version for this architecture.&lt;br /&gt;
 |-&lt;br /&gt;
 | ppc&lt;br /&gt;
 | PREFIX_PPC&lt;br /&gt;
 | 10.4&lt;br /&gt;
 | 10.4&lt;br /&gt;
 | Xcode 3.2.6&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross/blob/ppc-test/README.PPC-GCC-5.5.0-SDK-10.5.md osxcross (ppc-test)]&lt;br /&gt;
 | Mac OS X Tiger is targeted to support G3 Macs.&lt;br /&gt;
 |-&lt;br /&gt;
 | ppc64&lt;br /&gt;
 | PREFIX_PPC64&lt;br /&gt;
 | 10.5&lt;br /&gt;
 | 10.5&lt;br /&gt;
 | Xcode 3.2.6&lt;br /&gt;
 | [https://github.com/tpoechtrager/osxcross/blob/ppc-test/README.PPC-GCC-5.5.0-SDK-10.5.md osxcross (ppc-test)]&lt;br /&gt;
 | Mac OS X Leopard is targeted as Objective-C is broken for PowerPC64 in the Tiger SDK.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
WARNING: if targeting PowerPC64 via XcodeLegacy, you need to revert a fix that XcodeLegacy applies to libgcc_s.10.5.dylib.&lt;br /&gt;
&lt;br /&gt;
 cp /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib.vectorfix&lt;br /&gt;
 cp /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib.bak /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.10.5.dylib&lt;br /&gt;
&lt;br /&gt;
====Other required tools====&lt;br /&gt;
&lt;br /&gt;
[https://github.com/auriamg/macdylibbundler dylibbundler], which can be installed using MacPorts:&lt;br /&gt;
&lt;br /&gt;
 sudo port install dylibbundler&lt;br /&gt;
&lt;br /&gt;
WARNING: dylibbundler relies on otool and therefore llvm-objdump. LLVM currently lacks support for reading the LC_UNIXTHREAD load commands of PowerPC64 Mach-O executables, so bundling will fail. You may need to have a pre-LLVM Xcode selected to complete a PowerPC64 build.&lt;br /&gt;
&lt;br /&gt;
====Dependencies====&lt;br /&gt;
FIXME!&lt;br /&gt;
&lt;br /&gt;
====Compilation====&lt;br /&gt;
Unlike most other architectures, the prefix is provided PER ARCHITECTURE to a Makefile meta target.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform darwin-dist --enable-release --enable-lto&lt;br /&gt;
&lt;br /&gt;
To compile for a given architecture, provide to Make one or more of the PREFIX variables defined in the table above:&lt;br /&gt;
&lt;br /&gt;
 make PREFIX_I686=~/megazeux-dependencies/macos/i686 PREFIX_AMD64=~/megazeux-dependencies/macos/x86_64&lt;br /&gt;
&lt;br /&gt;
For each architecture, Make will invoke:&lt;br /&gt;
&lt;br /&gt;
 make ARCH=[arch] PREFIX=[prefix] package&lt;br /&gt;
 make ARCH=[arch] PREFIX=[prefix] clean&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;package&amp;quot; target is similar to &amp;quot;all&amp;quot;, except afterward, dylibbundler is used to generate a dependency bundle in &amp;quot;bundles/&amp;quot;, and then all binaries are moved to [binary].[arch].&lt;br /&gt;
&lt;br /&gt;
Finally, Make will perform&lt;br /&gt;
&lt;br /&gt;
 make lipo&lt;br /&gt;
&lt;br /&gt;
to merge all of the currently existing [binary].[arch] files into a new multiarchitecture file [binary].&lt;br /&gt;
&lt;br /&gt;
====Packaging====&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make archive&lt;br /&gt;
You can test the .app files generated in build/darwin-dist/ to make sure they run. A .dmg will appear in build/dist/darwin-dist/ containing the generated .app files, documentation, and multiarchitecture utilities.&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbis wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9177</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9177"/>
		<updated>2024-01-30T05:41:34Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatibility */ Add more detailed information about ATi hacks.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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 almost exclusively by nVidia and ATi 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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; 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.&lt;br /&gt;
** 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.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Support in Hardware&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Last working MZX version&lt;br /&gt;
 !Works?&lt;br /&gt;
 !Reverse nibbles?&lt;br /&gt;
 !Horizontal shift hack?&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | ?&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | Yes&lt;br /&gt;
 | ati_fix&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | ThinkPad 560X&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | -&lt;br /&gt;
 | No&lt;br /&gt;
 | -&lt;br /&gt;
 | -&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | ?&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | ?&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Nvidia GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 Reported by BFeely.]&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | ?&lt;br /&gt;
 | Yes&lt;br /&gt;
 | No&lt;br /&gt;
 | No&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9176</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9176"/>
		<updated>2024-01-20T01:24:24Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatibility */ Add GeForce 6200 AGP, clarify mode 3 and lack of hardware support for separate UI rendering.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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 almost exclusively by nVidia and ATi 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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
** Prior to MegaZeux 2.93, to support Super MegaZeux correctly on DOS versions of MegaZeux combined with certain graphics cards, the creation of an &amp;quot;ati_fix&amp;quot; file in the same directory as the MegaZeux executable was required. Newer versions of MegaZeux attempt automatic detection.&lt;br /&gt;
** In MegaZeux 2.93 and above, the SVGA renderer can be used to draw SMZX in software, thus enabling its use on any SVGA-compatible graphics card, albeit at a performance cost compared to the EGA renderer.&lt;br /&gt;
* 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.&lt;br /&gt;
** Hardware SMZX in DOS does not support this and still draws the UI in SMZX mode.&lt;br /&gt;
** 8bpp software rendering also doesn't support this and will draw the UI in normal mode but with SMZX palette colors.&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Support in Hardware&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Device&lt;br /&gt;
 !Working MZX version(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !ati_fix?&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | ATI Radeon 8500&lt;br /&gt;
 | 2001&lt;br /&gt;
 | -&lt;br /&gt;
 | ?&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | Yes&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | ThinkPad 560X&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | -&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia GeForce 2&lt;br /&gt;
 | 2000&lt;br /&gt;
 | -&lt;br /&gt;
 | All&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia GeForce 4&lt;br /&gt;
 | 2002&lt;br /&gt;
 | -&lt;br /&gt;
 | All&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 | Nvidia GeForce 6200 (AGP)&lt;br /&gt;
 | 2005&lt;br /&gt;
 | -&lt;br /&gt;
 | All&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | No&lt;br /&gt;
 | [https://github.com/joncampbell123/dosbox-x/issues/4764#issuecomment-1901327031 Reported by BFeely.]&lt;br /&gt;
 |-&lt;br /&gt;
 | nVidia RIVA TNT2&lt;br /&gt;
 | 1999&lt;br /&gt;
 | -&lt;br /&gt;
 | All&lt;br /&gt;
 | 2.70&lt;br /&gt;
 | No&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9175</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9175"/>
		<updated>2024-01-19T08:05:58Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Fedora */ SDL-devel was replaced with sdl12-compat-devel.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For compiling MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. If you are using a 64-bit operating system, follow the 64-bit instructions below. If you are using a 32-bit operating system, follow the 32-bit instructions below.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (64-bit)===&lt;br /&gt;
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-pkgconf&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (32-bit)===&lt;br /&gt;
Run '''mingw32.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw32 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-pkgconf&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win32&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw32.exe''', add the folder containing your dependencies (generally ''C:\msys32\mingw32\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'' or ''C:\msys32\mingw32\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''sdl12-compat-devel'' (''SDL-devel'' for older Fedora releases).&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.93&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make lipo&lt;br /&gt;
 make archive&lt;br /&gt;
A .dmg will appear in build/arch/darwin/.  Please refer to the documentation in arch/darwin/ for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbis wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9174</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9174"/>
		<updated>2024-01-19T08:02:36Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Windows */ Add pkgconf (required by SDL3).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For compiling MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. If you are using a 64-bit operating system, follow the 64-bit instructions below. If you are using a 32-bit operating system, follow the 32-bit instructions below.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (64-bit)===&lt;br /&gt;
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-pkgconf&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (32-bit)===&lt;br /&gt;
Run '''mingw32.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw32 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-pkgconf&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win32&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw32.exe''', add the folder containing your dependencies (generally ''C:\msys32\mingw32\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'' or ''C:\msys32\mingw32\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''SDL-devel''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.92c&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make lipo&lt;br /&gt;
 make archive&lt;br /&gt;
A .dmg will appear in build/arch/darwin/.  Please refer to the documentation in arch/darwin/ for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbis wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9171</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9171"/>
		<updated>2023-11-09T09:11:42Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Common */ Explicitly document build-base for Alpine.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. Linux and BSD ports are omitted from the table for obvious reasons.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup. For platforms where --enable-kvm is relevant, it was not used. &lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- x86_64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''x86_64''' &amp;lt;br&amp;gt; qemu-system-x86_64 7.2.6&lt;br /&gt;
|&lt;br /&gt;
* Windows&lt;br /&gt;
* Mac OS&lt;br /&gt;
* Android&lt;br /&gt;
| Debian 12.2&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -smp 4&lt;br /&gt;
[image...]&lt;br /&gt;
-vga qxl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m06s (-j4) &amp;lt;br&amp;gt; 1m17s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| '''run.serial.sh''' currently does not work, use '''run.sh''' instead.&lt;br /&gt;
| TODO&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If applicable, set up the '''run.serial.sh''' script (or '''run.sh''') and run it to start QEMU.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages for the tools and dependencies required to build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Debian&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Alpine&lt;br /&gt;
sudo apk add build-base gdb git zlib-dev libpng-dev libogg-dev libvorbis-dev sdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux and run the tests. Debug builds are used to measure the times in the table above, as release builds can be quite slow to make in these VMs. Video is not required for any of these steps.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If the target supports video or needs extra packages, see &amp;quot;extra software&amp;quot;.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Debian&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Alpine&lt;br /&gt;
sudo apk cache clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra software ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The following packages might be useful depending on the platform and setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Console utilities.&lt;br /&gt;
sudo apt install dialog screen lm-sensors lynx&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi rxvt-unicode fonts-dejavu&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You may need to preset various user roles to use a graphical desktop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# For each user that will be using this:&lt;br /&gt;
sudo usermod -a -G video [user]&lt;br /&gt;
sudo usermod -a -G audio [user]&lt;br /&gt;
sudo usermod -a -G input [user]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A launcher for i3 and/or Sway might be useful. By default, these installations use&lt;br /&gt;
[https://github.com/dopsi/console-tdm TDM], a lightweight terminal-based startx wrapper&lt;br /&gt;
(which also supports Wayland), but this can be done in several ways.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install dialog&lt;br /&gt;
git clone https://github.com/dopsi/console-tdm&lt;br /&gt;
cd console-tdm&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For each user that will be using tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tdmctl init&lt;br /&gt;
# You can skip whichever of these window managers isn't present.&lt;br /&gt;
tdmctl add i3 /usr/bin/i3&lt;br /&gt;
tdmctl add sway /usr/bin/sway extra&lt;br /&gt;
&lt;br /&gt;
# Place the following in your .profile or .bashrc file:&lt;br /&gt;
# Optional: Sway hardware cursors may not work in VirtualBox or QEMU.&lt;br /&gt;
export WLR_NO_HARDWARE_CURSORS=1&lt;br /&gt;
# Enable tdm when starting either of the first two VTs.&lt;br /&gt;
if [ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;$XDG_VTNR&amp;quot; ] &amp;amp;&amp;amp; [ &amp;quot;$XDG_VTNR&amp;quot; -le 2 ]; then&lt;br /&gt;
  tdm --disable-long-names || true&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Place the following line in your .xinitrc file:&lt;br /&gt;
# i3 only: xrdb -merge &amp;quot;$HOME&amp;quot;/.Xresources&lt;br /&gt;
exec tdm --xstart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For a graphical login, xdm is tolerable in a VM and easy to set up:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo make install xdm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Alternatively, just use &amp;quot;startx&amp;quot; or &amp;quot;sway&amp;quot; manually. In the case of the former, .xinitrc needs to be preset:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xrdb -merge &amp;quot;$HOME&amp;quot;/.Xresources&lt;br /&gt;
exec i3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
X11 only: Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If applicable, set up the '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why QEMU options that have worked in the past are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9170</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9170"/>
		<updated>2023-11-09T08:52:07Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Extra software */ Fixes for Alpine/i3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. Linux and BSD ports are omitted from the table for obvious reasons.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup. For platforms where --enable-kvm is relevant, it was not used. &lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- x86_64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''x86_64''' &amp;lt;br&amp;gt; qemu-system-x86_64 7.2.6&lt;br /&gt;
|&lt;br /&gt;
* Windows&lt;br /&gt;
* Mac OS&lt;br /&gt;
* Android&lt;br /&gt;
| Debian 12.2&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -smp 4&lt;br /&gt;
[image...]&lt;br /&gt;
-vga qxl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m06s (-j4) &amp;lt;br&amp;gt; 1m17s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| '''run.serial.sh''' currently does not work, use '''run.sh''' instead.&lt;br /&gt;
| TODO&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If applicable, set up the '''run.serial.sh''' script (or '''run.sh''') and run it to start QEMU.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages for the tools and dependencies required to build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux and run the tests. Debug builds are used to measure the times in the table above, as release builds can be quite slow to make in these VMs. Video is not required for any of these steps.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If the target supports video or needs extra packages, see &amp;quot;extra software&amp;quot;.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra software ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The following packages might be useful depending on the platform and setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Console utilities.&lt;br /&gt;
sudo apt install dialog screen lm-sensors lynx&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi rxvt-unicode fonts-dejavu&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You may need to preset various user roles to use a graphical desktop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# For each user that will be using this:&lt;br /&gt;
sudo usermod -a -G video [user]&lt;br /&gt;
sudo usermod -a -G audio [user]&lt;br /&gt;
sudo usermod -a -G input [user]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A launcher for i3 and/or Sway might be useful. By default, these installations use&lt;br /&gt;
[https://github.com/dopsi/console-tdm TDM], a lightweight terminal-based startx wrapper&lt;br /&gt;
(which also supports Wayland), but this can be done in several ways.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install dialog&lt;br /&gt;
git clone https://github.com/dopsi/console-tdm&lt;br /&gt;
cd console-tdm&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For each user that will be using tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tdmctl init&lt;br /&gt;
# You can skip whichever of these window managers isn't present.&lt;br /&gt;
tdmctl add i3 /usr/bin/i3&lt;br /&gt;
tdmctl add sway /usr/bin/sway extra&lt;br /&gt;
&lt;br /&gt;
# Place the following in your .profile or .bashrc file:&lt;br /&gt;
# Optional: Sway hardware cursors may not work in VirtualBox or QEMU.&lt;br /&gt;
export WLR_NO_HARDWARE_CURSORS=1&lt;br /&gt;
# Enable tdm when starting either of the first two VTs.&lt;br /&gt;
if [ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;$XDG_VTNR&amp;quot; ] &amp;amp;&amp;amp; [ &amp;quot;$XDG_VTNR&amp;quot; -le 2 ]; then&lt;br /&gt;
  tdm --disable-long-names || true&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Place the following line in your .xinitrc file:&lt;br /&gt;
# i3 only: xrdb -merge &amp;quot;$HOME&amp;quot;/.Xresources&lt;br /&gt;
exec tdm --xstart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For a graphical login, xdm is tolerable in a VM and easy to set up:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo make install xdm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Alternatively, just use &amp;quot;startx&amp;quot; or &amp;quot;sway&amp;quot; manually. In the case of the former, .xinitrc needs to be preset:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xrdb -merge &amp;quot;$HOME&amp;quot;/.Xresources&lt;br /&gt;
exec i3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
X11 only: Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If applicable, set up the '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why QEMU options that have worked in the past are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9169</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9169"/>
		<updated>2023-11-03T06:04:45Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Setup */ Move .Xresources setup to the X11-only section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. Linux and BSD ports are omitted from the table for obvious reasons.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup. For platforms where --enable-kvm is relevant, it was not used. &lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- x86_64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''x86_64''' &amp;lt;br&amp;gt; qemu-system-x86_64 7.2.6&lt;br /&gt;
|&lt;br /&gt;
* Windows&lt;br /&gt;
* Mac OS&lt;br /&gt;
* Android&lt;br /&gt;
| Debian 12.2&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -smp 4&lt;br /&gt;
[image...]&lt;br /&gt;
-vga qxl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m06s (-j4) &amp;lt;br&amp;gt; 1m17s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| '''run.serial.sh''' currently does not work, use '''run.sh''' instead.&lt;br /&gt;
| TODO&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If applicable, set up the '''run.serial.sh''' script (or '''run.sh''') and run it to start QEMU.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages for the tools and dependencies required to build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux and run the tests. Debug builds are used to measure the times in the table above, as release builds can be quite slow to make in these VMs. Video is not required for any of these steps.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If the target supports video or needs extra packages, see &amp;quot;extra software&amp;quot;.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra software ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The following packages might be useful depending on the platform and setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Console utilities.&lt;br /&gt;
sudo apt install screen lm-sensors lynx&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config cmake&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You may need to preset various user roles to use a graphical desktop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# For each user that will be using this:&lt;br /&gt;
sudo usermod -a -G video [user]&lt;br /&gt;
sudo usermod -a -G audio [user]&lt;br /&gt;
sudo usermod -a -G input [user]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A launcher for i3 and/or Sway might be useful. By default, these installations use&lt;br /&gt;
[https://github.com/dopsi/console-tdm TDM], a lightweight terminal-based startx wrapper&lt;br /&gt;
(which also supports Wayland), but this can be done in several ways.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install dialog&lt;br /&gt;
git clone https://github.com/dopsi/console-tdm&lt;br /&gt;
cd console-tdm&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For each user that will be using tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tdmctl init&lt;br /&gt;
# You can skip whichever of these window managers isn't present.&lt;br /&gt;
tdmctl add i3 /usr/bin/i3&lt;br /&gt;
tdmctl add sway /usr/bin/sway extra&lt;br /&gt;
&lt;br /&gt;
# Place the following in your .profile or .bashrc file:&lt;br /&gt;
# Optional: Sway hardware cursors may not work in VirtualBox or QEMU.&lt;br /&gt;
export WLR_NO_HARDWARE_CURSORS=1&lt;br /&gt;
# Enable tdm when starting either of the first two VTs.&lt;br /&gt;
if [ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;$XDG_VTNR&amp;quot; ] &amp;amp;&amp;amp; [ &amp;quot;$XDG_VTNR&amp;quot; -le 2 ]; then&lt;br /&gt;
  tdm --disable-long-names || true&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Place the following line in your .xinitrc file:&lt;br /&gt;
exec tdm --xstart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For a graphical login, xdm is tolerable in a VM and easy to set up:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo make install xdm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Alternatively, just use &amp;quot;startx&amp;quot; or &amp;quot;sway&amp;quot; manually. In the case of the former, .xinitrc needs to be preset:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec i3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
X11 only: Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If applicable, set up the '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why QEMU options that have worked in the past are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9168</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9168"/>
		<updated>2023-11-03T01:18:04Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Linux/BSD (main architectures) */ Add amd64.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. Linux and BSD ports are omitted from the table for obvious reasons.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup. For platforms where --enable-kvm is relevant, it was not used. &lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- x86_64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''x86_64''' &amp;lt;br&amp;gt; qemu-system-x86_64 7.2.6&lt;br /&gt;
|&lt;br /&gt;
* Windows&lt;br /&gt;
* Mac OS&lt;br /&gt;
* Android&lt;br /&gt;
| Debian 12.2&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -smp 4&lt;br /&gt;
[image...]&lt;br /&gt;
-vga qxl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m06s (-j4) &amp;lt;br&amp;gt; 1m17s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| '''run.serial.sh''' currently does not work, use '''run.sh''' instead.&lt;br /&gt;
| TODO&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages for the tools and dependencies required to build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux and run the tests. Debug builds are used to measure the times in the table above, as release builds can be quite slow to make in these VMs. Video is not required for any of these steps.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If the target supports video or needs extra packages, see &amp;quot;extra software&amp;quot;.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra software ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The following packages might be useful depending on the platform and setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Console utilities.&lt;br /&gt;
sudo apt install screen lm-sensors lynx&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config cmake&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You may need to preset various user roles to use a graphical desktop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# For each user that will be using this:&lt;br /&gt;
sudo usermod -a -G video [user]&lt;br /&gt;
sudo usermod -a -G audio [user]&lt;br /&gt;
sudo usermod -a -G input [user]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A launcher for i3 and/or Sway might be useful. By default, these installations use&lt;br /&gt;
[https://github.com/dopsi/console-tdm TDM], a lightweight terminal-based startx wrapper&lt;br /&gt;
(which also supports Wayland), but this can be done in several ways.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install dialog&lt;br /&gt;
git clone https://github.com/dopsi/console-tdm&lt;br /&gt;
cd console-tdm&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For each user that will be using tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tdmctl init&lt;br /&gt;
# You can skip whichever of these window managers isn't present.&lt;br /&gt;
tdmctl add i3 /usr/bin/i3&lt;br /&gt;
tdmctl add sway /usr/bin/sway extra&lt;br /&gt;
&lt;br /&gt;
# Place the following in your .profile or .bashrc file:&lt;br /&gt;
# Optional: Sway hardware cursors may not work in VirtualBox or QEMU.&lt;br /&gt;
export WLR_NO_HARDWARE_CURSORS=1&lt;br /&gt;
# Enable tdm when starting either of the first two VTs.&lt;br /&gt;
if [ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;$XDG_VTNR&amp;quot; ] &amp;amp;&amp;amp; [ &amp;quot;$XDG_VTNR&amp;quot; -le 2 ]; then&lt;br /&gt;
  tdm --disable-long-names || true&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Place the following line in your .xinitrc file:&lt;br /&gt;
exec tdm --xstart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For a graphical login, xdm is tolerable in a VM and easy to set up:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo make install xdm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Alternatively, just use &amp;quot;startx&amp;quot; or &amp;quot;sway&amp;quot; manually. In the case of the former, .xinitrc needs to be preset:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec i3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
X11 only: Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why QEMU options that have worked in the past are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9167</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9167"/>
		<updated>2023-11-02T23:43:04Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Extra software */ Explicitly install dialog for tdm, since Debian doesn't have it by default.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages for the tools and dependencies required to build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux and run the tests. Debug builds are used to measure the times in the table above, as release builds can be quite slow to make in these VMs. Video is not required for any of these steps.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If the target supports video or needs extra packages, see &amp;quot;extra software&amp;quot;.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra software ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The following packages might be useful depending on the platform and setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Console utilities.&lt;br /&gt;
sudo apt install screen lm-sensors lynx&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config cmake&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You may need to preset various user roles to use a graphical desktop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# For each user that will be using this:&lt;br /&gt;
sudo usermod -a -G video [user]&lt;br /&gt;
sudo usermod -a -G audio [user]&lt;br /&gt;
sudo usermod -a -G input [user]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A launcher for i3 and/or Sway might be useful. By default, these installations use&lt;br /&gt;
[https://github.com/dopsi/console-tdm TDM], a lightweight terminal-based startx wrapper&lt;br /&gt;
(which also supports Wayland), but this can be done in several ways.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install dialog&lt;br /&gt;
git clone https://github.com/dopsi/console-tdm&lt;br /&gt;
cd console-tdm&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For each user that will be using tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tdmctl init&lt;br /&gt;
# You can skip whichever of these window managers isn't present.&lt;br /&gt;
tdmctl add i3 /usr/bin/i3&lt;br /&gt;
tdmctl add sway /usr/bin/sway extra&lt;br /&gt;
&lt;br /&gt;
# Place the following in your .profile or .bashrc file:&lt;br /&gt;
# Optional: Sway hardware cursors may not work in VirtualBox or QEMU.&lt;br /&gt;
export WLR_NO_HARDWARE_CURSORS=1&lt;br /&gt;
# Enable tdm when starting either of the first two VTs.&lt;br /&gt;
if [ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;$XDG_VTNR&amp;quot; ] &amp;amp;&amp;amp; [ &amp;quot;$XDG_VTNR&amp;quot; -le 2 ]; then&lt;br /&gt;
  tdm --disable-long-names || true&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Place the following line in your .xinitrc file:&lt;br /&gt;
exec tdm --xstart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For a graphical login, xdm is tolerable in a VM and easy to set up:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo make install xdm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Alternatively, just use &amp;quot;startx&amp;quot; or &amp;quot;sway&amp;quot; manually. In the case of the former, .xinitrc needs to be preset:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec i3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
X11 only: Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why QEMU options that have worked in the past are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9166</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9166"/>
		<updated>2023-11-02T23:40:51Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Extra software */ Fix tdm instructions for Debian, add Sway hardware cursors hack.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages for the tools and dependencies required to build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux and run the tests. Debug builds are used to measure the times in the table above, as release builds can be quite slow to make in these VMs. Video is not required for any of these steps.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If the target supports video or needs extra packages, see &amp;quot;extra software&amp;quot;.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra software ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The following packages might be useful depending on the platform and setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Console utilities.&lt;br /&gt;
sudo apt install screen lm-sensors lynx&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config cmake&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You may need to preset various user roles to use a graphical desktop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# For each user that will be using this:&lt;br /&gt;
sudo usermod -a -G video [user]&lt;br /&gt;
sudo usermod -a -G audio [user]&lt;br /&gt;
sudo usermod -a -G input [user]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A launcher for i3 and/or Sway might be useful. By default, these installations use&lt;br /&gt;
[https://github.com/dopsi/console-tdm TDM], a lightweight terminal-based startx wrapper&lt;br /&gt;
(which also supports Wayland), but this can be done in several ways.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/dopsi/console-tdm&lt;br /&gt;
cd console-tdm&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For each user that will be using tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tdmctl init&lt;br /&gt;
# You can skip whichever of these window managers isn't present.&lt;br /&gt;
tdmctl add i3 /usr/bin/i3&lt;br /&gt;
tdmctl add sway /usr/bin/sway extra&lt;br /&gt;
&lt;br /&gt;
# Place the following in your .profile or .bashrc file:&lt;br /&gt;
# Optional: Sway hardware cursors may not work in VirtualBox or QEMU.&lt;br /&gt;
export WLR_NO_HARDWARE_CURSORS=1&lt;br /&gt;
# Enable tdm when starting either of the first two VTs.&lt;br /&gt;
if [ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;$XDG_VTNR&amp;quot; ] &amp;amp;&amp;amp; [ &amp;quot;$XDG_VTNR&amp;quot; -le 2 ]; then&lt;br /&gt;
  tdm --disable-long-names || true&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Place the following line in your .xinitrc file:&lt;br /&gt;
exec tdm --xstart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For a graphical login, xdm is tolerable in a VM and easy to set up:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo make install xdm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Alternatively, just use &amp;quot;startx&amp;quot; or &amp;quot;sway&amp;quot; manually. In the case of the former, .xinitrc needs to be preset:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec i3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
X11 only: Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why QEMU options that have worked in the past are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9165</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9165"/>
		<updated>2023-10-26T02:24:23Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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 almost exclusively by nVidia and ATi 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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* Modes 1 and 2 only worked on selected video hardware in DOS versions. DOSBox does not support SMZX.&lt;br /&gt;
* 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. (The main exception to this is 8bpp indexed software rendering, which still has graphical issues.)&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Support in Hardware&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Year&lt;br /&gt;
 !Laptop&lt;br /&gt;
 !Working MZX version(s)&lt;br /&gt;
 !Last tested MZX version&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | 1998&lt;br /&gt;
 | ThinkPad 560X&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9164</id>
		<title>Super MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Super_MegaZeux&amp;diff=9164"/>
		<updated>2023-10-26T02:03:44Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Compatibility issues */ Add SMZX hardware support table, MagicGraph128XD.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game&lt;br /&gt;
|title = Super MegaZeux&lt;br /&gt;
|image = And.png&lt;br /&gt;
|creator = [[MadBrain]], [[Akwende]], [[Exophase]]&lt;br /&gt;
|company = n/a&lt;br /&gt;
|released = n/a&lt;br /&gt;
|genre = [[MegaZeux|MegaZeux Fork]], regular feature since 2.69&lt;br /&gt;
|vault = n/a&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''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 almost exclusively by nVidia and ATi 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).&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
==How It Works==&lt;br /&gt;
SMZX Mode halves the horizontal screen resolution in favor of adding two colors per character, effectively making a color palette of 256 unique colors.&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;pixel&amp;quot; in SMZX can be either color I (represented in MZX mode as two 'off' pixels), color II ('on' and 'off'), color III ('off' and 'on') ad color IV (both 'on').&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 1===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 1&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Background of specified palette&lt;br /&gt;
 |42, 0, 0 (color 4)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |1/3 between BG and FG colors&lt;br /&gt;
 |49, 21, 21&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |2/3 between BG and FG colors&lt;br /&gt;
 |56, 42, 42&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Foreground of specified palette&lt;br /&gt;
 |63, 63, 63 (color 15)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 2===&lt;br /&gt;
SMZX mode 2 was the first to allow 4 colors per character that the user had full control over.  It uses the same color matrix as SMZX mode 1, but instead of automatically generating the new colors off of a standard 16 color palette, it references a user-defined 256 color palette to find the colors.  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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 2&lt;br /&gt;
 !Palette color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |Uses the background color for both hex digits&lt;br /&gt;
 |Color #0x44 (68 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Uses the FG for the most significant hex digit and the BG for the least significant hex digit&lt;br /&gt;
 |Color #0xF4 (244 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Uses the BG for the most significant hex digit and the FG fore the least significant hex digit&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Uses the foreground color for both hex digits&lt;br /&gt;
 |Color #0xFF (255 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
If the color indexes for colors II and III seem backwards to experienced programmers, it is not a mistake; this is how they actually are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SMZX Mode 3===&lt;br /&gt;
SMZX 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:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Mode 3&lt;br /&gt;
 !Palette Color&lt;br /&gt;
 !Derived by&lt;br /&gt;
 !Example (c4F)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color I&lt;br /&gt;
 |The color in the palette specified by cXX&lt;br /&gt;
 |Color #0x4F (79 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color II&lt;br /&gt;
 |Color I plus 1&lt;br /&gt;
 |Color #0x50 (80 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color III&lt;br /&gt;
 |Color I plus 2&lt;br /&gt;
 |Color #0x51 (81 decimal)&lt;br /&gt;
 |-&lt;br /&gt;
 |Color IV&lt;br /&gt;
 |Color I plus 3&lt;br /&gt;
 |Color #0x52 (82 decimal)&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
&lt;br /&gt;
There are some minor and/or past issues with SMZX mode:&lt;br /&gt;
&lt;br /&gt;
* Modes 1 and 2 only worked on selected video hardware in DOS versions. DOSBox does not support SMZX.&lt;br /&gt;
* 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. (The main exception to this is 8bpp indexed software rendering, which still has graphical issues.)&lt;br /&gt;
* SMZX modes are not supported by the (fairly limited) Nintendo DS port.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |+SMZX Support in Hardware&lt;br /&gt;
 !Video Adapter&lt;br /&gt;
 !Laptop&lt;br /&gt;
 !Works?&lt;br /&gt;
 !Last working version&lt;br /&gt;
 !Last tested version&lt;br /&gt;
 !Notes&lt;br /&gt;
 |-&lt;br /&gt;
 | NeoMagic MagicGraph128XD&lt;br /&gt;
 | ThinkPad 560X&lt;br /&gt;
 | No&lt;br /&gt;
 | -&lt;br /&gt;
 | 2.93&lt;br /&gt;
 | Doubles left pixel, 16 colors.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Notable games that use SMZX mode==&lt;br /&gt;
* [[&amp;amp;]] by [[Lancer-X]]&lt;br /&gt;
* [[Celestial Altar]] by [[Lancer-X]]&lt;br /&gt;
* [[red]] by [[Lancer-X]]&lt;br /&gt;
* [[Ultima IV]] (port) by [[Lancer-X]]&lt;br /&gt;
* [[Bloodlands]] by [[Maxim]] uses Mode 1 in a novel way: to blur the screen when the player takes damage.&lt;br /&gt;
* [[Akwende]]'s Tetris, the pack-in game included with [[MegaZeux#MZXak|MZXak]] 1.0 and above&lt;br /&gt;
* [[Kaboink!]] by [[Logicow]]&lt;br /&gt;
* [[Hackers Can Turn Your Computer into a Bomb!]]&lt;br /&gt;
* [[Murder on the Yellow Express]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9163</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9163"/>
		<updated>2023-10-20T20:41:08Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Extra software */ Add display manager instructions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages for the tools and dependencies required to build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux and run the tests. Debug builds are used to measure the times in the table above, as release builds can be quite slow to make in these VMs. Video is not required for any of these steps.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If the target supports video or needs extra packages, see &amp;quot;extra software&amp;quot;.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra software ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The following packages might be useful depending on the platform and setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Console utilities.&lt;br /&gt;
sudo apt install screen lm-sensors lynx&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config cmake&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You may need to preset various user roles to use a graphical desktop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# For each user that will be using this:&lt;br /&gt;
sudo usermod -a -G video [user]&lt;br /&gt;
sudo usermod -a -G audio [user]&lt;br /&gt;
sudo usermod -a -G input [user]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A launcher for i3 and/or Sway might be useful. By default, these installations use&lt;br /&gt;
[https://github.com/dopsi/console-tdm TDM], a lightweight terminal-based startx wrapper&lt;br /&gt;
(which also supports Wayland), but this can be done in several ways.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/dopsi/console-tdm&lt;br /&gt;
cd console-tdm&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For each user that will be using tdm:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tdmctl init&lt;br /&gt;
# You can skip whichever of these window managers isn't present.&lt;br /&gt;
tdmctl add i3 /usr/bin/i3&lt;br /&gt;
tdmctl add sway /usr/bin/sway extra&lt;br /&gt;
&lt;br /&gt;
# Enable an automatic prompt when starting either of the first two VTs.&lt;br /&gt;
# Place the following line in your .profile or .bashrc file:&lt;br /&gt;
[ -n &amp;quot;$XDG_VTNR&amp;quot; ] &amp;amp;&amp;amp; [ &amp;quot;$XDG_VTNR&amp;quot; -le 2 ] &amp;amp;&amp;amp; exec tdm --disable-long-names&lt;br /&gt;
&lt;br /&gt;
# Place the following line in your .xinitrc file:&lt;br /&gt;
exec tdm --start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For a graphical login, xdm is tolerable in a VM and easy to set up:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo make install xdm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Alternatively, just use &amp;quot;startx&amp;quot; or &amp;quot;sway&amp;quot; manually. In the case of the former, .xinitrc needs to be preset:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec i3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
X11 only: Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why QEMU options that have worked in the past are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9162</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9162"/>
		<updated>2023-10-20T05:06:24Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Setup */ Split &amp;quot;extra packages&amp;quot; off from &amp;quot;common&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages for the tools and dependencies required to build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux and run the tests. Debug builds are used to measure the times in the table above, as release builds can be quite slow to make in these VMs. Video is not required for any of these steps.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If the target supports video or needs extra packages, see &amp;quot;extra software&amp;quot;.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra software ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The following packages might be useful depending on the platform and setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Console utilities.&lt;br /&gt;
sudo apt install screen lm-sensors lynx&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config cmake&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
X11 only: Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why QEMU options that have worked in the past are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9161</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9161"/>
		<updated>2023-10-19T10:15:52Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Common */ more optional packages.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Tools and dependencies required to build MegaZeux.&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi lynx&lt;br /&gt;
&lt;br /&gt;
# Sway might work better on some setups (encountered on AML-S905X-CC v1).&lt;br /&gt;
sudo apt install sway xwayland i3status rofi lynx&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config cmake&lt;br /&gt;
&lt;br /&gt;
# clang may be useful for its sanitizers and built-in fuzzer, but it is quite large.&lt;br /&gt;
sudo apt install clang clang-tools llvm&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9160</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9160"/>
		<updated>2023-10-19T05:36:48Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Common */ Improve installed packages list, remove xdm, shorten .Xresources section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources''' from [https://www.digitalmzx.com/lachesis/.Xresources here]. This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget https://www.digitalmzx.com/lachesis/.Xresources&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Block the installation of dmenu. In Debian, this is done by creating a file called /etc/apt/preferences.d/no_goosesteppers with the contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Package: suckless-tools&lt;br /&gt;
Pin: origin *&lt;br /&gt;
Pin-Priority: -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Update packages.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Tools and dependencies required to build MegaZeux.&lt;br /&gt;
sudo apt install build-essential gdb git zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev&lt;br /&gt;
&lt;br /&gt;
# Graphical environment and browser.&lt;br /&gt;
sudo apt install xorg i3 i3lock i3status rofi lynx&lt;br /&gt;
&lt;br /&gt;
# Extra tools for building libxmp and xmp-cli from source.&lt;br /&gt;
sudo apt install autoconf automake libtool pkg-config cmake&lt;br /&gt;
&lt;br /&gt;
# If this machine or VM is going to be shelled into:&lt;br /&gt;
sudo apt install openssh-server&lt;br /&gt;
&lt;br /&gt;
# If memory compression is required:&lt;br /&gt;
sudo apt install zram-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9159</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9159"/>
		<updated>2023-10-19T05:17:32Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Setup */ add a subsection for the common steps.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images or a similarly configured machine, this is how the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
=== Common ===&lt;br /&gt;
&lt;br /&gt;
Debian is assumed in most of these steps, but they can be adapted to other distros. If one of the alternate setups is required, skip the installer steps in this section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources.''' This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
! &amp;quot;lumifoo&amp;quot; by gutterslob.&lt;br /&gt;
&lt;br /&gt;
! special&lt;br /&gt;
*.foreground:   #888a8c&lt;br /&gt;
*.background:   #1e2021&lt;br /&gt;
*.cursorColor:  #888a8c&lt;br /&gt;
&lt;br /&gt;
! black&lt;br /&gt;
*.color0:       #515151&lt;br /&gt;
*.color8:       #707172&lt;br /&gt;
&lt;br /&gt;
! red&lt;br /&gt;
*.color1:       #bf6382&lt;br /&gt;
*.color9:       #eaaec2&lt;br /&gt;
&lt;br /&gt;
! green&lt;br /&gt;
*.color2:       #65a446&lt;br /&gt;
*.color10:      #aed49b&lt;br /&gt;
&lt;br /&gt;
! yellow&lt;br /&gt;
*.color3:       #ad8a43&lt;br /&gt;
*.color11:      #d4c3a0&lt;br /&gt;
&lt;br /&gt;
! blue&lt;br /&gt;
*.color4:       #6b85c2&lt;br /&gt;
*.color12:      #afc4e9&lt;br /&gt;
&lt;br /&gt;
! magenta&lt;br /&gt;
*.color5:       #9e6bb8&lt;br /&gt;
*.color13:      #d2b1e2&lt;br /&gt;
&lt;br /&gt;
! cyan&lt;br /&gt;
*.color6:       #5c9d88&lt;br /&gt;
*.color14:      #a4d0c1&lt;br /&gt;
&lt;br /&gt;
! white&lt;br /&gt;
*.color7:       #919191&lt;br /&gt;
*.color15:      #d0d0d0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install git p7zip-full build-essential gdb zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev xorg i3 i3lock i3status rofi rxvt-unicode xdm lynx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Debian makes xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir /megazeux&lt;br /&gt;
sudo chown mzx:mzx /megazeux&lt;br /&gt;
cd /megazeux&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9158</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9158"/>
		<updated>2023-09-14T19:07:08Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Nintendo Wii U */ Fix packages for Wii U.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For compiling MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. If you are using a 64-bit operating system, follow the 64-bit instructions below. If you are using a 32-bit operating system, follow the 32-bit instructions below.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (64-bit)===&lt;br /&gt;
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (32-bit)===&lt;br /&gt;
Run '''mingw32.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw32 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win32&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw32.exe''', add the folder containing your dependencies (generally ''C:\msys32\mingw32\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'' or ''C:\msys32\mingw32\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''SDL-devel''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.92c&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make lipo&lt;br /&gt;
 make archive&lt;br /&gt;
A .dmg will appear in build/arch/darwin/.  Please refer to the documentation in arch/darwin/ for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbis wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9157</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9157"/>
		<updated>2022-08-31T12:55:42Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Setup */  # comments in .Xresources are nonstandard, use !&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images, this is roughly how all of the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources.''' This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
! &amp;quot;lumifoo&amp;quot; by gutterslob.&lt;br /&gt;
&lt;br /&gt;
! special&lt;br /&gt;
*.foreground:   #888a8c&lt;br /&gt;
*.background:   #1e2021&lt;br /&gt;
*.cursorColor:  #888a8c&lt;br /&gt;
&lt;br /&gt;
! black&lt;br /&gt;
*.color0:       #515151&lt;br /&gt;
*.color8:       #707172&lt;br /&gt;
&lt;br /&gt;
! red&lt;br /&gt;
*.color1:       #bf6382&lt;br /&gt;
*.color9:       #eaaec2&lt;br /&gt;
&lt;br /&gt;
! green&lt;br /&gt;
*.color2:       #65a446&lt;br /&gt;
*.color10:      #aed49b&lt;br /&gt;
&lt;br /&gt;
! yellow&lt;br /&gt;
*.color3:       #ad8a43&lt;br /&gt;
*.color11:      #d4c3a0&lt;br /&gt;
&lt;br /&gt;
! blue&lt;br /&gt;
*.color4:       #6b85c2&lt;br /&gt;
*.color12:      #afc4e9&lt;br /&gt;
&lt;br /&gt;
! magenta&lt;br /&gt;
*.color5:       #9e6bb8&lt;br /&gt;
*.color13:      #d2b1e2&lt;br /&gt;
&lt;br /&gt;
! cyan&lt;br /&gt;
*.color6:       #5c9d88&lt;br /&gt;
*.color14:      #a4d0c1&lt;br /&gt;
&lt;br /&gt;
! white&lt;br /&gt;
*.color7:       #919191&lt;br /&gt;
*.color15:      #d0d0d0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages (Debian assumed, will be different for other platforms):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install git p7zip-full build-essential gdb zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev xorg i3 i3lock i3status rofi rxvt-unicode xdm lynx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some Debian i3 packages make xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir /megazeux&lt;br /&gt;
sudo chown mzx:mzx /megazeux&lt;br /&gt;
cd /megazeux&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9156</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9156"/>
		<updated>2022-08-21T20:50:20Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Nintendo Wii U */ The Wii U port has, in fact, been merged.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For compiling MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. If you are using a 64-bit operating system, follow the 64-bit instructions below. If you are using a 32-bit operating system, follow the 32-bit instructions below.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (64-bit)===&lt;br /&gt;
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (32-bit)===&lt;br /&gt;
Run '''mingw32.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw32 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win32&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw32.exe''', add the folder containing your dependencies (generally ''C:\msys32\mingw32\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'' or ''C:\msys32\mingw32\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''SDL-devel''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.92c&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make lipo&lt;br /&gt;
 make archive&lt;br /&gt;
A .dmg will appear in build/arch/darwin/.  Please refer to the documentation in arch/darwin/ for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-libogg ppc-libvorbisidec wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9155</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9155"/>
		<updated>2022-08-21T20:49:56Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* DJGPP */  DJGPP has, in fact, been merged.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For compiling MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. If you are using a 64-bit operating system, follow the 64-bit instructions below. If you are using a 32-bit operating system, follow the 32-bit instructions below.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (64-bit)===&lt;br /&gt;
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (32-bit)===&lt;br /&gt;
Run '''mingw32.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw32 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win32&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw32.exe''', add the folder containing your dependencies (generally ''C:\msys32\mingw32\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'' or ''C:\msys32\mingw32\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''SDL-devel''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.92c&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make lipo&lt;br /&gt;
 make archive&lt;br /&gt;
A .dmg will appear in build/arch/darwin/.  Please refer to the documentation in arch/darwin/ for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
NOTE: [https://github.com/AliceLR/megazeux/pull/246/ this port has not yet been merged into mainline MZX.]&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-libogg ppc-libvorbisidec wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9154</id>
		<title>Compiling MegaZeux</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Compiling_MegaZeux&amp;diff=9154"/>
		<updated>2022-08-21T20:48:47Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* DJGPP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Instructions]] [[Category:MegaZeux]]&lt;br /&gt;
Compiling any MegaZeux 2.80 or later source requires a POSIX compatible shell (bash, dash) to be installed.  Download the source .tar.bz2 or .tar.xz and extract it to a new folder.&lt;br /&gt;
&lt;br /&gt;
==General Commands==&lt;br /&gt;
 ./config.sh&lt;br /&gt;
This will give you help about how to configure MegaZeux.&lt;br /&gt;
&lt;br /&gt;
 ./config.sh --platform unix&lt;br /&gt;
To configure the sources. On OS X, the platform is &amp;quot;darwin&amp;quot;, and on Windows the platform is either &amp;quot;win64&amp;quot; or &amp;quot;win32&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.&lt;br /&gt;
&lt;br /&gt;
 make install&lt;br /&gt;
This will install MegaZeux to the system. This should not be used with the &amp;quot;unix-devel&amp;quot; platform or any other option intended to run straight out of the source directory.&lt;br /&gt;
&lt;br /&gt;
Please see debian/README for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
For compiling MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing. If you are using a 64-bit operating system, follow the 64-bit instructions below. If you are using a 32-bit operating system, follow the 32-bit instructions below.&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (64-bit)===&lt;br /&gt;
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw64 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win64&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-x86_64-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Windows with MSYS2 (32-bit)===&lt;br /&gt;
Run '''mingw32.exe''' in the ''msys2'' directory. You will be in the &amp;quot;{MSYS DIRECTORY}\home\{your username}\&amp;quot; directory.  (This will display in the mingw32 shell as either &amp;quot;~&amp;quot; or &amp;quot;/home/{your username}&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
First, run this command. MSYS2 will need to restart when it is finished.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Syu&lt;br /&gt;
&lt;br /&gt;
After restarting MSYS2, run the following commands.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -Su&lt;br /&gt;
 yes Y | pacman -S git&lt;br /&gt;
 yes Y | pacman -S make&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-zlib&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gcc&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-gdb&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libpng&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libogg&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-libvorbis&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-SDL2&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git&lt;br /&gt;
 cd megazeux&lt;br /&gt;
 ./config.sh --platform win32&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
MegaZeux should be built and ready to run! If you are not running MegaZeux from '''mingw32.exe''', add the folder containing your dependencies (generally ''C:\msys32\mingw32\bin'') to your Windows PATH variable. Otherwise, MegaZeux will not be able to start from Explorer.&lt;br /&gt;
&lt;br /&gt;
The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.&lt;br /&gt;
&lt;br /&gt;
 yes Y | pacman -S nano&lt;br /&gt;
 yes Y | pacman -S p7zip&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-clang&lt;br /&gt;
 yes Y | pacman -S mingw-w64-i686-imagemagick&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
- ''&amp;quot;The program can't start because ___.dll is missing.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
If you are running MegaZeux from Explorer, add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'' or ''C:\msys32\mingw32\bin'') to your Windows PATH variable.&lt;br /&gt;
&lt;br /&gt;
- ''&amp;quot;The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.&amp;quot; (and similar errors)''&lt;br /&gt;
&lt;br /&gt;
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu/Debian==&lt;br /&gt;
&lt;br /&gt;
 sudo apt install build-essential&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang.&lt;br /&gt;
&lt;br /&gt;
 supo apt install libpng-dev libogg-dev libvorbis-dev libsdl2-dev &lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''libsdl1.2-dev''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
 sudo apt install devscripts debhelper&lt;br /&gt;
Download the packaging tools.&lt;br /&gt;
&lt;br /&gt;
From the MegaZeux source directory:&lt;br /&gt;
 debuild -us -uc&lt;br /&gt;
&lt;br /&gt;
==Fedora==&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install gcc gcc-c++ make binutils&lt;br /&gt;
Download compilers to build MegaZeux. MegaZeux will also build with clang/clang++.&lt;br /&gt;
&lt;br /&gt;
 supo dnf install zlib-devel libpng-devel libogg-devel libvorbis-devel SDL2-devel&lt;br /&gt;
Download the dependencies required to build MegaZeux. To build with SDL 1.2, install the package ''SDL-devel''.&lt;br /&gt;
&lt;br /&gt;
To install the latest master, use:&lt;br /&gt;
 sudo dnf install git&lt;br /&gt;
 git clone https://github.com/AliceLR/megazeux.git [dest dir]&lt;br /&gt;
Alternatively, download and extract the [https://vault.digitalmzx.net/download.php?latest=src latest .tar.xz or .tar.bz2 source archive] to the desired location.&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;general commands&amp;quot; section above for more information.&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
&lt;br /&gt;
The rpm-build package is required:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install rpm-build&lt;br /&gt;
&lt;br /&gt;
If you're building from a cloned Git repository, checkout the appropriate MegaZeux version tag. For example:&lt;br /&gt;
&lt;br /&gt;
 git checkout v2.92c&lt;br /&gt;
&lt;br /&gt;
To build the rpm:&lt;br /&gt;
&lt;br /&gt;
 make distclean&lt;br /&gt;
 rpm-build -bb --build-in-place megazeux.spec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
===With MacPorts (testing only)===&lt;br /&gt;
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.&lt;br /&gt;
&lt;br /&gt;
Compile/install dependencies.&lt;br /&gt;
 sudo port install zlib libpng libogg libvorbis libsdl&lt;br /&gt;
&lt;br /&gt;
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.&lt;br /&gt;
&lt;br /&gt;
Run ./config.sh with some or all of the following flags:&lt;br /&gt;
 --platform darwin-devel   ---------- Mandatory.&lt;br /&gt;
 --prefix /opt/local       ---------- Mandatory.&lt;br /&gt;
 --disable-libsdl2         ---------- Use this if building against SDL 1.2 (optional).&lt;br /&gt;
 --disable-utils           ---------- This disables compilation of utilities such as downver and checkres (optional).&lt;br /&gt;
 --enable-release          ---------- Enables optimizations, resulting in a faster executable.&lt;br /&gt;
&lt;br /&gt;
Build MegaZeux as usual:&lt;br /&gt;
 make -j8&lt;br /&gt;
&lt;br /&gt;
===Packaging===&lt;br /&gt;
Make sure there is not a &amp;quot;MegaZeux&amp;quot; volume mounted before continuing.&lt;br /&gt;
&lt;br /&gt;
 rm -r build/&lt;br /&gt;
 make lipo&lt;br /&gt;
 make archive&lt;br /&gt;
A .dmg will appear in build/arch/darwin/.  Please refer to the documentation in arch/darwin/ for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==HTML5 (Emscripten)==&lt;br /&gt;
NOTE: emsdk may not function properly in MSYS2. Using Linux or similar is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Download and install emsdk.&lt;br /&gt;
 git clone https://github.com/emscripten-core/emsdk /opt/emsdk&lt;br /&gt;
 cd /opt/emsdk&lt;br /&gt;
 ./emsdk install latest&lt;br /&gt;
 ./emsdk activate latest&lt;br /&gt;
 . ./emsdk_env.sh&lt;br /&gt;
&lt;br /&gt;
Configure and build MZX:&lt;br /&gt;
 ./config.sh --platform emscripten --enable-release&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
Note that compiling MZX will make emsdk automatically install all required dependencies.&lt;br /&gt;
&lt;br /&gt;
==devkitARM, devkitA64, and devkitPPC ==&lt;br /&gt;
Follow the instructions [https://devkitpro.org/wiki/Getting_Started here] to install the devkitPro toolchains.&lt;br /&gt;
&lt;br /&gt;
Note that if you're using MSYS2 (or a Linux distribution with pacman already installed), you can simply add the devkitPro repository to your pacman.conf and install devkitpro-keyring:&lt;br /&gt;
&lt;br /&gt;
 [dkp-libs]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages&lt;br /&gt;
 &lt;br /&gt;
 [dkp-windows]&lt;br /&gt;
 Server = http://downloads.devkitpro.org/packages/windows&lt;br /&gt;
&lt;br /&gt;
===Nintendo DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libnds libfat-nds maxmod-nds nds-zlib ndstool dstools&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/nds/CONFIG.NDS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo 3DS===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitARM libctru citro3d picasso 3dstools general-tools&lt;br /&gt;
 pacman --needed --noconfirm -S 3ds-zlib 3ds-libpng 3ds-libogg 3ds-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/3ds/CONFIG.3DS&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC libogc libfat-ogc gamecube-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-zlib ppc-libpng ppc-libogg ppc-libvorbisidec&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wii/CONFIG.WII&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Wii U===&lt;br /&gt;
NOTE: [https://github.com/AliceLR/megazeux/pull/246/ this port has not yet been merged into mainline MZX.]&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitPPC wut wut-tools&lt;br /&gt;
 pacman --needed --noconfirm -S ppc-libogg ppc-libvorbisidec wiiu-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/wiiu/CONFIG.WIIU&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
===Nintendo Switch===&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 pacman --needed --noconfirm -S devkitA64 libnx switch-tools&lt;br /&gt;
 pacman --needed --noconfirm -S switch-glad switch-glm switch-mesa switch-libdrm_nouveau&lt;br /&gt;
 pacman --needed --noconfirm -S switch-zlib switch-libpng switch-libogg switch-libvorbis switch-sdl2&lt;br /&gt;
&lt;br /&gt;
Configure and build:&lt;br /&gt;
 arch/switch/CONFIG.SWITCH&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;br /&gt;
&lt;br /&gt;
==DJGPP==&lt;br /&gt;
NOTE: [https://github.com/AliceLR/megazeux/pull/201/ this port has not yet been merged into mainline MZX.]&lt;br /&gt;
&lt;br /&gt;
Get a pre-built copy of DJGPP for your operating system from [https://github.com/andrewwutw/build-djgpp here]. Create an environment variable DJGPP pointing to the location you extracted DJGPP and add the toolchain to your PATH variable:&lt;br /&gt;
 export DJGPP=/opt/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
 export DJGPP_PREFIX=/c/djgpp&lt;br /&gt;
 export PATH=&amp;quot;$PATH:$DJGPP/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Build [https://zlib.net zlib]:&lt;br /&gt;
 CHOST=i586-pc-msdosdjgpp ./configure --prefix=$DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [http://www.libpng.org/pub/png/libpng.html libpng]:&lt;br /&gt;
 CFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 CPPFLAGS=&amp;quot;-I$DJGPP/include&amp;quot; \&lt;br /&gt;
 LDFLAGS=&amp;quot;-L$DJGPP/lib -lz&amp;quot; \&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build tremor (lowmem):&lt;br /&gt;
 git clone https://gitlab.xiph.org/xiph/tremor&lt;br /&gt;
 git checkout lowmem&lt;br /&gt;
 ./autogen.sh --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Build [https://xiph.org/downloads/ libogg and libvorbis]:&lt;br /&gt;
 ./configure --prefix=$DJGPP --host=i586-pc-msdosdjgpp --disable-shared --enable-static&lt;br /&gt;
 make -j8&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Configure and build MegaZeux (libpng disabled and using tremor by default):&lt;br /&gt;
 arch/djgpp/CONFIG.DJGPP&lt;br /&gt;
 make -j8&lt;br /&gt;
 make archive&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9153</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9153"/>
		<updated>2022-01-03T11:55:13Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: Update Debian packages list.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images, this is roughly how all of the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources.''' This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;quot;lumifoo&amp;quot; by gutterslob.&lt;br /&gt;
&lt;br /&gt;
! special&lt;br /&gt;
*.foreground:   #888a8c&lt;br /&gt;
*.background:   #1e2021&lt;br /&gt;
*.cursorColor:  #888a8c&lt;br /&gt;
&lt;br /&gt;
! black&lt;br /&gt;
*.color0:       #515151&lt;br /&gt;
*.color8:       #707172&lt;br /&gt;
&lt;br /&gt;
! red&lt;br /&gt;
*.color1:       #bf6382&lt;br /&gt;
*.color9:       #eaaec2&lt;br /&gt;
&lt;br /&gt;
! green&lt;br /&gt;
*.color2:       #65a446&lt;br /&gt;
*.color10:      #aed49b&lt;br /&gt;
&lt;br /&gt;
! yellow&lt;br /&gt;
*.color3:       #ad8a43&lt;br /&gt;
*.color11:      #d4c3a0&lt;br /&gt;
&lt;br /&gt;
! blue&lt;br /&gt;
*.color4:       #6b85c2&lt;br /&gt;
*.color12:      #afc4e9&lt;br /&gt;
&lt;br /&gt;
! magenta&lt;br /&gt;
*.color5:       #9e6bb8&lt;br /&gt;
*.color13:      #d2b1e2&lt;br /&gt;
&lt;br /&gt;
! cyan&lt;br /&gt;
*.color6:       #5c9d88&lt;br /&gt;
*.color14:      #a4d0c1&lt;br /&gt;
&lt;br /&gt;
! white&lt;br /&gt;
*.color7:       #919191&lt;br /&gt;
*.color15:      #d0d0d0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages (Debian assumed, will be different for other platforms):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install git p7zip-full build-essential gdb zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev xorg i3 i3lock i3status rofi rxvt-unicode xdm lynx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some Debian i3 packages make xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir /megazeux&lt;br /&gt;
sudo chown mzx:mzx /megazeux&lt;br /&gt;
cd /megazeux&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=List_of_known_worlds_that_fail_validation&amp;diff=9152</id>
		<title>List of known worlds that fail validation</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=List_of_known_worlds_that_fail_validation&amp;diff=9152"/>
		<updated>2021-12-09T04:50:07Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: Added invalid 1.x bytecode table (only known game is currently Chronos Stasis 1.01).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Several MegaZeux worlds, from infamous to little-known, fail MegaZeux's validation checks.&lt;br /&gt;
&lt;br /&gt;
== Major Errors ==&lt;br /&gt;
This is for worlds that fail major validation checks -- worlds that completely fail or with one or more boards that are broken beyond repair.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! Title !! Error type !! Description&lt;br /&gt;
 |-&lt;br /&gt;
 | Pre-2.83 SVN games&lt;br /&gt;
 | Board&lt;br /&gt;
 | Several games made with certain SVN versions of MZX contain 2.82X boards but have a 2.83 world magic, leading to errors when loaded in any official release version.  See the appropriate section.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1002 Archer Gremory Is Thirsty]&lt;br /&gt;
 | World&lt;br /&gt;
 | This game attempts a swap world to an invalid file designed to pass as a locked world.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=887 Brotherhood, The: Legacy of Drake (HUNTDRAK.MZX)]&lt;br /&gt;
 | Board&lt;br /&gt;
 | Seven corrupt boards exist in the middle of the file.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=150 Civil War 2040]&lt;br /&gt;
 | Board&lt;br /&gt;
 | One board is corrupt or truncated.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1929 DA BOMB!!!!!!] (corrupt version)&lt;br /&gt;
 | World&lt;br /&gt;
 | All instances of the byte 0A were replaced with 0D 0A newlines due to FTP misuse, causing the world to fail validation.  Version on DMZX is corrected.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=333 Final Fantasy: Dynasty Prelude Project Dump]&lt;br /&gt;
 | World (WORLD03.MZX), Robot (FFTOWNO.MZX), Board (all worlds failing a CRC check)&lt;br /&gt;
 | Akwende infamously released this ZIP file in his departure from the community.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1332 Lesbian Space Pirates (9.mzx)]&lt;br /&gt;
 | Board&lt;br /&gt;
 | Corrupt board.  The global robot is also corrupt, but gets silently caught due to an early program end.  This world was made in a hex editor.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1446 Mana Lust] (pre-fix)&lt;br /&gt;
 | Board&lt;br /&gt;
 | One of the boards has a subtly incorrect pointer from an unknown cause.  The version available on DMZX has this corrected.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1770 MZX Target (pre-recovery)]&lt;br /&gt;
 | Board, Robot, Program&lt;br /&gt;
 | World is completely truncated starting at least one program from the end of the fifth or sixth board.  A complete version has since been released.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=642 Star Quest (#4214)]&lt;br /&gt;
 | Board, Robot&lt;br /&gt;
 | Corrupt robots, several missing robots in a truncated board, the errors go on.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=774 Weirdland 3] (corrupt version)&lt;br /&gt;
 | World&lt;br /&gt;
 | Same issue as DA BOMB!!! above -- all 0A bytes were converted to 0D 0A.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1471 z1111000.mzx] (in the Fanye folder)&lt;br /&gt;
 | Program&lt;br /&gt;
 | Every single robot in the world has a corrupt program.  This world was probably made in a hex editor.&lt;br /&gt;
 |-&lt;br /&gt;
 | Shaq Hut 2 (Project Dump)&lt;br /&gt;
 | Robot&lt;br /&gt;
 | This world has a corrupt global robot, and as a result nothing in the game works properly.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Pre-2.83 SVN games ===&lt;br /&gt;
&lt;br /&gt;
These files can be fixed by hex editing byte 28 from \x53 to \x52.&lt;br /&gt;
&lt;br /&gt;
*[https://www.digitalmzx.net/forums/index.php?app=tracker&amp;amp;showissue=227 LPTW Season 2 Intro] (lptws2in.mzx)&lt;br /&gt;
*[https://www.digitalmzx.com/show.php?id=1634 Revenge of the Toaster] (easy.mzx)&lt;br /&gt;
*[https://www.digitalmzx.com/show.php?id=1809 Gravity by Revvy and Tixus] (tixrev2.mzx)&lt;br /&gt;
&lt;br /&gt;
The following games have been fixed:&lt;br /&gt;
&lt;br /&gt;
*[https://www.digitalmzx.com/show.php?id=1666 Bombin' Dude] (v2 was affected)&lt;br /&gt;
*[https://www.digitalmzx.com/show.php?id=1665 Pretentia] (affected version is hidden)&lt;br /&gt;
&lt;br /&gt;
== Minor Errors ==&lt;br /&gt;
This is for worlds that have one or two minor board issues, trigger the &amp;quot;expected # robots&amp;quot; error message, or attempt to use corrupt MZMs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! Title !! Description&lt;br /&gt;
 |-&lt;br /&gt;
 |-&lt;br /&gt;
 | HELL STAR&lt;br /&gt;
 | A board in this game contains one more robot than was specified in the robot data for the board.&lt;br /&gt;
 |-&lt;br /&gt;
 | instacrash.mzx&lt;br /&gt;
 | A world made by mzxrules.  The end of the board is corrupt, making it think there are no robots when there really is one.  MZX itself can't do anything about this but a utility could be made to recover &amp;quot;missing&amp;quot; programs such as this one.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Invalid Programs==&lt;br /&gt;
This is for games with invalid or corrupt Robotic programs. The severity of this varies from game to game but typically the programs in question ran fine to some degree and were never noticed until validation was added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! Title !! Description !! Invalid bytecode !! Fix&lt;br /&gt;
 |-&lt;br /&gt;
 | Anything made by mikawo's ZZT to MZX converter&lt;br /&gt;
 | The global robots produced by this converter are corrupt.  This results in the cheats and (in the case of SaintZZT 7th) some options being inaccessible.&lt;br /&gt;
*[https://www.digitalmzx.com/show.php?id=1925 Ep+Arp World MZX]&lt;br /&gt;
*[https://www.digitalmzx.com/show.php?id=1745 SZZT7_ori.mzx]&lt;br /&gt;
 |&lt;br /&gt;
 04 30 03 00 01 6E&lt;br /&gt;
 00 23 00 FF 20 FF&lt;br /&gt;
 20 FF 20&lt;br /&gt;
 FF 20 97 20 91 B2 DD 20 85&lt;br /&gt;
 B2 87 20&lt;br /&gt;
 85 B2 DD 20 83 B2&lt;br /&gt;
 8B 20 83 B2 DD 20&lt;br /&gt;
 82 B2 8D&lt;br /&gt;
 20&lt;br /&gt;
 |&lt;br /&gt;
 04 30 00 26 00 04&lt;br /&gt;
 04 5B 00 0E 00 04&lt;br /&gt;
 01 00 01&lt;br /&gt;
 07 6A 05 21 5E 77 6B 00 07&lt;br /&gt;
 01 2C 01&lt;br /&gt;
 04 30 00 26 00 04&lt;br /&gt;
 04 5B 00 0F 00 04&lt;br /&gt;
 01 00 01&lt;br /&gt;
 00&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1513 Eternal Eclipse Taoyarin (v1.0 only)]&lt;br /&gt;
 | Several of the robotic bytecode files packaged with this game have malformed program ends. This causes a large number of errors to display in some MZX versions.&lt;br /&gt;
 |&lt;br /&gt;
 AE 00 (the first byte varies)&lt;br /&gt;
 |&lt;br /&gt;
 00&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1386 Loco]&lt;br /&gt;
 | Loco has a robot with a corrupt program.&lt;br /&gt;
 |&lt;br /&gt;
 04 1D 02 61 00 7E&lt;br /&gt;
 04 0C 02 F7 74 1F&lt;br /&gt;
 01 52 00 00 00 00 00 00&lt;br /&gt;
 |&lt;br /&gt;
 04 1D 02 61 00 04&lt;br /&gt;
 04 6A 02 62 00 04&lt;br /&gt;
 19 4F 00 20 01 00 05 00&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=637 Manuel the Manx]&lt;br /&gt;
 | The control robot on the &amp;quot;House&amp;quot; board of Manuel the Manx is entirely corrupt starting about midway through. It doesn't matter much as this board is inaccessible.&lt;br /&gt;
 |&lt;br /&gt;
 0F 6E 00 04 00 0A 6C 6F 6F 70 63 6F 75 6E 84 84 84&lt;br /&gt;
 |&lt;br /&gt;
 00&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1207 Sidewinder's Engines]&lt;br /&gt;
 | Two robots have the last 00 byte replaced with FF.&lt;br /&gt;
 |&lt;br /&gt;
 FF&lt;br /&gt;
 |&lt;br /&gt;
 00&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Some games have global robots marked &amp;quot;unused&amp;quot;. Some MZX versions would retain a program pointer and length and save garbage bytecode to the world file for these robots. From 2.84c until 2.92c these programs wouldn't be properly ignored, producing some error messages. From 2.92c onward these are silently replaced with a blank program.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! Title !! Description !! Invalid bytecode !! Fix&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1424 Slave Pit]&lt;br /&gt;
 | Global robot.&lt;br /&gt;
 |&lt;br /&gt;
 FF&lt;br /&gt;
 FF FF FF 00 00 00 FF FF FF 88 01 00 ...&lt;br /&gt;
 |&lt;br /&gt;
 FF&lt;br /&gt;
 00&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1327 Wes]&lt;br /&gt;
 | Global robot.&lt;br /&gt;
 |&lt;br /&gt;
 42&lt;br /&gt;
 00 00&lt;br /&gt;
 00 43&lt;br /&gt;
 00 00&lt;br /&gt;
 00 B0&lt;br /&gt;
 9A 95 00 00 9B 95 00 ...&lt;br /&gt;
 |&lt;br /&gt;
 FF&lt;br /&gt;
 00&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Invalid Programs (1.x worlds)==&lt;br /&gt;
Due to MegaZeux 1.x being much buggier than 2.x, corrupt programs seem to be more frequent in affected worlds. 1.x program conversion will do the bare minimum required to get these to &amp;quot;work&amp;quot; (usually trailing length byte replacement or program termination). Note the bytecode format here is 1.x bytecode and NOT usual 2.x bytecode.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! Title !! Description !! Invalid bytecode !! Interpreted as&lt;br /&gt;
 |-&lt;br /&gt;
 | Chronos Stasis 1.01&lt;br /&gt;
 | FIXME unknown location.&lt;br /&gt;
 |&lt;br /&gt;
 01 4D 00&lt;br /&gt;
 00&lt;br /&gt;
 |&lt;br /&gt;
 00&lt;br /&gt;
 |-&lt;br /&gt;
 | Chronos Stasis 1.01&lt;br /&gt;
 | Upper camera (17- Aviary Lab)&lt;br /&gt;
 |&lt;br /&gt;
 02 4D 00 00 01 00 97 02&lt;br /&gt;
 02 02 01 02&lt;br /&gt;
 04 1D 64 6F 00 04&lt;br /&gt;
 00&lt;br /&gt;
 |&lt;br /&gt;
(Affected commands should presumably be 02 02 01 02 and 02 07 97 02.)&lt;br /&gt;
 02 4D 00 02&lt;br /&gt;
 01 00 01&lt;br /&gt;
 02 02 02 02&lt;br /&gt;
 00&lt;br /&gt;
 |-&lt;br /&gt;
 | Chronos Stasis 1.01&lt;br /&gt;
 | FIXME unknown location.&lt;br /&gt;
 |&lt;br /&gt;
 04 1D 64 6F 00 FF&lt;br /&gt;
 00&lt;br /&gt;
 |&lt;br /&gt;
 04 1D 64 6F 00 04&lt;br /&gt;
 00&lt;br /&gt;
 |-&lt;br /&gt;
 | Chronos Stasis 1.01&lt;br /&gt;
 | Red button near voice analyzer (22- Life support, etc).&lt;br /&gt;
 |&lt;br /&gt;
 02 02 4D 00 00 01 00 02&lt;br /&gt;
 01 00 01&lt;br /&gt;
 00&lt;br /&gt;
 |&lt;br /&gt;
 02 02 4D 02&lt;br /&gt;
 00&lt;br /&gt;
 |-&lt;br /&gt;
 | Chronos Stasis 1.01&lt;br /&gt;
 | Door code '0' button (28- Meeting Rooms).&lt;br /&gt;
 |&lt;br /&gt;
 07 1E 61 6C 6C 4D 00 00 01&lt;br /&gt;
 00 08 FC 02 02 02 02 02 02 08 F4 02 FF 00 01 00&lt;br /&gt;
 |&lt;br /&gt;
 07 1E 61 6C 6C 4D 00 00 07&lt;br /&gt;
 00&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== No message displayed ==&lt;br /&gt;
This is for development reference only, as most users will not be able to detect these errors.  These are mostly early program ends and 0-length programs that are silently managed internally.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! Title !! Error type !! Description&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1056 Aura MZX]&lt;br /&gt;
 | Program&lt;br /&gt;
 | Early program end.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1005 Catacombs of Zeux], probably countless other VER1TO2 worlds&lt;br /&gt;
 | Robot&lt;br /&gt;
 | Several robots exist with programs of length 0.  These are harmless and ignored with no error.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1653 CR2-6]&lt;br /&gt;
 | Program&lt;br /&gt;
 | This game contains a line of bytecode with an extra byte, but was otherwise valid.  It forced us to rewrite part of program validation!  Giel's legacy.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1584 Musings]&lt;br /&gt;
 | Program&lt;br /&gt;
 | Early program end.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=79 Oh No! Not Another Star Wars Parody!]&lt;br /&gt;
 | Program&lt;br /&gt;
 | Early program end.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=1142 Postality]&lt;br /&gt;
 | Program&lt;br /&gt;
 | Early program end.&lt;br /&gt;
 |-&lt;br /&gt;
 | [https://www.digitalmzx.com/show.php?id=278 Quest for the Nobles Demo]&lt;br /&gt;
 | Program&lt;br /&gt;
 | Early program end.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[Incompatibility|Worlds that are incompatible with the MegaZeux port]]&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9151</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9151"/>
		<updated>2021-08-28T14:50:51Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: Remove qcow2 compression from the packaging instructions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images, this is roughly how all of the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources.''' This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;quot;lumifoo&amp;quot; by gutterslob.&lt;br /&gt;
&lt;br /&gt;
! special&lt;br /&gt;
*.foreground:   #888a8c&lt;br /&gt;
*.background:   #1e2021&lt;br /&gt;
*.cursorColor:  #888a8c&lt;br /&gt;
&lt;br /&gt;
! black&lt;br /&gt;
*.color0:       #515151&lt;br /&gt;
*.color8:       #707172&lt;br /&gt;
&lt;br /&gt;
! red&lt;br /&gt;
*.color1:       #bf6382&lt;br /&gt;
*.color9:       #eaaec2&lt;br /&gt;
&lt;br /&gt;
! green&lt;br /&gt;
*.color2:       #65a446&lt;br /&gt;
*.color10:      #aed49b&lt;br /&gt;
&lt;br /&gt;
! yellow&lt;br /&gt;
*.color3:       #ad8a43&lt;br /&gt;
*.color11:      #d4c3a0&lt;br /&gt;
&lt;br /&gt;
! blue&lt;br /&gt;
*.color4:       #6b85c2&lt;br /&gt;
*.color12:      #afc4e9&lt;br /&gt;
&lt;br /&gt;
! magenta&lt;br /&gt;
*.color5:       #9e6bb8&lt;br /&gt;
*.color13:      #d2b1e2&lt;br /&gt;
&lt;br /&gt;
! cyan&lt;br /&gt;
*.color6:       #5c9d88&lt;br /&gt;
*.color14:      #a4d0c1&lt;br /&gt;
&lt;br /&gt;
! white&lt;br /&gt;
*.color7:       #919191&lt;br /&gt;
*.color15:      #d0d0d0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages (Debian assumed, will be different for other platforms):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install git p7zip-full build-essential gdb zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev xorg i3 i3lock i3status suckless-tools rxvt-unicode xdm lynx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some Debian i3 packages make xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir /megazeux&lt;br /&gt;
sudo chown mzx:mzx /megazeux&lt;br /&gt;
cd /megazeux&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed tarball containing the image and scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&lt;br /&gt;
# If you have several cores and don't mind using them all, this&lt;br /&gt;
# makes xz use parallel compression to speed things up.&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9150</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9150"/>
		<updated>2021-08-28T14:38:55Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Linux/BSD (secondary architectures) */ Update m68k image.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m34s &amp;lt;br&amp;gt; 1m20s &amp;lt;br&amp;gt; 20s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210828.tar.xz 355MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images, this is roughly how all of the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources.''' This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;quot;lumifoo&amp;quot; by gutterslob.&lt;br /&gt;
&lt;br /&gt;
! special&lt;br /&gt;
*.foreground:   #888a8c&lt;br /&gt;
*.background:   #1e2021&lt;br /&gt;
*.cursorColor:  #888a8c&lt;br /&gt;
&lt;br /&gt;
! black&lt;br /&gt;
*.color0:       #515151&lt;br /&gt;
*.color8:       #707172&lt;br /&gt;
&lt;br /&gt;
! red&lt;br /&gt;
*.color1:       #bf6382&lt;br /&gt;
*.color9:       #eaaec2&lt;br /&gt;
&lt;br /&gt;
! green&lt;br /&gt;
*.color2:       #65a446&lt;br /&gt;
*.color10:      #aed49b&lt;br /&gt;
&lt;br /&gt;
! yellow&lt;br /&gt;
*.color3:       #ad8a43&lt;br /&gt;
*.color11:      #d4c3a0&lt;br /&gt;
&lt;br /&gt;
! blue&lt;br /&gt;
*.color4:       #6b85c2&lt;br /&gt;
*.color12:      #afc4e9&lt;br /&gt;
&lt;br /&gt;
! magenta&lt;br /&gt;
*.color5:       #9e6bb8&lt;br /&gt;
*.color13:      #d2b1e2&lt;br /&gt;
&lt;br /&gt;
! cyan&lt;br /&gt;
*.color6:       #5c9d88&lt;br /&gt;
*.color14:      #a4d0c1&lt;br /&gt;
&lt;br /&gt;
! white&lt;br /&gt;
*.color7:       #919191&lt;br /&gt;
*.color15:      #d0d0d0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages (Debian assumed, will be different for other platforms):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install git p7zip-full build-essential gdb zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev xorg i3 i3lock i3status suckless-tools rxvt-unicode xdm lynx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some Debian i3 packages make xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir /megazeux&lt;br /&gt;
sudo chown mzx:mzx /megazeux&lt;br /&gt;
cd /megazeux&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed image for the tarball:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img convert -c -O qcow2 arch.debian10.qcow2 arch.debian10.compressed.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, instead of using qcow2 compression, just xz it as part of the tarball. This will take longer but the compression is better. This can be sped up with parallel compression using the '''XZ_OPT''' environment variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9149</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9149"/>
		<updated>2021-08-28T12:49:19Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Linux/BSD (secondary architectures) */ Update SH-4 image.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m19s &amp;lt;br&amp;gt; 2m30s &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210417.tar 577MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m21s (-j4) &amp;lt;br&amp;gt; 26s (-j4) &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210828.tar.xz 414MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images, this is roughly how all of the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources.''' This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;quot;lumifoo&amp;quot; by gutterslob.&lt;br /&gt;
&lt;br /&gt;
! special&lt;br /&gt;
*.foreground:   #888a8c&lt;br /&gt;
*.background:   #1e2021&lt;br /&gt;
*.cursorColor:  #888a8c&lt;br /&gt;
&lt;br /&gt;
! black&lt;br /&gt;
*.color0:       #515151&lt;br /&gt;
*.color8:       #707172&lt;br /&gt;
&lt;br /&gt;
! red&lt;br /&gt;
*.color1:       #bf6382&lt;br /&gt;
*.color9:       #eaaec2&lt;br /&gt;
&lt;br /&gt;
! green&lt;br /&gt;
*.color2:       #65a446&lt;br /&gt;
*.color10:      #aed49b&lt;br /&gt;
&lt;br /&gt;
! yellow&lt;br /&gt;
*.color3:       #ad8a43&lt;br /&gt;
*.color11:      #d4c3a0&lt;br /&gt;
&lt;br /&gt;
! blue&lt;br /&gt;
*.color4:       #6b85c2&lt;br /&gt;
*.color12:      #afc4e9&lt;br /&gt;
&lt;br /&gt;
! magenta&lt;br /&gt;
*.color5:       #9e6bb8&lt;br /&gt;
*.color13:      #d2b1e2&lt;br /&gt;
&lt;br /&gt;
! cyan&lt;br /&gt;
*.color6:       #5c9d88&lt;br /&gt;
*.color14:      #a4d0c1&lt;br /&gt;
&lt;br /&gt;
! white&lt;br /&gt;
*.color7:       #919191&lt;br /&gt;
*.color15:      #d0d0d0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages (Debian assumed, will be different for other platforms):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install git p7zip-full build-essential gdb zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev xorg i3 i3lock i3status suckless-tools rxvt-unicode xdm lynx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some Debian i3 packages make xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir /megazeux&lt;br /&gt;
sudo chown mzx:mzx /megazeux&lt;br /&gt;
cd /megazeux&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed image for the tarball:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img convert -c -O qcow2 arch.debian10.qcow2 arch.debian10.compressed.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, instead of using qcow2 compression, just xz it as part of the tarball. This will take longer but the compression is better. This can be sped up with parallel compression using the '''XZ_OPT''' environment variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9148</id>
		<title>MegaZeux Development VMs</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=MegaZeux_Development_VMs&amp;diff=9148"/>
		<updated>2021-08-28T03:18:38Z</updated>

		<summary type="html">&lt;p&gt;Lachesis: /* Linux/BSD (secondary architectures) */ Fix Alpha image size.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment ([https://i3wm.org i3] in Debian or [https://en.wikipedia.org/wiki/CTWM CTWM] in NetBSD) to run MegaZeux in.&lt;br /&gt;
&lt;br /&gt;
The login for all VMs is '''mzx''' with the password '''mzx''', and the MegaZeux Git repository is typically located at '''/megazeux'''.&lt;br /&gt;
&lt;br /&gt;
This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (main architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.&lt;br /&gt;
&lt;br /&gt;
Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.&lt;br /&gt;
&lt;br /&gt;
The current head in &amp;lt;code&amp;gt;/megazeux&amp;lt;/code&amp;gt; should be the most recent head a full build was tested with.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMel''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Nintendo DS&lt;br /&gt;
* Nintendo 3DS&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* GP2X&lt;br /&gt;
| Debian Unstable{{ref|armelsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M versatilepb -m 256M -cpu arm1176&lt;br /&gt;
-kernel [...] -dtb [...] -append &amp;quot;root=/dev/sda1 panic=10&amp;quot;&lt;br /&gt;
-hda [...]&lt;br /&gt;
-no-reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 9m24s &amp;lt;br&amp;gt; 2m44s &amp;lt;br&amp;gt; 27s&lt;br /&gt;
| —&lt;br /&gt;
| Testing MZX should be done in system emulation, as several vio tests and the test worlds fail with '''chroot.sh''' due to a [https://gitlab.com/qemu-project/qemu/-/issues/263 QEMU bug]. The red and blue video components are reversed.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armel-debian-u20210822.tar.xz 340MB]&lt;br /&gt;
| [https://github.com/dhruvvyas90/qemu-rpi-kernel QEMU Raspberry Pi kernels and scripts.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARMhf --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARMhf''' &amp;lt;br&amp;gt; qemu-system-arm 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Raspberry Pi&lt;br /&gt;
* PlayStation Vita&lt;br /&gt;
* Pandora&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a15 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m13s (-j4) &amp;lt;br&amp;gt; 53s (-j4) &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| No working video. Use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-armhf-debian-10.10.tar.xz 413MB]&lt;br /&gt;
| See ARM64.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ARM64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''ARM64''' &amp;lt;br&amp;gt; qemu-system-aarch64 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Android&lt;br /&gt;
* Nintendo Switch&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -m 2048 -cpu cortex-a57 -smp 4&lt;br /&gt;
-kernel [...] -initrd [...] -append &amp;quot;root=/dev/vda2&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0&lt;br /&gt;
-device VGA&lt;br /&gt;
-usb -device usb-ehci,id=ehci&lt;br /&gt;
-device usb-mouse,bus=ehci.0&lt;br /&gt;
-device usb-kbd,bus=ehci.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m47s (-j4) &amp;lt;br&amp;gt; 59s (-j4) &amp;lt;br&amp;gt; 23s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-arm64-debian-10.10.tar.xz 427MB]&lt;br /&gt;
| [https://wiki.debian.org/Arm64Qemu Debian Wiki] [https://web.archive.org/web/20210415230009/https://wiki.debian.org/Arm64Qemu (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html Blog post with more detailed info.] [https://web.archive.org/web/20161115080530/https://kennedy-han.github.io/2015/06/16/QEMU-debian-ARMv8.html (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSeb --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSeb''' &amp;lt;br&amp;gt; qemu-system-mips 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 33m21s &amp;lt;br&amp;gt; 9m42s &amp;lt;br&amp;gt; 43s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipseb-debian-10.10.tar.xz 424MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPSel --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPSel''' &amp;lt;br&amp;gt; qemu-system-mipsel 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* PlayStation Portable&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 45m52s &amp;lt;br&amp;gt; 15m06s &amp;lt;br&amp;gt; 46s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mipsel-debian-10.10.tar.xz 408MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- MIPS64el --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''MIPS64el''' &amp;lt;br&amp;gt; qemu-system-mips64el 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian 10.10&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M malta -m 256 -cpu 5KEc&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 console=tty0&amp;quot;&lt;br /&gt;
-device usb-mouse -device usb-kbd&lt;br /&gt;
-vga std&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 35m20s &amp;lt;br&amp;gt; 9m08s &amp;lt;br&amp;gt; 39s&lt;br /&gt;
| —&lt;br /&gt;
| RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-mips64el-debian-10.10.tar.xz 414MB]&lt;br /&gt;
| [https://www.aurel32.net/info/debian_mips_qemu.php Setup] [https://web.archive.org/web/20200817030436/https://www.aurel32.net/info/debian_mips_qemu.php (archived)] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://people.debian.org/~aurel32/qemu/mips/ More info] [https://web.archive.org/web/20210404205352/https://people.debian.org/~aurel32/qemu/mips/ (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC''' &amp;lt;br&amp;gt; qemu-system-ppc 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
* Nintendo Wii&lt;br /&gt;
* Nintendo Wii U&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/ Debian Unstable 10.0]{{ref|ppcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 1G&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 17s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc-debian-u20210823.tar.xz 459MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PowerPC 64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PowerPC 64''' &amp;lt;br&amp;gt; qemu-system-ppc64 6.0.0&lt;br /&gt;
|&lt;br /&gt;
* Mac OS X&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/ppc64/iso-cd/ Debian Unstable 10.0]{{ref|ppc64setup}}{{ref|ppc64partition}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-L pc-bios -boot c&lt;br /&gt;
-M mac99,via=pmu -m 2048 -cpu 970fx&lt;br /&gt;
-prom-env &amp;quot;boot-device=hd:,\yaboot&amp;quot;&lt;br /&gt;
-prom-env &amp;quot;boot-args=conf=hd:,\yaboot.conf&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial stdio&lt;br /&gt;
-g 1024x768x32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 3m36s &amp;lt;br&amp;gt; 59s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-ppc64-debian-u20210823.tar.xz 483MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/PowerPC QEMU Wiki] [https://web.archive.org/web/20210410231026/https://wiki.qemu.org/Documentation/Platforms/PowerPC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- RISC-V RV64GC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''RISC-V RV64GC''' &amp;lt;br&amp;gt; qemu-system-riscv64 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| Debian Unstable{{ref|riscv64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M virt -smp 4 -m 2048M&lt;br /&gt;
-bios opensbi/generic/fw_jump.elf&lt;br /&gt;
-kernel u-boot/qemu-riscv64_smode/uboot.elf&lt;br /&gt;
-append &amp;quot;console=ttyS0 rw root=/dev/vda1&amp;quot;&lt;br /&gt;
-object rng-random,filename=/dev/urandom,id=rng0&lt;br /&gt;
-device virtio-rng-device,rng=rng0&lt;br /&gt;
-device virtio-blk-device,drive=hd0&lt;br /&gt;
-drive file=[...],format=qcow2,id=hd0&lt;br /&gt;
-device virtio-net-device,netdev=usernet&lt;br /&gt;
-netdev user,id=usernet,hostfwd=tcp::22222-:22&lt;br /&gt;
-device VGA \&lt;br /&gt;
-usb -device usb-ehci,id=ehci \&lt;br /&gt;
-device usb-mouse,bus=ehci.0 -device usb-kbd,bus=ehci.0 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 2m04s (-j4) &amp;lt;br&amp;gt; 48s (-j4) &amp;lt;br&amp;gt; 18s&lt;br /&gt;
| —&lt;br /&gt;
| Serial terminal is required to boot even with a VGA device (Ctrl+Alt+3).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-riscv64-debian-u20210822.tar.xz 481MB]&lt;br /&gt;
| [https://wiki.debian.org/RISC-V Debian Wiki RISC-V article] [https://web.archive.org/web/20210818070052/https://wiki.debian.org/RISC-V (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linux/BSD (secondary architectures) ==&lt;br /&gt;
&lt;br /&gt;
These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Architecture&lt;br /&gt;
! Related Ports&lt;br /&gt;
! Distribution&lt;br /&gt;
! Options&lt;br /&gt;
! make &amp;lt;br&amp;gt; unit &amp;lt;br&amp;gt; testworlds&lt;br /&gt;
! Fails&lt;br /&gt;
! Other Issues&lt;br /&gt;
! Image&lt;br /&gt;
! Links&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DEC Alpha --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''DEC Alpha''' &amp;lt;br&amp;gt; qemu-system-alpha 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda3 rw&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-device VGA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m15s &amp;lt;br&amp;gt; 1m09s &amp;lt;br&amp;gt; 14s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. D-Bus and X11 currently do not work correctly due to alignment issues, so use '''run.serial.sh'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-alpha-debian-u20210826.tar.xz 455MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/Alpha QEMU Wiki] [https://web.archive.org/web/20210107214027/https://wiki.qemu.org/Documentation/Platforms/Alpha (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Motorola 68000 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''Motorola 68000''' &amp;lt;br&amp;gt; qemu-system-m68k 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/snapshots/2021-04-17/ Debian Unstable 2021-04-17]&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M q800 -m 1000M&lt;br /&gt;
-kernel [...] -initrd [...]&lt;br /&gt;
-append &amp;quot;root=/dev/sda1 rw console=ttyS0 console=tty&amp;quot;&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic,model=dp83932 -net user&lt;br /&gt;
-g 800x600x16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 4m19s &amp;lt;br&amp;gt; 2m30s &amp;lt;br&amp;gt; 22s&lt;br /&gt;
| —&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-m68k-debian-u20210417.tar 577MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/m68k QEMU Wiki] [https://web.archive.org/web/20210110025158/https://wiki.qemu.org/Documentation/Platforms/m68k (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PA-RISC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''PA-RISC''' &amp;lt;br&amp;gt; qemu-system-hppa 5.2.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://cdimage.debian.org/cdimage/ports/10.0/hppa/iso-cd/ Debian Unstable 10.0]{{ref|hppasetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048 -accel tcg,thread=multi -smp 4&lt;br /&gt;
-drive [...]&lt;br /&gt;
-global artist.width=800&lt;br /&gt;
-global artist.height=600&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 34m51s (-j4) &amp;lt;br&amp;gt; 13m02s (-j4) &amp;lt;br&amp;gt; 1m51s&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--disable-stack-protector&amp;lt;/code&amp;gt;. Emulation is SLOW! Video doesn't work yet; use '''run.serial.sh''' (see setup notes).&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-hppa-debian-u20210826.tar.xz 432MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/HPPA QEMU Wiki] [https://web.archive.org/web/20201101190558/https://wiki.qemu.org/Documentation/Platforms/HPPA (archived)] &amp;lt;br&amp;gt; [https://parisc.wiki.kernel.org/index.php/Qemu PA-RISC Linux Wiki - QEMU] [https://web.archive.org/web/20210419222007/https://parisc.wiki.kernel.org/index.php/Qemu (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC''' &amp;lt;br&amp;gt; qemu-system-sparc 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparcsetup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-M SS-20&lt;br /&gt;
-m 512M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-net nic -net user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 5m50s &amp;lt;br&amp;gt; 1m26s &amp;lt;br&amp;gt; 25s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors. May hang during IO operations, but so far this has only happened with '''pkgsrc'''.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc-netbsd-9.2.tar.xz 358MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- SPARC64 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SPARC64''' &amp;lt;br&amp;gt; qemu-system-sparc64 6.0.0&lt;br /&gt;
| —&lt;br /&gt;
| [https://www.netbsd.org/releases/formal-9/NetBSD-9.2.html NetBSD 9.2]{{ref|sparc64setup}}&lt;br /&gt;
| &amp;lt;pre class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
-m 2048M&lt;br /&gt;
-drive [...]&lt;br /&gt;
-serial mon:stdio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| 14m50s &amp;lt;br&amp;gt; 3m38s &amp;lt;br&amp;gt; 33s &amp;lt;br&amp;gt; (a173946a)&lt;br /&gt;
| —&lt;br /&gt;
| Use &amp;lt;code&amp;gt;--prefix /usr/pkg --disable-libsdl2&amp;lt;/code&amp;gt;. SDL2 works headless but can't find a texture format and is missing -Wl,-rpath. &amp;lt;code&amp;gt;force_bpp=16&amp;lt;/code&amp;gt; will match colors to the nearest indexed colors.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sparc64-netbsd-9.2.tar.xz 439MB]&lt;br /&gt;
| [https://wiki.qemu.org/Documentation/Platforms/SPARC QEMU Wiki] [https://web.archive.org/web/20210815074550/https://wiki.qemu.org/Documentation/Platforms/SPARC (archived)]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Hitachi SH-4 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| '''SuperH SH-4''' &amp;lt;br&amp;gt; qemu-sh4-static 5.2.0&lt;br /&gt;
|&lt;br /&gt;
* Sega Dreamcast&lt;br /&gt;
| Debian Unstable{{ref|sh4setup}}&lt;br /&gt;
| n/a&lt;br /&gt;
| 1m16s (-j4) &amp;lt;br&amp;gt; 33s (-j4) &amp;lt;br&amp;gt; 21s&lt;br /&gt;
| —&lt;br /&gt;
| Only works using user emulation right now; use '''chroot.sh'''. Since [https://people.debian.org/~aurel32/qemu/sh4/ this] VM does boot it might be an issue with newer kernels.&lt;br /&gt;
| [https://www.digitalmzx.com/lachesis/VMs/vm-mzx-sh4-debian-u20210511.tar 571MB]&lt;br /&gt;
| [https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html Building Debian VMs with debootstrap] [https://web.archive.org/web/20210507031949/https://blog.entek.org.uk/technology/2020/06/06/building-debian-vms-with-debootstrap.html (archived)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason) you want to set up your own VM images, this is roughly how all of the VM images above were generated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.debian10.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Extract installation media vmlinux/initrd from ISO (if needed) and set up initial '''install.sh''' script.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access. Do not install a desktop environment.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If needed, extract runtime vmlinux/vmlinuz/initrd from the virtual machine (required for ARM, MIPS, RISC-V, Alpha, m68k, and SH-4). The easiest way to do this is to use the '''guestfish''' utility from '''libguestfs'''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --ro -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
copy-out /boot/vmlinux-X.XX.X-X-ARCH .&lt;br /&gt;
copy-out /boot/initrd.img-X.XX.X-X-ARCH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''~/.Xresources.''' This is required to make urxvt not look awful.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;quot;lumifoo&amp;quot; by gutterslob.&lt;br /&gt;
&lt;br /&gt;
! special&lt;br /&gt;
*.foreground:   #888a8c&lt;br /&gt;
*.background:   #1e2021&lt;br /&gt;
*.cursorColor:  #888a8c&lt;br /&gt;
&lt;br /&gt;
! black&lt;br /&gt;
*.color0:       #515151&lt;br /&gt;
*.color8:       #707172&lt;br /&gt;
&lt;br /&gt;
! red&lt;br /&gt;
*.color1:       #bf6382&lt;br /&gt;
*.color9:       #eaaec2&lt;br /&gt;
&lt;br /&gt;
! green&lt;br /&gt;
*.color2:       #65a446&lt;br /&gt;
*.color10:      #aed49b&lt;br /&gt;
&lt;br /&gt;
! yellow&lt;br /&gt;
*.color3:       #ad8a43&lt;br /&gt;
*.color11:      #d4c3a0&lt;br /&gt;
&lt;br /&gt;
! blue&lt;br /&gt;
*.color4:       #6b85c2&lt;br /&gt;
*.color12:      #afc4e9&lt;br /&gt;
&lt;br /&gt;
! magenta&lt;br /&gt;
*.color5:       #9e6bb8&lt;br /&gt;
*.color13:      #d2b1e2&lt;br /&gt;
&lt;br /&gt;
! cyan&lt;br /&gt;
*.color6:       #5c9d88&lt;br /&gt;
*.color14:      #a4d0c1&lt;br /&gt;
&lt;br /&gt;
! white&lt;br /&gt;
*.color7:       #919191&lt;br /&gt;
*.color15:      #d0d0d0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''/bin/l''' (chmod a+x).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la --color=always --group-directories-first &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Install packages (Debian assumed, will be different for other platforms):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt install git p7zip-full build-essential gdb zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev xorg i3 i3lock i3status suckless-tools rxvt-unicode xdm lynx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Some Debian i3 packages make xterm default instead of urxvt, so fix that:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo update-alternatives --config x-terminal-emulator&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up MegaZeux repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir /megazeux&lt;br /&gt;
sudo chown mzx:mzx /megazeux&lt;br /&gt;
cd /megazeux&lt;br /&gt;
git clone https://github.com/AliceLR/megazeux .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Build MegaZeux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]&lt;br /&gt;
time make [use -jX with -smp]&lt;br /&gt;
time make unittest [use -jX with -smp]&lt;br /&gt;
time testworlds/run.sh unix-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.sh''' script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If preparing a VM tarball, some steps should be taken to reduce the size of the image.&lt;br /&gt;
&lt;br /&gt;
From the guest OS, clear the apt package cache:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt clean&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using '''guestfish''' from the host OS, fill all unused space in the image with 0s. This will increase the size of the image to its maximum size. (This method seems to be faster than using the &amp;lt;code&amp;gt;dd if=/dev/zero&amp;lt;/code&amp;gt; trick some places cite or using &amp;lt;code&amp;gt;zerofree&amp;lt;/code&amp;gt; from a guest rescue disk.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guestfish --rw -a arch.debian10.qcow2 -i&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zero-free-space /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To shrink your working copy of the image, compact it using &amp;lt;code&amp;gt;qemu-img&amp;lt;/code&amp;gt; (and then test it):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv arch.debian10.qcow2 arch.debian10.old.qcow2&lt;br /&gt;
qemu-img convert -O qcow2 arch.debian10.old.qcow2 arch.debian10.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, generate a compressed image for the tarball:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img convert -c -O qcow2 arch.debian10.qcow2 arch.debian10.compressed.qcow2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, instead of using qcow2 compression, just xz it as part of the tarball. This will take longer but the compression is better. This can be sped up with parallel compression using the '''XZ_OPT''' environment variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir arch/&lt;br /&gt;
cp *.sh arch.debian10.qcow2 arch/&lt;br /&gt;
XZ_OPT=&amp;quot;-T0&amp;quot; tar -cJf vm-mzx-arch-debian-10.0.tar.xz arch/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PowerPC/PPC64 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
Setting up working Debian Unstable builds for PowerPC/PPC64 currently requires a little bit of extra work.&lt;br /&gt;
&lt;br /&gt;
:1. {{note|ppcsetup}}{{note|ppc64setup}} An old image supporting Yaboot is currently required because all Debian Unstable PPC/PPC64 installers based on grub-ieee1275 have major installation issues (as of 2021-05-09). Skip setting up an apt repository, then add this to &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 deb [trusted=yes] http://ftp.debian.org/debian-ports sid main&lt;br /&gt;
&lt;br /&gt;
Install the following packages afterward to get the installation roughly equivalent to a standard install.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install wget curl ftp gnupg debian-keyring debian-archive-keyring&lt;br /&gt;
&lt;br /&gt;
Remove the old kernel and some large dependencies pulled in by '''mailutils''' (not required for these VMs):&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove linux-image-4.16.0-1-*&lt;br /&gt;
 sudo apt remove mailutils --purge&lt;br /&gt;
 sudo apt autoremove --purge&lt;br /&gt;
&lt;br /&gt;
:2. {{note|ppc64partition}} The version of Yaboot in older Debian Unstable PPC64 installers does not support ext4 (even though the equivalent PowerPC installer Yaboot does). Use manual partitioning instead of guided partitioning to create an ext2 &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
&lt;br /&gt;
 #1 Apple&lt;br /&gt;
 #2 1.0 MB boot&lt;br /&gt;
 #3 256.0 MB ext2 /boot&lt;br /&gt;
 #4 (drive size - 2GB - 258MB) ext4 /&lt;br /&gt;
 #5 2.0 GB swap&lt;br /&gt;
&lt;br /&gt;
=== PA-RISC (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
:1. {{note|hppasetup}} The Debian Installer in newer installer images crashes prior to partitioning. Like PowerPC, an older image needs to be installed, followed by a dist-update and cleanup. Follow the PowerPC instructions above. Make sure you back up the installed image once you've verified that the installation worked. The upgrade process is slow and will involve trial and error.&lt;br /&gt;
&lt;br /&gt;
:2. Optional: upgrading systemd may cause the VM to get stuck in an endless boot loop while attempting to run systemd-timesyncd. It may be beneficial to place holds on the relevant systemd packages until after the initial update.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-mark hold libpam-systemd&lt;br /&gt;
 sudo apt-mark hold libsystemd0&lt;br /&gt;
 sudo apt-mark hold systemd&lt;br /&gt;
 sudo apt-mark hold systemd-sysv&lt;br /&gt;
 sudo apt-mark hold systemd-timesyncd&lt;br /&gt;
&lt;br /&gt;
:3. If the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt; fails because of '''libgcc-s4''', do the following, then repeat the &amp;lt;code&amp;gt;sudo apt dist-upgrade&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install -o Dpkg::Options::=&amp;quot;--force-overwrite&amp;quot; libgcc-s4&lt;br /&gt;
&lt;br /&gt;
:4. TODO: due to either Artist emulation bugs in QEMU or a lack of driver support in Linux, running this VM in graphical mode will result in the graphical terminal freezing at a certain point. The boot process will continue as usual and the VM can be used from the serial terminal in this situation. This Xorg config fragment can at least get X to successfully start, but the Artist window will still be frozen.&lt;br /&gt;
&lt;br /&gt;
 Section &amp;quot;Device&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Artist&amp;quot;&lt;br /&gt;
  Driver &amp;quot;fbdev&amp;quot;&lt;br /&gt;
  Option &amp;quot;ShadowFB&amp;quot; &amp;quot;off&amp;quot;&lt;br /&gt;
 EndSection&lt;br /&gt;
 &lt;br /&gt;
 Section &amp;quot;Screen&amp;quot;&lt;br /&gt;
  Identifier &amp;quot;Screen0&amp;quot;&lt;br /&gt;
  Device &amp;quot;Artist&amp;quot;&lt;br /&gt;
  DefaultDepth 8&lt;br /&gt;
  DefaultFbBpp 8&lt;br /&gt;
  SubSection &amp;quot;Display&amp;quot;&lt;br /&gt;
   Depth 8&lt;br /&gt;
   Modes &amp;quot;800x600_60.00&amp;quot;&lt;br /&gt;
  EndSubSection&lt;br /&gt;
 EndSection&lt;br /&gt;
&lt;br /&gt;
=== ARMel, RISC-V, and SH-4 (Debian Unstable) ===&lt;br /&gt;
&lt;br /&gt;
{{note|armelsetup}}{{note|riscv64setup}}{{note|sh4setup}} No Debian Installer image is available for this architecture and it must be set up manually. Overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install '''debootstrap''', '''qemu-user-static''', and '''debian-ports-archive-keyring'''. If you aren't using Debian as a host, '''debian-ports-archive-keyring''' is available [http://ftp.us.debian.org/debian/pool/main/d/debian-ports-archive-keyring/ here].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;qemu-img create -f qcow2 [arch here].debian10.qcow2 16G&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe nbd&lt;br /&gt;
qemu-nbd -c /dev/nbd0 [arch here].debian10.qcow2&lt;br /&gt;
parted -s -a optimal -- /dev/nbd0 mklabel msdos mkpart primary ext4 1MiB -2GiB mkpart primary linux-swap -2GiB -0&lt;br /&gt;
mkfs -t ext4 -L root /dev/nbd0p1&lt;br /&gt;
mkswap -L swap /dev/nbd0p2&lt;br /&gt;
mount /dev/nbd0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
# For ARMel:&lt;br /&gt;
debootstrap --arch armel --keyring=/usr/share/keyrings/debian-archive-keyring.gpg unstable /mnt http://ftp.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
# For RISC-V:&lt;br /&gt;
debootstrap --arch riscv64 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&lt;br /&gt;
# For SH-4:&lt;br /&gt;
debootstrap --arch sh4 --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt http://ftp.ports.debian.org/debian-ports&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Mount and chroot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp /usr/bin/qemu-[arch here]-static /mnt/bin&lt;br /&gt;
mount -o bind,ro /dev /mnt/dev&lt;br /&gt;
mount -t proc none /mnt/proc&lt;br /&gt;
mount -t sysfs none /mnt/sys&lt;br /&gt;
chroot /mnt&lt;br /&gt;
uname -a # Verify machine name is armv7l (ARMel), riscv64 (RISC-V), or sh4 (SH-4).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL=swap none swap sw 0 0&lt;br /&gt;
LABEL=root / ext4 defaults 0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is the device name used by Debian and is needed for QEMU system emulation.&lt;br /&gt;
allow-hotplug eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/enp1s0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This allows networking to work from a chroot from Fedora.&lt;br /&gt;
allow-hotplug enp1s0&lt;br /&gt;
iface enp1s0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create &amp;lt;code&amp;gt;/etc/network/interfaces.d/lo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This configures the loopback interface.&lt;br /&gt;
# This breaks booting in ARMel and can be omitted for that platform.&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install and configure some required packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install debian-ports-archive-keyring&lt;br /&gt;
apt install sudo man locales console-setup wget curl ftp gnupg&lt;br /&gt;
# These images generally use US/Mountain but the specific timezone isn't that important.&lt;br /&gt;
dpkg-reconfigure tzdata&lt;br /&gt;
# Only select en_US.UTF-8 here; others can be added later if needed.&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
systemctl enable serial-getty@ttyS0.service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''RISC-V only''': install a kernel (the ~860MB install size is normal).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-riscv64&lt;br /&gt;
&lt;br /&gt;
# Also, some extra things to do here (see Debian Wiki RISC-V page):&lt;br /&gt;
apt install u-boot-menu openntpd ntpdate&lt;br /&gt;
sed -i 's/^DAEMON_OPTS=&amp;quot;/DAEMON_OPTS=&amp;quot;-s /' /etc/default/openntpd&lt;br /&gt;
echo '&lt;br /&gt;
UBOOT_PARAMETERS=&amp;quot;rw noquiet root=/dev/vda&amp;quot;&lt;br /&gt;
U_BOOT_FDT_DIR=&amp;quot;noexist&amp;quot;' &amp;gt;&amp;gt; /etc/default/u-boot&lt;br /&gt;
u-boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''SH-4 only''': install a kernel.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt install linux-image-sh7751r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser mzx&lt;br /&gt;
usermod -a -G sudo mzx&lt;br /&gt;
passwd -l root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''ARMel only''': get a [https://github.com/dhruvvyas90/qemu-rpi-kernel Raspberry Pi Linux kernel (4.19.50) and versatile-pb-buster.dtb here].&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
'''RISC-V only''': get the latest copy of [https://packages.debian.org/opensbi OpenSBI] and [https://packages.debian.org/u-boot-qemu U-Boot for QEMU] from the Debian packages repository. Extract OpenSBI and the U-Boot riscv64_smode kernel; these are required to boot the virtual machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup (NetBSD) ==&lt;br /&gt;
&lt;br /&gt;
{{note|sparcsetup}}{{note|sparc64setup}} Setting up NetBSD is a little more involved than Debian. Note NetBSD also isn't aware of power management for some architectures and will use a full core while its VM is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up initial QEMU disk image.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 arch.netbsd.qcow2 20G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
For whatever reason, the QEMU -kernel option doesn't seem to work with any BSD kernels, so right now any QEMU that requires -kernel should use a Linux instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Run installer. Leave root password blank, create user '''mzx''' with password '''mzx''' and sudo access (if it doesn't give you the option, set the root password). Install all packages, including the X window system. Enable xdm and nptdate. If network autodetection doesn't work here (SPARC 32-bit), pkgin and pkgsrc will need to be set up manually after reboot. Otherwise, install both.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Set up '''run.serial.sh''' script and run.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set up '''/bin/l''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LC_COLLATE=&amp;quot;C&amp;quot; \&lt;br /&gt;
ls -la &amp;quot;$@&amp;quot;' &amp;gt; /bin/l&lt;br /&gt;
chmod a+x /bin/l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, set a hostname, disable IPv6, enable DHCP (if it isn't already), and reboot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set a hostname for this architecture e.g. SPARC, SPARC64, ARMv6.&lt;br /&gt;
echo &amp;quot;SPARC&amp;quot; &amp;gt; /etc/myname&lt;br /&gt;
&lt;br /&gt;
# Disable IPv6 for DHCP.&lt;br /&gt;
# This prevents issues where all downloads can hang for a long time before&lt;br /&gt;
# the download starts (due to attempting IPv6 first and it timing out).&lt;br /&gt;
cp /etc/dhcpcd.conf ~/&lt;br /&gt;
echo '&lt;br /&gt;
# Disable IPv6 Support.&lt;br /&gt;
noipv6rs&lt;br /&gt;
noipv6' &amp;gt;&amp;gt; /etc/dhcpcd.conf&lt;br /&gt;
&lt;br /&gt;
# If it wasn't enabled during install, you can enable DHCP like this.&lt;br /&gt;
cp /etc/rc.conf ~/&lt;br /&gt;
echo &amp;quot;dhcpcd=yes&amp;quot; &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
# Reboot for these changes to take effect.&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgsrc'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftp http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz&lt;br /&gt;
tar -xzf pkgsrc.tar.gz -O /usr&lt;br /&gt;
chown root:wheel -R /usr/pkgsrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If network wasn't available during installation, manually install '''pkgin'''. As root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Replace ARCH and VERSION for the applicable architecture (e.g. sparc) and version (e.g. 9.2).&lt;br /&gt;
pkg_add http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/ARCH/VERSION/All/pkgin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
As root, install packages with '''pkgin''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin install sudo bash gmake git nano p7zip&lt;br /&gt;
pkgin install zlib png libogg libvorbis SDL SDL2&lt;br /&gt;
pkgin install lynx openssl ca-certificates&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If precompiled packages aren't available for this architecture, use '''pkgsrc''' to build and install these packages instead. WARNING: this will take a while.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
When configuring MegaZeux, make sure to use '''/usr/pkg''' as the prefix and to use '''gmake''' to invoke Makefile targets.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Preparing the image is a little different from Debian, mainly since the Linux kernel does not have write support for NetBSD's filesystem by default. As root, clear the pkgin cache and zero free space.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pkgin clear&lt;br /&gt;
cat /dev/zero &amp;gt;delet_this&lt;br /&gt;
sync&lt;br /&gt;
rm delet_this&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If pkgsrc was used, make sure there are no work directories leftover in the pkgsrc tree (TODO).&lt;br /&gt;
&lt;br /&gt;
The image is now ready to be shrunk with qemu-img.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
:1. [https://www.netbsd.org/docs/network/ NetBSD networking FAQ] [https://web.archive.org/web/20210425154205/https://www.netbsd.org/docs/network/ (archived)].&lt;br /&gt;
:2. [https://www.netbsd.org/docs/pkgsrc/getting.html NetBSD pkgsrc guide] [https://web.archive.org/web/20210506032728/https://www.netbsd.org/docs/pkgsrc/getting.html (archived)].&lt;/div&gt;</summary>
		<author><name>Lachesis</name></author>
	</entry>
</feed>