Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // by shutterbug2000 from GBAtemp
- #include <3ds.h>
- #include <3ds/srv.h>
- #include <stdio.h>
- //Handle* gspHand;
- int main()
- {
- FILE *dump;
- gfxInitDefault();
- consoleInit(GFX_TOP, NULL);
- Handle* gspHand = gspInit();
- u8* dumpbuf = linearAlloc(0x10000);
- int addr = 0;
- for (addr = 0x14000000; addr < 0x1A800000; addr += 0x10000){
- GSPGPU_FlushDataCache(gspHand, addr, 0x10000);
- GX_SetTextureCopy(NULL, (u32*)addr, 0x00000000, (u32*)dumpbuf, 0x00000000, 0x10000, 0x00000008);
- GSPGPU_FlushDataCache(gspHand, dumpbuf, 0x10000);
- dump = fopen("dump.bin", "wb");
- fseek(dump, addr - 0x14000000, SEEK_SET);
- fwrite(dumpbuf, 1, 0x10000, dump);
- fclose(dump);
- printf("\x1b[15;20HDumping...%x", addr);
- }
- // Main loop
- while (aptMainLoop())
- {
- printf("\x1b[15;19HDone!");
- u32 kDown = hidKeysDown();
- if (kDown & KEY_START)
- break; // break in order to return to hbmenu
- // Flush and swap framebuffers
- gfxFlushBuffers();
- gfxSwapBuffers();
- }
- gfxExit();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment