diff --git a/data/COLORS/BLUE.CLR b/data/COLORS/BLUE.CLR index ff3a5a5..3f38744 100644 Binary files a/data/COLORS/BLUE.CLR and b/data/COLORS/BLUE.CLR differ diff --git a/data/COLORS/EGG.CLR b/data/COLORS/EGG.CLR new file mode 100644 index 0000000..b409e7a Binary files /dev/null and b/data/COLORS/EGG.CLR differ diff --git a/data/COLORS/GREEN.CLR b/data/COLORS/GREEN.CLR index 17b6b03..d7bd638 100644 Binary files a/data/COLORS/GREEN.CLR and b/data/COLORS/GREEN.CLR differ diff --git a/data/COLORS/LBLUE2.CLR b/data/COLORS/LBLUE2.CLR index 4d76e12..1c91d88 100644 Binary files a/data/COLORS/LBLUE2.CLR and b/data/COLORS/LBLUE2.CLR differ diff --git a/data/COLORS/LPINK.CLR b/data/COLORS/LPINK.CLR index 5a0c04f..a234649 100644 Binary files a/data/COLORS/LPINK.CLR and b/data/COLORS/LPINK.CLR differ diff --git a/data/COLORS/PLEXUS.CLR b/data/COLORS/PLEXUS.CLR index 77b8465..c287922 100644 Binary files a/data/COLORS/PLEXUS.CLR and b/data/COLORS/PLEXUS.CLR differ diff --git a/data/COLORS/REDBROWN.CLR b/data/COLORS/REDBROWN.CLR index 4aa0022..13fca9f 100644 Binary files a/data/COLORS/REDBROWN.CLR and b/data/COLORS/REDBROWN.CLR differ diff --git a/data/COLORS/TEAL.CLR b/data/COLORS/TEAL.CLR index 0f46332..9014899 100644 Binary files a/data/COLORS/TEAL.CLR and b/data/COLORS/TEAL.CLR differ diff --git a/data/Fonts/COMIC.FNT b/data/Fonts/COMIC.FNT new file mode 100644 index 0000000..bab3260 Binary files /dev/null and b/data/Fonts/COMIC.FNT differ diff --git a/data/Fonts/FUTURE.FNT b/data/Fonts/FUTURE.FNT new file mode 100644 index 0000000..b9fedb7 Binary files /dev/null and b/data/Fonts/FUTURE.FNT differ diff --git a/data/Fonts/KRYPTO.FNT b/data/Fonts/KRYPTO.FNT new file mode 100644 index 0000000..a9c2264 Binary files /dev/null and b/data/Fonts/KRYPTO.FNT differ diff --git a/data/Fonts/NEW.FNT b/data/Fonts/NEW.FNT new file mode 100644 index 0000000..1a9f00c Binary files /dev/null and b/data/Fonts/NEW.FNT differ diff --git a/data/Fonts/ROUND.FNT b/data/Fonts/ROUND.FNT new file mode 100644 index 0000000..3622129 Binary files /dev/null and b/data/Fonts/ROUND.FNT differ diff --git a/data/Fonts/ROUND2.FNT b/data/Fonts/ROUND2.FNT new file mode 100644 index 0000000..aab6d6a Binary files /dev/null and b/data/Fonts/ROUND2.FNT differ diff --git a/data/Fonts/duenn.fnt b/data/Fonts/duenn.fnt new file mode 100644 index 0000000..977c46f Binary files /dev/null and b/data/Fonts/duenn.fnt differ diff --git a/data/Fonts/fett.fnt b/data/Fonts/fett.fnt new file mode 100644 index 0000000..68e7057 Binary files /dev/null and b/data/Fonts/fett.fnt differ diff --git a/data/Fonts/flame.fnt b/data/Fonts/flame.fnt new file mode 100644 index 0000000..3d98766 Binary files /dev/null and b/data/Fonts/flame.fnt differ diff --git a/data/Fonts/frozen.fnt b/data/Fonts/frozen.fnt new file mode 100644 index 0000000..9b115fa Binary files /dev/null and b/data/Fonts/frozen.fnt differ diff --git a/data/Fonts/gothic.fnt b/data/Fonts/gothic.fnt new file mode 100644 index 0000000..657f57d Binary files /dev/null and b/data/Fonts/gothic.fnt differ diff --git a/data/Fonts/jedi.fnt b/data/Fonts/jedi.fnt new file mode 100644 index 0000000..855449d Binary files /dev/null and b/data/Fonts/jedi.fnt differ diff --git a/data/Fonts/outline.fnt b/data/Fonts/outline.fnt new file mode 100644 index 0000000..05efca6 Binary files /dev/null and b/data/Fonts/outline.fnt differ diff --git a/data/reg.fnt b/data/Fonts/plexus.fnt similarity index 85% rename from data/reg.fnt rename to data/Fonts/plexus.fnt index 90cc153..418383c 100644 Binary files a/data/reg.fnt and b/data/Fonts/plexus.fnt differ diff --git a/data/Fonts/quake.fnt b/data/Fonts/quake.fnt new file mode 100644 index 0000000..619223d Binary files /dev/null and b/data/Fonts/quake.fnt differ diff --git a/data/Fonts/roman.fnt b/data/Fonts/roman.fnt new file mode 100644 index 0000000..3642601 Binary files /dev/null and b/data/Fonts/roman.fnt differ diff --git a/data/Fonts/stone.fnt b/data/Fonts/stone.fnt new file mode 100644 index 0000000..11fc206 Binary files /dev/null and b/data/Fonts/stone.fnt differ diff --git a/data/Help.txt b/data/Help.txt index 6e45ab7..49ab05d 100644 --- a/data/Help.txt +++ b/data/Help.txt @@ -11,10 +11,12 @@ F8 Color-Settings F9 Ram-Monitor F10 Sid-Dmp-Player F11 Calendar -F12 Reboot +F12 Reboot Plexus Alt+F1 About-Box Alt+F2 System-Settings +Alt+F3 extended Titlebar Alt+F5 Baud-Select +Alt+F12 Reboot TRIOS M Mount/Unmount I SD-Card-Info F Format SD-Card @@ -35,7 +37,7 @@ C Copy File P Paste File Cursor Select File Enter Start File(bin etc) -Entf Delete File +Del Delete File Y Send File(YMODEM) Z Receive File(YMODEM) ============================ @@ -84,4 +86,4 @@ D Use DCF-Receiver B Use HC05-Bluetooth ============================ Program Window -1..3 Select Program +1..6 Select Program diff --git a/data/NOISE.WVP b/data/NOISE.WVP new file mode 100644 index 0000000..7037b7e Binary files /dev/null and b/data/NOISE.WVP differ diff --git a/data/NOISE2.WVP b/data/NOISE2.WVP new file mode 100644 index 0000000..89c48af Binary files /dev/null and b/data/NOISE2.WVP differ diff --git a/data/PRG.NFO b/data/PRG.NFO index afdb816..05d5ba7 100644 --- a/data/PRG.NFO +++ b/data/PRG.NFO @@ -1,6 +1,6 @@ - PLEXUS for Hive 2.06 + PLEXUS for Hive 2.1 -Autor:R.Zielinski 04/2014 +Autor:R.Zielinski 08/2014 Mail :Zille09@gmail.com Hive-Project.de diff --git a/data/PWM.WVP b/data/PWM.WVP new file mode 100644 index 0000000..ec274fe Binary files /dev/null and b/data/PWM.WVP differ diff --git a/data/PWM2.WVP b/data/PWM2.WVP new file mode 100644 index 0000000..246ed91 Binary files /dev/null and b/data/PWM2.WVP differ diff --git a/data/REG.FNT b/data/REG.FNT new file mode 100644 index 0000000..aab6d6a Binary files /dev/null and b/data/REG.FNT differ diff --git a/data/REG.INI b/data/REG.INI index 6bf0776..31add35 100644 Binary files a/data/REG.INI and b/data/REG.INI differ diff --git a/data/SINUS.WVP b/data/SINUS.WVP new file mode 100644 index 0000000..9dda451 Binary files /dev/null and b/data/SINUS.WVP differ diff --git a/data/SQUARE.WVP b/data/SQUARE.WVP new file mode 100644 index 0000000..0e99e9a Binary files /dev/null and b/data/SQUARE.WVP differ diff --git a/data/SWEEP.WVP b/data/SWEEP.WVP new file mode 100644 index 0000000..e7b0ff5 Binary files /dev/null and b/data/SWEEP.WVP differ diff --git a/data/TRIANGLE.WVP b/data/TRIANGLE.WVP new file mode 100644 index 0000000..b260aba Binary files /dev/null and b/data/TRIANGLE.WVP differ diff --git a/data/WAVE.INI b/data/WAVE.INI new file mode 100644 index 0000000..37ca783 Binary files /dev/null and b/data/WAVE.INI differ diff --git a/data/dll.lst b/data/dll.lst new file mode 100644 index 0000000..e2914b1 --- /dev/null +++ b/data/dll.lst @@ -0,0 +1,9 @@ +ymodem.dll +basrun.dll +sepia.dll +venatrix.dll +dos.dll +dcf.dll +bltooth.dll +font.dll +wave.dll diff --git a/data/reg.err b/data/reg.err index 5342a75..42f68cb 100644 --- a/data/reg.err +++ b/data/reg.err @@ -76,3 +76,4 @@ No Response from Host Transmission complete Send File... Timeout failure! +Reboot Hive whith TRIOS? diff --git a/make.sh b/make.sh index 02e3f64..998a586 100755 --- a/make.sh +++ b/make.sh @@ -17,9 +17,9 @@ BSTC="bstc" # Alte Versionen löschen rm -rf ${sdplex} -##rm -rf ${sdsys}/xxxx +rm -rf ${sdsys}/goplexus.bin mkdir -p ${sdplex} -##mkdir ${sdsys} +mkdir ${sdsys} # ---------------------------------------------------------------- @@ -58,6 +58,16 @@ mv dos-shell.binary ${sdplex}/dos.dll ${BSTC} -L ${libpath} ${D} -b -O a source/sepia-test.spin mv sepia-test.binary ${sdplex}/sepia.dll +${BSTC} -L ${libpath} ${D} -b -O a source/SignalGenerator.spin +mv SignalGenerator.binary ${sdplex}/Wave.dll + +${BSTC} -L ${libpath} ${D} -b -O a source/font-draw.spin +mv font-draw.binary ${sdplex}/font.dll + +${BSTC} -L ${libpath} ${D} -b -O a source/Switch_Plexus.spin +mv Switch_Plexus.binary ${sdsys}/goplexus.bin + + # ---------------------------------------------------------------- # Daten kopieren diff --git a/source/Bluetooth.spin b/source/Bluetooth.spin index 58be444..f921fab 100644 --- a/source/Bluetooth.spin +++ b/source/Bluetooth.spin @@ -534,7 +534,7 @@ PRI time|s 'Zeitanzeige in der Statusleiste if timezaehler>150 timezaehler:=0 s:=ios.getminutes - Status_extern(ios.dcf_sync,dcf_on,170,27,0,colors[titeltextcol],black) 'Anzeige des aktuellen Status in der Titelzeile + Status_extern(ios.dcf_sync,dcf_on,170,34,29,green,black) 'Anzeige des aktuellen Status in der Titelzeile if s<>tmptime displaytime @@ -543,10 +543,10 @@ PRI displaytime|h,m h:=ios.gethours m:=ios.getminutes - print_zehner(h,29,34,colors[hcolstatus],colors[statustextcol]) - ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,36) + print_zehner(h,29,35,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,37) - print_zehner(m,29,37,colors[hcolstatus],colors[statustextcol]) + print_zehner(m,29,38,colors[hcolstatus],colors[statustextcol]) tmptime:=m date @@ -569,12 +569,12 @@ pri print_zehner(wert,y,x,hin,vor)|a pri Status_extern(wert1,wert2,tnr_act,x,y,col,f3) if wert1==1 - ios.displaytile(tnr_act,colors[Titelhcol],col,f3,y,x) 'Status ok-anzeigen + ios.displaytile(tnr_act,colors[hcolstatus],col,f3,y,x) 'Status ok-anzeigen else - if wert2 'Externe Komponente in Settingmenue ausgewählt? - ios.displaytile(tnr_act,colors[titelhcol],grey,0,y,x) 'Symbol grau + if wert2 'Externe Komponente in Settingmenue ausgewählt? + ios.displaytile(tnr_act,colors[hcolstatus],grey,0,y,x) 'Symbol grau else - ios.displaytile(16,colors[Titelhcol],colors[titeltextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) + ios.displaytile(16,colors[hcolstatus],colors[statustextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) con' PRI doppelklick:click 'pseudo-doppelklick @@ -647,6 +647,8 @@ PRI printfont(str1,a,b,c,d,e)|f repeat strsize(str1) f:= byte[str1++] + if f >96 + f^=32 f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt if d>39 'wenn Bildschirmrand erreicht, neue Zeile d:=0 @@ -677,13 +679,16 @@ con '************************************************** Button-Funktionen ****** PRI buttonpress(n) case n - 1:printfont(string("Start"),250,0,0,0,29) + 1:printfont(string("Start "),250,0,0,0,29) + ios.displaytile(144,colors[shellhcol],250,colors[shellhcol],29,7) + 2:printfont(@Abbr,250,0,0,buttonx[n],buttony[n]) 4:printfont(@butOK,250,0,0,buttonx[n],buttony[n]) Mouse_Release case n - 1:printfont(string("Start"),colors[hcolstatus],0,colors[statustextcol],0,29) + 1:printfont(string("Start "),colors[hcolstatus],0,colors[statustextcol],0,29) + ios.displaytile(144,colors[shellhcol],colors[hcolstatus],colors[shellhcol],29,7) 2:printfont(@Abbr,colors[Buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n]) 4:printfont(@butOK,colors[Buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n]) diff --git a/source/DCF-Test.spin b/source/DCF-Test.spin index 5824222..188bc46 100644 --- a/source/DCF-Test.spin +++ b/source/DCF-Test.spin @@ -183,9 +183,9 @@ PRI os_cmdinput | x,y ,i,dk,key,sync,dcferror,bit_tmp,lvl_tmp,bit_num,bit_lvl,gt printdec(gt_act,15,18,colors[winhcol],colors[act_color]) '####################### DCF-Empfangssymbol in der Titelleiste ######################################################### if sync==1 - ios.displaytile(170,colors[Titelhcol],colors[titeltextcol],0,0,27) + ios.displaytile(170,colors[hcolstatus],green,0,29,34) else - ios.displaytile(170,colors[titelhcol],grey,0,0,27) 'dcf-Symbol grau + ios.displaytile(170,colors[hcolstatus],grey,0,29,34) 'dcf-Symbol grau '####################### DCF-Zeit anzeigen ############################################################################# dcf_time @@ -349,10 +349,10 @@ PRI displaytime|h,m,x,y h:=ios.gethours m:=ios.getminutes - print_zehner(h,29,34,colors[hcolstatus],colors[statustextcol]) - ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,36) + print_zehner(h,29,35,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,37) - print_zehner(m,29,37,colors[hcolstatus],colors[statustextcol]) + print_zehner(m,29,38,colors[hcolstatus],colors[statustextcol]) tmptime:=m date @@ -463,6 +463,8 @@ PRI printfont(str1,a,b,c,d,e)|f repeat strsize(str1) f:= byte[str1++] + if f >96 + f^=32 f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt if d>39 'wenn Bildschirmrand erreicht, neue Zeile d:=0 @@ -494,14 +496,14 @@ con '************************************************** Button-Funktionen ****** PRI buttonpress(n) case n 1:printfont(string("Start "),250,0,0,0,29) - ios.displaytile(164,0,colors[shellhcol],250,29,7) + ios.displaytile(144,colors[shellhcol],250,colors[shellhcol],29,7) 4:printfont(@butOK,250,0,0,buttonx[n],buttony[n]) Mouse_Release case n 1:printfont(string("Start "),colors[hcolstatus],0,colors[statustextcol],0,29) - ios.displaytile(164,0,colors[shellhcol],colors[hcolstatus],29,7) + ios.displaytile(144,colors[shellhcol],colors[hcolstatus],colors[shellhcol],29,7) 4:printfont(@butOK,colors[Buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n]) diff --git a/source/Plexus-Shell.spin b/source/Plexus-Shell.spin index 2cdbbff..b4fa913 100644 --- a/source/Plexus-Shell.spin +++ b/source/Plexus-Shell.spin @@ -528,6 +528,122 @@ Logbuch : -DOS-Shell ebenfalls mit dieser Funktionalität ausgestattet -1317 Longs frei +'############################################################### Version 2.1 #################################################################################################### +29-05-2014 -optischer Umbau der Statusleiste, Explorerfenster erhält eine eigene Statusleiste (für Verzeichnisnamen) + -dadurch im unteren Bereich 2 Zeilen mehr Platz, Utility-Panel rutscht um eine Zeile nach unten, sieht optisch besser aus + -Verzeichnisnamen-Anzeige muss noch überarbeitet werden, es wird immer nur das aktuelle Verzeichnis angezeigt, nicht der komplette Pfad, das ist doof + -Statusleistentext wird nur noch angezeigt, wenn das Explorerfenster zu sehen ist + -1294 Longs frei + +31-05-2014 -Sanduhr beim Start von Bin-Dateien hizugefügt, da die Statusleiste nicht immer sichtbar ist + -1283 Longs frei + +08-06-2014 -Verzeichnispfad-Anzeige im Explorerfenster zeigt jetzt den kompletten Pfad an, ist der Pfad länger als 3 Verzeichnisse, wird entsprechend später mit + -der Anzeige begonnen + -dadurch einige Routinen gekürzt bzw. gelöscht + -Optische Frischzellenkur, untere Statusleiste existiert nicht mehr, nur noch Startbutton und Uhrzeitanzeige + -Shell-Titelzeile nur noch im mittleren Bildschirmteil existent mit abgerundeten Ecken + -1284 Longs frei + +09-06-2014 -optisch noch einige Kleinigkeiten geändert + -Fehler in der Scrollroutine behoben, war das Startmenue sichtbar, wurde es durch scrollen zerstört + -1264 Longs frei + +12-06-2014 -Fehler in der Pfadanzeige im TRASH-Fenster behoben + -falsche Darstellung bei Dateien ohne Dateiendung (wurden fälschlicherweise als Verzeichnisse interpretiert) behoben + -überflüssige DAT-Anweisungen entfernt + -Statusleiste des Explorerfensters hat jetzt die gleiche Farbe wie die Titelzeile + -Korrekturen beim Datei-Hervorhebungsbalken, noch wird beim runterscrollen an der letzten Position der Balken nicht korrekt gelöscht + -1265 Longs frei + +14-06-2014 -kleine optische Änderung in der TAB-Anzeige der Systeminfo um Tiles einzusparen + -Anzeigekorrektur bei der Datei-Datumsanzeige. Tages-und Monatswerte <10 haben jetzt eine führende Null + -Als hilfreich könnte sich noch ein Tastencode-Scanner erweisen, da man öfter den ASCII-Code einer Taste braucht, mal sehen, wie ich das realisiere + -1263 Longs frei + +15-06-2014 -Keyboardscanner in der oberen Titelzeile eingebaut(linker Teil), aktivierbar über die Taste K,k, erweitert die Titelzeile rechts und links + -im rechten Titelzeilen-Teil werden die Maus-Koordinaten angezeigt + -1209 Longs frei + +16-06-2014 -Umbau Keyboardscanner, dadurch etwas Platz gespart (2 Longs) + -DCF-Indikator nach unten neben der Uhr verschoben, da wo er hingehört + -DCF-OK-Anzeige erfolgt jetzt generell in Grün + -DLL's ebenfalls angepasst + -Korrektur Mülleimerpfadanzeige (wurde in der falschen Hintergrundfarbe dargestellt) + -1211 Longs frei + +20-06-2014 -optische Veränderung der App-Bar, dadurch werden Tiles eingespart + -Dll's entsprechend angepasst + -Fenster (Explorer,Terminal,Programms und Ram-Monitor) wurde um eine Zeile vergrößert + -Scroll-Handling verbessert + -einige CLR-Dateien angepasst an die neue Optik + -Fehler in Startmenue-Auswahl behoben (nachdem der Mülleimer aufgerufen wurde, wurde ein Klick auf Help im Startmenue als Show-Trash interpretiert) + -Cancel-Button in der Coganzeige und der Systeminfo entfernt (macht keinen Sinn, OK-Button reicht) + -1205 Longs frei + +21-06-2014 -weiterer optischer Umbau, Regal bleibt (sieht einfach besser aus) + -Statusleiste am unteren Bildschirmrand wird über Extended Titlebar sichtbar/unsichtbar + -Textausgaben entsprechend angepasst + -DLL's mit neuem Start-Button ausgestattet + -nun muss ich noch etwas Code-Optimierung durchführen + -1173 Longs frei + +22-06-2014 -Panel ist jetzt dynamisch + -sitzt ganz unten und springt eine Zeile hoch,wenn die extended Titlebar aktiviert wird (und umgekehrt) + -1167 Longs frei + +23-06-2014 -Möglichkeit, des Austausches der Fontdatei geschaffen.Dadurch wird Plexus optisch aufgewertet + -unterschiedliche Fontdateien erstellt + -Icon für Fontdateien im Explorerfenster erstellt + -Wechsel des Fonts erfolgt durch Doppelklick auf eine Fontdatei im Explorerfenster, aktivierter Font wird zum Systemfont + -1129 Longs frei + +24-06-2014 -Font Dateien befinden sich im Unterverzeichnis FONTS + -ausgewählte Fontdatei wird ins Systemverzeichnis kopiert und in Reg.Fnt umbenannt (war etwas tückisch, funktioniert aber jetzt endlich) + -1125 Longs frei + +25-06-2014 -Sanduhr beim Laden eines neuen Fonts eingebaut(dauert ja doch etwas länger) + -die neuen Fontdateien etwas bearbeitet + -1123 Longs frei + +27-06-2014 -Textausgaben auf Großschreibung umgestellt, das spart Tiles im Fontsatz und erlaubt zusätzliche Icons und Grafiktiles + -diverse optische Experimente getätigt, aber nichts brauchbares herausgekommen :-( + -nach Tests mit der Toolbox3 (TRIOS-R57) wird die SD-Karte geschreddert, da ich keine Lust habe, jedes Programm PLEXUS-Konform umzubasteln, + -werde ich im Fenster PROGRAMS einen Punkt TRIOS einbauen, um den HIVE in den TRIOS-Modus zu versetzen + -mal sehen, ob das funktioniert und wie ich zurück zu Plexus komme + -1117 Longs frei + +28-06-2014 -Umstieg auf TRIOS funktioniert nur mit abgezogener Venatrix-Erweiterung, da im Code von TRIOS der PIN24 (Regnatix LED) nicht gesetzt ist + -muss ich also doch was Umbauen, das nervt + -außerdem muss ich im Regime-Code (reg.sys von TRIOS) noch den Umstieg zurück auf Plexus realisieren. + -Variablen-Liste in VAR umsortiert und dadurch über 30 Longs eingespart + -goplexus.bin kreiert, um von TRIOS zurück zu Plexus zu gelangen + -1144 Longs frei + +01-07-2014 -Font-Editor bis auf die Speicherfunktion fertiggestellt + -erreichbar über das Programms-Fenster + -1113 Longs frei + +06-07-2014 -Font-Editor jetzt komplett fertig :-) + -Dll's auf Großschreibung umgestellt, dadurch können mehr Icons in den Fontsatz aufgenommen werden + -dank Kuroneko 20 Longs in der Regflash.bin eingespart, was den Heap größer werden läßt(mehr Platz im Ram :-)) + -1113 Longs frei + +10-07-2014 -Fehler des "ein Long zu lange Regflash.bin" von Kuroneko gefunden ->behoben (war meine Schuld :-( (peinlich!)) + +11-07-2014 -Einbindung eines Signalgenerators als Dll begonnen (Code von Ahle2) + -bei Aufruf des Signalgenerators wird die SidCog gestoppt (um Cogs frei zu bekommen) und nach Beendigung wieder gestartet + -1119 Longs frei + +12-07-2014 -DLL-Programmnamen in den Ram ausgelagert und entsprechende Startroutinen umgebaut, dadurch Platz gespart + -1141 Longs frei + +13-08-2014 -Durch den Umbau von Groß/Klein-Schreibung auf Großschreibung, einige Änderungen und Zusammenfassungen im Code durchgeführt + -kleinere Fehler beseitigt + -ein kleiner Texteditor wäre nicht schlecht, mal sehen was ich assimilieren kann ;-) + -1149 Longs frei + + Notizen : Window 0 = Hauptbildschirm, darf nicht anderweitig genutzt werden !!! Window 1 = Utilitie-Fenster (serielles Terminal, Uhr-Einstellung,Color-Settings, Ram-Monitor,Player,Systemsettings,Baud-Einstellung) Window 2 = Infofenster (SD-Card-Info,Kopierfenster,Messagebox,Datei-Info) @@ -543,17 +659,21 @@ _XINFREQ = 5_000_000 '-------- Speicher für diverse Texte ------------ TXT_RAM = $20000 +error_step = 25 'Schrittweite der Einträge vidnfo = $21000 sndnfo = $21200 prgnfo = $21400 Verz_RAM = $21800 +'-------- Speicher für DLL-Namen ---------------- +DLL_RAM = $30000 +dll_step = 16 'Schrittweite der Einträge '-------- Speicher für Titelliste --------------- DMP_RAM = $40000 '-------- Overlay-Puffer ------------------------ BRAM = $50000 '-------- Speicher für Systemfont --------------- SYS_FONT = $66800 '....$693FF ' ab hier liegt der System-Font 11kb -Hour_Glass= $66800+(167*16*4) +Hour_Glass= $66800+(167*16*4) ' Platz, wo das Sanduhrsymbol im Systemfont sitzt MOUSE_RAM = $69400 '....$6943F ' User-Mouse-Pointer 64byte '-------- Speicher für Dateiliste --------------- @@ -659,19 +779,20 @@ PLAY_PIC =125 STOP_PIC =141 CLR_PIC =155 EXT_PIC =156 +FNT_PIC =113 '-------------------------------------------------------------------------------- VAR 'systemvariablen - byte mountmarker,tmptime 'Marker für Mountbefehl, Vergleichsvariable für Time-Funktion - byte buttonx[8] 'Knöpfe - byte buttony[8] + '---------------- Fenster ------------------------------------------ byte windownum[3] 'Arbeits-Windows byte windowx[3] byte windowy[3] byte windowxx[3] byte windowyy[3] byte messagex 'x-Position der Messagebox + byte infomarker 'Marker für Info-Fenster-Anzeige + '---------------- Farben ------------------------------------------- byte act_color 'Speicher für gewählte zeichenfarbe byte hcolstatus 'statusleiste hintergrundfarbe @@ -694,25 +815,18 @@ VAR byte icony[30] byte iconf1[30],iconf2[30],iconf3[30] 'Iconfarben - byte buff[8] 'Dir-Befehl-variablen - byte filestring[13] 'selektierte Datei - - byte dumpstring[13] 'dmp-datei - byte copystring[13] 'kopier-string - word filenumber,dirnumber 'Anzahl Dateien und Verzeichnisse im aktuellen Verzeichnis - byte infomarker 'Marker für Info-Fenster-Anzeige - - byte ma,mb,mz 'Maus-Taste und Scrollrad - byte play 'Player läuft oder nicht - byte dirname[20] 'Directoryname + '----------------- Maus-Auswertung ----------------------------- + byte ma,mb,mz,mc 'Maus-Taste und Scrollrad long scrollende,scrollanfang,zeilenanfang, zeilenende 'Variablen für Scrollfunktion + '----------------- Text-Variablen ------------------------------ byte zeile,spalte 'Zeilen und spalten für terminalfenster byte inputline[len] 'Eingabezeile Terminal byte baud 'Baud-Parameter + '----------------- Datum/Zeit Anzeige -------------------------- byte tag,monat,stunde,minute sekunde 'Datum -und Zeit + byte tmptime 'Vergleichsvariable für Time-Funktion word jahr - long startadresse,endadresse 'E-Ram-Monitor Variablen - byte menuemarker 'Marker für Startmenue + '---------------- Variablen für Dateibehandlung ---------------- long filelen 'Dateigröße byte filedir 'Marker ob Datei oder Verzeichnis byte filehidden 'Datei versteckt Attribut @@ -722,7 +836,14 @@ VAR byte fileday 'Datei Erstellungstag byte filemonth 'Datei Erstellungsmonat byte selection 'selektierte Datei + byte menuemarker 'Marker für Startmenue + byte buff[8] 'Dir-Befehl-variablen + byte filestring[13] 'selektierte Datei + byte copystring[13] 'kopier-string + byte mountmarker 'Marker für Mountbefehl + word filenumber,dirnumber 'Anzahl Dateien und Verzeichnisse im aktuellen Verzeichnis word fileyear 'Datei Erstellungsjahr + '--------------- Popupmenue-Variablen -------------------------- byte popupx 'x und byte popupy 'y-Koordinaten des Popupmenues byte popupyy '2te y-koordinate @@ -730,35 +851,46 @@ VAR byte popupmarker 'Marker für Popupmenue byte menue_nr 'nr des gerade angezeigten Menues byte textline[12] 'Texteingabestring - long tp 'Texteingabe-übernahmestring - byte platz 'Platzhalter für Verzeichnisname in der Statusleiste - byte mc 'Mouse z-Koordinate byte lines 'Zeilen im Dateifenster byte attrmarker[4] 'Datei-Attribute-Marker byte tabx[3],taby[3],tabl[3] 'Tab-Parameter + long tp 'Texteingabe-übernahmestring + '------------ Variablen für den DMP-Player -------------------- byte playerposition 'Position im Dmp-File - word dmpfiles 'Anzahl Dmp-Files im Verzeichnis + byte dumpstring[13] 'dmp-datei + byte play 'Player läuft oder nicht long dmplen 'Länge des Dmp-Files word dumpnummer 'aktuelle Dmp-Nummer word tmpplay 'temporäre Dmp-Nummer + word dmpfiles 'Anzahl Dmp-Files im Verzeichnis + '------------ Button-Variablen -------------------------------- + byte buttonx[8] 'Knöpfe + byte buttony[8] byte buttontext[50] 'String mit allen Button-Texten (8*6 Zeichen) byte attribute[4] 'Attribute-Set byte font[25] 'Hilfsstring für Strings aus dem Ram + '----------- Verzeichnismarker -------------------------------- long rootdir 'root-Dirmarker long systemdir 'system-Dirmarker long trashdir 'Muelleimer-Dirmarker long userdir 'user-Dirmarker long targetdir 'Ziel-Dirmarker + '----------- RAM-Monitor Variablen ---------------------------- long HEX_ADRESSE 'Adresse E-Ram-Monitor - word trashcounter 'Muellzähler + long startadresse,endadresse 'E-Ram-Monitor Variablen + long pokeram,tmp_poke byte dump_ram 'Anzeige externer oder interner speicher + + '----------- Anzahl Einträge im Trash-Ordner ------------------ + word trashcounter 'Muellzähler + '----------- diverse Hilfsvariablen --------------------------- byte pfeil,pfeil_old 'Positionspfeil im Color-Fenster byte change_marker 'Merker, das Verzeichnis geändert wurde byte do_restore 'merker, ob Displayhintergrund wieder hergestellt wird byte link_merker 'merker, ob bei geöffnetem Explorer ein Link angeklickt wird byte attribut_fenster 'merker für Datei-Info-Fenster + '---------- Variablen für Programmverknüpfungen --------------- - long Link_marker[3] 'Dir_marker der 3 Links byte link_string[40] 'String für die drei Links byte link_pointer 'Linkposition byte link_counter 'Linkzaehler @@ -767,6 +899,8 @@ VAR byte Show_Hid_Files 'Versteckte Dateien anzeigen Marker byte Use_Trash 'Mülleimer Verwenden Marker byte util 'Utilitie-Marker + long Link_marker[3] 'Dir_marker der 3 Links + '----------- Kalender-Variablen ------------------------------- byte today byte tag_zahl 'Anzahl Tage im Monat und Schaltjahrerkenner @@ -782,40 +916,37 @@ VAR byte venatrix 'Venatrix-Marker '----------- Sepia Variablen ---------------------------------- byte sepia 'Sepia-Marker - + '----------- spezielle Fensterfunktionen byte tab_taste 'Tab-Tasten-Zähler byte kz 'Position im Scrollfenster Pfeiltasten byte scr 'scrollmerker für Pfeiltasten - '___________ Kopier-Variablen --------------------------------- - long dmpaste,dmcopy 'Quell,Zielpfad-Merker - byte copy_all 'gesamten Verzeichnisinhalt kopieren - byte copy_marker 'Kopier-Marker - '----------- RAM-Monitor Variablen ---------------------------- - long pokeram,tmp_poke '----------- DCF-Indikator ------------------------------------ byte dcf_on byte timezaehler '----------- Bluetooth-Variablen ------------------------------ byte Bluetooth_on,bl_connect byte serial - + '----------- externe Programme -------------------------------- byte return_merker 'Rückkehraktion aus DLL + '----------- extended Menue ----------------------------------- + byte keyscanner 'Merker für keyscanner + '___________ Kopier-Variablen --------------------------------- + byte copy_all 'gesamten Verzeichnisinhalt kopieren + byte copy_marker 'Kopier-Marker + long dmpaste,dmcopy 'Quell,Zielpfad-Merker + dat ini byte "reg.ini",0 'Ini-Datei für Farbwerte, Dateiverknüpfungen und Systemeinstellungen - errortxt byte "reg.err",0 - sepia_card byte "sepia.dll",0 'Sepia-Card-Testdatei - Venatrix_card byte "venatrix.dll",0 'Venatrix-Card-Testdatei - DOS_SHELL byte "dos.dll",0 'Dos-Shell - DCF77 byte "dcf.dll",0 'DCF77-Empfänger-Test - BLUETOOTH byte "bltooth.dll",0 'Bluetooth-Settings - Ymodem byte "ymodem.dll",0 'Ymodem-Funktion - BAS_RT byte "basrun.dll",0 'Basic-Runtime-Modul + sys_file byte "reg.sys",0 'Plexus oder Trios-Startdatei + sys_tmp byte "reg.tmp",0 'temporäre Plexus-Startdatei + sys_trs byte "reg.trs",0 'temporäre TRIOS-Startdatei + root byte ".. ",0 dirhoch byte ". ",0 Trash byte "TRASH ",0 - SYSTEM Byte "PLEXUS ",0 'Plexus-Systemverzeichnis + SYSTEM Byte "PLEXUS",0 'Plexus-Systemverzeichnis binfile byte "BIN",0 extfile byte "DLL",0 'externe-Plexus-Programme txtfile byte "TXT",0 @@ -827,16 +958,13 @@ dat sysfile byte "SYS",0 colorfile byte "CLR",0 'Farb-Schemen-Dateien maus byte "MAU",0 'Mauszeiger-Dateien - - video_inf byte "VIDEO.NFO",0 - prg_inf byte "prg.nfo",0 - sound_nfo byte "sound.nfo",0 + fontdat byte "FNT",0 'Font-Dateien butOK byte " OK ",0 - Abbr byte "Cancel",0 + Abbr byte " Quit ",0 sysfont byte "reg.fnt",0 promt byte "OK>",0 - Version byte "2.06",0 + Version byte "2.1",0 New_dir byte "NEWDIR",0 '------------ Tage ------------------------------------ DAY1 byte "MO",0 @@ -893,7 +1021,7 @@ dat off byte "off",0 - windowtile byte 146,148,147,114,116,6,4,2,0,129,1,5,77,3,124,124,124 'Fenster-Tiles für WIN-Funktion + windowtile byte 146,148,147,114,116,6,4,2,0,129,1,5,77,3,129,129,129 'Fenster-Tiles für WIN-Funktion PUB main | i @@ -944,7 +1072,6 @@ PUB main | i Verzeichnis_counter:=ios.ram_rdbyte(RETURN_POINT+1) ios.ram_wrbyte(0,RETURN_POINT+1) 'Verzeichnis_counter lesen und RAM-Platz danach löschen - 'num.init ios.mousebound(0,0,639,479) 'Maus-Bereich festlegen repeat @@ -957,10 +1084,12 @@ PRI Win_Set_Tiles|i,a repeat 17 ios.ram_wrbyte(windowtile[a++],i++) 'Standard-Wintiles in den Ram schreiben ios.windel(9) 'alle Fensterparameter löschen und Win Tiles senden + + CON '################################################### Hauptprogrammschleife #################################################################################################### '############################################################################################################################################################################## -PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp +PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp,dl lines:=21 'Zeilen im Dateifenster zeilenanfang:=1 'erste Zeile im Dateifenster @@ -978,13 +1107,16 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp '##################################### Hier gehts los ############################################################################################################################# repeat time 'Zeit und Datum anzeigen - 'Bluetooth_Abfrage + ma:=ios.mouse_button(0) 'linke Maustaste mb:=ios.mouse_button(1) 'rechte Maustaste mz:=ios.mousez 'scrollrad kb:=ios.key 'Tastenabfrage (für Zusatzfunktionen) - 'if kb - 'printdec_win(verzeichnis_counter,1,1) 'nur Test, um die Tastencodes zu erfahren + if keyscanner + print_zehner(ios.mousex,0,35,titeltextcol,titelhcol) 'Mauskoordinaten anzeigen + print_zehner(ios.mousey,0,37,titeltextcol,titelhcol) + + ' printdec_win(kb,1,1) 'nur Test, um die Tastencodes zu erfahren '********************** Dmp_Player-Automatik -> spielt alle im Verzeichnis befindlichen Dmp-Dateien ab ****************************************************** if play==1 @@ -1004,7 +1136,6 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp Player_sichtbar 'wenn Player sichtbar, dann Titel im Playerfenster anzeigen abspielen(Windownum[1]) 'Player starten (wenn Fenster da ist, balken löschen) - print_status(@dumpstring,7+platz,29) 'Titel in der Statusleiste anzeigen '**************************************** Globale Tasten-Abfrage ******************************************************************************************** if kb @@ -1014,16 +1145,12 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp if i>0 and i<4 show_tab(i) - 7:i:=kb-"0" 'im Programms-Fenster per Nummerntaste Programm auswählen - do_restore~ - popup_info_weg 'Popup-Menues löschen + 7:if kb>49 and kb=<55'57 '1...9 momentan 1-7 + i:=kb-"0" 'im Programms-Fenster per Nummerntaste Programm auswählen + do_restore~ + popup_info_weg 'Popup-Menues löschen + RUN_SYS(dll_txt(i+2),F3_KEY) - case i - 1:RUN_SYS(@sepia_card,F3_KEY) - 2:RUN_SYS(@Venatrix_card,F3_KEY) - 3:RUN_SYS(@DOS_SHELL,F3_KEY) - 4:RUN_SYS(@DCF77,F3_KEY) - 5:RUN_SYS(@BLUETOOTH,F3_KEY) '************** DMP-Player-Fenster ******* Steuerung durch Mausbedienung ************************************************************************************ if util==6 and windownum[1]==1 'Fenster sichtbar? @@ -1055,7 +1182,6 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp play:=1 12:tmpplay:=wert_plusminus(1,tmpplay,1,dmpfiles) 'titel vor playsong(tmpplay,1) - print_status(@dumpstring,7+platz,29) 'Titel in der Statusleiste anzeigen dmp_name 'Titel und Samples im Playerfenster anzeigen @@ -1092,7 +1218,7 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp if ((x==37) and ((y==8) or (y==13) or (y==18))) 'Link-Symbol mit der rechten Maustaste anklicken i:=linkpos(y-8) 'erster Eintrag bei popupy=8+2 (da das Popupmenue 2 Zeilen unter dem Symbol angezeigt wird) - get_link(LINK_RAM,i) 'Link-Name holen + get_link(LINK_RAM,i,1) 'Link-Name holen if strsize(@filestring)>1 'Link-Name gültig? 'sonst wird im zweifelsfall zuwenig wieder hergestellt popup(33,y+2,39,y+5) 'feste Position, sonst sind Fehldarstellungen möglich popup_entry(0,@starts,0) 'Link starten @@ -1129,7 +1255,6 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp popup_entry(9,@delete,1) menue_nr:=1 'Marker-Dateifenster-Popupmenu - '******************************************** linke Maustaste ******************************************************************************************************************** if ma==255 @@ -1140,12 +1265,6 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp fst:=kl/10 'Nummer des Fensters do_restore:=1 'bei Maus-Bedienung Hintergrund wieder herstellen '------------------------------------------------- Fenster-Schließen ------------------------------------------------------------------------------------------------------------- -' if kl==1 'Abfrage auf Fensterloeschen -' if doppelklick -' Close_Window(fst) -' if attribut_fenster 'beim Schließen des Attribut-Fensters SD-Card neu einlese -' mc:=SD_CARD -' attribut_fenster:=0 if kl==1 or kl==2 Close_Window(fst) if attribut_fenster @@ -1170,31 +1289,34 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp '*********************** Mausklick in Titelleiste ******************************************************* if y==0 'Beenden-Knopf - if x==39 - cmd_reboot - elseif x==0 'Beenden bei Doppelklick auf linke obere Ecke - if doppelklick - cmd_reboot + if x==34 + cmd_reboot(0) '------------ Kalender aufrufen ----------------------------------- - elseif (x=>29) and (x=<38) + elseif (x=>22) and (x=<31) if doppelklick keyboardscan(F11_Key) '------------ About-Box aufrufen ---------------------------------- - elseif x=>1 and x=<16 + elseif x=>8 and x=<17 if doppelklick about + elseif x==5 'erweiterte Titelleiste + ios.displaytile(17,titelhcol,titeltextcol,0,0,5) + Mouse_Release + print_titel(string("!"),5,0) + keyboardscan(ALT_F3) + '*********************** Mausklick in Statusleiste ****************************************************** '------------ Zeit/Datum-Einstellungen ---------------------------- if y==29 - if(x=>34) and (x=<38) + if(x=>35) and (x=<39) if doppelklick keyboardscan(F7_Key) '------------ Start-Menue ----------------------------------------- - elseif (x=>0) and (x=<4) 'Start-Knopf + elseif (x=>0) and (x=<6) 'Start-Knopf buttonpress(3) do_restore:=1 if menuemarker==1 @@ -1271,7 +1393,7 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp if popupmarker==1 and menue_nr==4 if(x=>popupx) and (x=7) and (x=<16) and (y=>9) and (y=<23) 'Auswahl Eintrag pfeil:=y WIN_TILE(16,pfeil_old,6) @@ -1393,7 +1516,7 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp if x==31 'Auswahl E-Ram keyboardscan("E") - if (x=>8) and (x=<23) and (y=>6) and (y=<24) and dump_ram==1 'Werte poken nur im eram erlaubt + if (x=>8) and (x=<23) and (y=>6) and (y=<25) and dump_ram==1 'Werte poken nur im eram erlaubt pokeram:=tmp_poke:=Poke_Ram(x,y) 'Adresse aus x/y-Koordinaten errechnen bd:=x-8 kn:=lookupz(bd:0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7) 'kn vorbelegen, damit nur bis zum 8.Byte in einer Zeile geschrieben wird @@ -1403,20 +1526,16 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp ram_input(bd,kn,x,y) 'Eingabe Daten 7: '****************** Programms-Fenster, noch nicht fertig ******************* - repeat i from 13 to 21 + repeat i from 13 to 22 if (x==iconx[i] or x==iconx[i]+1) and (icony[i]==y) - if i<13 or i>14 + if i<13 or i>15 iconpress(i,1) 'Icon-drücken-Effekt Zweitile-Icon anzeigen else iconpress(i,0) 'icon-drücken-Effekt Eintile-ICON do_restore:=1 popup_info_weg 'Popup-Menues löschen - case i - 13:RUN_SYS(@DCF77,F3_KEY) - 14:RUN_SYS(@BLUETOOTH,F3_KEY) - 19:RUN_SYS(@sepia_card,F3_KEY) - 20:RUN_SYS(@Venatrix_card,F3_KEY) - 21:RUN_SYS(@DOS_SHELL,F3_KEY) + dl:=((iconx[i]-3)/6)+3+((icony[i]-3)-1) 'DLL-Namens-Nr errechnen + RUN_SYS(dll_txt(dl),F3_KEY) '********************************************************************************* @@ -1517,7 +1636,7 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp selection:=y-3 kz:=selection getfilename(selection+scrollanfang) 'selektierte Datei nr - if y<>y_old 'nur einmal hervorheben + 'if y<>y_old 'nur einmal hervorheben highlight++ 'angeklickter Dateiname wird hervorgehoben if highlight>0 'erster Klick hebt hervor, Popupmenueklick wird ignoriert da -1 highlight_selection(y) @@ -1530,31 +1649,33 @@ PRI os_cmdinput | x,y ,i,col,dk,kb,b,kl,fst,term_aus,kn,bd,tmp '**************************** Maus Scrollrad **************************************** - if mc>mz or (x==34 and y==3 and ma==255) 'hochscrollen - if util==11 and infomarker==0 'Dateifenster nur scrollen, wenn kein Infofenster angezeigt wird (byte kann keine -1 sein also 255) - if filenumber>21 'Dateianzahl höher als Zeilen im Dateifenster? - scrollrunter 'Bildschirm scrollen - if scr>0 - scr-- - Highlight_balken 'auf Gültigkeit der Balkenposition prüfen - mc:=mz - if util==5 'E-Ram-Monitor - adresseminus - scrolldown(startadresse) - mc:=mz + if mc>mz or (x==34 and y=>3 and y=<14 and ma==255) 'hochscrollen + if popupmarker==0 + if util==11 and infomarker==0 'Dateifenster nur scrollen, wenn kein Infofenster angezeigt wird (byte kann keine -1 sein also 255) + if filenumber>21 'Dateianzahl höher als Zeilen im Dateifenster? + scrollrunter 'Bildschirm scrollen + if scr>0 + scr-- + Highlight_balken 'auf Gültigkeit der Balkenposition prüfen + mc:=mz + if util==5 'E-Ram-Monitor + adresseminus + scrolldown(startadresse) + mc:=mz - if mc21 - scrollhoch 'Bildschirm scrollen - if scr15 and ma==255) 'runterscrollen + if popupmarker==0 + if util==11 and infomarker==0 'Dateifenster nur scrollen, wenn kein Infofenster angezeigt wird + if filenumber>21 + scrollhoch 'Bildschirm scrollen + if scrtrashdir) 'Nur im Dateifenster (nicht im Mülleimer) playerstop cmd_mkdir change_marker:=0 'Verzeichnis muss neu eingelesen werden @@ -1931,7 +2055,7 @@ pri keyboardscan(k)|i,err,a,c,d,e,formatok fensterweg 'alle anderen Fenster löschen i:=scan_number_key if i=>0 and i=0 and i=0 and i=24 'außerhalb Scrollbereich? reset_Highlight 'Parameter für die Hervorhebung löschen @@ -2108,12 +2244,13 @@ pri reset_Highlight bytefill(@filestring_old,0,12) 'Dateinamen-Puffer löschen PRI highlight_selection(position) 'Dateiname mit einem farbigen Balken hervorheben + ' printdec_win(y_old,1,1) if util==11 and position>3 'nur im Dateifenster ab position y==4 hervorheben if highlight 'erstes mal Datei angeklickt(keine Old-Parameter) display_line(@filestring,position,winhcol,act_color) 'Dateiname mit Balken anzeigen - if highlight and strsize(@filestring_old)>0 'Hervorhebung aktiv und String im Puffer? + if highlight and strsize(@filestring_old)>0 'and position<>y_old 'Hervorhebung aktiv und String im Puffer? display_line(@filestring_old,y_old,old_color,winhcol) 'alter Dateiname an alter Position ohne Balken anzeigen bytemove(@filestring_old,@filestring,12) 'neuen Dateinamen in den Puffer schreiben @@ -2121,37 +2258,88 @@ PRI highlight_selection(position) scanstr(@filestring,1) 'Datei auf Endung scannen old_color:=act_color 'Farbe zurücksetzen (Standardschriftfarbe) - if strsize(@buff)<1 'Wenn Verzeichnis + if filedir==255 'Wenn Verzeichnis old_color:=selectcol 'Select-Farbe verwenden con '*********************************** Datei-Handling ************************************************************************************************************************** PRI OPEN_FILE(str):err err:=ios.sdopen("R",str) if err - error(err) + display_error(err) ios.sdclose -pri start_file(mode) +pri start_file(mode)|a,c + status_onoff ifnot OPEN_FILE(@filestring) case mode + '***************************** BIN-Dateien starten *********************************** 1:ios.ldbin(@filestring) 2:ios.belload(@filestring) 3:ios.admload(@filestring) 4:if venatrix ios.venload(@filestring) - 5:ios.paraset(@filestring) - ios.ldbin(@BAS_RT) -PRI FILE_START|a,c,dirmark + 5:ios.paraset(@filestring) + ios.ldbin(dll_txt(2)) + '****************************** SID-DMP-Dateien abspielen ***************************** + 6:bytemove(@dumpstring,@filestring,12) + tmpplay:=dumpnummer 'Positionszähler aktualisieren + OPEN_FILE(@dumpstring) + ios.sid_sdmpplay(@dumpstring) + play:=1 + '***************************** Text-Dateien anzeigen ********************************* + 7:windowloesch 'Dateifenster löschen + textfenster 'Textfenster öffnen + print_titel(@filestring,15,2) + Textdisplay(0) + '***************************** Color-Schemen-Dateien laden *************************** + 8:repeat a from 0 to 14 + c:=ios.sdgetc + farbe(a,c) + ios.sdseek(69) + lmouse + bytemove(@textline,@filestring,12) 'Backup von @filestring + Bildschirmaufbau 'Bildschirm mit den neuen Farben darstellen + mc:=SD_Card + bytemove(@filestring,@textline,12) 'restore von @filestring + status_onoff + '****************************** Maus-Pfeil laden ************************************** + 9:loadMouse(@filestring) + '****************************** Font-Datei laden ************************************** + 10:ios.mousepointer(Hour_Glass) 'Sanduhr anzeigen + load_Font + ios.mousepointer(Mouse_ram) 'Mauszeiger anzeigen + + +pri load_Font + + LoadTiletoRam(@filestring,SYS_FONT) 'neue Fontdatei in den Ram laden + ios.loadtilebuffer(SYS_FONT,2816) 'Systemfont aus E-Ram nach Bella laden + activate_dirmarker(systemdir) 'ins Systemverzeichnis + ios.sddel(@sysfont) 'bisherigen Systemfont löschen + ios.sdnewfile(@filestring) 'neue leere Datei (neue Font-Datei) erzeugen + ios.sdcopy(userdir,systemdir,@filestring) 'ausgewählte Fontdatei ins Systemverzeichnis kopieren + activate_dirmarker(rootdir) 'nach dem kopieren muß erst mal ins Root-Verzeichnis gesprungen werden + activate_dirmarker(systemdir) 'gehe ins Systemverzeichnis + + ios.sdrename(@filestring,@sysfont) 'Font-Datei in Reg.Fnt umbenennen + + activate_dirmarker(userdir) 'wieder ins User-Verzeichnis springen + + + +PRI LoadTiletoRam(datei,adress) 'tile:=tilenr,dateiname,xtile-zahl,ytilezahl + ios.sdopen("R",datei) 'datei öffnen + ios.sdxgetblk(adress,11264) 'datei in den Speicher schreiben (der blockbefehl ist viel schneller als der char-Befehl) + ios.sdclose + +PRI FILE_START|dirmark if mountmarker==1 playerstop dirmark:=get_dirmarker - '*****************Dateiname in der Statusleiste anzeigen****************************** - - print_status(@filestring,7+platz,29) 'Dateiname in der Statusleiste anzeigen '***************************** BIN-Dateien starten *********************************** if strcomp(@buff,@binfile) 'BIN-Datei, Ext-Datei starten @@ -2166,40 +2354,23 @@ PRI FILE_START|a,c,dirmark start_file(5) '****************************** Maus-Pfeil laden ************************************** if strcomp(@buff,@maus) - loadMouse(@filestring) + start_file(9) '****************************** SID-DMP-Dateien abspielen ***************************** if strcomp(@buff,@dmpfile) 'Sid-Dmp-Dateien abspielen - 'playerstop - bytemove(@dumpstring,@filestring,12) - tmpplay:=dumpnummer 'Positionszähler aktualisieren - ifnot OPEN_FILE(@dumpstring) - ios.sid_sdmpplay(@dumpstring) - play:=1 + start_file(6) '***************************** Text-Dateien anzeigen ********************************* - if strcomp(@buff,@txtfile) 'or strcomp(@buff,@basfile) 'Txt Dateien anzeigen - windowloesch 'Dateifenster löschen - textfenster 'Textfenster öffnen - 'playerstop - Textdisplay(0) - + if strcomp(@buff,@txtfile) 'Txt Dateien anzeigen + start_file(7) '************************************************************************************* + if strcomp(@buff,@fontdat) + start_file(10) '***************************** Color-Schemen-Dateien laden *************************** if strcomp(@buff,@colorfile) 'Farb-Einstellungs-Dateien laden - ifnot OPEN_FILE(@filestring) '---- Farb-SETTINGS IN DEN RAM LADEN ------------- - repeat a from 0 to 14 - c:=ios.sdgetc - farbe(a,c) - ios.sdseek(69) - lmouse - - bytemove(@textline,@filestring,12) 'Backup von @filestring - Bildschirmaufbau 'Bildschirm mit den neuen Farben darstellen - mc:=SD_Card - bytemove(@filestring,@textline,12) 'restore von @filestring + start_file(8) '****************************** Verzeichnis öffnen *********************************** - if filedir==255 or strcomp(@filestring,@dirhoch) or strcomp(@filestring,@root) or strsize(@buff)<1 'Verzeichnis? dann öffnen + if filedir==255 or strcomp(@filestring,@dirhoch) or strcomp(@filestring,@root) 'Verzeichnis? dann öffnen highlight:=0 'Hervorhebung zurücksetzen bytefill(@filestring_old,0,12) 'Dateinamepuffer löschen ifnot(strcomp(@filestring,@trash)) @@ -2213,18 +2384,15 @@ PRI FILE_START|a,c,dirmark userdir:=rootdir else ios.sdchdir(@filestring) - userdir:=get_dirmarker 'User-Marker lesen + userdir:=get_dirmarker 'User-Marker lesen if strcomp(@filestring,@root) 'Verzeichnis-tiefenzähler aktualisieren Verzeichnis_counter-- - if Verzeichnis_counter>0 - Get_Verz_Name + else Verzeichnis_counter++ Put_Verz_Name - Leerstellenweg(@filestring) 'Leerstellen im String entfernen für Pfadanzeige - scrollanfang:=0 'Scrollparameter setzen kz:=1 scr:=0 @@ -2238,9 +2406,23 @@ PRI FILE_START|a,c,dirmark scrollende:=filenumber +Pri PUT_Pfad(n)|i,sp,tm,tc + tm:=1 + tc:=n + sp:=2 + repeat while tc>3 'Bei Verzeichnistiefe größer 3 beginne mit Verzeichnisname - letztes Verzeichnis-3 + tm+=1 + tc-=1 + if tm>1 + ios.displaytile(76,titelhcol,0,titeltextcol,26,sp++) + + repeat i from tm to n + GET_LINK(Verz_Ram,i,0) + sp:=print_titel(@filestring,sp,26) + ios.displaytile(76,titelhcol,0,titeltextcol,26,sp++) Pri Get_Verz_Name - GET_LINK(Verz_Ram,Verzeichnis_counter) + GET_LINK(Verz_Ram,Verzeichnis_counter,0) Pri Put_Verz_Name WriteDmpToRam(Verz_RAM,@filestring,12,Verzeichnis_counter) @@ -2250,6 +2432,7 @@ pri Bildschirmaufbau ios.printBoxColor(0,0,shellhcol,black) ios.printchar(12) 'cls ios.printcursorrate(0) + 'side_panel if mountmarker==1 icon(1,1) 'sd-card-symbol else @@ -2273,39 +2456,39 @@ PRI time|s if timezaehler>150 timezaehler:=0 s:=ios.getminutes - Status_extern(ios.dcf_sync,dcf_on,170,27,0,titeltextcol,black) 'Anzeige des aktuellen Status in der Titelzeile + Status_extern(ios.dcf_sync,dcf_on,170,34,29,hcolstatus,green,black) 'Anzeige des aktuellen Status in der Statusleiste neben der Uhr if venatrix==1 ios.bus_putchar3(50) bl_connect:=ios.bus_getchar3 - Status_extern(bl_connect,Bluetooth_on,169,25,0,blue,white) 'Anzeige des aktuellen Status in der Titelzeile + Status_extern(bl_connect,Bluetooth_on,169,19,0,titelhcol,blue,white) 'Anzeige des aktuellen Status in der Titelzeile else - Status_extern(serial,Bluetooth_on,169,25,0,blue,white) 'Anzeige des aktuellen Status in der Titelzeile + Status_extern(serial,Bluetooth_on,169,19,0,titelhcol,blue,white) 'Anzeige des aktuellen Status in der Titelzeile if s<>tmptime displaytime - 'printdec_win(bluetooth_on,1,1) PRI displaytime|h,m h:=ios.gethours m:=ios.getminutes - print_zehner(h,29,34,statustextcol,hcolstatus) + print_zehner(h,29,35,statustextcol,hcolstatus) - ios.displaytile(42,hcolstatus,0,statustextcol,29,36) 'doppelpunkt - print_zehner(m,29,37,statustextcol,hcolstatus) + ios.displaytile(42,hcolstatus,0,statustextcol,29,37) 'doppelpunkt + print_zehner(m,29,38,statustextcol,hcolstatus) + 'ios.displaytile(16,hcolstatus,0,statustextcol,29,39) 'leerfeld tmptime:=m date -pri Status_extern(wert1,wert2,tnr_act,x,y,col,f3) +pri Status_extern(wert1,wert2,tnr_act,x,y,f1,col,f3) if wert2==1 'Externe Komponente in Settingmenue ausgewählt? if wert1==1 - ios.displaytile(tnr_act,Titelhcol,col,f3,y,x) 'Status ok-anzeigen + ios.displaytile(tnr_act,f1,col,f3,y,x) 'Status ok-anzeigen else - ios.displaytile(tnr_act,titelhcol,grey,0,y,x) 'Symbol grau + ios.displaytile(tnr_act,f1,grey,0,y,x) 'Symbol grau else - ios.displaytile(16,Titelhcol,titeltextcol,0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) + ios.displaytile(16,f1,titeltextcol,0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) PRI date|t,m,j @@ -2313,13 +2496,13 @@ PRI date|t,m,j m:=ios.getmonth j:=ios.getyear - print_zehner(t,0,29,titeltextcol,titelhcol) - TITEL_TILE(30,0,31) 'Punkt + print_zehner(t,0,22,titeltextcol,titelhcol) + TITEL_TILE(30,0,24) 'Punkt - print_zehner(m,0,32,titeltextcol,titelhcol) - TITEL_TILE(30,0,34) 'Punkt + print_zehner(m,0,25,titeltextcol,titelhcol) + TITEL_TILE(30,0,27) 'Punkt - printdec_titel(j,0,35) 'Jahr + printdec_titel(j,0,28) 'Jahr con'************************************ Kalender-Funktion ******************************************************************************************************************** pri Kalender|i,day,x,y,f,tok','mo,tg @@ -2492,23 +2675,21 @@ PRI write_attrib|i,e display_error(e) change_marker:=0 'Verzeichnis neu in den Ram laden -con '***************************************************** Diverse Texte in den E-Ram laden ************************************************************************************** +con '***************************************************** Diverse Texte aus dem E-Ram lesen ************************************************************************************* -PRI fileload(adr): cont +PRI ram_txt(nummer) + return txt_from_ram(txt_ram,nummer,error_step) +pri dll_txt(nummer) + return txt_from_ram(dll_ram,nummer,dll_step) - cont:=ios.sdfattrib(0) - ios.sdxgetblk(adr,cont) - ios.sdclose - -PRI ram_txt(nummer)|c,i,ad +pri txt_from_ram(adr,nummer,st)|c,i,ad i:=0 - ad:=TXT_RAM+((nummer-1)*25) + ad:=adr+((nummer-1)*st) repeat while c:=ios.ram_rdbyte(ad++) if c>13 byte[@font][i++]:=c byte[@font][i]:=0 return @font - con '***************************************************** Die einzelnen Fenster ************************************************************************************************* PRI SD_CARD_INFO|fr,us,pr,str @@ -2537,7 +2718,7 @@ PRI SD_Card:msz|b ifnot Checkmount reset_Highlight 'Hervorhebungsparameter löschen fensterweg - Programmfenster(6,ios.sdvolname) + Programmfenster(8,ios.sdvolname) ifnot change_marker 'Dir neu einlesen, wenn das Verzeichnis geändert wurde playerstop 'Player stoppen tmpplay:=0 'Song-Zähler auf null @@ -2564,17 +2745,11 @@ pri show_always:msz zeilenende:=filenumber scrollende:=filenumber display_list(zeilenanfang,zeilenende) - ios.display2dbox(hcolstatus,29,8,29,32,0) - platz:=status_show util:=11 + if verzeichnis_counter>0 and get_dirmarker<>trashdir + Put_Pfad(Verzeichnis_counter) scr:=0 - -PRI status_show:p - - print_status(@dirname,7,29) - p:=strsize(@dirname) - PRI textfenster Programmfenster(4,ram_txt(41)) @@ -2593,6 +2768,7 @@ PRI Startmenue separator(0,25,9) print_message(@reboots,0,27) menuemarker:=1 + menue_nr:=0 PRI Coreanzeige|c[4],i,cogs,loops window(1,4,8,8,16,27,ram_txt(62)) @@ -2622,8 +2798,8 @@ PRI Coreanzeige|c[4],i,cogs,loops cogs:=1 i++ - button(1,@butOK,10,16) - button(2,@Abbr,20,16) + button(1,@butOK,15,16) + 'button(2,@Abbr,20,16) PRI Setting_window @@ -2704,7 +2880,7 @@ con '********************************************** Verwaltung der Desktopverkn PRI Make_link(dm)|i,n 'Desktopverknüpfung erzeugen bytemove(@textline,@filestring,12) '@filestring merken repeat i from 0 to 2 'Test auf freie Position - get_link(LINK_RAM,i) 'Link holen + get_link(LINK_RAM,i,1) 'Link holen if strsize(@filestring)<1 'Position frei? link_pointer:=i 'dann diese Position verwenden quit @@ -2728,7 +2904,7 @@ PRI LINK_START(numm)|nu nu:=0 activate_dirmarker(link_marker[numm]) 'Verzeichnis öffnen cmd_dir 'Verzeichnis einlesen - GET_LINK(LINK_RAM,numm) 'Link holen + GET_LINK(LINK_RAM,numm,1) 'Link holen ios.paracopy(PARA_RAM+(numm*64)) 'Parameter in den System-Parameter-Ram kopieren scanstr(@filestring,1) 'Dateiendung scannen @@ -2757,7 +2933,7 @@ PRI DISPLAY_PARAM(tx,ty,n)|c,txtmp,a ty+=1 if c==10 or c==13 'return oder linefeed nicht als zeichen anzeigen next - win_tile(c-16,ty,tx++) + Grossbuchstabe(c,ty,tx++) PRI FILL_LINK 'Link-Parameter füllen @@ -2767,7 +2943,7 @@ PRI FILL_LINK Plot_Link PRI DISPLAY_LINK(numm) - GET_LINK(LINK_RAM,numm) 'string holen + GET_LINK(LINK_RAM,numm,1) 'string holen if strsize(@filestring)>0 'Link gültig? SHOW_LINK(numm*13) 'an entsprechender Position anzeigen link_counter++ @@ -2776,20 +2952,22 @@ PRI PLOT_LINK|i repeat i from 0 to 2 DISPLAY_LINK(i) -PRI GET_LINK(basis,numm)|n,c,adr,i 'Link-String aus e-ram holen +PRI GET_LINK(basis,numm,mode)|n,c,adr,i 'Link-String aus e-ram holen + i:=0 n:=numm*17 - link_pointer:=numm + if mode + link_pointer:=numm adr:=basis+n - repeat i from 0 to 11 - c:=ios.ram_rdbyte(adr++) - filestring[i]:=c + repeat while (c:=ios.ram_rdbyte(adr++))>32' from 0 to 11 + filestring[i++]:=c + filestring[i]:=0 PRI SHOW_LINK(n)|p 'Link auf dem Desktop anzeigen scanstr(@filestring,1) bytemove(@link_string[n],@filestring,5) p:=get_pic(@buff) - ios.displaytile(p,Shellhcol,0,act_color,8+(link_pointer*5),37) + ios.displaytile(p,shellhcol,0,act_color,8+(link_pointer*5),37) printfont(@link_string[n],shellhcol,0,act_color,35,9+(link_pointer*5)) PRI Delete_Link(n,y)|i,a @@ -2923,13 +3101,14 @@ PRI Text_Input(ser,min_x,max_x,min_y,max_y,mode,adr,ch):ausg|k,ii,x,y,serchar,bl blck:=1 'feste Zeichenanzahl-merker if k 'Zeichen von Tastatur - WIN_TILE(k-16,zeile,spalte) + Grossbuchstabe(k,zeile,spalte) if spalte+10 'Zeichen in den Ram schreiben ios.ram_wrbyte(k,adr) @@ -2938,8 +3117,7 @@ PRI Text_Input(ser,min_x,max_x,min_y,max_y,mode,adr,ch):ausg|k,ii,x,y,serchar,bl if ser ios.sertx(k) elseif serchar 'Zeichen von der com. Schnittstelle - WIN_TILE(serchar-16,zeile,spalte++) 'Zeichen ausgeben - + Grossbuchstabe(serchar,zeile,spalte++) if spalte>max_x 'Zeilenumbruch bei Spalte max x if tmp==0 and ser==0 'normale Texteingabe in String (Rename) @@ -2954,7 +3132,7 @@ PRI Text_Input(ser,min_x,max_x,min_y,max_y,mode,adr,ch):ausg|k,ii,x,y,serchar,bl ios.scrollup(1,winhcol, min_y, min_x, max_y, max_x,1) zeile:=max_y 'Zeilennummer wieder auf max_y setzen - if inp and ausg==13 'neue Eingabe-Daten + if inp and ausg==13 'neue Eingabe-Daten ifnot mode 'Texteingabefenster if tmp>0 'Parameter-Modus w:=64-ii @@ -2977,8 +3155,8 @@ PRI Sysinfo bytemove(@buttontext[7*6],string("Font"),4) button(7,@buttontext[7*6],21,6) tabframe(1,5,31,24) - button(1,@butOK,10,24) - button(2,@Abbr,20,24) + button(1,@butOK,15,24) + 'button(2,@Abbr,20,24) PRI print_info(adr,x,y)|a,c 'Info-Texte aus dem Ram lesen und anzeigen a:=x @@ -2989,7 +3167,10 @@ PRI print_info(adr,x,y)|a,c next if c==10 next - WIN_TILE(c-16,y,x++) + Grossbuchstabe(c,y,x++) + 'if c>96 + ' c&=!32 + 'WIN_TILE(c-16,y,x++) PRI Programms 'Fenster für Zusatzprogramme Programmfenster(4,@programs) @@ -3014,6 +3195,16 @@ PRI Programms print_win(string("Blue-"),2,9) print_win(string("tooth"),2,10) + printdec_win(6,8,10) + iconbutton(15,113,11,8) + print_win(string("Font-"),9,9) + print_win(string("Edit"),9,10) + + printdec_win(7,8,17) + display_icon(22,81,winhcol,panelcol,8,18) + print_win(string("Signal-"),16,9) + print_win(string("Gen."),17,10) + pri Show_Help 'Hilfefenster anzeigen Programmfenster(4,@Help) util:=12 @@ -3023,7 +3214,7 @@ pri Show_Help textdisplay(0) PRI Programmfenster(mode,strg) - window(1,mode,4,2,24,33,strg) + window(1,mode,4,2,25,33,strg) PRI tab(numm,l,x,y) 'Registerzunge anzeigen L ist die Textlänge @@ -3031,8 +3222,8 @@ PRI tab(numm,l,x,y) taby[numm]:=y tabl[numm]:=x+1+l - ios.displaytile(144,winhcol,buttonhcol,0,y,x) - ios.displaytile(145,winhcol,buttonhcol,0,y,x+1+l) + ios.displaytile(165,0,winhcol,buttonhcol,y,x) + ios.displaytile(164,0,winhcol,buttonhcol,y,x+1+l) PRI tabframe(numm,wx,xx,yy)|i 'Rahmen für Tabulatorfenster erstellen @@ -3103,7 +3294,7 @@ PRI date_refresh printdec_win(Jahr,9,23) wait(20000) 'etwas warten, sonst ändern sich die Werte zu schnell -pri print_zehner(wert,y,x,vor,hin)|a +pri print_zehner(wert,y,x,vor,hin)|a 'Überprüfung Wert<10 dann führende Null anzeigen a:=0 if wert<10 printdec(0,y,x,hin,vor) @@ -3144,6 +3335,7 @@ PRI farbe(i,c) 13:mousecol:=c 14:panelcol:=c + pri get_farbe(n):c c:=lookupz(n:shellhcol,act_color,winhcol,winframecol,titelhcol,titeltextcol,hcolstatus,statustextcol{ },buttonhcol,buttontextcol,messagehcol,messagetextcol,selectcol,mousecol,panelcol) @@ -3185,7 +3377,7 @@ PRI RamDump(start)|i,a else WIN_TILE(139,4,23) - repeat i from 6 to 24 + repeat i from 6 to 25 dump(a,2,i,dump_ram) a+=8 @@ -3205,7 +3397,10 @@ PRI Dump(adr,x,y,mode) |c[8],a,i printhex(c[i],2,x++,y,winhcol,act_color) if c[i]>175 or c[i]<16 c[i]:=46 - WIN_TILE(c[i]-16,y,a++) + Grossbuchstabe(c[i],y,a++) + 'if c[i]>96 + ' c[i]&=!32 + 'WIN_TILE(c[i]-16,y,a++) x++ PRI Dumpadresse|k,sp,i,ok ,ad '***********Adresseingabe im E-Ram-Monitor**************** @@ -3213,7 +3408,6 @@ PRI Dumpadresse|k,sp,i,ok ,ad i:=0 ad:=adressraum+dump_ram printhex(HEX_ADRESSE, ad,8,4,act_color,winhcol) 'Eingabe revers darstellen - 'WIN_TILE(26,4,8) 'Eingabestern repeat k:=ios.key @@ -3236,15 +3430,13 @@ PRI Dumpadresse|k,sp,i,ok ,ad textline[i++]:=k if i>ad 'Adressraum-Eingrenzung Hubram 4-stellig, E-Ram 5-stellig i:=ad - 'WIN_TILE(26,4,i+8) - if ok==1 tp:= @textline HEX_ADRESSE:=gethexnumber ramdump(HEX_ADRESSE) startadresse:=HEX_ADRESSE - endadresse:=HEX_ADRESSE+144 + endadresse:=HEX_ADRESSE+152 scrollanfang:=startadresse/8 scrollende:=endadresse/8 @@ -3297,6 +3489,8 @@ PRI abspielen(mode) ios.sdopen("R",@dumpstring) ios.sid_sdmpplay(@dumpstring) play:=1 + if keyscanner 'Statusleiste sichtbar? + print_status(@dumpstring,14,29) if mode==1 and util==6 'Playerfenster sichtbar balkenleer @@ -3332,6 +3526,7 @@ PRI dmp_name con '***************************************************** Unterprogramme für die Fensterverwaltung ****************************************************************************** PRI icon(numm,mode)|a + if mode==1 a:=panelcol else @@ -3353,22 +3548,71 @@ PRI icon_tile(numm,mode_farbe,y,x) ios.displaytile(numm,shellhcol,mode_farbe,0,y,x) PRI statusleiste - ios.display2dbox(hcolstatus,29,0,29,39,0) + ios.display2dbox(hcolstatus,29,0,29,4,0) + ios.displaytile(144,shellhcol,hcolstatus,shellhcol,29,7) + + ios.displaytile(145,shellhcol,hcolstatus,shellhcol,29,32) + ios.displaytile(16,hcolstatus,shellhcol,hcolstatus,29,33) + ios.displaytile(16,hcolstatus,shellhcol,hcolstatus,29,34) + print_status(@starts,0,29) + PRI panel - regal(shellhcol,panelcol,26,11) + ios.display2dbox(shellhcol,27,9,27,30,0) + regal(shellhcol,panelcol,28-keyscanner,13) PRI shell - ios.display2dbox(titelhcol,0,0,0,39,0) - FRAME_TILE(0,0,0) - print_titel(string(" PLEXUS Ver."),1,0) - print_titel(@Version,13,0) - FRAME_TILE(1,0,39) + ios.display2dbox(shellhcol,0,0,0,39,0) + ios.displaytile(164,0,titelhcol,shellhcol,0,4) + print_titel(string("!"),5,0) + + ios.displaytile(164,0,shellhcol,titelhcol,0,6) + + ios.displaytile(164,0,titelhcol,shellhcol,0,7) + ios.display2dbox(titelhcol,0,8,0,31,0) + ios.displaytile(165,0,titelhcol,shellhcol,0,32) + print_titel(string("PLEXUS"),8,0) + print_titel(@version,15,0) + ios.displaytile(165,0,shellhcol,titelhcol,0,33) + ios.displaytile(166,titelhcol,winhcol,winframecol,0,34) + ios.displaytile(165,0,titelhcol,shellhcol,0,35) + + status_onoff + +pri status_onoff + + if keyscanner + show_keyscan + ios.display2dbox(hcolstatus,29,9,29,30,0) + ios.displaytile(145,hcolstatus,shellhcol,0,29,31) + ios.displaytile(144,hcolstatus,shellhcol,0,29,8) + print_status(@filestring,14,29) + else + ios.display2dbox(shellhcol,29,8,29,31,0) + panel + + +pri del_keyscan + shell + date + +pri show_keyscan + ios.displaytile(164,0,titelhcol,shellhcol,0,0) + ios.display2dbox(titelhcol,0,1,0,4,0) + ios.displaytile(165,0,titelhcol,shellhcol,0,39) + ios.display2dbox(titelhcol,0,35,0,38,0) PRI Regal(f1,f2,y,x)|i,c + ios.displaytile(112,f1,f2,0,y,12) + ios.displaytile(115,f1,f2,0,y,27) + + ios.displaytile(128,shellhcol,panelcol,0,y+1,12) + repeat i from 13 to 26 + ios.displaytile(132,shellhcol,panelcol,0,y+1,i) + ios.displaytile(131,shellhcol,panelcol,0,y+1,27) + c:=x - x:=display_icon(9,112,f1,f2,y,x) x:=display_icon(0,78,f1,f2,y,x) x:=display_icon(1,108,f1,f2,y,x) x:=display_icon(2,110,f1,f2,y,x) @@ -3376,15 +3620,6 @@ PRI Regal(f1,f2,y,x)|i,c x:=display_icon(4,142,f1,f2,y,x) x:=display_icon(5,158,f1,f2,y,x) x:=display_icon(6,174,f1,f2,y,x) - ios.displaytile(113,f1,f2,0,y,x) - ios.displaytile(115,f1,f2,0,y,x+1) - - x:=display_icon(9,128,f1,f2,y+1,c) - - repeat i from c+1 to c+16 - ios.displaytile(132,f1,f2,0,y+1,i) - - ios.displaytile(131,f1,f2,0,y+1,c+17) PRI display_icon(ic,inr,f1,f2,y,x):xx ios.displaytile(inr,f1,f2,0,y,x) @@ -3404,7 +3639,9 @@ PRI window(numm,cntrl,y,x,yy,xx,strg) windowyy[numm]:=yy+1 'Nr,Vord,hint,curs,framecol - ios.window(numm,0,winhcol,0,winframecol,titelhcol,titeltextcol,hcolstatus,statustextcol,y-2,x-1,yy+1,xx+1,cntrl,0) + ios.window(numm,0,winhcol,0,winframecol,titelhcol,titeltextcol,titelhcol{hcolstatus,statustextcol},titeltextcol,y-2,x-1,yy+1,xx+1,cntrl,0) + 'ios.displaytile(164,0,shellhcol,titelhcol,y-2,xx) + 'ios.displaytile(165,0,shellhcol,titelhcol,y-2,x) ios.printcursorrate(0) ios.printchar(12) 'cls @@ -3478,20 +3715,28 @@ PRI buttonpress(n)|s 1: printfont(@butOK,250,0,0,buttonx[n],buttony[n]) 2: printfont(@Abbr,250,0,0,buttonx[n],buttony[n]) 3: printfont(@starts,250,0,0,0,29) + ios.displaytile(144,shellhcol,250,shellhcol,29,7) + + 'ios.displaytile(164,0,shellhcol,250,29,7) s:=1 4: printfont(@butOK,250,0,0,buttonx[n],buttony[n]) - 5,6,7,8:ios.displaytile(144,winhcol,250,0,taby[n-4],tabx[n-4]) + 5,6,7,8:ios.displaytile(165,0,winhcol,250,taby[n-4],tabx[n-4]) printfont(@buttontext[n*6],250,0,0,buttonx[n],buttony[n]) - ios.displaytile(145,winhcol,250,0,taby[n-4],tabl[n-4]) + ios.displaytile(164,0,winhcol,250,taby[n-4],tabl[n-4]) s:=2 + Mouse_Release case s 1:print_status(@starts,0,29) - 2:ios.displaytile(144,winhcol,buttonhcol,0,taby[n-4],tabx[n-4]) 'tab wiederherstellen + 'ios.displaytile(164,0,shellhcol,hcolstatus,29,7) + ios.displaytile(144,shellhcol,hcolstatus,shellhcol,29,7) + + + 2:ios.displaytile(165,0,winhcol,buttonhcol,taby[n-4],tabx[n-4]) 'tab wiederherstellen print_button(@buttontext[n*6],buttonx[n],buttony[n]) - ios.displaytile(145,winhcol,buttonhcol,0,taby[n-4],tabl[n-4]) + ios.displaytile(164,0,winhcol,buttonhcol,taby[n-4],tabl[n-4]) PRI abfrage:taste|a,x,y,k repeat @@ -3515,7 +3760,7 @@ con '*********************************************** Fenster-Lösch-Funktionen * PRI windowloesch 'einzelnes Fenster löschen popup_info_weg 'Popup-oder Infofenster loeschen - ios.display2dbox(shellhcol, 1, 1, 25, 34,0) 'Fenster loeschen + ios.display2dbox(shellhcol, 1, 1, 26, 34,0) 'Fenster loeschen windownum[1]:=windowx[1]:=windowy[1]:=windowxx[1]:=windowyy[1]:=-1 'Windowwerte loeschen ios.windel(1) 'printdec_win(util,1,1) @@ -3564,7 +3809,7 @@ PRI textdisplay(mode)|tx,tt,c,x,adr,b next - if tt>24 'bis Zeile 24 + if tt>25 'bis Zeile 24 repeat ma:=ios.mouse_button(0) b:=ios.key @@ -3586,30 +3831,38 @@ PRI textdisplay(mode)|tx,tt,c,x,adr,b repeat 8 c:=ios.sdgetc printhex(c,2,tx++,tt,winhcol,act_color) - if c>175 or c<16 + if c>175 or c<16 'Zeichencode ausserhalb darstellbarer Zeichen c:=46 - WIN_TILE(c-16,tt,x++) + Grossbuchstabe(c,tt,x++) tx++ adr++ tx:=2 tt+=1 else - WIN_TILE(c-16,tt,tx) + Grossbuchstabe(c,tt,tx) tx++ until ios.sdeof 'ausgabe bis eof ios.sdclose +PRI Grossbuchstabe(n,y,x) + if n>96 'in Großbuchstaben umwandeln + n&=!32 + n-=16 + WIN_TILE(n,y,x) PRI printfont(str1,a,b,c,d,e)|f repeat strsize(str1) - f:= byte[str1++]-16 + f:= byte[str1++] + if f>96 + f&=!32 if d>39 'wenn Bildschirmrand erreicht, neue Zeile d:=0 e++ - ios.displayTile(f,a,b,c,e,d) 'einzelnes Tile anzeigen ('displayTile(tnr,pcol,scol,tcol, row, column)) - + ios.displayTile(f-16,a,b,c,e,d) 'einzelnes Tile anzeigen ('displayTile(tnr,pcol,scol,tcol, row, column)) d++ + return d + PRI printdec(value,y,xx,hint,vor) | i ,c ,x 'screen: dezimalen zahlenwert auf bildschirm ausgeben i := 1_000_000_000 @@ -3673,17 +3926,21 @@ PRI TITEL_TILE(nu,ty,tx) PRI print_win(stradr,x,y) printfont(stradr,winhcol,0,act_color,x,y) + +PRI print_shell(stradr,x,y) + printfont(stradr,shellhcol,0,act_color,x,y) + PRI print_win_rev(stradr,x,y) 'reverse Darstellung printfont(stradr,act_color,0,winhcol,x,y) -PRI print_titel(stradr,x,y) - printfont(stradr,titelhcol,0,titeltextcol,x,y) +PRI print_titel(stradr,x,y):a + a:=printfont(stradr,titelhcol,0,titeltextcol,x,y) PRI Print_button(stradr,x,y) printfont(stradr,buttonhcol,0,buttontextcol,x,y) -PRI print_status(stradr,x,y) - printfont(stradr,hcolstatus,0,statustextcol,x,y) +PRI print_status(stradr,x,y):a + a:=printfont(stradr,hcolstatus,0,statustextcol,x,y) PRI print_message(stradr,x,y) printfont(stradr,messagehcol,0,messagetextcol,x,y) @@ -3691,6 +3948,9 @@ PRI print_message(stradr,x,y) PRI printdec_win(n,y,x) printdec(n,y,x,winhcol,act_color) +PRI printdec_shell(n,y,x) + printdec(n,y,x,shellhcol,act_color) + PRI printdec_win_revers(n,y,x) printdec(n,y,x,act_color,winhcol) @@ -3727,8 +3987,8 @@ PRI Poke_Ram(x,y):inp PRI adresseminus startadresse-=8 endadresse-=8 - if endadresse<144 - endadresse:=144 + if endadresse<152 + endadresse:=152 if startadresse<1 startadresse:=0 @@ -3738,14 +3998,14 @@ PRI adresseplus PRI scrollup(adresse) - ios.scrollup(1, winhcol, 6, 2, 24, 32,1) + ios.scrollup(1, winhcol, 6, 2, 25, 32,1) scrollanfang++ - dump(adresse,2,24,dump_ram) + dump(adresse,2,25,dump_ram) PRI scrolldown(adresse) if scrollanfang>0 scrollanfang-- - ios.scrolldown(1, winhcol, 6, 2, 24, 32,1) + ios.scrolldown(1, winhcol, 6, 2, 25, 32,1) dump(adresse,2,6,dump_ram) PRI scrollrunter @@ -3784,17 +4044,6 @@ PRI doppelklick|click if click>1 return 1 -PRI Leerstellenweg(f)|i,c 'entfernt die Leerstellen im String - i:=0 - dirname[i++]:="\" - repeat while strsize(f) - c:=byte[f++] - if c==32 - quit - dirname[i++]:=c - dirname[i++]:="\" - dirname[i++]:=0 - PRI Scan_File(y)|col 'scannt den Dateinamen nach erweiterung ->keine Erweiterung=Verzeichnis=andere Farbe col:=act_color if filedir==255 'verzeichnis @@ -4146,12 +4395,24 @@ PRI Show_Trash icon(2,1) 'Mülleimer leer anzeigen (Deckel drauf) con '***************************************************** Reboot-Funktion ******************************************************************************************************* -PRI cmd_reboot 'cmd: reboot - ios.displaytile(1,250,0,0,0,39) 'Schliessen-Symbol - Mouse_Release - FRAME_TILE(1,0,39) - - if display_error(25) 'Frage Reboot anzeigen und abfragen +PRI cmd_reboot(mode)|e,f 'cmd: reboot + e:=f:=0 + if mode + e:=display_error(79) 'Hive mit TRIOS-Rebooten + if e + activate_dirmarker(rootdir) + ios.sdrename(@sys_file,@sys_tmp) + f:=ios.sdrename(@sys_trs,@sys_file) + if f==5 'keine TRIOS-Startdatei vorhanden + ios.sdrename(@sys_tmp,@sys_file) + display_error(f) + return + else + ios.displaytile(166,titelhcol,winframecol,winhcol,0,34) + Mouse_Release + ios.displaytile(166,titelhcol,winhcol,winframecol,0,34) + e:=display_error(25) 'Frage Reboot anzeigen und abfragen + if e playerstop 'eventuell laufenden Player stoppen ios.Clear_Bluetooth_Command_Mode 'Kommando-Mode ausschalten @@ -4206,14 +4467,13 @@ PRI display_Filename(stradr,ty,col)|p if strsize(stradr)>0 and ty<25 ios.displaytile(p,winhcol,winframecol,col,ty,2) display_line(stradr,ty,col,winhcol) - 'printfont(stradr,winhcol,0,col,3,ty) if filedir printfont(string("Dir"),winhcol,0,col,16,ty) else printdec(filelen,ty,16,winhcol,col) - printdec(fileday,ty,23,winhcol,col) + print_zehner(fileday,ty,23,col,winhcol) ios.displaytile(29,winhcol,0,col,ty,25) - printdec(filemonth,ty,26,winhcol,col) + print_zehner(filemonth,ty,26,col,winhcol) ios.displaytile(29,winhcol,0,col,ty,28) printdec(fileyear,ty,29,winhcol,col) @@ -4242,7 +4502,9 @@ PRI get_pic(stradr):pic pic:=CLR_PIC elseif strcomp(stradr,@extfile) pic:=EXT_PIC - elseif filedir or strsize(stradr)<1 + elseif strcomp(stradr,@fontdat) + pic:=FNT_PIC + elseif filedir 'or strsize(stradr)<1 pic:=DIR_PIC PRI scanstr(f,mode) | z ,c 'Dateiendung extrahieren @@ -4346,6 +4608,8 @@ PRI binsave|i,a,b ios.ram_wrbyte(Use_Trash,b++) 'Verwendung Mülleimer in den Ram schreiben ios.ram_wrbyte(DCF_ON,b++) 'Verwendung DCF-Empfänger in den Ram schreiben ios.ram_wrbyte(Bluetooth_on,b++) 'Verwendung Bluetooth-Modul in den Ram schreiben + ios.ram_wrbyte(keyscanner,b++) 'Anzeige extended Titlebar + ios.sdputc(baud) 'Übertragungsrate serielles Terminal in INI-Datei schreiben ios.sdputc(Show_Hid_Files) 'Anzeige unsichtbarer Dateien in INI-Datei schreiben @@ -4365,6 +4629,7 @@ PRI binsave|i,a,b ios.sdputc(dcf_on) 'Verwendung DCF-Empfänger ios.sdputc(bluetooth_on) 'Verwendung Bluetooth-Modul + ios.sdputc(keyscanner) 'Anzeige extended Titlebar PRI iniload|i,a i:=SETTING_RAM @@ -4376,7 +4641,7 @@ PRI iniload|i,a Use_Trash:=ios.ram_rdbyte(i++) 'Mülleimer verwenden? ja/nein dcf_on:=ios.ram_rdbyte(i++) 'DCF-Empfänger benutzen bluetooth_on:=ios.ram_rdbyte(i++) 'Bluetooth-Modul - + keyscanner:=ios.ram_rdbyte(i++) 'Merker für extended Titlebar ios.Mousepointer(MOUSE_RAM) 'Maus-Pointer einlesen dcf_onoff 'DCF-Ein/Aus @@ -4431,19 +4696,21 @@ PRI LINK_LOAD(mode)|i,c dcf_on:=ios.sdgetc 'Verwendung DCF-Empfänger bluetooth_on:=ios.sdgetc 'Bluetooth-Modul + keyscanner:=ios.sdgetc 'Anzeige extended Titlebar + iniload PRI inisave if mountmarker==1 - playerstop - activate_dirmarker(systemdir) - ios.sddel(@ini) - ios.sdnewfile(@ini) - ios.sdopen("W",@ini) - binsave - ios.sdclose - activate_dirmarker(userdir) + playerstop 'eventuell laufenden Player anhalten + activate_dirmarker(systemdir) 'Systemverzeichnis setzen + ios.sddel(@ini) 'alte Ini-Datei löschen + ios.sdnewfile(@ini) 'neue Ini-Datei erstellen + ios.sdopen("W",@ini) 'Datei öffnen + binsave 'alle Systemparameter speichern + ios.sdclose 'Datei schließen + activate_dirmarker(userdir) 'wieder zurück ins User-Verzeichnis pri loadMouse(datei)|e e:=ios.sdopen("R",datei) 'datei öffnen diff --git a/source/Plexus-Start-Trios.spin b/source/Plexus-Start-Trios.spin index cff242a..f1f004e 100644 --- a/source/Plexus-Start-Trios.spin +++ b/source/Plexus-Start-Trios.spin @@ -51,6 +51,8 @@ sndnfo = $21200 prgnfo = $21400 Verz_RAM = $21800 MENU_RAM = $22000 +'-------- Speicher für DLL-Namen ---------------- +DLL_RAM = $30000 '-------- Speicher für Titelliste --------------- DMP_RAM = $40000 '-------- Speicher für Screensaver -------------- @@ -59,10 +61,10 @@ SCREEN_SV = $63000 SYS_FONT = $66800 '....$693FF ' ab hier liegt der System-Font 11kb +MOUSE_RAM = $69400 '....$6943F ' User-Mouse-Pointer 64byte '-------- Speicher für Dateiliste --------------- DIR_RAM = $69440 '....$6AFFF -MOUSE_RAM = $69400 '....$6943F ' User-Mouse-Pointer 64byte '-------- YMODEM Temp-Speicher ------------------ YMODEM_RAM= $7E400 '... $7E417 Name, der zu sendenden Datei, Was soll gemacht werden(0Empfang,1Senden)+Dirmarker @@ -89,19 +91,20 @@ obj gc:"glob-con" VAR 'systemvariablen byte font[25] 'Hilfsstring für Strings aus dem Ram - byte colors[14] + byte colors[15] long systemdir 'Systemverzeichnis-Marker dat ini byte "reg.ini",0 'Ini-Datei für Farbwerte, Dateiverknüpfungen und Systemeinstellungen errortxt byte "reg.err",0 ' Trash byte "TRASH ",0 - video_inf byte "VIDEO.NFO",0 - prg_inf byte "prg.nfo",0 - sound_nfo byte "sound.nfo",0 - plexus byte "plexus.dll",0 + video_inf byte "VIDEO.NFO",0 'Grafikinfo + prg_inf byte "prg.nfo",0 'Programminfo + sound_nfo byte "sound.nfo",0 'Soundinfo + dll_lst byte "dll.lst",0 'Dll-Namensliste + plexus byte "plexus.dll",0 'Plexus-Hauptprogramm SYSTEM Byte "PLEXUS ",0 'Plexus-Systemverzeichnis - Version byte "Version 2.06",0 + Version byte "Version 2.1",0 sysfont byte "reg.fnt",0 scrsaver byte "plexus.dat",0 @@ -110,40 +113,43 @@ dat PUB main | i,a ios.start - ios.sdmount 'sd-card mounten + ios.sdmount 'sd-card mounten activate_dirmarker(0) - ios.sdchdir(@system) 'in's System-Verzeichnis springen - systemdir:=get_dirmarker 'System-Dirmarker lesen + ios.sdchdir(@system) 'in's System-Verzeichnis springen + systemdir:=get_dirmarker 'System-Dirmarker lesen 'activate_dirmarker(0) if ios.admgetspec<>ADM_SPEC - ios.admload(string("plexus.adm")) 'Administracode laden + ios.admload(string("plexus.adm")) 'Administracode laden - activate_dirmarker(systemdir) 'nach dem Neustart von Administra wieder ins Systemverzeichnis springen + activate_dirmarker(systemdir) 'nach dem Neustart von Administra wieder ins Systemverzeichnis springen if ios.bel_get<>88 - ios.belload(string("plexus.bel")) 'Bellatrixcode laden + ios.belload(string("plexus.bel")) 'Bellatrixcode laden - ios.ram_fill(DIR_RAM,$1BFF,0) 'Dir-Speicher löschen - ios.ram_fill(DMP_RAM,$1FFF,0) 'Dmp-File-Speicher löschen - ios.ram_fill(TXT_RAM,$2000,0) 'Error-Text-Speicher löschen - ios.ram_fill(LINK_RAM,$ff,0) 'Link-Speicher löschen - ios.ram_fill(MENU_RAM,$500,0) 'Menue-Text-Speicher löschen - ios.ram_fill(YMODEM_RAM,$30,0) 'YMODEM-RAM löschen + ios.ram_fill(DIR_RAM,$1BFF,0) 'Dir-Speicher löschen + ios.ram_fill(DMP_RAM,$1FFF,0) 'Dmp-File-Speicher löschen + ios.ram_fill(TXT_RAM,$2000,0) 'Error-Text-Speicher löschen + ios.ram_fill(LINK_RAM,$ff,0) 'Link-Speicher löschen + ios.ram_fill(MENU_RAM,$500,0) 'Menue-Text-Speicher löschen + ios.ram_fill(dll_RAM,$300,0) 'Dll-Namen löschen + ios.ram_fill(YMODEM_RAM,$30,0) 'YMODEM-RAM löschen '-------------------------------------------------------------------------------------- - activate_dirmarker(systemdir) 'nach dem Neustart von Administra wieder ins Systemverzeichnis springen + activate_dirmarker(systemdir) 'nach dem Neustart von Administra wieder ins Systemverzeichnis springen ios.sdopen("R",@errortxt) - fileload_err(TXT_RAM) 'Fehler-Texte laden + fileload_err(TXT_RAM,25) 'Fehler-Texte laden ios.sdopen("R",@video_inf) - fileload(vidnfo) 'Video-Info laden + fileload(vidnfo) 'Video-Info laden ios.sdopen("R",@sound_nfo) - fileload(sndnfo) 'Sound-Info laden + fileload(sndnfo) 'Sound-Info laden ios.sdopen("R",@prg_inf) - fileload(prgnfo) 'Programm-Info laden + fileload(prgnfo) 'Programm-Info laden + ios.sdopen("R",@dll_lst) + fileload_err(DLL_RAM,16) 'dll-namen laden '***************** Initialisierung ohne Ini-Datei **************************** - if iniload 'wenn keine Ini da ist, standardwerte setzen + if iniload 'wenn keine Ini da ist, standardwerte setzen colors[0]:=light_blue colors[1]:=white colors[2]:=light_blue @@ -202,7 +208,7 @@ PUB main | i,a ios.setpos(21,12) ios.print(string("for Hive-Computer")) ios.printBoxcolor(0,orange,light_red,95) - ios.setpos(24,14) + ios.setpos(24,15) ios.print(@version) ios.printBoxcolor(0,orange,light_orange,95) @@ -214,7 +220,7 @@ PUB main | i,a ios.sdopen("R",@plexus) 'Plexus.Dll öffnen ios.ldbin(@plexus) 'Plexus laden - ios.stop + { #$FC, Light_Grey, #$A8, Grey, #$54, Dark_Grey #$C0, Light_Red, #$80, Red, #$40, Dark_Red @@ -233,7 +239,7 @@ PRI fileload(adr)|cont ios.sdxgetblk(adr,cont) ios.sdclose -PRI fileload_err(adr)| cont,c,b,a,i +PRI fileload_err(adr,st)| cont,c,b,a,i i:=adr b:=0 @@ -242,7 +248,7 @@ PRI fileload_err(adr)| cont,c,b,a,i if a==$0A b++ - i:=adr+(25*b) + i:=adr+(st*b) next else ios.ram_wrbyte(a,i++) @@ -303,6 +309,8 @@ PRI iniload:err|i,tmp ios.ram_wrbyte(ios.sdgetc,tmp++) '---- HC05-Bluetooth-Modul ------------------------- ios.ram_wrbyte(ios.sdgetc,tmp++) + '---- Extended Titlebar-Anzeige -------------------- + ios.ram_wrbyte(ios.sdgetc,tmp++) ios.sdclose diff --git a/source/SignalGenerator.spin b/source/SignalGenerator.spin new file mode 100644 index 0000000..7c126f6 --- /dev/null +++ b/source/SignalGenerator.spin @@ -0,0 +1,1408 @@ +{{ +┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Autor: Reinhard Zielinski │ +│ Copyright (c) 2013 Reinhard Zielinski │ +│ See end of file for terms of use. │ +│ Die Nutzungsbedingungen befinden sich am Ende der Datei │ +└──────────────────────────────────────────────────────────────────────────────────────────────────────┘ + +Informationen : hive-project.de +Kontakt : zille09@gmail.com +System : Plexus +Name : Plexus-Frontend für den Propeller Signal Generator v1.2 (C) 2012 von Johannes Ahlebrand +Chip : Regnatix +Typ : Plexus-Erweiterungsdatei +Version : 01 +Subversion : 00 + + +Logbuch : +'############################################### Version 1.0 ###################################################################################################################### + +10-07-2014 -Bildschirmmaske erstellt +11-07-2014 -Wellenformauswahl erstellt +16-07-2014 -Parametereingabe-Routine begonnen -> ist noch nicht optimal + -5665 Longs frei +17-07-2014 -Parametermaske soweit fertig, Mausauswahl fehlt noch + -6131 Longs frei +18-07-2014 -Save-Routine erstellt + -Load und Iniload-Routine erstellt + -speichern und laden funktioniert + -jetzt fehlt noch eine Dateiauswahl für zu ladende Parameterdateien und dann kann der Signalgenerator getestet werden + -5719 Longs frei + +'################################################ Version 1.1 ##################################################################################################################### +20-07-2014 -Parameterauswahl per Maus realisiert + -Parameterübertragung und Funktion soweit fertig + -es fehlt noch die PWM- und Sweep-Automatik + -Sweep-Automatik funktioniert, Schleife durch Timer-Abfragen ersetzt + -5362 Longs frei + +21-07-2014 -PWM-Automatik funktioniert jetzt auch + -beide Automatiken mit der Möglichkeit der Inversen Funktion ausgestattet (Werte von From und To können jeweils kleiner oder größer sein) + -Grundgerüst Ladefenster erstellt + -5167 Longs frei + +22-07-2014 -Ladefenster mit Dateiselektion komplettiert ->Mausbedienung fehlt noch + -5040 Longs frei + +27-07-2014 -Mausbedienung komplett + -soweit funktioniert alles, jetzt müsste noch etwas Optimierung ran + -4981 Longs frei + +14-08-2014 -Darstellungsfehler bei der Parameterübernahme aus Settingdatei behoben und etwas Optimierung + -5018 Longs frei + +}} + +obj + ios : "reg-ios-64" + TMRS : "timer" + +con +_CLKMODE = XTAL1 + PLL16X +_XINFREQ = 5_000_000 + +'------------- Shell-Farben ----------------------------------------------------- +shellhcol =0 'Hauptfensterfarbe +act_color =1 'Schriftfarbe +winhcol =2 'Fensterhintergrundfarbe +winframecol =3 'Fensterrandfarbe +Titelhcol =4 'Titelleistenfarbe +titeltextcol =5 'Titelleistentextfarbe +hcolstatus =6 'statusleiste hintergrundfarbe +statustextcol =7 'Statustextfarbe +buttonhcol =8 'Buttonhintergrundfarbe +buttontextcol =9 'Buttontextfarbe +messagehcol =10 'Messagebox-Hintergrundfarbe +messagetextcol =11 'Messagebox-Textfarbe +selectcol =12 'selektionsfarbe +mousecol =13 'Mauszeigerfarbe +panelcol =14 'Farbe des Utility-Panels + +ADM_SPEC = %00000000_00000000_00000000_01010011 +'-------- Speicher für diverse Texte ------------ +TXT_RAM = $20000 +SETTING_RAM = $7FF00 'Hier stehen die System-Settings +BRAM = $50000 'Overlay-Puffer +tmp_buffer = $51000 'temporärer Parameterspeicher +'-------- Speicher für Dateiliste --------------- +DIR_RAM = $69440 '....$7DFFF +'-------- Speicher für Systemfont --------------- +SYS_FONT = $66800 '....$693FF ' ab hier liegt der System-Font 11kb +Hour_Glass = $66800+(167*16*4) 'Sanduhr +MOUSE_RAM = $69400 '....$6943F ' User-Mouse-Pointer 64byte + +'******************Farben ******************************************************** + #$FC, Light_Grey, #$A8, Grey, #$54, Dark_Grey + #$C0, Light_Red, #$80, Red, #$40, Dark_Red + #$30, Light_Green, #$20, Green, #$10, Dark_Green + #$1F, Light_Blue, #$09, Blue, #$04, Dark_Blue + #$F0, Light_Orange, #$E6, Orange, #$92, Dark_Orange + #$CC, Light_Purple, #$88, Purple, #$44, Dark_Purple + #$3C, Light_Teal, #$28, Teal, #$14, Dark_Teal + #$FF, White, #$00, Black + +'------------- Wellenformen ------------------------------------------------------ + MUTE = 14, SAW = 16, TRIANGLE = 18, SQUARE = 22, NOISE = 25, SINE = 32, USER = 42 + +'------------- TASTENCODES ------------------------------------------------------- +Backspace = $C8 ' PS/2 keyboard backspace key +ESC_KEY = 27 +RETURN_KEY = 13 +Plus_Key = 43 +Minus_Key = 45 +Space_Key = 32 +TAB_KEY = 9 +ENTF_KEY = 186 +EINF_KEY = 187 +POS1_KEY = 6 +END_KEY = 7 +'------------- F-Tasten für Zusatzfunktionen ------------------------------------- +F1_Key = 208 +F2_Key = 209 +F3_Key = 210 +F4_Key = 211 +F5_Key = 212 +F6_Key = 213 +F7_Key = 214 +F8_Key = 215 +F9_Key = 216 +F10_Key = 217 +F11_Key = 218 +F12_Key = 219 +LEFT_KEY = 3 +RIGHT_KEY = 2 +'-------------------------------------------------------------------------------- + +var + + long systemdir 'Plexus-System-Verzeichnis + long setting[11] + long tmpwert + byte mountmarker,tmptime + byte colors[15] 'Farbwerte + byte ma,mb,mc,mz 'Maus-Tasten + + byte windowx[4] + byte windowy[4] + byte windowxx[4] + byte windowyy[4] + byte menuey[4] 'y-Koordinate für Start-Menue-Einträge + byte popupx,popupxx 'x und + byte popupy,popupyy 'y-Koordinaten des Popupmenues + byte popupmarker 'Marker für Popupmenue + byte infomarker + byte buttonx[11],buttony[11],buttonl[11] + byte util + byte timezaehler + '----------- DCF-Indikator ------------------------------------ + byte dcf_on + + + byte textline[13] 'Texteingabestring + byte tmpline[13] 'temp-string + byte font[25] + byte pwm_on,sweep_on,mute_on 'PWM-Sweep-und Mute Marker + byte Waveform 'ausgewählte Wellenform + byte tabkey 'Tab-Tasten-Zähler + byte tmp_wave 'temporärer Waveform-Wert + byte old 'alter tabkey-wert + byte selection 'selektierte Datei + byte Verzeichnis_counter 'Verzeichnis-Tiefenzähler + byte scr 'scrollmerker für Pfeiltasten +' byte filestring[13] 'selektierte Datei + byte buff[8] 'Dir-Befehl-variablen + '----------- Hervorhebungsbalken im Explorer ------------------ + byte y_old 'alte y-Koordinate + byte highlight 'Hervorhebungsmarker des Dateinamens + byte textline_old[13] 'alter Dateiname + byte old_color 'alte Farbe des Dateieintrages merken + + word filenumber 'Anzahl Dateien + long pw_von,pw_bis,pw_step + long sw_von,sw_bis,sw_step + long scrollende,scrollanfang,zeilenanfang, zeilenende 'Variablen für Scrollfunktion + +DAT + regsys byte "PLEXUS.DLL",0 'Reg.sys für Rückkehr aus externem Programm + SYSTEM Byte "PLEXUS",0 'Plexus-Systemverzeichnis + ini_file byte "WAVE.INI",0 'Ini-Datei + +DAT + Butt0 byte " SAW ",0 + Butt1 byte "Start ",0 + Butt2 byte "Cancel",0 + Butt3 byte "TRIANGLE",0 + Butt4 byte " OK ",0 + Butt5 byte " SQUARE ",0 + Butt6 byte " NOISE ",0 + Butt7 byte " SINE ",0 + MUTING byte " MUTE ",0 + Butt8 byte "LOAD",0 + Butt9 byte "SAVE",0 + + buttons word @Butt0,@Butt1,@Butt2,@Butt3,@Butt4,@Butt5,@Butt6,@Butt7,@butt8,@butt9 + tab byte 9,11,13,15,19,21,23,25,9,14,19 + spalte byte 19,19,19,19,19,17,17,19,25,25,25 + spaces byte 3,2,2,2,3,5,5,3,7,2,3 + + wvp_name byte ".WVP",0 + new_name byte "NEW.WVP",0 + PWM_50 byte "50 ",0 + PWM_25 byte "25 ",0 + PWM_12 byte "12.5",0 + PWM_6 byte "6.25",0 + PWM_3 byte "3.12",0 + PWM_1 byte "1.56",0 + PWM_07 byte "0.78",0 + PWM_03 byte "0.39",0 + +PUB main + + ios.start + cmd_mount 'sd-card mounten + mountmarker:=1 'mount-marker + '-------------------------------------------------------------------------------------- + activate_dirmarker(0) 'ins root + ios.sdchdir(@system) 'System-Verzeichnis lesen + systemdir:=get_dirmarker 'Dir-Marker lesen + + '-------------------------------------------------------------------------------------- + cmd_unmount + ios.ram_fill(tmp_buffer,48,0) + Waveform:=SAW + bytemove(@textline[0],@new_name,strsize(@new_name)) + iniload 'Ini-Datei mit Farbwerten laden + ios.mousepointer(MOUSE_RAM) + testfenster + util:=0 + pwm_on:=0 + sweep_on:=0 + tabkey:=-1 + buttonx[1]:=0 + buttony[1]:=29 + buttonl[1]:=7 + print_form(waveform,2,23) + ios.plxHalt + + '*********************************** Timer-Cog starten ******************************************************************************************************** + TMRS.start(1000) 'Timer-Objekt starten mit 1ms-Aufloesung + + ios.Gen_Start_FunctionGenerator + Load_Parameter + Set_Parameter + 'print_win(@textline,1,1) + repeat + + os_cmdinput 'Hauptprogrammschleife + +PRI os_cmdinput | x,y ,i,b,dk,key,tile_nr,pw_r,sw_r + pw_r:=0 + sw_r:=0 + highlight:=1 'keine Hervorhebung + scr:=0 + repeat + time 'Zeit und Datum anzeigen + + ma:=ios.mouse_button(0) 'linke Maustaste + mb:=ios.mouse_button(1) 'rechte Maustaste + mz:=ios.mousez + key:=ios.key + if key + 'printdec_win(key,1,1) + Key_Command(key) +'************************** Modulationsautomatik *************************************************************** + if pwm_on==1 + ifnot mute_on + if TMRS.isclr(0) + if setting[1] pw_bis + pw_von:=(setting[1]) + + if setting[1]>setting[2] + pw_von-=pw_step + if pw_von =< pw_bis + pw_von:=setting[1] + ios.Gen_SetPulseWidth(1<sw_bis + sw_von:=setting[5] + if setting[5]>setting[6] + sw_von-=sw_step + if sw_von=13 and x<27 and y>8 and y<26 + util:=2 + if x=>25 and x=<27 + repeat i from 8 to 10 + if y==tab[i] + tabkey:=i + quit + else + repeat i from 0 to 7 + if y==tab[i] + tabkey:=i + quit + tmpwert:=setting[tabkey] + Ausgabe_Wert(old,setting[old],tab[old],spalte[old],0) + Ausgabe_Wert(tabkey,setting[tabkey],tab[tabkey],spalte[tabkey],1) + old:=tabkey + +'****************************** Startmenue anzeigen ************************************************************ + if popupmarker==1 + if x>10 or y<22 'Menue loeschen, wenn man woanders hinklickt + popup_info_weg + util:=0 + if x=>0 and x=<10 and y=>23 and y=<28 + repeat i from 0 to 3 + if menuey[i]==y + + case i + 0:menueselect(string("Info - F1"),menuey[i]) + Key_Command(F1_Key) + 1:menueselect(string("Load - F2"),menuey[i]) + Key_Command(F2_Key) + 2:menueselect(string("Save - F3"),menuey[i]) + Key_Command(F3_Key) + 3:menueselect(string("-EXIT- F12"),menuey[i]) + Key_Command(F12_Key) + + + if util==4 and x>12 and x<25 and y>7 and y<18 + selection:=y-7 + getfilename(selection+scrollanfang) 'selektierte Datei nr + highlight_selection(y) + if doppelklick + popup_info_weg + select_file + util:=0 + +'****************************** Globale Funktionstasten ******************************************************** + + + + if y==windowy[2] and x==windowx[2] and Infomarker==1 'doppelklick in linke obere ecke des Info-Fensters + if doppelklick>1 + popup_info_weg + util:=0 + + elseif y==windowy[2] and x==windowxx[2] and Infomarker==1 + ios.get_window + popup_info_weg + util:=0 + + elseif y==0 + if (x==39) 'Beenden-Knopf + ios.displaytile(1,250,0,0,0,39) 'Schliessen-Symbol + Mouse_Release 'warten bis Maustaste losgelassen wird + ios.displaytile(1,colors[winhcol],0,colors[winframecol],0,39) 'Schliessen-Symbol + ausstieg + + if (x==0) 'Beenden bei Doppelklick auf linke obere Ecke + if doppelklick>1 + ausstieg + if x>1 and x<20 'Doppelklick in die Titelleiste + if doppelklick>1 + Key_Command(F1_Key) + + + else + repeat b from 0 to 9 + if (x=>buttonx[b]) and (x=mz or (x==31 and y=>6 and y=<11 and ma==255) 'hochscrollen + if popupmarker==0 + if util==4 'Dateifenster nur scrollen, wenn kein Infofenster angezeigt wird (byte kann keine -1 sein also 255) + if filenumber>10 'Dateianzahl höher als Zeilen im Dateifenster? + scrollrunter 'Bildschirm scrollen + if scr>0 + scr-- + mc:=mz + + if mc12 and ma==255) 'runterscrollen + if popupmarker==0 + if util==4 'Dateifenster nur scrollen, wenn kein Infofenster angezeigt wird + if filenumber>10 + scrollhoch 'Bildschirm scrollen + if scr5 and k<4 + popup_info_weg + 'util:=0 + case k + F1_Key:util:=0 + Display_Info + F2_Key:SD_Card + F3_Key:Save_fenster + F12_Key:ausstieg + ESC_KEY:if util==2 + setting[tabkey]:=tmpwert + Print_Spaces(spaces[tabkey],spalte[tabkey],tab[tabkey]) + Ausgabe_Wert(tabkey,setting[tabkey],tab[tabkey],spalte[tabkey],0) + popup_info_weg + util:=0 + RETURN_KEY:if util==2 'Werteauswahl + Print_Spaces(spaces,spalte[tabkey],tab[tabkey]) + Ausgabe_Wert(tabkey,setting[tabkey],tab[tabkey],spalte[tabkey],0) + + elseif util==4 'Load-Fenster + '******************************Dateien starten oder Verzeichnis wechseln************* + if selection=10 or tabkey==0 + tabkey:=0 + + tmpwert:=setting[tabkey] + Ausgabe_Wert(old,setting[old],tab[old],spalte[old],0) + Ausgabe_Wert(tabkey,setting[tabkey],tab[tabkey],spalte[tabkey],1) + old:=tabkey + + "A","a":Waveform:=SAW + "T","t":Waveform:=TRIANGLE + "Q","q":Waveform:=SQUARE + "N","n":Waveform:=NOISE + "S","s":Waveform:=SINE + "M","m":Mute_on:=toogle_value(Mute_ON,7,18) 'Mute + if mute_on + tmp_wave:=waveform + waveform:=mute + else + waveform:=tmp_wave + + "P","p":pwm_on:=toogle_value(pwm_ON,20,7) 'pwm an/aus + ifnot pwm_on + ios.Gen_SetPulseWidth(setting[10]) + + "W","w":sweep_on:=toogle_value(sweep_ON,20,17) 'sweep an/aus + ifnot sweep_on + ios.Gen_Frequency(setting[8]) + + + 4:if util==2 + setting[tabkey]++ + elseif util==4 + IF selection>1 + selection-- + getfilename(selection+scr) + + if selection==1 and scr>0 + scrollrunter + scr-- + highlight_selection(selection+7) + + 5:if util==2 + setting[tabkey]-- + elseif util==4 + if selection10 + if scr10 + zeilenende:=10 + scrollende:=10 + else + zeilenende:=filenumber + scrollende:=filenumber + display_list(zeilenanfang,zeilenende) + 'util:=4 + scr:=0 + +PRI scrollrunter + + if scrollanfang<0 + scrollanfang:=0 + if scrollanfang>0 + ios.scrolldown(1,colors[winhcol], 8, 13, 17, 29,1) + getfilename(scrollanfang) + display_Filename(@textline,8,colors[act_color])'Scan_File(4) + scrollanfang-- + scrollende-- + y_old++ + +PRI scrollhoch + if scrollendefilenumber + scrollende:=filenumber + scrollanfang:=filenumber-9 + +PRI highlight_selection(position) 'Dateiname mit einem farbigen Balken hervorheben + + if util==4 and position>7 'nur im Dateifenster ab position y==4 hervorheben + 'if highlight 'erstes mal Datei angeklickt(keine Old-Parameter) + + display_line(@textline,position,colors[winhcol],colors[act_color]) 'Dateiname mit Balken anzeigen + + if {highlight and }strsize(@textline_old)>0 'Hervorhebung aktiv und String im Puffer? + + display_line(@textline_old,y_old,colors[act_color],colors[winhcol]) 'alter Dateiname an alter Position ohne Balken anzeigen + bytemove(@textline_old,@textline,12) 'neuen Dateinamen in den Puffer schreiben + y_old:=position 'y-Koordinate merken + +PRI display_Line(stradr,ty,vor,hin) 'Ausgabe Dateiname, Icon, Größe und Erstellungsdatum + + printfont(stradr,hin,0,vor,13,ty) +pri Ausgabe_Wert(n,w,y,x,inv)|j + if inv + case n + 0..8:printdec_win_inv(setting[n],tab[n],spalte[n]) + 9: printdec_win_inv(setting[n]*6,tab[n],spalte[n]) + 10: case setting[n] + 31:print_win_inv(@PWM_50,spalte[n],tab[n]) + 30:print_win_inv(@PWM_25,spalte[n],tab[n]) + 29:print_win_inv(@PWM_12,spalte[n],tab[n]) + 28:print_win_inv(@PWM_6,spalte[n],tab[n]) + 27:print_win_inv(@PWM_3,spalte[n],tab[n]) + 26:print_win_inv(@PWM_1,spalte[n],tab[n]) + 25:print_win_inv(@PWM_07,spalte[n],tab[n]) + 24:print_win_inv(@PWM_03,spalte[n],tab[n]) + + + else + case n + 0..8:printdec_win(setting[n],tab[n],spalte[n]) + 9: printdec_win(setting[n]*6,tab[n],spalte[n]) + 10: case setting[n] + 31:print_win(@PWM_50,spalte[n],tab[n]) + 30:print_win(@PWM_25,spalte[n],tab[n]) + 29:print_win(@PWM_12,spalte[n],tab[n]) + 28:print_win(@PWM_6,spalte[n],tab[n]) + 27:print_win(@PWM_3,spalte[n],tab[n]) + 26:print_win(@PWM_1,spalte[n],tab[n]) + 25:print_win(@PWM_07,spalte[n],tab[n]) + 24:print_win(@PWM_03,spalte[n],tab[n]) + + + +pri check_limits(act_wert,min_wert,max_wert):ergebnis + ergebnis:=act_wert + if act_wertMax_wert + ergebnis:=min_wert + +PRI printdec_win(n,y,x) + printdec(n,y,x,colors[winhcol],colors[act_color]) +PRI printdec_win_inv(n,y,x) + printdec(n,y,x,colors[act_color],colors[winhcol]) +PRI print_titel(stradr,x,y):a + a:=printfont(stradr,colors[titelhcol],0,colors[titeltextcol],x,y) +pri print_form(n,x,y) + + case n + SAW:print_win(@Butt0,x,y) + TRIANGLE:print_win(@Butt3,x,y) + SQUARE:print_win(@Butt5,x,y) + NOISE:print_win(@Butt6,x,y) + SINE:print_win(@Butt7,x,y) + 'USER:print_win(@muting,x,y) + + + +PRI printbin(value, digits,hint,vor,x,y) |c 'screen: binären zahlenwert auf bildschirm ausgeben + + value <<= 32 - digits + repeat digits + c:=(value <-= 1) & 1 + "0" + ios.displaytile(c-16,hint,0,vor,y,x++) +con'--------------------------------------------------- Datei-Ladefenster --------------------------------------------------------------------------------------------------------- +PRI SD_Card:msz|b + b:=0 + util:=4 + 'reset_Highlight 'Hervorhebungsparameter löschen + popup_info_weg + ios.backup_area(13-1,8-2,30+1,18+1,BRAM) 'Hintergrund sichern + window(2,8,8,13,18,30,@butt8) 'Programmfenster(8,ios.sdvolname) + infomarker:=1 + cmd_dir + msz:=show_always 'Dateiliste aus dem E-Ram anzeigen + + +PRI display_list(a,b)|n,tt 'Dateiliste aus dem Speicher lesen und anzeigen + tt:=7 + repeat n from a to b + getfilename(n) + display_filename(@textline,tt,colors[act_color]) + tt++ + +PRI getfilename(nummer)|adress,position,c,z',aus 'Dateiname aus dem E-Ram holen + position:=(nummer-1)*13 + adress:=DIR_RAM+position 'Adresse Dateiname im eRam + z:=0 + 'aus:=0 + bytefill(@textline,12,0) + repeat 12 + c:=ios.ram_rdbyte(adress++) 'Dateiname aus Dir-Ram lesen + textline[z++]:=c + + textline[z]:=0 + + +PRI cmd_dir|stradr,n,d,c,ty',sh 'cmd: verzeichnis anzeigen +{{sddir - anzeige verzeichnis}} + n:=0 + c:=5 + ty:=8 + ios.sdmount + activate_dirmarker(systemdir) + ios.sddir 'kommando: verzeichnis öffnen + + repeat while (stradr <> 0) 'Begrenzung der Einträge auf die mit DIR_ENTRY vereinbarte 'ist eintrag gültig? + 'wiederhole bis verzeichnisende + stradr:=ios.sdnext 'einen eintrag holen + if stradr <> 0 + if ios.sdfattrib(17) 'unsichtbare Dateien ausblenden und Verzeichnisse + next + if ios.sdfattrib(19) + next + scanstr_ext(stradr,1) + if strcomp(@buff,@wvp_name) + n++ + WriteNameToRam(stradr,n) 'Dateiname zur spaeteren Verwendung in ERam speichern an adresse n + + filenumber:=n + ios.ram_fill(DIR_RAM+(n*13),$1BFF-(n*13),0) 'Variablen,Dir-Speicher,nach letzten Eintrag löschen + ios.sdunmount + +PRI WriteNameToRam(st,nummer)|adress,position,c 'Dateiliste in ERam schreiben + position:=(nummer-1)*13 + adress:=DIR_RAM+position + repeat strsize(st) + c:=byte[st++] + ios.ram_wrbyte(c,adress++) + +PRI scanstr_ext(f,mode) | z ,c ,a ,i 'Dateiendung extrahieren + if mode==1 + repeat while strsize(f) + if c:=byte[f++] == "." 'bis punkt springen + quit + f-- + z:=0 + repeat 4 'dateiendung lesen + c:=byte[f++] + buff[z++] := c + buff[z++] := 0 + return @buff +PRI display_Filename(stradr,ty,col)|p 'Ausgabe Dateiname, Icon, Größe und Erstellungsdatum + + if strsize(stradr)>0 and ty<18 + print_win(stradr,13,ty) + +con'--------------------------------------------------- Speicherroutine ----------------------------------------------------------------------------------------------------------- +PRI Save_Fenster:s|l + infofenster(9,10,29,15,string("Save Parameter"),1) 'Info-Fenster anzeigen + util:=3 + Print_win(string("Filename:"),9,10) + scanstr(@textline) + Print_win(@textline,18,10) + print_win(string(".WVP"),26,10) + s:=Text_Input(18,26,10,0,8) + l:=strsize(@textline) + if l<1 + bytemove(@textline[0],@new_name,7) + l:=7 + else + bytemove(@textline[l],@wvp_name,4) + textline[l+4]:=0 + ios.display2dbox(colors[winhcol],23,25,24,36,0) + print_win(@textline,25,23) + + if s==13 + popup_info_weg + util:=0 + Save_File(@textline) + +PRI Save_File(str)|adr,count,i + ios.sdmount + activate_dirmarker(systemdir) + adr:=tmp_buffer + i:=0 + repeat 11 'Longs in den Tmp-Puffer schreiben + ios.ram_wrlong(setting[i++],adr) + adr+=4 + ios.ram_wrbyte(waveform,adr++) + ios.ram_wrbyte(pwm_on,adr++) + ios.ram_wrbyte(sweep_on,adr++) + ios.ram_wrbyte(mute_on,adr) + + adr:=tmp_buffer + if ifexist(str) + ios.mousepointer(hour_glass) 'Sanduhr anzeigen + ios.sdopen("W",str) + ios.sdseek(0) + repeat 48 'Parameter vom Tmp-Puffer auf SD-Karte schreiben + ios.sdputc(ios.ram_rdbyte(adr++)) + ios.sdputc(0) + ios.sdclose + + save_ini_name + ios.mousepointer(Mouse_ram) 'Mauszeiger anzeigen + + else + ios.sdclose + + ios.sdunmount +pri save_ini_name|i + + i:=0 + ios.sddel(@ini_file) 'alte ini-datei löschen + ios.sdnewfile(@ini_file) 'datei neu erstellen + ios.sdopen("W",@ini_file) + i:=0 + repeat strsize(@textline) + ios.sdputc(textline[i++]) 'Dateiname in die ini-Datei schreiben + ios.sdputc(0) + ios.sdclose + +PRI Load_Parameter|adr,i + i:=0 + adr:=tmp_buffer + + repeat i from 0 to 10 'Longs aus dem Tmp-Puffer lesen + setting[i]:=ios.ram_rdlong(adr) + Print_Spaces(spaces[i],spalte[i],tab[i]) + Ausgabe_Wert(i,setting[i],tab[i],spalte[i],0)'display_parameter(i++) + adr+=4 + waveform:=ios.ram_rdbyte(adr++) + pwm_on :=ios.ram_rdbyte(adr++) + sweep_on:=ios.ram_rdbyte(adr++) + mute_on :=ios.ram_rdbyte(adr++) + Win_Tile(140-Mute_on,18,7) 'Mute + Win_Tile(140-pwm_on,7,20) 'pwm an/aus + Win_Tile(140-sweep_on,17,20) 'sweep an/aus + print_form(waveform,2,23) + print_win(@textline,25,23) + + if mute_on + tmp_wave:=waveform + waveform:=mute + +'pri display_parameter(n) + 'printdec_win(setting[n],tab[n],spalte[n]) +' Ausgabe_Wert(n,setting[n],spalte[n],tab[n],0) + +pri Set_Parameter|pwm_wert + pwm_wert:=1<buttonx[4]) and (x=buttonx[2]) and (x=<(buttonx[2]+6)) and (y==buttony[2]))or k==27 'cancel + buttonpress(2) + taste:=0 + + popup_info_weg + +PRI ram_txt(nummer)|c,i,ad + i:=0 + ad:=TXT_RAM+((nummer-1)*25) + repeat while c:=ios.ram_rdbyte(ad++) + if c>13 + font[i++]:=c + font[i]:=0 + return @font + +PRI messagebox(st)|laenge,mindest,messagex + laenge:=strsize(st)+2 + mindest:= 20 + messagex:=10+laenge + ios.backup_area(7,10,messagex,17,BRAM) 'Hintergrund sichern + ios.display3DBox(white, colors[messagehcol], black, 10, 7, 17, messagex) + windowx[2]:=7 + windowy[2]:=10 + windowxx[2]:=messagex + windowyy[2]:=17 + print_message(st,8,11) + Infomarker:=1 + + button(4,10,15) + button(2,1+laenge,15) + +PRI print_message(stradr,x,y) + printfont(stradr,colors[messagehcol],0,colors[messagetextcol],x,y) + +con' +PRI Text_Input(min_x,max_x,zeile,adr,ch):ausg|k,ii,x,y,blck,inp,adr_tmp,kl,spalten + {{####################################################### + adr=Adresse Parameter-Ram adr=0 normales Textfeld + ch=maximale Anzahl Zeichen + ####################################################### + }} + ii:=1 + blck:=0 + adr_tmp:=adr+1 'Adresse merken + 'tmps:=adr + inp:=0 'Eingabe Merker, wird aktiviert, wenn was verändert wurde + spalten:=min_x + + + WIN_TILE(6,zeile,spalten) 'Eingabe-Cursor + + repeat + time 'Zeitaktualisierung + k:=ios.key + ma:=ios.mouse_button(0) + + if k==27 or ma 'Abbruch mit ESC + x:=ios.mousex + y:=ios.mousey + kl:=ios.get_window//10 'Icon-Button-Nummer des Fensters + if (kl==1) or (kl==2) or (k==27) 'Abfrage auf Fensterloeschen + popup_info_weg + quit + + if(x=>buttonx[4]) and (x=1 + if spaltenmin_x + WIN_TILE(6,zeile,spalten) 'Cursor einen Schritt zurück + else + WIN_TILE(16,zeile,spalten) 'Leerzeichen + + adr-- + inp:=1 'Text wurde verändert + ii-- + blck:=0 + + if k>13 'Alle Zeichen außer Return + if ii>ch + ii:=ch 'Zeichenanzahl nicht mehr erhöhen + blck:=1 'feste Zeichenanzahl-merker + else + ii++ + if k>96 + k&=!32 + if spalten+1150 + timezaehler:=0 + s:=ios.getminutes + Status_extern(ios.dcf_sync,dcf_on,170,34,29,green,black) 'Anzeige des aktuellen Status in der Titelzeile + if s<>tmptime + displaytime + +PRI displaytime|h,m + + h:=ios.gethours + m:=ios.getminutes + + print_zehner(h,29,35,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,37) + + print_zehner(m,29,38,colors[hcolstatus],colors[statustextcol]) + tmptime:=m + date + +PRI date + + print_zehner(ios.getdate,0,29,colors[titelhcol],colors[titeltextcol]) + ios.displaytile(30,colors[titelhcol],0,colors[titeltextcol],0,31) + + print_zehner(ios.getmonth,0,32,colors[titelhcol],colors[titeltextcol]) + ios.displaytile(30,colors[titelhcol],0,colors[titeltextcol],0,34) + printdec(ios.getyear,0,35,colors[titelhcol],colors[titeltextcol]) + +pri print_zehner(wert,y,x,hin,vor)|a + a:=0 + if wert<10 + printdec(0,y,x,hin,vor) + a:=1 + printdec(wert,y,x+a,hin,vor) + +pri Status_extern(wert1,wert2,tnr_act,x,y,col,f3) + + if wert1==1 + ios.displaytile(tnr_act,colors[hcolstatus],col,f3,y,x) 'Status ok-anzeigen + else + if wert2 'Externe Komponente in Settingmenue ausgewählt? + ios.displaytile(tnr_act,colors[hcolstatus],grey,0,y,x) 'Symbol grau + else + ios.displaytile(16,colors[hcolstatus],colors[statustextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) + 'printdec(dcf_on,1,1,colors[winhcol],colors[act_color]) +con' +PRI doppelklick:click 'pseudo-doppelklick + click:=0 + 'ios.get_window + Mouse_Release + + repeat 500 + if ios.mouse_button(0)==255 + click++ + +con' +PRI iniload|i,a,c,adr + a:=SETTING_RAM + repeat i from 0 to 14 + colors[i]:=ios.ram_rdbyte(a++) + dcf_on:=ios.ram_rdbyte(a+3) + ios.sdmount + activate_dirmarker(systemdir) + ifnot ios.sdopen("r",@ini_file) + i:=0 + '********* Dateinamen der letzten Setting-Datei lesen ******** + repeat + c:=ios.sdgetc + tmpline[i++]:=c + until ios.sdeof + tmpline[i]:=0 + bytemove(@textline[0],@tmpline,strsize(@tmpline)) + ios.sdclose + 'print_win(@textline,1,1) + '********* Parameter der Setting-Datei in den Ram schreiben ** + load_in_ram(@textline) + 'ifnot ios.sdopen("r",@textline) + ' adr:=tmp_buffer + ' repeat + ' ios.ram_wrbyte(ios.sdgetc,adr++) + ' until ios.sdeof + + ios.sdclose + ios.sdunmount +pri load_in_ram(str)|adr + + ifnot ios.sdopen("r",str) + adr:=tmp_buffer + repeat + ios.ram_wrbyte(ios.sdgetc,adr++) + until ios.sdeof + +PRI activate_dirmarker(mark) 'USER-Marker setzen + + ios.sddmput(ios#DM_USER,mark) 'usermarker wieder in administra setzen + ios.sddmact(ios#DM_USER) 'u-marker aktivieren + +PRI get_dirmarker:dm 'USER-Marker lesen + + ios.sddmset(ios#DM_USER) + dm:=ios.sddmget(ios#DM_USER) +PRI cmd_mount :err 'cmd: mount + + repeat 16 + err:=ios.sdmount + ifnot err + mountmarker:=1 + quit + else + ' display_error(err) + quit + +PRI cmd_unmount|err 'cmd: unmount + err:=ios.sdunmount + ifnot err + mountmarker:=0 + else + 'display_error(err) + +PRI window(num,cntrl,y,x,yy,xx,strg) 'ein Fenster erstellen + + windowx[num]:=x-1 + windowy[num]:=y-2 + windowxx[num]:=xx+1 + windowyy[num]:=yy+1 + + ios.window(num,0,colors[winhcol],0,colors[winframecol],colors[titelhcol],colors[titeltextcol],colors[hcolstatus],colors[statustextcol],y-2,x-1,yy+1,xx+1,cntrl,0) + ios.printcursorrate(0) + ios.printchar(12) 'cls + printfont(strg,colors[titelhcol],0,colors[titeltextcol],x,y-2) + +PRI printfont(str1,a,b,c,d,e)|f + + repeat strsize(str1) + f:= byte[str1++] + if f >96 + f^=32 + f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt + if d>39 'wenn Bildschirmrand erreicht, neue Zeile + d:=0 + e++ + ios.displayTile(f,a,b,c,e,d) 'einzelnes Tile anzeigen ('displayTile(tnr,pcol,scol,tcol, row, column)) + + d++ +PRI printdec(value,y,xx,hint,vor) | i ,c ,x 'screen: dezimalen zahlenwert auf bildschirm ausgeben +{{printdec(value) - screen: dezimale bildschirmausgabe zahlenwertes}} + ' if value < 0 'negativer zahlenwert + ' -value + 'printchar("-") + + i := 1_000_000_000 + repeat 10 'zahl zerlegen + if value => i + x:=value / i + "0" + ios.displayTile(x-16,hint,0,vor,y,xx) 'printchar(x) + xx++ + c:=value / i + "0" + value //= i + result~~ + elseif result or i == 1 + printfont(string("0"),hint,0,vor,xx,y) 'printchar("0") + xx++ + i /= 10 'nächste stelle +con '************************************************** Button-Funktionen ******************************************************************************************************** + +PRI buttonpress(n) + printfont(@@buttons[n],250,0,0,buttonx[n],buttony[n]) + if n==1 + printfont(@@buttons[n],250,0,0,buttonx[n],buttony[n]) + ios.displaytile(144,colors[shellhcol],250,colors[shellhcol],29,7) + else + printfont(@@buttons[n],250,0,0,buttonx[n],buttony[n]) + Mouse_Release + if n==1 + printfont(@@buttons[n],colors[hcolstatus],0,colors[statustextcol],buttonx[n],buttony[n]) + ios.displaytile(144,colors[shellhcol],colors[hcolstatus],colors[shellhcol],29,7) + else + printfont(@@buttons[n],colors[Buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n]) + +con '*************************************************** Start-Menue ************************************************************************************************************* +PRI Menue(x,y,xx,yy)|i + popup(x,y,xx,yy) + repeat i from x to xx + ios.displaytile(16,colors[Titelhcol],$ff,$ff,y-1,i) + +PRI separator(x,y,xx)|i + repeat i from x to xx + ios.displaytile(6,colors[Messagehcol],0,colors[winframecol],y,i) + +PRI menueselect(stri,y) + printfont(stri,colors[messagetextcol],0,colors[messagehcol],0,y) + Mouse_Release + printfont(stri,colors[messagehcol],0,colors[messagetextcol],0,y) + popup_info_weg + +PRI Startmenue + menue(0,23,9,28) + printfont(string("Startmenue"),colors[titelhcol],0,colors[titeltextcol],0,22) + printfont(string("Info - F1"),colors[messagehcol],0,colors[messagetextcol],0,23) + menuey[0]:=23 + printfont(string("Load - F2"),colors[messagehcol],0,colors[messagetextcol],0,24) + menuey[1]:=24 + + printfont(string("Save - F3"),colors[messagehcol],0,colors[messagetextcol],0,25) + menuey[2]:=25 + separator(0,26,9) + + printfont(string("-EXIT- F12"),colors[messagehcol],0,colors[messagetextcol],0,27) + menuey[3]:=27 + popupmarker:=1 +con '*************************************************** Popup-Menue ************************************************************************************************************* + +PRI popup(x,y,xx,yy) + popupx:=x + popupy:=y-1 + popupyy:=yy + popupxx:=xx + ios.backup_area(popupx,popupy,popupxx,popupyy,BRAM) + ios.display2dbox(colors[messagehcol],y,x,yy,xx,0) + +PRI Popup_Info_weg + if popupmarker==1 'Popupmenue sichtbar? + ios.restore_area(popupx,popupy,popupxx,popupyy,BRAM) 'Hintergrund wiederherstellen + popupmarker:=0 'Popupmarker loeschen + if infomarker==1 + ios.restore_area(windowx[2],windowy[2],windowxx[2],windowyy[2],BRAM) 'Hintergrund wiederherstellen + buttonx[2]:=buttony[2]:=buttonl[2]:=buttonx[4]:=buttony[4]:=buttonl[4]:=-1 'Buttonwerte löschen + infomarker:=0 + + +PRI rahmen(x,y,xx,yy)|i + win_tile(137,y,x) + win_tile(136,yy,x) + win_tile(157,y,xx) + win_tile(119,yy,xx) + repeat i from y+1 to yy-1 + win_tile(2,i,x) + win_tile(114,i,xx) + line(x+1,y,xx-1) + line(x+1,yy,xx-1) + +PRI line(x,y,xx)|i + repeat i from x to xx + win_tile(130,y,i) + +con '---------------------------------------------- Ausgaberoutinen --------------------------------------------------------------------------------------------------------------- +PRI Win_Tile(nu,ty,tx) + ios.displaytile(nu,colors[winhcol],0,colors[act_color],ty,tx) + diff --git a/source/Switch_Plexus.spin b/source/Switch_Plexus.spin new file mode 100644 index 0000000..aa1b5a1 --- /dev/null +++ b/source/Switch_Plexus.spin @@ -0,0 +1,66 @@ +{{ +┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Autor: Reinhard Zielinski │ +│ Copyright (c) 2013 Reinhard Zielinski │ +│ See end of file for terms of use. │ +│ Die Nutzungsbedingungen befinden sich am Ende der Datei │ +└──────────────────────────────────────────────────────────────────────────────────────────────────────┘ + +Informationen : hive-project.de +Kontakt : zille09@gmail.com +System : TriOS +Name : PLEXUS - Zentrale Kommunikationseinheit der Borg +Chip : Regnatix +Typ : Programm +Version : 01 +Subversion : 00 + +Funktion : "Programm schaltet von TRIOS zu Plexus um + +Logbuch : +################################################### Version 1.00 ################################################################################################################ +}} +OBJ + ios: "reg-ios" + +CON + +_CLKMODE = XTAL1 + PLL16X +_XINFREQ = 5_000_000 + +VAR + '----------- Verzeichnismarker -------------------------------- + long rootdir 'root-Dirmarker + long systemdir 'system-Dirmarker + +DAT + sys_file byte "reg.sys",0 'Plexus oder Trios-Startdatei + sys_tmp byte "reg.tmp",0 'temporäre Plexus-Startdatei + sys_trs byte "reg.trs",0 'temporäre TRIOS-Startdatei + +PUB Main|e,err + + activate_dirmarker(0) + ios.sdrename(@sys_file,@sys_trs) + e:=ios.os_error(ios.sdrename(@sys_tmp,@sys_file)) + if e 'keine TRIOS-Startdatei vorhanden + ios.sdrename(@sys_trs,@sys_file) 'Tmp-Datei zurück in Sys + else + ios.admreset 'alle chips resetten + ios.belreset + + waitcnt(cnt+clkfreq*3) + reboot + + +PRI activate_dirmarker(mark) 'USER-Marker setzen + + ios.sddmput(ios#DM_USER,mark) 'usermarker wieder in administra setzen + ios.sddmact(ios#DM_USER) 'u-marker aktivieren + +PRI get_dirmarker:dm 'USER-Marker lesen + + ios.sddmset(ios#DM_USER) + dm:=ios.sddmget(ios#DM_USER) + + diff --git a/source/Timer.spin b/source/Timer.spin new file mode 100644 index 0000000..fae40ce --- /dev/null +++ b/source/Timer.spin @@ -0,0 +1,110 @@ +'' =========================================================================== +'' VGA High-Res Text UI Elements Base UI Support Functions v1.2 +'' +'' FILE: Timer.spin +'' Author: Allen Marincak +'' Copyright (c) 2009 Allen MArincak +'' See end of file for terms of use +'' =========================================================================== +'' +'' ============================================================================ +'' Timer function +'' ============================================================================ +'' +'' Starts a new cog to provide timing functionality. +'' +'' There are 8 timers available, the code running on the new cog simply +'' decrements each timer value at the rate specified in the start() call. +'' +'' Only the first object to create this needs to call the START method. That +'' will launch it on a new COG, other objects can reference it in the OBJ +'' section but do not need to start it, just call the public methods. +'' ============================================================================ + +_CLKMODE = XTAL1 + PLL16X +_XINFREQ = 5_000_000 + +DAT +' stack size determined StackLengthAJM.spin + cog long 0 'cog execute is running on + stack long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + timers long 0,0,0,0,0,0,0,0,0,0,0,0 'timer values (16 bit) + + +PUB start( period ) : okay1|okay2 +'' +'' Launches TIMER TASK on new cog, returns 0 on error, else the cog that was +'' started up. +'' - period is the fractional part of a second to operate at +'' example: 10 = 1/10th of a second +'' 30 = 1/30th of a second +'' 100 = 1/100th of a second + + longfill( @timers, 0, 12 ) + + + + cog := cognew( execute( period, @timers ), @stack ) + 1 + okay1 := cog + +Pub Stop + if Cog==-1 + return + cogstop(Cog) + Cog:=-1 + +PUB set( tmrid, val ) +'' Sets a registered timer with a 16 bit value. + + timers[tmrid] := val + + +PUB isClr( tmrid ): clr +'' Checks the status of the registered timer. +'' returns 1 if it has expired (zeroed) +'' 0 if is still running + + if timers[tmrid] == 0 + clr:= 1 + +PUB read( tmrid ) +'' returns the current count of a registered timer. + + return timers[tmrid] + +PRI execute( period, ptr_tmrs ) | idx +'' new cog executes this, it just decrements the timers + ' __________________ Korrekturwert + repeat '| + waitcnt( cnt + clkfreq / (period))' + 655)) + repeat idx from 0 to 11 + if idx<8 + if long[ptr_tmrs][idx] <> 0 + long[ptr_tmrs][idx] -= 1 + else + long[ptr_tmrs][idx]+=1 + + +{{ +┌────────────────────────────────────────────────────────────────────────────┐ +│ TERMS OF USE: MIT License │ +├────────────────────────────────────────────────────────────────────────────┤ +│Permission is hereby granted, free of charge, to any person obtaining a copy│ +│of this software and associated documentation files (the "Software"), to │ +│deal in the Software without restriction, including without limitation the │ +│rights to use, copy, modify, merge, publish, distribute, sublicense, and/or │ +│sell copies of the Software, and to permit persons to whom the Software is │ +│furnished to do so, subject to the following conditions: │ +│ │ +│The above copyright notice and this permission notice shall be included in │ +│all copies or substantial portions of the Software. │ +│ │ +│THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR │ +│IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, │ +│FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE │ +│AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER │ +│LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING │ +│FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS│ +│IN THE SOFTWARE. │ +└────────────────────────────────────────────────────────────────────────────┘ +}} diff --git a/source/Venatrix-Bus.spin b/source/Venatrix-Bus.spin deleted file mode 100644 index edde4b2..0000000 --- a/source/Venatrix-Bus.spin +++ /dev/null @@ -1,252 +0,0 @@ -{{ -┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐ -│ Autor: Ingo Kripahle Anpassungen:Reinhard Zielinski │ -│ Copyright (c) 2013 Ingo Kripahle │ -│ See end of file for terms of use. │ -│ Die Nutzungsbedingungen befinden sich am Ende der Datei │ -└──────────────────────────────────────────────────────────────────────────────────────────────────────┘ - -Informationen : hive-project.de -Kontakt : zille9@googlemail.com -System : Hive -Name : Bus-Erweiterung für Hive-Computer -Chip : Venatrix-Bus-Protokoll -Typ : EEProm-Urfile -Version : 00 -Subversion : 01 -Funktion : Bus-System für Erweiterungsmodule - -Der integrierte Loader kann Venatrix mit einem beliebigen Code versorgen - - -COG's : MANAGMENT 1 COG - ------------------- - 1 COG - -}} -CON -_CLKMODE = XTAL1 + PLL16X -_XINFREQ = 5_000_000 - -' /cs --------+ -' clk -------+| -' /wr ------+|| -' /hs -----+||| +------------------------- /cs ->bei Venatrix P24 statt P23 -' |||| | -------- d0..d7 -DB_IN = %00001000_00000000_00000000_00000000 'maske: dbus-eingabe -DB_OUT = %00001000_00000000_00000000_11111111 'maske: dbus-ausgabe - -M1 = %00000010_00000000_00000000_00000000 'busclk=1? & /cs=0? -M2 = %00000011_00000000_00000000_00000000 'maske: busclk & /cs (/prop4) - -M3 = %00000000_00000000_00000000_00000000 'busclk=0? -M4 = %00000010_00000000_00000000_00000000 'maske busclk - - -#24, BUS_CS 'Chip-Select - BUSCLK 'bustakt - BUS_WR '/wr - schreibsignal - BUS_HS ' '/hs - quittungssignal - -STRCOUNT =64 'Größe des Stringpuffers - -Var - byte proghdr[16] 'puffer für objektkopf - long plen 'länge datenblock loader - byte strpuffer[STRCOUNT] 'stringpuffer - -PUB bus_init 'bus: initialisiert bussystem -{{bus_init - bus: initialisierung aller bussignale }} - - dira:= db_in ' datenbus auf eingabe schalten - outa[bus_hs] := 1 ' handshake inaktiv ,frida - 'outa[23..8] := 0 ' Port 2 und 3 Null setzen - -PUB bus_putchar(zeichen) 'chip: ein byte über bus ausgeben -''funktionsgruppe : chip -''funktion : senderoutine für ein byte zu regnatix über den systembus -''eingabe : byte zeichen -''ausgabe : - - - waitpeq(M1,M2,0) 'busclk=1? & /prop1=0? - dira := db_out 'datenbus auf ausgabe stellen - outa[7..0] := zeichen 'daten ausgeben - outa[bus_hs] := 0 'daten gültig - waitpeq(M3,M4,0) 'busclk=0? - dira := db_in - outa[bus_hs] := 1 'daten ungültig - -PUB bus_getchar : zeichen 'chip: ein byte über bus empfangen -''funktionsgruppe : chip -''funktion : emfangsroutine für ein byte von regnatix über den systembus -''eingabe : - -''ausgabe : byte zeichen - waitpeq(M1,M2,0) 'busclk=1? & prop4=0? - zeichen := ina[7..0] 'daten einlesen - outa[bus_hs] := 0 'daten quittieren - waitpeq(M3,M4,0) 'busclk=0? - outa[bus_hs] := 1 - -PUB bus_putstr(stradr) | len,i 'bus: string zu administra senden - - len := strsize(stradr) - bus_putchar(len) - repeat i from 0 to len - 1 - bus_putchar(byte[stradr++]) - -PUB bus_getstr: stradr | len,i 'bus: string von administra empfangen - - len := bus_getchar 'längenbyte empfangen - repeat i from 0 to len - 1 '20 zeichen dateinamen empfangen - strpuffer[i] := bus_getchar - strpuffer[i] := 0 - return @strpuffer - -PUB bus_getword: wert 'bus: 16 bit von bellatrix empfangen hsb/lsb - - wert := bus_getchar << 8 - wert := wert + bus_getchar - -PUB bus_putword(wert) 'bus: 16 bit an bellatrix senden hsb/lsb - - bus_putchar(wert >> 8) - bus_putchar(wert) - -PUB bus_getlong: wert 'bus: long von bellatrix empfangen hsb/lsb - - wert := bus_getchar << 24 '32 bit empfangen hsb/lsb - wert := wert + bus_getchar << 16 - wert := wert + bus_getchar << 8 - wert := wert + bus_getchar - -PUB bus_putlong(wert) 'bus: long an bellatrix senden hsb/lsb - - bus_putchar(wert >> 24) '32bit wert senden hsb/lsb - bus_putchar(wert >> 16) - bus_putchar(wert >> 8) - bus_putchar(wert) - -con'------------------------------------------------ Chiploader ------------------------------------------------------------------------------------------------------------------- -PUB mgr_getcogs: cogs |i,c,cog[8] 'cmgr: abfragen wie viele cogs in benutzung sind -''funktionsgruppe : cmgr -''funktion : abfrage wie viele cogs in benutzung sind -''eingabe : - -''ausgabe : cogs - anzahl der cogs -''busprotokoll : [097][put.cogs] -'' : cogs - anzahl der belegten cogs - - cogs := i := 0 - repeat 'loads as many cogs as possible and stores their cog numbers - c := cog[i] := cognew(@entry, 0) - if c=>0 - i++ - while c => 0 - cogs := i - repeat 'unloads the cogs and updates the string - i-- - if i=>0 - cogstop(cog[i]) - while i=>0 - - -PUB mgr_load|i 'cmgr: venatrix-loader -''funktionsgruppe : cmgr -''funktion : funktion um einen neuen code in bellatrix zu laden -'' - -' kopf der bin-datei einlesen ------------------------------------------------------ - repeat i from 0 to 15 '16 bytes --> proghdr - byte[@proghdr][i] := bus_getchar - - plen := 0 - plen := byte[@proghdr + $0B] << 8 - plen := plen + byte[@proghdr + $0A] - plen := plen - 8 - -' objektlänge an regnatix senden - bus_putchar(plen >> 8) 'hsb senden - bus_putchar(plen & $FF) 'lsb senden - - repeat i from 0 to 7 'alle anderen cogs anhalten - ifnot i == cogid - cogstop(i) - - dira := 0 'diese cog vom bus trennen - cognew(@loader, plen) - - cogstop(cogid) 'cog 0 anhalten - -DAT - org 0 - -loader - mov outa, M_0 'bus inaktiv - mov dira, DINP 'bus auf eingabe schalten - mov reg_a, PAR 'parameter = plen - mov reg_b, #0 'adresse ab 0 - - ' datenblock empfangen -loop - call #get 'wert einlesen - wrbyte in, reg_b 'wert --> hubram - add reg_b, #1 'adresse + 1 - djnz reg_a, #loop - - ' neuen code starten - - rdword reg_a, #$A ' Setup the stack markers. - sub reg_a, #4 ' - wrlong SMARK, reg_a ' - sub reg_a, #4 ' - wrlong SMARK, reg_a ' - - rdbyte reg_a, #$4 ' Switch to new clock mode. - clkset reg_a ' - - coginit SINT ' Restart running new code. - - - cogid reg_a - cogstop reg_a 'cog hält sich selbst an - - -get - waitpeq M_1, M_2 'busclk=1? & /cs=0? - mov in, ina 'daten einlesen - and in, DMASK 'wert maskieren - mov outa, M_3 'hs=0 - waitpeq M_3, M_4 'busclk=0? - mov outa, M_0 'hs=1 -get_ret ret - - -' /cs --------+ -' clk -------+| -' /wr ------+|| -' /hs -----+|||+------------------------- /cs ->geändert auf 24 -' ||||| -------- d0..d7 -DINP long %00001000000000000000000000000000 'constant dinp hex \ bus input -DOUT long %00001000000000000000000011111111 'constant dout hex \ bus output - -M_0 long %00001000000000000000000000000000 'bus inaktiv - -M_1 long %00000010000000000000000000000000 -M_2 long %00000011000000000000000000000000 'busclk=1? & /cs=0? - -M_3 long %00000000000000000000000000000000 -M_4 long %00000010000000000000000000000000 'busclk=0? - - -DMASK long %00000000000000000000000011111111 'datenmaske - -SINT long ($0001 << 18) | ($3C01 << 4) ' Spin interpreter boot information. -SMARK long $FFF9FFFF ' Stack mark used for spin code. - -in res 1 -reg_a res 1 -reg_b res 1 -Dat - -' Entry: dummy-assemblercode fuer cogtest -' -entry jmp entry 'just loops diff --git a/source/Venatrix-Test.spin b/source/Venatrix-Test.spin index 9340891..577a857 100644 --- a/source/Venatrix-Test.spin +++ b/source/Venatrix-Test.spin @@ -329,7 +329,7 @@ PRI time|s 'Zeitanzeige in der Statusleiste if timezaehler>150 timezaehler:=0 s:=ios.getminutes - Status_extern(ios.dcf_sync,dcf_on,170,27,0,colors[titeltextcol],black) 'Anzeige des aktuellen Status in der Titelzeile + Status_extern(ios.dcf_sync,dcf_on,170,34,29,green,black) 'Anzeige des aktuellen Status in der Titelzeile if s<>tmptime displaytime @@ -338,10 +338,10 @@ PRI displaytime|h,m h:=ios.gethours m:=ios.getminutes - print_zehner(h,29,34,colors[hcolstatus],colors[statustextcol]) - ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,36) + print_zehner(h,29,35,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,37) - print_zehner(m,29,37,colors[hcolstatus],colors[statustextcol]) + print_zehner(m,29,38,colors[hcolstatus],colors[statustextcol]) tmptime:=m date @@ -364,12 +364,12 @@ pri print_zehner(wert,y,x,hin,vor)|a pri Status_extern(wert1,wert2,tnr_act,x,y,col,f3) if wert1==1 - ios.displaytile(tnr_act,colors[Titelhcol],col,f3,y,x) 'Status ok-anzeigen + ios.displaytile(tnr_act,colors[hcolstatus],col,f3,y,x) 'Status ok-anzeigen else - if wert2 'Externe Komponente in Settingmenue ausgewählt? - ios.displaytile(tnr_act,colors[titelhcol],grey,0,y,x) 'Symbol grau + if wert2 'Externe Komponente in Settingmenue ausgewählt? + ios.displaytile(tnr_act,colors[hcolstatus],grey,0,y,x) 'Symbol grau else - ios.displaytile(16,colors[Titelhcol],colors[titeltextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) + ios.displaytile(16,colors[hcolstatus],colors[statustextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) 'printdec(dcf_on,1,1,colors[winhcol],colors[act_color]) con' PRI doppelklick:click 'pseudo-doppelklick @@ -431,6 +431,8 @@ PRI printfont(str1,a,b,c,d,e)|f repeat strsize(str1) f:= byte[str1++] + if f >96 + f^=32 f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt if d>39 'wenn Bildschirmrand erreicht, neue Zeile d:=0 @@ -461,12 +463,14 @@ con '************************************************** Button-Funktionen ****** PRI buttonpress(n) case n - 1:printfont(string("Start"),250,0,0,0,29) + 1:printfont(string("Start "),250,0,0,0,29) + ios.displaytile(144,colors[shellhcol],250,colors[shellhcol],29,7) 4:printfont(@butOK,250,0,0,buttonx[n],buttony[n]) Mouse_Release case n - 1:printfont(string("Start"),colors[hcolstatus],0,colors[statustextcol],0,29) + 1:printfont(string("Start "),colors[hcolstatus],0,colors[statustextcol],0,29) + ios.displaytile(144,colors[shellhcol],colors[hcolstatus],colors[shellhcol],29,7) 4:printfont(@butOK,colors[Buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n]) diff --git a/source/Venatrix.spin b/source/Venatrix.spin deleted file mode 100644 index f8c2387..0000000 --- a/source/Venatrix.spin +++ /dev/null @@ -1,452 +0,0 @@ -{{ -┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐ -│ Autor: Reinhard Zielinski -> Original-Code: Ingo Kripahle │ -│ Copyright (c) 2013 Ingo Kripahle │ -│ See end of file for terms of use. │ -│ Die Nutzungsbedingungen befinden sich am Ende der Datei │ -└──────────────────────────────────────────────────────────────────────────────────────────────────────┘ - -Informationen : hive-project.de -Kontakt : zille9@googlemail.com -System : Hive -Name : Bus-Erweiterung für Hive-Computer -Chip : Venatrix -Typ : Treiber -Version : 01 -Subversion : 00 -Funktion : Bus-System für Erweiterungsmodule - -Der integrierte Loader kann Venatrix mit einem beliebigen Code versorgen - -20-11-2013 -I2C-Slave Funktion hinzugefügt, damit die Bus-Karte vom Hive (Plexus) erkannt werden kann (Adresse 5) - -22-03-2014 -HC05-Bluetoothmodul-Statuspin-Abfrage an Portpin 16 hinzugefügt - -IP-Stack von Joerg angefangen zu integrieren - - -COG's : MANAGMENT 1 COG - I2C-Slave 1 COG - IP-Stack 1 COG - ------------------- - 3 COG's - -}} -CON -_CLKMODE = XTAL1 + PLL16X -_XINFREQ = 5_000_000 -Treiberversion= %00010001 -'Treiberdatum = 20122013 - - -' /cs --------+ -' clk -------+| -' /wr ------+|| -' /hs -----+||| +------------------------- /cs ->bei Venatrix P24 statt P23 -' |||| | -------- d0..d7 -DB_IN = %00001000_00000000_00000000_00000000 'maske: dbus-eingabe -DB_OUT = %00001000_00000000_00000000_11111111 'maske: dbus-ausgabe - -M1 = %00000010_00000000_00000000_00000000 'busclk=1? & /cs=0? -M2 = %00000011_00000000_00000000_00000000 'maske: busclk & /cs (/prop4) - -M3 = %00000000_00000000_00000000_00000000 'busclk=0? -M4 = %00000010_00000000_00000000_00000000 'maske busclk - - - - -#0, D0,D1,D2,D3,D4,D5,D6,D7 'datenbus (Port A) -#8, B0,B1,B2,B3,B4,B5,B6,B7 'Port B -#16, C0,C1,C2,C3,C4,C5,C6,C7 'Port C -#24, BUS_CS 'Chip-Select - BUSCLK 'bustakt - BUS_WR '/wr - schreibsignal - BUS_HS ' '/hs - quittungssignal - - SDA_PIN = 29 - SCL_PIN = 28 -'Netzwerk-Puffergrößen (müssen Vielfaches von 2 sein!) -rxlen = 2048 -txlen = 128 -CON 'Signaldefinitionen -------------------------------------------------------------------------- - -'signaldefinitionen administra (todo: nach glob-con.spin auslagern!!!) - -'#20, A_NETCS,A_NETSCK,A_NETSI,A_NETSO 'Pins zum ENC28J60 - -CON 'NVRAM Konstanten -------------------------------------------------------------------------- - -' todo: nach glob-con.spin auslagern!!! -{ -#4, NVRAM_IPADDR -#8, NVRAM_IPMASK -#12, NVRAM_IPGW -#16, NVRAM_IPDNS -#20, NVRAM_IPBOOT -#24, NVRAM_HIVE ' 4 Bytes -} -txpin = 9 -rxpin = 8 -Ack = 6 -Error =15 -obj - bus : "Venatrix-Bus" 'allgemeine Bus-Funktionen - i2c_slave: "i2c_slave_Venatrix" -' sock : "driver_socket" 'LAN - 'gc : "glob-con" 'globale konstanten -' num : "glob-numbers" 'Number Engine -' ser : "FullDuplexSerialExtended" - -Var - byte proghdr[16] 'puffer für objektkopf - long plen 'länge datenblock loader -' byte lan_started 'LAN gestartet? -' long sockhandle[sock#sNumSockets] 'Handle für mit sock.connect/sock.listen erstellten Socket -' byte bufidx[sock#sNumSockets] 'zum Handle-Index gehörender Puffer-abschnitt - '(zum Socket mit dem Handle 2 gehört der Pufferabschnitt aus bufidx[2]) -' byte bufrx[rxlen*sock#sNumSockets] 'LAN Empfangspuffer -' byte buftx[txlen*sock#sNumSockets] 'LAN Sendepuffer - -PUB main | zeichen,i 'chip: kommandointerpreter -''funktionsgruppe : chip -''funktion : kommandointerpreter -''eingabe : - -''ausgabe : - - - bus.bus_init - 'LAN -' lan_started := false 'LAN noch nicht gestartet - i2c_Slave.Start( SCL_PIN, SDA_PIN, $5) -' ser.start(rxpin, txpin, 0, 9600) - - repeat - zeichen := bus.bus_getchar 'kommandocode empfangen - 'if zeichen - 'else - ' zeichen:=bus.bus_getchar - case zeichen - - 10: bus.bus_putchar(Port2_In) 'Sende Port-Zustand 2 - 20: bus.bus_putchar(Port3_In) 'Sende Portzustand 3 - 30: Port2_Out(bus.bus_getchar) 'Setze Port 2 - 40: Port3_Out(bus.bus_getchar) 'Setze Port 3 - 50: bus.bus_putchar(HC05_Status) 'Status des HC05-Bluetooth-Moduls - -' ---------------------------------------------- LAN-FUNKTIONEN -{ 71: lan_start 'Start Network - 72: lan_stop 'Stop Network - 73: lan_connect 'ausgehende TCP-Verbindung öffnen - 74: lan_listen 'auf eingehende TCP-Verbindung lauschen - 75: lan_waitconntimeout 'bestimmte Zeit auf Verbindung warten - 76: lan_close 'TCP-Verbindung schließen - 77: lan_rxtime 'bestimmte Zeit warten auf Byte aus Empfangspuffer - 78: lan_rxdata 'Daten aus Empfangspuffer lesen - 79: lan_txdata 'Daten senden - 80: lan_rxbyte 'wenn vorhanden, Byte aus Empfangspuffer lesen - 81: lan_isconnected 'TRUE, wenn Socket verbunden, sonst FALSE -} -' ---------------------------------------------- CHIP-MANAGMENT - 96: bus.bus_putchar(bus.mgr_getcogs) 'freie cogs abfragen - 97: bus.mgr_load 'neuen Venatrix-code laden - 98: bus.bus_putlong(Treiberversion) 'Rückgabe Testwert (Version des Venatrix-Treibers) - - 99: reboot 'Venatrix neu starten - -pri Port2_In:c - - dira[8..15]~ - c:=ina[15..8] - dira:=db_in - -pri Port3_In:c - dira[16..23]~ - c:=ina[23..16] - dira:=db_in - -pri Port2_Out(char) - - dira[8..15]~~ - outa[8..15]:=char - dira:=db_in - -pri Port3_Out(char) - - dira[16..23]~~ - outa[16..23]:=char - dira:=db_in - -pri HC05_Status:c 'Rueckgabewert des HC05-Statuspin - dira[16]~ - c:=ina[16] - dira:=db_in - -CON ''------------------------------------------------- LAN-FUNKTIONEN - -{PRI lan_start | hiveid, hivestr, strpos, macpos, i, a -''funktionsgruppe : lan -''funktion : Netzwerk starten -''eingabe : - -''ausgabe : - -''busprotokoll : [071] - - if (not lan_started) - - 'Pufferindex zurücksetzen - i := 0 - repeat sock#sNumSockets - bufidx[i++] := $FF '0xFF: nicht zugewiesen -'######################### Das hier muss nach Administra ################################ - get_ip 'diese funktionen ersetzen den auskommentierten Teil - hiveid:=bus.bus_putchar(72) 'in Administra hiveid ermitteln und übertragen -{ - 'IP-Parameter setzen - if probeRTC - repeat a from 0 to 15 - ip_addr[a] := rtc.getNVSRAM(NVRAM_IPADDR+a) ' fill addresses - hiveid := rtc.getNVSRAM(NVRAM_HIVE) - hiveid += rtc.getNVSRAM(NVRAM_HIVE+1) << 8 - hiveid += rtc.getNVSRAM(NVRAM_HIVE+2) << 16 - hiveid += rtc.getNVSRAM(NVRAM_HIVE+3) << 24 - else - dmarker[UMARKER] := sdfat.getDirCluster 'u-marker setzen - ifnot dmarker[SMARKER] == TRUE 's-marker aktivieren - sdfat.setDirCluster(dmarker[SMARKER]) - ifnot \sdfat.openFile(@strNVRAMFile, "R") - \sdfat.setCharacterPosition(NVRAM_IPADDR) - repeat a from 0 to 15 - ip_addr[a] := \sdfat.readCharacter 'fill addresses - \sdfat.setCharacterPosition(NVRAM_HIVE) - hiveid := \sdfat.readCharacter - hiveid += \sdfat.readCharacter << 8 - hiveid += \sdfat.readCharacter << 16 - hiveid += \sdfat.readCharacter << 24 - \sdfat.closeFile - ifnot dmarker[UMARKER] == TRUE 'U-marker aktivieren - sdfat.setDirCluster(dmarker[UMARKER]) - - nach Venatrix senden: ip_addr[0]..[15], hiveid -} -'######################################################################################## - hivestr := num.ToStr(hiveid, num#DEC) - strpos := strsize(hivestr) - macpos := 5 - repeat while (strpos AND macpos) - strpos-- - if(strpos) - strpos-- - mac_addr[macpos] := num.FromStr(hivestr+strpos, num#HEX) - byte[hivestr+strpos] := 0 - macpos-- - - sock.start(A_NETCS,A_NETSCK,A_NETSI,A_NETSO, -1, @mac_addr, @ip_addr) - lan_started := true - -PRI get_ip|i - bus.bus_putchar(71) 'ip-adresse von Administra empfangen - repeat i from 0 to 15 - ip_addr[i]:=bus.bus_getchar - -PRI lan_stop -''funktionsgruppe : lan -''funktion : Netzwerk anhalten -''eingabe : - -''ausgabe : - -''busprotokoll : [072] - - if lan_started - sock.stop - lan_started := false - -PRI lan_connect | ipaddr, remoteport, handle, handleidx, i -''funktionsgruppe : lan -''funktion : ausgehende TCP-Verbindung öffnen (mit Server verbinden) -''eingabe : - -''ausgabe : - -''busprotokoll : [073][sub_getlong.ipaddr][sub_getword.remoteport][put.handleidx] -'' : ipaddr - ipv4 address packed into a long (ie: 1.2.3.4 => $01_02_03_04) -'' : remoteport - port number to connect to -'' : handleidx - lfd. Nr. der Verbindung (index des kompletten handle) - - ipaddr := bus.bus_getlong - remoteport := bus.bus_getword - - 'freien Pufferabschnitt suchen - i := 0 - repeat sock#sNumSockets - if bufidx[i] == $FF '0xFF: nicht zugewiesen - quit - i++ - - ifnot (handle := sock.connect(ipaddr, remoteport, @bufrx[i*rxlen], rxlen, @buftx[i*txlen], txlen)) == -102 - sock.resetBuffers(handle) - handleidx := handle.byte[0] 'extract the handle index from the lower 8 bits - sockhandle[handleidx] := handle 'komplettes handle zu handle index speichern - bufidx[i] :=handleidx - bus.bus_putchar(handleidx) 'handleidx senden - else - bus.bus_putchar($FF) - -PRI lan_listen | port, handle, handleidx, i -''funktionsgruppe : lan -''funktion : Port für eingehende TCP-Verbindung öffnen -''eingabe : - -''ausgabe : - -''busprotokoll : [074][sub_getword.port][put.handleidx] -'' : port - zu öffnende Portnummer -'' : handleidx - lfd. Nr. der Verbindung (index des kompletten handle) - - port := bus.bus_getword - - 'freien Pufferabschnitt suchen - i := 0 - repeat sock#sNumSockets - if bufidx[i] == $FF '0xFF: nicht zugewiesen - quit - i++ - - ifnot (handle := sock.listen(port, @bufrx[i*rxlen], rxlen, @buftx[i*txlen], txlen)) == -102 - handleidx := handle.byte[0] 'extract the handle index from the lower 8 bits - sockhandle[handleidx] := handle 'komplettes handle zu handle index speichern - bufidx[i] :=handleidx - bus.bus_putchar(handleidx) 'handleidx senden - else - bus.bus_putchar($FF) - -PRI lan_waitconntimeout | handleidx, timeout, t, connected -''funktionsgruppe : lan -''funktion : bestimmte Zeit auf Verbindung warten -''eingabe : - -''ausgabe : - -''busprotokoll : [075][get.handleidx][sub_getword.timeout][put.connected] -'' : handleidx - lfd. Nr. der zu testenden Verbindung -'' : timeout - Timeout in Millisekunden -'' : connected - True, if connected - - handleidx := bus.bus_getchar - timeout := bus.bus_getword - - t := cnt - repeat until (connected := sock.isConnected(sockhandle[handleidx])) or (((cnt - t) / (clkfreq / 1000)) > timeout) - - bus.bus_putchar(connected) - -PRI lan_close | handleidx, i -''funktionsgruppe : lan -''funktion : TCP-Verbindung (ein- oder ausgehend) schließen -''eingabe : - -''ausgabe : - -''busprotokoll : [076][get.handleidx] -'' : handleidx - lfd. Nr. der zu schließenden Verbindung - - handleidx := bus.bus_getchar - - sock.close(sockhandle[handleidx]) - - 'reservierten Pufferabschnitt freigeben - i := 0 - repeat sock#sNumSockets - if bufidx[i++] == handleidx '0xFF: nicht zugewiesen - bufidx[i++] := $FF - quit - - -PRI lan_rxtime | handleidx, timeout, t, rxbyte -''funktionsgruppe : lan -''funktion : angegebene Zeit auf ASCII-Zeichen warten -'' : nicht verwenden, wenn anderes als ASCII (0 - 127) empfangen wird -''eingabe : - -''ausgabe : - -''busprotokoll : [077][get.handleidx][sub_getword.timeout][put.rxbyte] -'' : handleidx - lfd. Nr. der Verbindung -'' : timeout - Timeout in Millisekunden -'' : rxbyte - empfangenes Zeichen (0 - 127) oder -'' : sock#RETBUFFEREMPTY (-1) wenn Timeout oder keine Verbindung mehr - - handleidx := bus.bus_getchar - timeout := bus.bus_getword - - t := cnt - repeat until (rxbyte := sock.readByteNonBlocking(sockhandle[handleidx])) => 0 or (not sock.isConnected(sockhandle[handleidx])) or (cnt - t) / (clkfreq / 1000) > timeout - - bus.bus_putchar(rxbyte) - -PRI lan_rxdata | handleidx, len, rxbyte, error -''funktionsgruppe : lan -''funktion : bei bestehender Verbindung die angegebene Datenmenge empfangen -''eingabe : - -''ausgabe : - -''busprotokoll : [078][get.handleidx][sub_getlong.len][put.byte1][put.byte][put.error] -'' : handleidx - lfd. Nr. der Verbindung -'' : len - Anzahl zu empfangender Bytes -'' : error - ungleich Null bei Fehler - - error := FALSE - handleidx := bus.bus_getchar - len := bus.bus_getlong - - repeat len - ifnot error - repeat while (rxbyte := sock.readByteNonBlocking(sockhandle[handleidx])) < 0 - ifnot sock.isConnected(sockhandle[handleidx]) - error := sock#ERRSOCKETCLOSED - quit - bus.bus_putchar(rxbyte) - - bus.bus_putchar(error) - -PRI lan_txdata | handleidx, len, txbyte, error -''funktionsgruppe : lan -''funktion : bei bestehender Verbindung die angegebene Datenmenge senden -''eingabe : - -''ausgabe : - -''busprotokoll : [079][get.handleidx][sub_getlong.len][get.byte1][get.byte][put.error] -'' : handleidx - lfd. Nr. der Verbindung -'' : len - Anzahl zu sendender Bytes -'' : error - ungleich Null bei Fehler - - error := FALSE - handleidx := bus.bus_getchar - len := bus.bus_getlong - - repeat len - txbyte := bus.bus_getchar - ifnot error - repeat while sock.writeByteNonBlocking(sockhandle[handleidx], txbyte) < 0 - ifnot sock.isConnected(sockhandle[handleidx]) - error := sock#ERRSOCKETCLOSED - quit - - bus.bus_putchar(error) - -PRI lan_rxbyte -''funktionsgruppe : lan -''funktion : wenn vorhanden, ein empfangenes Byte lesen -'' : nicht verwenden, wenn auch $FF empfangen werden kann -''eingabe : - -''ausgabe : - -''busprotokoll : [080][get.handleidx][put.rxbyte] -'' : handleidx - lfd. Nr. der Verbindung -'' : rxbyte - empfangenes Zeichen oder -'' : sock#RETBUFFEREMPTY (-1) wenn kein Zeichen vorhanden - - bus.bus_putchar(sock.readByteNonBlocking(sockhandle[bus.bus_getchar])) - -PRI lan_isconnected -''funktionsgruppe : lan -''funktion : Returns true if the socket is connected, false otherwise -''eingabe : - -''ausgabe : - -''busprotokoll : [081][get.handleidx][put.connected] -'' : handleidx - lfd. Nr. der Verbindung -'' : connected - TRUE wenn verbunden, sonst FALSE - - bus.bus_putchar(sock.isConnected(sockhandle[bus.bus_getchar])) - -DAT - long ' long alignment for addresses - ip_addr byte 10, 1, 1, 1 'ip - ip_subnet byte 255, 255, 255, 0 'subnet-maske - ip_gateway byte 10, 1, 1, 254 'gateway - ip_dns byte 10, 1, 1, 254 'dns - ip_boot long 0 'boot-server (IP address in long) - mac_addr byte $c0, $de, $ba, $be, $00, $00 'mac-adresse -} diff --git a/source/YMODEM-Dll.spin b/source/YMODEM-Dll.spin index 8300046..a63c638 100644 --- a/source/YMODEM-Dll.spin +++ b/source/YMODEM-Dll.spin @@ -537,7 +537,6 @@ pri Empfang_file|key,i,packet,crc,j,k,timer,bytes,done,zaehler,tmp,position ios.sertx(ACK) ios.sdclose print_win(@fertig,10,14) -'waitcnt(cnt+clkfreq) ausstieg PRI UpdateCRC(data,crc):newcrc|i @@ -585,8 +584,6 @@ PRI Mouse_Release repeat while ios.mouse_button(0) 'warten bis Maustaste losgelassen wird pri ausstieg - 'ios.restore_Area(8,7,32,15,BRAM) - 'ios.display2dbox(colors[shellhcol], 1,1, 25,34,0) ios.Mousepointer(hour_glass) cmd_mount activate_dirmarker(systemdir) @@ -665,6 +662,8 @@ PRI printfont(str1,a,b,c,d,e)|f repeat strsize(str1) f:= byte[str1++] + if f >96 + f^=32 f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt if d>39 'wenn Bildschirmrand erreicht, neue Zeile d:=0 diff --git a/source/dos-shell.spin b/source/dos-shell.spin index 3a927ff..d6fe2b8 100644 --- a/source/dos-shell.spin +++ b/source/dos-shell.spin @@ -263,6 +263,8 @@ PRI printfont(str1,a,b,c,d,e)|f repeat strsize(str1) f:= byte[str1++] + if f >96 + f^=32 f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt if d>39 'wenn Bildschirmrand erreicht, neue Zeile d:=0 @@ -325,12 +327,19 @@ con '************************************************** Button-Funktionen ****** PRI buttonpress(n) case n - 1:printfont(string("Start"),250,0,0,0,29) + 1:printfont(string("Start "),250,0,0,0,29) + ios.displaytile(144,colors[shellhcol],250,colors[shellhcol],29,7) + + 'ios.displaytile(164,0,colors[shellhcol],250,29,7) + 4:printfont(@butOK,250,0,0,buttonx[n],buttony[n]) Mouse_Release case n - 1:printfont(string("Start"),colors[hcolstatus],0,colors[statustextcol],0,29) + 1:printfont(string("Start "),colors[hcolstatus],0,colors[statustextcol],0,29) + ios.displaytile(144,colors[shellhcol],colors[hcolstatus],colors[shellhcol],29,7) + + 'ios.displaytile(164,0,colors[shellhcol],colors[hcolstatus],29,7) 4:printfont(@butOK,colors[Buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n]) @@ -531,7 +540,7 @@ PRI time|s 'Zeitanzeige in der Statusleiste pri show_time |s s:=ios.getminutes - Status_extern(ios.dcf_sync,dcf_on,170,27,0,colors[titeltextcol],black) 'Anzeige des aktuellen Status in der Titelzeile + Status_extern(ios.dcf_sync,dcf_on,170,34,29,green,black) 'Anzeige des aktuellen Status in der Titelzeile if s<>tmptime displaytime @@ -540,10 +549,10 @@ PRI displaytime|h,m h:=ios.gethours m:=ios.getminutes - print_zehner(h,29,34,colors[hcolstatus],colors[statustextcol]) - ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,36) + print_zehner(h,29,35,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,37) - print_zehner(m,29,37,colors[hcolstatus],colors[statustextcol]) + print_zehner(m,29,38,colors[hcolstatus],colors[statustextcol]) tmptime:=m date @@ -566,12 +575,12 @@ pri print_zehner(wert,y,x,hin,vor)|a pri Status_extern(wert1,wert2,tnr_act,x,y,col,f3) if wert1==1 - ios.displaytile(tnr_act,colors[Titelhcol],col,f3,y,x) 'Status ok-anzeigen + ios.displaytile(tnr_act,colors[hcolstatus],col,f3,y,x) 'Status ok-anzeigen else - if wert2 'Externe Komponente in Settingmenue ausgewählt? - ios.displaytile(tnr_act,colors[titelhcol],grey,0,y,x) 'Symbol grau + if wert2 'Externe Komponente in Settingmenue ausgewählt? + ios.displaytile(tnr_act,colors[hcolstatus],grey,0,y,x) 'Symbol grau else - ios.displaytile(16,colors[Titelhcol],colors[titeltextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) + ios.displaytile(16,colors[hcolstatus],colors[statustextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) con'****************************************************** Perplex-Funktionen ************************************************************************************************* PRI plx_map|ack,adr,n,i @@ -1090,18 +1099,7 @@ PUB os_testbas(stradr): flag | status,i,len 'sys: test ob kommando a ios.ldbin(@BAS_RT) else 'datei nicht gefunden ios.sdclose -{ -'im system-dir suchen - ios.sddmset(ios#DM_USER) 'u-marker setzen - ios.sddmact(ios#DM_SYSTEM) 's-marker aktivieren - status := ios.sdopen("r",stradr) 'datei vorhanden? - if status == 0 'datei gefunden - flag := TRUE - ios.belload(stradr) 'bellatrix-code laden - 'ios.screeninit(0,1) 'systemmeldung - else 'datei nicht gefunden - ios.sdclose - } + ios.sddmact(ios#DM_USER) 'u-marker aktivieren byte[stradr][len] := 0 'extender wieder abschneiden diff --git a/source/extern.spin b/source/extern.spin new file mode 100644 index 0000000..1db4bf2 --- /dev/null +++ b/source/extern.spin @@ -0,0 +1,582 @@ +{{ +Template für externe Programme unter Plexus-Shell +}} + +obj ios: "reg-ios-64" + +con +'------------- Shell-Farben ----------------------------------------------------- +shellhcol =0 'Hauptfensterfarbe +act_color =1 'Schriftfarbe +winhcol =2 'Fensterhintergrundfarbe +winframecol =3 'Fensterrandfarbe +Titelhcol =4 'Titelleistenfarbe +titeltextcol =5 'Titelleistentextfarbe +hcolstatus =6 'statusleiste hintergrundfarbe +statustextcol =7 'Statustextfarbe +buttonhcol =8 'Buttonhintergrundfarbe +buttontextcol =9 'Buttontextfarbe +messagehcol =10 'Messagebox-Hintergrundfarbe +messagetextcol =11 'Messagebox-Textfarbe +selectcol =12 'selektionsfarbe +mousecol =13 'Mauszeigerfarbe +panelcol =14 'Farbe des Utility-Panels + +ADM_SPEC = %00000000_00000000_00000000_01010011 +SETTING_RAM = $7FF00 'Hier stehen die System-Settings + +'******************Farben ******************************************************** + #$FC, Light_Grey, #$A8, Grey, #$54, Dark_Grey + #$C0, Light_Red, #$80, Red, #$40, Dark_Red + #$30, Light_Green, #$20, Green, #$10, Dark_Green + #$1F, Light_Blue, #$09, Blue, #$04, Dark_Blue + #$F0, Light_Orange, #$E6, Orange, #$92, Dark_Orange + #$CC, Light_Purple, #$88, Purple, #$44, Dark_Purple + #$3C, Light_Teal, #$28, Teal, #$14, Dark_Teal + #$FF, White, #$00, Black +'----Icon-Nummern---------------------------------------------------------------- +BEL_PIC =14 +ADM_PIC =15 +BIN_PIC =9 +BAS_PIC =107 +DIR_PIC =7 +ALL_PIC =8 +DMP_PIC =120 +TXT_PIC =121 +SYS_PIC =122 +COG_PIC =75 +BACK_PIC =124 +VOR_PIC =123 +PLAY_PIC =125 +STOP_PIC =141 +CLR_PIC =155 +'-------------------------------------------------------------------------------- + +var + +byte mountmarker,tmptime +long rootdir 'root-Dirmarker +long userdir 'user-Dirmarker +byte colors[15] 'Farbwerte +byte ma,mb,mz 'Maus-Tasten und Scrollrad + + byte buttonx[8] 'Knöpfe + byte buttony[8] + byte windownum[8] 'Arbeits-Windows + byte windowx[8] + byte windowy[8] + byte windowxx[8] + byte windowyy[8] + byte messagex 'x-Position der Messagebox + byte tag,monat,stunde,minute sekunde 'Datum -und Zeit + word jahr + byte menuemarker 'Marker für Startmenue + byte menuey[10] 'y-Koordinate für Start-Menue-Einträge + byte popupx 'x und + byte popupy 'y-Koordinaten des Popupmenues + byte popupmarker 'Marker für Popupmenue + byte menue_nr 'nr des gerade angezeigten Menues + byte infomarker +dat +' ini byte "reg.ini",0 'Ini-Datei für Farbwerte + regsys byte "plexus.dll",0 'Reg.sys für Rückkehr aus externem Programm + butOK byte " OK ",0 + Abbr byte "Cancel",0 + +PUB main + + ios.start + ios.sdmount 'sd-card mounten + mountmarker:=1 'mount-marker + if ios.admgetspec<>ADM_SPEC 'ADM-Spezifikation SID? + ios.admreset'ios.admload(@adm) 'Administracode wird im EEPROM erwartet + if ios.bel_get<>64 'BEL-Treiber 64 farben Tile ? + ios.belreset 'Bellatrixcode wird im EEPROM erwartet + '-------------------------------------------------------------------------------------- + rootdir:=get_dirmarker 'Dir-Marker für root Verzeichnis lesen + userdir:=rootdir 'User-Dir-Marker erst mal mit root vorbelegen + ios.sdunmount + '-------------------------------------------------------------------------------------- + ios.sdmount + iniload 'Ini-Datei mit Farbwerten laden + buttonweg + testfenster + repeat + + os_cmdinput 'Hauptprogrammschleife + +PRI os_cmdinput | x,y ,i,dk,util + + repeat + time 'Zeit und Datum anzeigen + + ma:=ios.mouse_button(0) 'linke Maustaste + mb:=ios.mouse_button(1) 'rechte Maustaste + mz:=ios.mousez 'scrollrad + + +'***************************** linke Maustaste ********************************************************************** + if ma==255 + dk:=0 + x:=ios.mousex + y:=ios.mousey + + repeat i from 1 to 7 'Abfrage auf Fensterloeschen + if windownum[i]==1 + if (x==windowxx[i]) and (y==windowy[i]) + windowloesch(i) + ios.sdopen("r",@regsys) + ios.ldbin(@regsys) + + + if (x==windowx[i]) and (y==windowy[i]) + dk:=doppelklick + if dk>1 + windowloesch(i) + ios.sdopen("r",@regsys) + ios.ldbin(@regsys) + + +'****************************** Startmenue anzeigen ************************************************************ + if menuemarker==1 + if x>10 or y<14 'Menue loeschen, wenn man woanders hinklickt + menueweg + testfenster + if x=>0 and x=<10 and y=>14 and y=<28 + repeat i from 0 to 5 + if menuey[i]==y + util:=0 'eventuelle Utilitie-Fenster deaktivieren + case i + 0:menueselect(string(" -EXIT- "),menuey[i]) + windowloesch(7) + ios.sdopen("r",@regsys) + ios.ldbin(@regsys) + 'windowloesch(7) + +'****************************** IO-Port-Fenster **************************************************************** + if y==4 + if x==3 or x==20 + toogle_board(x) +'****************************** Globale Funktionstasten ******************************************************** + + if (x==39) and (y==0) 'Beenden-Knopf + + ios.sdopen("r",@regsys) + ios.ldbin(@regsys) + + if (x==0) and (y==0) 'Beenden bei Doppelklick auf linke obere Ecke + dk:=doppelklick + if dk>1 + ios.sdopen("r",@regsys) + ios.ldbin(@regsys) + + if ((x=>0) and (x=<5)) and (y==29) 'Start-Knopf + buttonpress(3) + if menuemarker==1 + 'fensterweg + Menueweg + testfenster + + else + fensterweg + startmenue + menuemarker:=1 + + '****************************** Globale Abfrage OK und Cancel-Button ***************************** + if(x=>buttonx[1]) and (x=buttonx[2]) and (x=<(buttonx[2]+6)) and (y==buttony[2]) 'cancel + buttonpress(2) + fensterweg + testfenster + +pri toogle_board(tg) + case tg + 3:ios.displaytile(138,colors[winhcol],colors[winhcol],255,4,3) + ios.displaytile(Cog_pic,colors[winhcol],colors[winhcol],255,4,20) + 20:ios.displaytile(Cog_pic,colors[winhcol],colors[winhcol],255,4,3) + ios.displaytile(138,colors[winhcol],colors[winhcol],255,4,20) + +pri testfenster|i + 'dira[24]~ + 'i:=ina[24] + window(7,4,1,27,38,string("I/O-Card-Test")) + rahmen (1,6,37,25) + rahmen (1,3,37,5) + rahmen (3,8,18,18) + 'ios.displaytile(COG_PIC,winhcol,red,0,8+i+i,19+cogs-1) + ios.displaytile(138,colors[winhcol],colors[winhcol],255,4,3) + printfont(string("Sepia-Card"),colors[winhcol],0,colors[act_color],4,4) + 'printdec(i,20,20,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(Cog_pic,colors[winhcol],colors[winhcol],255,4,20) + printfont(string("Venatrix-Card"),colors[winhcol],0,colors[act_color],21,4) + 'y,x + ios.displaytile(COG_PIC,colors[winhcol],green,0,10,6) + ios.displaytile(COG_PIC,colors[winhcol],green,0,11,5) + ios.displaytile(COG_PIC,colors[winhcol],green,0,11,7) + ios.displaytile(COG_PIC,colors[winhcol],green,0,12,6) + + ios.displaytile(COG_PIC,colors[winhcol],green,0,14,6) + + printfont(string("Port 1"),colors[winhcol],0,colors[act_color],4,16) + + ios.displaytile(COG_PIC,colors[winhcol],green,0,10,14) + ios.displaytile(COG_PIC,colors[winhcol],green,0,11,13) + ios.displaytile(COG_PIC,colors[winhcol],green,0,11,15) + ios.displaytile(COG_PIC,colors[winhcol],green,0,12,14) + + ios.displaytile(COG_PIC,colors[winhcol],green,0,14,14) + + printfont(string("Port 2"),colors[winhcol],0,colors[act_color],12,16) + + printfont(string("Joystick-Test"),colors[winhcol],0,colors[act_color],4,8) + + 'printfont(string("eingebettetes Programm"),colors[winhcol],0,colors[act_color],3,5) + +con'****************************************************** Datum und Zeitanzeige ************************************************************************************************* + +PRI time|s 'Zeitanzeige in der Statusleiste + + s:=ios.getminutes + if s<>tmptime + displaytime + +PRI displaytime|h,m,x,y + + h:=ios.gethours + m:=ios.getminutes + if h<10 + printdec(0,29,34,colors[hcolstatus],colors[statustextcol]) + y:=1 + else + y:=0 + printdec(h,29,34+y,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,36) + if m<10 + printdec(0,29,37,colors[hcolstatus],colors[statustextcol]) + x:=1 + else + x:=0 + printdec(m,29,37+x,colors[hcolstatus],colors[statustextcol]) + tmptime:=m + date + +PRI date|t,m,j,y,x + t:=ios.getdate + m:=ios.getmonth + j:=ios.getyear + + if t<10 + printdec(0,0,29,colors[titelhcol],colors[titeltextcol]) + y:=1 + else + y:=0 + printdec(t,0,29+y,colors[titelhcol],colors[titeltextcol]) + ios.displaytile(30,colors[titelhcol],0,colors[titeltextcol],0,31) + if m<10 + printdec(0,0,32,colors[titelhcol],colors[titeltextcol]) + x:=1 + else + x:=0 + printdec(m,0,32+x,colors[titelhcol],colors[titeltextcol]) + ios.displaytile(30,colors[titelhcol],0,colors[titeltextcol],0,34) + printdec(j,0,35,colors[titelhcol],colors[titeltextcol]) + + +con '*********************************************** Fenster-Lösch-Funktionen **************************************************************************************************** +PRI windowloesch(num) 'einzelnes Fenster löschen + ios.display2dbox(colors[shellhcol], windowy[num], windowx[num], windowyy[num], windowxx[num]) 'Fenster loeschen + 'regal(colors[shellhcol],colors[panelcol],0,26,11) + if menuemarker==1 + menueweg + win_paraloesch(num) + + 'muelleimer:=0 + 'util:=0 + +PRI win_paraloesch(num) 'Fensterparameter löschen + + windownum[num]:=windowx[num]:=windowy[num]:=windowxx[num]:=windowyy[num]:=-1 'Windowwerte loeschen + + +PRI fensterweg|i 'alle gesetzten Fenster loeschen + repeat i from 1 to 7 + if windownum[i]==1 + windowloesch(i) + + repeat i from 0 to 7 + buttonx[i]:=-1 + buttony[i]:=-1 +con' +PRI doppelklick:click 'pseudo-doppelklick + click:=0 + repeat while ios.mouse_button(0)>0 + + repeat 500 + if ios.mouse_button(0)==255 + click++ +con' +PRI iniload|i,a + a:=SETTING_RAM + repeat i from 0 to 14 + colors[i]:=ios.ram_rdbyte(0,a++) +' repeat i from 0 to 4 +' sys_set[i]:=ios.ram_rdbyte(0,a++) + +PRI activate_dirmarker(mark) 'USER-Marker setzen + + ios.sddmput(ios#DM_USER,mark) 'usermarker wieder in administra setzen + ios.sddmact(ios#DM_USER) 'u-marker aktivieren + +PRI get_dirmarker:dm 'USER-Marker lesen + + ios.sddmset(ios#DM_USER) + dm:=ios.sddmget(ios#DM_USER) +PRI cmd_mount :err 'cmd: mount + + repeat 16 + err:=ios.sdmount + ifnot err + mountmarker:=1 + quit + else + ' display_error(err) + quit + +PRI cmd_unmount|err 'cmd: unmount + err:=ios.sdunmount + ifnot err + mountmarker:=0 + else + 'display_error(err) +PRI window(num,y,x,yy,xx,strg)|i 'ein Fenster erstellen + windowx[num]:=x-1 + windowy[num]:=y-2 + windowxx[num]:=xx+1 + windowyy[num]:=yy+1 + + ios.displaytile(0,colors[winhcol],0,colors[winframecol],y-2,x-1) + repeat i from x to xx + ios.displaytile(16,colors[Titelhcol],$ff,$ff,y-2,i) + ios.displaytile(1,colors[winhcol],0,colors[winframecol],y-2,xx+1) + repeat i from y-1 to yy + ios.displaytile(2,colors[winhcol],0,colors[winframecol],i,x-1) + ios.displaytile(77,colors[winhcol],0,colors[winframecol],i,xx+1) + repeat i from x-1 to xx + ios.displaytile(6,colors[winhcol],0,colors[winframecol],yy+1,i) + + ios.displaytile(4,colors[winhcol],0,colors[winframecol],yy+1,x-1) + ios.displaytile(5,colors[winhcol],0,colors[winframecol],y-1,xx+1) + ios.displaytile(3,colors[winhcol],0,colors[winframecol],yy+1,xx+1) + + ios.printBoxSize(num,y-1, x, yy, xx) + ios.printBoxColor(num,colors[act_color],colors[winhcol],0) + ios.printcursorrate(0) + ios.printchar(12) 'cls + windownum[num]:=1 + printfont(strg,colors[titelhcol],0,colors[titeltextcol],x+1,y-2) + + +PRI printfont(str1,a,b,c,d,e)|f + + repeat strsize(str1) + f:= byte[str1++] + f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt + if d>39 'wenn Bildschirmrand erreicht, neue Zeile + d:=0 + e++ + ios.displayTile(f,a,b,c,e,d) 'einzelnes Tile anzeigen ('displayTile(tnr,pcol,scol,tcol, row, column)) + + d++ +PRI printdec(value,y,xx,hint,vor) | i ,c ,x 'screen: dezimalen zahlenwert auf bildschirm ausgeben +{{printdec(value) - screen: dezimale bildschirmausgabe zahlenwertes}} + ' if value < 0 'negativer zahlenwert + ' -value + 'printchar("-") + + i := 1_000_000_000 + repeat 10 'zahl zerlegen + if value => i + x:=value / i + "0" + ios.displayTile(x-16,hint,0,vor,y,xx) 'printchar(x) + xx++ + c:=value / i + "0" + value //= i + result~~ + elseif result or i == 1 + printfont(string("0"),hint,0,vor,xx,y) 'printchar("0") + xx++ + i /= 10 'nächste stelle +con '************************************************** Button-Funktionen ******************************************************************************************************** + +PRI button(n,btext,x,y) + printfont(btext,colors[buttonhcol],0,colors[buttontextcol],x,y) + buttonx[n]:=x + buttony[n]:=y + + +PRI buttonpress(n)|s + s:=0 + case n + 1: printfont(@butOK,250,0,0,buttonx[n],buttony[n]) + 2: printfont(@Abbr,250,0,0,buttonx[n],buttony[n]) + 3: printfont(string("START"),250,0,0,0,29) + s:=1 + 4: printfont(@butOK,250,0,0,buttonx[n],buttony[n]) +{ + 5,6,7,8:ios.displaytile(144,colors[winhcol],250,0,taby[n-4],tabx[n-4]) + printfont(@buttontext[n*6],250,0,0,buttonx[n],buttony[n]) + ios.displaytile(145,colors[winhcol],250,0,taby[n-4],tabl[n-4]) + s:=2 +} + repeat while ios.mouse_button(0)>0 + case s + 1:printfont(string("START"),colors[hcolstatus],0,colors[statustextcol],0,29) + ' 2:ios.displaytile(144,colors[winhcol],colors[buttonhcol],0,taby[n-4],tabx[n-4]) 'tab wiederherstellen + ' printfont(@buttontext[n*6],colors[buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n]) + ' ios.displaytile(145,colors[winhcol],colors[buttonhcol],0,taby[n-4],tabl[n-4]) + +PRI abfrage:taste|a,x,y + repeat + a:=ios.mouse_button(0) + if a==255 + x:=ios.mousex + y:=ios.mousey + + if(x=>buttonx[1]) and (x=buttonx[2]) and (x=<(buttonx[2]+6)) and (y==buttony[2]) 'cancel + buttonpress(2) + taste:=2 + quit + fensterweg + ios.display2dbox(colors[shellhcol], 10, 7, 17, messagex) +con '*************************************************** Start-Menue ************************************************************************************************************* +PRI Menue(x,y,xx,yy)|i + popup(x,y,xx,yy) + repeat i from x to xx + ios.displaytile(16,colors[Titelhcol],$ff,$ff,y-1,i) + +PRI menueweg + ios.display2dbox(colors[shellhcol],14,0,28,9) + menuemarker:=0 + +PRI separator(x,y,xx)|i + repeat i from x to xx + ios.displaytile(6,colors[Messagehcol],0,colors[winframecol],y,i) + +PRI menueselect(stri,y) + printfont(stri,colors[messagetextcol],0,colors[messagehcol],0,y) + repeat while ios.mouse_button(0)>0 + printfont(stri,colors[messagehcol],0,colors[messagetextcol],0,y) + menueweg + +PRI Startmenue + menue(0,26,9,28) + menuemarker:=1 + printfont(string("Startmenue"),colors[titelhcol],0,colors[titeltextcol],0,25) + separator(0,26,9) +' printfont(string("Files"),messagehcol,0,messagetextcol,0,16) +' menuey[0]:=16 +' separator(0,17,9) +' printfont(string("Baud"),messagehcol,0,messagetextcol,0,18) +' menuey[1]:=18 +' separator(0,19,9) +' printfont(string("Settings"),messagehcol,0,messagetextcol,0,20) +' menuey[2]:=20 +' separator(0,21,9) +' printfont(string("Programs"),messagehcol,0,messagetextcol,0,22) +' menuey[3]:=22 +' separator(0,23,9) +' printfont(string("About"),messagehcol,0,messagetextcol,0,24) +' menuey[4]:=24 +' separator(0,25,9) + printfont(string(" -EXIT- "),colors[messagehcol],0,colors[messagetextcol],0,27) + menuey[0]:=27 +con '*************************************************** Popup-Menue ************************************************************************************************************* + +PRI popup(x,y,xx,yy) + ios.display2dbox(colors[messagehcol],y,x,yy,xx) + popupx:=x + popupy:=y + +PRI popup_entry(num,strg,sep) + if sep==1 + separator(popupx,popupy+num,popupx+6) + num+=1 + printfont(strg,colors[messagehcol],0,colors[messagetextcol],popupx,popupy+num) + printfont(strg,colors[messagehcol],0,colors[messagetextcol],popupx,popupy+num) + 'popentry[num]:=num + +PRI Popup_Info_weg + if infomarker==1 'Infofenster sichtbar? + ios.restore(windowx[2],windowy[2],windowxx[2],windowyy[2]) 'Hintergrund wiederherstellen + 'win_paraloesch(2) 'Info-Fenster-Parameter loeschen + infomarker:=0 'Marker loeschen + if popupmarker==1 'Popupmenue sichtbar? + ios.restore(popupx,popupy,popupx+6,popupy+7) 'Hintergrund wiederherstellen + popupmarker:=0 'Popupmarker loeschen + +PRI popupselect(stri,x,y) + printfont(stri,colors[messagetextcol],0,colors[messagehcol],x,y) + repeat while ios.mouse_button(0)>0 + printfont(stri,colors[messagehcol],0,colors[messagetextcol],x,y) + 'popupmarker:=0 +pri Buttonweg|i + repeat i from 0 to 7 + buttonx[i]:=-1 + buttony[i]:=-1 +PRI rahmen(x,y,xx,yy)|i + win_tile(137,y,x) + win_tile(136,yy,x) + win_tile(157,y,xx) + win_tile(119,yy,xx) + repeat i from y+1 to yy-1 + win_tile(2,i,x) + win_tile(114,i,xx) + line(x+1,y,xx-1) + line(x+1,yy,xx-1) + +PRI line(x,y,xx)|i + repeat i from x to xx + win_tile(130,y,i) + +con '---------------------------------------------- Ausgaberoutinen --------------------------------------------------------------------------------------------------------------- +PRI Win_Tile(nu,ty,tx) + ios.displaytile(nu,colors[winhcol],0,colors[act_color],ty,tx) + +PRI FRAME_TILE(nu,ty,tx) + ios.displaytile(nu,colors[winhcol],0,colors[winframecol],ty,tx) + +PRI TITEL_TILE(nu,ty,tx) + ios.displaytile(nu,colors[titelhcol],0,colors[titeltextcol],ty,tx) + +PRI print_win(stradr,x,y) + printfont(stradr,colors[winhcol],0,colors[act_color],x,y) + +PRI print_titel(stradr,x,y) + printfont(stradr,colors[titelhcol],0,colors[titeltextcol],x,y) + +PRI Print_button(stradr,x,y) + printfont(stradr,colors[buttonhcol],0,colors[buttontextcol],x,y) + +PRI print_status(stradr,x,y) + printfont(stradr,colors[hcolstatus],0,colors[statustextcol],x,y) + +PRI print_message(stradr,x,y) + printfont(stradr,colors[messagehcol],0,colors[messagetextcol],x,y) + +PRI printdec_win(n,y,x) + printdec(n,y,x,colors[winhcol],colors[act_color]) + +PRI printdec_titel(n,y,x) + printdec(n,y,x,colors[titelhcol],colors[titeltextcol]) + diff --git a/source/font-draw.spin b/source/font-draw.spin new file mode 100644 index 0000000..00a809e --- /dev/null +++ b/source/font-draw.spin @@ -0,0 +1,1081 @@ +{{ +┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Autor: Reinhard Zielinski │ +│ Copyright (c) 2013 Reinhard Zielinski │ +│ See end of file for terms of use. │ +│ Die Nutzungsbedingungen befinden sich am Ende der Datei │ +└──────────────────────────────────────────────────────────────────────────────────────────────────────┘ + +Informationen : hive-project.de +Kontakt : zille09@gmail.com +System : Plexus +Name : Font-Editor +Chip : Regnatix +Typ : Plexus-Erweiterungsdatei +Version : 01 +Subversion : 01 + + +Logbuch : +'############################################### Version 1.0 ###################################################################################################################### + +01-07-2014 -Fontbearbeitung abgeschlossen,fehlt nur noch das Speichern des gesamten Font-Satzes + -6170 Longs frei + +02-07-2014 -Fonteditor soweit fertig, die Pixelroutine funktioniert noch nicht hundertprozentig, es werden manchmal falsche Pixel übernommen + -muss ich nochmal drüberschauen + -6032 Longs frei + +03-07-2014 -Pixelroutine scheint jetzt halbwegs zu funktionieren, mal sehen, wie es sich über die Zeit darstellt + -Sanduhr beim Speichern des Font-Satzes eingebaut + -6014 Longs frei + +04-07-2014 -mit verschiedenen Bit-Operationen herumexperimentiert + -Funktionen:Links schieben, rechts schieben, invertieren, horizontal spiegeln + -schön wäre noch eine Rotationsfunktion + -5984 Longs frei + +05-07-2014 -Button-Abfrage etwas eingedampft + -Button OK und Abbruch müssen separat gelöscht werden, da sie auch nach dem Verschwinden anklickbar waren ->erledigt + -Tastatur-Befehle realisiert + -Fehler in der Buttondarstellung behoben, obwohl es nicht nachvollziehbar war, warum falscher Text im Button angezeigt wurde ->Compilierfehler? + -Bit-Korrektur bei Mirror und Revers-Funktion (Grau wurde von 2 zu 1 ->diese musste wieder zur 2 werden, sonst wird das Icon falsch dargestellt) + -Editor soweit fertig (Rotation fehlt noch, ob ich das hinbekomme weis ich noch nicht) + -nun muss noch der Code optimiert werden + -5748 Longs frei + +'############################################### Version 1.1 ###################################################################################################################### + +06-07-2014 -Rotationsfunktion eingefügt, funktioniert ! + -Buttonverarbeitung etwas umgebaut und dadurch Platz gespart + -Fehler in der Rotate-Routine behoben, wurde ein gezeichnetes Tile rotiert entstanden Darstellungsfehler + -kleinere Korrekturen in der Tastaturabfrage+Mouse + -So, jetzt sollte der Editor endlich fehlerfrei sein (hoffentlich) + -5765 Longs frei + +13-07-2014 -Fehler in der Save-Routine, genauer gesagt, speichert man den Fontsatz(bei existierender Datei), funktioniert die Rückkehr zu Plexus nicht mehr ??? + -hab noch keine Ahnung was das nun wieder ist :-( + -5782 Longs frei + +18-07-2014 -Fehler in der Save-Routine behoben (Variable @font war zu klein dimensioniert) + -Abfrage in der Save-Routine eingedampft + -so, ich hoffe das war's endlich + -5788 Longs frei +}} + +obj + ios: "reg-ios-64" + +con +_CLKMODE = XTAL1 + PLL16X +_XINFREQ = 5_000_000 + +'------------- Shell-Farben ----------------------------------------------------- +shellhcol =0 'Hauptfensterfarbe +act_color =1 'Schriftfarbe +winhcol =2 'Fensterhintergrundfarbe +winframecol =3 'Fensterrandfarbe +Titelhcol =4 'Titelleistenfarbe +titeltextcol =5 'Titelleistentextfarbe +hcolstatus =6 'statusleiste hintergrundfarbe +statustextcol =7 'Statustextfarbe +buttonhcol =8 'Buttonhintergrundfarbe +buttontextcol =9 'Buttontextfarbe +messagehcol =10 'Messagebox-Hintergrundfarbe +messagetextcol =11 'Messagebox-Textfarbe +selectcol =12 'selektionsfarbe +mousecol =13 'Mauszeigerfarbe +panelcol =14 'Farbe des Utility-Panels + +ADM_SPEC = %00000000_00000000_00000000_01010011 +'-------- Speicher für diverse Texte ------------ +TXT_RAM = $20000 +SETTING_RAM = $7FF00 'Hier stehen die System-Settings +BRAM = $50000 'Overlay-Puffer +'-------- Speicher für Systemfont --------------- +SYS_FONT = $66800 '....$693FF ' ab hier liegt der System-Font 11kb +Hour_Glass = $66800+(167*16*4) 'Sanduhr +MOUSE_RAM = $69400 '....$6943F ' User-Mouse-Pointer 64byte + +'******************Farben ******************************************************** + #$FC, Light_Grey, #$A8, Grey, #$54, Dark_Grey + #$C0, Light_Red, #$80, Red, #$40, Dark_Red + #$30, Light_Green, #$20, Green, #$10, Dark_Green + #$1F, Light_Blue, #$09, Blue, #$04, Dark_Blue + #$F0, Light_Orange, #$E6, Orange, #$92, Dark_Orange + #$CC, Light_Purple, #$88, Purple, #$44, Dark_Purple + #$3C, Light_Teal, #$28, Teal, #$14, Dark_Teal + #$FF, White, #$00, Black +'----Icon-Nummern---------------------------------------------------------------- +BEL_PIC =14 +ADM_PIC =15 +BIN_PIC =9 +BAS_PIC =107 +DIR_PIC =7 +ALL_PIC =8 +DMP_PIC =120 +TXT_PIC =121 +SYS_PIC =122 +COG_PIC =75 +BACK_PIC =124 +VOR_PIC =123 +PLAY_PIC =125 +STOP_PIC =141 +CLR_PIC =155 +EXT_PIC =156 + +'------------- F-Tasten für Zusatzfunktionen ------------------------------------- +F1_Key = 208 +F2_Key = 209 +F3_Key = 210 +F4_Key = 211 +F5_Key = 212 +F6_Key = 213 +F7_Key = 214 +F8_Key = 215 +F9_Key = 216 +F10_Key = 217 +F11_Key = 218 +F12_Key = 219 +ESC_KEY = 27 +RETURN_KEY = 13 +LEFT_KEY = 3 +RIGHT_KEY = 2 +'-------------------------------------------------------------------------------- + +var + + long systemdir 'Plexus-System-Verzeichnis + long fontdir 'Fonts-Verzeichnis + long einzel_tile[16] 'das zu zeichnende Tile + long tmp[16],temp[16] 'das zu zeichnende Tile + Byte Pix[256] 'Pixelmap für Manipulation + + byte tmptime + byte colors[15] 'Farbwerte + byte ma,mb 'Maus-Tasten + + byte windowx[3] + byte windowy[3] + byte windowxx[3] + byte windowyy[3] + byte menuey[3] 'y-Koordinate für Start-Menue-Einträge + byte popupx,popupxx 'x und + byte popupy,popupyy 'y-Koordinaten des Popupmenues + byte popupmarker 'Marker für Popupmenue + byte infomarker + byte buttonx[11],buttony[11],buttonl[11] + byte util + byte timezaehler + '----------- DCF-Indikator ------------------------------------ + byte dcf_on + + byte tile_nr_old + byte tilex_old + byte tiley_old + byte paintfarbe 'Malfarbe + byte Set_Marker 'Marker, um Tile zu setzen + byte textline[12] 'Texteingabestring + byte font[25] 'Hilfsstring + +DAT + regsys byte "PLEXUS.DLL",0 'Reg.sys für Rückkehr aus externem Programm + +DAT + Butt0 byte "Clear",0 + Butt1 byte "Start ",0 + Butt2 byte "Cancel",0 + Butt3 byte " Set ",0 + Butt4 byte " OK ",0 + Butt5 byte " Save ",0 + Butt6 byte "Right ",0 + Butt7 byte " Left ",0 + Butt8 byte " Flip ",0 'Mirror + Butt9 byte "Invert",0 'Invert + Butt10 byte "Rotate",0 + + buttons word @Butt0,@Butt1,@Butt2,@Butt3,@Butt4,@Butt5 + word @Butt6,@Butt7,@Butt8,@Butt9,@Butt10 + + fnt_name byte ".FNT",0 + new_name byte "NEW.FNT",0 + fonts byte "FONTS",0 'Font-Verzeichnis + + + +PUB main + + ios.start +' ios.sdmount 'sd-card mounten + '-------------------------------------------------------------------------------------- +' activate_dirmarker(0) 'ins root +' ios.sdchdir(@system) 'System-Verzeichnis lesen + systemdir:=get_dirmarker 'Dir-Marker lesen + ios.sdchdir(@fonts) 'ins Font-Verzeichnis wechseln + fontdir:=get_dirmarker 'Dir-Marker lesen + activate_dirmarker(systemdir) + '-------------------------------------------------------------------------------------- + ios.sdunmount + iniload 'Ini-Datei mit Farbwerten laden + ios.mousepointer(MOUSE_RAM) + testfenster + util:=0 + Set_Marker:=0 + tile_nr_old:=0 + tilex_old:=21 + tiley_old:=11 + paintfarbe:=black + ios.DisplayMouse(1,paintfarbe) + bytemove(@textline[0],@new_name,strsize(@new_name)) + buttonx[1]:=0 + buttony[1]:=29 + buttonl[1]:=7 + + repeat + + os_cmdinput 'Hauptprogrammschleife + +PRI os_cmdinput | x,y ,i,b,dk,key,tile_nr + + repeat + time 'Zeit und Datum anzeigen + + ma:=ios.mouse_button(0) 'linke Maustaste + mb:=ios.mouse_button(1) 'rechte Maustaste + key:=ios.key + if key + Key_Command(key) + +'***************************** linke Maustaste ********************************************************************** + if ma==255 + dk:=0 + x:=ios.mousex + y:=ios.mousey +'****************************** Tile aus Fontdatei vergrößert darstellen *************************************** + if infomarker==0 and popupmarker==0 + if x=>21 and x=<36 and y=>11 and y=<21 + + Tile_nr:=(x-21)+((y-11)*16) + if Set_marker 'gezeichnetes Tile in Fontsatz übernehmen + Set_Tile(Tile_nr) + ios.loadtilebuffer(SYS_FONT,2816) + clear_set + else + print_win(string(" "),7,7) 'Tile-Nr-Feld löschen + printdec(tile_nr,7,7,colors[act_color],colors[winhcol])'printdec_win(tile_nr,1,1) 'Anzeige gewähltes Tile (nr) + ios.displaytile(tile_nr_old,colors[winhcol],colors[panelcol],0,tiley_old,tilex_old) 'altes gewähltes tile normal darstellen + ios.displaytile(tile_nr,colors[panelcol],colors[winhcol],0,y,x) 'neues gewähltes Tile revers darstellen + Draw_tile(tile_nr) 'gewähltes Tile vergrößert darstellen + tile_nr_old:=tile_nr + tilex_old:=x + tiley_old:=y + + +'****************************** im linken Fenster Zeichnen mit der aktuellen Farbe ***************************** + elseif x=>3 and x=<18 and y=>9 and y=<24 + Paint_Pixel(x,y) + if set_marker + clear_set + +'****************************** Auswahl Zeichenfarbe *********************************************************** + if y==5 + case x + 9,10:Key_Command("W") + 12,13:Key_Command("G") + 15,16:Key_Command("B") + +'****************************** Startmenue anzeigen ************************************************************ + if popupmarker==1 + if x>10 or y<24 'Menue loeschen, wenn man woanders hinklickt + popup_info_weg + util:=0 + if x=>0 and x=<10 and y=>25 and y=<28 + repeat i from 0 to 1 + if menuey[i]==y + + case i + 0:menueselect(string("Save - F2"),menuey[i]) + Save_fenster + + 1:menueselect(string("-EXIT- F12"),menuey[i]) + ausstieg + + + +'****************************** Globale Funktionstasten ******************************************************** + + + + if y==windowy[2] and x==windowx[2] and Infomarker==1 'doppelklick in linke obere ecke des Info-Fensters + if doppelklick>1 + popup_info_weg + util:=0 + + elseif y==windowy[2] and x==windowxx[2] and Infomarker==1 + ios.get_window + popup_info_weg + util:=0 + + elseif y==0 + if (x==39) 'Beenden-Knopf + ios.displaytile(1,250,0,0,0,39) 'Schliessen-Symbol + Mouse_Release 'warten bis Maustaste losgelassen wird + ios.displaytile(1,colors[winhcol],0,colors[winframecol],0,39) 'Schliessen-Symbol + ausstieg + + if (x==0) 'Beenden bei Doppelklick auf linke obere Ecke + if doppelklick>1 + ausstieg + if x>1 and x<20 'Doppelklick in die Titelleiste + if doppelklick>1 + Key_Command(F1_Key) + + + else + repeat b from 0 to 10 + if (x=>buttonx[b]) and (x=<=32 'Icon horizontal spiegeln + mirror_tile + actuali_tile(1) + "I","i":repeat i from 0 to 15 + !einzel_tile[i] 'Icon invers darstellen + mirror_tile + actuali_tile(1) + + "R","r":actuali_tile(0) + Rotate_Icon + actuali_tile(1) + + "C","c":ios.display2dbox(white,9,3,24,18,0) 'CLEAR + longfill(@einzel_tile,0,16) + bytefill(@pix,0,256) + + left_key:repeat i from 0 to 15 + einzel_tile[i]->=2 'Icon nach links schieben + actuali_tile(1) + right_key:repeat i from 0 to 15 + einzel_tile[i]<-=2 'Icon nach rechts schieben + actuali_tile(1) + +pri Rotate_Icon|i,b,n + b:=0 + i:=0 + n:=0 + 'Rotationroutine + repeat 16 'Zeilen + repeat 16 'Spalten + tmp[b]+=pix[(i*16)+b]<<((16-i)*2) 'alle 256 Pixel umsortieren + b++ + + + b:=0 + i++ + i:=0 + 'rotiertes und zusammengesetztes Tile übernehmen + repeat 16 + einzel_tile[i]:=tmp[i]->2 'Tile um eine Position nach links schieben (?) + i++ +pri mirror_tile|i,re,f,b,n 'beim Spiegeln wird aus einer 2 eine 1, dies muss korrigiert werden + temp:=0 + tmp:=0 + + i:=0 + f:=0 + b:=0 + n:=0 + repeat 16 + temp[b]:=einzel_tile[b] + repeat i from 0 to 15 + tmp[i]:=temp[b] & %%3 + if tmp[i]==1 + tmp[i]:=2 + temp[b]>>=2 + + temp[b]:=0 + repeat i from 0 to 15 + temp[b]+=tmp[i]<<(i*2) + einzel_tile[b]:=temp[b] + b++ + +pri actuali_tile(mode)|i,x,y,pixel,farbe,n + + tmp:=0 + x:=3 + y:=9 + i:=0 + n:=0 + repeat 16 + tmp[i]:=einzel_tile[i] + repeat 16 + pixel:=tmp[i]&3 + pix[n++]:=pixel 'Pixel merken für Rotationsfunktion + tmp[i]>>=2 + if mode + farbe:=lookupz(pixel:white,grey,grey,black) + ios.displaytile(16,farbe,0,0,y,x++) 'Pixel am Bildschirm setzen + x:=3 + y++ + i++ + +pri draw_tile(n)|adr,i 'ausgewähltes Tile vergrößert darstellen + + adr:=$66800+(n*64) + i:=0 + repeat 16 + einzel_tile[i++]:=ios.ram_rdlong(adr) + adr+=4 + actuali_tile(1) + +PRI Set_Tile(n)|adr,i 'gezeichnetes Tile in den Fontsatz übernehmen + adr:=$66800+(n*64) + i:=0 + repeat 16 + ios.ram_wrlong(einzel_tile[i++],adr) + adr+=4 + +PRI Paint_Pixel(x,y)|b,i,f 'gezeichnetes Pixel in Tile übernehmen + tmp:=0 + ios.displaytile(16,paintfarbe,0,0,y,x) + case paintfarbe + white:b:=%%0 + grey: b:=%%2 + black:b:=%%3 + + i:=y-9 + f:=x-3 + tmp[i]:=%%3<<(2*f) + einzel_tile[i]|=tmp[i] 'Farbe Schwarz übernehmen + + case b + + %%2: + tmp[i]:=1<<(2*f) 'Farbe Grau + einzel_tile[i]&=!tmp[i] + + %%0:tmp[i]:=0 + tmp[i]:=%%3<<(2*f) + einzel_tile[i]&=!tmp[i] 'Farbe weiss + + + + +PRI printbin(value, digits,hint,vor,x,y) |c 'screen: binären zahlenwert auf bildschirm ausgeben + + value <<= 32 - digits + repeat digits + c:=(value <-= 1) & 1 + "0" + ios.displaytile(c-16,hint,0,vor,y,x++) + + +PRI Text_Input(min_x,max_x,zeile,adr,ch):ausg|k,ii,x,y,blck,inp,adr_tmp,kl,spalte + {{####################################################### + ser=serielle Schnittstelle verwenden + mode=1 - Terminal mode=0 - Texteingabefeld + adr=Adresse Parameter-Ram adr=0 normales Textfeld + ch=maximale Anzahl Zeichen + ####################################################### + }} + ii:=0 + blck:=0 + adr_tmp:=adr+1 'Adresse merken + 'tmps:=adr + inp:=0 'Eingabe Merker, wird aktiviert, wenn was verändert wurde + spalte:=min_x + + + WIN_TILE(6,zeile,spalte) 'Eingabe-Cursor + + repeat + time 'Zeitaktualisierung + k:=ios.key + ma:=ios.mouse_button(0) + + if k==27 or ma 'Abbruch mit ESC + x:=ios.mousex + y:=ios.mousey + kl:=ios.get_window//10 'Icon-Button-Nummer des Fensters + if (kl==1) or (kl==2) or (k==27) 'Abfrage auf Fensterloeschen + popup_info_weg + quit + + if(x=>buttonx[4]) and (x=0 + if spaltemin_x 'or (spalte==min_x and zeile==min_y) + WIN_TILE(6,zeile,spalte) 'Cursor einen Schritt zurück + else + WIN_TILE(16,zeile,spalte) 'Leerzeichen + + adr-- + inp:=1 'Text wurde verändert + ii-- + if k>13 'Alle Zeichen außer Return + ii++ + if ii>ch + ii:=ch 'Zeichenanzahl nicht mehr erhöhen + blck:=1 'feste Zeichenanzahl-merker + + if k>96 + k&=!32 + WIN_TILE(k-16,zeile,spalte) + if spalte+1 ram_txt(nummer,TXT_RAM) aufgerufen ************** + 32: SD-Card-Info + 33: File-Info + 34: Calendar + 35: Filename: + 36: Filetype: + 37: Directory + 38: File + 39: - Attribute - + 40: R/O HID SYS ARC + 41: Textdisplay + 42: Startmenue + 43: Administra: + 44: Bellatrix : + 45: Regnatix : + 46: System-Settings + 47: Show hidden Files: + 48: Use Trash : + 49: Serial-Terminal + 50: Set Baudrate + 51: Systeminfo + 52: Clock-Settings + 53: Color-Settings + 54: Ram-Monitor + 55: Sid-Dmp-Player + 56: Copy : + 57: Delete: + 58: Venatrix : + 59: Start-Parameter (für Links) + 60: Venatrix-BUS: + 61: Sepia-Card : + 62: Cogs + 63: About + 64: Date + 65: Time + 66: Col: + 67: H-RAM: + 68: E-RAM: + +} +PRI display_error(er):r + if er + messagebox(ram_txt(er)) + r:=abfrage + 'ios.sdclose + +PRI abfrage:taste|a,x,y,k + repeat + a:=ios.mouse_button(0) + k:=ios.key + until a==255 or k==27 or k==13 + x:=ios.mousex + y:=ios.mousey + + if((x=>buttonx[4]) and (x=buttonx[2]) and (x=<(buttonx[2]+6)) and (y==buttony[2]))or k==27 'cancel + buttonpress(2) + taste:=0 + + popup_info_weg + +PRI ram_txt(nummer)|c,i,ad + i:=0 + ad:=TXT_RAM+((nummer-1)*25) + repeat while c:=ios.ram_rdbyte(ad++) + if c>13 + font[i++]:=c + font[i]:=0 + return @font + +PRI messagebox(st)|laenge,mindest,messagex + laenge:=strsize(st)+2 + mindest:= 20 + messagex:=10+laenge + ios.backup_area(7,10,messagex,17,BRAM) 'Hintergrund sichern + ios.display3DBox(white, colors[messagehcol], black, 10, 7, 17, messagex) + windowx[2]:=7 + windowy[2]:=10 + windowxx[2]:=messagex + windowyy[2]:=17 + print_message(st,8,11) + Infomarker:=1 + + button(4,10,15) + button(2,1+laenge,15) + +PRI print_message(stradr,x,y) + printfont(stradr,colors[messagehcol],0,colors[messagetextcol],x,y) + +PRI scanstr(f) | c 'Dateiendung extrahieren + repeat while strsize(f) + if c:=byte[f] == "." 'bis punkt springen + byte[f]:=0 + quit + f++ + +PRI infofenster(x,y,xx,yy,strg,knopf)'|i + + ios.backup_area(x-1,y-2,xx+1,yy+1,BRAM) 'Hintergrund sichern + window(2,4,y,x,yy,xx,strg) 'Fenster erstellen + if knopf==1 + button(4,((xx-x)/2)+x-2,yy) + if knopf==2 + button(2,((xx-x)/2)+x-2,yy) + infomarker:=1 + +PRI button(n,x,y) + buttonx[n]:=x + buttony[n]:=y + buttonl[n]:=strsize(@@buttons[n]) + if n==1 + printfont(@@buttons[n],colors[hcolstatus],0,colors[statustextcol],x,y) + else + printfont(@@buttons[n],colors[buttonhcol],0,colors[buttontextcol],x,y) + +PRI Mouse_Release + repeat while ios.mouse_button(0) 'warten bis Maustaste losgelassen wird + +pri ausstieg + + ios.sdmount + + ios.DisplayMouse(1,colors[mousecol]) + ios.mousepointer(hour_glass) + activate_dirmarker(systemdir) + ios.ldbin(@regsys) + + +pri testfenster|a + + a:=0 + window(0,4,2,1,27,38,string("Font-Draw")) + rahmen (1,6,38,27) + rahmen (1,1,38,3) + rahmen (1,4,38,6) + ios.displaytile(133,colors[winhcol],0,colors[act_color],6,1) 'Rahmen-Verbindungsstücke + ios.displaytile(117,colors[winhcol],0,colors[act_color],6,38) + Print_win(string("Font-Editor for Hive-Computer V1.2"),2,2) + + rahmen(2,8,19,25) + ios.display2dbox(white,9,3,24,18,0) + rahmen(20,8,37,25) + ios.displaypic(colors[winhcol],colors[panelcol],0,11,21,11,16) + + print_win(string("Tile:"),2,7) +' print_win(string(" "),8,7) + print_win(@new_name,21,9) + + Print_win(string("Color:"),2,5) + ios.display2dbox(white,5,9,5,10,0) + ios.display2dbox(grey,5,12,5,13,0) + ios.display2dbox(black,5,15,5,16,0) + + + button(0,12,7) + button(3,20,7) + button(5,28,7) + button(6,3,26) + button(7,10,26) + button(8,17,26) + button(9,24,26) + button(10,31,26) + +PRI Print_win(str,x,y) + printfont(str,colors[winhcol],0,colors[act_color],x,y) +PRI Print_win_rev(str,x,y) + printfont(str,colors[act_color],0,colors[winhcol],x,y) + +PRI printhex(value, digits,x,y,back,vor)|wert 'screen: hexadezimalen zahlenwert auf bildschirm ausgeben +{{hex(value,digits) - screen: hexadezimale bildschirmausgabe eines zahlenwertes}} + value <<= (8 - digits) << 2 + repeat digits + wert:=lookupz((value <-= 4) & $F : "0".."9", "A".."F") + ios.displaytile(wert-16,back,0,vor,y,x++) + +con'****************************************************** Datum und Zeitanzeige ************************************************************************************************* + +PRI time|s 'Zeitanzeige in der Statusleiste + timezaehler++ + if timezaehler>150 + timezaehler:=0 + s:=ios.getminutes + Status_extern(ios.dcf_sync,dcf_on,170,34,29,green,black) 'Anzeige des aktuellen Status in der Titelzeile + if s<>tmptime + displaytime + +PRI displaytime|h,m + + h:=ios.gethours + m:=ios.getminutes + + print_zehner(h,29,35,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,37) + + print_zehner(m,29,38,colors[hcolstatus],colors[statustextcol]) + tmptime:=m + date + +PRI date + + print_zehner(ios.getdate,0,29,colors[titelhcol],colors[titeltextcol]) + ios.displaytile(30,colors[titelhcol],0,colors[titeltextcol],0,31) + + print_zehner(ios.getmonth,0,32,colors[titelhcol],colors[titeltextcol]) + ios.displaytile(30,colors[titelhcol],0,colors[titeltextcol],0,34) + printdec(ios.getyear,0,35,colors[titelhcol],colors[titeltextcol]) + +pri print_zehner(wert,y,x,hin,vor)|a + a:=0 + if wert<10 + printdec(0,y,x,hin,vor) + a:=1 + printdec(wert,y,x+a,hin,vor) + +pri Status_extern(wert1,wert2,tnr_act,x,y,col,f3) + + if wert1==1 + ios.displaytile(tnr_act,colors[hcolstatus],col,f3,y,x) 'Status ok-anzeigen + else + if wert2 'Externe Komponente in Settingmenue ausgewählt? + ios.displaytile(tnr_act,colors[hcolstatus],grey,0,y,x) 'Symbol grau + else + ios.displaytile(16,colors[hcolstatus],colors[statustextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) + 'printdec(dcf_on,1,1,colors[winhcol],colors[act_color]) +con' +PRI doppelklick:click 'pseudo-doppelklick + click:=0 + ios.get_window + 'Mouse_Release + + repeat 800 + if ios.mouse_button(0)==255 + click++ + +con' +PRI iniload|i,a + a:=SETTING_RAM + repeat i from 0 to 14 + colors[i]:=ios.ram_rdbyte(a++) + dcf_on:=ios.ram_rdbyte(a+3) + +PRI activate_dirmarker(mark) 'USER-Marker setzen + + ios.sddmput(ios#DM_USER,mark) 'usermarker wieder in administra setzen + ios.sddmact(ios#DM_USER) 'u-marker aktivieren + +PRI get_dirmarker:dm 'USER-Marker lesen + + ios.sddmset(ios#DM_USER) + dm:=ios.sddmget(ios#DM_USER) + +PRI window(num,cntrl,y,x,yy,xx,strg) 'ein Fenster erstellen + + windowx[num]:=x-1 + windowy[num]:=y-2 + windowxx[num]:=xx+1 + windowyy[num]:=yy+1 + + ios.window(num,0,colors[winhcol],0,colors[winframecol],colors[titelhcol],colors[titeltextcol],colors[hcolstatus],colors[statustextcol],y-2,x-1,yy+1,xx+1,cntrl,0) + ios.printcursorrate(0) + ios.printchar(12) 'cls + printfont(strg,colors[titelhcol],0,colors[titeltextcol],x,y-2) + +PRI printfont(str1,a,b,c,d,e)|f + + repeat strsize(str1) + f:= byte[str1++] + if f >96 + f^=32 + f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt + if d>39 'wenn Bildschirmrand erreicht, neue Zeile + d:=0 + e++ + ios.displayTile(f,a,b,c,e,d) 'einzelnes Tile anzeigen ('displayTile(tnr,pcol,scol,tcol, row, column)) + + d++ +PRI printdec(value,y,xx,hint,vor) | i ,c ,x 'screen: dezimalen zahlenwert auf bildschirm ausgeben +{{printdec(value) - screen: dezimale bildschirmausgabe zahlenwertes}} + ' if value < 0 'negativer zahlenwert + ' -value + 'printchar("-") + + i := 1_000_000_000 + repeat 10 'zahl zerlegen + if value => i + x:=value / i + "0" + ios.displayTile(x-16,hint,0,vor,y,xx) 'printchar(x) + xx++ + c:=value / i + "0" + value //= i + result~~ + elseif result or i == 1 + printfont(string("0"),hint,0,vor,xx,y) 'printchar("0") + xx++ + i /= 10 'nächste stelle +con '************************************************** Button-Funktionen ******************************************************************************************************** + +PRI buttonpress(n) + printfont(@@buttons[n],250,0,0,buttonx[n],buttony[n]) + if n==1 + printfont(@@buttons[n],250,0,0,buttonx[n],buttony[n]) + ios.displaytile(144,colors[shellhcol],250,colors[shellhcol],29,7) + else + printfont(@@buttons[n],250,0,0,buttonx[n],buttony[n]) + Mouse_Release + if n==1 + printfont(@@buttons[n],colors[hcolstatus],0,colors[statustextcol],buttonx[n],buttony[n]) + ios.displaytile(144,colors[shellhcol],colors[hcolstatus],colors[shellhcol],29,7) + else + printfont(@@buttons[n],colors[Buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n]) + +con '*************************************************** Start-Menue ************************************************************************************************************* +PRI Menue(x,y,xx,yy)|i + popup(x,y,xx,yy) + repeat i from x to xx + ios.displaytile(16,colors[Titelhcol],$ff,$ff,y-1,i) + +PRI separator(x,y,xx)|i + repeat i from x to xx + ios.displaytile(6,colors[Messagehcol],0,colors[winframecol],y,i) + +PRI menueselect(stri,y) + printfont(stri,colors[messagetextcol],0,colors[messagehcol],0,y) + Mouse_Release + printfont(stri,colors[messagehcol],0,colors[messagetextcol],0,y) + popup_info_weg + +PRI Startmenue + menue(0,25,9,28) + printfont(string("Startmenue"),colors[titelhcol],0,colors[titeltextcol],0,24) + + printfont(string("Save - F2"),colors[messagehcol],0,colors[messagetextcol],0,25) + menuey[0]:=25 + 'printfont(string("Help - F1"),colors[messagehcol],0,colors[messagetextcol],0,25) + 'menuey[1]:=25 + separator(0,26,9) + + printfont(string("-EXIT- F12"),colors[messagehcol],0,colors[messagetextcol],0,27) + menuey[1]:=27 + popupmarker:=1 +con '*************************************************** Popup-Menue ************************************************************************************************************* + +PRI popup(x,y,xx,yy) + popupx:=x + popupy:=y-1 + popupyy:=yy + popupxx:=xx + ios.backup_area(popupx,popupy,popupxx,popupyy,BRAM) + ios.display2dbox(colors[messagehcol],y,x,yy,xx,0) + +PRI Popup_Info_weg + if popupmarker==1 'Popupmenue sichtbar? + ios.restore_area(popupx,popupy,popupxx,popupyy,BRAM) 'Hintergrund wiederherstellen + popupmarker:=0 'Popupmarker loeschen + if infomarker==1 + ios.restore_area(windowx[2],windowy[2],windowxx[2],windowyy[2],BRAM) 'Hintergrund wiederherstellen + buttonx[2]:=buttony[2]:=buttonl[2]:=buttonx[4]:=buttony[4]:=buttonl[4]:=-1 'Buttonwerte löschen + infomarker:=0 + +PRI rahmen(x,y,xx,yy)|i + win_tile(137,y,x) + win_tile(136,yy,x) + win_tile(157,y,xx) + win_tile(119,yy,xx) + repeat i from y+1 to yy-1 + win_tile(2,i,x) + win_tile(114,i,xx) + line(x+1,y,xx-1) + line(x+1,yy,xx-1) + +PRI line(x,y,xx)|i + repeat i from x to xx + win_tile(130,y,i) + +con '---------------------------------------------- Ausgaberoutinen --------------------------------------------------------------------------------------------------------------- +PRI Win_Tile(nu,ty,tx) + ios.displaytile(nu,colors[winhcol],0,colors[act_color],ty,tx) + +DAT + +'sepia_ini byte "sepia.ini",0 + diff --git a/source/reg-ios-64.spin b/source/reg-ios-64.spin index f28ef7f..058f14d 100644 --- a/source/reg-ios-64.spin +++ b/source/reg-ios-64.spin @@ -338,8 +338,6 @@ PUB start: wflag 'system: ios initialisieren serial:=0 'serielle Schnittstelle geschlossen - ram_wrlong($7f54,$FFFFB) - 'ram_wrbyte(0,$7f,$FFFFC) sddmact(DM_USER) 'wieder in userverzeichnis wechseln lflagadr := ram_rdlong(LOADERPTR) 'adresse der loader-register setzen @@ -480,7 +478,7 @@ PUB ldbin(stradr) | len,i,stradr2 'loader: startet bin-datei über len := strsize(stradr) stradr2 := lflagadr + 1 'adr = flag, adr + 1 = string repeat i from 0 to len - 1 'string in loadervariable kopieren - byte[stradr2][i] := byte[stradr][i] + byte[stradr2][i] := byte[stradr][i] byte[stradr2][++i] := 0 'string abschließen byte[lflagadr][0] := 1 'loader starten @@ -809,16 +807,8 @@ PUB sdxgetblk(adr,count)|i 'sd-card: block lesen -- bus_putchar1(gc#a_SDGETBLK) bus_putlong1(count) 'laenge der Datei in byte repeat count - 'rd_put(fnr,bus_getchar1) ram_wrbyte(bus_getchar1,adr++) -'PUB rd_put(adr,wert) | adr,fix 'ramdisk: nächstes byte in datei schreiben -'********** muss modifiziert werden ******************** - 'fix := fnr * FTCNT - 'adr := ftab[fix+0] + ftab[fix+2] -' ram_wrbyte(0,wert,adr) - 'rd_seek(fnr,ftab[fix+2]+1) - con '*********************************************** Blocktransfer test ************************************************************************************************** PUB sdxputblk(adr,count) 'sd-card: block schreiben <-- eRAM ''funktionsgruppe : sdcard @@ -1124,7 +1114,33 @@ pub Set_Bluetooth_Command_Mode bus_putchar1(gc#a_bl_Command_On) pub Clear_Bluetooth_Command_Mode bus_putchar1(gc#a_bl_Command_Off) +con'--------------------------------------------------- Funktionsgenerator -------------------------------------------------------------------------------------------------------- +PUB Gen_Start_FunctionGenerator + bus_putchar1(gc#a_startFunctionGenerator) +PUB GEN_Stop_FunctionGenerator + bus_putchar1(gc#a_stopFunctionGenerator) +PUB Gen_SetPulseWidth(n) + bus_putchar1(gc#a_PulseWidth) + bus_putlong1(n) +PUB Gen_Frequency(n) + bus_putchar1(gc#a_Frequency_HZ) + bus_putlong1(n) +PUB Gen_DeziFrequency(n) + bus_putchar1(gc#a_Frequency_Centihz) + bus_putlong1(n) +PUB Gen_Waveform(n) + bus_putchar1(gc#a_SetWaveform) + bus_putchar1(n) +PUB Gen_DampLevel(n) + bus_putchar1(gc#a_SetDampLevel) + bus_putlong1(n) +PUB Gen_SetParameter(WaveformType, frequencyInHertz, dampLev, pulseWidthValue) + bus_putchar1(gc#a_setParameter) + bus_putchar1(WaveformType) + bus_putlong1(frequencyInHertz) + bus_putlong1(dampLev) + bus_putlong1(pulseWidthValue) CON ''------------------------------------------------- LAN_FUNKTIONEN PUB lanstart 'LAN starten @@ -2423,10 +2439,8 @@ PUB bus_getlong1: wert 'bus: long von administr PUB bus_putlong1(wert) 'bus: long zu administra senden hsb/lsb - bus_putchar1(wert >> 24) '32bit wert senden hsb/lsb - bus_putchar1(wert >> 16) - bus_putchar1(wert >> 8) - bus_putchar1(wert) + repeat 4 + bus_putchar1(wert <-= 8) '32bit wert senden hsb/lsb PUB bus_getstr1: stradr | len,i 'bus: string von administra empfangen @@ -2537,11 +2551,14 @@ PUB bus_getlong2: wert 'bus: long von bellatrix wert := wert + bus_getchar2 PUB bus_putlong2(wert) 'bus: long an bellatrix senden hsb/lsb - + repeat 4 + bus_putchar2(wert <-= 8) '32bit wert senden hsb/lsb +{ bus_putchar2(wert >> 24) '32bit wert senden hsb/lsb bus_putchar2(wert >> 16) bus_putchar2(wert >> 8) bus_putchar2(wert) + } PUB bus_getword3: wert 'bus: 16 bit von venatrix empfangen hsb/lsb wert := bus_getchar3 << 8 @@ -2560,11 +2577,14 @@ PUB bus_getlong3: wert 'bus: long von venatrix wert := wert + bus_getchar3 PUB bus_putlong3(wert) 'bus: long an venatrix senden hsb/lsb - + repeat 4 + bus_putchar3(wert <-= 8) '32bit wert senden hsb/lsb +{ bus_putchar3(wert >> 24) '32bit wert senden hsb/lsb bus_putchar3(wert >> 16) bus_putchar3(wert >> 8) bus_putchar3(wert) + } PUB bus_getstr3: stradr | len,i 'bus: string von administra empfangen len := bus_getchar3 'längenbyte empfangen diff --git a/source/sepia-test.spin b/source/sepia-test.spin index 8de74c4..5fb7095 100644 --- a/source/sepia-test.spin +++ b/source/sepia-test.spin @@ -591,7 +591,7 @@ PRI time|s 'Zeitanzeige in der Statusleiste if timezaehler>50 timezaehler:=0 s:=ios.getminutes - Status_extern(ios.dcf_sync,dcf_on,170,27,0,colors[titeltextcol],black) 'Anzeige des aktuellen Status in der Titelzeile + Status_extern(ios.dcf_sync,dcf_on,170,34,29,green,black) 'Anzeige des aktuellen Status in der Titelzeile if s<>tmptime displaytime @@ -600,10 +600,10 @@ PRI displaytime|h,m h:=ios.gethours m:=ios.getminutes - print_zehner(h,29,34,colors[hcolstatus],colors[statustextcol]) - ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,36) + print_zehner(h,29,35,colors[hcolstatus],colors[statustextcol]) + ios.displaytile(42,colors[hcolstatus],0,colors[statustextcol],29,37) - print_zehner(m,29,37,colors[hcolstatus],colors[statustextcol]) + print_zehner(m,29,38,colors[hcolstatus],colors[statustextcol]) tmptime:=m date @@ -626,12 +626,12 @@ pri print_zehner(wert,y,x,hin,vor)|a pri Status_extern(wert1,wert2,tnr_act,x,y,col,f3) if wert1==1 - ios.displaytile(tnr_act,colors[Titelhcol],col,f3,y,x) 'Status ok-anzeigen + ios.displaytile(tnr_act,colors[hcolstatus],col,f3,y,x) 'Status ok-anzeigen else - if wert2 'Externe Komponente in Settingmenue ausgewählt? - ios.displaytile(tnr_act,colors[titelhcol],grey,0,y,x) 'Symbol grau + if wert2 'Externe Komponente in Settingmenue ausgewählt? + ios.displaytile(tnr_act,colors[hcolstatus],grey,0,y,x) 'Symbol grau else - ios.displaytile(16,colors[Titelhcol],colors[titeltextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) + ios.displaytile(16,colors[hcolstatus],colors[statustextcol],0,y,x) 'Ohne externe Komponente arbeiten (kein Symbol) con' PRI doppelklick:click 'pseudo-doppelklick @@ -692,6 +692,8 @@ PRI printfont(str1,a,b,c,d,e)|f repeat strsize(str1) f:= byte[str1++] + if f >96 + f^=32 f-=16 'anderer Zeichensatz, Zeichen um -16 Positionen versetzt if d>39 'wenn Bildschirmrand erreicht, neue Zeile d:=0 @@ -722,12 +724,14 @@ con '************************************************** Button-Funktionen ****** PRI buttonpress(n) case n - 1:printfont(string("Start"),250,0,0,0,29) + 1:printfont(string("Start "),250,0,0,0,29) + ios.displaytile(144,colors[shellhcol],250,colors[shellhcol],29,7) 4:printfont(@butOK,250,0,0,buttonx[n],buttony[n]) Mouse_Release case n - 1:printfont(string("Start"),colors[hcolstatus],0,colors[statustextcol],0,29) + 1:printfont(string("Start "),colors[hcolstatus],0,colors[statustextcol],0,29) + ios.displaytile(144,colors[shellhcol],colors[hcolstatus],colors[shellhcol],29,7) 4:printfont(@butOK,colors[Buttonhcol],0,colors[buttontextcol],buttonx[n],buttony[n])