megadrive_test1

annotate src/main.c @ 6:862f8a034cae

expanding the megadrive code
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 11 Feb 2017 08:56:42 +0200
parents f99eab59e7dc
children 8253942b0a1a
rev   line source
nuclear@4 1 #include "vdp.h"
nuclear@4 2
nuclear@6 3 static const unsigned char pal[][3] = {
nuclear@6 4 {0, 0, 0}, {64, 128, 255}, {255, 128, 32}, {255, 255, 255}
nuclear@6 5 };
nuclear@6 6
nuclear@6 7 static const unsigned char pat[8] = {
nuclear@6 8 0, 0, 0, 0, /* 0 0 0 0 0 0 0 0 */
nuclear@6 9 1, 0x11, 0x11, 0x11, /* 0 1 1 1 1 1 1 1 */
nuclear@6 10 1, 0x11, 0x11, 0x11, /* 0 1 1 1 1 1 1 1 */
nuclear@6 11 1, 0x11, 0x11, 0x12, /* 0 1 1 1 1 1 1 2 */
nuclear@6 12 1, 0x11, 0x12, 0x22, /* 0 1 1 1 1 2 2 2 */
nuclear@6 13 1, 0x11, 0x22, 0x22, /* 0 1 1 1 2 2 2 2 */
nuclear@6 14 1, 0x11, 0x22, 0x22, /* 0 1 1 1 2 2 2 2 */
nuclear@6 15 1, 0x12, 0x22, 0x22 /* 0 1 1 2 2 2 2 2 */
nuclear@6 16 };
nuclear@6 17
nuclear@4 18 int main(void)
nuclear@4 19 {
nuclear@6 20 unsigned char *tmap;
nuclear@6 21
nuclear@6 22 vdp_init();
nuclear@6 23
nuclear@6 24 vdp_setpal(0, sizeof pal / sizeof *pal, (unsigned char*)pal);
nuclear@5 25 VDP_SET_BGCOLOR(0, 0);
nuclear@6 26
nuclear@6 27 vdp_set_tilemap_slot(VDP_PLANE_A, 0);
nuclear@6 28 tmap = vdp_tilemap_ptr(VDP_PLANE_A);
nuclear@6 29
nuclear@6 30
nuclear@4 31 return 0;
nuclear@4 32 }