mirror of
https://github.com/pnx/m16vm
synced 2026-07-02 11:33:40 +02:00
src/vm.c: add preprocessor macro for reg/mem debug output.
This commit is contained in:
parent
66ea2b3b49
commit
61263f65c8
1 changed files with 8 additions and 0 deletions
8
src/vm.c
8
src/vm.c
|
|
@ -22,6 +22,7 @@
|
||||||
#include "mm.h"
|
#include "mm.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
|
#ifdef M16_DEBUG_MEM
|
||||||
void print_memory() {
|
void print_memory() {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
@ -33,7 +34,11 @@ void print_memory() {
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define print_memory()
|
||||||
|
#endif /* ! M16_DEBUG_MEM */
|
||||||
|
|
||||||
|
#ifdef M16_DEBUG_REG
|
||||||
void print_regs(uint16_t *regs) {
|
void print_regs(uint16_t *regs) {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
@ -45,6 +50,9 @@ void print_regs(uint16_t *regs) {
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define print_regs(regs)
|
||||||
|
#endif /* ! M16_DEBUG_REG */
|
||||||
|
|
||||||
void run(struct program *prog) {
|
void run(struct program *prog) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue