megadrive_test1

view src/main.c @ 7:8253942b0a1a

in the middle of something
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 19 Feb 2017 14:00:26 +0200
parents 862f8a034cae
children
line source
1 #include "vdp.h"
3 static const unsigned char pal[][3] = {
4 {0, 0, 0}, {64, 128, 255}, {255, 128, 32}, {255, 255, 255}
5 };
7 static const unsigned char pat[8] = {
8 0, 0, 0, 0, /* 0 0 0 0 0 0 0 0 */
9 1, 0x11, 0x11, 0x11, /* 0 1 1 1 1 1 1 1 */
10 1, 0x11, 0x11, 0x11, /* 0 1 1 1 1 1 1 1 */
11 1, 0x11, 0x11, 0x12, /* 0 1 1 1 1 1 1 2 */
12 1, 0x11, 0x12, 0x22, /* 0 1 1 1 1 2 2 2 */
13 1, 0x11, 0x22, 0x22, /* 0 1 1 1 2 2 2 2 */
14 1, 0x11, 0x22, 0x22, /* 0 1 1 1 2 2 2 2 */
15 1, 0x12, 0x22, 0x22 /* 0 1 1 2 2 2 2 2 */
16 };
18 int main(void)
19 {
20 uint16_t *tmap;
22 vdp_init();
24 vdp_setpal(0, sizeof pal / sizeof *pal, (unsigned char*)pal);
25 VDP_SET_BGCOLOR(0, 0);
27 vdp_set_tilemap_slot(VDP_PLANE_A, 0);
28 tmap = vdp_tilemap_ptr(VDP_PLANE_A);
32 return 0;
33 }