summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/pc98/pc98/syscons.c51
-rw-r--r--sys/pc98/pc98/syscons.h8
2 files changed, 37 insertions, 22 deletions
diff --git a/sys/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c
index 3b6ebf7..417547e 100644
--- a/sys/pc98/pc98/syscons.c
+++ b/sys/pc98/pc98/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.38 1997/05/07 14:17:38 kato Exp $
+ * $Id: syscons.c,v 1.39 1997/05/08 09:22:32 kato Exp $
*/
#include "sc.h"
@@ -900,7 +900,13 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return 0;
case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
+ if (*(int *)data < 0)
+ return EINVAL;
scrn_blank_time = *(int*)data;
+ if ((scrn_blank_time == 0) && scrn_blanked) {
+ (*current_saver)(FALSE);
+ mark_all(cur_console);
+ }
return 0;
case CONS_CURSORTYPE: /* set cursor type blink/noblink */
@@ -1161,6 +1167,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case SW_ENH_B40x25: case SW_ENH_C40x25:
case SW_ENH_B80x25: case SW_ENH_C80x25:
case SW_ENH_B80x43: case SW_ENH_C80x43:
+ case SW_EGAMONO80x25:
if (!crtc_vga || video_mode_ptr == NULL)
return ENXIO;
@@ -1187,6 +1194,12 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
scp->xsize = 80;
scp->ysize = 30;
break;
+ case M_ENH_C40x25: case M_ENH_B40x25:
+ case M_ENH_C80x25: case M_ENH_B80x25:
+ case M_EGAMONO80x25:
+ if (!(fonts_loaded & FONT_14))
+ return EINVAL;
+ /* FALL THROUGH */
default:
if ((cmd & 0xff) > M_VGA_CG320)
return EINVAL;
@@ -2652,10 +2665,11 @@ scan_esc(scr_stat *scp, u_char c)
break;
case 'A': /* set display border color */
- if (scp->term.num_param == 1)
+ if ((scp->term.num_param == 1) && crtc_vga) {
scp->border=scp->term.param[0] & 0xff;
if (scp == cur_console)
set_border(scp->border);
+ }
break;
case 'B': /* set bell pitch and duration */
@@ -2671,7 +2685,7 @@ scan_esc(scr_stat *scp, u_char c)
flags |= BLINK_CURSOR;
else
flags &= ~BLINK_CURSOR;
- if (scp->term.param[0] & 0x02) {
+ if ((scp->term.param[0] & 0x02) && crtc_vga) {
flags |= CHAR_CURSOR;
set_destructive_cursor(scp);
} else
@@ -3341,7 +3355,7 @@ init_scp(scr_stat *scp)
scp->mode = M_C80x25;
#endif
- scp->font_size = FONT_16;
+ scp->font_size = 16;
scp->xsize = COL;
scp->ysize = ROW;
scp->xpos = scp->ypos = 0;
@@ -4219,6 +4233,7 @@ special_80x50:
case M_B80x25: case M_C80x25:
case M_ENH_B40x25: case M_ENH_C40x25:
case M_ENH_B80x25: case M_ENH_C80x25:
+ case M_EGAMONO80x25:
modetable = video_mode_ptr + (scp->mode * 64);
setup_mode:
@@ -4226,11 +4241,11 @@ setup_mode:
scp->font_size = *(modetable + 2);
/* set font type (size) */
- if (scp->font_size < FONT_14) {
+ if (scp->font_size < 14) {
if (fonts_loaded & FONT_8)
copy_font(LOAD, FONT_8, font_8);
outb(TSIDX, 0x03); outb(TSREG, 0x0A); /* font 2 */
- } else if (scp->font_size >= FONT_16) {
+ } else if (scp->font_size >= 16) {
if (fonts_loaded & FONT_16)
copy_font(LOAD, FONT_16, font_16);
outb(TSIDX, 0x03); outb(TSREG, 0x00); /* font 0 */
@@ -4454,6 +4469,7 @@ set_normal_mode()
case M_B80x25: case M_C80x25:
case M_ENH_B40x25: case M_ENH_C40x25:
case M_ENH_B80x25: case M_ENH_C80x25:
+ case M_EGAMONO80x25:
case M_BG320: case M_CG320: case M_BG640:
case M_CG320_D: case M_CG640_E:
@@ -4552,11 +4568,11 @@ set_destructive_cursor(scr_stat *scp)
char *font_buffer;
- if (scp->font_size < FONT_14) {
+ if (scp->font_size < 14) {
font_buffer = font_8;
address = (caddr_t)VIDEOMEM + 0x8000;
}
- else if (scp->font_size >= FONT_16) {
+ else if (scp->font_size >= 16) {
font_buffer = font_16;
address = (caddr_t)VIDEOMEM;
}
@@ -4710,11 +4726,11 @@ draw_mouse_image(scr_stat *scp)
u_short *crt_pos = Crtat + (scp->mouse_pos - scp->scr_buf);
int font_size = scp->font_size;
- if (font_size < FONT_14) {
+ if (font_size < 14) {
font_buffer = font_8;
address = (caddr_t)VIDEOMEM + 0x8000;
}
- else if (font_size >= FONT_16) {
+ else if (font_size >= 16) {
font_buffer = font_16;
address = (caddr_t)VIDEOMEM;
}
@@ -4870,7 +4886,6 @@ do_bell(scr_stat *scp, int pitch, int duration)
if (scp != cur_console)
blink_in_progress += 2;
blink_screen(cur_console);
- timeout(blink_screen, cur_console, hz / 10);
} else {
if (scp != cur_console)
pitch *= 2;
@@ -4898,7 +4913,13 @@ blink_screen(void *arg)
{
scr_stat *scp = arg;
- if (blink_in_progress > 1) {
+ if ((scp->status & UNKNOWN_MODE) || (blink_in_progress <= 1)) {
+ blink_in_progress = FALSE;
+ mark_all(scp);
+ if (delayed_next_scr)
+ switch_scr(scp, delayed_next_scr - 1);
+ }
+ else {
#ifdef PC98
if (blink_in_progress & 1){
fillw(scr_map[0x20],
@@ -4922,12 +4943,6 @@ blink_screen(void *arg)
blink_in_progress--;
timeout(blink_screen, scp, hz / 10);
}
- else {
- blink_in_progress = FALSE;
- mark_all(scp);
- if (delayed_next_scr)
- switch_scr(scp, delayed_next_scr - 1);
- }
}
#ifdef SC_SPLASH_SCREEN
diff --git a/sys/pc98/pc98/syscons.h b/sys/pc98/pc98/syscons.h
index eea8cd7..b2e7ccc 100644
--- a/sys/pc98/pc98/syscons.h
+++ b/sys/pc98/pc98/syscons.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id$
+ * $Id: syscons.h,v 1.12 1997/02/22 09:43:51 peter Exp $
*/
#ifndef _PC98_PC98_SYSCONS_H_
@@ -113,9 +113,9 @@ static unsigned int BELL_PITCH = 1678;
#define CONSOLE_BUFSIZE 1024
#define PCBURST 128
#define FONT_NONE 1
-#define FONT_8 8
-#define FONT_14 14
-#define FONT_16 16
+#define FONT_8 2
+#define FONT_14 4
+#define FONT_16 8
#define HISTORY_SIZE 100*80
/* defines related to hardware addresses */
OpenPOWER on IntegriCloud