delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/10/02:46:33

From: frenchc AT cadvision DOT com (Calvin French)
Newsgroups: comp.os.msdos.djgpp
Subject: Allegro: Fakemode feasable?
Date: 10 May 1997 05:00:11 GMT
Organization: Reham Salad
Lines: 60
Message-ID: <5l0vcr$2jje@elmo.cadvision.com>
NNTP-Posting-Host: ts13ip195.cadvision.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hey! I'm building a 3D lib based on the allegro 3D stuph, and my plan 
is to design everything for 32-bit graphics and then scale down at 
runtime (as neccesary) all the way to VGA Mode-X. Colorscaling is done 
when the double buffer is finally blitted to the screen, so with 
Allegro it's fairly simple to implement this trick.

Now, I know basically how to build ye olde' 256-color colorcube, ala 
everybody else. But having played now played N64, i've decided that 
this sucks. Remembering a program/source I once snagged off x2 
(x2ftp.oulu.fi) called FAKEMODE, I decided at the very least I can do 
at the least 4K colours, given a bit more thought, possibly even 
16-bit, although at the cost of speed. What I would like to know is, 
how *much* speed? Here is the plan for each mode.

4K mode: Basically we use vga modex 320x400 (480???) with 2 hardware 
pages and flip them every vtrace. Each pixel requires 4 bytes to write, 
2 each for green and red+blue. Pick up fakemode if you don't know how 
this works; this is very convincing. My screen literally *glows*... The 
only speed loss comes at transfering the bitmap to vram, since all the 
internals are full 32-bit colour.

16K mode: Basically this is the same as 4K mode with one difference. We 
have to use 2 palettes and set them every vtrace. Is this possible? I 
have no idea how expensive palette setting is, I imagine it's fairly 
expensive, but I really have no idea. Also this mode may not be 
possible because of flicker; we can't stagger pixels like we could in 
4K mode, but actually we only have to copy 2 bytes per pixel and use 
mode 320x200, so I suppose this is really a lot different from 4K mode. 
If the flicker was tolerable, this would probably be feasable (if the 
palette can be set) 4K mode could also, alternatively be done quickly 
if we used 320x200 and didn't use pixel-staggering, but again the 
flicker could be bad.

18bit mode: This came to me a minute ago but again we are likely to 
have real flicker probs. We use 3 pages instead of 2, in vga modex 
320x200 (or 240) and set 3 pixels on each from our constant-palette of 
64 red, green and blue colours.

24bit mode: Okay, this is the super-mode. We use two pages at 640x400, 
stagger pixels, have a constant palette, and each pixel requires 4 
bytes to set, but the flicker is bad (unlike 4K mode, which like I said 
before, looks positively amazing)

Okay, kapeesh, yes, no, eh? Or is this another one of those "sure 
buddy, sure, sure, then you can do the win95 emu"-feasabilty-rated 
ideas? In case you're wondering, I know that truecolour cards aren't 
that expensive, even 3D truecolour cards are only like 160$, so maybe 
that really is my bestest solution. Don't worry about coding 
complexities, let me decide if it's worth it to code for. I'm only 
looking for feedback on which of the above is feasable. Now that i 
think of it, 16K mode isn't a great idea since we have to set the 
palettes *and* we get horrible flicker, which in the end can't be 
better than 24bit mode. In case you're wondering where I get 24bits 
from plain ole' VGA which is unabashedly 6bit colour resolution, I use 
64 shades of grey.

So, heh, anyways, I'm insane.

- Calvin -

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019