home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
476-500
/
apd483
/
copper-paintv2_1.amos
/
copper-paintv2_1.amosSourceCode
Wrap
AMOS Source Code
|
1991-03-05
|
10KB
|
499 lines
' Copper-Paint(V2.1)
'
' By
'
' Storm-coder
' (Cedric Curinier)
' Coded with Amos on ??/1992
'
'
'--------initialisation-------
'
On Error Proc INIBERROR
Resume Label BLP
Volume(10)
'
B=15 : AFF=1 : V=15 : R=15 : VN=4095 : OVN=0 : DDEP=-1
Dim CO(271)
Screen Open 0,320,270,8,Lowres
Screen Display 0,130,35,,
Curs Off : Flash Off
Colour 7,$FFF
Colour 5,$0
Limit Mouse 128,35 To 448,305
Paper 2 : Change Mouse 2
Cls 0
Colour 2,$0
Ink 2
Bar 275,0 To 305,30
Ink 5
Bar 280,5 To 300,25
Ink 7
Bar 285,10 To 295,20
Set Rainbow 0,0,271,"","",""
'
'******Prog. principal*******
'
BLP:
Pen 4
Colour 7,VN
Colour 5,OVN
A$=Inkey$
If A$<>"" Then Goto CHC
If Mouse Key=1
NPM=NPM+1
If NPM<2
Gosub MJ
End If
Goto LPBC
End If
If Mouse Key=2
NPM=NPM+1
If NPM<2
Gosub MJ
End If
Goto RPBC
End If
NPM=0
Pen 6
XM=X Screen(X Mouse) : YM=Y Screen(Y Mouse)
If AFF=1 Then Locate 1,30 : Print XM;YM;" ";
If AFF=1 and DDEP>-1 Then PASS=0 : Print "Y Start gradation:";DDEP;" "
If DDEP=-1 and PASS=0 Then Paper 0 : Print " " : Inc PASS
If AFF=1 and X Text(XM)>0 and Y Text(YM)>0
Locate 1,31 : Print " X text";X Text(XM);" Y text";Y Text(YM);" "
End If
Paper 2
Goto BLP
'
'******* Test Pav� numerique *******
CHC:
If A$="7" Then R=R+1
If A$="4" Then R=R-1
If A$="8" Then V=V+1
If A$="5" Then V=V-1
If A$="9" Then B=B+1
If A$="6" Then B=B-1
If A$="1" Then R=0
If A$="2" Then V=0
If A$="3" Then B=0
If A$="[" Then R=15
If A$="]" Then V=15
If A$="/" Then B=15
If A$="." Then B=15 : R=15 : V=15
If A$="0" Then B=0 : R=0 : V=0
'
'******** CONTROL Couleurs ******
'
If R>15 Then R=15
If V>15 Then V=15
If B>15 Then B=15
If R<0 Then R=0
If V<0 Then V=0
If B<0 Then B=0
'
'--------Autres fonctions-----------
'
If A$="s" Then Gosub MJ : Goto PRCH
Goto PPRCH
PRCH:
CFSEL["Save a Copper-Paint picture"]
F$=Param$
If F$="" Then Goto PPRCH
If Exist(F$)
Bell 4
CSCREEN
Print "Picture:" : Print : Centre F$
Print : Centre "already existe !!!" : Print
Input "Overwrite it (y/n)";RR$
Screen Close 1
If Upper$(RR$)="Y"
Goto SPS
End If
Goto PPRCH
End If
SPS:
Open Out 1,F$
For T=0 To 269
Print #1,CO(T)
Next
Close 1
'
PPRCH:
'
If A$="l" Then Goto PRCH1
Goto PPRCH1
PRCH1:
CFSEL["Load a Copper-Paint picture"]
F$=Param$
If F$="" Then Goto PPRCH1
If Exist(F$)=False Then Bell 4 : Goto PPRCH1
Open In 1,F$
For T=0 To 269
Input #1,CO(T)
Next
Close 1
For T=0 To 269
Rain(0,T)=CO(T)
Rainbow 0,0,35,271
Next
'
PPRCH1:
If A$="d"
CSCREEN
Print
Centre Str$(Dfree)+" Bytes free" : Print
If Dfree<1900
Centre "DISC is Full !"
End If
If Dfree>1899
NICP=Dfree/1900
Centre "Can save" : Print
Print " a minimum of";NICP;" pictures"
End If
Wait 145 : Screen Close 1
End If
If A$="n"
CSCREEN
Print : Centre F$
Wait 120 : Screen Close 1
End If
If A$="a" Then DDEP=-1
If A$="c" Then Gosub PCLS
If A$="q"
CSCREEN
Centre "QUIT !" : Print : Print "Are yous sure ?" : Input "(y/n):";RR$
Screen Close 1
If Upper$(RR$)="Y"
CEND
End If
End If
If A$="u" Then Gosub PUNDO
If A$="k"
CKILL
If Param$<>""
CSCREEN
Centre "Are you sure" : Print
Centre "I must kill" : Print
Centre Param$+"?" : Print
Input "(y/n)";RR$
Screen Close 1
If Upper$(RR$)="Y"
Kill Param$
End If
End If
End If
If A$="m" Then CMKDIR : If Param=1 Then Mkdir "df0:Copper-pics"
If A$="e" Then Swap OV,V : Swap OB,B : Swap VN,OVN : Swap OLR,R
YPM=Y Mouse-35
'--------------------FONCTIONS PICK---------------------
If A$="p" Then Goto TPP
Goto ZPP
TPP:
TPM=Rain(0,YPM)
TPM$=Hex$(TPM)
If Len(TPM$)=3 Then R=0 : Goto TPP1
If Len(TPM$)=2 Then R=0 : V=0 : Goto TPP2
R$=Left$(TPM$,2)
R$=Right$(R$,1)
A$=R$
CONVDEC[A$]
R=Param
TPP1:
V$=Right$(TPM$,2)
V$=Left$(V$,1)
A$=V$
CONVDEC[A$]
V=Param
TPP2:
B$=Right$(TPM$,1)
A$=B$
CONVDEC[A$]
B=Param
ZPP:
If A$="P" Then OVN=Rain(0,YPM) : Goto TPPP
Goto ZPPP
TPPP:
TPM=Rain(0,YPM)
TPM$=Hex$(TPM)
If Len(TPM$)=3 Then OLR=0 : Goto TPPP1
If Len(TPM$)=2 Then OLR=0 : OV=0 : Goto TPPP2
R$=Left$(TPM$,2)
R$=Right$(R$,1)
A$=R$
CONVDEC[A$]
OLR=Param
TPPP1:
V$=Right$(TPM$,2)
V$=Left$(V$,1)
A$=V$
CONVDEC[A$]
OV=Param
TPPP2:
B$=Right$(TPM$,1)
A$=B$
CONVDEC[A$]
OB=Param
ZPPP:
'
If Scancode=95
CSCREEN
For T=1 To 5
Bell T*2
Read T$
Centre T$
Print
Wait 50
Next
Wait 150
Boom
Screen Close 1
Restore TCRED
TCRED:
Data "For more or updates Write to:"
Data "Cedric Curinier"
Data "Chemin des Ratz"
Data "38330 Saint Nazaire Les Eymes"
Data "France"
End If
'
If Scancode=89
AFF=-AFF
Paper 0
Ink 0 : Bar 275,0 To 305,30
If AFF=1
Ink 2
Bar 275,0 To 305,30
Ink 5
Bar 280,5 To 300,25
Ink 7
Bar 285,10 To 295,20
End If
Locate 0,1 : Print Space$(34)
Locate 0,30 : Print Space$(30)
Locate 0,31 : Print Space$(30)
Locate 0,2 : Print Space$(16)
Paper 2
End If
'
'/\/\/\/\/\-Affichages en tous Genres-/\/\/\/\/\
'
NR=256*R : NV=16*V : NB=B
If AFF=1 Then Locate 0,1 : Print R;" ";V;" ";B;" "
VN=NR+NV+NB
If AFF=1
Locate 18,1 : Print VN;" "
Locate 0,2 : Print " Hex:";Hex$(VN);" "
End If
Goto BLP
'
'******************* Sous PROGS. *****************
'
'
' /\/\-Tests souris-/\/\
'--------L mouse-------
LPBC:
C=Y Mouse-35
Rain(0,C)=VN
Rainbow 0,0,35,271
Goto CHC
'---------R mouse------------
'------D�but de d�grad�------
RPBC:
C=Y Mouse-35
If DDEP=-1
DDEP=C
Goto CHC
End If
'-----Cr�ation du d�grad�----
If C=DDEP Then Goto CHC
DV#=V-OV : DB#=B-OB : DR#=R-OLR : DPOS=C-DDEP
DPV#=OV : DPB#=OB : DPR#=OLR
For VD=DDEP To C Step Sgn(DPOS)
DPV#=DPV#+DV#/Abs(DPOS) : DPB#=DPB#+DB#/Abs(DPOS) : DPR#=DPR#+DR#/Abs(DPOS)
DPV2=DPV# : DPB2=DPB# : DPR2=DPR#
DCOL=256*DPR2+16*DPV2+DPB2
Rain(0,VD)=DCOL
Rainbow 0,0,35,271
Next
DDEP=-1
Goto CHC
'
' /\/\ Mise a Jour des Co(*) /\/\
MJ:
For C1=0 To 269
CO(C1)=Rain(0,C1)
Next
Return
'
' /\/\/\ Undo /\/\/\
PUNDO:
For C1=0 To 269
OCO=Rain(0,C1)
Rain(0,C1)=CO(C1)
CO(C1)=OCO
Next
Rainbow 0,0,35,271
Return
'
' /\/\ CLS /\/\
PCLS:
For C1=0 To 269
CO(C1)=Rain(0,C1)
Rain(0,C1)=0
Next
Rainbow 0,0,35,271
ALTN=5
Return
'
'****************** Procedures ! ! ! ******************
'
' KIll
'
Procedure CKILL
F$=Fsel$("Copper-pics/*.CO",".CO","DELETE a Copper-Paint picture")
If F$="" Then Goto ZBA
If Exist(F$)=False Then Bell 4 : F$=""
ZBA:
End Proc[F$]
'
' CONVDEC
'
Procedure CONVDEC[A$]
If A$="A" Then A=10
If A$="B" Then A=11
If A$="C" Then A=12
If A$="D" Then A=13
If A$="E" Then A=14
If A$="F" Then A=15
If A=0 Then A=Val(A$)
A$=Str$(A)
End Proc[A]
'
' MKDIR
'
Procedure CMKDIR
Clear Key
Screen Open 1,320,100,4,Lowres
Colour 1,$0 : Colour 3,$FFF
Curs Off : Flash Off
Paper 1 : Cls : Pen 3
F$="df0:Copper-pics"
Print
Centre "Making Dir ..."
Wait 60
Print : Print
If Exist(F$)=False
TTT=1
Goto TTC
End If
Bell 1
Print : Bell 1 : Centre "ERROR" : Wait 40
Centre "Directory already on disc." : Wait 50 : Bell 18 : Wait 40
TTC:
Screen Close 1
End Proc[TTT]
'
' ERROR
'
Procedure INIBERROR
Clear Key
Screen Open 1,320,150,4,Lowres
Screen Display 1,135,35,,
Colour 1,$0
Colour 3,$F00
Curs Off : Flash Off
Paper 1 : Cls : Pen 3
Bell 3
Print : Centre "ERROR ! ! !"
Wait 10
Print : Centre "Analysing !" : Wait 30 : Print : Print
If Errn=24
Print "Memory full !"
Print "I free a few bytes !!!" : Close Workbench : Close Editor
DED=1
End If
If Errn=11
Print "Only";Free;" Bytes free"
Print "for variables"
DED=1
End If
If Errn=92
Print "This disc has:"
Print "a SPECIAL Protection"
Print "or"
Print "It's too much old"
Print "not a DOS format !"
DED=1
End If
If Errn=88
Print "Disc Full" : Print "change it !"
DED=1
End If
If Errn=84
Print "Disc Write Protected" : Print "make it write enable."
DED=1
End If
If Errn=83
Print "Disc not validated"
Print " test it"
Print "with a VIRUS-killer:"
Print "LE LAMER-exterminator."
Print "or use diskdoctor"
Print "Change it !!!"
DED=1
End If
If Errn=34 Then Print "Not a Copper-paint picture !" : DED=1
If Errn=89 or Errn=90
Print "File seems to"
Print "be protected !!!"
DED=1
End If
If Errn=93
Print "Drive is empty !!!" : Print "Insert disc !"
DED=1
End If
If Errn=94
Print "Disc is unreadable !!!"
Print "I/O Error !!!"
DED=1
End If
If DED=0
For T=0 To 800
Colour 1,T
Locate 17,5 : Print Hex$(T)
Inc Z
Next
Print "Error N�";Errn
Print "Can't understand it ! ! !"
Input "continue ? (y/n):";RR$
End If
If Upper$(RR$)="N" Then CEND
Wait 150
Screen Close 1
Resume Label
End Proc
'
' Fsel
'
Procedure CFSEL[A$]
F$=Fsel$("Copper-pics/*.CO",".CO",A$)
End Proc[F$]
'
' End
'
Procedure CEND
Amos To Back
For T=1 To 10000
Poke Rnd(8000),Rnd(255)
Next
End Proc
'
' Sys screen
'
Procedure CSCREEN
Screen Open 1,300,50,4,Lowres : Flash Off : Curs Off
Colour 1,$0 : Colour 3,$DDD : Cls 1
Pen 3
Screen Display 1,150,100,,
End Proc