You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add new routines to query game devices and poll from them.
Implement comparator to joystick voltages.
Fix reversed controls, add CA2 auto-transition when bit 4 is zero.
Add ability to set joystick via config file
* Clarify README for joystick usage and JDK and JRE selection.
Finally, you will need to add yourself to the `input` group so that the emulator can read
108
+
joystick information:
109
+
110
+
```bash
111
+
sudo usermod -a -G input <your username>
112
+
```
113
+
114
+
You will need to end your current session and restart in order for the group information
115
+
to be updated. In some cases, you may need to reboot for the group change to take effect.
116
+
117
+
To run the emulator, see the section called [Running](#running) below.
118
+
119
+
### Windows
120
+
121
+
At a minimum, you will need to install the Java Runtime Environment (JRE) 17 or
122
+
higher.
123
+
124
+
1.*Required* - a Java Runtime Environment (JRE) version 17 or higher. I recommend using
125
+
Eclipse Temurin JRE (formerly AdoptJDK) as the software
126
+
is licensed under the GNU license version 2 with classpath exception. The latest
127
+
JRE builds are available at [https://adoptium.net/en-GB/temurin/releases](https://adoptium.net/en-GB/temurin/releases)
128
+
(make sure you select _JRE_ as the type you wish to download). Run the installer
129
+
and follow the directions as required to install the runtime.
130
+
131
+
To run the emulator, see the section called [Running](#running) below.
132
+
133
+
## Compiling From Source
134
+
135
+
_Note this section is optional - this is only if you want to compile the project
136
+
yourself from source code._ If you want to build the emulator from source code,
137
+
you will need a copy of the Java Development Kit (JDK) version 17 or greater
138
+
installed in to compile the JAR file.
139
+
140
+
### Linux
141
+
142
+
For most Linux distributions there is likely an `openjdk-17-jdk` package that will do
143
+
this for you automatically. On Ubuntu and Debian based systems, this is typically:
144
+
145
+
```bash
146
+
sudo apt update
147
+
sudo apt install openjdk-17-jdk
148
+
```
149
+
150
+
Next, to build the project, switch to the root of the source directory, and type:
151
+
66
152
```bash
67
153
./gradlew build
68
154
```
69
155
70
-
On Windows, switch to the root of the source directory, and type:
156
+
The compiled Jar file will be placed in the `build/libs` directory. Note that
157
+
for some components such as joystick detection and control to work correctly,
158
+
operating-specific steps may be required. See the _Requirements_ section above
159
+
to install necessary sub-systems.
160
+
161
+
162
+
### Windows
163
+
164
+
For Windows, I recommend using Eclipse Temurin JDK (formerly AdoptJDK) as the software
165
+
is licensed under the GNU license version 2 with classpath exception. The latest
166
+
JDK builds are available at [https://adoptium.net/en-GB/temurin/releases](https://adoptium.net/en-GB/temurin/releases)
167
+
(make sure you select _JDK_ as the type you wish to download).
168
+
169
+
Next, switch to the root of the source directory, and type:
71
170
72
171
```bash
73
172
gradlew.bat build
74
173
```
75
174
76
-
The compiled Jar file will be placed in the `build/libs` directory.
175
+
The compiled Jar file will be placed in the `build/libs` directory. Note that
176
+
for some components such as joystick detection and control to work correctly,
177
+
operating-specific steps may be required. See the _Requirements_ section above
178
+
to install necessary sub-systems.
77
179
78
180
79
181
## Running
80
182
81
-
For the emulator to run, you will need to have the Java 8 Runtime Environment (JRE)
82
-
installed on your computer. See [Oracle's Java SE Runtime Environment Download](https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)
83
-
page for more information on installing the JRE. Alternatively, you can
84
-
use [OpenJDK](https://openjdk.java.net/install/).
85
-
86
183
Simply double-clicking the jar file will start the emulator running. By
87
184
default, the emulator will be in paused mode until you attach a system
88
185
ROM to it. You can do so by clicking *ROM*, *Load System ROM*. You can
@@ -192,6 +289,22 @@ select a location on your computer where the disk file will be saved to.
192
289
Once entered, the contents of the drive will be saved to the virtual disk
193
290
file, and can be loaded from the host computer in a future session.
194
291
292
+
## Joysticks
293
+
294
+
Joystick control is still experimental and only currently available under
295
+
Linux. When running the emulator, to set the joystick to be used,
296
+
click on *Joystick* and then *Left Joystick* or *Right Joystick* to select
297
+
which device should be used as the left or right joystick. If no USB
298
+
joystick devices are found, then *No joystick* will be the only option
299
+
available.
300
+
301
+
To troubleshoot joystick configuration, when the emulator starts, a
302
+
list of detected joysticks will be printed to the console. The
303
+
`Joystick #0` device will always be `No Joystick`. Other enumerated
304
+
joysticks will be printed after this one. The name of the detected joystick
305
+
can be used in the configuration file below to automatically associate
306
+
the left or right joystick device during emulator startup.
307
+
195
308
196
309
## Configuration File
197
310
@@ -205,19 +318,22 @@ Super Extended Color Basic ROM file).
205
318
Megabug).
206
319
*`cassetteROM` - the full path to the ROM file used in the cassette recorder.
207
320
*`drive0Image` - the `DSK` image to be used in drive 0.
208
-
*`drive1Image` - the `DSK` image to be used in drive 0.
209
-
*`drive2Image` - the `DSK` image to be used in drive 0.
210
-
*`drive3Image` - the `DSK` image to be used in drive 0.
321
+
*`drive1Image` - the `DSK` image to be used in drive 1.
322
+
*`drive2Image` - the `DSK` image to be used in drive 2.
323
+
*`drive3Image` - the `DSK` image to be used in drive 3.
324
+
*`leftJoystick` - the name of the detected joystick to use as the left joystick.
325
+
*`rightJoystick` - the name of the detected joystick to use as the right joystick.
211
326
212
327
Leaving any one of the keys out will result in the emulator ignoring that particular
213
-
ROM image. An example YAML configuration file that specifies ROMs to use for the
214
-
system, cartridge slot, cassette, and drive 0 is as follows:
328
+
configuration option. An example YAML configuration file that specifies ROMs to use for the
329
+
system, cartridge slot, cassette, joystick, and drive 0 is as follows:
215
330
216
331
```
217
332
systemROM: "C:\Users\basic3.rom"
218
333
cartridgeROM: "C:\disk11.rom"
219
334
cassetteROM: "C:\Users\zaxxon.cas"
220
335
drive0Image: "C:\megabug.dsk"
336
+
leftJoystick: "usb gamepad"
221
337
```
222
338
223
339
If you start the emulator without command-line arguments, it will look for a configuration file named
0 commit comments