an Apple ][ emulator in Python
Go to file
Greg Hewgill c9c609be1d Separate CPU core and UI processes
This is a first step toward separating the CPU core and UI.  The UI program
starts the CPU core as a subprocess and communicates through its standard input
and output. The protocol is deliberately simple at this point. Each bus request
from the core is exactly eight bytes:

    +-------------------------+
    | cpu cycle counter high  |
    +-------------------------+
    | cpu cycle counter       |
    +-------------------------+
    | cpu cycle counter       |
    +-------------------------+
    | cpu cycle counter low   |
    +-------------------------+
    | 0x00=read / 0x01=write  |
    +-------------------------+
    | address high            |
    +-------------------------+
    | address low             |
    +-------------------------+
    | value (unused for read) |
    +-------------------------+

A single-byte response from the UI is required for a read request, and a
response must not be sent for a write request.

The above protocol is expected to change. For example:

    - the UI should tell the CPU core which address ranges are of interest
    - needs ability to send memory images to the core (both ROM and RAM)

The stream communications is currently buggy because it expects that all eight
bytes will be read when requested (that is, partial reads are not handled). In
practice, this seems to work okay for the moment.

To improve portability, it may be better to communicate over TCP sockets
instead of stdin/stdout.
2011-08-16 12:54:23 +12:00
.gitignore Separate CPU core and UI processes 2011-08-16 12:54:23 +12:00
README updated README credits and status 2011-08-13 09:30:39 -04:00
applepy.py Separate CPU core and UI processes 2011-08-16 12:54:23 +12:00
applepy_curses.py Separate CPU core and UI processes 2011-08-16 12:54:23 +12:00
cpu6502.py Separate CPU core and UI processes 2011-08-16 12:54:23 +12:00
cycle_notes.txt added notes on implementation that seems to give the right result 2011-08-14 23:45:10 -04:00
tests.py Separate CPU core and UI processes 2011-08-16 12:54:23 +12:00

README

ApplePy - an Apple ][ emulator in Python
========================================

by James Tauber / http://jtauber.com/

Originally written 2001, updated 2011

Apple ][ ROM available from http://www.easy68k.com/paulrsm/6502/index.html


Credits
-------

Some 6502 code came from contributions from Christiaan Kelly in 2007.

Greg Hewgill provided significant fixes and improvements to the 2011 version
(see the commit log for details).

The character generator bitmaps were entered by hand from visual inspection
of http://www.sbprojects.com/projects/apple1/terminal.php


Status
------

With original Apple ][ ROM it boots to the monitor, most monitor commands
work and you can go into Integer BASIC (with E000G or Ctrl-B RETURN) and
write and run programs. With an Apple ][+ ROM it boots to Applesoft Basic and
runs all the programs I've tried so far.

The only I/O supported is the keyboard and screen but 40-column text, LORES
and HIRES graphics are all supported.

ApplePy currently requires Pygame.