1
0
Fork 0
mirror of https://github.com/pnx/m16vm synced 2026-06-16 03:44:55 +02:00

vm/debug.c: make debug_print_memory() print a nice table.

This commit is contained in:
Henrik Hautakoski 2023-11-25 14:03:05 +01:00
parent a005c8672c
commit c941c2b6e7

View file

@ -20,14 +20,20 @@
#include <stdio.h>
#include "cpu.h"
#include "debug.h"
#include "mm.h"
void debug_print_memory(uint8_t *mm) {
int i = 0;
printf("\n");
printf("\n"
" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
" ------------------------------------------------");
for(i = 0; i < MEM_SIZE; i++) {
if ((i % 16) == 0)
printf("\n%.2X| ", i);
for(i = 0; i < 32; i++) {
printf("%.2X ", mm[i]);
}
printf("\n");