Bring back darwin hosted port to live, might also work for android hosted but is...
[AROS.git] / test / exec / vblank.c
blob718998a2bc08b55bfb51fa8f8899d47d74df500d
1 #include <aros/asmcall.h>
2 #include <exec/interrupts.h>
3 #include <hardware/intbits.h>
5 #include <proto/dos.h>
6 #include <proto/exec.h>
8 int __nocommandline = 1;
10 static int counter = 0;
12 AROS_UFH4(static ULONG, vblank_handler,
13 AROS_UFHA(APTR, unused, A0),
14 AROS_UFHA(APTR, mydata, A1),
15 AROS_UFHA(APTR, self, A5),
16 AROS_UFHA(struct ExecBase *, SysBase, A6))
18 AROS_USERFUNC_INIT
20 counter++;
21 return 0;
23 AROS_USERFUNC_EXIT
27 static struct Interrupt vblank_int =
29 .is_Code = (APTR)vblank_handler
32 int main(void)
34 AddIntServer(INTB_VERTB, &vblank_int);
36 while (!(CheckSignal(SIGBREAKF_CTRL_C)))
38 Printf("\rVBlank counter: %lu ", counter);
41 RemIntServer(INTB_VERTB, &vblank_int);
43 Printf("\nTerminated\n");
45 return 0;