i'm making a #QBasic game using mode 13h, 320x200 8bpp. i'm using the line doubling feature of the VGA card to make it 320x100 then manually doubling each pixel horizontally for 160x100

i realized i could use a palette with 3 bits red/green and 2 blue, and then do "subpixel" dither to generate the in between colors. i made a converter to test if that would look good, and it does

here's a thread of images showing what that looks like

1/5

#PixelArt #QBasic #dos #RetroComputing #RetroDev

every image has a CRTized version made using https://mattiasgustavsson.itch.io/crtview by @Mattias_G and the crispy pixel original

my converter has a bias factor between 0 and 1, that biases towards non-dithered colors. it's kind of a push and pull between less busy dithering and more detail

2/5

little known fact: qbasic can produce mind boggling effects

i'm making this engine in qbasic for DOS as a challenge, using qb1.1, the interpreted one, without resorting to assembly language hacks. hence the low resolution (fewer tiles/pixels = better performance)

3/5

right now my qbasic engine can run locked to 70, 60, 35, 30, or 18.2 frames per second. @discatte tested it and it runs at 35 fps on a 486sx-20mhz

i intend for it to have OPL music and sounds, with a PC speaker sfx and no music fallback for the 18.2 fps mode

4/5

the images here are all wallpapers (except for the FF7 one) that i grabbed off reddit for testing many years ago. they were all unsourced

5/5

and just to be clear: all of these images use *the same* single 8 bit, 256 color palette. the colors aren't adapted to fit the image. it's a one size fits all approach

@eniko

This is magically nostalgic for me. I had many friends in high school who were really pushing what could be done with VGA graphics with the tools we had available at the time (when we were supposed to be doing arrays or something in Turbo Pascal)

@venya i never managed to get very far with qbasic game development back in the day. lack of resources in the backwater part of the netherlands

so this is kind of like a revenge tour where i bend qbasic to my will after having been a professional gamedev for 10+ years >_>

@eniko

As with music, I think a lot of the beauty and art of gamedev comes from working within your limitations. I'm a mediocre (at best) guitar player--how can I make pretty music with guitar? Well, get better. But also make music within my skill set. Some of my favorite games from the last few years (e.g. Moonring, Caves of Qud, Wildermyth) are not AAA powerhouses, but they're fantastic games using the tech and development models they chose. (And they run on a potato.)

@eniko @venya This is amazing! I have some (not really period-correct but qbasic-capable) hardware I want to try this out on. Though (sadly?) no CRT.

Is this coming out in boot floppy form?

@Forbearance @venya i dunno about boot floppy, but i would like to get it running on period hardware. i mean, it's mostly going to be qbasic + content files so it should probably work pretty well on any machine with dos!
@eniko @Forbearance @venya Having done a little QBasic as a kid I am deeply curious how this engine works. I'll probably never go back to dev on DOS PC but still learning what's possible...
@mirth @Forbearance @venya i'll publish the source code if i get far enough with it

@eniko @venya One thing I hate about QBasic is the "medium" memory model: together with the way strings work, it fills up available memory space like crazy.

I'm learning to use the VGA as well and I didn't know you could force it to double the scanlines. I knew that 320x200 is actually 320x400 with double scalines so is the screen actually copying the same scanline 4 times? If so: wow!

Nice project!

@Blackthorn @venya don't quote me on this one but i believe the "320x200 is actually 320x400" is just a quirk of how the VGA card interfaces with the monitor

meanwhile 320x100 is just the result of a bit you can set in one of the VGA's control registers that tells it "actually just double every logical line"

@eniko This looks fantastic! 🤩 And the "dithering" really supports the foggy, misty sceneries!
@eniko this is so cool! Tks for sharing.
@eniko This is the most exciting part IMO. Blending effects that are just one or two bitwise operations away.
@eniko Can you add some Roland MIDI music support as well? I still have a fully functional Roland CM32L (fully backwards compatible successor to the MT32, but without any display or controls, just a grey box).
@LordCaramac i don't know if i can to be honest. i don't know how you interface with a midi device in DOS, let alone from qbasic
@eniko I just wonder if it is possible. I was so happy back in the early 1990s that most of the DOS games I played supported Roland MT32 music, it was absolutely awesome. It's basically the same synth engine as in the D50, which was Enya's favourite synth back then, but it's multitimbral, made to play up to eight different synth patches plus a drum track simultaneously instead of just one performance patch consisting of two synth patches. I got into MIDI sequencers back then and learned to play the keyboards so I could make music with my PC.
The OPL chips Yamaha sold to sound card makers were simply cheap toy versions of the chips they put in the DX7, but the sound chips Roland used were the same as in the D50, and you can hear it.
@eniko this is so frigging cool?? I love this!
@eniko It's amazing how different some smoothing from a CRT filter can change the entire vibe.
@eniko Oh wow, so you're like some kind of masochist. I remember QB ... I was alive then. Not only that, but I used QB, both the original and the one that came with DOS.
@LanceJZ i just think it's neat
@eniko ah, well, since I grew up with that I think it more as PTSD.
@eniko That torii gate looks like peak PS1 horror.
@eniko At some point, art just starts to look like magic
@eniko QBasic like... the original (interpreted) QBasic, or the compiled QuickBasic one? (At this point I guess it's no new infothat QuickBasic exists, but it doesn't hurt to mention it).

BTW, awesome screenshots
​ The game could have even been a text adventure (with the screenshots as illustrations) and would still look awesome. Although knowing you, I'm sure it's something much better than a text adventure. A point and click one, maybe, or even an action game.

@cinnamon the original interpreted one >_> and i'm banning myself from using assembly using CALL ABSOLUTE

so i have to work purely with the tools qbasic gives me

@eniko I'm trying to imagine what you might achieve as a demoscener and... I'm sure it would be amazing ​:blobcatlowpoly3d:​
@cinnamon tbh trying to get a full-speed proper game out of qbasic is kinda demoscening XD
@eniko Repeating myself for the 99th time, but this stuff marked me so deeply back in the day that I can't avoid mentioning it one time after another:

Have you ever seen the
PC Game Programming Encyclopedia? ​

(Beware, 90's social vibes, "he/him/his" assumed by default about the reader and all that stuff that fortunately now tends to belong to the past. If some text shows garbled, force a CP-850 codepage. The original PCGPE .exe was a TurboPascal TurboVision app in text mode serving as a menu, from which each document could be opened)

pcgpe.exe can be found
here. I make no assumptions about it not having viruses or being a harmful executable!!
@cinnamon oh that's neat, thanks for linking it
@eniko I love that all the images end up looking great both as thumbnails *and* fullscreen in either raw pixel or CRT filtered format. It's a nice reminder that you don't need absurdly high resolutions or incredibly tiny pixels to get visually stunning results.
@eniko *Adds to wallpaper folder on laptop*
@eniko This looks very pretty. Excuse my ignorance but I‘ve just seen this post boosted into my timeline: What are you aiming at? Reducing the screen resolution to achieve fast refresh rates for a game? Or get better colors that were thought possible on qbasic/DOS?

@compfu i started by reducing the resolution to 160x100 to make it possible to make a game run at max refresh rate even on interpreted qbasic

then i started thinking about palettes, thinking 332 bit RGB would be real convenient instead of having to make multiple bespoke palettes

and then realized i could combine it with this "subpixel" dithering (since every pixel is actually 2 pixels wide) to get 1575 colors and not worry about bespoke palettes

so this was my test for how that actually looks

@eniko the crt version are iconic! ​
@eniko
Nice!
I didn't know VGA had a "doubling" feature. My only attempt at QBasic gsme at mode 13 relied in a TSR .com file to hold 64bytes of additional data and render the map on screen.
@microblogc @eniko there’s even a 160×100 “graphical” (really: text) mode that gives you 16 colours on even CGA, with some subpixeling possible…

@eniko This is all so gorgeous.

Also hell yes #QBasic.

@jamie hell yea qbasic!

@eniko awesome work!

I never managed to push Qbasic that far and switched to C in the end. Still remember trying to make things in Qbasic <mumble> years ago.

@eniko

Gorgeous, and I'm usually not a fan of CRT filters. Still not sure if I'd actually want to run it in game, but these are beautiful.

@eniko do they move? I'm thinking colour cycling for the water etc
@eniko How did I never know there was a way to do 100-line like that? As I recall 200-line was already doubled to scan out 400 lines to the CRT. Is it a second doubling or something?
@dalias I don't know. I just know that Allegro 4 had a 160x120 mode and I still the trick from there
@eniko
Good god this is absolutely gorgeous! 🤩

@eniko
This awesome.

Over 30 years ago was I fiddling with #QBasic with just EGA graphics on a 286 machine. 12 year old me wouldn't believe that was possible.