1. Palette idea

I've noticed some of you use the get_all_palette(), all_palette() and
palette() commands. You shouldn't do that. Instead you should get the
include file PORTS.E from the archive on the Euphoria homepage.
With it you can use the hardware ports for palette operations. something
like this:

--set a color
Output(color_number,#3C8) --set color "color_number" to..
Output(red_value,#3C9) --red (0-63)
Output(green_value,#3C9) --green (0-63)
Output(blue_value,#3C9) --blue (0-63)

--get a color
Output(color_number,#3C7) --get color "color_number"
red_value=Input(#3C9)
green_value=Input(#3C9)
blue_value=Input(#3C9)

a set_palette routine could look like this:

procedure set_pal(sequence the_pal)
for i=1 to 256 do
Output(i-1,#3C8) --set color i-1 (0-255) to..
Output(the_pal[i][1],#3C9)
Output(the_pal[i][2],#3C9)
Output(the_pal[i][3],#3C9)
end for
end procedure

Hope you understood that...
Now I got a question too. How do one get rid of the ugly border in mode
19?
The border seem to be of color 16, so if you set color 16 to black it
will be "gone". But I want to know if there's any better way to remove
it.


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » topic index » view message » categorize

2. Re: Palette idea

> Now I got a question too. How do one get rid of the ugly border in mode
> 19?
> The border seem to be of color 16, so if you set color 16 to black it
> will be "gone". But I want to know if there's any better way to remove
> it.

I found two ways to do this:

> Try this:
>
>
>
>
>
>
> include machine.e
>
>
>
> procedure border_color(integer color)
>     -- set border & background color
>     sequence regs
>     regs=repeat(0,10)
>     regs[REG_AX]=#0B00
>     regs[REG_BX]=color
>     regs=dos_interrupt(#10,regs)
> end procedure
>
>
>
>
>
>
>
>
>
> Graeme.

or

> You can reprogram the vga card overscan (the border) color by doing the
> following:
> 1. read a byte from the input status register 1 (port #3DA)
>   you don't have to do anything with this value; it just resets some flags
>    in the vga hardware so we can do the next step.
> 2. send the byte #31 to the attribute register (port #3C0)
> 3. send the border color you want to the attribute register (port #3C0)
>
>
>
> You will need Jacques Deschenes ports.e to read and write ports.
> or you could do it with the following machine code:
>    {#60,                    --    0: pusha
>     #66,#BA,#DA,#03,        --    1: mov dx, #3DA
>     #EC,                    --    5: in al, dx
>     #B2,#C0,                --    6: mov dl, #C0
>     #B0,#31,                --    8: mov al, #31
>     #EE,                    --    A: out dx, al
>     #B0,#00,                --    B: mov al, yourcolor (12)
>     #EE,                    --    D: out dx, al
>     #61,                    --    E: popa
>     #C3}                    --    F: ret
>
>
>


--
                  _____         _____        _____
   ________      /\    \       /\    \      /\    \
  /   \    \    /  \____\     /  \____\    /  \____\
 /  _  \____\  /   / ___/_   /   /____/   /   / ___/_
/  / \  |____|/   / /\____\ /    \    \  /   / /\____\
\  \_/ /    / \   \/ / ___/_\     \    \ \   \/ / ___/_
 \    /____/   \    / /\    \\/\   \    \ \    / /\    \
  \   \    \    \   \/  \____\  \   \    \ \   \/  \____\
   \   \    \    \      /    /   \   \____\ \      /    /
    \   \____\    \    /    /     \  /    /  \    /    /
     \  /    /     \  /    /       \/____/    \  /    /
      \/____/       \/____/xseal at harborside.com\/____/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu