On Tue, 15 Jul 2003 20:22:16 +0100, Dilwyn Jones <[EMAIL PROTECTED]> wrote:



I've been playing a little with Marcel's 256 colour mode 16 on QPC2.


Not only does it work, most programs seem to run quite happily in it.
Including (I'm pleased to say) my Launchpad and Screen Snatcher
programs!

My old Graphics Viewer program does not because it guesses the screen
sizes from file sizes, and some screens in different modes and
resolutions may well end up by coincidence having the same file size.

I've been tinkering with some graphics routines as my recent message
regarding mode 32 to bmp conversion suggested. One of the routines I
came up with which has been useful for me is a mode 16 to mode 32
screen converter. It's rather slow, but the need doesn't really arise
that often, so it's OK.

Simply enter the filename of a 256 colour (mode 16) file, and the
filename to save the converted mode 32 file. I've put REMs in showing
the bit layouts, and converted basically by doubling up the bits which
is a bit of a dirty method but it seems to work reasonably well.

Obviously, as 16-bit graphics need twice the number of bits per pixel,
converted screens are twice the size of the original.

100 REMark convert mode 16 picture to mode 32
110 CLS : CLS #0
120 INPUT #0,'Filename of MODE 16 screen     > ';ip$
130 INPUT #0,'Filename of MODE 32 conversion > ';op$
140 fl = FLEN(\ip$)
150 IF fl <= 0 THEN STOP
160 base = ALCHP(3*fl) : REMark Mode 32 equivalent is twice as long
170 LBYTES ip$,base
180 addr16 = base
190 addr32 = base+fl
200 FOR a = base TO base+fl-1
210   byte = PEEK(a) : REMark pixel from mode 16 screen
220   REMark 128 64 32 16 8 4 2  1
230   REMark  g  r  b  g  r b g  x (x=rb)
240   :
250   REMark byte1                  byte 2
260   REMark 128 64 32 16 8 4 2 1   128 64 32 16 8 4 2 1
270   REMark  g  g  g  b  b b b b    r  r  r  r  r g g g
280   :
290   REMark do the BLUE bits
300   byte1 = 16*((byte&&32)>0)+12*((byte&&4)>0)+3*((byte&&1)>0)
310   REMark do the RED
320   byte2 = 128*((byte&&64)>0)+96*((byte&&8)>0)+24*((byte&&1)>0)
330   REMark do the GREEN bits
340   byte1 = byte1+128*((byte&&16)>0)+96*((byte&&2)>0)
350   byte2 = byte2+6*((byte&&128)>0)+((byte&&16)>0)
360   :
370   POKE addr32,byte1 : POKE addr32+1,byte2
380   addr32 = addr32+2
390 END FOR a
400 SBYTES op$,base+fl,2*fl
410 RECHP base : REMark release heap area used
420 PRINT #0,'Program finished'

Any suggestions on improving this welcome.

Oh, and I hope Marcel is happy someone's actually using the 256 colour
mode. If I'm right, this should work on Aurora 256 colour screens as
well since if I'm right Marcel wrote the QPC2 256 colour driver to be
compatible with Aurora 256 colour modes (once Aurora colour drivers
are out that is!)

--
Dilwyn Jones




Aurora drivers ARE out. I've been using them for quite awhile and I have them available for sale as well (with SMSQ/E v.3.00).
Q-Word btw supports mode 16 :-) (And it's pretty impressive too :-)


Phoebus
--
Phoebus Dokos - Undergrad in MIS
Eberly College of Business - Indiana U. of PA




Reply via email to