Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't bother programming the vga registers to manipulate the
framebuffer when in planar4 mode. Instead, just switch between the
four planes and do the manipulation with regular reads and writes.
This makes the code simpler to understand (the vga hardware
manipulations are arcane and complex).
Note, this could make text scrolling in planar4 mode slower and more
likely to result in tearing. However, it's unlikely anything
important uses the vgabios in planar4 mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Extract out the fields in 'struct vgamode_s' that are used in the main
code. The remaining fields are specific to the standard vga hardware
driver.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The previous code could obtain the page size in different ways - from
vmode_g->sslength, from SCREEN_MEM_START, or by manually multiplying
cols and rows. Add a new func (calc_page_size) and use that in areas
that need to calculate the page size.
Convert readers of the page size to read it from the "video_pagesize"
entry in the BDA instead of recalculating it.
Remove the page size from struct vgamode_s (slength) as it is now
calculated dynamically. The new calculated versions are different
from the existing values exported in video_param_table. However, the
existing values (for CGA) did not look correct - I compared the values
to those exported by two other VGA BIOS manufacturers and used the
values that look more standard.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
For graphics modes, store pixel width/height instead of text
width/height. Add explicit char width field. Where needed, calculate
text width/height from pixel width/height by dividing pixel count by
character size.
Rename some fields and change field sizes to match cirrus/bochs
definitions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Replace the custom flags with the flags defined in the VBE spec.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
All three scroll function variants have the same format, but those
that have an implicit character width or height of 1 have those
multiplications omitted. Add those multiplications back in (the
compiler will optimize them away) so all the variants look similar.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Fix missing divide by 2 in CGA mode scroll. Consistently use
cheight/2 for all uses.
Planar graphics character write has a read to video memory with a side
effect - mark that as volatile so the compiler doesn't optimize it
away.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Split out the BDA setup part of vga_set_mode to new function
modeswitch_set_bda. Move the remaining parts (palette loading, screen
clearing, font loading) of vga_set_mode into stdvga_set_mode.
Add new mode switching flags and pass them to stdvga_set_mode, so it
does not need to inspect modeset_ctl directly.
Move code needed by stdvga_set_mode (perform_gray_scale_summing,
clear_screen) to stdvga.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, introduce stdvga.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, rename vgatables.h to vgabios.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Now that all the info in video_param_table is also in vgamode_s, use
the info in vgamode_s throughout the code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Implement wrapper calls in vgaio.c and use them instead.
|
|
Remove remaining "biosfn_" prefixes from functions.
Don't use register names as function parameters.
vgafb_read_pixel should return a value (instead of passing in a pointer)
|
|
Introduce memcpy_stride and memset_stride functions.
Simplify the moves and fills using src and dest pointers.
Don't nest for loops - just use one loop for copies.
|
|
Check for nblines==0 in calling function.
Eliminate full screen clearing optimization.
|
|
|
|
Use vmode_g->memmodel instead of memmodel and svgamode.
|
|
Rename biosfn_scroll to vgafb_scroll.
Break function up into per-mode scroll function.
Pass row/col params in a 'struct cursorpos'.
Encode direction as sign in nblines.
Move parameter checking to callers.
Add enhancement to 'attr' for using mode specific default attribute.
Also, make get_cursor_pos local to vga.c.
|
|
Pass cursor position into vgafb_write_char and vgafb_read_char.
Don't pass count into vgafb_write_char.
Break text writing into separate function.
|
|
|
|
The three parameters are used frequently together - define a struct to
hold them.
Alos, merge biosfn_write_char_attr/_only into one function.
|
|
These three values are frequently used together - put them in a struct
and pass the struct around.
|
|
The functions font loading functions are nearly identical - replace
with one common function.
|
|
Create vgahw_set_mode() that handles low-level vga setup in vgaio.c.
Move screen clearing to new function in vgafb.c.
|
|
Move hardware IO accessor functions to vgaio.c.
Move framebuffer and font manipulation code to vgafb.c.
Also, have biosfn_write_teletype use biosfn_write_char_attr/only.
Also, breakout set_scan_lines() functionality from biosfn_load_text_X.
|