Login
You're viewing the f.duriansoftware.com public feed.
  • Oct 9, 2026, 6:03 AM

    Well this is definitely... something. Palette's all screwed up on the sprite. Not sure what's going on there. But the lines look nice.

    A couple of weirdly colored trees are pasted in the corner while magenta lines fly at the camera in some sort of perspective nonsense.
    💬 1🔄 0⭐ 1

Replies

  • Oct 12, 2026, 6:34 AM

    Figured out the palette. Turns out setting palette entries works better _after_ you switch video modes. 😑 Porting the scaler has also gone well, minus one issue with signed indexes. But this pretty much only works because I've cranked the emulation speed up on DOSBox so it can draw everything in vblank.

    I have realized to my horror that VGA doesn't do a 320x200x256 linear framebuffer graphics mode where you can flip pages. Mode 13h utilizes all four planes in "chain mode", so the one page of linear framebuffer is all you get. If you want page flipping, you have to modify this to a sort of interleaved planar mode where every fourth column of pixels lives in a plane. And to switch which plane you're writing to you have to twiddle some VGA registers, which are themselves abstracted behind address/data I/O port pairs. I knew the PC platform was a pile of bad hacks but I am still somewhat aghast that people put up with this. The good news is, this gives you some interesting data pathway tricks you can use to perform faster fills and copies. Which will probably be quite useful, actually.

    So now I get to completely rewrite this...

    A VGA graphics display with the zooming perspective lines and a few scaled palm trees with correct colors this time.
    💬 1🔄 6⭐ 9
  • Oct 12, 2026, 9:47 PM

    Writing pixels like it's linear to planar video memory is kind of a neat vibe. Very "LED sign board".

    You can see my work on the left for drawing horizontal lines. The setup in planar mode is kind of insane - every byte write to video memory now writes to all planes, controlled by a mask register. So you can, with a single byte write, fill in four pixels. That's very neat! But if you're doing something _other_ than four aligned pixels, you need to calculate the mask value, which is less fun.

    A graphics screen with a pixelated palm tree that's got blank space between the pixels, making it look kind of like a Lite-Brite.
    💬 0🔄 1⭐ 5
  • Oct 13, 2026, 5:38 AM

    Unchained planar VGA scaler LET'S FUCKIN GOOOOO!

    So to demonstrate concretely how weird this mode is, I've slowed down the draw routine so you can see exactly how this gets drawn. Each set of columns is one plane, and it draws each plane sequentially. This was actually not a terribly hard modification to the existing routine since it's working on two independent iterations anyway. I just had to think about it as skipping across the source image by four pixels instead of by one and adding the plane offset to the start.

    This is using fixed-point arithmetic but it's not super optimized yet. Optimizing this will be... challenging.

    An animation of a scaled palm tree being drawn on a black background. The pixels are drawn top to bottom in sets of columns, filling in each of four repeated columns one after the next.
    💬 0🔄 0⭐ 3
  • Oct 13, 2026, 5:58 AM

    Wrote some rudimentary benchmarking. This is on a 486 AT board with an 83MHz Pentium Overdrive and a Diamond SpeedStar PRO VLB. It’s kind of my target device and I want a lot more scaled sprites on screen as well as some polygons, so I’ve got work to do.

    Log output displayed on a CRT:

Benched 1000 iterations of clearscreen in 2.25 seconds (2.25 ms/iter)
Benched 1000 iterations of hline in 1.54 seconds (1.54 ms/iter)
Benched 500 iterations of sprites in 2.03 seconds (4.06 ms/iter)
Benched 100 iterations of scaler in 1.32 seconds (13.18 ms/iter)
    💬 1🔄 1⭐ 3
  • Oct 13, 2026, 6:04 AM

    It's kind of interesting to compare this against DOSBox at "Pentium 66MHz" speed. "clearscreen" running so fast seems to suggest DOSBox doesn't have any penalty for video memory writes.

    More benchmark output:

Benched 1000 iterations of clearscreen in 0.17 seconds (0.17 ms/iter)
Benched 1000 iterations of hline in 2.31 seconds (2.31 ms/iter)
Benched 500 iterations of sprites in 2.91 seconds (5.82 ms/iter)
Benched 100 iterations of scaler in 1.76 seconds (17.58 ms/iter)
    💬 0🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Oct 13, 2026, 4:31 PM

    @discatte Oh, thanks! I think I’m a ways away from needing further testing but I’ll let you know.

    💬 0🔄 0⭐ 0