mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-13 08:04:03 +09:00
Update VMEmuExecutable.kt
This commit is contained in:
@@ -96,7 +96,7 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
|||||||
private val currentlyLoadedProfiles = HashMap<String, VM>()
|
private val currentlyLoadedProfiles = HashMap<String, VM>()
|
||||||
fun getVMbyProfileName(name: String): VM? {
|
fun getVMbyProfileName(name: String): VM? {
|
||||||
if (profiles.containsKey(name)) {
|
if (profiles.containsKey(name)) {
|
||||||
return currentlyLoadedProfiles.getOrPut(name) { _makeVMfromJson(profiles[name]!!) }
|
return currentlyLoadedProfiles.getOrPut(name) { _makeVMfromJson(profiles[name]!!, name) }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return null
|
return null
|
||||||
@@ -464,7 +464,9 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
private fun _makeVMfromJson(json: JsonValue): VM {
|
private fun _makeVMfromJson(json: JsonValue, profileName: String): VM {
|
||||||
|
println("Processing profile '$profileName'")
|
||||||
|
|
||||||
val assetsDir = json.getString("assetsdir")
|
val assetsDir = json.getString("assetsdir")
|
||||||
val ramsize = json.getLong("ramsize")
|
val ramsize = json.getLong("ramsize")
|
||||||
val cardslots = json.getInt("cardslots")
|
val cardslots = json.getInt("cardslots")
|
||||||
@@ -507,7 +509,7 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!successful) {
|
if (!successful) {
|
||||||
throw RuntimeException("Invalid or insufficient arguments for ${className}")
|
throw RuntimeException("Invalid or insufficient arguments for $className in the profile $profileName")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user