ViTi95 wrote on 2023-10-17, 07:25:
BitWrangler wrote on 2023-10-13, 03:48:
I was watching that IBM EGA FantasyLand demo on PCJS, and that seems really fast in text mode and redefining fonts on the fly, dunno how many font primitives you'd have to design though to get something seeming to be a decent resolution.
I've been thinking in this idea, and it's possible to create a very fast text mode for EGA cards with modified fonts, that has more resolution but with color clash. There are 256 characters available, so it's possible to generate a font with all permutations of 4x2 pixels with 2 colors (foreground + background). For example the 80x100 text mode (2 scanlines per character), becomes virtually 320x200 but with only two colors per group of 8 pixels. I really like the idea as is very similar to ZX Spectrum video. The main issue here is the real time conversion from a group of 8 pixels to a single character + foreground/background color. A lookup table is just too big in this case (4Gb), so real time conversion is needed. Maybe someone here has an idea of a fast way to process these blocks in real time.
I have vaguely got an idea of something. For purposes of example, assume a 5x9 character bitmap. Instead of storing 40 unique character bitmaps, one could store a master bitmap that reading it in 5x9 chunks with offsets would make 40 unique bitmaps. Imagine a single pixel set, 1, in a 9x17 bitmap, the middle pixel. Then reading the top left 5x9 gives a character bitmap with bottom right pixel lit, or reading top right it's the bottom left pixel in the char, or any frame of 5x9 in the 9x17 gives you single pixel. I think this halves the space, since sets of 40 characters can be stored as 9x17s where all the characters are overlaid at positions in it. They need not be 9x17 either, could be larger with multiple patterns. Also, if you could read half the character at one position and the bottom half at another position, using the first example bitmap you could have many more unique characters with one pixel lit in each half. Then some sort of binary tree and procedural generation, might give a way to fold that a few more times into itself and yay, we only need a 286 with 256Mb of RAM to run it 🤣 IDK that might be the right direction and get further optimised, it might not.
Edit: oh yah, some of the old ZX spectrum tricks might not apply since I think some of the situations where it seemed like there were 80k of custom bitmaps in a 48kb game when 30k was the game logic is because they were doing crap like treating machine code in ROM and from other parts of the program as arrays and using bits of it that were the right shape/pattern.
EditII: also remember they would leverage the fastest instructions like ADD and if two locations run through the instruction made the pattern they wanted, used that.
Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.