syscons.c (25049) | syscons.c (25190) |
---|---|
1/*- 2 * Copyright (c) 1992-1997 S�ren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1992-1997 S�ren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $Id: syscons.c,v 1.209 1997/04/10 12:26:50 yokota Exp $ | 28 * $Id: syscons.c,v 1.210 1997/04/20 16:05:33 bde Exp $ |
29 */ 30 31#include "sc.h" 32#include "apm.h" 33#include "opt_ddb.h" 34#include "opt_syscons.h" 35 36#if NSC > 0 --- 37 unchanged lines hidden (view full) --- 74#if !defined(MAXCONS) 75#define MAXCONS 16 76#endif 77 78#define COLD 0 79#define WARM 1 80 81/* this may break on older VGA's but is useful on real 32 bit systems */ | 29 */ 30 31#include "sc.h" 32#include "apm.h" 33#include "opt_ddb.h" 34#include "opt_syscons.h" 35 36#if NSC > 0 --- 37 unchanged lines hidden (view full) --- 74#if !defined(MAXCONS) 75#define MAXCONS 16 76#endif 77 78#define COLD 0 79#define WARM 1 80 81/* this may break on older VGA's but is useful on real 32 bit systems */ |
82#define bcopyw bcopy | 82/* XXX use sc_bcopy where video memory is concerned */ 83#define bcopyw bcopy 84#define sc_bcopy generic_bcopy 85extern void generic_bcopy(const void *, void *, size_t); |
83 84static default_attr user_default = { 85 (FG_LIGHTGREY | BG_BLACK) << 8, 86 (FG_BLACK | BG_LIGHTGREY) << 8 87}; 88 89static default_attr kernel_default = { 90 (FG_WHITE | BG_BLACK) << 8, --- 30 unchanged lines hidden (view full) --- 121 u_char scr_map[256]; 122 u_char scr_rmap[256]; 123 char *video_mode_ptr = NULL; 124 int fonts_loaded = 0; 125 char font_8[256*8]; 126 char font_14[256*14]; 127 char font_16[256*16]; 128 char palette[256*3]; | 86 87static default_attr user_default = { 88 (FG_LIGHTGREY | BG_BLACK) << 8, 89 (FG_BLACK | BG_LIGHTGREY) << 8 90}; 91 92static default_attr kernel_default = { 93 (FG_WHITE | BG_BLACK) << 8, --- 30 unchanged lines hidden (view full) --- 124 u_char scr_map[256]; 125 u_char scr_rmap[256]; 126 char *video_mode_ptr = NULL; 127 int fonts_loaded = 0; 128 char font_8[256*8]; 129 char font_14[256*14]; 130 char font_16[256*16]; 131 char palette[256*3]; |
132static char vgaregs[64]; |
|
129static char *cut_buffer; 130static u_short mouse_and_mask[16] = { 131 0xc000, 0xe000, 0xf000, 0xf800, 132 0xfc00, 0xfe00, 0xff00, 0xff80, 133 0xfe00, 0x1e00, 0x1f00, 0x0f00, 134 0x0f00, 0x0000, 0x0000, 0x0000 135 }; 136static u_short mouse_or_mask[16] = { --- 58 unchanged lines hidden (view full) --- 195static u_char *get_fstr(u_int c, u_int *len); 196static void history_to_screen(scr_stat *scp); 197static int history_up_line(scr_stat *scp); 198static int history_down_line(scr_stat *scp); 199static int mask2attr(struct term_stat *term); 200static void set_keyboard(int command, int data); 201static void update_leds(int which); 202static void set_vgaregs(char *modetable); | 133static char *cut_buffer; 134static u_short mouse_and_mask[16] = { 135 0xc000, 0xe000, 0xf000, 0xf800, 136 0xfc00, 0xfe00, 0xff00, 0xff80, 137 0xfe00, 0x1e00, 0x1f00, 0x0f00, 138 0x0f00, 0x0000, 0x0000, 0x0000 139 }; 140static u_short mouse_or_mask[16] = { --- 58 unchanged lines hidden (view full) --- 199static u_char *get_fstr(u_int c, u_int *len); 200static void history_to_screen(scr_stat *scp); 201static int history_up_line(scr_stat *scp); 202static int history_down_line(scr_stat *scp); 203static int mask2attr(struct term_stat *term); 204static void set_keyboard(int command, int data); 205static void update_leds(int which); 206static void set_vgaregs(char *modetable); |
207static void read_vgaregs(char *buf); 208static int comp_vgaregs(u_char *buf1, u_char *buf2); 209static void dump_vgaregs(u_char *buf); |
|
203static void set_font_mode(void); 204static void set_normal_mode(void); 205static void set_destructive_cursor(scr_stat *scp); 206static void set_mouse_pos(scr_stat *scp); 207static void mouse_cut_start(scr_stat *scp); 208static void mouse_cut_end(scr_stat *scp); 209static void mouse_paste(scr_stat *scp); 210static void draw_mouse_image(scr_stat *scp); --- 273 unchanged lines hidden (view full) --- 484 set_destructive_cursor(scp); 485 } 486 487 /* get screen update going */ 488 scrn_timer(NULL); 489 490 update_leds(scp->status); 491 | 210static void set_font_mode(void); 211static void set_normal_mode(void); 212static void set_destructive_cursor(scr_stat *scp); 213static void set_mouse_pos(scr_stat *scp); 214static void mouse_cut_start(scr_stat *scp); 215static void mouse_cut_end(scr_stat *scp); 216static void mouse_paste(scr_stat *scp); 217static void draw_mouse_image(scr_stat *scp); --- 273 unchanged lines hidden (view full) --- 491 set_destructive_cursor(scp); 492 } 493 494 /* get screen update going */ 495 scrn_timer(NULL); 496 497 update_leds(scp->status); 498 |
499 if (bootverbose) { 500 printf("sc%d: BIOS video mode:%d\n", 501 dev->id_unit, *(u_char *)pa_to_va(0x449)); 502 printf("sc%d: VGA registers upon power-up\n", dev->id_unit); 503 dump_vgaregs(vgaregs); 504 printf("sc%d: video mode:%d\n", dev->id_unit, scp->mode); 505 if (video_mode_ptr != NULL) { 506 printf("sc%d: VGA registers for mode:%d\n", 507 dev->id_unit, scp->mode); 508 dump_vgaregs(video_mode_ptr + (64*scp->mode)); 509 } 510 } 511 |
|
492 printf("sc%d: ", dev->id_unit); 493 if (crtc_vga) 494 if (crtc_addr == MONO_BASE) 495 printf("VGA mono"); 496 else 497 printf("VGA color"); 498 else 499 if (crtc_addr == MONO_BASE) --- 965 unchanged lines hidden (view full) --- 1465 buf[0] = c; 1466 ansi_put(scp, buf, 1); 1467 kernel_console = scp->term; 1468 current_default = &user_default; 1469 scp->term = save; 1470 s = splclock(); 1471 if (scp == cur_console && !(scp->status & UNKNOWN_MODE)) { 1472 if (/* timer not running && */ (scp->start <= scp->end)) { | 512 printf("sc%d: ", dev->id_unit); 513 if (crtc_vga) 514 if (crtc_addr == MONO_BASE) 515 printf("VGA mono"); 516 else 517 printf("VGA color"); 518 else 519 if (crtc_addr == MONO_BASE) --- 965 unchanged lines hidden (view full) --- 1485 buf[0] = c; 1486 ansi_put(scp, buf, 1); 1487 kernel_console = scp->term; 1488 current_default = &user_default; 1489 scp->term = save; 1490 s = splclock(); 1491 if (scp == cur_console && !(scp->status & UNKNOWN_MODE)) { 1492 if (/* timer not running && */ (scp->start <= scp->end)) { |
1473 bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, | 1493 sc_bcopy(scp->scr_buf + scp->start, Crtat + scp->start, |
1474 (1 + scp->end - scp->start) * sizeof(u_short)); 1475 scp->start = scp->xsize * scp->ysize; 1476 scp->end = 0; 1477 } 1478 scp->cursor_oldpos = scp->cursor_pos; 1479 draw_cursor_image(scp); 1480 } 1481 splx(s); --- 75 unchanged lines hidden (view full) --- 1557 timeout(scrn_timer, NULL, hz / 10); 1558 splx(s); 1559 return; 1560 } 1561 1562 if (!scrn_blanked) { 1563 /* update screen image */ 1564 if (scp->start <= scp->end) { | 1494 (1 + scp->end - scp->start) * sizeof(u_short)); 1495 scp->start = scp->xsize * scp->ysize; 1496 scp->end = 0; 1497 } 1498 scp->cursor_oldpos = scp->cursor_pos; 1499 draw_cursor_image(scp); 1500 } 1501 splx(s); --- 75 unchanged lines hidden (view full) --- 1577 timeout(scrn_timer, NULL, hz / 10); 1578 splx(s); 1579 return; 1580 } 1581 1582 if (!scrn_blanked) { 1583 /* update screen image */ 1584 if (scp->start <= scp->end) { |
1565 bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, | 1585 sc_bcopy(scp->scr_buf + scp->start, Crtat + scp->start, |
1566 (1 + scp->end - scp->start) * sizeof(u_short)); 1567 } 1568 1569 /* update "pseudo" mouse pointer image */ 1570 if ((scp->status & MOUSE_VISIBLE) && crtc_vga) { 1571 /* did mouse move since last time ? */ 1572 if (scp->status & MOUSE_MOVED) { 1573 /* do we need to remove old mouse pointer image ? */ --- 850 unchanged lines hidden (view full) --- 2424 2425 /* is this a VGA or higher ? */ 2426 outb(crtc_addr, 7); 2427 if (inb(crtc_addr) == 7) { 2428 u_long pa; 2429 u_long segoff; 2430 2431 crtc_vga = TRUE; | 1586 (1 + scp->end - scp->start) * sizeof(u_short)); 1587 } 1588 1589 /* update "pseudo" mouse pointer image */ 1590 if ((scp->status & MOUSE_VISIBLE) && crtc_vga) { 1591 /* did mouse move since last time ? */ 1592 if (scp->status & MOUSE_MOVED) { 1593 /* do we need to remove old mouse pointer image ? */ --- 850 unchanged lines hidden (view full) --- 2444 2445 /* is this a VGA or higher ? */ 2446 outb(crtc_addr, 7); 2447 if (inb(crtc_addr) == 7) { 2448 u_long pa; 2449 u_long segoff; 2450 2451 crtc_vga = TRUE; |
2452 read_vgaregs(vgaregs); |
|
2432 2433 /* Get the BIOS video mode pointer */ 2434 segoff = *(u_long *)pa_to_va(0x4a8); 2435 pa = (((segoff & 0xffff0000) >> 12) + (segoff & 0xffff)); 2436 if (ISMAPPED(pa, sizeof(u_long))) { 2437 segoff = *(u_long *)pa_to_va(pa); 2438 pa = (((segoff & 0xffff0000) >> 12) + (segoff & 0xffff)); 2439 if (ISMAPPED(pa, 64)) 2440 video_mode_ptr = (char *)pa_to_va(pa); 2441 } 2442 } 2443 current_default = &user_default; 2444 console[0] = &main_console; 2445 init_scp(console[0]); 2446 cur_console = console[0]; 2447 | 2453 2454 /* Get the BIOS video mode pointer */ 2455 segoff = *(u_long *)pa_to_va(0x4a8); 2456 pa = (((segoff & 0xffff0000) >> 12) + (segoff & 0xffff)); 2457 if (ISMAPPED(pa, sizeof(u_long))) { 2458 segoff = *(u_long *)pa_to_va(pa); 2459 pa = (((segoff & 0xffff0000) >> 12) + (segoff & 0xffff)); 2460 if (ISMAPPED(pa, 64)) 2461 video_mode_ptr = (char *)pa_to_va(pa); 2462 } 2463 } 2464 current_default = &user_default; 2465 console[0] = &main_console; 2466 init_scp(console[0]); 2467 cur_console = console[0]; 2468 |
2469 /* discard the video mode table if we are not familiar with it... */ 2470 if (video_mode_ptr) { 2471 if (comp_vgaregs(vgaregs, video_mode_ptr + 64*console[0]->mode)) 2472 video_mode_ptr = NULL; 2473 } 2474 |
|
2448 /* copy screen to temporary buffer */ | 2475 /* copy screen to temporary buffer */ |
2449 bcopyw(Crtat, sc_buffer, | 2476 sc_bcopy(Crtat, sc_buffer, |
2450 console[0]->xsize * console[0]->ysize * sizeof(u_short)); 2451 2452 console[0]->scr_buf = console[0]->mouse_pos = sc_buffer; 2453 console[0]->cursor_pos = console[0]->cursor_oldpos = sc_buffer + hw_cursor; 2454 console[0]->xpos = hw_cursor % COL; 2455 console[0]->ypos = hw_cursor / COL; 2456 for (i=1; i<MAXCONS; i++) 2457 console[i] = NULL; --- 858 unchanged lines hidden (view full) --- 3316 outb(GDCREG, modetable[i+55]); 3317 } 3318 inb(crtc_addr+6); /* reset flip-flop */ 3319 outb(ATC, 0x20); /* enable palette */ 3320 splx(s); 3321} 3322 3323static void | 2477 console[0]->xsize * console[0]->ysize * sizeof(u_short)); 2478 2479 console[0]->scr_buf = console[0]->mouse_pos = sc_buffer; 2480 console[0]->cursor_pos = console[0]->cursor_oldpos = sc_buffer + hw_cursor; 2481 console[0]->xpos = hw_cursor % COL; 2482 console[0]->ypos = hw_cursor / COL; 2483 for (i=1; i<MAXCONS; i++) 2484 console[i] = NULL; --- 858 unchanged lines hidden (view full) --- 3343 outb(GDCREG, modetable[i+55]); 3344 } 3345 inb(crtc_addr+6); /* reset flip-flop */ 3346 outb(ATC, 0x20); /* enable palette */ 3347 splx(s); 3348} 3349 3350static void |
3351read_vgaregs(char *buf) 3352{ 3353 int i, j; 3354 int s; 3355 3356 bzero(buf, 64); 3357 3358 s = splhigh(); 3359 3360 outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */ 3361 outb(TSIDX, 0x07); outb(TSREG, 0x00); /* unlock registers */ 3362 for (i=0, j=5; i<4; i++) { 3363 outb(TSIDX, i+1); 3364 buf[j++] = inb(TSREG); 3365 } 3366 buf[9] = inb(MISC + 10); /* dot-clock */ 3367 outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */ 3368 3369 for (i=0, j=10; i<25; i++) { /* crtc */ 3370 outb(crtc_addr, i); 3371 buf[j++] = inb(crtc_addr+1); 3372 } 3373 for (i=0, j=35; i<20; i++) { /* attribute ctrl */ 3374 inb(crtc_addr+6); /* reset flip-flop */ 3375 outb(ATC, i); 3376 buf[j++] = inb(ATC + 1); 3377 } 3378 for (i=0, j=55; i<9; i++) { /* graph data ctrl */ 3379 outb(GDCIDX, i); 3380 buf[j++] = inb(GDCREG); 3381 } 3382 inb(crtc_addr+6); /* reset flip-flop */ 3383 outb(ATC, 0x20); /* enable palette */ 3384 3385 buf[0] = *(char *)pa_to_va(0x44a); /* COLS */ 3386 buf[1] = *(char *)pa_to_va(0x484); /* ROWS */ 3387 buf[2] = *(char *)pa_to_va(0x485); /* POINTS */ 3388 buf[3] = *(char *)pa_to_va(0x44c); 3389 buf[4] = *(char *)pa_to_va(0x44d); 3390 3391 splx(s); 3392} 3393 3394static int 3395comp_vgaregs(u_char *buf1, u_char *buf2) 3396{ 3397 int i; 3398 3399 for(i = 0; i < 24; ++i) { 3400 if (*buf1++ != *buf2++) 3401 return 1; 3402 } 3403 buf1 += 2; /* skip the cursor position register value */ 3404 buf2 += 2; 3405 for(i = 26; i < 64; ++i) { 3406 if (*buf1++ != *buf2++) 3407 return 1; 3408 } 3409 return 0; 3410} 3411 3412static void 3413dump_vgaregs(u_char *buf) 3414{ 3415 int i; 3416 3417 for(i = 0; i < 64;) { 3418 printf("%02x ", buf[i]); 3419 if ((++i % 16) == 0) 3420 printf("\n"); 3421 } 3422} 3423 3424static void |
|
3324set_font_mode() 3325{ 3326 int s = splhigh(); 3327 3328 /* setup vga for loading fonts (graphics plane mode) */ 3329 inb(crtc_addr+6); /* reset flip-flop */ 3330 outb(ATC, 0x10); outb(ATC, 0x01); 3331 inb(crtc_addr+6); /* reset flip-flop */ --- 55 unchanged lines hidden (view full) --- 3387 case M_BG640x480: case M_CG640x480: case M_VGA_CG320: 3388 modetable = video_mode_ptr + (cur_console->mode * 64); 3389 break; 3390 3391 default: 3392 modetable = video_mode_ptr + (64*M_VGA_C80x25); 3393 } 3394 | 3425set_font_mode() 3426{ 3427 int s = splhigh(); 3428 3429 /* setup vga for loading fonts (graphics plane mode) */ 3430 inb(crtc_addr+6); /* reset flip-flop */ 3431 outb(ATC, 0x10); outb(ATC, 0x01); 3432 inb(crtc_addr+6); /* reset flip-flop */ --- 55 unchanged lines hidden (view full) --- 3488 case M_BG640x480: case M_CG640x480: case M_VGA_CG320: 3489 modetable = video_mode_ptr + (cur_console->mode * 64); 3490 break; 3491 3492 default: 3493 modetable = video_mode_ptr + (64*M_VGA_C80x25); 3494 } 3495 |
3496 if (video_mode_ptr == NULL) 3497 modetable = vgaregs; 3498 |
|
3395 /* setup vga for normal operation mode again */ 3396 inb(crtc_addr+6); /* reset flip-flop */ 3397 outb(ATC, 0x10); outb(ATC, modetable[0x10+35]); 3398 inb(crtc_addr+6); /* reset flip-flop */ 3399 outb(ATC, 0x20); /* enable palette */ 3400#if SLOW_VGA 3401 outb(TSIDX, 0x02); outb(TSREG, modetable[0x02+4]); 3402 outb(TSIDX, 0x04); outb(TSREG, modetable[0x04+4]); --- 100 unchanged lines hidden (view full) --- 3503 for (i=0; i<32; i++) 3504 if ((i >= scp->cursor_start && i <= scp->cursor_end) || 3505 (scp->cursor_start >= scp->font_size && i == scp->font_size - 1)) 3506 cursor[i] |= 0xff; 3507#if 1 3508 while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ; 3509#endif 3510 set_font_mode(); | 3499 /* setup vga for normal operation mode again */ 3500 inb(crtc_addr+6); /* reset flip-flop */ 3501 outb(ATC, 0x10); outb(ATC, modetable[0x10+35]); 3502 inb(crtc_addr+6); /* reset flip-flop */ 3503 outb(ATC, 0x20); /* enable palette */ 3504#if SLOW_VGA 3505 outb(TSIDX, 0x02); outb(TSREG, modetable[0x02+4]); 3506 outb(TSIDX, 0x04); outb(TSREG, modetable[0x04+4]); --- 100 unchanged lines hidden (view full) --- 3607 for (i=0; i<32; i++) 3608 if ((i >= scp->cursor_start && i <= scp->cursor_end) || 3609 (scp->cursor_start >= scp->font_size && i == scp->font_size - 1)) 3610 cursor[i] |= 0xff; 3611#if 1 3612 while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ; 3613#endif 3614 set_font_mode(); |
3511 bcopy(cursor, (char *)pa_to_va(address) + DEAD_CHAR * 32, 32); | 3615 sc_bcopy(cursor, (char *)pa_to_va(address) + DEAD_CHAR * 32, 32); |
3512 set_normal_mode(); 3513} 3514 3515static void 3516set_mouse_pos(scr_stat *scp) 3517{ 3518 static int last_xpos = -1, last_ypos = -1; 3519 /* --- 143 unchanged lines hidden (view full) --- 3663 3664 scp->mouse_oldpos = scp->mouse_pos; 3665 3666 /* wait for vertical retrace to avoid jitter on some videocards */ 3667#if 1 3668 while (!(inb(crtc_addr+6) & 0x08)) /* idle */ ; 3669#endif 3670 set_font_mode(); | 3616 set_normal_mode(); 3617} 3618 3619static void 3620set_mouse_pos(scr_stat *scp) 3621{ 3622 static int last_xpos = -1, last_ypos = -1; 3623 /* --- 143 unchanged lines hidden (view full) --- 3767 3768 scp->mouse_oldpos = scp->mouse_pos; 3769 3770 /* wait for vertical retrace to avoid jitter on some videocards */ 3771#if 1 3772 while (!(inb(crtc_addr+6) & 0x08)) /* idle */ ; 3773#endif 3774 set_font_mode(); |
3671 bcopy(scp->mouse_cursor, (char *)pa_to_va(address) + 0xd0 * 32, 128); | 3775 sc_bcopy(scp->mouse_cursor, (char *)pa_to_va(address) + 0xd0 * 32, 128); |
3672 set_normal_mode(); 3673 *(crt_pos) = (*(scp->mouse_pos)&0xff00)|0xd0; 3674 *(crt_pos+scp->xsize) = (*(scp->mouse_pos+scp->xsize)&0xff00)|0xd2; 3675 if (scp->mouse_xpos < (scp->xsize-1)*8) { 3676 *(crt_pos+1) = (*(scp->mouse_pos+1)&0xff00)|0xd1; 3677 *(crt_pos+scp->xsize+1) = (*(scp->mouse_pos+scp->xsize+1)&0xff00)|0xd3; 3678 } 3679 mark_for_update(scp, scp->mouse_pos - scp->scr_buf); --- 120 unchanged lines hidden (view full) --- 3800} 3801 3802#ifdef SC_SPLASH_SCREEN 3803static void 3804toggle_splash_screen(scr_stat *scp) 3805{ 3806 static int toggle = 0; 3807 static u_char save_mode; | 3776 set_normal_mode(); 3777 *(crt_pos) = (*(scp->mouse_pos)&0xff00)|0xd0; 3778 *(crt_pos+scp->xsize) = (*(scp->mouse_pos+scp->xsize)&0xff00)|0xd2; 3779 if (scp->mouse_xpos < (scp->xsize-1)*8) { 3780 *(crt_pos+1) = (*(scp->mouse_pos+1)&0xff00)|0xd1; 3781 *(crt_pos+scp->xsize+1) = (*(scp->mouse_pos+scp->xsize+1)&0xff00)|0xd3; 3782 } 3783 mark_for_update(scp, scp->mouse_pos - scp->scr_buf); --- 120 unchanged lines hidden (view full) --- 3904} 3905 3906#ifdef SC_SPLASH_SCREEN 3907static void 3908toggle_splash_screen(scr_stat *scp) 3909{ 3910 static int toggle = 0; 3911 static u_char save_mode; |
3808 int s = splhigh(); | 3912 int s; |
3809 | 3913 |
3914 if (video_mode_ptr == NULL) 3915 return; 3916 3917 s = splhigh(); |
|
3810 if (toggle) { 3811 scp->mode = save_mode; 3812 scp->status &= ~UNKNOWN_MODE; 3813 set_mode(scp); 3814 load_palette(palette); 3815 toggle = 0; 3816 } 3817 else { 3818 save_mode = scp->mode; 3819 scp->mode = M_VGA_CG320; 3820 scp->status |= UNKNOWN_MODE; 3821 set_mode(scp); 3822 /* load image */ 3823 toggle = 1; 3824 } 3825 splx(s); 3826} 3827#endif 3828#endif /* NSC */ | 3918 if (toggle) { 3919 scp->mode = save_mode; 3920 scp->status &= ~UNKNOWN_MODE; 3921 set_mode(scp); 3922 load_palette(palette); 3923 toggle = 0; 3924 } 3925 else { 3926 save_mode = scp->mode; 3927 scp->mode = M_VGA_CG320; 3928 scp->status |= UNKNOWN_MODE; 3929 set_mode(scp); 3930 /* load image */ 3931 toggle = 1; 3932 } 3933 splx(s); 3934} 3935#endif 3936#endif /* NSC */ |