Date: Sun, 8 Sep 1996 11:36:16 +0400 (????) From: Alexey Pialkin <pialkin@pdmi.ras.ru> To: emulation@freebsd.org Subject: Small patch for Non X yusers Message-ID: <199609080736.LAA26282@gauss.pdmi.ras.ru>
next in thread | raw e-mail | index | archive | help
Hi !
This is a small patch for compiling doscmd without X support.
(this patch doesn't able to support BIOS calls for fullscreen drawing)
diff -cr old/Makefile doscmd/Makefile
*** old/Makefile Sun Sep 1 04:35:45 1996
--- doscmd/Makefile Sun Sep 8 10:46:03 1996
***************
*** 15,23 ****
################################################################################
# For FreeBSD
! CFLAGS+=-I/usr/X11R6/include -DDISASSEMBLER -g
LDFLAGS+=-L/usr/X11R6/lib
! LDADD+= -lX11 -lgcc -lc -lgcc
DPADD+=/usr/X11R6/lib/libX11.a ${LIBC}
################################################################################
--- 15,25 ----
################################################################################
# For FreeBSD
! # NO_X - compile without X support
! CFLAGS+=-I/usr/X11R6/include -DDISASSEMBLER -g -DNO_X
LDFLAGS+=-L/usr/X11R6/lib
! #without X11
! LDADD+= -lgcc -lc -lgcc
DPADD+=/usr/X11R6/lib/libX11.a ${LIBC}
################################################################################
Binary files old/doscmd and doscmd/doscmd differ
diff -cr old/doscmd.c doscmd/doscmd.c
*** old/doscmd.c Sun Sep 1 04:44:01 1996
--- doscmd/doscmd.c Sun Sep 8 10:47:56 1996
***************
*** 137,144 ****
debug_set(0); /* debug any D_TRAPS without intnum */
while ((c = getopt (argc, argv, "234Oc:IEMPRLAU:S:HDtzvVxXfbri:o:d:")) != -1) {
! switch (c) {
case 'd':
if (fp = fopen(optarg, "w")) {
debugf = fp;
--- 137,148 ----
debug_set(0); /* debug any D_TRAPS without intnum */
+ #ifndef NO_X
while ((c = getopt (argc, argv, "234Oc:IEMPRLAU:S:HDtzvVxXfbri:o:d:")) != -1) {
! #else
! while ((c = getopt (argc, argv, "234Oc:IEMPRLAU:S:HDtzvVXfbri:o:d:")) != -1) {
! #endif
! switch (c) {
case 'd':
if (fp = fopen(optarg, "w")) {
debugf = fp;
Binary files old/doscmd.kernel and doscmd/doscmd.kernel differ
Binary files old/doscmd.o and doscmd/doscmd.o differ
diff -cr old/tty.c doscmd/tty.c
*** old/tty.c Sun Sep 1 04:35:46 1996
--- doscmd/tty.c Sun Sep 8 10:51:55 1996
***************
*** 30,38 ****
* BSDI tty.c,v 2.4 1996/04/08 22:03:27 prb Exp
*/
! #include <X11/Xlib.h>
! #include <X11/Xutil.h>
! #include <X11/keysym.h>
#include <stdio.h>
#include <termios.h>
#include <limits.h>
--- 30,41 ----
* BSDI tty.c,v 2.4 1996/04/08 22:03:27 prb Exp
*/
! #ifndef NO_X
! #include <X11/Xlib.h>
! #include <X11/Xutil.h>
! #include <X11/keysym.h>
! #endif
!
#include <stdio.h>
#include <termios.h>
#include <limits.h>
***************
*** 68,76 ****
static u_short break_code = 0x00;
static u_short scan_code = 0x00;
! static Display *dpy = 0;
! static Window win;
! static XFontStruct *font;
static unsigned long black;
static unsigned long white;
static unsigned long pixels[16];
--- 71,82 ----
static u_short break_code = 0x00;
static u_short scan_code = 0x00;
! #ifndef NO_X
! static Display *dpy = 0;
! static Window win;
! static XFontStruct *font;
! #endif
!
static unsigned long black;
static unsigned long white;
static unsigned long pixels[16];
***************
*** 94,101 ****
};
static int FW, FH, FD;
! static GC gc;
! static GC cgc;
static int xfd;
int kbd_fd = -1;
int kbd_read = 0;
--- 100,109 ----
};
static int FW, FH, FD;
! #ifndef NO_X
! static GC gc;
! static GC cgc;
! #endif
static int xfd;
int kbd_fd = -1;
int kbd_read = 0;
***************
*** 136,142 ****
#define video_pate BISODATA[0x62]
! #define IBMFONT "ibmpc"
char *xfont = 0;
--- 144,150 ----
#define video_pate BISODATA[0x62]
! #define IBMFONT "fixed"
char *xfont = 0;
***************
*** 352,359 ****
--- 360,369 ----
video_setborder(int color)
{
_BlockIO();
+ #ifndef NO_X
XSetWindowBackground(dpy, win, pixels[color & 0xf]);
_UnblockIO();
+ #endif
}
void
video_blink(int mode)
***************
*** 365,370 ****
--- 375,381 ----
setgc(u_short attr)
{
+ #ifndef NO_X
XGCValues v;
if (blink && !show && (attr & 0x8000))
v.foreground = pixels[(attr >> 12) & 0x07];
***************
*** 379,389 ****
--- 390,402 ----
}
#endif
XChangeGC(dpy, gc, GCForeground|GCBackground, &v);
+ #endif
}
void
video_update(struct sigcontext *sc)
{
+ #ifndef NO_X
static int or = -1;
static int oc = -1;
***************
*** 516,521 ****
--- 529,535 ----
BIOSDATA[0x70]++; /* BIOSDATA[0x70] # times past mn */
}
}
+ #endif
}
static u_short Ascii2Scan[] = {
***************
*** 732,739 ****
--- 746,755 ----
}
KbdWrite(ScanCodes[28].base);
} else if (!strcasecmp(av[0], "bell")) {
+ #ifndef NO_X
XBell(dpy, 0);
XFlush(dpy);
+ #endif
} else {
fprintf(stderr, "%s: unknown command\n", av[0]);
}
***************
*** 958,963 ****
--- 974,980 ----
{
int int09 = 0;
+ #ifndef NO_X
for (;;) {
int x;
fd_set fdset;
***************
*** 988,994 ****
--- 1005,1013 ----
perror("select");
return;
case 0:
+ #ifndef NO_X
XFlush(dpy);
+ #endif
if (int09)
hardint(0x09);
return;
***************
*** 1002,1007 ****
--- 1021,1027 ----
break;
}
}
+ #endif
}
void
***************
*** 1098,1103 ****
--- 1118,1124 ----
#endif
}
+ #ifndef NO_X
int
video_event(XEvent *ev)
{
***************
*** 1457,1462 ****
--- 1478,1484 ----
}
return(0);
}
+ #endif
#define R03D4 BIOSDATA[0x65]
static u_char R03BA = 0;
***************
*** 1578,1584 ****
--- 1600,1608 ----
switch (c) {
case 0x07:
if (xmode) {
+ #ifndef NO_X
XBell(dpy, 0);
+ #endif
} else
write(1, "\007", 1);
break;
***************
*** 1873,1879 ****
--- 1897,1905 ----
int klen = K_BUFEND - K_BUFSTART;
int kf = (K_FREE + 1) % klen;
if (kf == K_NEXT) {
+ #ifndef NO_X
XBell(dpy, 0);
+ #endif
return;
}
K_BUFSTART[K_FREE] = code;
***************
*** 1907,1915 ****
--- 1933,1943 ----
video_init()
{
u_long vec;
+ #ifndef NO_X
XSizeHints sh;
XGCValues gcv;
XColor ccd, rgb;
+ #endif
unsigned long mask;
int level;
int i, j;
***************
*** 1954,1959 ****
--- 1982,1989 ----
if (!xmode)
return;
+ #ifndef NO_X
+
if (!(lines = (TextLine *)malloc(sizeof(TextLine) * height))) {
fprintf(stderr, "Could not allocate data structure for text lines\n");
quit(1);
***************
*** 2085,2090 ****
--- 2115,2121 ----
XFlush(dpy);
_UnblockIO();
+ #endif
}
void
Alexey Pialkin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609080736.LAA26282>
