Skip to content

Commit

Permalink
move cons under unibus
Browse files Browse the repository at this point in the history
  • Loading branch information
davecheney committed Sep 16, 2020
1 parent 1898391 commit 918840c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
4 changes: 1 addition & 3 deletions avr11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
#include <termios.h>

#include "avr11.h"
#include "dl11.h"
#include "kb11.h"
#include "rk11.h"

KB11 cpu;
DL11 cons;
RK11 rk11;

void setup() {
Expand Down Expand Up @@ -80,7 +78,7 @@ void loop0() {
cpu.interrupt(INTCLOCK, 6);
}
}
cons.poll();
cpu.unibus.cons.poll();
}
}

Expand Down
1 change: 1 addition & 0 deletions dl11.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
#include <stdint.h>

class DL11 {
Expand Down
12 changes: 4 additions & 8 deletions kb11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
#include <stdio.h>

#include "avr11.h"
#include "dl11.h"
#include "bootrom.h"
#include "kb11.h"
#include "rk11.h"
#include "bootrom.h"

extern jmp_buf trapbuf;
extern DL11 cons;
extern RK11 rk11;
extern UNIBUS unibus;
extern UNIBUS unibus;

void KB11::reset() {
LKS = 1 << 7;
Expand All @@ -22,7 +20,7 @@ void KB11::reset() {
unibus.access<1>(02000 + (i * 2), bootrom[i]);
}
R[7] = 002002;
cons.clearterminal();
unibus.cons.clearterminal();
rk11.reset();
}

Expand All @@ -31,7 +29,6 @@ bool KB11::Z() { return PS & FLAGZ; }
bool KB11::V() { return PS & FLAGV; }
bool KB11::C() { return PS & FLAGC; }


inline uint16_t KB11::fetch16() {
const uint16_t val = access<0>(R[7]);
R[7] += 2;
Expand Down Expand Up @@ -316,7 +313,6 @@ void KB11::JMP(const uint16_t instr) {
R[7] = uval;
}


void KB11::MARK(const uint16_t instr) {
R[6] = R[7] + ((instr & 077) << 1);
R[7] = R[5];
Expand Down Expand Up @@ -420,7 +416,7 @@ void KB11::RESET() {
if (curuser) {
return;
}
cons.clearterminal();
unibus.cons.clearterminal();
rk11.reset();
}

Expand Down
1 change: 0 additions & 1 deletion unibus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "rk11.h"
#include "unibus.h"

extern DL11 cons;
extern KB11 cpu;
extern RK11 rk11;

Expand Down
2 changes: 2 additions & 0 deletions unibus.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#pragma once
#include "ms11.h"
#include "dl11.h"
#include <stdint.h>

class UNIBUS {

public:
MS11 core;
DL11 cons;

uint16_t read8(const uint32_t a);
void write8(const uint32_t a, const uint16_t v);
Expand Down

0 comments on commit 918840c

Please sign in to comment.