32x: drc: dynamicregister allocator
[picodrive.git] / pico / carthw / svp / svp.c
index 6248120..76904ae 100644 (file)
@@ -7,6 +7,7 @@
 
 
 #include "../../pico_int.h"
+#include "../../cpu/drc/cmn.h"
 #include "compiler.h"
 
 svp_t *svp = NULL;
@@ -97,6 +98,18 @@ static int PicoSVPDma(unsigned int source, int len, unsigned short **srcp, unsig
 
 void PicoSVPInit(void)
 {
+#ifndef PSP
+       // this is to unmap tcache and make
+       // mem available for large ROMs, MCD, etc.
+       drc_cmn_cleanup();
+#endif
+}
+
+static void PicoSVPExit(void)
+{
+#ifndef PSP
+       ssp1601_dyn_exit();
+#endif
 }
 
 
@@ -133,6 +146,7 @@ void PicoSVPStartup(void)
        PicoDmaHook = PicoSVPDma;
        PicoResetHook = PicoSVPReset;
        PicoLineHook = PicoSVPLine;
+       PicoCartUnloadHook = PicoSVPExit;
 
        // save state stuff
        svp_states[0].ptr = svp->iram_rom;