Skip to content

Commit b2ca602

Browse files
committed
Fix web build/run instructions. More nits
1 parent 21d9f94 commit b2ca602

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ If you'd rather use Gradle, run:
3232

3333
To build/run the Javascript version of the emulator, run:
3434
```
35-
./gradlew web:run
35+
./gradlew web:bundle web:run
3636
```
3737

3838
Then, open `http://localhost:8088` on your browser.

lib/src/commonMain/kotlin/com/felipecsl/knes/INESFileParser.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ internal class INESFileParser {
3232
val battery = (control1 shr 1).and(1)
3333
// read prg-rom bank(s)
3434
val prg = ByteArray(inesFileHeader.numPRG.toInt() * 16384)
35-
if (stream.read(prg) != prg.size) {
36-
throw IllegalStateException("Could not load ${prg.size} bytes from the input")
37-
}
35+
check(stream.read(prg) == prg.size) { "Could not load ${prg.size} bytes from the input" }
3836
// read chr-rom bank(s)
3937
val numCHR = inesFileHeader.numCHR.toInt()
4038
var chr = ByteArray(numCHR * 8192)

web/src/jsMain/kotlin/com/felipecsl/knes/Main.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import react.router.dom.switch
88
import kotlin.browser.document
99
import kotlin.browser.window
1010

11-
fun main(args: Array<String>) {
11+
fun main(@Suppress("UnusedMainParameter") args: Array<String>) {
1212
window.onload = {
1313
render(document.getElementById("root")!!) {
1414
hashRouter {

0 commit comments

Comments
 (0)