Now that we have replaced video-related block copy calls with

sc_bcopy(), which is generic_bcopy() in reality, there is no point in
retaining bcopyw() calls in the source code.
OKed by : sos
This commit is contained in:
Kazutaka YOKOTA 1997-05-07 10:42:06 +00:00
parent e6eac8565e
commit df25dec0e5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25527
3 changed files with 96 additions and 102 deletions

View File

@ -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.212 1997/04/30 01:19:21 ache Exp $
* $Id: syscons.c,v 1.213 1997/04/30 15:31:22 ache Exp $
*/
#include "sc.h"
@ -78,9 +78,7 @@
#define COLD 0
#define WARM 1
/* this may break on older VGA's but is useful on real 32 bit systems */
/* XXX use sc_bcopy where video memory is concerned */
#define bcopyw bcopy
#define sc_bcopy generic_bcopy
extern void generic_bcopy(const void *, void *, size_t);
@ -470,7 +468,7 @@ scattach(struct isa_device *dev)
M_DEVBUF, M_NOWAIT);
/* copy temporary buffer to final buffer */
bcopyw(sc_buffer, scp->scr_buf, scp->xsize * scp->ysize * sizeof(u_short));
bcopy(sc_buffer, scp->scr_buf, scp->xsize * scp->ysize * sizeof(u_short));
scp->cursor_pos = scp->cursor_oldpos =
scp->scr_buf + scp->xpos + scp->ypos * scp->xsize;
@ -1771,7 +1769,7 @@ scan_esc(scr_stat *scp, u_char c)
if (scp->ypos > 0)
move_crsr(scp, scp->xpos, scp->ypos - 1);
else {
bcopyw(scp->scr_buf, scp->scr_buf + scp->xsize,
bcopy(scp->scr_buf, scp->scr_buf + scp->xsize,
(scp->ysize - 1) * scp->xsize * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
scp->scr_buf, scp->xsize);
@ -1924,7 +1922,7 @@ scan_esc(scr_stat *scp, u_char c)
src = scp->scr_buf + scp->ypos * scp->xsize;
dst = src + n * scp->xsize;
count = scp->ysize - (scp->ypos + n);
bcopyw(src, dst, count * scp->xsize * sizeof(u_short));
bcopy(src, dst, count * scp->xsize * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20], src,
n * scp->xsize);
mark_for_update(scp, scp->ypos * scp->xsize);
@ -1938,7 +1936,7 @@ scan_esc(scr_stat *scp, u_char c)
dst = scp->scr_buf + scp->ypos * scp->xsize;
src = dst + n * scp->xsize;
count = scp->ysize - (scp->ypos + n);
bcopyw(src, dst, count * scp->xsize * sizeof(u_short));
bcopy(src, dst, count * scp->xsize * sizeof(u_short));
src = dst + count * scp->xsize;
fillw(scp->term.cur_color | scr_map[0x20], src,
n * scp->xsize);
@ -1953,7 +1951,7 @@ scan_esc(scr_stat *scp, u_char c)
dst = scp->cursor_pos;
src = dst + n;
count = scp->xsize - (scp->xpos + n);
bcopyw(src, dst, count * sizeof(u_short));
bcopy(src, dst, count * sizeof(u_short));
src = dst + count;
fillw(scp->term.cur_color | scr_map[0x20], src, n);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
@ -1967,7 +1965,7 @@ scan_esc(scr_stat *scp, u_char c)
src = scp->cursor_pos;
dst = src + n;
count = scp->xsize - (scp->xpos + n);
bcopyw(src, dst, count * sizeof(u_short));
bcopy(src, dst, count * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20], src, n);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count);
@ -1977,7 +1975,7 @@ scan_esc(scr_stat *scp, u_char c)
n = scp->term.param[0]; if (n < 1) n = 1;
if (n > scp->ysize)
n = scp->ysize;
bcopyw(scp->scr_buf + (scp->xsize * n),
bcopy(scp->scr_buf + (scp->xsize * n),
scp->scr_buf,
scp->xsize * (scp->ysize - n) * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
@ -1990,7 +1988,7 @@ scan_esc(scr_stat *scp, u_char c)
n = scp->term.param[0]; if (n < 1) n = 1;
if (n > scp->ysize)
n = scp->ysize;
bcopyw(scp->scr_buf,
bcopy(scp->scr_buf,
scp->scr_buf + (scp->xsize * n),
scp->xsize * (scp->ysize - n) *
sizeof(u_short));
@ -2360,14 +2358,14 @@ ansi_put(scr_stat *scp, u_char *buf, int len)
if (scp->cursor_pos >= scp->scr_buf + scp->ysize * scp->xsize) {
remove_cutmarking(scp);
if (scp->history) {
bcopyw(scp->scr_buf, scp->history_head,
bcopy(scp->scr_buf, scp->history_head,
scp->xsize * sizeof(u_short));
scp->history_head += scp->xsize;
if (scp->history_head + scp->xsize >
scp->history + scp->history_size)
scp->history_head = scp->history;
}
bcopyw(scp->scr_buf + scp->xsize, scp->scr_buf,
bcopy(scp->scr_buf + scp->xsize, scp->scr_buf,
scp->xsize * (scp->ysize - 1) * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
scp->scr_buf + scp->xsize * (scp->ysize - 1),
@ -2602,7 +2600,7 @@ history_to_screen(scr_stat *scp)
int i;
for (i=0; i<scp->ysize; i++)
bcopyw(scp->history + (((scp->history_pos - scp->history) +
bcopy(scp->history + (((scp->history_pos - scp->history) +
scp->history_size-((i+1)*scp->xsize))%scp->history_size),
scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)),
scp->xsize * sizeof(u_short));
@ -2784,7 +2782,7 @@ scgetc(u_int flags)
/* copy screen into top of history buffer */
for (i=0; i<cur_console->ysize; i++) {
bcopyw(cur_console->scr_buf + (cur_console->xsize * i),
bcopy(cur_console->scr_buf + (cur_console->xsize * i),
cur_console->history_head,
cur_console->xsize * sizeof(u_short));
cur_console->history_head += cur_console->xsize;
@ -2966,7 +2964,7 @@ scgetc(u_int flags)
u_short *ptr = cur_console->history_save;
for (i=0; i<cur_console->ysize; i++) {
bcopyw(ptr,
bcopy(ptr,
cur_console->scr_buf +
(cur_console->xsize*i),
cur_console->xsize * sizeof(u_short));
@ -3201,22 +3199,22 @@ set_mode(scr_stat *scp)
/* setup video hardware for the given mode */
switch (scp->mode) {
case M_VGA_M80x60:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x60;
case M_VGA_C80x60:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x60:
special_modetable[2] = 0x08;
special_modetable[19] = 0x47;
goto special_480l;
case M_VGA_M80x30:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x30;
case M_VGA_C80x30:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x30:
special_modetable[19] = 0x4f;
special_480l:
@ -3231,21 +3229,21 @@ set_mode(scr_stat *scp)
goto setup_mode;
case M_ENH_B80x43:
bcopyw(video_mode_ptr+(64*M_ENH_B80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_ENH_B80x25), &special_modetable, 64);
goto special_80x43;
case M_ENH_C80x43:
bcopyw(video_mode_ptr+(64*M_ENH_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_ENH_C80x25), &special_modetable, 64);
special_80x43:
special_modetable[28] = 87;
goto special_80x50;
case M_VGA_M80x50:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x50;
case M_VGA_C80x50:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x50:
special_modetable[2] = 8;
special_modetable[19] = 7;
@ -3596,19 +3594,19 @@ set_destructive_cursor(scr_stat *scp)
if (scp->status & MOUSE_VISIBLE) {
if ((scp->cursor_saveunder & 0xff) == 0xd0)
bcopyw(&scp->mouse_cursor[0], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[0], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd1)
bcopyw(&scp->mouse_cursor[32], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[32], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd2)
bcopyw(&scp->mouse_cursor[64], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[64], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd3)
bcopyw(&scp->mouse_cursor[96], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[96], cursor, scp->font_size);
else
bcopyw(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
bcopy(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
cursor, scp->font_size);
}
else
bcopyw(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
bcopy(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
cursor, scp->font_size);
for (i=0; i<32; i++)
if ((i >= scp->cursor_start && i <= scp->cursor_end) ||
@ -3745,13 +3743,13 @@ draw_mouse_image(scr_stat *scp)
yoffset = scp->mouse_ypos % font_size;
/* prepare mousepointer char's bitmaps */
bcopyw(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
&scp->mouse_cursor[0], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
&scp->mouse_cursor[32], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
&scp->mouse_cursor[64], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
&scp->mouse_cursor[96], font_size);
for (i=0; i<font_size; i++) {
buffer[i] = scp->mouse_cursor[i]<<8 | scp->mouse_cursor[i+32];

View File

@ -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.212 1997/04/30 01:19:21 ache Exp $
* $Id: syscons.c,v 1.213 1997/04/30 15:31:22 ache Exp $
*/
#include "sc.h"
@ -78,9 +78,7 @@
#define COLD 0
#define WARM 1
/* this may break on older VGA's but is useful on real 32 bit systems */
/* XXX use sc_bcopy where video memory is concerned */
#define bcopyw bcopy
#define sc_bcopy generic_bcopy
extern void generic_bcopy(const void *, void *, size_t);
@ -470,7 +468,7 @@ scattach(struct isa_device *dev)
M_DEVBUF, M_NOWAIT);
/* copy temporary buffer to final buffer */
bcopyw(sc_buffer, scp->scr_buf, scp->xsize * scp->ysize * sizeof(u_short));
bcopy(sc_buffer, scp->scr_buf, scp->xsize * scp->ysize * sizeof(u_short));
scp->cursor_pos = scp->cursor_oldpos =
scp->scr_buf + scp->xpos + scp->ypos * scp->xsize;
@ -1771,7 +1769,7 @@ scan_esc(scr_stat *scp, u_char c)
if (scp->ypos > 0)
move_crsr(scp, scp->xpos, scp->ypos - 1);
else {
bcopyw(scp->scr_buf, scp->scr_buf + scp->xsize,
bcopy(scp->scr_buf, scp->scr_buf + scp->xsize,
(scp->ysize - 1) * scp->xsize * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
scp->scr_buf, scp->xsize);
@ -1924,7 +1922,7 @@ scan_esc(scr_stat *scp, u_char c)
src = scp->scr_buf + scp->ypos * scp->xsize;
dst = src + n * scp->xsize;
count = scp->ysize - (scp->ypos + n);
bcopyw(src, dst, count * scp->xsize * sizeof(u_short));
bcopy(src, dst, count * scp->xsize * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20], src,
n * scp->xsize);
mark_for_update(scp, scp->ypos * scp->xsize);
@ -1938,7 +1936,7 @@ scan_esc(scr_stat *scp, u_char c)
dst = scp->scr_buf + scp->ypos * scp->xsize;
src = dst + n * scp->xsize;
count = scp->ysize - (scp->ypos + n);
bcopyw(src, dst, count * scp->xsize * sizeof(u_short));
bcopy(src, dst, count * scp->xsize * sizeof(u_short));
src = dst + count * scp->xsize;
fillw(scp->term.cur_color | scr_map[0x20], src,
n * scp->xsize);
@ -1953,7 +1951,7 @@ scan_esc(scr_stat *scp, u_char c)
dst = scp->cursor_pos;
src = dst + n;
count = scp->xsize - (scp->xpos + n);
bcopyw(src, dst, count * sizeof(u_short));
bcopy(src, dst, count * sizeof(u_short));
src = dst + count;
fillw(scp->term.cur_color | scr_map[0x20], src, n);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
@ -1967,7 +1965,7 @@ scan_esc(scr_stat *scp, u_char c)
src = scp->cursor_pos;
dst = src + n;
count = scp->xsize - (scp->xpos + n);
bcopyw(src, dst, count * sizeof(u_short));
bcopy(src, dst, count * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20], src, n);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count);
@ -1977,7 +1975,7 @@ scan_esc(scr_stat *scp, u_char c)
n = scp->term.param[0]; if (n < 1) n = 1;
if (n > scp->ysize)
n = scp->ysize;
bcopyw(scp->scr_buf + (scp->xsize * n),
bcopy(scp->scr_buf + (scp->xsize * n),
scp->scr_buf,
scp->xsize * (scp->ysize - n) * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
@ -1990,7 +1988,7 @@ scan_esc(scr_stat *scp, u_char c)
n = scp->term.param[0]; if (n < 1) n = 1;
if (n > scp->ysize)
n = scp->ysize;
bcopyw(scp->scr_buf,
bcopy(scp->scr_buf,
scp->scr_buf + (scp->xsize * n),
scp->xsize * (scp->ysize - n) *
sizeof(u_short));
@ -2360,14 +2358,14 @@ ansi_put(scr_stat *scp, u_char *buf, int len)
if (scp->cursor_pos >= scp->scr_buf + scp->ysize * scp->xsize) {
remove_cutmarking(scp);
if (scp->history) {
bcopyw(scp->scr_buf, scp->history_head,
bcopy(scp->scr_buf, scp->history_head,
scp->xsize * sizeof(u_short));
scp->history_head += scp->xsize;
if (scp->history_head + scp->xsize >
scp->history + scp->history_size)
scp->history_head = scp->history;
}
bcopyw(scp->scr_buf + scp->xsize, scp->scr_buf,
bcopy(scp->scr_buf + scp->xsize, scp->scr_buf,
scp->xsize * (scp->ysize - 1) * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
scp->scr_buf + scp->xsize * (scp->ysize - 1),
@ -2602,7 +2600,7 @@ history_to_screen(scr_stat *scp)
int i;
for (i=0; i<scp->ysize; i++)
bcopyw(scp->history + (((scp->history_pos - scp->history) +
bcopy(scp->history + (((scp->history_pos - scp->history) +
scp->history_size-((i+1)*scp->xsize))%scp->history_size),
scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)),
scp->xsize * sizeof(u_short));
@ -2784,7 +2782,7 @@ scgetc(u_int flags)
/* copy screen into top of history buffer */
for (i=0; i<cur_console->ysize; i++) {
bcopyw(cur_console->scr_buf + (cur_console->xsize * i),
bcopy(cur_console->scr_buf + (cur_console->xsize * i),
cur_console->history_head,
cur_console->xsize * sizeof(u_short));
cur_console->history_head += cur_console->xsize;
@ -2966,7 +2964,7 @@ scgetc(u_int flags)
u_short *ptr = cur_console->history_save;
for (i=0; i<cur_console->ysize; i++) {
bcopyw(ptr,
bcopy(ptr,
cur_console->scr_buf +
(cur_console->xsize*i),
cur_console->xsize * sizeof(u_short));
@ -3201,22 +3199,22 @@ set_mode(scr_stat *scp)
/* setup video hardware for the given mode */
switch (scp->mode) {
case M_VGA_M80x60:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x60;
case M_VGA_C80x60:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x60:
special_modetable[2] = 0x08;
special_modetable[19] = 0x47;
goto special_480l;
case M_VGA_M80x30:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x30;
case M_VGA_C80x30:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x30:
special_modetable[19] = 0x4f;
special_480l:
@ -3231,21 +3229,21 @@ set_mode(scr_stat *scp)
goto setup_mode;
case M_ENH_B80x43:
bcopyw(video_mode_ptr+(64*M_ENH_B80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_ENH_B80x25), &special_modetable, 64);
goto special_80x43;
case M_ENH_C80x43:
bcopyw(video_mode_ptr+(64*M_ENH_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_ENH_C80x25), &special_modetable, 64);
special_80x43:
special_modetable[28] = 87;
goto special_80x50;
case M_VGA_M80x50:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x50;
case M_VGA_C80x50:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x50:
special_modetable[2] = 8;
special_modetable[19] = 7;
@ -3596,19 +3594,19 @@ set_destructive_cursor(scr_stat *scp)
if (scp->status & MOUSE_VISIBLE) {
if ((scp->cursor_saveunder & 0xff) == 0xd0)
bcopyw(&scp->mouse_cursor[0], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[0], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd1)
bcopyw(&scp->mouse_cursor[32], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[32], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd2)
bcopyw(&scp->mouse_cursor[64], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[64], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd3)
bcopyw(&scp->mouse_cursor[96], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[96], cursor, scp->font_size);
else
bcopyw(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
bcopy(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
cursor, scp->font_size);
}
else
bcopyw(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
bcopy(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
cursor, scp->font_size);
for (i=0; i<32; i++)
if ((i >= scp->cursor_start && i <= scp->cursor_end) ||
@ -3745,13 +3743,13 @@ draw_mouse_image(scr_stat *scp)
yoffset = scp->mouse_ypos % font_size;
/* prepare mousepointer char's bitmaps */
bcopyw(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
&scp->mouse_cursor[0], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
&scp->mouse_cursor[32], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
&scp->mouse_cursor[64], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
&scp->mouse_cursor[96], font_size);
for (i=0; i<font_size; i++) {
buffer[i] = scp->mouse_cursor[i]<<8 | scp->mouse_cursor[i+32];

View File

@ -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.212 1997/04/30 01:19:21 ache Exp $
* $Id: syscons.c,v 1.213 1997/04/30 15:31:22 ache Exp $
*/
#include "sc.h"
@ -78,9 +78,7 @@
#define COLD 0
#define WARM 1
/* this may break on older VGA's but is useful on real 32 bit systems */
/* XXX use sc_bcopy where video memory is concerned */
#define bcopyw bcopy
#define sc_bcopy generic_bcopy
extern void generic_bcopy(const void *, void *, size_t);
@ -470,7 +468,7 @@ scattach(struct isa_device *dev)
M_DEVBUF, M_NOWAIT);
/* copy temporary buffer to final buffer */
bcopyw(sc_buffer, scp->scr_buf, scp->xsize * scp->ysize * sizeof(u_short));
bcopy(sc_buffer, scp->scr_buf, scp->xsize * scp->ysize * sizeof(u_short));
scp->cursor_pos = scp->cursor_oldpos =
scp->scr_buf + scp->xpos + scp->ypos * scp->xsize;
@ -1771,7 +1769,7 @@ scan_esc(scr_stat *scp, u_char c)
if (scp->ypos > 0)
move_crsr(scp, scp->xpos, scp->ypos - 1);
else {
bcopyw(scp->scr_buf, scp->scr_buf + scp->xsize,
bcopy(scp->scr_buf, scp->scr_buf + scp->xsize,
(scp->ysize - 1) * scp->xsize * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
scp->scr_buf, scp->xsize);
@ -1924,7 +1922,7 @@ scan_esc(scr_stat *scp, u_char c)
src = scp->scr_buf + scp->ypos * scp->xsize;
dst = src + n * scp->xsize;
count = scp->ysize - (scp->ypos + n);
bcopyw(src, dst, count * scp->xsize * sizeof(u_short));
bcopy(src, dst, count * scp->xsize * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20], src,
n * scp->xsize);
mark_for_update(scp, scp->ypos * scp->xsize);
@ -1938,7 +1936,7 @@ scan_esc(scr_stat *scp, u_char c)
dst = scp->scr_buf + scp->ypos * scp->xsize;
src = dst + n * scp->xsize;
count = scp->ysize - (scp->ypos + n);
bcopyw(src, dst, count * scp->xsize * sizeof(u_short));
bcopy(src, dst, count * scp->xsize * sizeof(u_short));
src = dst + count * scp->xsize;
fillw(scp->term.cur_color | scr_map[0x20], src,
n * scp->xsize);
@ -1953,7 +1951,7 @@ scan_esc(scr_stat *scp, u_char c)
dst = scp->cursor_pos;
src = dst + n;
count = scp->xsize - (scp->xpos + n);
bcopyw(src, dst, count * sizeof(u_short));
bcopy(src, dst, count * sizeof(u_short));
src = dst + count;
fillw(scp->term.cur_color | scr_map[0x20], src, n);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
@ -1967,7 +1965,7 @@ scan_esc(scr_stat *scp, u_char c)
src = scp->cursor_pos;
dst = src + n;
count = scp->xsize - (scp->xpos + n);
bcopyw(src, dst, count * sizeof(u_short));
bcopy(src, dst, count * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20], src, n);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count);
@ -1977,7 +1975,7 @@ scan_esc(scr_stat *scp, u_char c)
n = scp->term.param[0]; if (n < 1) n = 1;
if (n > scp->ysize)
n = scp->ysize;
bcopyw(scp->scr_buf + (scp->xsize * n),
bcopy(scp->scr_buf + (scp->xsize * n),
scp->scr_buf,
scp->xsize * (scp->ysize - n) * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
@ -1990,7 +1988,7 @@ scan_esc(scr_stat *scp, u_char c)
n = scp->term.param[0]; if (n < 1) n = 1;
if (n > scp->ysize)
n = scp->ysize;
bcopyw(scp->scr_buf,
bcopy(scp->scr_buf,
scp->scr_buf + (scp->xsize * n),
scp->xsize * (scp->ysize - n) *
sizeof(u_short));
@ -2360,14 +2358,14 @@ ansi_put(scr_stat *scp, u_char *buf, int len)
if (scp->cursor_pos >= scp->scr_buf + scp->ysize * scp->xsize) {
remove_cutmarking(scp);
if (scp->history) {
bcopyw(scp->scr_buf, scp->history_head,
bcopy(scp->scr_buf, scp->history_head,
scp->xsize * sizeof(u_short));
scp->history_head += scp->xsize;
if (scp->history_head + scp->xsize >
scp->history + scp->history_size)
scp->history_head = scp->history;
}
bcopyw(scp->scr_buf + scp->xsize, scp->scr_buf,
bcopy(scp->scr_buf + scp->xsize, scp->scr_buf,
scp->xsize * (scp->ysize - 1) * sizeof(u_short));
fillw(scp->term.cur_color | scr_map[0x20],
scp->scr_buf + scp->xsize * (scp->ysize - 1),
@ -2602,7 +2600,7 @@ history_to_screen(scr_stat *scp)
int i;
for (i=0; i<scp->ysize; i++)
bcopyw(scp->history + (((scp->history_pos - scp->history) +
bcopy(scp->history + (((scp->history_pos - scp->history) +
scp->history_size-((i+1)*scp->xsize))%scp->history_size),
scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)),
scp->xsize * sizeof(u_short));
@ -2784,7 +2782,7 @@ scgetc(u_int flags)
/* copy screen into top of history buffer */
for (i=0; i<cur_console->ysize; i++) {
bcopyw(cur_console->scr_buf + (cur_console->xsize * i),
bcopy(cur_console->scr_buf + (cur_console->xsize * i),
cur_console->history_head,
cur_console->xsize * sizeof(u_short));
cur_console->history_head += cur_console->xsize;
@ -2966,7 +2964,7 @@ scgetc(u_int flags)
u_short *ptr = cur_console->history_save;
for (i=0; i<cur_console->ysize; i++) {
bcopyw(ptr,
bcopy(ptr,
cur_console->scr_buf +
(cur_console->xsize*i),
cur_console->xsize * sizeof(u_short));
@ -3201,22 +3199,22 @@ set_mode(scr_stat *scp)
/* setup video hardware for the given mode */
switch (scp->mode) {
case M_VGA_M80x60:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x60;
case M_VGA_C80x60:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x60:
special_modetable[2] = 0x08;
special_modetable[19] = 0x47;
goto special_480l;
case M_VGA_M80x30:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x30;
case M_VGA_C80x30:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x30:
special_modetable[19] = 0x4f;
special_480l:
@ -3231,21 +3229,21 @@ set_mode(scr_stat *scp)
goto setup_mode;
case M_ENH_B80x43:
bcopyw(video_mode_ptr+(64*M_ENH_B80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_ENH_B80x25), &special_modetable, 64);
goto special_80x43;
case M_ENH_C80x43:
bcopyw(video_mode_ptr+(64*M_ENH_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_ENH_C80x25), &special_modetable, 64);
special_80x43:
special_modetable[28] = 87;
goto special_80x50;
case M_VGA_M80x50:
bcopyw(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_M80x25), &special_modetable, 64);
goto special_80x50;
case M_VGA_C80x50:
bcopyw(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
bcopy(video_mode_ptr+(64*M_VGA_C80x25), &special_modetable, 64);
special_80x50:
special_modetable[2] = 8;
special_modetable[19] = 7;
@ -3596,19 +3594,19 @@ set_destructive_cursor(scr_stat *scp)
if (scp->status & MOUSE_VISIBLE) {
if ((scp->cursor_saveunder & 0xff) == 0xd0)
bcopyw(&scp->mouse_cursor[0], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[0], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd1)
bcopyw(&scp->mouse_cursor[32], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[32], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd2)
bcopyw(&scp->mouse_cursor[64], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[64], cursor, scp->font_size);
else if ((scp->cursor_saveunder & 0xff) == 0xd3)
bcopyw(&scp->mouse_cursor[96], cursor, scp->font_size);
bcopy(&scp->mouse_cursor[96], cursor, scp->font_size);
else
bcopyw(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
bcopy(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
cursor, scp->font_size);
}
else
bcopyw(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
bcopy(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
cursor, scp->font_size);
for (i=0; i<32; i++)
if ((i >= scp->cursor_start && i <= scp->cursor_end) ||
@ -3745,13 +3743,13 @@ draw_mouse_image(scr_stat *scp)
yoffset = scp->mouse_ypos % font_size;
/* prepare mousepointer char's bitmaps */
bcopyw(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
&scp->mouse_cursor[0], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
&scp->mouse_cursor[32], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
&scp->mouse_cursor[64], font_size);
bcopyw(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
&scp->mouse_cursor[96], font_size);
for (i=0; i<font_size; i++) {
buffer[i] = scp->mouse_cursor[i]<<8 | scp->mouse_cursor[i+32];