X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fjaguar.cpp;h=e1b95aa4dbdedbf13daef539bd3d4c07cab46fd8;hb=5d76d651dfc3aa0a2e810e6b6db2ae8a2e34c53e;hp=72802f518ce117b6895c2e9db4e2c0ff364083d3;hpb=9d399cea8466c7e4a6a1336dafdc830c4680d977;p=virtualjaguar diff --git a/src/jaguar.cpp b/src/jaguar.cpp index 72802f5..e1b95aa 100644 --- a/src/jaguar.cpp +++ b/src/jaguar.cpp @@ -16,6 +16,7 @@ #include "jaguar.h" +#include #include #include "SDL_opengl.h" #include "blitter.h" @@ -1758,12 +1759,19 @@ void JaguarSetScreenPitch(uint32_t pitch) // void JaguarInit(void) { + // For randomizing RAM + srand(time(NULL)); + + // Contents of local RAM are quasi-stable; we simulate this by randomizing RAM contents + for(uint32_t i=0; i<0x200000; i+=4) + *((uint32_t *)(&jaguarMainRAM[i])) = rand(); + #ifdef CPU_DEBUG_MEMORY memset(readMem, 0x00, 0x400000); memset(writeMemMin, 0xFF, 0x400000); memset(writeMemMax, 0x00, 0x400000); #endif - memset(jaguarMainRAM, 0x00, 0x200000); +// memset(jaguarMainRAM, 0x00, 0x200000); // memset(jaguar_mainRom, 0xFF, 0x200000); // & set it to all Fs... // memset(jaguar_mainRom, 0x00, 0x200000); // & set it to all 0s... //NOTE: This *doesn't* fix FlipOut... @@ -1784,11 +1792,16 @@ memset(jaguarMainRAM + 0x804, 0xFF, 4); CDROMInit(); } + //New timer based code stuffola... void HalflineCallback(void); void RenderCallback(void); void JaguarReset(void) { + // Contents of local RAM are quasi-stable; we simulate this by randomizing RAM contents + for(uint32_t i=0; i<0x200000; i+=4) + *((uint32_t *)(&jaguarMainRAM[i])) = rand(); + // New timer base code stuffola... InitializeEventList(); //Need to change this so it uses the single RAM space and load the BIOS @@ -1816,6 +1829,7 @@ void JaguarReset(void) SetCallbackTime(HalflineCallback, (vjs.hardwareTypeNTSC ? 31.777777777 : 32.0)); } + void JaguarDone(void) { #ifdef CPU_DEBUG_MEMORY