Files
tms-c-compiler/scripts/m3/xhello.c
T

19 lines
457 B
C

#include "vt1200_xlib.h"
#define MARK(n) (*(volatile unsigned int *)(0x018A8000u + (n) * 0x20u))
int xhello(void) {
Display *d = XOpenDisplay("0::0");
MARK(0) = (unsigned int)d;
if (!d)
return -1;
unsigned int root = vt1200_root(d);
MARK(1) = root;
Window w = XCreateSimpleWindow(d, root, 100, 100, 400, 200, 2, 0, 1);
MARK(2) = (unsigned int)w;
XMapWindow(d, w);
int s = XSync(d, 0);
MARK(3) = (unsigned int)s;
return (int)w;
}