dreamcast/example/dump_ram.cpp
Zack Buhman e4c2a047fa example: add gdrom_test
This successfully reads the first 17 sectors of the first data track
of a CD.
2024-02-25 13:27:39 +08:00

29 lines
494 B
C++

#include <cstdint>
#include "memorymap.hpp"
#include "sh7091/serial.hpp"
void dump_ram(const volatile uint32_t * mem, const uint32_t len)
{
uint32_t sum = 0;
for (uint32_t i = 0; i < ; i++) {
uint8_t n = mem[i];
sum += n;
serial::hexlify(n);
if ((i & 0xf) == 0xf)
serial::character('\n');
}
serial::character('\n');
serial::integer<uint32_t>(sum);
}
void main()
{
// dump the first 64k of system memory
dump_ram(system_memory, 0x10000);
while (1);
}