Skip to content

Commit

Permalink
Add shift quirks, change source and target names to x and y.
Browse files Browse the repository at this point in the history
  • Loading branch information
craigthomas committed Apr 28, 2024
1 parent d9af2dc commit 5198cb3
Show file tree
Hide file tree
Showing 6 changed files with 625 additions and 578 deletions.
117 changes: 81 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
1. [What is it?](#what-is-it)
2. [License](#license)
3. [Installing](#installing)
1. [Ubuntu Installation](#ubuntu-installation)
2. [Windows Installation](#windows-installation)
1. [Ubuntu Installation](#ubuntu-installation)
2. [Windows Installation](#windows-installation)
4. [Running](#running)
1. [Running a ROM](#running-a-rom)
2. [Screen Scale](#screen-scale)
3. [Execution Delay](#execution-delay)
1. [Running a ROM](#running-a-rom)
2. [Screen Scale](#screen-scale)
3. [Execution Delay](#execution-delay)
4. [Quirks Modes](#quirks-modes)
1. [Shift Quirks](#shift-quirks)
5. [Customization](#customization)
1. [Keys](#keys)
2. [Debug Keys](#debug-keys)
1. [Keys](#keys)
2. [Debug Keys](#debug-keys)
6. [ROM Compatibility](#rom-compatibility)
7. [Further Documentation](#further-documentation)

Expand Down Expand Up @@ -208,6 +210,47 @@ information regarding opcode execution times, as such, I have not attempted
any fancy timing mechanisms to ensure that instructions are executed in a
set amount of time).
### Quirks Modes
Over time, various extensions to the Chip8 mnemonics were developed, which
resulted in an interesting fragmentation of the Chip8 language specification.
As discussed in Octo's [Mastering SuperChip](https://github.com/JohnEarnest/Octo/blob/gh-pages/docs/SuperChip.md)
documentation, one version of the SuperChip instruction set subtly changed
the meaning of a few instructions from their original Chip8 definitions.
This change went mostly unnoticed for many implementations of the Chip8
langauge. Problems arose when people started writing programs using the
updated language model - programs written for "pure" Chip8 ceased to
function correctly on emulators making use of the altered specification.
To address this issue, [Octo](https://github.com/JohnEarnest/Octo) implements
a number of _quirks_ modes so that all Chip8 software can run correctly,
regardless of which specification was used when developing the Chip8 program.
This same approach is used here, such that there are several `quirks` flags
that can be passed to the emulator at startup to force it to run with
adjustments to the language specification.
Additional quirks and their impacts on the running Chip8 interpreter are
examined in great depth at Chromatophore's [HP48-Superchip](https://github.com/Chromatophore/HP48-Superchip)
repository. Many thanks for this detailed explanation of various quirks
found in the wild!
#### Shift Quirks
The `--shift_quirks` flag will change the way that register shift operations work.
In the original language specification two registers were required: the
destination register `x`, and the source register `y`. The source register `y`
value was shifted one bit left or right, and stored in `x`. For example,
shift left was defined as:
Vx = Vy << 1
However, with the updated language specification, the source and destination
register are assumed to always be the same, thus the `y` register is ignored and
instead the value is sourced from `x` as such:
Vx = Vx << 1
## Customization
Expand Down Expand Up @@ -254,35 +297,37 @@ keys that impact the execution of the emulator.
Here are the list of public domain ROMs and their current status with the emulator, along
with keypresses based on the default keymap:
| ROM Name | Status | Notes |
|:------------------------------------------------------------------------------------------|:------------------:|:-------------------------------------------------------------------------------------|
| BRIX | :heavy_check_mark: | `Q` moves left, `E` moves right |
| BLINKY | :question: | |
| BLITZ | :x: | Problem with screen drawing |
| CONNECT4 | :heavy_check_mark: | `Q` moves left, `E` moves right, `W` drops checker |
| [Glitch Ghost](https://johnearnest.github.io/chip8Archive/play.html?p=glitchGhost) | :x: | Problem with CPU |
| GUESS | :question: | |
| KALEID | :question: | Problem with inputs |
| MAZE | :heavy_check_mark: | |
| MERLIN | :heavy_check_mark: | `Q` upper left, `A` lower left, `W` upper right, `S` lower right |
| MISSILE | :heavy_check_mark: | `S` fires |
| [Octojam 1 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam1title) | :heavy_check_mark: | |
| [Octojam 2 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam2title) | :heavy_check_mark: | |
| [Octojam 3 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam3title) | :heavy_check_mark: | |
| [Octojam 4 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam4title) | :heavy_check_mark: | |
| [Octojam 5 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam5title) | :heavy_check_mark: | |
| [Octojam 6 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam6title) | :heavy_check_mark: | |
| [Octojam 7 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam7title) | :heavy_check_mark: | |
| [Octojam 8 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam8title) | :question: | Screen drawing corruption |
| [Octojam 9 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam9title) | :heavy_check_mark: | |
| [Octojam 10 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam10title) | :heavy_check_mark: | |
| PONG | :heavy_check_mark: | `1` left player up, `Q` left player down, `4` right player up, `R` right player down |
| PONG2 | :heavy_check_mark: | `1` left player up, `Q` left player down, `4` right player up, `R` right player down |
| TANK | :heavy_check_mark: | `W` fires, `E` moves right, `Q` moves left, `2` moves down, `S` moves up |
| TETRIS | :heavy_check_mark: | `W` moves left, `E` moves right, `A` moves down, `Q` rotates |
| TICTAC | :heavy_check_mark: | Place X or O on grid by pressing `1`, `2`, `3`, `Q`, `W`, `E`, `A`, `S`, `D` |
| UFO | :heavy_check_mark: | `W` fires up, `E` fires right, `Q` fires left |
| VBRIX | :question: | `1` moves up, `Q` moves down, problem with collision detection |
| ROM Name | Status | Notes |
|:---------------------------------------------------------------------------------------------------|:------------------:|:-------------------------------------------------------------------------------------|
| BRIX | :heavy_check_mark: | `Q` moves left, `E` moves right |
| BLINKY | :heavy_check_mark: | Requires `--shift_quirks` |
| BLITZ | :x: | Problem with screen drawing |
| CONNECT4 | :heavy_check_mark: | `Q` moves left, `E` moves right, `W` drops checker |
| [Glitch Ghost](https://johnearnest.github.io/chip8Archive/play.html?p=glitchGhost) | :x: | Problem with CPU |
| GUESS | :question: | |
| INVADERS | :heavy_check_mark: | Requires `--shift_quirks`, `Q` moves left, `R` moves right, `W` fires |
| KALEID | :question: | Problem with inputs |
| MAZE | :heavy_check_mark: | |
| MERLIN | :heavy_check_mark: | `Q` upper left, `A` lower left, `W` upper right, `S` lower right |
| MISSILE | :heavy_check_mark: | `S` fires |
| [Octojam 1 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam1title) | :heavy_check_mark: | |
| [Octojam 2 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam2title) | :heavy_check_mark: | |
| [Octojam 3 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam3title) | :heavy_check_mark: | |
| [Octojam 4 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam4title) | :heavy_check_mark: | |
| [Octojam 5 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam5title) | :heavy_check_mark: | |
| [Octojam 6 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam6title) | :heavy_check_mark: | |
| [Octojam 7 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam7title) | :heavy_check_mark: | |
| [Octojam 8 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam8title) | :question: | Screen drawing corruption |
| [Octojam 9 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam9title) | :heavy_check_mark: | |
| [Octojam 10 Title](https://johnearnest.github.io/chip8Archive/play.html?p=octojam10title) | :heavy_check_mark: | |
| PONG | :heavy_check_mark: | `1` left player up, `Q` left player down, `4` right player up, `R` right player down |
| PONG2 | :heavy_check_mark: | `1` left player up, `Q` left player down, `4` right player up, `R` right player down |
| [Spock Paper Scissors](https://johnearnest.github.io/chip8Archive/play.html?p=spockpaperscissors) | :heavy_check_mark: | `A` rock, `S` paper, `D` scissors, `Z` lizard, `X` Spock |
| TANK | :heavy_check_mark: | `W` fires, `E` moves right, `Q` moves left, `2` moves down, `S` moves up |
| TETRIS | :heavy_check_mark: | `W` moves left, `E` moves right, `A` moves down, `Q` rotates |
| TICTAC | :heavy_check_mark: | Place X or O on grid by pressing `1`, `2`, `3`, `Q`, `W`, `E`, `A`, `S`, `D` |
| UFO | :heavy_check_mark: | `W` fires up, `E` fires right, `Q` fires left |
| VBRIX | :question: | `1` moves up, `Q` moves down, problem with collision detection |
## Further Documentation
Expand Down
Loading

0 comments on commit 5198cb3

Please sign in to comment.