Skip to content

Commit a0f7a93

Browse files
committed
Remove unneccesary routines, update load_rom to close stream.
Change registers from dictionary to object. Change keyboard configuration to match other emulators. Update readme to reflect tested ROMS. Update readme to reflect working status of ROMS. Add shift quirks, change source and target names to x and y. Update workflow Update Codecov action to v4. Add env secret to code coverage action. Run code coverage only on pull requests, update README Add memory size switch. Fix huge bug with timers and extended screen mode. Update README with new compatibility notes. Add more games compability to README. Fix scrolling. Update README and unit tests. Change the wait wait_for_keypress waits so the emulator does not hang.
1 parent afc9d70 commit a0f7a93

File tree

9 files changed

+1118
-819
lines changed

9 files changed

+1118
-819
lines changed

.github/workflows/python-app.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
name: Build Test Coverage
2-
on: [push, pull_request]
2+
on: [pull_request]
33
jobs:
44
run:
5-
runs-on: ubuntu-20.04
5+
runs-on: ubuntu-latest
66
env:
7-
OS: ubuntu-20.04
8-
PYTHON: '3.8.10'
97
DISPLAY: :0
108
steps:
119
- name: Checkout
1210
uses: actions/checkout@v3
13-
- name: Setup Python
11+
- name: Setup Python 3.8.12
1412
uses: actions/setup-python@v4
1513
with:
16-
python-version: 3.8.10
14+
python-version: '3.8.12'
15+
- name: Update PIP
16+
run: python -m pip install --upgrade pip
17+
- name: Install OS Dependencies
18+
run: sudo apt-get install xvfb
19+
- name: Install Requirements
20+
run: pip install -r requirements.txt
1721
- name: Generate Report
18-
run: |
19-
pip install -r requirements.txt
20-
sudo apt-get install xvfb
21-
xvfb-run --auto-servernum coverage run --source=chip8 -m unittest
22+
run: xvfb-run --auto-servernum coverage run --source=chip8 -m unittest
2223
- name: Codecov
23-
uses: codecov/codecov-action@v3.1.0
24+
uses: codecov/codecov-action@v4.2.0
25+
env:
26+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 200 additions & 67 deletions
Large diffs are not rendered by default.

chip8/config.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (C) 2012-2019 Craig Thomas
2+
Copyright (C) 2024 Craig Thomas
33
This project uses an MIT style license - see LICENSE for details.
44
55
A simple Chip 8 emulator - see the README file for more information.
@@ -10,9 +10,6 @@
1010

1111
# C U S T O M I Z A T I O N V A R I A B L E S###############################
1212

13-
# The total amount of memory to allocate for the emulator
14-
MAX_MEMORY = 4096
15-
1613
# Where the stack pointer should originally point
1714
STACK_POINTER_START = 0x52
1815

@@ -21,22 +18,22 @@
2118

2219
# Sets which keys on the keyboard map to the Chip 8 keys
2320
KEY_MAPPINGS = {
24-
0x0: pygame.K_g,
25-
0x1: pygame.K_4,
26-
0x2: pygame.K_5,
27-
0x3: pygame.K_6,
28-
0x4: pygame.K_7,
29-
0x5: pygame.K_r,
30-
0x6: pygame.K_t,
31-
0x7: pygame.K_y,
32-
0x8: pygame.K_u,
33-
0x9: pygame.K_f,
34-
0xA: pygame.K_h,
35-
0xB: pygame.K_j,
36-
0xC: pygame.K_v,
37-
0xD: pygame.K_b,
38-
0xE: pygame.K_n,
39-
0xF: pygame.K_m,
21+
0x0: pygame.K_x,
22+
0x1: pygame.K_1,
23+
0x2: pygame.K_2,
24+
0x3: pygame.K_3,
25+
0x4: pygame.K_q,
26+
0x5: pygame.K_w,
27+
0x6: pygame.K_e,
28+
0x7: pygame.K_a,
29+
0x8: pygame.K_s,
30+
0x9: pygame.K_d,
31+
0xA: pygame.K_z,
32+
0xB: pygame.K_c,
33+
0xC: pygame.K_4,
34+
0xD: pygame.K_r,
35+
0xE: pygame.K_f,
36+
0xF: pygame.K_v,
4037
}
4138

4239
# The font file to use

0 commit comments

Comments
 (0)