#include <math.h>
#include "screenhackI.h"
#include "analogterm.h"
+#include <stdbool.h>
#ifdef HAVE_XSHM_EXTENSION
#include "xshm.h"
*mptr = st->mode & TMODE_BGCOLOR;
}
+bool cursor_waitnext = true;
+bool cursor_laststate = false;
+
+void
+at_drawcursor(analogterm_sim_t *sim)
+{
+ analogterm_state_t *st = sim->st;
+ int x, y;
+ signed char *pp;
+
+ if (st->blink && !cursor_waitnext)
+ return;
+ if (cursor_waitnext) {
+ if (cursor_laststate != st->blink)
+ cursor_waitnext = false;
+ }
+ cursor_laststate = st->blink;
+
+ for (y = 0; y < 8; y++) {
+ pp = &sim->inp->signal[(ANALOGTV_TOP + 3) + (8 * st->cursy) + y]
+ [(ANALOGTV_PIC_START + 100) + (7 * st->cursx)];
+ for (x = 0; x < 8; x++)
+ *pp++ ^= 64/*TMODE_NORMAL_LEVEL*/;
+ }
+}
+
+void
+at_resetcursor(void)
+{
+
+ cursor_waitnext = true;
+}
+
+#ifdef PULSECURSOR
static signed char cursorstate = 127;
static int cursorstate_timer = 1, cursorstate_add = -1;
void
/* Line cursor */
/*
- pp = &sim->inp->signal[(ANALOGTV_TOP+3) + (8 * st->cursy) + 7]
- [(ANALOGTV_PIC_START+100) + (7 * st->cursx)];
+ pp = &sim->inp->signal[(ANALOGTV_TOP + 3) + (8 * st->cursy) + 7]
+ [(ANALOGTV_PIC_START + 100) + (7 * st->cursx)];
for (x = 0; x < 8; x++) {
*pp++ ^= cursorstate;
if (--cursorstate_timer == 0) {
* - Blinking speed should rely on a configurable timer
*/
for (y = 0; y < 8; y++) {
- pp = &sim->inp->signal[(ANALOGTV_TOP+3) + (8 * st->cursy) + y]
- [(ANALOGTV_PIC_START+100) + (7 * st->cursx)];
+ pp = &sim->inp->signal[(ANALOGTV_TOP + 3) + (8 * st->cursy) + y]
+ [(ANALOGTV_PIC_START + 100) + (7 * st->cursx)];
for (x = 0; x < 8; x++) {
*pp++ ^= cursorstate;
}
cursorstate = 127;
cursorstate_add = -1;
}
+#endif
/*
* Scroll page by offset (may be negative or positive) and takes in
st->blink=((int)blinkphase)&1;
#if 0
+ /*
+ * XXX It's unclear what this was supposed to do. The entry is
+ * conditional then only internal scope variables appear to be used,
+ * except for reading.
+ */
if (st->blink!=i && !(st->gr_mode&A2_GR_FULL)) {
int downcounter=0;
/* For every row with blinking text, set the changed flag. This basically