Skip to content

Commit cbacf60

Browse files
committed
Update Gradle and JDK to more recent versions.
Small change to markdown syntax. Update Github actions to more recent versions. Update to use proper ubuntu-latest for Github Actions
1 parent 7fafaf2 commit cbacf60

File tree

7 files changed

+301
-173
lines changed

7 files changed

+301
-173
lines changed

.github/workflows/gradle.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: Build Test Coverage
22
on: [push, pull_request]
33
jobs:
44
run:
5-
runs-on: ubuntu-20.04
5+
runs-on: ubuntu-latest
66
steps:
77
- name: Checkout
8-
uses: actions/checkout@v3
9-
- name: Setup JDK 11
10-
uses: actions/setup-java@v3
8+
uses: actions/checkout@v6
9+
- name: Setup JDK 17
10+
uses: actions/setup-java@v5
1111
with:
12-
java-version: '11'
12+
java-version: '17'
1313
distribution: 'adopt'
1414
- name: Install xvfb for headless testing
1515
run: sudo apt-get install xvfb
@@ -18,6 +18,6 @@ jobs:
1818
- name: Build with Gradle
1919
run: xvfb-run --auto-servernum ./gradlew build
2020
- name: Codecov
21-
uses: codecov/codecov-action@v4.2.0
21+
uses: codecov/codecov-action@v5
2222
env:
2323
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ of the emulator written in different languages:
4747
The original goal of these projects was to learn how to code a simple emulator.
4848

4949
In addition to supporting Chip 8 ROMs, the emulator also supports the
50-
[XO Chip](https://johnearnest.github.io/Octo/docs/XO-ChipSpecification.html)
51-
and [Super Chip](https://github.com/JohnEarnest/Octo/blob/gh-pages/docs/SuperChip.md) specifications.
52-
Note that while there are no special flags that are needed to run an XO Chip,
50+
[XO Chip](https://johnearnest.github.io/Octo/docs/XO-ChipSpecification.html) and [Super Chip](https://github.com/JohnEarnest/Octo/blob/gh-pages/docs/SuperChip.md) specifications. Note that while there
51+
are no special flags that are needed to run an XO Chip,
5352
Super Chip, or normal Chip 8 ROM, there are other compatibility flags that
5453
may need to be set for the ROM to run properly. See the [Quirks Modes](#quirks-modes)
5554
documentation below for more information.
@@ -66,13 +65,25 @@ software components.
6665

6766
## Compiling
6867

69-
To compile the project, you will need a Java Development Kit (JDK) version 8 or greater installed.
70-
Recently, Oracle has changed their license agreement to make personal and developmental use of their
71-
JDK free. However, some other use cases may require a paid subscription. Oracle's version of the
72-
JDK can be downloaded [here](https://www.oracle.com/technetwork/java/javase/downloads/index.html).
73-
Alternatively, if you prefer to use a JRE with an open-source license (GPL v2 with Classpath
74-
Exception), you may visit [https://adoptopenjdk.net](https://adoptopenjdk.net) and install the
75-
latest Java Development Kit (JDK) for your system. Again, JDK version 8 or better will work correctly.
68+
To compile the project, you will need a Java Development Kit (JDK) version 17 or greater installed
69+
(note that these steps are only needed if you want to compile the software yourself - if you just
70+
want to run the emulator, see the [Running](#running) section below).
71+
72+
1. *For Linux* - the simplest way to install the JDK is to use OpenJDK:
73+
74+
```bash
75+
sudo apt update
76+
sudo apt install openjdk-17-jdk
77+
```
78+
79+
2. *For Windows* - I recommend using Eclipse Temurin (formerly AdoptJDK) as the software
80+
is licensed under the GNU license version 2 with classpath exception. The latest
81+
JRE builds are available at [https://adoptium.net/en-GB/temurin/releases](https://adoptium.net/en-GB/temurin/releases)
82+
(make sure you select _JDK_ as the type you wish to download). The MSI method
83+
will download an installer that will download and can be run to install the
84+
JDK for you. Follow the prompts for more information. Note that this will also
85+
install the appropriate JRE as well.
86+
7687

7788
To build the project, switch to the root of the source directory, and
7889
type:
@@ -84,34 +95,60 @@ On Windows, switch to the root of the source directory, and type:
8495
gradlew.bat build
8596

8697
The compiled JAR file will be placed in the `build/libs` directory, as a file called
87-
`emulator-2.0.0-all.jar`.
98+
`emulator-2.0.2-all.jar`.
8899

89100

90101
## Running
91102

92-
### Requirements
103+
The project needs several different packages installed in order to run the
104+
emulator properly. Please see the platform specific steps below for
105+
more information.
106+
107+
### Linux
108+
109+
You will need to install the Java Runtime Environment (JRE) 17 or
110+
higher.
111+
112+
1. Java Runtime Environment (JRE) version 17 or higher. The simplest way to
113+
do this is to install _OpenJDK 17_ or higher. On Ubuntu or Debian systems, this can
114+
be done with :
115+
116+
```bash
117+
sudo apt update
118+
sudo apt install openjdk-17-jre
119+
```
120+
121+
2. Check that installation was successful by typing:
122+
123+
```bash
124+
java -version
125+
```
126+
127+
### Windows
128+
129+
You will need to install the Java Runtime Environment (JRE) 17 or higher.
130+
131+
1. I recommend using Eclipse Temurin (formerly AdoptJDK) as the software
132+
is licensed under the GNU license version 2 with classpath exception. The latest
133+
JRE builds are available at [https://adoptium.net/en-GB/temurin/releases](https://adoptium.net/en-GB/temurin/releases)
134+
(make sure you select _JRE_ as the type you wish to download). The MSI method
135+
will download an installer that will download and can be run to install the
136+
JRE for you. Follow the prompts for more information.
93137

94-
You will need a copy of the Java Runtime Environment (JRE) version 8 or greater installed
95-
in order to run the compiled JAR file. For most systems, you can install Java 8 JRE by visiting
96-
[http://java.com](http://java.com) and installing the Oracle Java Runtime Environment for your
97-
platform. This version of the JRE is free for personal use but contains a custom binary license
98-
from Oracle. Alternatively, if you prefer to use a JRE with an open-source license (GPL
99-
v2 with Classpath Exception), you may visit [https://adoptopenjdk.net](https://adoptopenjdk.net)
100-
and install the latest Java Development Kit (JDK) for your system, which will include an appropriate JRE.
101138

102139
### Starting the Emulator
103140

104141
By default, the emulator can start up without a ROM loaded. Simply double-click
105142
the JAR file, or run it with the following command line:
106143

107-
java -jar emulator-2.0.0-all.jar
144+
java -jar emulator-2.0.2-all.jar
108145

109146
### Running a ROM
110147

111148
The command-line interface currently requires a single argument, which
112149
is the full path to a Chip 8 ROM:
113150

114-
java -jar emulator-2.0.0-all.jar /path/to/rom/filename
151+
java -jar emulator-2.0.2-all.jar /path/to/rom/filename
115152

116153
This will start the emulator with the specified ROM.
117154

@@ -120,7 +157,7 @@ This will start the emulator with the specified ROM.
120157
The `--scale` switch will scale the size of the window (the original size
121158
at 1x scale is 64 x 32):
122159

123-
java -jar emulator-2.0.0-all.jar /path/to/rom/filename --scale 10
160+
java -jar emulator-2.0.2-all.jar /path/to/rom/filename --scale 10
124161

125162
The command above will scale the window so that it is 10 times the normal
126163
size.
@@ -129,8 +166,9 @@ size.
129166

130167
The `--ticks` switch will limit the number of instructions per second that the
131168
emulator is allowed to run. By default, the value is set to 1,000. Minimum values
132-
are 200. Use this switch to adjust the running time of ROMs that execute too quickly.
133-
For simplicity, each instruction is assumed to take the same amount of time.
169+
are 200. Use this switch to adjust the running time of ROMs that execute too quickly.
170+
For Super Chip 8 or XO Chip 8 ROMs, you will probably want to execute more instructions
171+
per second. For simplicity, each instruction is assumed to take the same amount of time.
134172

135173
### Quirks Modes
136174

build.gradle

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,28 @@ plugins {
88
id 'java'
99
id 'jacoco'
1010
id 'application'
11-
id 'com.github.johnrengelman.shadow' version '8.1.1'
11+
id 'com.gradleup.shadow' version '9.2.2'
1212
}
1313

1414
group = 'ca.craigthomas'
15-
version = '2.0.1'
15+
version = '2.0.2'
1616

17-
mainClassName = 'ca.craigthomas.chip8java.emulator.runner.Runner'
17+
java {
18+
sourceCompatibility = JavaVersion.VERSION_17
19+
}
1820

19-
sourceCompatibility = 1.8
21+
application {
22+
mainClass.set("ca.craigthomas.chip8java.emulator.runner.Runner")
23+
}
2024

2125
repositories {
2226
mavenCentral()
2327
}
2428

2529
dependencies {
2630
implementation 'com.beust:jcommander:1.82'
27-
implementation 'commons-io:commons-io:2.20.0'
28-
testImplementation 'org.mockito:mockito-core:5.+'
31+
implementation 'commons-io:commons-io:2.21.0'
32+
testImplementation 'org.mockito:mockito-core:5.20.0'
2933
testImplementation 'junit:junit:4.13.2'
3034
}
3135

gradle/wrapper/gradle-wrapper.jar

7.99 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)