diff --git a/limbo-android-arm/src/main/AndroidManifest.xml b/limbo-android-arm/src/main/AndroidManifest.xml index 0823c2de1..d02d4e592 100644 --- a/limbo-android-arm/src/main/AndroidManifest.xml +++ b/limbo-android-arm/src/main/AndroidManifest.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" package="com.limbo.emu.main.arm" android:versionCode="60001" - android:versionName="6.0.1-arm"> + android:versionName="6.0.1-arm-dev"> paramsList) { paramsList.add(initrd); } + String dtb = getDTB(); + if (dtb != null && !dtb.equals("")) { + paramsList.add("-dtb"); + paramsList.add(dtb); + } + if (getMachine().getAppend() != null && !getMachine().getAppend().equals("")) { paramsList.add("-append"); paramsList.add(getMachine().getAppend()); @@ -521,6 +527,10 @@ private String getInitRd() { return FileUtils.encodeDocumentFilePath(getMachine().getInitRd()); } + private String getDTB() { + return FileUtils.encodeDocumentFilePath(getMachine().getDTB()); + } + private String getKernel() { return FileUtils.encodeDocumentFilePath(getMachine().getKernel()); } diff --git a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/Dispatcher.java b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/Dispatcher.java index 146932e75..8cbf870be 100644 --- a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/Dispatcher.java +++ b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/Dispatcher.java @@ -137,8 +137,6 @@ private void requestFieldChange(MachineProperty property, Object value) { setDriveEnabled(value); break; case NON_REMOVABLE_DRIVE: - setDrive(value); - break; case REMOVABLE_DRIVE: setDrive(value); break; @@ -162,6 +160,9 @@ private void requestFieldChange(MachineProperty property, Object value) { case INITRD: getMachine().setInitRd(convertString(property, value)); break; + case DTB: + getMachine().setDTB(convertString(property, value)); + break; case APPEND: getMachine().setAppend(convertString(property, value)); break; diff --git a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/Machine.java b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/Machine.java index f753faf73..8bdd85438 100644 --- a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/Machine.java +++ b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/Machine.java @@ -71,6 +71,7 @@ public class Machine extends Observable { private String bootDevice = "Default"; private String kernel; private String initRd; + private String dtb; private String append; // net private String network = null; @@ -498,6 +499,19 @@ void setInitRd(String initRd) { } + public String getDTB() { + return dtb; + } + + void setDTB(String DTB) { + if (this.dtb == null || !this.dtb.equals(DTB)) { + this.dtb = DTB; + setChanged(); + notifyChanged(MachineProperty.DTB, DTB); + } + + } + public String getAppend() { return append; } @@ -701,7 +715,7 @@ private void notifyChanged(MachineProperty property, Object value) { public enum FileType { CDROM, FDA, FDB, SD, HDA, HDB, HDC, HDD, SHARED_DIR, - KERNEL, INITRD, + KERNEL, INITRD, DTB, EXPORT_DIR, IMAGE_DIR, LOG_DIR, IMPORT_FILE, IMPORT_BIOS_FILE } diff --git a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/MachineProperty.java b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/MachineProperty.java index f9dcfb99e..daf8fef04 100644 --- a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/MachineProperty.java +++ b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/machine/MachineProperty.java @@ -27,9 +27,9 @@ public enum MachineProperty { HDA, HDB, HDC, HDD, SHARED_FOLDER, SHARED_FOLDER_MODE, HDCONFIG, CDROM, FDA, FDB, SD, MEDIA_INTERFACE, HDA_INTERFACE, HDB_INTERFACE, HDC_INTERFACE, HDD_INTERFACE, CDROM_INTERFACE, - BOOT_CONFIG, KERNEL, INITRD, APPEND, + BOOT_CONFIG, KERNEL, INITRD, DTB, APPEND, VGA, SOUNDCARD, NETCONFIG, HOSTFWD, GUESTFWD, NICCONFIG, NON_REMOVABLE_DRIVE, REMOVABLE_DRIVE, DRIVE_ENABLED, - EXTRA_PARAMS, OTHER + EXTRA_PARAMS, OTHER; } diff --git a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/main/LimboActivity.java b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/main/LimboActivity.java index 5d253f04f..b16e492d0 100644 --- a/limbo-android-lib/src/main/java/com/max2idea/android/limbo/main/LimboActivity.java +++ b/limbo-android-lib/src/main/java/com/max2idea/android/limbo/main/LimboActivity.java @@ -132,6 +132,7 @@ public class LimboActivity extends AppCompatActivity private Spinner mMachineType; private Spinner mCPUNum; private Spinner mKernel; + private Spinner mDTB; private Spinner mInitrd; // HDD private ImageView mHDAOptions; @@ -440,6 +441,26 @@ public void onNothingSelected(AdapterView parentView) { } }); + mDTB.setOnItemSelectedListener(new OnItemSelectedListener() { + public void onItemSelected(AdapterView parentView, View selectedItemView, int position, long id) { + if (getMachine() == null) + return; + String initrd = (String) ((ArrayAdapter) mDTB.getAdapter()).getItem(position); + if (position == 0) { + notifyFieldChange(MachineProperty.DTB, initrd); + } else if (position == 1) { + browseFileType = FileType.DTB; + LimboFileManager.browse(LimboActivity.this, browseFileType, Config.OPEN_IMAGE_FILE_REQUEST_CODE); + mDTB.setSelection(0); + } else if (position > 1) { + notifyFieldChange(MachineProperty.DTB, initrd); + } + } + + public void onNothingSelected(AdapterView parentView) { + } + }); + mBootDevices.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView parentView, View selectedItemView, int position, long id) { if (getMachine() == null) @@ -921,6 +942,7 @@ private void disableListeners() { mBootDevices.setOnItemSelectedListener(null); mKernel.setOnItemSelectedListener(null); mInitrd.setOnItemSelectedListener(null); + mDTB.setOnItemSelectedListener(null); mAppend.setOnFocusChangeListener(null); mVGAConfig.setOnItemSelectedListener(null); mSoundCard.setOnItemSelectedListener(null); @@ -1017,6 +1039,7 @@ private void setupDiskMapping() { addDiskMapping(FileType.KERNEL, mKernel, null, MachineProperty.KERNEL); addDiskMapping(FileType.INITRD, mInitrd, null, MachineProperty.INITRD); + addDiskMapping(FileType.DTB, mDTB, null, MachineProperty.DTB); } private void addDiskMapping(FileType fileType, Spinner spinner, @@ -1263,6 +1286,7 @@ private void populateDisks() { //boot populateDiskAdapter(mKernel, FileType.KERNEL, false); populateDiskAdapter(mInitrd, FileType.INITRD, false); + populateDiskAdapter(mDTB, FileType.DTB, false); } @@ -1407,6 +1431,7 @@ private void enableNonRemovableDeviceOptions(boolean flag) { mBootDevices.setEnabled(flag); mKernel.setEnabled(flag); mInitrd.setEnabled(flag); + mDTB.setEnabled(flag); mAppend.setEnabled(flag); //graphics @@ -1635,9 +1660,10 @@ public void setupWidgets() { mBootDevices = findViewById(R.id.bootfromval); mKernel = findViewById(R.id.kernelval); mInitrd = findViewById(R.id.initrdval); + mDTB = findViewById(R.id.DTBval); mAppend = findViewById(R.id.appendval); - //display + //displayDTB mVGAConfig = findViewById(R.id.vgacfgval); //sound @@ -1923,6 +1949,7 @@ public void updateBootSummary(boolean clear) { String text = "Boot from: " + getMachine().getBootDevice(); text = appendDriveFilename(getMachine().getKernel(), text, "kernel", false); text = appendDriveFilename(getMachine().getInitRd(), text, "initrd", false); + text = appendDriveFilename(getMachine().getDTB(), text, "DTB", false); text = appendDriveFilename(getMachine().getAppend(), text, "append", false); mBootSectionSummary.setText(text); } @@ -2851,6 +2878,7 @@ private void updateFavAdapters() { mSD.getAdapter().getCount(); mKernel.getAdapter().getCount(); mInitrd.getAdapter().getCount(); + mDTB.getAdapter().getCount(); } private void addGenericOperatingSystems() { diff --git a/limbo-android-lib/src/main/res/layout/boot_layout.xml b/limbo-android-lib/src/main/res/layout/boot_layout.xml index e4ac1e701..7702ecd33 100644 --- a/limbo-android-lib/src/main/res/layout/boot_layout.xml +++ b/limbo-android-lib/src/main/res/layout/boot_layout.xml @@ -157,6 +157,39 @@ android:textSize="15sp" /> + + + + + + + + +