Advertisement
KazoWAR

dxromswap.c

Jan 25th, 2015
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.92 KB | None | 0 0
  1. #include "spider.h"
  2. #include "fs.h"
  3.  
  4. int uvl_entry()
  5. {
  6.     FILE *fin = (void *)0x08F10000;
  7.     unsigned int addr;
  8.     int *buf = 0x18410000;
  9.     int *read_len = 0x08F10020;
  10.     int i;
  11.     unsigned int offset;
  12.  
  13.  
  14.     addr = 0x16800000;
  15.     offset = 0;
  16.  
  17.     GSPGPU_FlushDataCache(addr, 0x10000);
  18.     GX_SetTextureCopy(addr, buf, 0x10000, 0, 0, 0, 0, 8);
  19.     GSPGPU_FlushDataCache(buf, 0x10000);
  20.     svcSleepThread(0x400000LL);
  21.  
  22.     offset = 0;
  23.     for (i = 0; i < 0x4000; i++)
  24.     {
  25.         if (buf[i] == 0x0028B7C3)
  26.         {
  27.             offset = addr + (i * 4);
  28.         }
  29.     }
  30.  
  31.     if (offset != 0)
  32.     {
  33.         IFile_Open(fin, L"dmc:/rom.gbc", FILE_R);
  34.         fin->pos = 0x00;
  35.  
  36.         for (addr = offset; addr < (offset + 0x100000); addr += 0x10000)
  37.         {
  38.             IFile_Read(fin, read_len, buf, 0x10000);
  39.             GSPGPU_FlushDataCache(buf, 0x10000);
  40.             GX_SetTextureCopy(buf, addr, 0x10000, 0, 0, 0, 0, 8);
  41.             GSPGPU_FlushDataCache(addr, 0x10000);
  42.             svcSleepThread(0x400000LL);
  43.         }
  44.     }
  45.  
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement