diff options
| author | StapleButter <thetotalworm@gmail.com> | 2017-02-03 16:57:31 +0100 | 
|---|---|---|
| committer | StapleButter <thetotalworm@gmail.com> | 2017-02-03 16:57:31 +0100 | 
| commit | f4335b92927ec3ba0eb3675eb1c4a5c80bb0a05d (patch) | |
| tree | c38d271abf37386fcf872f11c81b9d254e247804 /main.cpp | |
| parent | 7e9972e0378ca7a5499d16511f3a3b169d6a62e1 (diff) | |
better save support. not hardcoded filename, support for non-tiny EEPROM and Flash, attempt at autodetecting the right memory type.
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 26 | 
1 files changed, 16 insertions, 10 deletions
| @@ -41,20 +41,26 @@ LRESULT CALLBACK derpo(HWND window, UINT msg, WPARAM wparam, LPARAM lparam)          printf("close\n");          {              // 6006800 6008000 -            FILE* f = fopen("wram.bin", "wb"); -            for (u32 i = 0x37F8000; i < 0x3808000; i+=4) +            FILE* f = fopen("debug/wram.bin", "wb"); +            if (f)              { -                u32 blarg = NDS::ARM7Read32(i); -                fwrite(&blarg, 4, 1, f); +                for (u32 i = 0x37F8000; i < 0x3808000; i+=4) +                { +                    u32 blarg = NDS::ARM7Read32(i); +                    fwrite(&blarg, 4, 1, f); +                } +                fclose(f);              } -            fclose(f); -            f = fopen("mainram.bin", "wb"); -            for (u32 i = 0x2000000; i < 0x2400000; i+=4) +            f = fopen("debug/mainram.bin", "wb"); +            if (f)              { -                u32 blarg = NDS::ARM9Read32(i); -                fwrite(&blarg, 4, 1, f); +                for (u32 i = 0x2000000; i < 0x2400000; i+=4) +                { +                    u32 blarg = NDS::ARM9Read32(i); +                    fwrite(&blarg, 4, 1, f); +                } +                fclose(f);              } -            fclose(f);          }          PostQuitMessage(0);          return 0; |