Skip to content
Snippets Groups Projects
Commit 7ae2f1b1 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Add C64/C128 blinking... 1.5Hz

Blinking text is opposite of the cursor
parent 0524805a
Branches
Tags
No related merge requests found
Pipeline #7948 failed
......@@ -981,7 +981,6 @@ static void blinker_thread(void *data)
struct bitmap_screen *ncscreen;
int lfc;
int blink;
bool prestel;
SetThreadName("Blinker");
while(1) {
......@@ -992,52 +991,72 @@ static void blinker_thread(void *data)
assert_rwlock_wrlock(&vstatlock);
prestel = vstat.mode == PRESTEL_40X24;
if (prestel) {
if (next_blink < now) {
if (vstat.blink) {
vstat.blink=FALSE;
next_blink = now + 1000;
}
else {
vstat.blink=TRUE;
next_blink = now + 333;
}
blink_changed = 1;
}
if (next_cursor < now) {
curs_changed = cursor_visible_locked();
if (vstat.curs_blink) {
vstat.curs_blink=FALSE;
}
else {
vstat.curs_blink=TRUE;
switch (vstat.mode) {
case PRESTEL_40X24:
if (next_blink < now) {
if (vstat.blink) {
vstat.blink=FALSE;
next_blink = now + 1000;
}
else {
vstat.blink=TRUE;
next_blink = now + 333;
}
blink_changed = 1;
}
curs_changed = (curs_changed != cursor_visible_locked());
next_cursor = now + 320;
}
}
else {
if (next_blink < now) {
if (vstat.blink) {
vstat.blink=FALSE;
if (next_cursor < now) {
curs_changed = cursor_visible_locked();
if (vstat.curs_blink) {
vstat.curs_blink=FALSE;
}
else {
vstat.curs_blink=TRUE;
}
curs_changed = (curs_changed != cursor_visible_locked());
next_cursor = now + 320;
}
else {
vstat.blink=TRUE;
break;
case C64_40X25:
case C128_40X25:
case C128_80X25:
if (next_cursor < now) {
curs_changed = cursor_visible_locked();
if (vstat.curs_blink) {
vstat.curs_blink=FALSE;
vstat.blink=TRUE;
}
else {
vstat.curs_blink=TRUE;
vstat.blink=FALSE;
}
blink_changed = 1;
curs_changed = (curs_changed != cursor_visible_locked());
next_cursor = now + 333;
}
next_blink = now + 266;
blink_changed = 1;
}
if (next_cursor < now) {
curs_changed = cursor_visible_locked();
if (vstat.curs_blink) {
vstat.curs_blink=FALSE;
break;
default:
if (next_blink < now) {
if (vstat.blink) {
vstat.blink=FALSE;
}
else {
vstat.blink=TRUE;
}
next_blink = now + 266;
blink_changed = 1;
}
else {
vstat.curs_blink=TRUE;
if (next_cursor < now) {
curs_changed = cursor_visible_locked();
if (vstat.curs_blink) {
vstat.curs_blink=FALSE;
}
else {
vstat.curs_blink=TRUE;
}
curs_changed = (curs_changed != cursor_visible_locked());
next_cursor = now + 133;
}
curs_changed = (curs_changed != cursor_visible_locked());
next_cursor = now + 133;
}
break;
}
lfc = force_cursor;
force_cursor = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment