Re: VGA 640x480@60Hz 80x60(8X8) char Color16/16
Verfasst: So 24. Jun 2012, 11:35
-
Retro Style Eigenbau Computer mit Parallax Propeller
https://www.hive-project.de/board/
Code: Alles auswählen
'' 1C0 Left Arrow
'' 1C1 Right Arrow
'' 1C2 Up Arrow
'' 1C3 Down Arrow
'' 1C4 Home
'' 1C5 End
'' 1C6 Page Up
'' 1C7 Page Down
'' 1C8 Backspace
'' 1C9 Delete
'' 1CA Insert
'' 1CB Esc
'' 1CC Apps
'' 1CD Power
'' 1CE Sleep
'' 1CF Wakeup
Code: Alles auswählen
CrsLt = $02E4 '←
CrsRt = $03E6 '→
CrsUp = $04E8 '↑
CrsDn = $05E2 '↓
CrsHm = $06E7 '◀
CrsEn = $07E1 '▶
PgUp = $A0E9 '
PgDn = $A2E3 '
Bksp = $00C8 'È
Del = $BAEA '
Ins = $BBE0 '
Esc = $001B '
Apps = $CC00 'Ì
Power = $CD00 'Í
Sleep = $CE00 'Î
WkUp = $CF00 'Ï
Code: Alles auswählen
a := startm(bini#BEL_MOUSED, bini#BEL_MOUSEC)'mausport starten
a := startk(bini#BEL_KEYBD, bini#BEL_KEYBC, %0_000_000, %01_01000) 'tastaturport starten
a := startv(@screen, @ckx, @sync) 'start vga text driver
if (a)
xchr($FE)
xstr(string("(c)PIC18F2550 VGA 80x60, COLOR 16/16 RASTER 8x8 Treiber fuer HIVE r48/n"))
xstr(string("Z1013.A2 Zeichensatz/n"))
waitcnt(clkfreq * 2 + cnt)
case par_mpresent
0 : xstr(string("no mouse connected/n"))
1 : xstr(string("two-button or three-button mouse/n"))
2 : xstr(string("three-button scrollwheel mouse/n"))
3 : xstr(string("five-button scrollwheel mouse/n"))
case -par_kpresent
true : xstr(string("keybord connected/n"))
False: xstr(string("no keybord connected/n"))
waitcnt(clkfreq * 4 + cnt)
Code: Alles auswählen
cmd := gc
if cmd > 0 ' > 0
xchr(cmd) ' textzeichen $01..$FF
else
cmd := gc
case cmd
'----------------------------------------- KEYBOARD
$01: 'io ' Tastaturstatus senden
$02: 'io ' Tastaturzeichen senden
$03: ' ' Statustasten ($100..$1FF) abfragen
$04: ' ' Keybord Kursorstatus lesen
$05: ' ' Keybordkursorstatus setzen
$06: ' ' Kursor von Windows lesen
$07: ' ' Kursor von Windows setzen
'----------------------------------------- MAUS
$10: ' ' Maus Kursorstatus lesen
$11: ' ' Maus Kursorstatus setzen
$12: 'io ' Maus position lesen(x,y,z)
$13: 'io ' Maus position setzen(x,y,z)
$14: ' ' Maus letzte click position (x,y,z)
'----------------------------------------- VGA-Textausgabe
$20: 'io ' clear Fenster
$21: 'io ' Kursor home im fenster
$22: 'io ' Kursor pos1
$23: 'io ' scrollup scrollt das Fenster nach oben
$24: 'xxx' scrolldown scrollt das Fenster nach unten
$25: 'io ' Kursor im Fenster backspace
$26: ' ' Tabulatortabelle setzen
$27: 'io ' tab im fenster setzen
$60: ' ' aktuelle Fenster Nummer lesen
$61: ' ' aktuelle Fenster Nummer setzen
$70: ' ' Fenster Schriftfarbe setzen
$71: ' ' Fenster Hintergrundfarbe setzen
'----------------------------------------- VGA-Zeichensatz
$80: 'io*' hive-logo ausgeben
$81: ' ' Ein Zeichen im Zeichensatz ändern
'----------------------------------------- CHIP-MANAGMENT
$F0: ' ' Config abfragen
$F1: 'io ' screeninit
$FF: 'io ' bellatrix neu starten
other:
b := Awindows
Awindows := 9
xstr(string("BUS-COMMAND-ERROR>00 "))
xstr(integerToHexadecimal(cmd,2))
xstr(string("<\n"))
repeat 2
waitcnt(clkfreq + cnt)
!outa[HBEAT] 'led blinken
Awindows := b
else ' LED Error meldung
waitcnt(clkfreq + cnt)
!outa[HBEAT] 'led blinken
Code: Alles auswählen
'io ' Getestet
' ' ungetestet
'xxx' geht nicht
Code: Alles auswählen
PRI xchr(a) ' ' ein Zeichen ausgeben
if (a == "\") & !(lchar[Awindows] == "\") ' Zeichen "\" zwischenspeichern
lchar[Awindows] := a
else
if (a == "\") & (lchar[Awindows] == "\") ' doppeltes "\\"
lchar[Awindows] := 0
if !(a == "\") and (lchar[Awindows] == "\") ' doppeltes "\?" Steuerzeichen
lchar[Awindows] := 0
case a
"n" : '\n newline
lchar[Awindows] := a
spalte[Awindows] := 0
if (zeile[Awindows] < eline[Awindows])
zeile[Awindows]++
else
zeile[Awindows] := eline[Awindows]
wordmove(@screen[sline[Awindows]*cols], @screen[(sline[Awindows]+1)*cols],(eline[Awindows]-sline)*cols) 'wordmove(dest,src,cnt)
wordfill(@screen[eline[Awindows]*cols], fcolor[Awindows] + hcolor[Awindows] + " ", cols)
else ' Zeichen 0..255 Ausgeben
lchar[Awindows] := 0
screen[spalte[Awindows] + zeile[Awindows] * 80] := fcolor[Awindows] + hcolor[Awindows] + a
spalte[Awindows]++
if spalte[Awindows] >79
spalte[Awindows] := 0
zeile[Awindows]++
if (zeile[Awindows] > eline[Awindows])
zeile[Awindows]--
wordmove(@screen[sline[Awindows]*cols], @screen[(sline[Awindows]+1)*cols],(eline[Awindows]-sline)*cols) 'wordmove(dest,src,cnt)
wordfill(@screen[eline[Awindows]*cols], fcolor[Awindows] + hcolor[Awindows] + " ", cols)