Add C64 SID audio output via OpenSL ES with sound toggle

This commit is contained in:
ml
2026-06-13 13:40:24 +02:00
parent 7a8cd492d5
commit 5a390aa733
12 changed files with 435 additions and 88 deletions
@@ -130,6 +130,48 @@ tasks.whenTaskAdded {
}
}
// ---------------------------------------------------------------------------
// ROM extraction task
//
// Extracts C64 and drive ROMs from the bundled VICE tarball into the Android
// assets directory so they are packaged into the APK automatically.
// Output files are gitignored — the tarball is the single source of truth.
// ---------------------------------------------------------------------------
val assetsDir = layout.projectDirectory.dir("src/main/assets")
tasks.register<Copy>("extractViceRoms") {
group = "build"
description = "Extract C64 and 1541 ROMs from the VICE tarball into assets/"
from(tarTree(viceTarball.asFile)) {
include("vice-3.8/data/C64/kernal-901227-03.bin")
include("vice-3.8/data/C64/basic-901226-01.bin")
include("vice-3.8/data/C64/chargen-901225-01.bin")
include("vice-3.8/data/DRIVES/dos1541-325302-01+901229-05.bin")
eachFile {
// Flatten the tarball directory structure: place each ROM directly
// in assets/ with its short name rather than the versioned filename.
relativePath = RelativePath(true, when (name) {
"kernal-901227-03.bin" -> "kernal"
"basic-901226-01.bin" -> "basic"
"chargen-901225-01.bin" -> "chargen"
"dos1541-325302-01+901229-05.bin" -> "1541"
else -> name
})
}
includeEmptyDirs = false
}
into(assetsDir)
}
// Run extractViceRoms before assets are merged into the APK.
tasks.whenTaskAdded {
if (name.startsWith("merge") && name.endsWith("Assets")) {
dependsOn("extractViceRoms")
}
}
dependencies {
implementation(libs.androidx.activity.ktx)
implementation(libs.androidx.appcompat)