Code:
$regfile = "m32def.dat"
$crystal = 16000000
$framesize = 64
$swstack = 64
$hwstack = 64
Config Timer0 = Timer , Prescale = 256
On Timer0 Timer_irq
Enable Timer0
Enable Interrupts
Config Porta = Output
Config Portb = Output
Config Portc = Output
Config Portd = Output
Porta = 255
Portb = 255
Portc = 255
Portd = 255
Dim Ebene1_long As Long At $60
Dim Ebene1(4) As Byte At $60 Overlay
Dim Ebene2_long As Long At $64
Dim Ebene2(4) As Byte At $64 Overlay
Dim Ebene3_long As Long At $68
Dim Ebene3(4) As Byte At $68 Overlay
Dim Ebene4_long As Long At $6c
Dim Ebene4(4) As Byte At $6c Overlay
Dim Ebene5_long As Long At $70
Dim Ebene5(4) As Byte At $70 Overlay
Dim Ebene_seite As Bit
Dim Ebene As Byte
Ebene = 1
Dim Temp_byte As Byte
Dim Wait_ms As Byte
Dim I As Byte
Dim J As Byte
Declare Sub Auf_ab
Declare Sub Rundherum
Declare Sub Vorne_hinten
Declare Sub Rechts_links
Declare Sub Quadrat
Declare Sub Scheibe_rotieren
Declare Sub Tropfen
Declare Sub Pyramide
Declare Sub Rotieren_waagrecht
Do
Wait_ms = 200
Gosub Tropfen
Wait_ms = 200
Gosub Tropfen
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms 1100
Wait_ms = 50
Auf_ab '9
Waitms 950
Wait_ms = 50
Auf_ab
Waitms 300
Wait_ms = 50
Auf_ab
Waitms 1050
Wait_ms = 50
Auf_ab
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms 1000
Wait_ms = 100 '17
Gosub Rundherum
Gosub Rundherum
Wait_ms = 100
Gosub Scheibe_rotieren '4
Gosub Scheibe_rotieren
Gosub Scheibe_rotieren
Gosub Scheibe_rotieren
Gosub Scheibe_rotieren
Gosub Scheibe_rotieren
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms 300
Wait_ms = 20
Gosub Rechts_links
Wait_ms = 20
Gosub Rechts_links
Waitms 300
Wait_ms = 20
Gosub Rechts_links
Wait_ms = 20
Gosub Rechts_links
Waitms 300
Wait_ms = 20
Gosub Rechts_links
Wait_ms = 20
Gosub Rechts_links
Waitms 300
Wait_ms = 20
Gosub Auf_ab
Wait_ms = 20
Gosub Auf_ab
Waitms 300
Wait_ms = 20
Gosub Auf_ab
Wait_ms = 20
Gosub Auf_ab
Waitms 300
Wait_ms = 20
Gosub Auf_ab
Wait_ms = 20
Gosub Auf_ab
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms 500
Wait_ms = 100
Gosub Quadrat
Wait_ms = 100
Gosub Quadrat
Wait_ms = 100
Gosub Quadrat
Wait_ms = 100
Gosub Quadrat
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms 500
Wait_ms = 20
Gosub Auf_ab
Wait_ms = 20
Gosub Auf_ab
Waitms 300
Wait_ms = 20
Gosub Auf_ab
Wait_ms = 20
Gosub Auf_ab
Waitms 300
Wait_ms = 20
Gosub Auf_ab
Wait_ms = 20
Gosub Auf_ab
Waitms 300
Wait_ms = 20
Gosub Rechts_links
Wait_ms = 20
Gosub Rechts_links
Waitms 300
Wait_ms = 20
Gosub Rechts_links
Wait_ms = 20
Gosub Rechts_links
Waitms 300
Wait_ms = 20
Gosub Rechts_links
Wait_ms = 20
Gosub Rechts_links
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms 500
Wait_ms = 80
Gosub Pyramide
Waitms 200
Gosub Pyramide
Waitms 200
Gosub Pyramide
Waitms 200
Gosub Pyramide
Waitms 200
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms 300
End
Loop
Timer_irq:
Timer0 = 150
Porta = 255
Portb = 255
Portc = 255
Portd = 255
Toggle Ebene_seite
If Ebene_seite = 1 Then
If Ebene = 1 Then
Portb = Not Ebene1(1)
Temp_byte = Ebene1(2) And &B11111000
Porta = Not Temp_byte
Portc = 255
Portd = 255
Portd.2 = 0
End If
If Ebene = 2 Then
Portb = Not Ebene2(1)
Temp_byte = Ebene2(2) And &B11111000
Porta = Not Temp_byte
Portc = 255
Portd = 255
Portd.3 = 0
End If
If Ebene = 3 Then
Portb = Not Ebene3(1)
Temp_byte = Ebene3(2) And &B11111000
Porta = Not Temp_byte
Portc = 255
Portd = 255
Portd.4 = 0
End If
If Ebene = 4 Then
Portb = Not Ebene4(1)
Temp_byte = Ebene4(2) And &B11111000
Porta = Not Temp_byte
Portc = 255
Portd = 255
Portd.5 = 0
End If
If Ebene = 5 Then
Portb = Not Ebene5(1)
Temp_byte = Ebene5(2) And &B11111000
Porta = Not Temp_byte
Portc = 255
Portd = 255
Portd.6 = 0
End If
End If
If Ebene_seite = 0 Then
If Ebene = 1 Then
Portb = 255
Temp_byte = Ebene1(2) And &B00000111
Porta = Not Temp_byte
Portc = Not Ebene1(3)
Temp_byte = Ebene1(4)
Rotate Temp_byte , Right
Temp_byte = Temp_byte And &B10000000
Portd = Not Temp_byte
Portd.2 = 0
End If
If Ebene = 2 Then
Portb = 255
Temp_byte = Ebene2(2) And &B00000111
Porta = Not Temp_byte
Portc = Not Ebene2(3)
Temp_byte = Ebene2(4)
Rotate Temp_byte , Right
Temp_byte = Temp_byte And &B10000000
Portd = Not Temp_byte
Portd.3 = 0
End If
If Ebene = 3 Then
Portb = 255
Temp_byte = Ebene3(2) And &B00000111
Porta = Not Temp_byte
Portc = Not Ebene3(3)
Temp_byte = Ebene3(4)
Rotate Temp_byte , Right
Temp_byte = Temp_byte And &B10000000
Portd = Not Temp_byte
Portd.4 = 0
End If
If Ebene = 4 Then
Portb = 255
Temp_byte = Ebene4(2) And &B00000111
Porta = Not Temp_byte
Portc = Not Ebene4(3)
Temp_byte = Ebene4(4)
Rotate Temp_byte , Right
Temp_byte = Temp_byte And &B10000000
Portd = Not Temp_byte
Portd.5 = 0
End If
If Ebene = 5 Then
Portb = 255
Temp_byte = Ebene5(2) And &B00000111
Porta = Not Temp_byte
Portc = Not Ebene5(3)
Temp_byte = Ebene5(4)
Rotate Temp_byte , Right
Temp_byte = Temp_byte And &B10000000
Portd = Not Temp_byte
Portd.6 = 0
End If
Incr Ebene
If Ebene = 6 Then Ebene = 1
End If
Return
Sub Auf_ab
Ebene1_long = &B11111111111111111111111111111111
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms Wait_ms
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B11111111111111111111111111111111
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms Wait_ms
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B11111111111111111111111111111111
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms Wait_ms
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B11111111111111111111111111111111
Ebene5_long = &B00000000000000000000000000000000
Waitms Wait_ms
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B11111111111111111111111111111111
Waitms Wait_ms
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B11111111111111111111111111111111
Ebene5_long = &B00000000000000000000000000000000
Waitms Wait_ms
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B11111111111111111111111111111111
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms Wait_ms
Ebene1_long = &B00000000000000000000000000000000
Ebene2_long = &B11111111111111111111111111111111
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms Wait_ms
Ebene1_long = &B11111111111111111111111111111111
Ebene2_long = &B00000000000000000000000000000000
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000000000000000000000000000000
Ebene5_long = &B00000000000000000000000000000000
Waitms Wait_ms
End Sub
Sub Rundherum
Ebene1_long = 1
Ebene2_long = 1
Ebene3_long = 1
Ebene4_long = 1
Ebene5_long = 1
For I = 1 To 4
Waitms Wait_ms
Rotate Ebene1_long , Left
Rotate Ebene2_long , Left
Rotate Ebene3_long , Left
Rotate Ebene4_long , Left
Rotate Ebene5_long , Left
Next
For I = 1 To 4
Waitms Wait_ms
Rotate Ebene1_long , Left , 5
Rotate Ebene2_long , Left , 5
Rotate Ebene3_long , Left , 5
Rotate Ebene4_long , Left , 5
Rotate Ebene5_long , Left , 5
Next
For I = 1 To 4
Waitms Wait_ms
Rotate Ebene1_long , Right
Rotate Ebene2_long , Right
Rotate Ebene3_long , Right
Rotate Ebene4_long , Right
Rotate Ebene5_long , Right
Next
For I = 1 To 4
Waitms Wait_ms
Rotate Ebene1_long , Right , 5
Rotate Ebene2_long , Right , 5
Rotate Ebene3_long , Right , 5
Rotate Ebene4_long , Right , 5
Rotate Ebene5_long , Right , 5
Next
End Sub
Sub Vorne_hinten
Ebene1_long = &B00000000000000000000000000011111
Ebene2_long = &B00000000000000000000000000011111
Ebene3_long = &B00000000000000000000000000011111
Ebene4_long = &B00000000000000000000000000011111
Ebene5_long = &B00000000000000000000000000011111
For J = 1 To 4
Waitms Wait_ms
Rotate Ebene1_long , Left , 5
Rotate Ebene2_long , Left , 5
Rotate Ebene3_long , Left , 5
Rotate Ebene4_long , Left , 5
Rotate Ebene5_long , Left , 5
Next
For J = 1 To 4
Waitms Wait_ms
Rotate Ebene1_long , Right , 5
Rotate Ebene2_long , Right , 5
Rotate Ebene3_long , Right , 5
Rotate Ebene4_long , Right , 5
Rotate Ebene5_long , Right , 5
Next
End Sub
Sub Rechts_links
Ebene1_long = &B00000010000100001000010000100001
Ebene2_long = &B00000010000100001000010000100001
Ebene3_long = &B00000010000100001000010000100001
Ebene4_long = &B00000010000100001000010000100001
Ebene5_long = &B00000010000100001000010000100001
For J = 1 To 4
Waitms Wait_ms
Rotate Ebene1_long , Left , 1
Rotate Ebene2_long , Left , 1
Rotate Ebene3_long , Left , 1
Rotate Ebene4_long , Left , 1
Rotate Ebene5_long , Left , 1
Next
For J = 1 To 4
Waitms Wait_ms
Rotate Ebene1_long , Right , 1
Rotate Ebene2_long , Right , 1
Rotate Ebene3_long , Right , 1
Rotate Ebene4_long , Right , 1
Rotate Ebene5_long , Right , 1
Next
End Sub
Sub Quadrat
Ebene1_long = &B00000000000000000000000001100011
Ebene2_long = &B00000000000000000000000001100011
Ebene3_long = &B00000000000000000000000000000000
Ebene4_long = &B00000001100011000000000000000000
Ebene5_long = &B00000001100011000000000000000000
For J = 1 To 3
Waitms Wait_ms
Rotate Ebene1_long , Left , 1
Rotate Ebene2_long , Left , 1
Rotate Ebene3_long , Left , 1
Rotate Ebene4_long , Right , 1
Rotate Ebene5_long , Right , 1
Next
For J = 1 To 3
Waitms Wait_ms
Rotate Ebene1_long , Left , 5
Rotate Ebene2_long , Left , 5
Rotate Ebene3_long , Left , 5
Rotate Ebene4_long , Right , 5
Rotate Ebene5_long , Right , 5
Next
For J = 1 To 3
Waitms Wait_ms
Rotate Ebene1_long , Right , 1
Rotate Ebene2_long , Right , 1
Rotate Ebene3_long , Right , 1
Rotate Ebene4_long , Left , 1
Rotate Ebene5_long , Left , 1
Next
For J = 1 To 3
Waitms Wait_ms
Rotate Ebene1_long , Right , 5
Rotate Ebene2_long , Right , 5
Rotate Ebene3_long , Right , 5
Rotate Ebene4_long , Left , 5
Rotate Ebene5_long , Left , 5
Next
End Sub
Sub Scheibe_rotieren
Ebene1_long = &B00000000010000100001000010000100
Ebene2_long = &B00000000010000100001000010000100
Ebene3_long = &B00000000010000100001000010000100
Ebene4_long = &B00000000010000100001000010000100
Ebene5_long = &B00000000010000100001000010000100
Waitms Wait_ms
Ebene1_long = &B00000000000100010001000100010000
Ebene2_long = &B00000000000100010001000100010000
Ebene3_long = &B00000000000100010001000100010000
Ebene4_long = &B00000000000100010001000100010000
Ebene5_long = &B00000000000100010001000100010000
Waitms Wait_ms
Ebene1_long = &B00000000000000000111110000000000
Ebene2_long = &B00000000000000000111110000000000
Ebene3_long = &B00000000000000000111110000000000
Ebene4_long = &B00000000000000000111110000000000
Ebene5_long = &B00000000000000000111110000000000
Waitms Wait_ms
Ebene1_long = &B00000001000001000001000001000001
Ebene2_long = &B00000001000001000001000001000001
Ebene3_long = &B00000001000001000001000001000001
Ebene4_long = &B00000001000001000001000001000001
Ebene5_long = &B00000001000001000001000001000001
Waitms Wait_ms
End Sub
gruss Bluesmash
Lesezeichen