megadrive_test2

view src/main.c @ 1:2560a8be8cb8

hblank interrupt test
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 14 Mar 2017 09:02:43 +0200
parents ce1b05082ac4
children 1d35c3b3a525
line source
1 #include <stdint.h>
2 #include "vdp.h"
4 int main(void)
5 {
6 vdp_init();
8 vdp_set_pal_entry(0, 0, 0, 0, 0);
9 vdp_set_pal_entry(0, 1, 7, 0, 3);
10 vdp_set_bgcolor(0, 1);
12 vdp_enable_hintr(12);
13 vdp_enable_vintr();
15 for(;;);
17 return 0;
18 }
20 uint16_t testcol = 0x00c0;
22 void hblank_handler(void)
23 {
24 vdp_set_pal_entry(0, 1, ~testcol, 0, testcol);
25 testcol = ~testcol;
26 }
28 void vblank_handler(void)
29 {
30 testcol = 0x00c0;
31 }