1 #include "../../PicoInt.h"
5 static void PicoSVPReset(void)
7 elprintf(EL_SVP, "SVP reset");
9 memcpy(svp->iram_rom + 0x800, Pico.rom + 0x800, 0x20000 - 0x800);
10 ssp1601_reset(&svp->ssp1601);
14 static void PicoSVPLine(void)
17 // OSC_NTSC / 3.0 / 60.0 / 262.0 ~= 1139
18 // OSC_PAL / 3.0 / 50.0 / 312.0 ~= 1137
22 //if (Pico.m.frame_count == 13) PicoPad[0] |= 0xff;
26 static int PicoSVPDma(unsigned int source, int len, unsigned short **srcp, unsigned short **limitp)
28 if ((source & 0xfe0000) == 0x300000)
30 elprintf(EL_VDPDMA|EL_SVP, "SVP DmaSlow from %06x, len=%i", source, len);
33 *srcp = (unsigned short *)(svp->dram + source);
34 *limitp = (unsigned short *)(svp->dram + sizeof(svp->dram));
38 elprintf(EL_VDPDMA|EL_SVP|EL_ANOMALY, "SVP FIXME unhandled DmaSlow from %06x, len=%i", source, len);
44 void PicoSVPInit(void)
48 elprintf(EL_SVP, "SVP init");
50 tmp = realloc(Pico.rom, 0x200000 + sizeof(*svp));
53 elprintf(EL_STATUS|EL_SVP, "OOM for SVP data");
58 svp = (void *) ((char *)tmp + 0x200000);
59 memset(svp, 0, sizeof(*svp));
61 // init ok, setup hooks..
62 PicoRead16Hook = PicoSVPRead16;
63 PicoWrite8Hook = PicoSVPWrite8;
64 PicoWrite16Hook = PicoSVPWrite16;
65 PicoDmaHook = PicoSVPDma;
66 PicoResetHook = PicoSVPReset;
67 PicoLineHook = PicoSVPLine;