nuclear@0: #include "vdp.h" nuclear@0: nuclear@0: void vdp_init(void) nuclear@0: { nuclear@5: int i; nuclear@5: nuclear@0: vdp_setreg(VDP_REG_MODE1, VDP_MODE1_BASE); nuclear@0: vdp_setreg(VDP_REG_MODE2, VDP_MODE2_BASE | VDP_MODE2_DISP); nuclear@0: nuclear@5: vdp_set_nametab_addr(VDP_PLANE_A, 0xc000); nuclear@5: vdp_set_nametab_addr(VDP_PLANE_B, 0xe000); nuclear@5: vdp_disable_layer(VDP_PLANE_WIN); nuclear@5: vdp_set_scroll_table(0xd000); nuclear@5: vdp_set_sprite_table(0xd400); nuclear@5: nuclear@5: vdp_setreg(VDP_REG_MODE3, VDP_MODE3_BASE); nuclear@5: vdp_setreg(VDP_REG_MODE4, VDP_MODE4_BASE | VDP_MODE4_H40CELL); nuclear@5: vdp_setreg(VDP_REG_SCROLL_SIZE, VDP_SCROLL_H64 | VDP_SCROLL_V32); nuclear@5: nuclear@0: vdp_set_autoinc(2); nuclear@5: vdp_set_bgcolor(0, 0); nuclear@5: nuclear@5: vdp_setreg(VDP_REG_HINTR, 0); nuclear@5: vdp_setreg(VDP_REG_WIN_XPOS, 0); nuclear@5: vdp_setreg(VDP_REG_WIN_YPOS, 0); nuclear@5: nuclear@5: /* clear vmem at the planes A/B name tables, scroll table, and sprite table */ nuclear@5: vdp_setup_access(0xd000, VDP_MEM_WRITE, VDP_MEM_VRAM); nuclear@5: for(i=0xd000; i<65536; i++) { nuclear@5: VDP_PORT_DATA = 0; nuclear@5: } nuclear@0: }