Das kleine Wochenupdate:
- Player und Umschaltung der Soundsysteme funktioniert jetzt - Boulder Dash und StarTracker an TriOS angepasst
This commit is contained in:
parent
47fac2c8da
commit
1a46a0760d
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
|
||||
"Die Blütenträume
|
||||
Von Faltern, wie ich hörte,
|
||||
So lautlos wie sie -"
|
||||
Reikan
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
"Die Blütenträume
|
||||
Von Faltern, wie ich hörte,
|
||||
So lautlos wie sie -"
|
||||
Reikan
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
"Die Blütenträume
|
||||
Von Faltern, wie ich hörte,
|
||||
So lautlos wie sie -"
|
||||
Reikan
|
||||
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
Johann Wolfgang Goethe
|
||||
|
||||
Der Zauberlehrling
|
||||
|
||||
Hat der alte Hexenmeister
|
||||
Sich doch einmal wegbegeben!
|
||||
Und nun sollen seine Geister
|
||||
Auch nach meinem Willen leben!
|
||||
Seine Wort' und Werke
|
||||
Merkt' ich und den Brauch,
|
||||
Und mit Geistesstärke
|
||||
Tu' ich Wunder auch.
|
||||
|
||||
Walle! Walle
|
||||
Manche Strecke,
|
||||
Dass, zum Zwecke,
|
||||
Wasser fließe
|
||||
Und mit reichem, vollem Schwalle
|
||||
Zu dem Bade sich ergieße.
|
||||
|
||||
Und nun komm, du alter Besen!
|
||||
Nimm die schlechten Lumpenhüllen!
|
||||
Bist schon lange Knecht gewesen;
|
||||
Nun erfülle meinen Willen!
|
||||
Auf zwei Beinen stehe,
|
||||
Oben sei ein Kopf,
|
||||
Eile nun und gehe
|
||||
Mit dem Wassertopf!
|
||||
|
||||
Walle! Walle
|
||||
Manche Strecke,
|
||||
Dass, zum Zwecke,
|
||||
Wasser fließe
|
||||
Und mit reichem, vollem Schwalle
|
||||
Zu dem Bade sich ergieße.
|
||||
|
||||
Seht, er läuft zum Ufer nieder;
|
||||
Wahrlich! ist schon an dem Flusse,
|
||||
Und mit Blitzesschnelle wieder
|
||||
Ist er hier mit raschem Gusse.
|
||||
Schon zum zweiten Male!
|
||||
Wie das Becken schwillt!
|
||||
Wie sich jede Schale
|
||||
Voll mit Wasser füllt!
|
||||
|
||||
Stehe! Stehe!
|
||||
Denn wir haben
|
||||
Deiner Gaben
|
||||
Voll gemessen!
|
||||
Ach, ich merk' es! Wehe! Wehe!
|
||||
Hab' ich doch das Wort vergessen!
|
||||
|
||||
Ach, das Wort, worauf am Ende
|
||||
Er das wird, was er gewesen.
|
||||
Ach, er läuft und bringt behände!
|
||||
Wärst du doch der alte Besen!
|
||||
Immer neue Güsse
|
||||
Bringt er schnell herein,
|
||||
Ach! und hundert Flüsse
|
||||
Stürzen auf mich ein.
|
||||
|
||||
Nein, nicht länger
|
||||
Kann ich's lassen;
|
||||
Will ihn fassen.
|
||||
Das ist Tücke!
|
||||
Ach! nun wird mir immer bänger!
|
||||
Welche Miene! Welche Blicke!
|
||||
|
||||
Oh, du Ausgeburt der Hölle!
|
||||
Soll das ganze Haus ersaufen?
|
||||
Seh' ich über jede Schwelle
|
||||
Doch schon Wasserströme laufen.
|
||||
Ein verruchter Besen,
|
||||
Der nicht hören will!
|
||||
Stock, der du gewesen,
|
||||
Steh doch wieder still!
|
||||
|
||||
Willst's am Ende
|
||||
Gar nicht lassen?
|
||||
Will dich fassen,
|
||||
Will dich halten
|
||||
Und das alte Holz behände
|
||||
Mit dem scharfen Beile spalten.
|
||||
|
||||
Seht, da kommt er schleppend wieder!
|
||||
Wie ich mich nun auf dich werfe,
|
||||
Gleich, o Kobold, liegst du nieder;
|
||||
Krachend trifft die glatte Schärfe!
|
||||
Wahrlich, brav getroffen!
|
||||
Seht, er ist entzwei!
|
||||
Und nun kann ich hoffen
|
||||
Und ich atme frei!
|
||||
|
||||
Wehe! Wehe!
|
||||
Beide Teile
|
||||
Stehn in Eile
|
||||
Schon als Knechte
|
||||
Völlig fertig in die Höhe!
|
||||
Helft mir, ach! ihr hohen Mächte!
|
||||
|
||||
Und sie laufen! Nass und nässer
|
||||
Wird's im Saal und auf den Stufen.
|
||||
Welch entsetzliches Gewässer!
|
||||
Herr und Meister! Hör' mich rufen! -
|
||||
Ach, da kommt der Meister!
|
||||
Herr, die Not ist groß!
|
||||
Die ich rief, die Geister,
|
||||
Werd' ich nun nicht los.
|
||||
|
||||
In die Ecke,
|
||||
Besen! Besen!
|
||||
Seid's gewesen!
|
||||
Denn als Geister
|
||||
Ruft euch nur, zu seinem Zwecke,
|
||||
Erst hervor der alte Meister."
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
|
||||
"Die Blütenträume
|
||||
Von Faltern, wie ich hörte,
|
||||
So lautlos wie sie -"
|
||||
Reikan
|
||||
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
Johann Wolfgang Goethe
|
||||
|
||||
Der Zauberlehrling
|
||||
|
||||
Hat der alte Hexenmeister
|
||||
Sich doch einmal wegbegeben!
|
||||
Und nun sollen seine Geister
|
||||
Auch nach meinem Willen leben!
|
||||
Seine Wort' und Werke
|
||||
Merkt' ich und den Brauch,
|
||||
Und mit Geistesstärke
|
||||
Tu' ich Wunder auch.
|
||||
|
||||
Walle! Walle
|
||||
Manche Strecke,
|
||||
Dass, zum Zwecke,
|
||||
Wasser fließe
|
||||
Und mit reichem, vollem Schwalle
|
||||
Zu dem Bade sich ergieße.
|
||||
|
||||
Und nun komm, du alter Besen!
|
||||
Nimm die schlechten Lumpenhüllen!
|
||||
Bist schon lange Knecht gewesen;
|
||||
Nun erfülle meinen Willen!
|
||||
Auf zwei Beinen stehe,
|
||||
Oben sei ein Kopf,
|
||||
Eile nun und gehe
|
||||
Mit dem Wassertopf!
|
||||
|
||||
Walle! Walle
|
||||
Manche Strecke,
|
||||
Dass, zum Zwecke,
|
||||
Wasser fließe
|
||||
Und mit reichem, vollem Schwalle
|
||||
Zu dem Bade sich ergieße.
|
||||
|
||||
Seht, er läuft zum Ufer nieder;
|
||||
Wahrlich! ist schon an dem Flusse,
|
||||
Und mit Blitzesschnelle wieder
|
||||
Ist er hier mit raschem Gusse.
|
||||
Schon zum zweiten Male!
|
||||
Wie das Becken schwillt!
|
||||
Wie sich jede Schale
|
||||
Voll mit Wasser füllt!
|
||||
|
||||
Stehe! Stehe!
|
||||
Denn wir haben
|
||||
Deiner Gaben
|
||||
Voll gemessen!
|
||||
Ach, ich merk' es! Wehe! Wehe!
|
||||
Hab' ich doch das Wort vergessen!
|
||||
|
||||
Ach, das Wort, worauf am Ende
|
||||
Er das wird, was er gewesen.
|
||||
Ach, er läuft und bringt behände!
|
||||
Wärst du doch der alte Besen!
|
||||
Immer neue Güsse
|
||||
Bringt er schnell herein,
|
||||
Ach! und hundert Flüsse
|
||||
Stürzen auf mich ein.
|
||||
|
||||
Nein, nicht länger
|
||||
Kann ich's lassen;
|
||||
Will ihn fassen.
|
||||
Das ist Tücke!
|
||||
Ach! nun wird mir immer bänger!
|
||||
Welche Miene! Welche Blicke!
|
||||
|
||||
Oh, du Ausgeburt der Hölle!
|
||||
Soll das ganze Haus ersaufen?
|
||||
Seh' ich über jede Schwelle
|
||||
Doch schon Wasserströme laufen.
|
||||
Ein verruchter Besen,
|
||||
Der nicht hören will!
|
||||
Stock, der du gewesen,
|
||||
Steh doch wieder still!
|
||||
|
||||
Willst's am Ende
|
||||
Gar nicht lassen?
|
||||
Will dich fassen,
|
||||
Will dich halten
|
||||
Und das alte Holz behände
|
||||
Mit dem scharfen Beile spalten.
|
||||
|
||||
Seht, da kommt er schleppend wieder!
|
||||
Wie ich mich nun auf dich werfe,
|
||||
Gleich, o Kobold, liegst du nieder;
|
||||
Krachend trifft die glatte Schärfe!
|
||||
Wahrlich, brav getroffen!
|
||||
Seht, er ist entzwei!
|
||||
Und nun kann ich hoffen
|
||||
Und ich atme frei!
|
||||
|
||||
Wehe! Wehe!
|
||||
Beide Teile
|
||||
Stehn in Eile
|
||||
Schon als Knechte
|
||||
Völlig fertig in die Höhe!
|
||||
Helft mir, ach! ihr hohen Mächte!
|
||||
|
||||
Und sie laufen! Nass und nässer
|
||||
Wird's im Saal und auf den Stufen.
|
||||
Welch entsetzliches Gewässer!
|
||||
Herr und Meister! Hör' mich rufen! -
|
||||
Ach, da kommt der Meister!
|
||||
Herr, die Not ist groß!
|
||||
Die ich rief, die Geister,
|
||||
Werd' ich nun nicht los.
|
||||
|
||||
In die Ecke,
|
||||
Besen! Besen!
|
||||
Seid's gewesen!
|
||||
Denn als Geister
|
||||
Ruft euch nur, zu seinem Zwecke,
|
||||
Erst hervor der alte Meister."
|
|
@ -1,3 +0,0 @@
|
|||
0123456789
|
||||
0123456789
|
||||
0123456789
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -70,19 +70,16 @@ CON
|
|||
|
||||
'' Hss Master Control
|
||||
|
||||
PUB start : okay
|
||||
PUB start: okay
|
||||
|
||||
stop
|
||||
okay := cog1 := cognew(@entry, @snd_regs) + 1
|
||||
okay := cog2 := cognew(hsound, @hsnd_stack) + 1
|
||||
okay := cog1 := cognew(@entry, @snd_regs)
|
||||
okay := cog2 := cognew(hsound, @hsnd_stack)
|
||||
|
||||
PUB stop
|
||||
|
||||
if cog1
|
||||
cogstop(cog1~ - 1)
|
||||
if cog2
|
||||
cogstop(cog2~ - 1)
|
||||
|
||||
cogstop(cog2)
|
||||
cogstop(cog1)
|
||||
|
||||
PUB peek(addrptr) : var1
|
||||
|
||||
var1 := LONG[@snd_regs][addrptr]
|
||||
|
|
Binary file not shown.
Binary file not shown.
BIN
license.spin
BIN
license.spin
Binary file not shown.
Binary file not shown.
|
@ -1,11 +1,7 @@
|
|||
|
||||
<dateiname> - hss-datei wird abgespielt
|
||||
help - diese hilfe
|
||||
stop - player stopen
|
||||
pause - player pause
|
||||
reg - registerwerte anzeigen
|
||||
intreg - interface-register anzeigen
|
||||
list - trackerliste anzeigen
|
||||
rep - alle hss-dateien abspielen
|
||||
cls - bildschirm löschen
|
||||
bye - player beenden
|
||||
/? : hilfetext
|
||||
/p name.wav : hss-datei abspielen
|
||||
/d : verzeichnis abspielen
|
||||
/s : wiedergabe stoppen
|
||||
/t : anzeige trackerliste
|
||||
/r : anzeige engine-register
|
||||
/i : anzeige interface-register
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,8 @@
|
|||
sysconf
|
||||
/? : Hilfe
|
||||
/p : Konfiguration anzeigen
|
||||
/h 0|1 : hss ab-/anschalten
|
||||
/w 0|1 : wav ab-/anschalten
|
||||
/s 0|1 : systemklänge ab-/anschalten
|
||||
/? : Hilfe
|
||||
/p : Konfiguration anzeigen
|
||||
/h 0|1 : hss ab-/anschalten
|
||||
/w 0|1 : wav ab-/anschalten
|
||||
/s 0|1 : systemklänge ab-/anschalten
|
||||
/l 0..100 : wav-lautstärke links
|
||||
/r 0..100 : wav-lautstärke rechts
|
||||
/h 0..15 : hss-lautstärke
|
||||
|
|
Binary file not shown.
|
@ -1,3 +1,5 @@
|
|||
wplay
|
||||
/? : Hilfetext
|
||||
/p name.wav : WAV-Datei abspielen
|
||||
/p name.wav : WAV-Datei abspielen
|
||||
/d : Verzeichnis wiedergeben
|
||||
/l 0..100 : Lautstärke links
|
||||
/r 0..100 : Lautstärke rechts
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
bonus
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $03,$03,$FF,$0F,$02,$00,$05,$00,$FF,$01,$50,$11
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
crack
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $01,$22,$01,$0F,$11,$00,$05,$00,$55,$01,$50,$11
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
error
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $04,$01,$80,$0F,$00,$00,$00,$00,$FF,$00,$00,$80
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
exp
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $06,$04,$10,$0F,$00,$00,$00,$00,$FF,$01,$50,$11
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
wall
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $04,$FF,$FF,$0F,$01,$00,$01,$00,$FF,$06,$20,$00
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
Binary file not shown.
|
@ -30,10 +30,8 @@ pub cCog | cmd
|
|||
|
||||
bus_init
|
||||
repeat
|
||||
cmd := bus_getchar 'quittung von regnatix empfangen
|
||||
repeat until sndfx > 0 'warte bis fx gesendet werden soll
|
||||
bus_putchar(sndfx) 'sndfx-Kommando senden
|
||||
sndfx := 0
|
||||
bus_putchar(sndfx~) 'sndfx-Kommando senden
|
||||
|
||||
|
||||
CON
|
||||
|
|
|
@ -30,6 +30,8 @@ Anpassungen f
|
|||
- Auskommentierung Sound
|
||||
12-01-2010 - Soundadapter optimiert
|
||||
- Scrolltext im Titelbildschirm eingefügt
|
||||
19-04-2010 - Anpassung an TriOS: Boulder läuft jetzt auch aus dem Verzeichnis. Bedingt durch das
|
||||
neue, etwas trägere WAV-Soundsystem, habe ich einige Effekte durch HSS/SFX ersetzt.
|
||||
|
||||
Zur Hive-Version: Das Game an sich - also der ursprüngliche Basiscode aus dem Parallax-Forum - läuft
|
||||
auf einem einzigen Propellerchip! Was war zu tun um diese Version an den Hive anzupassen:
|
||||
|
@ -66,7 +68,8 @@ drohne235
|
|||
|
||||
|
||||
OBJ
|
||||
ios: "ios"
|
||||
ios : "ios"
|
||||
' debugx : "pterm" 'debug
|
||||
|
||||
CON
|
||||
|
||||
|
@ -95,16 +98,19 @@ _cover_sound = 16
|
|||
VAR
|
||||
|
||||
byte parastr[64]
|
||||
byte fl_musicon
|
||||
|
||||
PUB main | a,b,c
|
||||
PUB main | a,b,c,i,n,stradr
|
||||
|
||||
'initialisierung
|
||||
ios.start 'ios initialisieren
|
||||
' ios.startram 'code für test im ram, sollte bei bin-datei auskommentiert werden
|
||||
' ios.startram 'code für test im ram, sollte bei bin-datei auskommentiert werden
|
||||
|
||||
' debugx.start(115200)
|
||||
|
||||
ios.admsetsyssnd(0) 'systemsounds abschalten
|
||||
ios.sddmact(ios#DM_USER) 'wieder in userverzeichnis wechseln
|
||||
ios.sddmact(ios#DM_USER) 'wieder in userverzeichnis wechseln
|
||||
ios.print(string("Boulder Dash - Loading..."))
|
||||
waitcnt(clkfreq*3+cnt)
|
||||
|
||||
'bellatrix-code laden
|
||||
ios.parastart
|
||||
|
@ -113,86 +119,104 @@ PUB main | a,b,c
|
|||
|
||||
case parastr[0]
|
||||
"n":
|
||||
waitcnt(cnt + 200_000_000) 'warte bis bel fertig ist
|
||||
ios.belload(@beln) 'grafiktreiber ntsc laden
|
||||
other:
|
||||
waitcnt(cnt + 200_000_000) 'warte bis bel fertig ist
|
||||
ios.belload(@belp) 'grafiktreiber pal laden
|
||||
|
||||
'sfx-slots setzen
|
||||
ios.sfx_setslot2(@fx_moving_sound1, 0)
|
||||
ios.sfx_setslot2(@fx_moving_sound2, 1)
|
||||
ios.sfx_setslot2(@fx_boulder_sound,2)
|
||||
ios.sfx_setslot2(@fx_diamond_sound,3)
|
||||
ios.sfx_setslot2(@fx_pick_sound,4)
|
||||
ios.sfx_setslot2(@fx_explosion_sound,5)
|
||||
ios.sfx_setslot2(@fx_crack_sound,6)
|
||||
ios.sfx_setslot2(@fx_magic_sound,7)
|
||||
ios.sfx_setslot2(@fx_amoeba_sound,8)
|
||||
ios.sfx_setslot2(@fx_time_sound,9)
|
||||
ios.sfx_setslot2(@fx_bonus_sound,10)
|
||||
ios.sfx_setslot2(@fx_cover_sound,11)
|
||||
ios.sddmact(ios#DM_USER) '???
|
||||
|
||||
'sfx-slots setzen
|
||||
ios.sfx_setslot(@fx_moving_sound1, 0)
|
||||
ios.sfx_setslot(@fx_moving_sound2, 1)
|
||||
ios.sfx_setslot(@fx_boulder_sound,2)
|
||||
ios.sfx_setslot(@fx_diamond_sound,3)
|
||||
ios.sfx_setslot(@fx_pick_sound,4)
|
||||
ios.sfx_setslot(@fx_amoeba_sound,5)
|
||||
ios.sfx_setslot(@fx_time_sound,6)
|
||||
ios.sfx_setslot(@fx_cover_sound,7)
|
||||
ios.sfx_setslot(@fx_bonus,8)
|
||||
ios.sfx_setslot(@fx_crack,9)
|
||||
ios.sfx_setslot(@fx_explosion,10)
|
||||
ios.sfx_setslot(@fx_wall,11)
|
||||
|
||||
|
||||
'soundadapter
|
||||
repeat
|
||||
ios.bus_putchar2($1) 'kommando: sound abfragen
|
||||
a := ios.bus_getchar2 'soundcode einlesen
|
||||
case a
|
||||
case ios.bus_getchar2
|
||||
|
||||
_music_on: 'titelmusik
|
||||
ios.wav_play(@wav1)
|
||||
_music_off:
|
||||
ios.admsetsound(ios#SND_HSSOFF) 'hss ausschalten
|
||||
ios.admsetsound(ios#SND_WAVON) 'wav einschalten
|
||||
n := ios.wav_play(@wav1)
|
||||
fl_musicon := 1
|
||||
|
||||
_music_off:
|
||||
if fl_musicon
|
||||
ios.wav_stop
|
||||
ios.admsetsound(ios#SND_WAVOFF) 'wav ausschalten
|
||||
ios.admsetsound(ios#SND_HSSON) 'hss anschalten
|
||||
fl_musicon := 0
|
||||
|
||||
_moving_sound1:
|
||||
ios.sfx_fire(0,1)
|
||||
|
||||
_moving_sound2:
|
||||
ios.sfx_fire(1,1)
|
||||
|
||||
_boulder_sound:
|
||||
ios.sfx_fire(2,1)
|
||||
waitcnt(clkfreq / 30 + cnt)
|
||||
|
||||
_diamond_sound:
|
||||
b?
|
||||
b := b & $FF
|
||||
byte[@fx_diamond_sound+2] := b
|
||||
ios.sfx_setslot2(@fx_diamond_sound,3)
|
||||
ios.sfx_setslot(@fx_diamond_sound,3)
|
||||
ios.sfx_fire(3,1)
|
||||
waitcnt(clkfreq / 30 + cnt)
|
||||
|
||||
_pick_sound:
|
||||
ios.sfx_fire(4,2)
|
||||
waitcnt(clkfreq / 3 + cnt)
|
||||
_explosion_sound:
|
||||
ios.wav_play(@wav3) 'explosion
|
||||
waitcnt(clkfreq * 2 + cnt)
|
||||
ios.wav_stop
|
||||
_crack_sound:
|
||||
ios.wav_play(@wav4) 'eingang
|
||||
waitcnt(clkfreq * 1 + cnt)
|
||||
ios.wav_stop
|
||||
|
||||
_explosion_sound: 'explosion
|
||||
ios.sfx_fire(10,1)
|
||||
waitcnt(clkfreq * 3 + cnt)
|
||||
|
||||
_crack_sound: 'eingang
|
||||
ios.sfx_fire(9,1)
|
||||
waitcnt(clkfreq / 3 + cnt)
|
||||
|
||||
_magic_wall_sound_on:
|
||||
ios.sfx_fire(11,2)
|
||||
|
||||
_magic_wall_sound_off:
|
||||
|
||||
_amoeba_sound_on:
|
||||
ios.sfx_fire(5,2)
|
||||
|
||||
_amoeba_sound_off:
|
||||
|
||||
_time_ending_sound:
|
||||
ios.sfx_fire(9,2)
|
||||
_bonus_point_sound:
|
||||
ios.wav_play(@wav2) 'bonus
|
||||
waitcnt(clkfreq * 2 + cnt)
|
||||
ios.wav_stop
|
||||
ios.sfx_fire(6,2)
|
||||
|
||||
_bonus_point_sound: 'bonus
|
||||
ios.sfx_fire(8,2)
|
||||
waitcnt(clkfreq * 4 + cnt)
|
||||
|
||||
_cover_sound:
|
||||
b?
|
||||
b := b & $FF
|
||||
byte[@fx_cover_sound+2] := b
|
||||
ios.sfx_setslot2(@fx_cover_sound,15)
|
||||
ios.sfx_fire(15,1)
|
||||
ios.sfx_setslot(@fx_cover_sound,7)
|
||||
ios.sfx_fire(7,1)
|
||||
waitcnt(clkfreq / 30 + cnt)
|
||||
|
||||
|
||||
|
||||
DAT
|
||||
|
||||
wav1 byte "bd2.wav",0 ' titelmusik
|
||||
wav2 byte "bd3.wav",0 ' bonus
|
||||
wav3 byte "bd4.wav",0 ' boom
|
||||
wav4 byte "bd5.wav",0 ' eingang
|
||||
wav1 byte "bd.wav",0 ' titelmusik
|
||||
|
||||
beln byte "bd_ntsc.bel",0 ' bella-code, ntsc-version
|
||||
belp byte "bd_pal.bel",0
|
||||
|
@ -212,6 +236,26 @@ fx_time_sound byte $02, $05, $FF, $0F, $10, $00, $01, $00, $FF, $00
|
|||
fx_bonus_sound byte $01, $01, $80, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
||||
fx_cover_sound byte $01, $01, $80, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
||||
|
||||
fx_bonus
|
||||
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
||||
byte $03,$03,$FF,$0F,$02,$00,$05,$00,$FF,$01,$50,$11
|
||||
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
||||
|
||||
fx_crack
|
||||
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
||||
byte $01,$22,$01,$0F,$11,$00,$05,$00,$55,$01,$50,$11
|
||||
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
||||
|
||||
fx_explosion
|
||||
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
||||
byte $06,$04,$10,$0F,$00,$00,$00,$00,$FF,$01,$50,$11
|
||||
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
||||
|
||||
fx_wall
|
||||
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
||||
byte $04,$FF,$FF,$0F,$01,$00,$01,$00,$FF,$06,$20,$00
|
||||
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
||||
|
||||
|
||||
DAT
|
||||
{
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,28 +0,0 @@
|
|||
|
||||
CON
|
||||
|
||||
_CLKMODE = XTAL1 + PLL16X
|
||||
_XINFREQ = 5_000_000
|
||||
|
||||
OBJ
|
||||
ios: "ios"
|
||||
deb: "pterm"
|
||||
|
||||
PUB main | a,b,c
|
||||
|
||||
deb.Start(115200) ' Start des Debug-Terminals
|
||||
deb.Str(string(deb#cs,"Debugterminal gestartet..."))
|
||||
ios.start
|
||||
ios.startram 'code für test im ram, sollte bei bin-datei auskommentiert werden
|
||||
ios.print(string("Debugterminal gestartet..."))
|
||||
waitcnt(clkfreq*3+cnt)
|
||||
|
||||
repeat 100
|
||||
a?
|
||||
a := a & $FF
|
||||
ios.printdec(a)
|
||||
ios.print(string(" : "))
|
||||
|
||||
repeat
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD>
|
|
@ -0,0 +1,3 @@
|
|||
<EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD><0F><><EFBFBD>UUUUUU
|
|
@ -0,0 +1 @@
|
|||
UU<EFBFBD><EFBFBD>UU<EFBFBD><EFBFBD>U<EFBFBD><EFBFBD><EFBFBD>U<EFBFBD><EFBFBD><EFBFBD>U<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
@ -0,0 +1 @@
|
|||
<EFBFBD>WUU<EFBFBD>UU<EFBFBD><EFBFBD>WU<EFBFBD><EFBFBD>_U<EFBFBD><EFBFBD><EFBFBD>U<EFBFBD><EFBFBD><EFBFBD><17><><EFBFBD><17><><EFBFBD><1F><><EFBFBD>/<2F><><EFBFBD>+<2B><><EFBFBD>+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>开<EFBFBD><E5BC80><EFBFBD><EFBFBD>
|
Binary file not shown.
|
@ -0,0 +1,4 @@
|
|||
UU˙_U˙˙U˙˙W˙˙_˙˙˙˙˙˙˙˙˙˙ż˙˙Ż
|
||||
˙˙Ť
|
||||
˙˙Ş
|
||||
˙ŻŞ*żŞŞ*ŞŞŞ*ŞŞŞ*
|
|
@ -0,0 +1 @@
|
|||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Binary file not shown.
|
@ -0,0 +1,670 @@
|
|||
''LCARS tryout in XGA *
|
||||
'Trying to emulate look of this page: http://www.lcarscom.net/databank.htm
|
||||
'Copyright 2008 Raymond Allen
|
||||
|
||||
{{ ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Hive-Computer-Projekt
|
||||
|
||||
Name : StarTracker
|
||||
Chip : Bellatrix-Code (soundplayer)
|
||||
Version : 0.1
|
||||
Dateien : stint.spin
|
||||
|
||||
Beschreibung : Grafiktreiber für StarTracker
|
||||
|
||||
Eigenschaften :
|
||||
|
||||
Logbuch :
|
||||
|
||||
Kommandoliste:
|
||||
|
||||
0 1 Tastaturstatus abfragen
|
||||
0 2 Tastaturzeichen holen
|
||||
0 3 n Screensteuerzeichen
|
||||
0 3 0 CLS
|
||||
0 3 1 Home
|
||||
0 3 2 Backspace
|
||||
0 3 3 TAB
|
||||
0 3 4 n SETCUR Cursorzeichen auf n setzen
|
||||
0 3 5 POS1
|
||||
0 3 6 x SETX
|
||||
0 3 7 y SETY
|
||||
0 3 8 (x) GETX
|
||||
0 3 9 (y) GETY
|
||||
0 3 10 c SETCOL
|
||||
0 3 11 n SLINE
|
||||
0 3 13 SCREENINIT
|
||||
0 3 14 CURON
|
||||
0 3 15 CUROFF
|
||||
0 99 Reboot und neuen Treiber laden
|
||||
0 100 testfunktion
|
||||
|
||||
1..255 Zeichenausgabe
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------------------------------- }}
|
||||
|
||||
|
||||
CON
|
||||
|
||||
_clkmode = xtal1 + pll16x
|
||||
_xinfreq = 5_000_000
|
||||
|
||||
'number of custom 16x16 characters
|
||||
nuchars = (6*3+1*7+47+23*2+20*5) '!!!!! you must have the correct # here for alignment later
|
||||
|
||||
'signaldefinitionen regnatix
|
||||
|
||||
#0, D0,D1,D2,D3,D4,D5,D6,D7 'datenbus
|
||||
#8, BEL_VGABASE 'vga-signale (8pin)
|
||||
#16, BEL_KEYBC,BEL_KEYBD 'keyboard-signale
|
||||
#18, BEL_MOUSEC,BEL_MOUSED 'maus-signale
|
||||
#20, BEL_VIDBASE 'video-signale(3pin)
|
||||
#23, BEL_SELECT 'belatrix-auswahlsignal
|
||||
#24, HBEAT 'front-led
|
||||
BUSCLK 'bustakt
|
||||
BUS_WR '/wr - schreibsignal
|
||||
BUS_HS ' '/hs - quittungssignal
|
||||
|
||||
COLS = 64
|
||||
ROWS = 48
|
||||
TILES = cols * rows
|
||||
|
||||
TAB1 = 16
|
||||
TAB2 = 32
|
||||
TAB3 = 48
|
||||
SPACETILE = $8000 + $20 << 6
|
||||
|
||||
VGA_BASPORT = 8 'vga startport
|
||||
VGA_RESX = COLS * 16 'vga anzahl pixel x
|
||||
VGA_RESY = ROWS * 16 'vga anzahl pixel y
|
||||
KEYB_DPORT = BEL_KEYBD 'tastatur datenport
|
||||
KEYB_CPORT = BEL_KEYBC 'tastatur taktport
|
||||
MOUSE_DPORT = BEL_MOUSED
|
||||
MOUSE_CPORT = BEL_MOUSEC
|
||||
CURSORCHAR = $0E 'cursorzeichen
|
||||
|
||||
DB_WAIT = %00000001_00000000_00000000_00000000 'dira-wert f?r wait-status am bus
|
||||
DB_IN = %00001001_00000000_00000000_00000000 'dira-wert f?r datenbuseingabe
|
||||
DB_OUT = %00001001_00000000_00000000_11111111 'dira-wert f?r datenbusausgabe
|
||||
CNT_HBEAT = 5_000_0000 'blinkgeschw. front-led
|
||||
|
||||
|
||||
VAR
|
||||
|
||||
'variables for display
|
||||
long col, row, color, flag
|
||||
long array[tiles/2]
|
||||
long stackhb[9] 'stack f?r hbeat-cog
|
||||
byte cursor 'cursorzeichen
|
||||
byte curstat 'cursorstatus 1 = ein
|
||||
byte sline 'startzeile des scrollfensters
|
||||
byte eline 'endzeile des scrollfensters
|
||||
|
||||
'for custom characters
|
||||
word user_charbase
|
||||
|
||||
'for drawing buttons
|
||||
word ptr
|
||||
byte boxcolor
|
||||
byte sBuffer[32] 'stingpuffer
|
||||
|
||||
|
||||
OBJ
|
||||
|
||||
vga : "stvga"
|
||||
keyb : "stkeyb"
|
||||
|
||||
|
||||
PUB main | zeichen
|
||||
{{interpreter f?r hostdialog}}
|
||||
|
||||
init_subsysteme 'bus/vga/keyboard/maus initialisieren
|
||||
repeat
|
||||
zeichen := bus_getchar '1. zeichen empfangen
|
||||
if zeichen > 0
|
||||
print_char(zeichen)
|
||||
else
|
||||
zeichen := bus_getchar '2. zeichen kommando empfange
|
||||
case zeichen
|
||||
1: bus_putchar(keyb.gotkey) '1: Tastaturstatus senden
|
||||
2: bus_putchar(keyb.key) '2: Tastaturzeichen senden
|
||||
3: zeichen := bus_getchar '3: Sonderzeichen von $100 bis $1FF ausgeben
|
||||
print_char(zeichen + $100)
|
||||
|
||||
10: cmd_bitmap1
|
||||
11: cmd_fillbox
|
||||
12: cmd_drawtxt
|
||||
99: reboot '99: bellatrix neu starten
|
||||
100: gfx1
|
||||
|
||||
PUB gfx1
|
||||
|
||||
PUB cmd_bitmap1 | nBitmap,pBitmap,xPos,yPos,xSize,ySize,clr
|
||||
'Bitmap1Bit(@endcap_med_left,1,1,1,2,1)
|
||||
'Bitmap1Bit(pBitmap, xPos, yPos, xSize, ySize, clr)
|
||||
nBitmap := bus_getchar
|
||||
xPos := bus_getchar
|
||||
yPos := bus_getchar
|
||||
xSize := bus_getchar
|
||||
ySize := bus_getchar
|
||||
clr := bus_getchar
|
||||
case nBitmap
|
||||
0: pBitmap := @title
|
||||
1: pBitmap := @footer
|
||||
2: pBitmap := @button1
|
||||
3: pBitmap := @button2
|
||||
4: pBitmap := @button3
|
||||
5: pBitmap := @button4
|
||||
6: pBitmap := @button5
|
||||
7: pBitmap := @button6
|
||||
8: pBitmap := @button7
|
||||
9: pBitmap := @button8
|
||||
10: pBitmap := @button9
|
||||
11: pBitmap := @corner_topleft
|
||||
12: pBitmap := @corner_topright
|
||||
13: pBitmap := @corner_bottomLeft
|
||||
14: pBitmap := @endcap_med_left
|
||||
15: pBitmap := @endcap_med_right
|
||||
16: pBitmap := @endcap_small_left
|
||||
17: pBitmap := @endcap_small_right
|
||||
Bitmap1Bit(pBitmap, xPos, yPos, xSize, ySize, clr)
|
||||
|
||||
|
||||
PUB cmd_fillbox | left,top,width,height,clr,bBottomBreak,bRightBreak,bTrimRight
|
||||
'FillBlock(3,1,35,2,3,false,false,false)
|
||||
'FillBlock(left,top,width,height,clr,bBottomBreak,bRightBreak,bTrimRight)
|
||||
left := bus_getchar
|
||||
top := bus_getchar
|
||||
width := bus_getchar
|
||||
height := bus_getchar
|
||||
clr := bus_getchar
|
||||
bBottomBreak := bus_getchar
|
||||
bRightBreak := bus_getchar
|
||||
bTrimRight := bus_getchar
|
||||
FillBlock(left,top,width,height,clr,bBottomBreak,bRightBreak,bTrimRight)
|
||||
|
||||
PUB cmd_drawtxt | nButton,pButton,nLen,c,i
|
||||
'DrawText(@button,@string,bInvert)
|
||||
nButton := bus_getchar
|
||||
nLen := bus_getchar
|
||||
repeat i from 0 to nLen - 1
|
||||
c := bus_getchar
|
||||
sBuffer[i] := c
|
||||
sBuffer[i+1] := 0
|
||||
case nButton
|
||||
0: pButton := @title
|
||||
1: pButton := @footer
|
||||
2: pButton := @button1
|
||||
3: pButton := @button2
|
||||
4: pButton := @button3
|
||||
5: pButton := @button4
|
||||
6: pButton := @button5
|
||||
7: pButton := @button6
|
||||
8: pButton := @button7
|
||||
9: pButton := @button8
|
||||
10: pButton := @button9
|
||||
DrawText(pButton, @sBuffer,false)
|
||||
|
||||
PUB init_subsysteme
|
||||
{{initialisierung des belatrix-chips}}
|
||||
cognew(led_hbeat, @stackhb) 'heartbeat aktivieren
|
||||
bus_init 'bussignale initialisieren
|
||||
|
||||
'64 byte align the user characters
|
||||
user_charbase := @uchar & $FFC0 'destination
|
||||
'user_charbase_offset := user_charbase-@uchar
|
||||
longmove(user_charbase,@uchar,16*nuchars)
|
||||
|
||||
keyb.start(keyb_dport, keyb_cport) 'tastaturport starten
|
||||
vga.start(vga_basport, @array, @vgacolors, 0,0,0) 'vga-treiber starten
|
||||
|
||||
print_char($100) 'bildschirm l?schen
|
||||
cursor := CURSORCHAR 'cursorzeichen setzen
|
||||
curstat := 1 'cursor anschalten
|
||||
sline := 2
|
||||
eline := rows
|
||||
|
||||
PUB bus_init
|
||||
{{initialisierung des bussystems}}
|
||||
dira := db_in 'datenbus auf eingabe schalten
|
||||
outa[bus_hs] := 1 'handshake inaktiv
|
||||
|
||||
PUB bus_putchar(zeichen)
|
||||
{{ein byte ?ber bus ausgeben}}
|
||||
waitpeq(%00000010_00000000_00000000_00000000,%00000010_10000000_00000000_00000000,0) 'busclk=1? & prop2=0?
|
||||
dira := db_out 'datenbus auf ausgabe stellen
|
||||
outa[7..0] := zeichen 'daten ausgeben
|
||||
outa[bus_hs] := 0 'daten g?ltig
|
||||
waitpeq(%00000000_00000000_00000000_00000000,%00000010_00000000_00000000_00000000,0) 'busclk=0?
|
||||
'waitcnt(1_000 + cnt) 'zeit f?r master
|
||||
outa[bus_hs] := 1 'daten ung?ltig
|
||||
dira := db_in 'bus freigeben
|
||||
|
||||
PUB bus_getchar : zeichen
|
||||
{{ein byte ?ber bus empfangen}}
|
||||
waitpeq(%00000010_00000000_00000000_00000000,%00000010_10000000_00000000_00000000,0) 'busclk=1? & prop2=0?
|
||||
zeichen := ina[7..0] 'daten einlesen
|
||||
outa[bus_hs] := 0 'daten quittieren
|
||||
outa[bus_hs] := 1
|
||||
waitpeq(%00000000_00000000_00000000_00000000,%00000010_00000000_00000000_00000000,0) 'busclk=0?
|
||||
|
||||
PUB led_hbeat
|
||||
{{led_hbeat - herzschlag f?r front-led}}
|
||||
dira := db_in
|
||||
repeat
|
||||
!outa[hbeat]
|
||||
waitcnt(cnt_hbeat + cnt)
|
||||
|
||||
PUB print_str(strptr)
|
||||
{{zeichenkette auf bildschirm ausgeben}}
|
||||
repeat while byte[strptr]
|
||||
print_char(byte[strptr++])
|
||||
|
||||
|
||||
PUB print_char(c) | code,n
|
||||
{{zeichen auf bildschirm ausgeben}}
|
||||
'' Print a character
|
||||
''
|
||||
'' $0D = new line
|
||||
'' $20..$FF = character
|
||||
'' $100 = clear screen
|
||||
'' $101 = home
|
||||
'' $108 = backspace
|
||||
''$110..$11F = select color
|
||||
|
||||
case c
|
||||
|
||||
$00..$0C:
|
||||
pchar(c)
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
|
||||
$0D: 'return?
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
newline
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
|
||||
$0E..$FF: 'character?
|
||||
pchar(c)
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
|
||||
$100: 'clear screen?
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
n := sline * cols * 2
|
||||
wordfill(@array + n, spacetile, tiles - n)
|
||||
row := sline
|
||||
col := 0
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
|
||||
$101: 'home?
|
||||
row := sline
|
||||
col := 0
|
||||
|
||||
$102: 'backspace?
|
||||
if col
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
col--
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
|
||||
$103: 'tab
|
||||
if col < TAB1
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
col := TAB1
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
return
|
||||
if col < TAB2
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
col := TAB2
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
return
|
||||
if col < TAB3
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
col := TAB3
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
return
|
||||
$104: 'setcur
|
||||
code := bus_getchar
|
||||
cursor := code
|
||||
if curstat == 1
|
||||
schar(code)
|
||||
|
||||
$105: 'pos1
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
col := 0
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
|
||||
$106: 'setx
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
col := bus_getchar
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
|
||||
$107: 'sety
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
row := bus_getchar * 2 + sline '2 tiles pro zeichen!
|
||||
if curstat == 1
|
||||
schar(cursor)
|
||||
|
||||
$108: 'getx
|
||||
bus_putchar(col)
|
||||
|
||||
$109: 'gety
|
||||
bus_putchar(row / 2)
|
||||
|
||||
$110: 'setcolor
|
||||
color := bus_getchar
|
||||
|
||||
$111: 'sline
|
||||
sline := bus_getchar * 2
|
||||
|
||||
$112: 'eline
|
||||
eline := bus_getchar * 2
|
||||
|
||||
$113: 'screeninit
|
||||
wordfill(@array, spacetile, tiles)
|
||||
row := 0
|
||||
col := 0
|
||||
sline := 0
|
||||
|
||||
$114: 'curon
|
||||
curstat := 1
|
||||
schar(cursor)
|
||||
|
||||
$115: 'curoff
|
||||
if curstat == 1
|
||||
schar($20)
|
||||
curstat := 0
|
||||
|
||||
$116: 'scrollup
|
||||
scrollup
|
||||
|
||||
$130..$13F: 'select color?
|
||||
color := c & $F
|
||||
|
||||
PRI schar(c)| i,k
|
||||
'schreibt zeichen an aktuelle position ohne cursorposition zu ver?ndern
|
||||
k := color << 1 + c & 1
|
||||
i := $8000 + (c & $FE) << 6 + k
|
||||
array.word[row * cols + col] := i 'oberes tile setzen
|
||||
array.word[(row + 1) * cols + col] := i | $40 'unteres tile setzen
|
||||
|
||||
PRI pchar(c)
|
||||
'schreibt zeichen an aktuelle position z?hlt position weiter
|
||||
schar(c)
|
||||
if ++col == cols
|
||||
newline
|
||||
|
||||
PUB newline | i
|
||||
|
||||
col := 0
|
||||
if (row += 2) == rows
|
||||
row -= 2
|
||||
'scroll lines
|
||||
repeat i from sline to rows-3
|
||||
|
||||
wordmove(@array.word[i*cols], @array.word[(i+2)*cols], cols) 'wordmove(dest,src,cnt)
|
||||
'clear new line
|
||||
wordfill(@array.word[(rows-2)*cols], spacetile, cols<<1)
|
||||
|
||||
PUB scrollup | i 'scrollt den screen nach oben
|
||||
'scroll lines
|
||||
repeat i from sline to rows-3
|
||||
wordmove(@array.word[i*cols], @array.word[(i+2)*cols], cols) 'wordmove(dest,src,cnt)
|
||||
'clear new line
|
||||
wordfill(@array.word[(rows-2)*cols], spacetile, cols<<1)
|
||||
|
||||
PRI DrawText(pBmp,str,bInvert)|x1,x2,i,j,b,k,c,s
|
||||
'draw prop font into bitmap
|
||||
k:=0 'current column
|
||||
repeat s from 0 to strsize(str)-1
|
||||
c:=byte[str][s]
|
||||
if (c=>32) and (c=<(95+2)) 'note: char 96=dot, 97=degree
|
||||
x1:=word[@FontTable][c-32]
|
||||
x2:=word[@FontTable][c-32+1]
|
||||
repeat i from x1 to x2-1
|
||||
DrawFontColumn(i,j,pBmp,k,b)
|
||||
'repeat j from 0 to 31
|
||||
' b:=getFontPixel(i,j)
|
||||
' setFontPixel(pBmp,k,j,b)
|
||||
k++
|
||||
|
||||
PRI DrawFontColumn(x,y,pdest,k,b)|dtile,stile,doffset,soffset,psrc,d,pixel,j
|
||||
stile:=x/16
|
||||
soffset:=(x//16)*2
|
||||
psrc:=@font+4*16*stile+user_charbase-@uchar
|
||||
dtile:=k/16
|
||||
doffset:=(k//16)*2
|
||||
pdest+=4*16*dtile+user_charbase-@uchar
|
||||
repeat j from 0 to 31
|
||||
y:=j
|
||||
if y=>16
|
||||
y-=16
|
||||
if j==16
|
||||
soffset++
|
||||
doffset++
|
||||
pixel:=long[psrc][y//16]
|
||||
pixel>>=soffset
|
||||
pixel&=$1
|
||||
'draw
|
||||
if pixel
|
||||
long[pdest][y//16]|=|<doffset
|
||||
else
|
||||
long[pdest][y//16]&=!(|<doffset)
|
||||
|
||||
|
||||
PRI getFontPixel(x,y)|tile,offset,p,d
|
||||
'return boolean indicating state of font pixel at (x,y)
|
||||
tile:=x/16
|
||||
offset:=(x//16)*2
|
||||
|
||||
if y=>16
|
||||
offset++
|
||||
y-=16
|
||||
p:=@font+4*16*tile
|
||||
d:=long[p+user_charbase-@uchar][y//16]
|
||||
d>>=offset
|
||||
return (d&$1)>0
|
||||
|
||||
PRI setFontPixel(p,x,y,b)|tile,offset,d
|
||||
'set (b=true) or clear (b=false) pixel in bmp @p at coordinates (x,y)
|
||||
tile:=x/16
|
||||
offset:=(x//16)*2
|
||||
if y=>16
|
||||
offset++
|
||||
y-=16
|
||||
p+=4*16*tile+user_charbase-@uchar
|
||||
'd:=long[p][y//16]
|
||||
if b
|
||||
long[p][y//16]|=|<offset
|
||||
else
|
||||
long[p][y//16]&=!(|<offset)
|
||||
|
||||
|
||||
PRI FillBlock(left,top,width,height,clr,bBottomBreak,bRightBreak,bTrimRight)|x,y,p,bBottomTile
|
||||
' fill a block and optionally add break to bottom or right edges
|
||||
repeat y from top to top+height-1
|
||||
repeat x from left to left+width-1
|
||||
bBottomTile:=false
|
||||
p:=@filled_space
|
||||
if bRightBreak
|
||||
if (x==(left+width-1 ))
|
||||
p:=@hv_break
|
||||
if bBottomBreak
|
||||
bBottomTile:=true
|
||||
if y==(top+height-1)
|
||||
p:=@hv_break
|
||||
|
||||
if (bTrimRight and bBottomBreak) and (x==(left+width-1 ))
|
||||
if (y==(top+height-1))
|
||||
p:=@hv_break2
|
||||
else
|
||||
p:=@hv_break
|
||||
bBottomTile:=false
|
||||
Bitmap1BitTile(p,x,y,clr,bBottomTile)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PRI uPrint(c,ncol,nrow)
|
||||
uPrintTop(c,ncol,nrow)
|
||||
uPrintBottom(c,ncol,nrow+1)
|
||||
|
||||
PRI uPrintTop(c,ncol,nrow)|i,k
|
||||
'print top part of a character
|
||||
k := color << 1 + c & 1
|
||||
i := user_charbase + (c & $FE) << 6 + k
|
||||
array.word[nrow * cols + ncol] := i'user_charbase + (c<<6) + color'(color << 1 + c & 1) << 10 + user_charbase>>6 + c & $FE
|
||||
|
||||
PRI uPrintBottom(c,ncol,nrow)|i,k
|
||||
'print bottom part of a character
|
||||
k := color << 1 + c & 1
|
||||
i := user_charbase + (c & $FE) << 6 + k
|
||||
array.word[nrow * cols + ncol] := i+$40'user_charbase + (c<<6) + color+$40'(color << 1 + c & 1) << 10 + user_charbase>>6 + c & $FE +1
|
||||
|
||||
PRI Bitmap2Bit(pBitmap, xPos, yPos, xSize, ySize, clr)|c,i,j,BmpAddress
|
||||
row:=yPos
|
||||
col:=xPos
|
||||
c:=0
|
||||
BmpAddress:=pBitmap+user_charbase-@uchar
|
||||
repeat j from 0 to (ySize-1)
|
||||
repeat i from 0 to (xSize-1)
|
||||
array.word[row * cols + col] := BmpAddress + (c<<6) + clr
|
||||
'Print2Bit(c,clr,pBitmap)
|
||||
c++
|
||||
col++
|
||||
row++
|
||||
col:=xPos
|
||||
|
||||
|
||||
PRI Bitmap1Bit(pBitmap, xPos, yPos, xSize, ySize, clr)|c,i,j,BmpAddress
|
||||
row:=yPos
|
||||
col:=xPos
|
||||
c:=0
|
||||
BmpAddress:=pBitmap+user_charbase-@uchar
|
||||
repeat j from 0 to (ySize-1) step 2
|
||||
repeat i from 0 to (xSize-1)
|
||||
array.word[row * cols + col] := (clr<<1+1) + BmpAddress +c<<6
|
||||
if ySize<>1
|
||||
array.word[(row+1) * cols + col] := (clr<<1) + BmpAddress +c<<6
|
||||
c++
|
||||
col++
|
||||
row+=2
|
||||
col:=xPos
|
||||
|
||||
|
||||
PRI Bitmap1BitTile(pBitmap,x,y,clr,bLower)|BmpAddress
|
||||
'print just the upper or lower tile of a 2-tile bitmap
|
||||
BmpAddress:=pBitmap+user_charbase-@uchar
|
||||
clr:=clr<<1+1
|
||||
if bLower
|
||||
clr-=1
|
||||
|
||||
array.word[y * cols + x] := clr + BmpAddress
|
||||
|
||||
|
||||
DAT
|
||||
vgacolors long
|
||||
|
||||
'0..1: text color 0:
|
||||
long $90009000 'orange on black
|
||||
long $90900000
|
||||
'2..3: text color 1:
|
||||
long $5c005c00 'blue on black
|
||||
long $5c5c0000
|
||||
'4..5: text color 2:
|
||||
long $94009400 'light red on black
|
||||
long $94940000
|
||||
'6..7: text color 3:
|
||||
long $98009800 'purple on black
|
||||
long $98980000
|
||||
'8..9: text color 4:
|
||||
long $f800f800 'yellow on black
|
||||
long $f8f80000
|
||||
'10..11: text color 5:
|
||||
long $84008400 'dark red on black
|
||||
long $84840000
|
||||
|
||||
|
||||
'12: graphics 2: 'card edge colors
|
||||
long $100000FC ''green,black,black,white
|
||||
'13: graphics 3: 'red face card colors
|
||||
long $F0C000FC ' yellow,red,black,white
|
||||
'14: graphics 4: 'black face card colors
|
||||
long $F000C0FC ''yellow,black,red,white
|
||||
'15: graphics 5: button colors
|
||||
long $FC54A8A8 'lt grey, dk.gray, gray, gray
|
||||
|
||||
|
||||
FontTable word
|
||||
word 8, 16,21,32,60,72,92,107,114,121,129,138,150,156,164,170,184,195,203,214,225,239,250,261,273,284,295,300,306,316,333,343,354,378,392 'to B
|
||||
word 403,414,425,435,445,456,467,472,483,496,506,523,537,548,559,570,582,593,605,616,630,649,663,676,686,695,706,720,733,743,751 'note last two chars are dot and degree
|
||||
|
||||
padding LONG 7[16] 'alignment padding for the following user defined characters
|
||||
|
||||
uchar long
|
||||
|
||||
corner_topleft long
|
||||
file "corner_topleft.dat" '6x2
|
||||
|
||||
corner_topright long
|
||||
file "corner_topright.dat" '6x2
|
||||
|
||||
corner_bottomLeft long
|
||||
file "corner_bottomLeft.dat" '6x2
|
||||
|
||||
hv_break long
|
||||
file "hv_break.dat" '1x2
|
||||
|
||||
hv_break2 long
|
||||
file "hv_break2.dat" '1x2
|
||||
|
||||
endcap_med_left long
|
||||
file "endcap_med_left.dat" '1x2
|
||||
|
||||
endcap_med_right long
|
||||
file "endcap_med_right.dat" '1x2
|
||||
|
||||
endcap_small_left long
|
||||
file "endcap_small_left.dat" '1x2
|
||||
|
||||
endcap_small_right long
|
||||
file "endcap_small_right.dat" '1x2
|
||||
|
||||
filled_space long
|
||||
file "filled_space.dat" '1x2
|
||||
|
||||
font long
|
||||
file "font_29p5.dat" '47x2
|
||||
|
||||
title long 0[16*23] 'space for title 23x2
|
||||
footer long 0[16*23] 'space for footer 23x2
|
||||
|
||||
button1 long 0[16*20] 'space for button text 10x2
|
||||
button2 long 0[16*20] 'space for button text
|
||||
button3 long 0[16*20] 'space for button text
|
||||
button4 long 0[16*20] 'space for button text
|
||||
button5 long 0[16*20] 'space for button text
|
||||
button6 long 0[16*20] 'space for button text 10x2
|
||||
button7 long 0[16*20] 'space for button text
|
||||
button8 long 0[16*20] 'space for button text
|
||||
button9 long 0[16*20] 'space for button text
|
Binary file not shown.
|
@ -0,0 +1,470 @@
|
|||
''*****************************
|
||||
''* PS/2 Mouse Driver v1.1 *
|
||||
''* (C) 2006 Parallax, Inc. *
|
||||
''*****************************
|
||||
|
||||
' v1.0 - 01 May 2006 - original version
|
||||
' v1.1 - 01 Jun 2006 - bound coordinates added to simplify upper objects
|
||||
|
||||
|
||||
VAR
|
||||
|
||||
long cog
|
||||
|
||||
long oldx, oldy, oldz 'must be followed by parameters (10 contiguous longs)
|
||||
|
||||
long par_x 'absolute x read-only (7 contiguous longs)
|
||||
long par_y 'absolute y read-only
|
||||
long par_z 'absolute z read-only
|
||||
long par_buttons 'button states read-only
|
||||
long par_present 'mouse present read-only
|
||||
long par_dpin 'data pin write-only
|
||||
long par_cpin 'clock pin write-only
|
||||
|
||||
long bx_min, by_min, bz_min 'min/max must be contiguous
|
||||
long bx_max, by_max, bz_max
|
||||
long bx_div, by_div, bz_div
|
||||
long bx_acc, by_acc, bz_acc
|
||||
|
||||
|
||||
PUB start(dpin, cpin) : okay
|
||||
|
||||
'' Start mouse driver - starts a cog
|
||||
'' returns false if no cog available
|
||||
''
|
||||
'' dpin = data signal on PS/2 jack
|
||||
'' cpin = clock signal on PS/2 jack
|
||||
''
|
||||
'' use 100-ohm resistors between pins and jack
|
||||
'' use 10K-ohm resistors to pull jack-side signals to VDD
|
||||
'' connect jack-power to 5V, jack-gnd to VSS
|
||||
|
||||
stop
|
||||
par_dpin := dpin
|
||||
par_cpin := cpin
|
||||
okay := cog := cognew(@entry, @par_x) + 1
|
||||
|
||||
|
||||
PUB stop
|
||||
|
||||
'' Stop mouse driver - frees a cog
|
||||
|
||||
if cog
|
||||
cogstop(cog~ - 1)
|
||||
longfill(@oldx, 0, 10)
|
||||
|
||||
|
||||
PUB present : type
|
||||
|
||||
'' Check if mouse present - valid ~2s after start
|
||||
'' returns mouse type:
|
||||
''
|
||||
'' 3 = five-button scrollwheel mouse
|
||||
'' 2 = three-button scrollwheel mouse
|
||||
'' 1 = two-button or three-button mouse
|
||||
'' 0 = no mouse connected
|
||||
|
||||
type := par_present
|
||||
|
||||
|
||||
PUB button(b) : state
|
||||
|
||||
'' Get the state of a particular button
|
||||
'' returns t|f
|
||||
|
||||
state := -(par_buttons >> b & 1)
|
||||
|
||||
|
||||
PUB buttons : states
|
||||
|
||||
'' Get the states of all buttons
|
||||
'' returns buttons:
|
||||
''
|
||||
'' bit4 = right-side button
|
||||
'' bit3 = left-side button
|
||||
'' bit2 = center/scrollwheel button
|
||||
'' bit1 = right button
|
||||
'' bit0 = left button
|
||||
|
||||
states := par_buttons
|
||||
|
||||
|
||||
PUB abs_x : x
|
||||
|
||||
'' Get absolute-x
|
||||
|
||||
x := par_x
|
||||
|
||||
|
||||
PUB abs_y : y
|
||||
|
||||
'' Get absolute-y
|
||||
|
||||
y := par_y
|
||||
|
||||
|
||||
PUB abs_z : z
|
||||
|
||||
'' Get absolute-z (scrollwheel)
|
||||
|
||||
z := par_z
|
||||
|
||||
|
||||
PUB delta_reset
|
||||
|
||||
'' Reset deltas
|
||||
|
||||
oldx := par_x
|
||||
oldy := par_y
|
||||
oldz := par_z
|
||||
|
||||
|
||||
PUB delta_x : x | newx
|
||||
|
||||
'' Get delta-x
|
||||
|
||||
newx := par_x
|
||||
x := newx - oldx
|
||||
oldx := newx
|
||||
|
||||
|
||||
PUB delta_y : y | newy
|
||||
|
||||
'' Get delta-y
|
||||
|
||||
newy := par_y
|
||||
y := newy - oldy
|
||||
oldy := newy
|
||||
|
||||
|
||||
PUB delta_z : z | newz
|
||||
|
||||
'' Get delta-z (scrollwheel)
|
||||
|
||||
newz := par_z
|
||||
z := newz - oldz
|
||||
oldz := newz
|
||||
|
||||
|
||||
PUB bound_limits(xmin, ymin, zmin, xmax, ymax, zmax) | i
|
||||
|
||||
'' Set bounding limits
|
||||
|
||||
longmove(@bx_min, @xmin, 6)
|
||||
|
||||
|
||||
PUB bound_scales(x_scale, y_scale, z_scale)
|
||||
|
||||
'' Set bounding scales (usually +/-1's, bigger values divide)
|
||||
|
||||
longmove(@bx_div, @x_scale, 3)
|
||||
|
||||
|
||||
PUB bound_preset(x, y, z) | i, d
|
||||
|
||||
'' Preset bound coordinates
|
||||
|
||||
repeat i from 0 to 2
|
||||
d := ||bx_div[i]
|
||||
bx_acc[i] := (x[i] - bx_min[i]) * d + d >> 1
|
||||
|
||||
|
||||
PUB bound_x : x
|
||||
|
||||
'' Get bound-x
|
||||
|
||||
x := bound(0, delta_x)
|
||||
|
||||
|
||||
PUB bound_y : y
|
||||
|
||||
'' Get bound-y
|
||||
|
||||
y := bound(1, delta_y)
|
||||
|
||||
|
||||
PUB bound_z : z
|
||||
|
||||
'' Get bound-z
|
||||
|
||||
z := bound(2, delta_z)
|
||||
|
||||
|
||||
PRI bound(i, delta) : b | d
|
||||
|
||||
d := bx_div[i]
|
||||
b := bx_min[i] + (bx_acc[i] := bx_acc[i] + delta * (d < 0) | 1 #> 0 <# (bx_max[i] - bx_min[i] + 1) * ||d - 1) / ||d
|
||||
|
||||
|
||||
DAT
|
||||
|
||||
'***************************************
|
||||
'* Assembly language PS/2 mouse driver *
|
||||
'***************************************
|
||||
|
||||
org
|
||||
'
|
||||
'
|
||||
' Entry
|
||||
'
|
||||
entry mov p,par 'load input parameters:
|
||||
add p,#5*4 '_dpin/_cpin
|
||||
rdlong _dpin,p
|
||||
add p,#4
|
||||
rdlong _cpin,p
|
||||
|
||||
mov dmask,#1 'set pin masks
|
||||
shl dmask,_dpin
|
||||
mov cmask,#1
|
||||
shl cmask,_cpin
|
||||
|
||||
test _dpin,#$20 wc 'modify port registers within code
|
||||
muxc _d1,dlsb
|
||||
muxc _d2,dlsb
|
||||
muxc _d3,#1
|
||||
muxc _d4,#1
|
||||
test _cpin,#$20 wc
|
||||
muxc _c1,dlsb
|
||||
muxc _c2,dlsb
|
||||
muxc _c3,#1
|
||||
|
||||
movd :par,#_x 'reset output parameters:
|
||||
mov p,#5 '_x/_y/_z/_buttons/_present
|
||||
:par mov 0,#0
|
||||
add :par,dlsb
|
||||
djnz p,#:par
|
||||
'
|
||||
'
|
||||
' Reset mouse
|
||||
'
|
||||
reset mov dira,#0 'reset directions
|
||||
mov dirb,#0
|
||||
|
||||
mov stat,#1 'set reset flag
|
||||
'
|
||||
'
|
||||
' Update parameters
|
||||
'
|
||||
update movd :par,#_x 'update output parameters:
|
||||
mov p,par '_x/_y/_z/_buttons/_present
|
||||
mov q,#5
|
||||
:par wrlong 0,p
|
||||
add :par,dlsb
|
||||
add p,#4
|
||||
djnz q,#:par
|
||||
|
||||
test stat,#1 wc 'if reset flag, transmit reset command
|
||||
if_c mov data,#$FF
|
||||
if_c call #transmit
|
||||
'
|
||||
'
|
||||
' Get data packet
|
||||
'
|
||||
mov stat,#0 'reset state
|
||||
|
||||
call #receive 'receive first byte
|
||||
|
||||
cmp data,#$AA wz 'powerup/reset?
|
||||
if_z jmp #init
|
||||
|
||||
mov _buttons,data 'data packet, save buttons
|
||||
|
||||
call #receive 'receive second byte
|
||||
|
||||
test _buttons,#$10 wc 'adjust _x
|
||||
muxc data,signext
|
||||
add _x,data
|
||||
|
||||
call #receive 'receive third byte
|
||||
|
||||
test _buttons,#$20 wc 'adjust _y
|
||||
muxc data,signext
|
||||
add _y,data
|
||||
|
||||
and _buttons,#%111 'trim buttons
|
||||
|
||||
cmp _present,#2 wc 'if not scrollwheel mouse, update parameters
|
||||
if_c jmp #update
|
||||
|
||||
|
||||
call #receive 'scrollwheel mouse, receive fourth byte
|
||||
|
||||
cmp _present,#3 wz 'if 5-button mouse, handle two extra buttons
|
||||
if_z test data,#$10 wc
|
||||
if_z_and_c or _buttons,#%01000
|
||||
if_z test data,#$20 wc
|
||||
if_z_and_c or _buttons,#%10000
|
||||
|
||||
shl data,#28 'adjust _z
|
||||
sar data,#28
|
||||
sub _z,data
|
||||
|
||||
jmp #update 'update parameters
|
||||
'
|
||||
'
|
||||
' Initialize mouse
|
||||
'
|
||||
init call #receive '$AA received, receive id
|
||||
|
||||
movs crate,#100 'try to enable 3-button scrollwheel type
|
||||
call #checktype
|
||||
movs crate,#200 'try to enable 5-button scrollwheel type
|
||||
call #checktype
|
||||
shr data,#1 'if neither, 3-button type
|
||||
add data,#1
|
||||
mov _present,data
|
||||
|
||||
movs srate,#200 'set 200 samples per second
|
||||
call #setrate
|
||||
|
||||
mov data,#$F4 'enable data reporting
|
||||
call #transmit
|
||||
|
||||
jmp #update
|
||||
'
|
||||
'
|
||||
' Check mouse type
|
||||
'
|
||||
checktype movs srate,#200 'perform "knock" sequence to enable
|
||||
call #setrate '..scrollwheel and extra buttons
|
||||
|
||||
crate movs srate,#200/100
|
||||
call #setrate
|
||||
|
||||
movs srate,#80
|
||||
call #setrate
|
||||
|
||||
mov data,#$F2 'read type
|
||||
call #transmit
|
||||
call #receive
|
||||
|
||||
checktype_ret ret
|
||||
'
|
||||
'
|
||||
' Set sample rate
|
||||
'
|
||||
setrate mov data,#$F3
|
||||
call #transmit
|
||||
srate mov data,#0
|
||||
call #transmit
|
||||
|
||||
setrate_ret ret
|
||||
'
|
||||
'
|
||||
' Transmit byte to mouse
|
||||
'
|
||||
transmit
|
||||
_c1 or dira,cmask 'pull clock low
|
||||
movs napshr,#13 'hold clock for ~128us (must be >100us)
|
||||
call #nap
|
||||
_d1 or dira,dmask 'pull data low
|
||||
movs napshr,#18 'hold data for ~4us
|
||||
call #nap
|
||||
_c2 xor dira,cmask 'release clock
|
||||
|
||||
test data,#$0FF wc 'append parity and stop bits to byte
|
||||
muxnc data,#$100
|
||||
or data,dlsb
|
||||
|
||||
mov p,#10 'ready 10 bits
|
||||
transmit_bit call #wait_c0 'wait until clock low
|
||||
shr data,#1 wc 'output data bit
|
||||
_d2 muxnc dira,dmask
|
||||
mov wcond,c1 'wait until clock high
|
||||
call #wait
|
||||
djnz p,#transmit_bit 'another bit?
|
||||
|
||||
mov wcond,c0d0 'wait until clock and data low
|
||||
call #wait
|
||||
mov wcond,c1d1 'wait until clock and data high
|
||||
call #wait
|
||||
|
||||
call #receive_ack 'receive ack byte with timed wait
|
||||
cmp data,#$FA wz 'if ack error, reset mouse
|
||||
if_nz jmp #reset
|
||||
|
||||
transmit_ret ret
|
||||
'
|
||||
'
|
||||
' Receive byte from mouse
|
||||
'
|
||||
receive test _cpin,#$20 wc 'wait indefinitely for initial clock low
|
||||
waitpne cmask,cmask
|
||||
receive_ack
|
||||
mov p,#11 'ready 11 bits
|
||||
receive_bit call #wait_c0 'wait until clock low
|
||||
movs napshr,#16 'pause ~16us
|
||||
call #nap
|
||||
_d3 test dmask,ina wc 'input data bit
|
||||
rcr data,#1
|
||||
mov wcond,c1 'wait until clock high
|
||||
call #wait
|
||||
djnz p,#receive_bit 'another bit?
|
||||
|
||||
shr data,#22 'align byte
|
||||
test data,#$1FF wc 'if parity error, reset mouse
|
||||
if_nc jmp #reset
|
||||
and data,#$FF 'isolate byte
|
||||
|
||||
receive_ack_ret
|
||||
receive_ret ret
|
||||
'
|
||||
'
|
||||
' Wait for clock/data to be in required state(s)
|
||||
'
|
||||
wait_c0 mov wcond,c0 '(wait until clock low)
|
||||
|
||||
wait mov q,tenms 'set timeout to 10ms
|
||||
|
||||
wloop movs napshr,#18 'nap ~4us
|
||||
call #nap
|
||||
_c3 test cmask,ina wc 'check required state(s)
|
||||
_d4 test dmask,ina wz 'loop until got state(s) or timeout
|
||||
wcond if_never djnz q,#wloop '(replaced with c0/c1/c0d0/c1d1)
|
||||
|
||||
tjz q,#reset 'if timeout, reset mouse
|
||||
wait_ret
|
||||
wait_c0_ret ret
|
||||
|
||||
|
||||
c0 if_c djnz q,#wloop '(if_never replacements)
|
||||
c1 if_nc djnz q,#wloop
|
||||
c0d0 if_c_or_nz djnz q,#wloop
|
||||
c1d1 if_nc_or_z djnz q,#wloop
|
||||
'
|
||||
'
|
||||
' Nap
|
||||
'
|
||||
nap rdlong t,#0 'get clkfreq
|
||||
napshr shr t,#18/16/13 'shr scales time
|
||||
min t,#3 'ensure waitcnt won't snag
|
||||
add t,cnt 'add cnt to time
|
||||
waitcnt t,#0 'wait until time elapses (nap)
|
||||
|
||||
nap_ret ret
|
||||
'
|
||||
'
|
||||
' Initialized data
|
||||
'
|
||||
dlsb long 1 << 9
|
||||
tenms long 10_000 / 4
|
||||
signext long $FFFFFF00
|
||||
'
|
||||
'
|
||||
' Uninitialized data
|
||||
'
|
||||
dmask res 1
|
||||
cmask res 1
|
||||
stat res 1
|
||||
data res 1
|
||||
p res 1
|
||||
q res 1
|
||||
t res 1
|
||||
|
||||
_x res 1 'write-only
|
||||
_y res 1 'write-only
|
||||
_z res 1 'write-only
|
||||
_buttons res 1 'write-only
|
||||
_present res 1 'write-only
|
||||
_dpin res 1 'read-only
|
||||
_cpin res 1 'read-only
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue