Use better hard-coded defaults for the cursor shape, and remove nearby
redundant initializations. Hard-code base = 0, height = (approx. 1/8 of the boot-time font height) in all cases, and remove the BIOS/MD support for setting these values. This asks for an underline cursor sized for the boot-time font instead of various less hard-coded but worse values. I used that think that the x86 BIOS always gave the same values as the above hard-coding, but on 1 of my systems it gives the wrong value of base = 1. The remaining BIOS fields are shift_state and bell_pitch. These are now consistently not explicitly reinitialized to 0. All sc_get_bios_value() functions except x86's are now empty, and the only useful thing that x86 returns is shift_state. This really belongs in atkbdc, but heavier use of the BIOS to read the more useful typematic rate has been removed there. fb still makes much heavier use of the BIOS.
This commit is contained in:
parent
43f0edd4e7
commit
7692d200c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322705
@ -78,9 +78,6 @@ sc_get_softc(int unit, int flags)
|
||||
void
|
||||
sc_get_bios_values(bios_values_t *values)
|
||||
{
|
||||
values->cursor_start = 0;
|
||||
values->cursor_end = 32;
|
||||
values->shift_state = 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -3208,14 +3208,8 @@ scinit(int unit, int flags)
|
||||
scp->cursor_pos = scp->cursor_oldpos = row*scp->xsize + col;
|
||||
(*scp->tsw->te_sync)(scp);
|
||||
|
||||
/* Sync BIOS cursor shape to s/w (sc only). */
|
||||
if (bios_value.cursor_end < scp->font_size)
|
||||
sc->dflt_curs_attr.base = scp->font_size -
|
||||
bios_value.cursor_end - 1;
|
||||
else
|
||||
sc->dflt_curs_attr.base = 0;
|
||||
i = bios_value.cursor_end - bios_value.cursor_start + 1;
|
||||
sc->dflt_curs_attr.height = imin(i, scp->font_size);
|
||||
sc->dflt_curs_attr.base = 0;
|
||||
sc->dflt_curs_attr.height = howmany(scp->font_size, 8);
|
||||
sc->dflt_curs_attr.flags = 0;
|
||||
sc->curs_attr = sc->dflt_curs_attr;
|
||||
scp->curr_curs_attr = scp->dflt_curs_attr = sc->curs_attr;
|
||||
|
@ -516,8 +516,6 @@ typedef struct sc_renderer {
|
||||
SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
|
||||
|
||||
typedef struct {
|
||||
int cursor_start;
|
||||
int cursor_end;
|
||||
int shift_state;
|
||||
int bell_pitch;
|
||||
} bios_values_t;
|
||||
|
@ -207,17 +207,11 @@ sc_get_bios_values(bios_values_t *values)
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
uint8_t shift;
|
||||
|
||||
values->cursor_start = *(uint8_t *)BIOS_PADDRTOVADDR(0x461);
|
||||
values->cursor_end = *(uint8_t *)BIOS_PADDRTOVADDR(0x460);
|
||||
shift = *(uint8_t *)BIOS_PADDRTOVADDR(0x417);
|
||||
values->shift_state = ((shift & BIOS_CLKED) != 0 ? CLKED : 0) |
|
||||
((shift & BIOS_NLKED) != 0 ? NLKED : 0) |
|
||||
((shift & BIOS_SLKED) != 0 ? SLKED : 0) |
|
||||
((shift & BIOS_ALKED) != 0 ? ALKED : 0);
|
||||
#else
|
||||
values->cursor_start = 0;
|
||||
values->cursor_end = 32;
|
||||
values->shift_state = 0;
|
||||
#endif
|
||||
values->bell_pitch = BELL_PITCH;
|
||||
}
|
||||
|
@ -78,9 +78,6 @@ sc_get_softc(int unit, int flags)
|
||||
void
|
||||
sc_get_bios_values(bios_values_t *values)
|
||||
{
|
||||
values->cursor_start = 0;
|
||||
values->cursor_end = 32;
|
||||
values->shift_state = 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -78,9 +78,6 @@ sc_get_softc(int unit, int flags)
|
||||
void
|
||||
sc_get_bios_values(bios_values_t *values)
|
||||
{
|
||||
values->cursor_start = 0;
|
||||
values->cursor_end = 32;
|
||||
values->shift_state = 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user