Giter VIP home page Giter VIP logo

Comments (17)

joncampbell123 avatar joncampbell123 commented on September 25, 2024 3

How's this?

mzxrun_000

from dosbox-x.

AliceLR avatar AliceLR commented on September 25, 2024 1

To more accurately explain what is supposed to be going on in VGA terms: for '90s Nvidia, ATi, and possibly some Cirrus Logic and C&T graphics adapters, enabling the mode 13h pixel doubling bit of the VGA mode control register while in 640x350 text mode would result in a 256-color 320x350 text mode with 4 colors per character. The 4 colors are indexed using the background and foreground colors as the high and low nibbles of the palette index.

For reference, here is how modern MZX enables this hack: https://github.com/AliceLR/megazeux/blob/88a20a39ac50e70eabd4925a6a1433ae0be0e127/arch/djgpp/render_ega.c#L98

static void ega_set_smzx(boolean is_ati)
{
  // Super MegaZeux mode:
  // In a nutshell, this sets bit 6 of the VGA Mode Control Register.
  // Bit 6 controls the pixel width - if 1, the pixel width is doubled,
  // creating one 8-bit pixel instead of two 4-bit pixels. HOWEVER,
  // normally, this is only done in Mode 13h.
  //
  // nVidia and some Cirrus Logic cards support this; ATI cards
  // also "support" it, but swap the order of joining the pixels
  // and require a weird horizontal pixel shift value - see below.
  outportb(0x3C0, 0x10);
  outportb(0x3C0, 0x4C);

  if(is_ati)
  {
    // set horizontal pixel shift to Undefined (0.5 pixels, in theory)
    outportb(0x3C0, 0x13);
    outportb(0x3C0, 0x01);
  }
}

I don't have any test programs for this ready since I wasn't prepared to request this yet, but in the old DOS versions of MegaZeux you could load the file PAL_ED.MZX, press "P" to open the palette editor, and press "X" to display the entire 256 color palette. It should show something that looks like this:

image

Instead, what DOSBox and DOSBox-X display is this:

image

from dosbox-x.

dxgldotorg avatar dxgldotorg commented on September 25, 2024

I just tested on an old GeForce 6200 AGP card, and that card does SMZX mode correctly. Tested on 2.93 DJGPP build.

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

Ew... very clever! Someone figured out how 256-color mode works and hacked text mode to fit within it! 👍

VGA 256-color mode is really just 4 bits shifted into an 8-bit register per dot clock, but that would make a strange unhelpful 640x200 256-color mode, so there is a bit to latch every other pixel so that you only see the completed 8-bit value and not the intermediate ones. This is also why it is impossible to do a 640x200 256-color tweakmode on standard VGA hardware.

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

I have an old Pentium laptop with a Cirrus chipset (and 4KB bank switching to prove to naive DOS games jam developers that not all VESA BIOSes bank switch on multiples of 64KB even if the window itself is 64KB 😆), maybe this trick works there too.

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

I can confirm:

A 486 laptop with a Paradise/Western Digital SVGA chipset doesn't work this way. You can set the bit and halve the resolution of text mode, but it doesn't allow this hack to work.

A Pentium laptop (Toshiba Satellite Pro) with a Chips & Tech chipset does appear to work in a way that allows this hack to work. Setting that bit halves the resolution and makes the text multicolored that suggest 256-color 4-bit shifting behavior.

from dosbox-x.

AliceLR avatar AliceLR commented on September 25, 2024

Do you have specifics on these laptop models/graphics? I've been trying to keep a list of every known model that's been tested so far so we have more data.

A 486 laptop with a Paradise/Western Digital SVGA chipset doesn't work this way. You can set the bit and halve the resolution of text mode, but it doesn't allow this hack to work.

This sounds a lot like what happens with my ThinkPad 560X's NeoMagic chipset. The left pixel always gets doubled and tweaking the horizontal pixel shift register doesn't help.

Is the Satellite Pro a 400 CDS or comparable, by any chance? I had an unknown model Satellite Pro circa 2004 most likely with a C&T chipset that supported this hack. I remember it having used the same pixel ordering as the Nvidia cards (the left pixel of each pair contributes the low nibble of the color, IIRC).

The ATi cards that support this—in addition to needing that horizontal shift setting—apparently also have the nibbles in the opposite order.

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

Do you have specifics on these laptop models/graphics? I've been trying to keep a list of every known model that's been tested so far so we have more data.

A 486 laptop with a Paradise/Western Digital SVGA chipset doesn't work this way. You can set the bit and halve the resolution of text mode, but it doesn't allow this hack to work.

This sounds a lot like what happens with my ThinkPad 560X's NeoMagic chipset. The left pixel always gets doubled and tweaking the horizontal pixel shift register doesn't help.

Is the Satellite Pro a 400 CDS or comparable, by any chance? I had an unknown model Satellite Pro circa 2004 most likely with a C&T chipset that supported this hack. I remember it having used the same pixel ordering as the Nvidia cards (the left pixel of each pair contributes the low nibble of the color, IIRC).

The ATi cards that support this—in addition to needing that horizontal shift setting—apparently also have the nibbles in the opposite order.

The Pentium laptop in question is a Toshiba Satellite Pro 465CDX (1997 era DOS/Windows 95 era laptop). It was a great laptop for it's time for both DOS gaming and Windows 95 OSR2 gaming. It came out right when Intel Pentium CPUs with MMX were appearing in laptops which was fun to play with from assembly language. Most Toshiba laptops of the time period including the Libretto use C&T chipsets.

The 486 laptop is a Compaq LTE Elite 450CX with a Paradise/Western Digital SVGA chipset. Seems to be about 1994-era. When I put a CF card in it I had to pick one 512MB or smaller for the BIOS to work with it.

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

If your Toshiba laptop was made 2000-ish or later it may have an Intel chipset instead of Chips & Tech because Intel acquired C&T around that time. https://en.wikipedia.org/wiki/Chips_and_Technologies

I have a Toshiba laptop I bought sometime around 2004 with an Intel graphics chipset (the 855GM) which runs perfectly fine with Linux and Windows XP.

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

One thing that DOSBox-X has already implemented regarding this bit was the discovery some time ago that if you set up 320x200 256-color mode on VGA, and then switch OFF this bit, you get a strange 640x200 256-color mode because you get to see the intermediate "pixels" that result when the 8-bit value is halfway shifted out to shift the next pixel in. I suppose if you arrange the color palette just right you might exploit this odd tweakmode for high res 256-color graphics on standard VGA, but obviously not for gaming. While it seems to work on most chipsets I noticed Tseng ET4000 cards react in that case by just making it a 640x200 256-color mode with the 320x200 screen squeezed on the left side and the right side is just edge pixels repeated, but then again ET4000 cards have their own weird edge cases with standard VGA compatibility.

from dosbox-x.

AliceLR avatar AliceLR commented on September 25, 2024

How's this?

Looks great!

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

Awesome. It's done.

from dosbox-x.

AliceLR avatar AliceLR commented on September 25, 2024

Not sure if hardware testing follow-up belongs in this issue, but so far I've received feedback from a MegaZeux user with a Compaq 4704 motherboard (onboard S3 Trio64V) that suggests this chip performs the same left pixel doubling as the NeoMagic MagicGraph128XD.

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

Not sure if hardware testing follow-up belongs in this issue, but so far I've received feedback from a MegaZeux user with a Compaq 4704 motherboard (onboard S3 Trio64V) that suggests this chip performs the same left pixel doubling as the NeoMagic MagicGraph128XD.

So it does the same thing my 486 laptop with the Paradise/WD chipset does, and it only doubles pixels, instead of combining them into 8 bit pixels?

from dosbox-x.

AliceLR avatar AliceLR commented on September 25, 2024

So it does the same thing my 486 laptop with the Paradise/WD chipset does, and it only doubles pixels, instead of combining them into 8 bit pixels?

Yes, I think so. Here's a sample from PAL_ED.MZX that demonstrates the doubled pixels and 4-bit indexing:
image

edit: for good measure, here's the NeoMagic MagicGraph128XD showing the same behavior:
NeoMagic_MagicGraph128XD_PAL_ED

from dosbox-x.

joncampbell123 avatar joncampbell123 commented on September 25, 2024

Yeah, that's pixel doubling. If it's just doubled pixels and there's no colors between the colors, that's what it's doing.

from dosbox-x.

dxgldotorg avatar dxgldotorg commented on September 25, 2024

How's this?

Looks great!

Exactly like my ultra-janky MZX port I made back in the day (though I used automatic interpolation outside of the MZX runtime for SMZX Mode 1 until Mode 2 came out).

from dosbox-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.