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:
parent
a005c8672c
commit
c941c2b6e7
1 changed files with 8 additions and 2 deletions
10
vm/debug.c
10
vm/debug.c
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue