Advertisement
BullyATWiiplaza

code.c

Feb 24th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.24 KB | None | 0 0
  1. #include "spider.h"
  2. #include "fs.h"
  3.  
  4. int uvl_entry()
  5. {
  6.     unsigned int startingAddress    = 0x14000000;
  7.     unsigned int dumpLength     = 0x4000000;
  8.    
  9.     performMemoryDump(startingAddress, dumpLength);
  10.  
  11.         return 0;
  12. }
  13.  
  14. performMemoryDump(unsigned int startingAddress, unsigned int dumpLength)
  15. {
  16.     unsigned int addr = startingAddress;
  17.     void *this = 0x08F10000;
  18.     int *written = 0x08F01000;
  19.     int *buf = 0x18410000;
  20.  
  21.     IFile_Open(this, L"dmc:/MemoryDump.bin", 6);
  22.     svcSleepThread(0x400000LL);
  23.  
  24.     for (; addr < startingAddress + dumpLength; addr += 0x10000)
  25.     {
  26.         // Dumps a 0x10000 bytes of ram to sd card
  27.         GSPGPU_FlushDataCache(addr, 0x10000);
  28.         GX_SetTextureCopy(addr, buf, 0x10000, 0, 0, 0, 0, 8);
  29.         GSPGPU_FlushDataCache(buf, 0x10000);
  30.         svcSleepThread(0x400000LL);
  31.         IFile_Write(this, written, buf, 0x10000);
  32.  
  33.         // Flashes mostly black screen on the bottom screen for a few frames, this is so I know the program is running and not frozen
  34.         GSPGPU_FlushDataCache(0x18000000, 0x00038400);
  35.         GX_SetTextureCopy(0x18000000, 0x1F48F000, 0x00038400, 0, 0, 0, 0, 8);
  36.         svcSleepThread(0x400000LL);
  37.         GSPGPU_FlushDataCache(0x18000000, 0x00038400);
  38.         GX_SetTextureCopy(0x18000000, 0x1F4C7800, 0x00038400, 0, 0, 0, 0, 8);
  39.         svcSleepThread(0x400000LL);
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement