Skip to content

Commit

Permalink
[MC6809] Fix ORCC/ANDCC bus cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
tgtakaoka committed May 2, 2024
1 parent fc9fc5a commit c40c46e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 17 deletions.
4 changes: 2 additions & 2 deletions debugger/mc6809/hd6309-P00.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ op nemo oper ~ # sequence
17 LBSR r16 9/7 3 1:2:3:x:x:X:x:w:W:k/1:2:3:x:x:w:W:k
18 - - - - -
19 DAA - 2/1 1 1:N:N/1:N
1A ORCC #n8 3 2 1:2:N:N
1A ORCC #n8 3 2 1:2:N:N/1:2:x
1B - - - - -
1C ANDCC #n8 3 2 1:2:N:N
1C ANDCC #n8 3 2 1:2:N:N/1:2:x
1D SEX - 2/1 1 1:N:N/1:N
1E EXG #n8 8/5 2 1:2:x:x:x:x:x:x:N/1:2:x:x:x:N
1F TFR #n8 6/4 2 1:2:x:x:x:x:N/1:2:x:x:N
Expand Down
2 changes: 1 addition & 1 deletion debugger/mc6809/inst_hd6309.awk
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ BEGIN {
CYCLES[27]="1NxxN";
CYCLES[28]="123xxk/123xk";
CYCLES[29]="123xxXxwWk/123xxwWk";
CYCLES[30]="12NN";
CYCLES[30]="12NN/12x";
CYCLES[31]="12xxxxxxN/12xxxN";
CYCLES[32]="12xxxxN/12xxN";
CYCLES[33]="12xj";
Expand Down
6 changes: 3 additions & 3 deletions debugger/mc6809/inst_hd6309.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ constexpr const char *const SEQUENCES[/*seq*/] = {
"1NxxN", // 27
"123xxk/123xk", // 28
"123xxXxwWk/123xxwWk", // 29
"12NN", // 30
"12NN/12x", // 30
"12xxxxxxN/12xxxN", // 31
"12xxxxN/12xxN", // 32
"12xj", // 33
Expand Down Expand Up @@ -400,9 +400,9 @@ constexpr uint8_t P00_TABLE[] = {
29, // 17: LBSR r16 9/7 3 1:2:3:x:x:X:x:w:W:k/1:2:3:x:x:w:W:k
0, // 18: - - - - -
25, // 19: DAA - 2/1 1 1:N:N/1:N
30, // 1A: ORCC #n8 3 2 1:2:N:N
30, // 1A: ORCC #n8 3 2 1:2:N:N/1:2:x
0, // 1B: - - - - -
30, // 1C: ANDCC #n8 3 2 1:2:N:N
30, // 1C: ANDCC #n8 3 2 1:2:N:N/1:2:x
25, // 1D: SEX - 2/1 1 1:N:N/1:N
31, // 1E: EXG #n8 8/5 2 1:2:x:x:x:x:x:x:N/1:2:x:x:x:N
32, // 1F: TFR #n8 6/4 2 1:2:x:x:x:x:N/1:2:x:x:N
Expand Down
2 changes: 1 addition & 1 deletion debugger/mc6809/pins_mc6809.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ void PinsMc6809::suspend(bool show) {
cycle(); // non-VMA
_regs->capture(frame, true);
if (show) {
const auto last = frame->prev(_regs->contextLength() == 14 ? 4 : 3);
const auto last = frame->prev(_regs->contextLength() == 14 ? 3 : 2);
Signals::discard(last);
}
}
Expand Down
1 change: 0 additions & 1 deletion debugger/mc6809/pins_mc6809e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ mc6809::Signals *PinsMc6809E::rawCycle() const {
// c1
signals->getControl();
c1_clock();
vma = signals->avma();

return signals;
}
Expand Down
1 change: 0 additions & 1 deletion debugger/mc6809/signals_mc6809.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ void Signals::getDirection() {

void Signals::clearControl() {
lic() = 0;
avma() = 0;
vma() = 1;
}

Expand Down
12 changes: 5 additions & 7 deletions debugger/mc6809/signals_mc6809.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace debugger {
namespace mc6809 {
struct Signals : SignalsBase<Signals, mc6800::Signals> {
struct Signals : SignalsBase<Signals, mc6800::Signals> {
void getHighAddr();
void getLowAddr();
void getDirection();
Expand All @@ -14,10 +14,8 @@ namespace mc6809 {
void print() const;

bool vector() const { return status() == S_VEC; }
uint8_t lic() const { return _signals[4]; }
uint8_t avma() const { return _signals[5]; }
uint8_t &lic() { return _signals[4]; }
uint8_t &avma() { return _signals[5]; }
uint8_t lic() const { return _signals[3]; }
uint8_t &lic() { return _signals[3]; }

protected:
enum Status : uint8_t {
Expand All @@ -27,8 +25,8 @@ namespace mc6809 {
S_HALT = 3, // BA=H, BS=H
};

uint8_t status() const { return _signals[3]; }
uint8_t &status() { return _signals[3]; }
uint8_t status() const { return _signals[2]; }
uint8_t &status() { return _signals[2]; }
};
} // namespace mc6809
} // namespace debugger
Expand Down
1 change: 0 additions & 1 deletion debugger/mc6809/signals_mc6809e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace mc6809e {

void Signals::getControl() {
lic() = digitalReadFast(PIN_LIC);
avma() = digitalReadFast(PIN_AVMA);
vma() = 1;
}

Expand Down

0 comments on commit c40c46e

Please sign in to comment.