mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-06 07:38:05 -04:00
more wip SVP code
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@318 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
f53f286a8b
commit
f8ef8ff710
13 changed files with 399 additions and 24 deletions
|
@ -1,7 +1,51 @@
|
|||
#include "../../PicoInt.h"
|
||||
|
||||
svp_t *svp = NULL;
|
||||
|
||||
void PicoSVPInit(void)
|
||||
{
|
||||
elprintf(0xffff, "SVP");
|
||||
void *tmp;
|
||||
|
||||
elprintf(0xffff, "SVP init");
|
||||
|
||||
tmp = realloc(Pico.rom, 0x200000 + sizeof(*svp));
|
||||
if (tmp == NULL)
|
||||
{
|
||||
elprintf(EL_STATUS, "OOM for SVP data");
|
||||
return;
|
||||
}
|
||||
|
||||
Pico.rom = tmp;
|
||||
svp = (void *) ((char *)tmp + 0x200000);
|
||||
memset(svp, 0, sizeof(*svp));
|
||||
|
||||
// init ok, setup hooks..
|
||||
PicoRead16Hook = PicoSVPRead16;
|
||||
PicoWrite8Hook = PicoSVPWrite8;
|
||||
PicoWrite16Hook = PicoSVPWrite16;
|
||||
PicoDmaHook = PicoSVPDma;
|
||||
}
|
||||
|
||||
|
||||
void PicoSVPReset(void)
|
||||
{
|
||||
elprintf(0xffff, "SVP reset");
|
||||
|
||||
ssp1601_reset(&svp->ssp1601);
|
||||
}
|
||||
|
||||
|
||||
int PicoSVPDma(unsigned int source, unsigned short **srcp, unsigned short **limitp)
|
||||
{
|
||||
if ((source & 0xfe0000) == 0x300000)
|
||||
{
|
||||
elprintf(EL_VDPDMA|0xffff, "SVP DmaSlow from %06x", source);
|
||||
source &= 0x1fffe;
|
||||
*srcp = (unsigned short *)(svp->ram + source);
|
||||
*limitp = (unsigned short *)(svp->ram + sizeof(svp->ram));
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue