Re: Bitmap palette

From: Herman Dullink (hd5_at_hetnet.nl)
Date: 05/16/04


Date: Sun, 16 May 2004 09:03:31 +0000 (UTC)


> > For the standard MCGA/VGA mode #13 (320x200x256) you can:
> > out 3C8,<index of first palette entry>
> > for each palette entry
> > out 3C9,<red value>
> > out 3C9,<green value>
> > out 3C9,<blue value>
> While this version is safer, one must be aware that "in" and "out"
> instructions are serialized on the P4, i.e. each requires around 20
> clock cycles to execute, with no opportunity to schedule parallel
> instructions.
That's OK, as it takes a few instructions to get the proper <red value>,
<green value> and <blue value>.
These 'out' instructions have to be used at some point, either by the
BIOS routine, or your own code.

If prefer data to be in the original form as long as possible. Therefor
I prefer a routine which uses the bitmap's aRGB structure above a
conversion and another routine.
It usually saves time and resources.

H



Relevant Pages

  • Re: Enhanced //e with a 6503??!
    ... Do you see a chance of posting this routine? ... an Rockwell R65C02 with the extended instructions? ... extra bit manipulation instructions which Rockwell introduced. ... BBRn zp,dest Branch if bit n reset in zero page location (8 opcodes) ...
    (comp.sys.apple2)
  • Re: A more structured approach
    ... For a more general "find an environment variable" routine - which would be more useful - you'd want a general "string compare" routine. ... My understanding is that "rep movsb" has been kept optimized, but that the other "string" instructions have gotten slow, compared to equivalent discrete instructions. ...
    (alt.lang.asm)
  • Re: HLA v1.86 is now available
    ... generally don't have the algorithmic background to write such a routine ... language programming course than machine instructions. ... What sense does it make to explain that there is a CPU instruction ... Assembly programming means to generate a sequence of CPU ...
    (alt.lang.asm)
  • Re: Can Windows CL compilers be as fast as CMUCL ?
    ... With vector based CPU instructions that ... | routine could be reduced to one instruction. ... | machine instruction to multiply a vector by a scalar. ... | newer x86 instructions provide something similar. ...
    (comp.lang.lisp)
  • Re: Adding Forms to the taskbar?
    ... in the archive thread: ... Remember to uncomment the first two ... instructions in the UserForm_Activate ... routine. ...
    (microsoft.public.excel.programming)