Skip to content

Commit

Permalink
Use Platform::File calls in NDS::debug (melonDS-emu#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTG authored Nov 24, 2023
1 parent 679c37d commit 651b0f6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/NDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2074,25 +2074,24 @@ void debug(u32 param)
//for (int i = 0; i < 9; i++)
// printf("VRAM %c: %02X\n", 'A'+i, GPU->VRAMCNT[i]);

FILE*
shit = fopen("debug/DSfirmware.bin", "wb");
fwrite(ARM9->ITCM, 0x8000, 1, shit);
Platform::FileHandle* shit = Platform::OpenFile("debug/DSfirmware.bin", FileMode::Write);
Platform::FileWrite(ARM9->ITCM, 0x8000, 1, shit);
for (u32 i = 0x02000000; i < 0x02400000; i+=4)
{
u32 val = ARM7Read32(i);
fwrite(&val, 4, 1, shit);
Platform::FileWrite(&val, 4, 1, shit);
}
for (u32 i = 0x037F0000; i < 0x03810000; i+=4)
{
u32 val = ARM7Read32(i);
fwrite(&val, 4, 1, shit);
Platform::FileWrite(&val, 4, 1, shit);
}
for (u32 i = 0x06000000; i < 0x06040000; i+=4)
{
u32 val = ARM7Read32(i);
fwrite(&val, 4, 1, shit);
Platform::FileWrite(&val, 4, 1, shit);
}
fclose(shit);
Platform::CloseFile(shit);

/*FILE*
shit = fopen("debug/directboot9.bin", "wb");
Expand Down

0 comments on commit 651b0f6

Please sign in to comment.