Comment by burnt-resistor

1 day ago

Neat. It'd be more "ASCII" if it used 8x16 pixel (but right extended to 9x16) characters in 80:133 width:height aspect ratio since 80x25 characters at 720x400 on 4:3 results in 80:133 pixels. An arbitrary sized canvas is cool so long as the aspect ratio is preserved.

The infamous MCGA/"VGA" mode 13h had pixels with an aspect ratio 6:5, while 320 x 240 Mode X was square (1:1).

I still remember the unchained offset calculation for the memory offset for pixel memory access before the era of U and V pipes and many optimizing compiler passes:

    unsigned short offset = (((y << 2) + y) << 6) + x;
    unsigned char far *ptr = (unsigned char far*)MK_FP(0xA000, offset);

    // IIRC: #define MK_FP(seg, off) ((void far *)((unsigned long)(seg) << 16 | (unsigned long)(off))) // far pointers != linear address

In real-mode (linear): 0xa0000 + (320 * y) + x

Infamous means famous but for a bad reason, basically notorious. I've noticed a lot of people making this mistake recently, as well as people using ignorant to mean stupid. But I digress...

Many of us have that mode 13h stuff memorised too, including the 0x3c8 and 0x3c9 palette registers etc. And since 320x200 bytes is less than 65536 you don't need to do any segment stuff to access the full frame buffer.