#define VPL_TRIAL_C
#include "vpl_data.c"
#define FIXTM mtt(1000)
#define BLTM mtt(0)
#define MAXTM mtt(0)
#define ITI mtt(500)
struct {
__int64 junk;
__int64 t1, e1;
__int64 t2, e2;
} rttmp;
void trial(int i)
{
int w = ts_textheight();
int h = ts_textlength("A");
char x[20];
char m[20];
int mpos;
if (data[i].slen == 5) {
sprintf(x, "XXXXX");
if (data[i].mask == SMALL) {
sprintf(m, "#######");
mpos = data[i].sloc;
} else {
sprintf(m, "###########");
mpos = 0;
}
} else {
sprintf(x, "XXXXXXX");
if (data[i].mask == SMALL) {
sprintf(m, "#########");
mpos = data[i].sloc;
} else {
sprintf(m, "###############");
mpos = 0;
}
}
ts_vsync(&rttmp.junk, &rttmp.junk);
ts_printf_centre(0, h, "|");
ts_printf_centre(0, -h, "|");
ts_wait(FIXTM);
ts_vsync(&rttmp.t1, &rttmp.e1);
ts_clrscr();
ts_printf_centre(data[i].sloc * w, 0, x);
ts_printf_centre(data[i].lloc * w, 0, "%c", data[i].target);
ts_vsyncs(&rttmp.junk, &rttmp.junk, data[i].stime);
ts_clrscr();
ts_printf_centre(mpos * w, 0, m);
data[i].r = ts_resp(&rttmp.t2, &rttmp.e2, MAXTM);
ts_clrscr();
data[i].rt = ttm(rttmp.t2 - rttmp.t1);
data[i].re = ttm(rttmp.e2 + rttmp.e1);
if (data[i].r == data[i].targetno)
data[i].corr = C;
else
data[i].corr = E;
if (data[i].r == 17) {
writedata();
ts_fatal("aborted by user");
}
ts_wait(ITI);
}
#ifndef VPL_EXP_C
int main()
{
ts_textmode(BLACK);
ts_defkey(KEY_B);
ts_defkey(KEY_C);
ts_defkey(KEY_D);
ts_defkey(KEY_F);
ts_defkey(KEY_H);
ts_defkey(KEY_G);
ts_defkey(KEY_J);
ts_defkey(KEY_K);
ts_defkey(KEY_L);
ts_defkey(KEY_M);
ts_defkey(KEY_N);
ts_defkey(KEY_P);
ts_defkey(KEY_R);
ts_defkey(KEY_S);
ts_defkey(KEY_T);
ts_defkey(KEY_SPACE);
ts_defkey(KEY_ESC);
randomize(0, 0);
int ntrials;
if (data[0].slen == FIVE)
ntrials = NTRIALSPRACT + NTRIALS5;
else
ntrials = NTRIALSPRACT + NTRIALS7;
int i;
for (i = 0; i < NTRIALSPRACT; i++) {
if (i < NTRIALSPRACT && i != 0 && i % CELLSPRACT == 0)
if (adjust_stime(i) == STOP)
break;
trial(i);
}
for (i = NTRIALSPRACT; i < ntrials; i++)
trial(i);
writedata();
return 0;
}
END_OF_MAIN();
#endif