summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-08-13 17:25:09 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-08-13 17:25:09 -0400
commit7e57608dff1e768d2ee5d6b6a28a319865530ed0 (patch)
tree26a0f3795c29f8fd9e55cf63bcac278ddf55302a /io.c
parenta9860417f53216a2f3b0b490afec46ab5db70181 (diff)
Refactored get_addr(), and all of the effective
address handling. It's now all done using several functions for each addressing mode, with the result being the effective address. I did this to make the codebase cleaner, and more readable.
Diffstat (limited to 'io.c')
-rw-r--r--io.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/io.c b/io.c
index 37116df..4e69f7e 100644
--- a/io.c
+++ b/io.c
@@ -231,6 +231,13 @@ void reset_esc() {
void handle_ctrlcode(int c) {
int x, y;
+ uint16_t scr_col = 0;
+ #if debug
+ if (!subdbg) {
+ scr_col = (addr[TX_ADDR] != 0x0C && addr[TX_ADDR] != '\n' && scr_col < 160) ? (addr[1] << 1)-2 : 0;
+ wmove(scr, 28, scr_col);
+ }
+ #endif
getyx(scr, y, x);
switch (c) {
case 0xC:
@@ -288,7 +295,6 @@ void handle_ctrlcode(int c) {
void io(uint64_t address, uint8_t rw) {
- uint16_t scr_col = 0;
/*step |= (!rw) ? (cpu->pc[thread] == CTRL_ADDR) : step;*/
switch (address) {
case STEP_ADDR: step = (!rw) ? addr[STEP_ADDR] : step; break;
@@ -305,12 +311,6 @@ void io(uint64_t address, uint8_t rw) {
if (rw) {
break;
}
- #if debug
- if (!subdbg) {
- scr_col = (addr[TX_ADDR] != 0x0C && addr[TX_ADDR] != '\n' && scr_col < 160) ? (addr[1] << 1)-2 : 0;
- wmove(scr, 28, scr_col);
- }
- #endif
if (esc) {
#if debug
if (!subdbg && addr[RX_ADDR] == '\n') {