ipconfig/ftp: auto-load admnet, ftp: /f optional, irc: dialogs not blocking
This commit is contained in:
parent
6015961fab
commit
0723196cd5
|
@ -36,14 +36,13 @@ OBJ
|
|||
ios: "reg-ios"
|
||||
str: "glob-string"
|
||||
num: "glob-numbers" 'Number Engine
|
||||
gc : "glob-con"
|
||||
|
||||
CON
|
||||
|
||||
_CLKMODE = XTAL1 + PLL16X
|
||||
_XINFREQ = 5_000_000
|
||||
|
||||
LANMASK = %00000000_00000000_00000000_00100000
|
||||
|
||||
CON 'NVRAM Konstanten --------------------------------------------------------------------------
|
||||
|
||||
#4, NVRAM_IPADDR
|
||||
|
@ -81,9 +80,14 @@ PUB main
|
|||
password[0] := 0
|
||||
|
||||
ios.start
|
||||
ifnot (ios.admgetspec & LANMASK)
|
||||
ifnot (ios.admgetspec & gc#A_LAN)
|
||||
ios.sddmset(ios#DM_USER) 'u-marker setzen
|
||||
ios.sddmact(ios#DM_SYSTEM) 's-marker aktivieren
|
||||
ios.admload(string("admnet.adm")) 'versuche, admnet zu laden
|
||||
ios.sddmact(ios#DM_USER) 'u-marker aktivieren
|
||||
ifnot (ios.admgetspec & gc#A_LAN) 'wenn Laden fehlgeschlagen
|
||||
ios.print(@strNoNetwork)
|
||||
ios.stop
|
||||
ios.stop 'Ende
|
||||
ios.printnl
|
||||
ios.parastart 'parameterübergabe starten
|
||||
repeat while ios.paranext(@parastr) 'parameter einlesen
|
||||
|
@ -98,6 +102,8 @@ PUB main
|
|||
"p": ios.paranext(@password)
|
||||
"s": save2card := TRUE
|
||||
other: ios.print(@help)
|
||||
else
|
||||
ByteMove(@filename, @parastr, strsize(@parastr))
|
||||
|
||||
ifnot byte[@filename][0] == 0
|
||||
ifnot ftpconnect
|
||||
|
@ -461,7 +467,7 @@ DAT ' Locale
|
|||
byte " (default: boot server from ipconfig)",13
|
||||
byte " /d <directory>: change to remote directory",13
|
||||
byte " (default: /hive/sdcard/system)",13
|
||||
byte "/f <filename> : download <filename>",13
|
||||
byte "[/f] <filename> : download <filename>",13
|
||||
byte " /u <username> : Username at ftp server",13
|
||||
byte " (default: anonymous)",13
|
||||
byte " /p <password> : password at ftp server",13
|
||||
|
@ -509,7 +515,7 @@ DAT ' Locale
|
|||
byte " (default: mit ipconfig gesetzter Boot-Server)",13
|
||||
byte " /d <verzeichnis>: in entferntes Verzeichnis wechseln",13
|
||||
byte " (default: /hive/sdcard/system)",13
|
||||
byte "/f <dateiname> : Download <dateiname>",13
|
||||
byte "[/f] <dateiname> : Download <dateiname>",13
|
||||
byte " /u <username> : Benutzername am FTP-Server",13
|
||||
byte " (default: anonymous)",13
|
||||
byte " /p <password> : Paßwort am FTP-Server",13
|
||||
|
|
|
@ -34,14 +34,13 @@ OBJ
|
|||
ios: "reg-ios"
|
||||
str: "glob-string"
|
||||
num: "glob-numbers"
|
||||
gc : "glob-con"
|
||||
|
||||
CON
|
||||
|
||||
_CLKMODE = XTAL1 + PLL16X
|
||||
_XINFREQ = 5_000_000
|
||||
|
||||
LANMASK = %00000000_00000000_00000000_00100000
|
||||
|
||||
CON 'NVRAM Konstanten --------------------------------------------------------------------------
|
||||
|
||||
#4, NVRAM_IPADDR
|
||||
|
@ -65,9 +64,14 @@ PUB main | i
|
|||
ios.start 'ios initialisieren
|
||||
ios.printnl
|
||||
|
||||
ifnot (ios.admgetspec & LANMASK)
|
||||
ifnot (ios.admgetspec & gc#A_LAN)
|
||||
ios.sddmset(ios#DM_USER) 'u-marker setzen
|
||||
ios.sddmact(ios#DM_SYSTEM) 's-marker aktivieren
|
||||
ios.admload(string("admnet.adm")) 'versuche, admnet zu laden
|
||||
ios.sddmact(ios#DM_USER) 'u-marker aktivieren
|
||||
ifnot (ios.admgetspec & gc#A_LAN) 'wenn Laden fehlgeschlagen
|
||||
ios.print(@strNoNetwork)
|
||||
ios.stop
|
||||
ios.stop 'Ende
|
||||
if ios.rtcTest 'RTC chip available?
|
||||
rtcAvailable := TRUE
|
||||
else 'use configfile
|
||||
|
|
|
@ -30,6 +30,10 @@ Notizen :
|
|||
|
||||
}}
|
||||
|
||||
DAT
|
||||
|
||||
strVersion byte "1.3.1",0
|
||||
|
||||
OBJ
|
||||
ios: "reg-ios"
|
||||
str: "glob-string"
|
||||
|
@ -71,7 +75,6 @@ LEN_IRCSRV = 64
|
|||
|
||||
MAX_LINES_WIN1 = 1000 ' maximale Zeilenanzahl im Puffer für Fenster 1 (Chat)
|
||||
MAX_LINES_WIN2 = 1000 ' maximale Zeilenanzahl im Puffer für Fenster 2 (Status)
|
||||
MAX_LINES_WIN3 = 100 ' maximale Zeilenanzahl im Puffer für Fenster 3 (Eingabe)
|
||||
|
||||
CON 'NVRAM Konstanten --------------------------------------------------------------------------
|
||||
|
||||
|
@ -114,6 +117,7 @@ VAR
|
|||
byte receive_str[LEN_IRCLINE]
|
||||
byte brightness
|
||||
byte newMsg
|
||||
byte nooutput
|
||||
|
||||
PUB main | key, t
|
||||
|
||||
|
@ -177,6 +181,7 @@ PRI init
|
|||
reconnect := FALSE
|
||||
joined := FALSE
|
||||
newMsg := FALSE
|
||||
nooutput := FALSE
|
||||
|
||||
ios.start 'ios initialisieren
|
||||
ifnot (ios.belgetspec & (gc#b_key|gc#b_txt|gc#b_win)) 'Wir brauchen Bellatrix mit Keyboard-, Text- und Fensterfunktionen
|
||||
|
@ -262,6 +267,7 @@ PRI f_scrolldown | lineAddr, lineNum, lineMax
|
|||
|
||||
PRI f_help
|
||||
|
||||
nooutput := TRUE 'solange Hilfe angezeigt wird, nichts ausgeben
|
||||
ios.winset(5)
|
||||
ios.printcls
|
||||
ios.winoframe
|
||||
|
@ -269,9 +275,11 @@ PRI f_help
|
|||
ios.curoff
|
||||
ios.setcolor(COL_DEFAULT)
|
||||
ios.print(@strHelp)
|
||||
repeat until ios.keystat > 0
|
||||
waitcnt(cnt + clkfreq) '1sek warten
|
||||
ios.key
|
||||
repeat until ios.keystat > 0 'bis eine Taste gedrückt wird
|
||||
ifnot handleidx == $FF 'bei bestehender Verbindung...
|
||||
ircGetLine 'Meldungen vom Server empfangen
|
||||
ios.key 'Taste "abholen" (dummy)
|
||||
nooutput := FALSE 'Ausgabe wieder freigeben
|
||||
win_redraw
|
||||
win_contentRefresh
|
||||
|
||||
|
@ -649,7 +657,9 @@ PRI ircGetLine | i, x, prefixstr, nickstr, chanstr, msgstr, commandstr
|
|||
if strcomp(msgstr, string("VERSION")) 'Versions-Anfrage
|
||||
sendStr(string("NOTICE "))
|
||||
sendStr(nickstr)
|
||||
sendStr(string(" :VERSION HiveIRC 1.0.0 [P8X32A/80MHz] <http://hive-project.de/>",13,10))
|
||||
sendStr(string(" :VERSION HiveIRC "))
|
||||
sendStr(@strVersion)
|
||||
sendStr(string(" [P8X32A/80MHz] <http://hive-project.de/>",13,10))
|
||||
else
|
||||
ifnot newMsg 'neue Mitteilung noch nicht signalisiert
|
||||
newMsg := TRUE
|
||||
|
@ -880,6 +890,12 @@ PRI title_draw | spaces, i
|
|||
if ircsrv[++i] == 0 'Ende Servername folgt
|
||||
ios.printchar(")")
|
||||
else
|
||||
ios.print(string(" v"))
|
||||
spaces -= 2
|
||||
ios.print(@strVersion)
|
||||
spaces -= strsize(@strVersion)
|
||||
ios.print(string(" © Jörg Deckert"))
|
||||
spaces -= 15
|
||||
repeat spaces
|
||||
ios.printchar(" ")
|
||||
ios.printlogo(0,0)
|
||||
|
@ -1029,10 +1045,6 @@ PRI setscreen | buflen[4], i
|
|||
yn[3] := rows-2
|
||||
buflinenr[3] := 0
|
||||
scrolllinenr[3] := 0
|
||||
bufstart[3] := bufstart[2] + buflen[2]
|
||||
buflen[3] := buflinelen * MAX_LINES_WIN3
|
||||
repeat i from 0 to MAX_LINES_WIN3 - 1 'Fensterpuffer leeren
|
||||
printStrBuf(3)
|
||||
|
||||
ios.winset(0)
|
||||
ios.printcls
|
||||
|
@ -1206,6 +1218,9 @@ PRI printStrWin(printStr) | i
|
|||
'' │ Chat-Zeile in aktuellem Fenster zeigen │
|
||||
'' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
if nooutput 'wenn Ausgabe gesterrt
|
||||
return
|
||||
|
||||
i := 0
|
||||
repeat
|
||||
if byte[printStr][i] == 0 and byte[printStr][i+1] == 0 'nichts mehr anzuzeigen, Ende
|
||||
|
@ -1225,7 +1240,6 @@ PRI printStrBuf(win) | lineAddr, lineMax, i
|
|||
case win
|
||||
1: lineMax := MAX_LINES_WIN1
|
||||
2: lineMax := MAX_LINES_WIN2
|
||||
3: lineMax := MAX_LINES_WIN3
|
||||
|
||||
lineAddr := bufstart[win] + (buflinenr[win]++ * buflinelen) 'Adresse Zeilenbeginn im eRAM (Usermode)
|
||||
if buflinenr[win] == lineMax
|
||||
|
@ -1299,6 +1313,7 @@ PRI IpPortToStr(ip, port) | i,n,x,stradr
|
|||
|
||||
PUB input(strdesc, strdef, input_len) | i,n
|
||||
|
||||
nooutput := TRUE 'solange Dialog angezeigt wird, nichts ausgeben
|
||||
input_str[0] := 0
|
||||
ios.winset(4)
|
||||
ios.printcls
|
||||
|
@ -1323,8 +1338,11 @@ PUB input(strdesc, strdef, input_len) | i,n
|
|||
i++
|
||||
byte[@input_str][i] := 0
|
||||
ios.curon
|
||||
repeat 'entspricht ab hier ios.input
|
||||
n := ios.keywait 'auf taste warten
|
||||
repeat
|
||||
ifnot handleidx == $FF 'bei bestehender Verbindung...
|
||||
ircGetLine 'Meldungen vom Server empfangen
|
||||
if ios.keystat > 0 'wenn Taste gedrückt
|
||||
n := ios.key
|
||||
case n
|
||||
$0d: quit 'Enter, Eingabe beenden
|
||||
ios#CHAR_BS: if i > 0 'Zurück
|
||||
|
@ -1338,6 +1356,7 @@ PUB input(strdesc, strdef, input_len) | i,n
|
|||
byte[@input_str][i] := 0
|
||||
|
||||
ios.curoff
|
||||
nooutput := FALSE 'Ausgabe wieder freigeben
|
||||
|
||||
PRI readLine(timeout) : ch
|
||||
|
||||
|
|
Loading…
Reference in New Issue