diff --git a/README.md b/README.md index c3d658f..1cf1d36 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ Apple-1 Emulator ================ - +- Emulates an Apple-1 with 32k of RAM - see [napple1](https://github.com/nobuh/napple1) - see also [krusader](http://school.anhb.uwa.edu.au/personalpages/kwessen/apple1/Krusader.htm) + +Keyboard +-------- +- F1: reset +- F2: advance tape +- F3: rewind tape +- F4: load program from tape (by simulating typing it) +- F6: checkpoint machine +- F7: restore from current checkpoint on tape +- F8: enter debug mode (display current processor status on serial port) diff --git a/apple1.ino b/apple1.ino index 16e1619..902b1e5 100644 --- a/apple1.ino +++ b/apple1.ino @@ -34,7 +34,7 @@ void status(const char *fmt, ...) { } jmp_buf ex; -r6502 cpu(&memory, &ex, status); +r6502 cpu(memory, &ex, status); bool halted = false; const char *filename; diff --git a/io.cpp b/io.cpp index d0d3391..7024558 100644 --- a/io.cpp +++ b/io.cpp @@ -145,13 +145,14 @@ void io::write_portb(byte b) { byte io::read_porta_cr() { byte b = pia::read_porta_cr(); - if (b == 0xa7) { - if (_loading) { - if (tape.more()) - enter(tape.read()); - else - _loading = false; - } + if (b != 0xa7) + return b; + + if (_loading) { + if (tape.more()) + enter(tape.read()); + else + _loading = false; } return b; } diff --git a/pia.cpp b/pia.cpp index 408867b..9ede66e 100644 --- a/pia.cpp +++ b/pia.cpp @@ -3,6 +3,11 @@ #include "pia.h" void pia::operator=(byte b) { +Serial.print(millis()); +Serial.print(" > "); +Serial.print(_acc, 16); +Serial.print(' '); +Serial.println(b, 16); switch(_acc % 4) { case 0: write_porta(b); @@ -20,6 +25,11 @@ void pia::operator=(byte b) { } pia::operator byte() { +/* +Serial.print(millis()); +Serial.print(" < "); +Serial.println(_acc, 16); +*/ switch (_acc % 4) { case 0: return read_porta();