|
3 | 3 | [](https://travis-ci.org/craigthomas/Chip8Python)
|
4 | 4 | [](https://codecov.io/gh/craigthomas/Chip8Python)
|
5 | 5 | [](https://www.codacy.com/app/craig-thomas/Chip8Python?utm_source=github.com&utm_medium=referral&utm_content=craigthomas/Chip8Python&utm_campaign=Badge_Grade)
|
6 |
| -[](https://dependencyci.com/github/craigthomas/Chip8Python) |
| 6 | +[](https://dependencyci.com/github/craigthomas/Chip8Python) |
| 7 | + |
| 8 | + |
| 9 | +## Table of Contents |
| 10 | + |
| 11 | +1. [What is it?](#what-is-it) |
| 12 | +2. [License](#license) |
| 13 | +3. [Installing](#installing) |
| 14 | + 1. [Ubuntu Installation](#ubuntu-installation) |
| 15 | + 2. [Windows Installation](#windows) |
| 16 | +4. [Running](#running) |
| 17 | + 1. [Running a ROM](#running-a-rom) |
| 18 | + 2. [Screen Scale](#screen-scale) |
| 19 | + 3. [Execution Delay](#execution-delay) |
| 20 | +5. [Customization](#customization) |
| 21 | +6. [Further Documentation](#further-documentation) |
7 | 22 |
|
8 | 23 | ## What is it?
|
9 | 24 |
|
@@ -38,52 +53,124 @@ I strongly recommend creating a virtual environment using the
|
38 | 53 | With these tools, you can easily create a virtual sandbox to install pygame
|
39 | 54 | and run the emulator in, without touching your master Python environment.
|
40 | 55 |
|
| 56 | + |
41 | 57 | ### Ubuntu Installation
|
42 | 58 |
|
43 | 59 | The installation under Ubuntu requires several different steps:
|
44 | 60 |
|
45 |
| -1) Install SDL libraries. The SDL (Simple DirectMedia Layer) libraries are |
46 |
| -used by PyGame to draw images on the screen. Several other dependencies are |
47 |
| -needed by SDL in order to install PyGame. To install the required SDL |
48 |
| -libraries (plus dependencies) from the command-line: |
| 61 | +1. Install SDL libraries. The SDL (Simple DirectMedia Layer) libraries are used by PyGame to draw |
| 62 | +images on the screen. Several other dependencies are needed by SDL in order to install PyGame. |
| 63 | +To install the required SDL libraries (plus dependencies) from the command-line: |
| 64 | + |
| 65 | + ``` |
| 66 | + sudo apt-get install libfreetype6-dev libsdl-dev libsdl-image1.2-dev \ |
| 67 | + libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl-sound1.2-dev \ |
| 68 | + libportmidi-dev python-dev |
| 69 | + ``` |
| 70 | + |
| 71 | +2. Install PIP. The `pip` package manager is used for managing Python packages. To install `pip` |
| 72 | +from the command-line: |
| 73 | + |
| 74 | + ``` |
| 75 | + sudo apt-get install python-pip |
| 76 | + ``` |
| 77 | + |
| 78 | +3. (*Optional*) Install virtual environment support for Python: |
| 79 | + |
| 80 | + 1. Install virtual environment support: |
| 81 | + |
| 82 | + ``` |
| 83 | + pip install virtualenv |
| 84 | + pip install virtualenvwrapper |
| 85 | + ``` |
| 86 | +
|
| 87 | + 2. First you must update your `.bashrc` file in the your home directory and add a few lines |
| 88 | + to the bottom of that file: |
| 89 | +
|
| 90 | + ``` |
| 91 | + cat >> ~/.bashrc << EOF |
| 92 | + export WORKON_HOME=$HOME/.virtualenvs |
| 93 | + source /usr/local/bin/virtualenvwrapper.sh |
| 94 | + EOF |
| 95 | + ``` |
| 96 | +
|
| 97 | + 3. Next you must source the `.bashrc` file: |
| 98 | +
|
| 99 | + ``` |
| 100 | + source ~/.bashrc |
| 101 | + ``` |
| 102 | +
|
| 103 | + 4. Finally you can create the environment: |
49 | 104 |
|
50 |
| - sudo apt-get install libfreetype6-dev libsdl-dev libsdl-image1.2-dev \ |
51 |
| - libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl-sound1.2-dev \ |
52 |
| - libportmidi-dev python-dev |
53 |
| - |
54 |
| -2) Install Mercurial. The `hg` command-line tool is required when using |
55 |
| -`pip` (see next step) to install the requirements for the project. To |
56 |
| -install Mercurial from the command-line: |
| 105 | + ``` |
| 106 | + mkvirtualenv chip8 |
| 107 | + ``` |
57 | 108 |
|
58 |
| - sudo apt-get install mercurial |
59 |
| - |
60 |
| -3) Install PIP. The `pip` package manager is used for managing Python |
61 |
| -packages. To install `pip` from the command-line: |
| 109 | +5. Clone (or download) the Chip 8 emulator project: |
62 | 110 |
|
63 |
| - sudo apt-get install wget |
64 |
| - wget https://bootstrap.pypa.io/get-pip.py |
65 |
| - sudo python ./get-pip.py |
66 |
| - |
67 |
| -4) Clone (or download) the Chip 8 emulator project: |
| 111 | + ``` |
| 112 | + sudo apt-get install git |
| 113 | + git clone https://github.com/craigthomas/Chip8Python.git |
| 114 | + ``` |
68 | 115 |
|
69 |
| - sudo apt-get install git |
70 |
| - git clone [email protected]:craigthomas/Chip8Python.git |
71 |
| - |
72 |
| -5) Install the requirements from the project: |
| 116 | +6. Install the requirements from the project: |
73 | 117 |
|
74 |
| - pip install -r requirements.txt |
| 118 | + ``` |
| 119 | + pip install -r requirements.txt |
| 120 | + ``` |
| 121 | +
|
| 122 | +
|
| 123 | +### Windows Installation |
| 124 | +
|
| 125 | +1. Download and install [Python 2.7.15 for Windows](https://www.python.org/downloads/release/python-2715/). |
| 126 | +Make sure that `pip` and `Add python.exe to Path` options are checked when performing the installation. |
| 127 | +
|
| 128 | +2. (*Optional*) Install virtual environment support for Python. Run the following commands from a command prompt: |
| 129 | +
|
| 130 | + 1. Install the virtual environment wrapper: |
| 131 | +
|
| 132 | + ``` |
| 133 | + pip install virtualenv |
| 134 | + pip install virtualenvwrapper-win |
| 135 | + ``` |
| 136 | +
|
| 137 | + 2. Create a new environment for the Chip 8 emulator: |
| 138 | +
|
| 139 | + ``` |
| 140 | + mkvirtualenv chip8 |
| 141 | + ``` |
| 142 | +
|
| 143 | +4. Install [Git for Windows](https://git-scm.com/download/win). |
| 144 | +
|
| 145 | +5. Clone (or download) the source files from GitHub. Run the following commands in a command prompt window: |
| 146 | +
|
| 147 | + ``` |
| 148 | + git clone https://github.com/craigthomas/Chip8Python.git |
| 149 | + ``` |
| 150 | +
|
| 151 | +6. Install the requirements for the project. Run the following commands in a command prompt window |
| 152 | +in the directory where you cloned or downloaded the source files: |
| 153 | +
|
| 154 | + ``` |
| 155 | + pip install -r requirements.txt |
| 156 | + ``` |
75 | 157 |
|
76 | 158 |
|
77 | 159 | ## Running
|
78 | 160 |
|
79 | 161 | ### Running a ROM
|
80 | 162 |
|
81 | 163 | The command-line interface requires a single argument, which is the full
|
82 |
| -path to a Chip 8 ROM: |
| 164 | +path to a Chip 8 ROM. Run the following command in the directory where you |
| 165 | +cloned or downloaded the source files: |
83 | 166 |
|
84 | 167 | python chip8/yac8e.py /path/to/rom/filename
|
85 | 168 |
|
86 |
| -This will start the emulator with the specified ROM. |
| 169 | +This will start the emulator with the specified ROM. Note that if you created |
| 170 | +a virtual environment as detailed above, you will need to `workon` that |
| 171 | +environment before starting the emulator: |
| 172 | +
|
| 173 | + workon chip8 |
87 | 174 |
|
88 | 175 | ### Screen Scale
|
89 | 176 |
|
|
0 commit comments