43 lines
1.0 KiB
C
43 lines
1.0 KiB
C
//
|
|
// Created by william on 10/01/24.
|
|
//
|
|
|
|
#include "program_view.h"
|
|
#include "../cpu/op.h"
|
|
|
|
void decode_operands(byte *ram, address start_addr) {
|
|
int pc = start_addr;
|
|
|
|
for (int i = 0; i < 10; i++) {
|
|
DebugOperand operand;
|
|
byte op_code = ram[pc];
|
|
|
|
operand.op_code = op_code;
|
|
operand.addr_mode = get_op_addr_mode(op_code);
|
|
}
|
|
}
|
|
|
|
void program_view_write_line(WINDOW *window, int line, address addr) {
|
|
mvwprintw(window, line + 1, 1, "%04x:", addr);
|
|
mvwprintw(window, line + 1, 7, "%s", "BRK");
|
|
}
|
|
|
|
void program_view_print(ProgramView *view) {
|
|
for (int line = 0; line <= 0xf; line++) {
|
|
address addr = 0x8000 + line;
|
|
|
|
program_view_write_line(view->panel->win, line, addr);
|
|
}
|
|
}
|
|
|
|
void program_view_init(ProgramView *view, ram ram, int x, int y) {
|
|
WINDOW *window = newwin(PROGRAM_VIEW_HEIGHT, PROGRAM_VIEW_WIDTH, y, x);
|
|
box(window, 0, 0);
|
|
|
|
mvwprintw(window, 0, 1, " PROGRAM VIEW ");
|
|
|
|
view->panel = new_panel(window);
|
|
view->ram = ram;
|
|
|
|
program_view_print(view);
|
|
} |