Skip to content

Commit a21dae1

Browse files
authored
Update main.cpp
1 parent 19786a4 commit a21dae1

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

src/main.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,9 @@ void writeHexDumpToFile()
114114
write_sr(0x100000F0 | sr);
115115

116116
int fd = File_Open("\\fls0\\dump.dmp", FILE_OPEN_WRITE | FILE_OPEN_CREATE | FILE_OPEN_APPEND);
117-
118-
char hexDumpTableHeader[57] = "Offset:\t00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n";
119117

120-
auto _ = File_Write(fd, hexDumpTableHeader, sizeof(hexDumpTableHeader) - 1);
121-
122-
char hexTextBuffer[4];
123-
char addressTextBuffer[32];
124-
125-
for (uintptr_t addr = startMemoryAddress; addr <= endMemoryAddress; addr+=16) {
126-
int len = snprintf(addressTextBuffer, sizeof(addressTextBuffer), "%08zx", addr);
127-
[[maybe_unused]] auto f = File_Write(fd, addressTextBuffer, len);
128-
129-
for (uintptr_t offset = 0; offset < 16; offset++) {
130-
uintptr_t currentAddr = addr + offset;
131-
if (currentAddr > endMemoryAddress) break;
132-
133-
snprintf(hexTextBuffer, sizeof(hexTextBuffer), " %02X", *reinterpret_cast<uint8_t*>(currentAddr));
134-
[[maybe_unused]] auto f = File_Write(fd, hexTextBuffer, strlen(hexTextBuffer));
135-
}
136-
137-
[[maybe_unused]] auto f4 = File_Write(fd, "\r\n", 2);
118+
for (uintptr_t addr = startMemoryAddress; addr <= endMemoryAddress; addr++) {
119+
auto _ = File_Write(fd, (char*)addr, 1);
138120
}
139121

140122
start = (uintptr_t)0x00000000;

0 commit comments

Comments
 (0)