11 extern uint16_t simbabg_data[], simbabg_data_end[];
12 extern unsigned char simbabg_cmap[], simbabg_cmap_end[];
13 extern uint16_t simbabg_tmap[], simbabg_tmap_end[];
14 extern uint16_t simbafg_data[], simbafg_data_end[];
15 extern unsigned char simbafg_cmap[], simbafg_cmap_end[];
16 extern uint16_t simbafg_tmap[], simbafg_tmap_end[];
26 vdp_setup_addr(VDP_VRAM, BGTILES_OFFS * 32); /* start from tile 1 32 bytes on */
27 while(src < simbabg_data_end) {
32 vdp_setup_addr(VDP_VRAM, FGTILES_OFFS * 32);
33 while(src < simbafg_data_end) {
38 void simba_start(void)
46 vdp_setup_addr(VDP_VRAM, 0xc000); /* nametable A */
47 while(src < simbafg_tmap_end) {
48 VDP_DATA = VDP_TILENAME(*src++ + FGTILES_OFFS, 3, 0);
51 vdp_setup_addr(VDP_VRAM, 0xe000); /* nametable B */
52 while(src < simbabg_tmap_end) {
53 VDP_DATA = VDP_TILENAME(*src++ + BGTILES_OFFS, 2, 0);
59 vdp_setcolor(2, i, cptr[0] >> 4, cptr[1] >> 4, cptr[2] >> 4);
64 vdp_setcolor(3, i, cptr[0] >> 4, cptr[1] >> 4, cptr[2] >> 4);
68 /* set scrolling to whole screen */
69 vdp_setreg(VDP_REG_MODE3, 0);
73 void simba_update(void)
75 if(bnstate & PAD_LEFT) {
76 if(scroll > 256) scroll--;
77 } else if(bnstate & PAD_RIGHT) {
78 if(scroll < 704) scroll++;
83 void simba_vblank(void)
85 vdp_setup_addr(VDP_VRAM, 0xf000); /* hscroll table is at f000, see vdp.S */
89 VDP_DATA = 1024 - scroll;
91 VDP_DATA = 512 - (scroll >> 1);