master
Avril 4 years ago
parent ab69e5e2a7
commit 82d8fd44c7
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -110,15 +110,15 @@ namespace hv {
u64_to_hex(offset, posbuf+3);
prints(posbuf+1);
char hxbuf[3];
char hxbuf[3] = { ' ' };
std::size_t i=0;
char r_ascii[2 + ROW_SZ];
r_ascii[0] = ' ';
r_ascii[1] = ' ';
char* ascii = r_ascii + 2;
auto memsize = memory.size();
hxbuf[2] = ' ';
for(;i<memory.size();i++) {
for(;i<memsize;i++) {
if (i && i % ROW_SZ == 0) { //TODO: Change to i +=16 so we don't have to branch here on every byte. Make sure to not overrun buffer tho
P_EX(S, r_ascii);
@ -131,9 +131,9 @@ namespace hv {
ascii[i%ROW_SZ] = ascii_map[idx];
}
if (memory.size() % ROW_SZ != 0)
if (memsize % ROW_SZ != 0)
{
auto rest = memory.size() % ROW_SZ;
auto rest = memsize % ROW_SZ;
ascii[rest] = 0;
constexpr const char output[3] = { ' ', ' ', ' ' };
for(std::size_t j=0;j< ROW_SZ - rest;j++)

Loading…
Cancel
Save