Skip to content
This repository was archived by the owner on Apr 25, 2021. It is now read-only.

Commit 66a0d3e

Browse files
committedOct 19, 2018
버전 업데이트
1 parent 051964f commit 66a0d3e

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed
 

‎src/main/java/kr/pe/ecmaxp/openpython/OpenPython.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
1818
name = OpenPython.NAME,
1919
version = OpenPython.VERSION,
2020
dependencies = "required-after:forgelin;required-after:opencomputers;",
21-
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter")
21+
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter"
22+
/*@MCVERSIONDEP@*/)
2223
object OpenPython {
2324
const val MODID = "openpython"
2425
const val NAME = "OpenPython"
25-
const val VERSION = "1.0.0"
26+
const val VERSION = "1.0.1"
2627

2728
@Mod.EventHandler
2829
fun preInit(event: FMLPreInitializationEvent) {
@@ -41,7 +42,7 @@ object OpenPython {
4142

4243
Items.registerEEPROM(
4344
"EEPROM (OpenPython BIOS)",
44-
OpenPythonFirmware.v1_0_0.loadEEPROM(),
45+
OpenPythonFirmware.v1_0_1.loadEEPROM(),
4546
byteArrayOf(),
4647
false
4748
)

‎src/main/java/kr/pe/ecmaxp/openpython/arch/OpenPythonArchitecture.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open class OpenPythonArchitecture(val machine: Machine) : Architecture {
2323
close()
2424

2525
try {
26-
val firmware = OpenPythonFirmware("v1.0.0") // TODO: OpenPythonFirmware mapping
26+
val firmware = OpenPythonFirmware.v1_0_1
2727
recomputeMemory(machine.host().internalComponents())
2828
vm = OpenPythonVirtualMachine(machine, totalMemory, firmware)
2929
} catch (e: Exception) {

‎src/main/java/kr/pe/ecmaxp/openpython/arch/OpenPythonFirmware.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class OpenPythonFirmware(val name: String) {
1111
private val path: String = "/assets/${OpenPython.MODID}/firmwares/$name"
1212

1313
companion object {
14-
val v1_0_0 = OpenPythonFirmware("v1.0.0")
14+
val v1_0_1 = OpenPythonFirmware("v1.0.1")
1515
}
1616

1717
init {

‎src/main/java/kr/pe/ecmaxp/openpython/arch/OpenPythonVirtualMachine.kt

+12-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,18 @@ class OpenPythonVirtualMachine internal constructor(val machine: Machine, val me
6868
// firmware
6969
val firmwareTag = rootTag.getCompoundTag("firmware")
7070
val firmwareName = firmwareTag.getString("name")
71-
if (firmware.name != firmwareName)
72-
firmware = OpenPythonFirmware(firmwareName)
71+
if (firmware.name != firmwareName) {
72+
try {
73+
firmware = OpenPythonFirmware(firmwareName)
74+
} catch (e: Exception) {
75+
if (firmwareName.startsWith("v1.0.")) {
76+
e.printStackTrace()
77+
firmware = OpenPythonFirmware.v1_0_1
78+
} else {
79+
throw e;
80+
}
81+
}
82+
}
7383

7484

7585
// cpu

‎src/main/java/kr/pe/ecmaxp/openpython/console/OpenPieBenchmark.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object OpenPythonBenchmark {
1717
@JvmStatic
1818
fun main(args: Array<String>) {
1919
val cpu = CPU()
20-
val firmware = OpenPythonFirmware.v1_0_0
20+
val firmware = OpenPythonFirmware.v1_0_1
2121
cpu.memory.apply {
2222
flash(FLASH.address, FLASH.size, firmware.loadFirmware())
2323
map(SRAM.address, SRAM.size, MemoryFlag.RW) // ram

0 commit comments

Comments
 (0)
Failed to load comments.