Thanks Cyrille! I hope you can find a fix or remedy! I think it's really an excellent calculator in a class of its own, but the flickering is very difficult to deal with.
- Added a WARNING for people with EPILEPSY. I just found out online that this kind of flickering could potentially trigger a seizure in certain people (~3% epileptics).
- I numbered the test cases and added a few new ones.
- I find it interesting that Test "T8" doesn't appear to flicker (single interleaved pixel) but that "T9" definitely flickers (Double/Triple/Quadruple interleaved pixels).
Code:
EXPORT ScreenTest()
BEGIN
RECT();
TEXTOUT_P("WARNING", 130, 48);
TEXTOUT_P("DO NOT VIEW THIS TEST IF YOU ARE", 30, 48+32);
TEXTOUT_P("EPILEPTIC", 130, 48+80);
TEXTOUT_P("THE FLICKERING MAY TRIGGER A SEIZURE", 10, 48+128);
WAIT(-1);
// Multiple Horizantal Lines in Light Blue + White
RECT();
C:=RGB(200,200,255);
FOR Y FROM 0 TO 239 STEP 2 DO
LINE_P(0,Y,320,Y,C);
END;
TEXTOUT_P("T1: Flicker", 140, 110);
WAIT(-1);
// Multiple Horizontal Lines in Light+Darker Blue
RECT();
C:=RGB(100,100,200);
FOR Y FROM 0 TO 239 STEP 2 DO
LINE_P(0,Y,320,Y,C);
END;
C:=RGB(200,200,255);
FOR Y FROM 1 TO 239 STEP 2 DO
LINE_P(0,Y,320,Y,C);
END;
TEXTOUT_P("T2: Flicker", 140, 110);
WAIT(-1);
// Single Horiz Line
C:=#DDDDDDh;
RECT();
LINE_P(0,120,320,120,C);
TEXTOUT_P("T3: Line Flickers", 20, 180);
WAIT(-1);
// Graph Example
C:=#DDDDDDh;
C:=RGB(192,192,192);
RECT();
FOR Y FROM 0 TO 239 STEP 5 DO
LINE_P(0,Y,320,Y,C);
END;
FOR X FROM 0 TO 319 STEP 5 DO
LINE_P(X,0,X,240,C);
END;
LINE_P(0,120,320,120,0);
LINE_P(160,0,160,240,0);
TEXTOUT_P("T4: Grid Flickers", 20, 180);
WAIT(-1);
// Multiple Horizontal Lines in Fully Saturated Blue
RECT();
C:=RGB(0,0,255);
FOR Y FROM 0 TO 239 STEP 2 DO
LINE_P(0,Y,320,Y,C);
END;
TEXTOUT_P("T5: No Flicker", 130, 110);
WAIT(-1);
// Solid Light Blue
C:=RGB(200,200,255);
RECT();
FOR Y FROM 0 TO 239 STEP 1 DO
LINE_P(0,Y,320,Y,C);
END;
TEXTOUT_P("T6: No Flicker", 130, 110);
WAIT(-1);
// Split Screen
RECT();
FOR Y FROM 0 TO 239 STEP 2 DO
LINE_P(0,Y,160,Y,C);
LINE_P(161,Y,319,Y,#000000);
END;
TEXTOUT_P("T7: Flicker", 40, 110);
TEXTOUT_P("T7: No Flicker", 200, 110);
WAIT(-1);
// White pixels surrounded by Blue
// BBBBBBB
// B B B B
// BBBBBBB
// B B B B
// BBBBBBB
C:=RGB(200,200,255);
RECT();
FOR X FROM 0 TO 319 STEP 2 DO
LINE_P(X,0,X,240,C);
END;
FOR Y FROM 0 TO 239 STEP 2 DO
LINE_P(0,Y,320,Y,C);
END;
TEXTOUT_P("T7: Flicker", 140, 110);
WAIT(-1);
// White/Blue Pixels (Diagonal Lines)
// B B B
// B B B B
// B B B
RECT();
C:=#DDDDDDh;
C:=RGB(200,200,255);
FOR Y FROM 0 TO 239 STEP 1 DO
IF even(Y) THEN X0:=0; ELSE X0:=1; END;
FOR X FROM X0 TO 319 STEP 2 DO
PIXON_P(X,Y,C);
END;
END;
TEXTOUT_P("T8: No Flicker", 130, 110);
WAIT(-1);
// White/Blue Pixels (Increasing Spacing)
// BB BB BB
// BB BB
// BB BB BB
RECT();
C:=RGB(200,200,255);
FOR Y FROM 0 TO 239 STEP 1 DO
IF even(Y) THEN X0:=0; ELSE X0:=1; END;
FOR X FROM (0+X0) TO 80 STEP 2 DO
PIXON_P(X,Y,C);
END;
IF even(Y) THEN X0:=0; ELSE X0:=2; END;
FOR X FROM (80+X0) TO 159 STEP 4 DO
PIXON_P(X,Y,C);
PIXON_P(X+1,Y,C);
END;
IF even(Y) THEN X0:=0; ELSE X0:=3; END;
FOR X FROM (160+X0) TO 239 STEP 6 DO
PIXON_P(X,Y,C);
PIXON_P(X+1,Y,C);
PIXON_P(X+2,Y,C);
END;
IF even(Y) THEN X0:=0; ELSE X0:=4; END;
FOR X FROM (240+X0) TO 319 STEP 8 DO
PIXON_P(X,Y,C);
PIXON_P(X+1,Y,C);
PIXON_P(X+2,Y,C);
PIXON_P(X+3,Y,C);
END;
END;
TEXTOUT_P("T9: 3 of 4 Flicker", 0, 0);
WAIT(-1);
// White/Blue Pixels (Increasing Spacing)
// BB BB BB
// BB BB
// BB BB BB
RECT();
C:=RGB(0,0,0);
FOR Y FROM 0 TO 239 STEP 1 DO
IF even(Y) THEN X0:=0; ELSE X0:=1; END;
FOR X FROM (0+X0) TO 80 STEP 2 DO
PIXON_P(X,Y,C);
END;
IF even(Y) THEN X0:=0; ELSE X0:=2; END;
FOR X FROM (80+X0) TO 159 STEP 4 DO
PIXON_P(X,Y,C);
PIXON_P(X+1,Y,C);
END;
IF even(Y) THEN X0:=0; ELSE X0:=3; END;
FOR X FROM (160+X0) TO 239 STEP 6 DO
PIXON_P(X,Y,C);
PIXON_P(X+1,Y,C);
PIXON_P(X+2,Y,C);
END;
IF even(Y) THEN X0:=0; ELSE X0:=4; END;
FOR X FROM (240+X0) TO 319 STEP 8 DO
PIXON_P(X,Y,C);
PIXON_P(X+1,Y,C);
PIXON_P(X+2,Y,C);
PIXON_P(X+3,Y,C);
END;
END;
TEXTOUT_P("T10: No Flicker", 0, 0);
WAIT(-1);
// Color Comparison
RECT();
Y:=20;
LINE_P(0,Y,320,Y,#DDDDDDh); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(192,192,192)); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(128,128,128)); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(64,64,64)); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(0,0,0)); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(100,100,200)); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(192,192,192)); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(255,200,200)); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(200,255,200)); Y:=Y+10;
LINE_P(0,Y,320,Y,RGB(200,200,255)); Y:=Y+10;
TEXTOUT_P("T11: Some Lines Flicker", 20, 220);
WAIT(-1);
// Spacing Comparison
RECT();
C:=RGB(192,192,192);
Y:=20;
FOR I FROM 0 TO 9 DO
FOR N FROM 0 TO I DO
LINE_P(0,Y+N,320,Y+N,C);
END;
Y:=Y+10;
END;
LINE_P(0,179,320,179,0);
FOR Y FROM 180 TO 240 DO
LINE_P(0,Y,320,Y,C);
END;
TEXTOUT_P("T12: Some Flicker", 20, 140);
WAIT(-1);
// 2 Grey + 1 White
RECT();
C:=RGB(192,192,192);
FOR Y FROM 0 TO 239 STEP 3 DO
LINE_P(0,Y,320,Y,C);
LINE_P(0,Y+1,320,Y+1,C);
END;
TEXTOUT_P("T13: Flicker", 0, 0);
WAIT(-1);
// 2 Grey + 2 White
RECT();
C:=RGB(192,192,192);
FOR Y FROM 0 TO 239 STEP 4 DO
LINE_P(0,Y,320,Y,C);
LINE_P(0,Y+1,320,Y+1,C);
END;
TEXTOUT_P("T14: Light Flicker?", 0, 0);
WAIT(-1);
// 3 Grey + 1 White
RECT();
C:=RGB(192,192,192);
FOR Y FROM 0 TO 239 STEP 4 DO
LINE_P(0,Y,320,Y,C);
LINE_P(0,Y+1,320,Y+1,C);
LINE_P(0,Y+2,320,Y+2,C);
END;
TEXTOUT_P("T15: Flicker", 0, 0);
WAIT(-1);
// Some Color Tests
RECT();
A:=RGB(64,64,64);
B:=RGB(96,96,96);
C:=RGB(128,128,128);
D:=RGB(160,160,160);
FOR Y FROM 0 TO 239 STEP 2 DO
LINE_P(0, Y, 79,Y, A);
LINE_P(80, Y,159,Y, B);
LINE_P(160,Y,239,Y, C);
LINE_P(240,Y,319,Y, D);
END;
TEXTOUT_P("T18: Flicker", 0, 0);
WAIT(-1);
// Dark Grey Test
RECT();
C:=RGB(64,64,64);
FOR Y FROM 0 TO 239 STEP 4 DO
LINE_P(0,Y,320,Y,C);
END;
TEXTOUT_P("T19: Light Flicker", 0, 0);
WAIT(-1);
RECT();
TEXTOUT_P("Test Finished", 120, 110);
FREEZE;
END;