1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Falke_34

Beiträge von Falke_34

  • QEmu GUI - erstellen virtuelles Image

    • Falke_34
    • 18. September 2024 um 18:03

    Auch wenn jetzt doch etwas Zeit vergangen ist......möchte ich euch auch hier ein neues QEmu PPC GUI vorstellen

    Vielleicht sind ja für den ein oder anderen noch ein paar Ideen dabei

    Verzeit bitte das dieses GUI derzeit nur für die Emulation der QEmu PC Machinen: Pegasos2, AmigaOne und Sam460ex verwendbar ist

    Für all diese werden noch die benötigten AmigaOS 4 Betriebssysteme benötigt!

    Kleines Update des Guis:

    - Mac99 Emulation und Sungem Netzwerkkarte hinzugefügt


    Nun sollten folgende Konfigurationen laufen:
    MorphOS 3.18 (ISO): Pegasos 2 + Bios + 1024 + GTK + SM501 + ES1370 + RTL8139 (In Console eingeben: boot cd boot.img)

    MacOS 9.2.2 (HD): Mac99 + 1024 + GTK/SDL + VGA + AC97 + Sungem

    AmigaOS 4.1 (HD/ISO): Pegasos 2 + Kernel BBoot + 1024 + GTK/SDL + SM501 + ES1370 + RTL8139
    AmigaOS 4.1 (HD/ISO): AmigaOne + Loader BBoot + 1024 + GTK/SDL + SM501 + ES1370 + RTL8139
    AmigaOS 4.1 (HD/ISO): Sam460ex + 1024 + GTK/SDL + SM501 + ES1370 + RTL8139


    sshot-1.jpg


    C
    #include <GUIConstantsEx.au3>
    #include <File.au3>
    #include <MsgBoxConstants.au3>
    
    Global $iniFile = @ScriptDir & "\qemu_ppc_config.ini"
    
    ; Erstelle das GUI
    GUICreate("QEMU PPC GUI v1.0", 600, 680)
    
    ; Pfad zu QEMU PPC
    GUICtrlCreateLabel("Pfad zu QEMU PPC:", 10, 10, 130, 20)
    Global $inputQemuPath = GUICtrlCreateInput("", 150, 10, 320, 20)
    Global $btnQemuPath = GUICtrlCreateButton("Durchsuchen", 480, 10, 100, 20)
    
    ; Maschine Auswahl
    GUICtrlCreateLabel("Maschine:", 10, 40, 130, 20)
    Global $comboMachine = GUICtrlCreateCombo("", 150, 40, 320, 20)
    GUICtrlSetData($comboMachine, "amigaone|pegasos2|sam460ex|mac99")
    
    ; Speicher (RAM)
    GUICtrlCreateLabel("Speicher (MB):", 10, 70, 130, 20)
    Global $inputMemory = GUICtrlCreateInput("1024", 150, 70, 320, 20)
    
    ; ISO-Datei (optional)
    GUICtrlCreateLabel("ISO-Datei (optional):", 10, 100, 130, 20)
    Global $inputISO = GUICtrlCreateInput("", 150, 100, 320, 20)
    Global $btnISO = GUICtrlCreateButton("Durchsuchen", 480, 100, 100, 20)
    
    ; Festplatte 1 (optional)
    GUICtrlCreateLabel("Festplatte 1 (optional):", 10, 130, 130, 20)
    Global $inputDisk1 = GUICtrlCreateInput("", 150, 130, 320, 20)
    Global $btnDisk1 = GUICtrlCreateButton("Durchsuchen", 480, 130, 100, 20)
    
    ; Festplatte 2 (optional)
    GUICtrlCreateLabel("Festplatte 2 (optional):", 10, 160, 130, 20)
    Global $inputDisk2 = GUICtrlCreateInput("", 150, 160, 320, 20)
    Global $btnDisk2 = GUICtrlCreateButton("Durchsuchen", 480, 160, 100, 20)
    
    ; VGA Auswahl
    GUICtrlCreateLabel("VGA Device:", 10, 190, 130, 20)
    Global $comboVGA = GUICtrlCreateCombo("", 150, 190, 320, 20)
    GUICtrlSetData($comboVGA, "std|cirrus|none")
    
    ; Display Auswahl
    GUICtrlCreateLabel("Display:", 10, 220, 130, 20)
    Global $comboDisplay = GUICtrlCreateCombo("", 150, 220, 320, 20)
    GUICtrlSetData($comboDisplay, "gtk|sdl|none")
    
    ; Device Grafik
    GUICtrlCreateLabel("Grafik Device:", 10, 250, 130, 20)
    Global $comboGraphics = GUICtrlCreateCombo("", 150, 250, 320, 20)
    GUICtrlSetData($comboGraphics, "sm501|ati-vga|cirrus-vga|bochs-display|VGA")
    
    ; Vollbild-Modus (Fullscreen) an/aus
    Global $chkFullscreen = GUICtrlCreateCheckbox("Fullscreen aktivieren", 10, 280, 320, 20)
    
    ; Sound Device Auswahl
    GUICtrlCreateLabel("Sound Device:", 10, 310, 130, 20)
    Global $comboSound = GUICtrlCreateCombo("", 150, 310, 320, 20)
    GUICtrlSetData($comboSound, "ac97|sb16|es1370")
    
    ; Netzwerk
    GUICtrlCreateLabel("Netzwerk:", 10, 340, 130, 20)
    Global $comboNetwork = GUICtrlCreateCombo("", 150, 340, 320, 20)
    GUICtrlSetData($comboNetwork, "user|tap|bridge|virtio|rtl8139|sungem")
    
    ; BIOS Datei (optional, für pegasos2 und amigaone)
    GUICtrlCreateLabel("BIOS-Datei (optional):", 10, 370, 130, 20)
    Global $inputBios = GUICtrlCreateInput("", 150, 370, 320, 20)
    Global $btnBios = GUICtrlCreateButton("Durchsuchen", 480, 370, 100, 20)
    
    ; Ordner Freigabe (optional)
    GUICtrlCreateLabel("Freigabe Ordner (optional):", 10, 400, 130, 20)
    Global $inputFolder = GUICtrlCreateInput("", 150, 400, 320, 20)
    Global $btnFolder = GUICtrlCreateButton("Ordner auswählen", 480, 400, 100, 20)
    
    GUICtrlCreateLabel("BBoot: Only Pegasos2", 220, 450, 320, 20)
    
    ; Kernel Datei (optional, nur für pegasos2)
    GUICtrlCreateLabel("Kernel-Datei (optional):", 10, 480, 130, 20)
    Global $inputKernel = GUICtrlCreateInput("", 150, 480, 320, 20)
    
    ; Button für Kernel Examples
    Global $btnKernelLoader = GUICtrlCreateButton("Examples", 480, 480, 100, 20)
    
    GUICtrlCreateLabel("BBoot: Only AmigaOne", 220, 520, 320, 20)
    
    ; Device Loader 1 (optional, nur für amigaone)
    GUICtrlCreateLabel("Device Loader 1 (optional):", 10, 550, 130, 20)
    Global $inputLoader1 = GUICtrlCreateInput("", 150, 550, 320, 20)
    
    ; Device Loader 2 (optional, nur für amigaone)
    GUICtrlCreateLabel("Device Loader 2 (optional):", 10, 580, 130, 20)
    Global $inputLoader2 = GUICtrlCreateInput("", 150, 580, 320, 20)
    
    ; Button für Device Loader Examples
    Global $btnExampleLoader = GUICtrlCreateButton("Examples", 480, 565, 100, 20)
    
    ; Buttons für Speichern und VM starten
    Global $btnStartVM = GUICtrlCreateButton("VM starten", 200, 630, 160, 30)
    
    ; GUI anzeigen
    GUISetState(@SW_SHOW)
    
    ; Automatisches Laden der Konfiguration beim Start
    LoadConfig()
    
    ; Haupt-Event-Schleife
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ; Speichern der Konfiguration beim Schließen
                SaveConfig()
                ExitLoop
            Case $btnQemuPath
                _BrowseForFile($inputQemuPath, "Alle Dateien (*.exe)")
            Case $btnISO
                _BrowseForFile($inputISO, "ISO Dateien (*.iso)")
            Case $btnDisk1
                _BrowseForFile($inputDisk1, "Alle Dateien (*.img; *.qcow2)")
            Case $btnDisk2
                _BrowseForFile($inputDisk2, "Alle Dateien (*.img; *.qcow2)")
            Case $btnBios
                _BrowseForFile($inputBios, "Alle Dateien (*.rom; *.bin)")
            Case $btnFolder
                _BrowseFolder($inputFolder)
            Case $btnKernelLoader
                ; Button Kernel Example einfügen
                MsgBox($MB_SYSTEMMODAL, "Examples","Kernel: bboot-0.7\bboot -initrd roms\Pegasos2\Kickstart.zip")              
            Case $btnExampleLoader
                ; Button Loader Example einfügen
                MsgBox($MB_SYSTEMMODAL, "Examples","Loader 1: cpu-num=0,file=bboot-0.7\bboot"&@crlf&"Loader 2: addr=0x600000,file=roms\AmigaOne\Kickstart.zip")            
            Case $btnStartVM
                StartVM()
        EndSwitch
    WEnd
    
    GUIDelete()
    
    ; Hilfsfunktion zur Dateiauswahl
    Func _BrowseForFile($inputField, $filter)
        Local $file = FileOpenDialog("Datei auswählen", @WorkingDir, $filter, 1)
        If Not @error Then
            GUICtrlSetData($inputField, $file)
        EndIf
    EndFunc
    
    ; Funktion für Ordnerauswahl
    Func _BrowseFolder($inputControl)
        Local $folderPath = FileSelectFolder("Ordner auswählen", "", 3)
        If @error = 0 Then GUICtrlSetData($inputControl, $folderPath)
    EndFunc
    
    ; Funktion zum Speichern der Konfiguration in einer INI-Datei
    Func SaveConfig()
        IniWrite($iniFile, "QEMU", "QemuPath", GUICtrlRead($inputQemuPath))
        IniWrite($iniFile, "QEMU", "Maschine", GUICtrlRead($comboMachine))
        IniWrite($iniFile, "QEMU", "Memory", GUICtrlRead($inputMemory))
        IniWrite($iniFile, "QEMU", "ISO", GUICtrlRead($inputISO))
        IniWrite($iniFile, "QEMU", "Disk1", GUICtrlRead($inputDisk1))
        IniWrite($iniFile, "QEMU", "Disk2", GUICtrlRead($inputDisk2))
        IniWrite($iniFile, "QEMU", "VGA", GUICtrlRead($comboVGA))
        IniWrite($iniFile, "QEMU", "Display", GUICtrlRead($comboDisplay))
        IniWrite($iniFile, "QEMU", "Graphics", GUICtrlRead($comboGraphics))
        IniWrite($iniFile, "QEMU", "Fullscreen", GUICtrlRead($chkFullscreen))
        IniWrite($iniFile, "QEMU", "Sound", GUICtrlRead($comboSound))
        IniWrite($iniFile, "QEMU", "Network", GUICtrlRead($comboNetwork))
        IniWrite($iniFile, "QEMU", "Bios", GUICtrlRead($inputBios))
    	IniWrite($iniFile, "QEMU", "Folder", GUICtrlRead($inputFolder))
        IniWrite($iniFile, "QEMU", "Kernel", GUICtrlRead($inputKernel))
        IniWrite($iniFile, "QEMU", "Loader1", GUICtrlRead($inputLoader1))
        IniWrite($iniFile, "QEMU", "Loader2", GUICtrlRead($inputLoader2))
    EndFunc
    
    ; Funktion zum Laden der Konfiguration aus der INI-Datei
    Func LoadConfig()
        GUICtrlSetData($inputQemuPath, IniRead($iniFile, "QEMU", "QemuPath", ""))
        GUICtrlSetData($comboMachine, IniRead($iniFile, "QEMU", "Maschine", "pegasos2"))
        GUICtrlSetData($inputMemory, IniRead($iniFile, "QEMU", "Memory", "1024"))
        GUICtrlSetData($inputISO, IniRead($iniFile, "QEMU", "ISO", ""))
        GUICtrlSetData($inputDisk1, IniRead($iniFile, "QEMU", "Disk1", ""))
        GUICtrlSetData($inputDisk2, IniRead($iniFile, "QEMU", "Disk2", ""))
        GUICtrlSetData($comboVGA, IniRead($iniFile, "QEMU", "VGA", "none"))
        GUICtrlSetData($comboDisplay, IniRead($iniFile, "QEMU", "Display", "gtk"))
        GUICtrlSetData($comboGraphics, IniRead($iniFile, "QEMU", "Graphics", "sm501"))
        GUICtrlSetState($chkFullscreen, IniRead($iniFile, "QEMU", "Fullscreen", "0"))
        GUICtrlSetData($comboSound, IniRead($iniFile, "QEMU", "Sound", "es1370"))
        GUICtrlSetData($comboNetwork, IniRead($iniFile, "QEMU", "Network", "rtl8139"))
        GUICtrlSetData($inputBios, IniRead($iniFile, "QEMU", "Bios", ""))
        GUICtrlSetData($inputFolder, IniRead($iniFile, "QEMU", "Folder", ""))
        GUICtrlSetData($inputKernel, IniRead($iniFile, "QEMU", "Kernel", ""))
        GUICtrlSetData($inputLoader1, IniRead($iniFile, "QEMU", "Loader1", ""))
        GUICtrlSetData($inputLoader2, IniRead($iniFile, "QEMU", "Loader2", ""))
    EndFunc
    
    ; Funktion zum Starten der VM mit den ausgewählten Optionen
    Func StartVM()
        Local $cmd = '"' & GUICtrlRead($inputQemuPath) & '" -machine ' & GUICtrlRead($comboMachine) & ' -m ' & GUICtrlRead($inputMemory)
    
        If GUICtrlRead($inputISO) <> "" Then
            $cmd &= ' -cdrom "' & GUICtrlRead($inputISO) & '"'
        EndIf
        If GUICtrlRead($inputDisk1) <> "" Then
            $cmd &= ' -drive file="' & GUICtrlRead($inputDisk1) & '",format=raw,index=0,media=disk'
        EndIf
        If GUICtrlRead($inputDisk2) <> "" Then
            $cmd &= ' -drive file="' & GUICtrlRead($inputDisk2) & '",format=raw,index=1,media=disk'
        EndIf
    
        $cmd &= ' -vga ' & GUICtrlRead($comboVGA)
        $cmd &= ' -display ' & GUICtrlRead($comboDisplay)
        $cmd &= ' -device ' & GUICtrlRead($comboGraphics)
    
        If GUICtrlRead($chkFullscreen) = $GUI_CHECKED Then
            $cmd &= ' -full-screen'
        EndIf
    
        $cmd &= ' -device ' & GUICtrlRead($comboSound)
        $cmd &= ' -netdev user,id=network0 -device ' & GUICtrlRead($comboNetwork) & ',netdev=network0'
    
        ; Nur für pegasos2 und amigaone: Optionales BIOS
        If (GUICtrlRead($comboMachine) = "pegasos2" Or GUICtrlRead($comboMachine) = "amigaone") And GUICtrlRead($inputBios) <> "" Then
            $cmd &= ' -bios ' & GUICtrlRead($inputBios) & ''
        EndIf
    
        ; Nur für pegasos2 und amigaone: Optionaler Folder
        If (GUICtrlRead($comboMachine) = "pegasos2" Or GUICtrlRead($comboMachine) = "amigaone") And GUICtrlRead($inputFolder) <> "" Then
            $cmd &= ' -drive file=fat:rw:' & GUICtrlRead($inputFolder) & ',id=ufat,format=raw,if=none -device usb-storage,drive=ufat'
        EndIf
    
        ; Nur für pegasos2: Optionaler Kernel
        If GUICtrlRead($comboMachine) = "pegasos2" And GUICtrlRead($inputKernel) <> "" Then
            $cmd &= ' -kernel ' & GUICtrlRead($inputKernel) & ''
        EndIf
    
        ; Nur für amigaone: Device Loader 1 und 2
        If GUICtrlRead($comboMachine) = "amigaone" Then
            If GUICtrlRead($inputLoader1) <> "" Then
                $cmd &= ' -device loader,' & GUICtrlRead($inputLoader1) & ''
            EndIf
            If GUICtrlRead($inputLoader2) <> "" Then
                $cmd &= ' -device loader,' & GUICtrlRead($inputLoader2) & ''
            EndIf
        EndIf
    
        ; Starte die VM
        Run($cmd, "", @SW_SHOW)
        ; Starte die VM - Console nicht schließen
        ;Run('cmd.exe /K "' & $cmd & '"', "", @SW_SHOW)
    EndFunc
    Alles anzeigen
  • QEmu GUI - erstellen virtuelles Image

    • Falke_34
    • 8. Juni 2024 um 21:59

    Guten Abend


    Wie bekomme ich es hin das das Shell Fenster offen bleibt?

    Code
    Run("qemu-system-ppc.exe -machine help")

    oder alternativ, was wohl wieder zu kompliziert wird, bekomme ich diese Ausgaben auch in ein schönes Fensterchen ala MsgBox?

    Vielen Dank

  • QEmu GUI - erstellen virtuelles Image

    • Falke_34
    • 7. Juni 2024 um 19:30

    Wow

    Vielen Dank!!


    Es sieht genauso aus wie meins nur ist das script komplett anders......da werde ich mich erstmal reinfinden müssen

    Vielen Vielen Dank dafür!


    Nachtrag:

    Das erstellen des Images hat noch nicht funktioniert - der kleine Fehler wurde gefunden und behoben - statt "MB" nur "M"

    Code
    Local $sCommand = 'qemu-img.exe create -f raw "'&$sPath&'" '&$iRam&'M'


    Hier noch einmal das leicht abgeänderte Script mit behobenen Fehlerchen:

    C
    #include <GUIConstantsEx.au3>
    #include <MsgBoxConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    
    Global $bInOneGui = False
    
    _main()
    
    Func _guiCreate()
    	Local Const $arBtnDefs = [ _
    								["Pegasos 2", "pics/PegasosII.ico", "Pegasos_II.bat", true, Default], _
    								["AmigaOne", "pics/AmigaOne.ico", "AmigaOne.bat", true, "Example.txt"], _
    								["Sam460ex", "pics/Sam460ex.ico", "Sam460.bat", true, Default] _
    							 ]
    	Local $mGui[], $arButtonCtrlIds[UBound($arBtnDefs)][3]
    	$mGui.btnDef = $arBtnDefs
    
    	Local $iWidth = 300, $iHeight = 130+UBound($arBtnDefs)*50
    	$mGui.hGui = GUICreate("AmigaNG Starter v0.2", $iWidth, $iHeight)
    	GuiSetIcon("pics/amigaos.ico", 0)
    	;BACKGROUND PIC
    	;GuiCtrlCreatePic("pics/boingball.jpg", -1, -1, 300, 280)
    
    	Local $sName = FileGetVersion( "qemu-system-ppc.exe", "ProductName")
    	GUICtrlCreateLabel($sName<>""?$sName:"QEMU", 112, 15, 71, 31)
    	Local $sVersion = FileGetVersion( "qemu-system-ppc.exe", "ProductVersion")
    	GUICtrlCreateLabel($sVersion<>""?$sVersion:"- Not installed", 149, 15, 71, 31)
    
    	; start create vm buttons
    	For $i=0 to UBound($arBtnDefs)-1 Step 1
    		Local $iTop = 50*($i+1)
    		$arButtonCtrlIds[$i][0] = GUICtrlCreateButton($arBtnDefs[$i][0], 15, $iTop, 164, 34, $BS_ICON)
    		GUICtrlSetImage($arButtonCtrlIds[$i][0], $arBtnDefs[$i][1])
    		If $arBtnDefs[$i][3] Then $arButtonCtrlIds[$i][1] = GUICtrlCreateButton ("Edit", 185, $iTop+2, 50, 30)
    		If $arBtnDefs[$i][4]<>Default Then $arButtonCtrlIds[$i][2] = GUICtrlCreateButton ("Example", 237, $iTop+2, 50, 30)
    	Next
    	$mGui.buttons = $arButtonCtrlIds
    	; end create vm buttons
    
    	;Start Create Image Buttons
    	If $bInOneGui Then
    		Local $iImageTop = $iHeight-50
    		GUICtrlCreateLabel("Create HDD Image:", 25, $iImageTop-20)
    		$mGui.inputRam = GUICtrlCreateInput('2048', 25, $iImageTop, 50, 20)
    		GUICtrlCreateLabel("MB", 80, $iImageTop+5)
    		$mGui.inputPathQemu = GUICtrlCreateInput('', 115, $iImageTop, 50, 20)
    		$mGui.buttonPath = GUICtrlCreateButton("...", 170, $iImageTop, 40, 20)
    		$mGui.buttonOk = GUICtrlCreateButton("OK",  215, $iImageTop, 40, 20)
    	Else
    		$mGui.buttonImageGui = GUICtrlCreateButton("Create Image", 10, $iHeight-55, $iWidth-20, 25)
    
    		Local $iGuiImageWidth = 400, $iGuiImageHeight = 80, $mImageGui[]
    		$mImageGui.hGui = GUICreate("Create HDD Image", $iGuiImageWidth, $iGuiImageHeight) ; create controls on the new gui now
    		Local $iTop = 10
    		$mImageGui.inputRam = GUICtrlCreateInput('2048', 10, $iTop, 50, 20)
    		GUICtrlCreateLabel("MB", 65, $iTop+5)
    		$iTop+=30
    		$mImageGui.inputPathQemu = GUICtrlCreateInput('hdf\amiga.img', 10, $iTop, $iGuiImageWidth-120, 20)
    		$mImageGui.buttonPath = GUICtrlCreateButton("...", $iGuiImageWidth-100, $iTop, 40, 20)
    		$mImageGui.buttonOk = GUICtrlCreateButton("OK",  $iGuiImageWidth-50, $iTop, 40, 20)
    
    		$mGui.imageGui = $mImageGui
    		GUISwitch($mGui.hGui) ; Create controls after this line on the main gui again
    	EndIf
    	;End Create Image Buttons
    
    	$mGui.menuFile = GUICtrlCreateMenu("&QEmu")
    	$mGui.menuExit = GUICtrlCreateMenuItem("Exit", $mGui.menuFile)
    	$mGui.menuHelp = GUICtrlCreateMenu("?")
    	$mGui.menuInfo = GUICtrlCreateMenuItem("Info", $mGui.menuHelp)
    	GUISetState(@SW_SHOW, $mGui.hGui)
    	return $mGui
    EndFunc
    
    Func _main()
    	Local $mGui = _guiCreate()
    	Local $iMsg = 0
    	While 1
    		$arMsg = GUIGetMsg(1)
    		; Handle input on the main gui
    		If $arMsg[1] = $mGui.hGui Then
    			Switch $arMsg[0]
    				Case $GUI_EVENT_CLOSE, $mGui.menuExit
    					ExitLoop
    				Case $mGui.menuInfo
    					MsgBox($MB_SYSTEMMODAL, "Info", "AmigaNG Starter v0.2" & @CRLF & @CRLF & "by Falke_34")
    				Case $mGui.buttonPath
    					GUICtrlSetData($mGui.imageGui.inputPathQemu, _imageSelectPath($mGui.hGui))
    				Case $mGui.buttonImageGui
    					GUISetState(@SW_SHOW, $mGui.imageGui.hGui)
    				Case $mGui.buttonOk
    					_imageCreate(Int(GUICtrlRead($mGui.inputRam)), GUICtrlRead($mGui.inputPathQemu))
    					If @error Then MsgBox(16, "Error creating image", "Error: "&@error&" Ext: "&@extended)
    			EndSwitch
    			; Check if one of the buttons from our array was clicked and handle that
    			If $arMsg[0]<>0 Then
    				For $i=0 to UBound($mGui.buttons)-1 Step 1
    					For $j=0 to UBound($mGui.buttons, 2)-1 Step 1
    						If $arMsg[0]=$mGui.buttons[$i][$j] Then
    							Local $subIndex = ($j=0 or $j=1)?2:4
    							If $j=0 Then _run($mGui.btnDef[$i][$subIndex])
    							If $j=1 Then _edit($mGui.btnDef[$i][$subIndex])
    							If $j=2 Then _edit($mGui.btnDef[$i][$subIndex])
    							Local $iError = @error
    							Local $iExt = @extended
    							If $iError Then MsgBox(16, "Error executing code", "Error running/editing/showing """&$mGui.btnDef[$i][$subIndex]&""" Error: "&$iError&" Ext: "&$iExt)
    							ExitLoop
    						EndIf
    					Next
    				Next
    			EndIf
    		EndIf
    		; Handle input on the image gui
    		If $arMsg[1] = $mGui.imageGui.hGui Then
    			Switch $arMsg[0]
    				Case $GUI_EVENT_CLOSE
    					GUISetState(@SW_HIDE, $mGui.imageGui.hGui)
    					GUICtrlSetData($mGui.imageGui.inputPathQemu, "")
    				Case $mGui.imageGui.buttonPath
    					GUICtrlSetData($mGui.imageGui.inputPathQemu, _imageSelectPath($mGui.imageGui.hGui))
    				Case $mGui.imageGui.buttonOk
    					_imageCreate(Int(GUICtrlRead($mGui.imageGui.inputRam)), GUICtrlRead($mGui.imageGui.inputPathQemu))
    					If @error Then
    						MsgBox(16, "Error creating image", "Error: "&@error&" Ext: "&@extended)
    					Else
    						GUISetState(@SW_HIDE, $mGui.imageGui.hGui)
    						GUICtrlSetData($mGui.imageGui.inputPathQemu, "")
    					EndIf
    			EndSwitch
    		EndIf
    	WEnd
    EndFunc
    
    Func _run($sFile)
    	Run($sFile)
    	If @error Then return SetError(1, @error, False)
    	return True
    EndFunc
    
    Func _edit($sFile)
    	Run("notepad.exe "&$sFile)
    	If @error Then return SetError(1, @error, False)
    	return True
    EndFunc
    
    Func _imageSelectPath($hGui = 0, $sStartFolder=@ScriptDir)
    	Local $sFolder = FileSelectFolder("Select folder", $sStartFolder, 0, "", $hGui)
    	If @error or $sFolder="" Then return SetError(1, 0, "")
    	return $sFolder
    EndFunc
    
    Func _imageCreate($iRam, $sPath)
    	If $iRam<1 Then return SetError(1, 0, False)
    	If $sPath="" Then return SetError(2, 0, False)
    	Local $sCommand = 'qemu-img.exe create -f raw "'&$sPath&'" '&$iRam&'M'
    	ConsoleWrite("Execute: "&$sCommand&@crlf)
    	Run($sCommand, @ScriptDir)
    	If @error Then Return SetError(3, @extended, False)
    	return True
    EndFunc
    Alles anzeigen
  • QEmu GUI - erstellen virtuelles Image

    • Falke_34
    • 7. Juni 2024 um 13:06

    Vielen dank für deine Antwort.

    Aber hier muß ich mir doch eingestehen das das für mich viel zu kompliziert wird :(

    Ich habe das für mich erstmal schon so gelöst:

    C
    #include <GUIConstantsEx.au3>
    #include <MsgBoxConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    
    Global $QEmu, $Pegasos2, $Pegasos2Edit, $AmigaOne, $AmigaOneEdit, $Example, $Sam460ex, $Sam460exEdit, $PathQemu, $BtnPath, $sAnswer, $idFilemenu, $idExititem, $idHelpmenu, $idInfoitem
    
    Global $version = FileGetVersion( "qemu-system-ppc.exe", "ProductVersion")
    Global $name = FileGetVersion( "qemu-system-ppc.exe", "ProductName")
    
    Func _guiCreate()
    	;GUI
    	GUICreate("AmigaNG Starter v0.1", 300, 280, -1, -1)
    	;ICON
    	GuiSetIcon("pics/amigaos.ico", 0)
    	;BACKGROUND PIC
    	;GuiCtrlCreatePic("pics/boingball.jpg", -1, -1, 300, 280)
    	
    	$QEmu = GUICtrlCreateLabel($name, 112, 15, 71, 31)
    	$QEmu = GUICtrlCreateLabel($version, 149, 15, 71, 31)
    	
    	;BUTTONS
    	$Pegasos2 = GUICtrlCreateButton("Pegasos 2", 15, 50, 164, 34, $BS_ICON)
    				GUICtrlSetImage (-1, "pics/PegasosII.ico",-1)
    	$Pegasos2Edit = GUICtrlCreateButton ("Edit", 185, 52, 50, 30)
    	
    	$AmigaOne = GUICtrlCreateButton("AmigaOne", 15, 100, 164, 34, $BS_ICON)
    				GUICtrlSetImage (-1, "pics/AmigaOne.ico",-1)
    	$AmigaOneEdit = GUICtrlCreateButton ("Edit", 185, 102, 50, 30)
    	
    	$Example = GUICtrlCreateButton ("Example", 237, 102, 50, 30)
    	
    	$Sam460ex = GUICtrlCreateButton("Sam460ex", 15, 150, 164, 34, $BS_ICON)
    				GUICtrlSetImage (-1, "pics/Sam460ex.ico",-1)
    	$Sam460exEdit = GUICtrlCreateButton ("Edit", 185, 152, 50, 30)
    
    	;Start Create Image Buttons
    	GUICtrlCreateLabel("Create HDD Image:", 25, 205)
    	$RAM = GUICtrlCreateInput('2048', 25, 225, 50, 20)
    	GUICtrlCreateLabel("MB", 80, 228)
    	$PathQemu = GUICtrlCreateInput('', 115, 225, 50, 20)
    	$BtnPath = GUICtrlCreateButton("...", 170, 225, 40, 20)
    	$BtnOk = GUICtrlCreateButton("OK",  215, 225, 40, 20)
    	;End Create Image Buttons
    
    	$idFilemenu = GUICtrlCreateMenu("&QEmu")
    	$idExititem = GUICtrlCreateMenuItem("Exit", $idFilemenu)
    	$idHelpmenu = GUICtrlCreateMenu("?")
    	$idInfoitem = GUICtrlCreateMenuItem("Info", $idHelpmenu)
    EndFunc
    
    _main()
    
    Func _main()
    	_guiCreate()
    	GUISetState(@SW_SHOWNORMAL)
    
    	While 1
    		Switch GUIGetMsg()
    			Case $GUI_EVENT_CLOSE, $idExititem
    				ExitLoop
    			Case $Pegasos2
    				Run("Pegasos_II.bat")
    			Case $Pegasos2Edit
    				Run("notepad.exe Pegasos_II.bat")
    			Case $AmigaOne
    				Run("AmigaOne.bat")
    			Case $AmigaOneEdit
    				Run("notepad.exe AmigaOne.bat")
    			Case $Example
    				Run("notepad.exe Example.txt")
    			Case $Sam460ex
    				Run("Sam460.bat")
    			Case $Sam460exEdit
    				Run("notepad.exe Sam460.bat")
                Case $idInfoitem
                    MsgBox($MB_SYSTEMMODAL, "Info", "AmigaNG Starter v0.1" & @CRLF & @CRLF & "by Falke_34")
    			Case Else
    				;
    		EndSwitch
    	WEnd
    EndFunc
    Alles anzeigen

    Somit habe ich erstmal schon die Buttons - fehlt nur noch irgendwie die Funktion - da scheitere ich aber wieder kläglich :(

  • QEmu GUI - erstellen virtuelles Image

    • Falke_34
    • 6. Juni 2024 um 17:05

    Guten Tag

    Ich habe mir für QEmu PPC ein kleines einfaches GUI mit AutoIt gebastelt.

    Es ist mit Sicherheit nicht perfekt aber es funktioniert soweit ganz gut .....

    Für eine neue Funktion muß ich, mangels Kenntnisse, um Hilfe bitten:

    - möchten gern einen neuen Button hinzufügen welcher ein neues fenster öffnet indem ich nun die Größe des virtuellen Images eingeben kann und mittels klick auf "erstellen" sollte nun in einen auswählbaren ordner ein Image erstellt werden.

    Example Qemu script wäre: qemu-img create -f raw c:test.img 1G


    Hier möchte ich euch mein kleines GUI vorstellen (sollte hier jemand noch Verbesserungsvorschläge haben, darf er sie natürlich gerne äußern):

    Screenshot:

    AmigaNG-Starter.au3:

    C
    #include <GUIConstantsEx.au3>
    #include <MsgBoxConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    
    Global $QEmu, $Pegasos2, $Pegasos2Edit, $AmigaOne, $AmigaOneEdit, $Example, $Sam460ex, $Sam460exEdit, $idFilemenu, $idExititem, $idHelpmenu, $idInfoitem
    
    Global $version = FileGetVersion( "qemu-system-ppc.exe", "ProductVersion")
    Global $name = FileGetVersion( "qemu-system-ppc.exe", "ProductName")
    
    Func _guiCreate()
    	;GUI
    	GUICreate("AmigaNG Starter v0.1", 300, 280, -1, -1)
    	;ICON
    	GuiSetIcon("pics/amigaos.ico", 0)
    	;BACKGROUND PIC
    	;GuiCtrlCreatePic("pics/boingball.jpg", -1, -1, 300, 280)
    	
    	$QEmu = GUICtrlCreateLabel($name, 112, 15, 71, 31)
    	$QEmu = GUICtrlCreateLabel($version, 149, 15, 71, 31)
    	
    	;BUTTONS
    	$Pegasos2 = GUICtrlCreateButton("Pegasos 2", 15, 50, 164, 34, $BS_ICON)
    				GUICtrlSetImage (-1, "pics/PegasosII.ico",-1)
    	$Pegasos2Edit = GUICtrlCreateButton ("Edit", 185, 52, 50, 30)
    	
    	$AmigaOne = GUICtrlCreateButton("AmigaOne", 15, 100, 164, 34, $BS_ICON)
    				GUICtrlSetImage (-1, "pics/AmigaOne.ico",-1)
    	$AmigaOneEdit = GUICtrlCreateButton ("Edit", 185, 102, 50, 30)
    	
    	$Example = GUICtrlCreateButton ("Example", 237, 102, 50, 30)
    	
    	$Sam460ex = GUICtrlCreateButton("Sam460ex", 15, 150, 164, 34, $BS_ICON)
    				GUICtrlSetImage (-1, "pics/Sam460ex.ico",-1)
    	$Sam460exEdit = GUICtrlCreateButton ("Edit", 185, 152, 50, 30)
    
    	$idFilemenu = GUICtrlCreateMenu("&QEmu")
    	$idExititem = GUICtrlCreateMenuItem("Exit", $idFilemenu)
    	$idHelpmenu = GUICtrlCreateMenu("?")
    	$idInfoitem = GUICtrlCreateMenuItem("Info", $idHelpmenu)
    EndFunc
    
    _main()
    
    Func _main()
    	_guiCreate()
    	GUISetState(@SW_SHOWNORMAL)
    
    	While 1
    		Switch GUIGetMsg()
    			Case $GUI_EVENT_CLOSE, $idExititem
    				ExitLoop
    			Case $Pegasos2
    				Run("Pegasos_II.bat")
    			Case $Pegasos2Edit
    				Run("notepad.exe Pegasos_II.bat")
    			Case $AmigaOne
    				Run("AmigaOne.bat")
    			Case $AmigaOneEdit
    				Run("notepad.exe AmigaOne.bat")
    			Case $Example
    				Run("notepad.exe Example.txt")
    			Case $Sam460ex
    				Run("Sam460.bat")
    			Case $Sam460exEdit
    				Run("notepad.exe Sam460.bat")
                Case $idInfoitem
                    MsgBox($MB_SYSTEMMODAL, "Info", "AmigaNG Starter v0.1" & @CRLF & @CRLF & "by Falke_34")
    			Case Else
    				;
    		EndSwitch
    	WEnd
    EndFunc
    Alles anzeigen

    Download (in den QEmu Ordner entpacken): AmigaNG Starter.zip

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™