diff options
author | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-12-03 11:32:39 +1100 |
---|---|---|
committer | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-12-03 11:32:39 +1100 |
commit | 991c09b01e6b099a5b00d7a9236d252b85a714b5 (patch) | |
tree | bee9445cbd318bbf7a805c80b5bc4b94517b44df /src/debug.h | |
parent | 7a5672d085399d0de9d2c77431ea7a2f089faacb (diff) |
half-fixed infinite loop; new debug util, old one out
Diffstat (limited to 'src/debug.h')
-rw-r--r-- | src/debug.h | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/debug.h b/src/debug.h deleted file mode 100644 index 59e3c47..0000000 --- a/src/debug.h +++ /dev/null @@ -1,58 +0,0 @@ -// debug.h -// Various functions useful for use during development. - -#include"stdio.h" -#include"cpu/6502.h" -#include"cpu/addressing.h" -#include"cpu/core.h" -#include"cpu/instructions.h" -#include"cpu/table.h" - - - -// Converts a single character to hexadecimal -int dCharToNum(char c){ - // 0x0 - 0x9 - if (c != 0x20 && (c >= 0x30 && c <= 0x39)){ - return (c - 0x30); - } - // 0xA - 0xF - else if (c != 0x20 && (c >= 0x41 && c <= 0x46)){ - return (c - 0x37); - // 0xa - 0xf - }else if (c != 0x20 && (c >= 0x61 && c <= 0x66)){ - return (c - 0x57); - // Invalid - }else{ - return -1; - } -} - -// Dump page m from memory to stdout. -void dPageDump(short m){ - m <<= 8; - for(int i = 0; i < 256; i+=16){ - printf("\t"); - for(int j = 0; j < 16; j+=1){ - if ((j+1) % 4 == 0){ - printf("%02x ", GetMemory((m+(i+j)))); - } - else { - printf("%02x ", GetMemory((m+(i+j)))); - } - } - printf("\n"); - } -} - -// Dump CPU values -void dStatusDump(void){ -printf("\ -\t..acc:\t%x\tcycles:\t%d\n\ -\t....X:\t%x\tlength:\t%d\n\ -\t....Y:\t%x\t...add:\t%x\n\ -\tstack:\t%x\t.value:\t%x\n\ -\tflags:\t%x\t....PC:\t%x\n\ -\n\ -", acc, idata.cycles, X, idata.length, Y, idata.add, S, idata.value, P, PC); -} |