Continued from the previous message...
screen mode. But in screen mode 11-13 it changes the VGA DAC
registers. That is, the active palette remains the same, but the
red, green, and blue components of the colors are changed. That is
why you have to determine the Red, Green, and Blue values, and
combine them into one number. PowerBasic's PALETTE is consistent in
that it actually changes the palette in all screen modes, but it
leaves you without the ability to change the VGA DAC registers.
Here are a couple of routines from Mark Phillips to do that--
To convert a QB PALETTE statement in a VGA screen mode, determine
the color values as before, but forget about combining them. So,
PALETTE ClrAttribute%, Blue% * 65536 + Green% * 256 + Red%
would become:
CALL Set1DAC (ClrAttribute%, Red%, Green%, Blue%)
1) BIOS. BIOS service 10h, function 10h has several subfunctions
that write to and read from the DAC registers. For
example, to change a single DAC:
SUB Set1DAC (BYVAL DAC?, BYVAL Red?, BYVAL Green?, BYVAL Blue?) PUBLIC
! mov ax,&h1010
! mov bh,0
! mov bl,DAC?
! mov ch,Green?
! mov cl,Blue?
! mov dh,Red?
! int &h10
END SUB
2) Hardware direct. The DAC registers are I/O mapped at 3C6h-3C9h. To
set one DAC:
SUB HSet1DAC (BYVAL DAC?, BYVAL Red?, BYVAL Green?, BYVAL Blue?)
UBLIC
! mov dx,&h3C8
! mov al,DAC? ;point to register with DAC Write Index Register
! out dx,al
! mov dx,&h3C9 ;3 consecutive writes loads the 3 DAC registers
! mov al,Red?
! out dx,al
! mov al,Green?
! out dx,al
! mov al,Blue?
! out dx,al
END SUB
When using the direct method, you might need to wait for the vertical
blanking interval. Directly changing the DAC's may cause "snow" on
your VGA.
PCOPY--
PB does not have a PCOPY command. It is a reserved keyword, though,
so maybe Bob has plans for it. In the meantime, you will need to
write your own routine to do it.
PLAY--
QB's default is to play in the foreground. The PB documentation
implies that it defaults to background. This is another one that I
can't be sure of because I don't use it.
PRINT--
QB PRINT allows DOS redirection, PB does not. To be able to
redirect output, you will have to open the CONS: device and PRINT #
to it or use one of the sample DOS output routines included with
later versions of PB 3.x.
Greg Shultz reported that when printing an 80 character string, he
had to add a semicolon, because "Apparently, PB implicitly adds a
when it completes printing of character number 80, whereas QBX
doesn't advance the "page" until the command is executed on the next
pass."
PUT (graphics)--
I don't use it, I'm just repeating something I read here.
Apparently PB's PUT will not accept an element of an array. Jamshid
Khoshrangi suggested passing passing the element of the array to a
Continued in the next message...
--- FidoPCB v1.4 [ff013/c]
---------------
* Origin: Sound Advice - 24 Nodes (816)436-4516 (1:280/333)
|