mirror of
https://github.com/ethauvin/chip-8.git
synced 2025-04-28 10:08:13 -07:00
Merge branch 'ethauvin-master'
This commit is contained in:
commit
6bbfa2f7be
3 changed files with 12 additions and 22 deletions
|
@ -1,7 +1,5 @@
|
||||||
@file:Suppress("MayBeConstant")
|
@file:Suppress("MayBeConstant")
|
||||||
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
|
|
||||||
fun DependencyHandler.impl(vararg dep: Any) = dep.forEach { implementation(it) }
|
fun DependencyHandler.impl(vararg dep: Any) = dep.forEach { implementation(it) }
|
||||||
fun DependencyHandler.testImpl(vararg dep: Any) = dep.forEach { testImplementation(it) }
|
fun DependencyHandler.testImpl(vararg dep: Any) = dep.forEach { testImplementation(it) }
|
||||||
|
|
||||||
|
@ -9,7 +7,6 @@ plugins {
|
||||||
java
|
java
|
||||||
id("org.jetbrains.kotlin.jvm") version "1.3.72"
|
id("org.jetbrains.kotlin.jvm") version "1.3.72"
|
||||||
application
|
application
|
||||||
id("com.github.johnrengelman.shadow") version "5.2.0"
|
|
||||||
id("org.openjfx.javafxplugin") version "0.0.8"
|
id("org.openjfx.javafxplugin") version "0.0.8"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +16,8 @@ repositories {
|
||||||
maven { setUrl("https://plugins.gradle.org/m2") }
|
maven { setUrl("https://plugins.gradle.org/m2") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
|
||||||
|
|
||||||
object This {
|
object This {
|
||||||
val artifactId = "chip8"
|
val artifactId = "chip8"
|
||||||
}
|
}
|
||||||
|
@ -28,26 +27,13 @@ dependencies {
|
||||||
testImpl(kotlin("test"), "org.testng:testng:7.0.0", "org.assertj:assertj-core:3.10.0")
|
testImpl(kotlin("test"), "org.testng:testng:7.0.0", "org.assertj:assertj-core:3.10.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
val test by tasks.getting(Test::class) {
|
|
||||||
useTestNG()
|
|
||||||
}
|
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClassName = "com.beust.chip8.MainKt"
|
mainClassName = "com.beust.chip8.MainKt"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
named<ShadowJar>("shadowJar") {
|
withType<Test> {
|
||||||
archiveBaseName.set(This.artifactId)
|
useTestNG()
|
||||||
mergeServiceFiles()
|
|
||||||
manifest {
|
|
||||||
attributes(mapOf(
|
|
||||||
"Implementation-Title" to rootProject.name,
|
|
||||||
"Implementation-Version" to rootProject.version,
|
|
||||||
"Implementation-Vendor-Id" to rootProject.group,
|
|
||||||
"Created-By" to "Gradle "+ gradle.gradleVersion,
|
|
||||||
"Main-Class" to "com.beust.cedlinks.MainKt"))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class MyFxApp : Application() {
|
||||||
// Computer is paused
|
// Computer is paused
|
||||||
|
|
||||||
// Update the pause button label
|
// Update the pause button label
|
||||||
pauseButton?.text = if (newVal) "Resume" else "Pause"
|
pauseButton?.text = if (newVal) "_Resume" else "_Pause"
|
||||||
|
|
||||||
// Display the disassembly
|
// Display the disassembly
|
||||||
updateDisassembly(disassembly!!, computer.disassemble())
|
updateDisassembly(disassembly!!, computer.disassemble())
|
||||||
|
@ -187,10 +187,14 @@ class MyFxApp : Application() {
|
||||||
exitProcess(0)
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
KeyCode.P -> {
|
KeyCode.P -> {
|
||||||
|
if (computer.paused) {
|
||||||
|
computer.start()
|
||||||
|
} else {
|
||||||
computer.pause()
|
computer.pause()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
if (computer.paused) computer.start()
|
if (computer.paused && event.code != KeyCode.ALT) computer.start()
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
val key = Integer.parseInt(event.code.char, 16)
|
val key = Integer.parseInt(event.code.char, 16)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</padding>
|
</padding>
|
||||||
<Button text="Open rom..." alignment="CENTER" id="loadRom">
|
<Button text="Open rom..." alignment="CENTER" id="loadRom">
|
||||||
</Button>
|
</Button>
|
||||||
<Button text="Pause" id="pause">
|
<Button text="_Pause" id="pause">
|
||||||
</Button>
|
</Button>
|
||||||
<HBox maxWidth="Infinity" spacing="10">
|
<HBox maxWidth="Infinity" spacing="10">
|
||||||
<Label text="Clock speed"/>
|
<Label text="Clock speed"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue