On 02/01/2015 04:40, Kevin O'Connor wrote:
> > I couldn't find documentation for what to return as the attribute, but
> > experimenting with DOSBox suggests 0 (and GWBasic accepts it).
>
> Just for reference, for the "cbvga" text mode emulation, I grab the
> background attribute by assuming the lower right pixel of the cell is
> the background, and then assume the foreground attribute is the
> background attribute xor'd with 0x7 (see gfx_write_char()).  I'm not
> sure if that hack applies here though.  :-)

No, it doesn't.  http://www.ctyme.com/intr/rb-0098.htm says AH is only
defined in text mode, so it's probably safer to return zero.

Actually, it even says "only characters drawn with white foreground
pixels are matched by the pattern-comparison routine".  I can tweak the
patch to only match color (1 << vga_bpp) - 1, or to add a comment that
we extend the behavior.

> Any reason not to just "return gfx_read_char(vmode_g, cp);" here and
> have gfx_read_char() return a struct carattr?

No reason.

Paolo

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios

Reply via email to