megadrive_test2

view src/vdp.c @ 5:ea70f3da150f

color cycling tunnel
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 20 Jun 2017 06:08:58 +0300
parents ce1b05082ac4
children
line source
1 #include "vdp.h"
3 void vdp_init(void)
4 {
5 int i;
7 vdp_setreg(VDP_REG_MODE1, VDP_MODE1_BASE);
8 vdp_setreg(VDP_REG_MODE2, VDP_MODE2_BASE | VDP_MODE2_DISP);
10 vdp_set_nametab_addr(VDP_PLANE_A, 0xc000);
11 vdp_set_nametab_addr(VDP_PLANE_B, 0xe000);
12 vdp_disable_layer(VDP_PLANE_WIN);
13 vdp_set_scroll_table(0xd000);
14 vdp_set_sprite_table(0xd400);
16 vdp_setreg(VDP_REG_MODE3, VDP_MODE3_BASE);
17 vdp_setreg(VDP_REG_MODE4, VDP_MODE4_BASE | VDP_MODE4_H40CELL);
18 vdp_setreg(VDP_REG_SCROLL_SIZE, VDP_SCROLL_H64 | VDP_SCROLL_V32);
20 vdp_set_autoinc(2);
21 vdp_set_bgcolor(0, 0);
23 vdp_setreg(VDP_REG_HINTR, 0);
24 vdp_setreg(VDP_REG_WIN_XPOS, 0);
25 vdp_setreg(VDP_REG_WIN_YPOS, 0);
27 /* clear vmem at the planes A/B name tables, scroll table, and sprite table */
28 vdp_setup_access(0xd000, VDP_MEM_WRITE, VDP_MEM_VRAM);
29 for(i=0xd000; i<65536; i++) {
30 VDP_PORT_DATA = 0;
31 }
32 }