2727
2828## What is it?
2929
30- This project is a Chip 8 emulator written in Python 2.7 . The original purpose
30+ This project is a Chip 8 emulator written in Python 3.6+ . The original purpose
3131of the project was to create a simple learning emulator that was well
3232documented and coded in terms that were easy to understand. It was also an
3333exercise to learn more about Python. The result is a simple command-line
@@ -54,7 +54,7 @@ This project makes use of an MIT style license. Please see the file called LICEN
5454Copy the source files to a directory of your choice. In addition to
5555the source, you will need the following required software packages:
5656
57- * [ Python 2.7 ] ( http://www.python.org )
57+ * [ Python 3.6.8 or better ] ( http://www.python.org )
5858* [ pygame] ( http://www.pygame.org )
5959
6060I strongly recommend creating a virtual environment using the
@@ -66,41 +66,43 @@ and run the emulator in, without touching your master Python environment.
6666
6767### Ubuntu Installation
6868
69- The installation under Ubuntu requires several different steps:
69+ The installation under Ubuntu 20.04 requires several different steps:
7070
71711 . Install SDL libraries. The SDL (Simple DirectMedia Layer) libraries are used by PyGame to draw
7272images on the screen. Several other dependencies are needed by SDL in order to install PyGame.
7373To install the required SDL libraries (plus dependencies) from the command-line:
7474
7575 ```
76- sudo apt-get install libfreetype6 -dev libsdl-dev libsdl-image1.2- dev \
77- libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl-sound1.2-dev \
78- libportmidi-dev python-dev
76+ sudo apt install python3 python3 -dev libsdl-dev libfreetype6- dev \
77+ libsdl-image1.2-dev libsdl- mixer1.2-dev libsdl-ttf2.0-dev libsdl-sound1.2-dev \
78+ libportmidi-dev
7979 ```
8080
81812 . Install PIP. The ` pip ` package manager is used for managing Python packages. To install ` pip `
8282from the command-line:
8383
8484 ```
85- sudo apt-get install python -pip
85+ sudo apt install python3 -pip
8686 ```
8787
88883 . (* Optional* ) Install virtual environment support for Python:
8989
9090 1 . Install virtual environment support:
9191
9292 ```
93- pip install virtualenv
94- pip install virtualenvwrapper
93+ pip3 install virtualenv
94+ pip3 install virtualenvwrapper
9595 ```
9696
9797 2. First you must update your `.bashrc` file in the your home directory and add a few lines
9898 to the bottom of that file:
9999
100100 ```
101101 cat >> ~/.bashrc << EOF
102+ export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
102103 export WORKON_HOME=$HOME/.virtualenvs
103- source /usr/local/bin/virtualenvwrapper.sh
104+ export PATH=$PATH:$HOME/.local/bin
105+ source $HOME/.local/bin/virtualenvwrapper.sh
104106 EOF
105107 ```
106108
@@ -119,7 +121,7 @@ from the command-line:
1191215. Clone (or download) the Chip 8 emulator project:
120122
121123 ```
122- sudo apt-get install git
124+ sudo apt install git
123125 git clone https://github.com/craigthomas/Chip8Python.git
124126 ```
125127
@@ -132,8 +134,9 @@ from the command-line:
132134
133135### Windows Installation
134136
135- 1. Download and install [Python 2.7.15 for Windows](https://www.python.org/downloads/release/python-2715/).
136- Make sure that `pip` and `Add python.exe to Path` options are checked when performing the installation.
137+ 1. Download and install [Python 3.6.8 for Windows](https://www.python.org/downloads/release/python-368/).
138+ Make sure that `pip` and `Add python.exe to Path` options are checked when performing the installation. Later
139+ versions of Python 3 are also likely to work correctly with the emulator.
137140
1381412. (*Optional*) Install virtual environment support for Python. Run the following commands from a command prompt:
139142
@@ -170,34 +173,35 @@ in the directory where you cloned or downloaded the source files:
170173
171174### Running a ROM
172175
176+ Note that if you created a virtual environment as detailed above,
177+ you will need to `workon` that environment before starting the emulator:
178+
179+ workon chip8
180+
173181The command-line interface requires a single argument, which is the full
174182path to a Chip 8 ROM. Run the following command in the directory where you
175183cloned or downloaded the source files:
176184
177- python chip8/ yac8e.py /path/to/rom/filename
185+ python yac8e.py /path/to/rom/filename
178186
179- This will start the emulator with the specified ROM. Note that if you created
180- a virtual environment as detailed above, you will need to `workon` that
181- environment before starting the emulator:
182-
183- workon chip8
187+ This will start the emulator with the specified ROM.
184188
185189### Screen Scale
186190
187- The `-s ` switch will scale the size of the window (the original size at 1x
191+ The `--scale ` switch will scale the size of the window (the original size at 1x
188192scale is 64 x 32):
189193
190- python chip8/ yac8e.py /path/to/rom/filename -s 10
194+ python yac8e.py /path/to/rom/filename --scale 10
191195
192196The command above will scale the window so that it is 10 times the normal
193197size.
194198
195199### Execution Delay
196200
197- You may also wish to experiment with the `-d ` switch, which instructs
201+ You may also wish to experiment with the `--delay ` switch, which instructs
198202the emulator to add a delay to every operation that is executed. For example,
199203
200- python chip8/ yac8e.py /path/to/rom/filename -d 10
204+ python yac8e.py /path/to/rom/filename --delay 10
201205
202206The command above will add a 10 ms delay to every opcode that is executed.
203207This is useful for very fast computers (note that it is difficult to find
@@ -253,11 +257,17 @@ keys that impact the execution of the emulator.
253257
254258## ROM Compatibility
255259
256- Here are the list of public domain ROMs and their current status with the emulator.
257-
258- | ROM Name | Works Correctly | Notes |
259- | :---------------: | :----------------: | :---: |
260- | MAZE | :heavy_check_mark: | |
260+ Here are the list of public domain ROMs and their current status with the emulator, along
261+ with keypresses based on the default keymap:
262+
263+ | ROM Name | Works Correctly | Notes |
264+ | :-------- | :----------------: | :---------------------------------------------------------------------------------- |
265+ | MAZE | :heavy_check_mark: | |
266+ | MISSILE | :heavy_check_mark: | `U` fires |
267+ | PONG | :heavy_check_mark: | `4` left player up, `7` left player down, `V` right player up, `B` right player down|
268+ | TANK | :heavy_check_mark: | `R` fires, `T` moves right, `7` moves left, `5` moves down, `U` moves up |
269+ | TETRIS | :heavy_check_mark: | `R` moves left, `T` moves right, `Y` moves down, `7` rotates |
270+ | UFO | :heavy_check_mark: | `R` fires up, `T` fires right, `7` fires left |
261271
262272
263273## Further Documentation
0 commit comments