Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An MS paint clone written in 1996.
'PAINT.BAS by Tony Lieuallen .99f 3/4/96 -
'$DYNAMIC
DEFINT A-Z
COMMON SHARED Mx, My, LBut, RBut, FColor, BColor, Tool, Sides
COMMON SHARED FilName$
TYPE RegType
ax AS INTEGER
bx AS INTEGER
cx AS INTEGER
dx AS INTEGER
bp AS INTEGER
si AS INTEGER
di AS INTEGER
flags AS INTEGER
END TYPE
DECLARE SUB Interrupt (intnum, reg1 AS RegType, reg2 AS RegType)
DECLARE SUB MSetRange (x0, y0, X1, Y1)
DECLARE SUB MGetLoc (Mx, My)
DECLARE SUB Minit ()
DECLARE SUB MButton (LBut, RBut, My, Mx, BBut)
DECLARE SUB MShowCurs ()
DECLARE SUB MHideCurs ()
DECLARE SUB GPrint (Txt$, X, Y, Style)
DECLARE SUB MDefGrfCurs (Shape$(), HotX, HotY)
DECLARE SUB MSetLoc (My, Mx)
DECLARE SUB GraphColor (Clr)
DECLARE SUB GLineEdit (Txt$, X, Y, Style, Options, KeyCode)
DECLARE FUNCTION MRange (x0, y0, X1, Y1, Mx, My)
DECLARE SUB CustomCursor (FileNum)
DECLARE SUB DrawingTools ()
DECLARE SUB FileLoad ()
DECLARE SUB FileSave ()
DECLARE SUB Icon (X, Y, Wid, High, Title$)
DECLARE SUB InitScreen ()
DECLARE SUB PrintCoords ()
DECLARE SUB PutPic (X, Y, Pic$)
DECLARE SUB TeaseScreen ()
SCREEN 8, , 0, 0
'$INCLUDE: 'packed.ico'
CONST Pi = 3.141593
FColor = 0
BColor = 15
Tool = 2
DIM SHARED FillArea(26908) AS INTEGER
DIM SHARED FillString(0 TO 175) AS STRING * 595
MHideCurs
CustomCursor 1
InitScreen
TeaseScreen
LINE (47, 24)-(640, 200), BColor, BF
MShowCurs
PCOPY 0, 2: PCOPY 0, 3
MSetLoc 100, 320
CustomCursor 2
DO
MButton LBut, RBut, My, Mx, BBut
MGetLoc My, Mx
IF Mx > 47 AND My > 24 THEN
IF OMx <> Mx OR OMy <> My THEN PrintCoords
ELSE
LINE (545, 2)-(640, 19), 15, BF
END IF
OMx = Mx: OMy = My
Key$ = INKEY$
SELECT CASE Key$
CASE CHR$(27): SYSTEM
END SELECT
IF LBut OR RBut THEN
IF MRange(1, 1, 40, 19, Mx, My) THEN
MHideCurs
PCOPY 0, 2
Icon 2, 20, 40, 19, "Save"
Icon 2, 40, 40, 19, "Load"
Icon 2, 60, 40, 19, "Quit"
MShowCurs
MSetRange 2, 2, 40, 80
LBut = 0: RBut = 0
DO UNTIL LBut
MButton LBut, RBut, My, Mx, BBut
LOOP
IF My > 60 THEN SYSTEM
IF My < 61 AND My > 40 THEN
MHideCurs
PCOPY 2, 0
Icon 70, 92, 180, 16, "Please type the name:"
Icon 125, 110, 85, 16, ""
FilName$ = SPACE$(8)
GLineEdit FilName$, 135, 115, 1, 0, KeyCode
FilName$ = RTRIM$(FilName$) + ".doo"
PCOPY 2, 0
IF FilName$ <> ".doo" THEN FileLoad
PCOPY 0, 2
MShowCurs
END IF
IF My < 41 AND My > 20 THEN
MHideCurs
PCOPY 2, 0
Icon 70, 92, 180, 16, "Please type the name:"
Icon 125, 110, 85, 16, ""
FilName$ = SPACE$(8)
GLineEdit FilName$, 135, 115, 1, 0, KeyCode
FilName$ = RTRIM$(FilName$) + ".doo"
PCOPY 2, 0
IF FilName$ <> ".doo" THEN FileSave
MShowCurs
END IF
MHideCurs
PCOPY 2, 0
MShowCurs
MSetRange 1, 1, 640, 200
LBut = 0: RBut = 0
PrintCoords
ELSEIF MRange(45, 1, 90, 19, Mx, My) THEN
MHideCurs
PCOPY 0, 2
Icon 45, 20, 43, 19, "Clear"
Icon 45, 40, 43, 19, "Undo"
LBut = 0: RBut = 0
MSetRange 45, 2, 90, 59
MShowCurs
DO UNTIL LBut
MButton LBut, RBut, My, Mx, BBut
LOOP
MHideCurs
PCOPY 2, 0
IF My < 20 THEN
ELSEIF My > 19 AND My < 40 THEN
LINE (47, 24)-(640, 200), BColor, BF
ELSEIF My > 39 AND My < 60 THEN
PCOPY 3, 0
END IF
MSetRange 1, 1, 640, 200
MShowCurs
LBut = 0: RBut = 0
PrintCoords
ELSEIF MRange(90, 1, 110, 19, Mx, My) THEN Tool = 1
ELSEIF MRange(115, 1, 135, 19, Mx, My) THEN Tool = 2
ELSEIF MRange(140, 1, 160, 19, Mx, My) THEN Tool = 3
ELSEIF MRange(165, 1, 185, 19, Mx, My) THEN Tool = 4
ELSEIF MRange(190, 1, 210, 19, Mx, My) THEN
IF Tool = 5 THEN
MHideCurs
PCOPY 0, 2
Icon 190, 20, 20, 19, ""
LINE (198, 27)-(204, 33), 0
Icon 190, 40, 20, 19, ""
LINE (198, 47)-(204, 53), 0
LINE (204, 47)-(198, 53), 0
LINE (201, 44)-(201, 56), 0
LINE (195, 50)-(208, 50), 0
MShowCurs
MSetRange 190, 20, 210, 60
DO UNTIL LBut AND My > 20
MButton LBut, RBut, My, Mx, BBut
LOOP
Tool = 5
IF My > 40 THEN Tool = 50
MHideCurs
PCOPY 2, 0
MShowCurs
MSetRange 1, 1, 640, 200
LBut = 0: RBut = 0
PrintCoords
ELSE
Tool = 5
END IF
ELSEIF MRange(215, 1, 235, 19, Mx, My) THEN
IF Tool = 6 OR Tool = 60 THEN
MHideCurs
PCOPY 0, 2
Icon 215, 20, 20, 19, ""
LINE (222, 27)-(228, 33), 0, B
Icon 215, 40, 20, 19, ""
LINE (222, 47)-(228, 53), 0, B
LINE (223, 48)-(227, 52), 15, BF
MShowCurs
MSetRange 215, 20, 235, 60
DO UNTIL LBut AND My > 20
MButton LBut, RBut, My, Mx, BBut
LOOP
Tool = 6
IF My > 40 THEN Tool = 60
MHideCurs
PCOPY 2, 0
MShowCurs
MSetRange 1, 1, 640, 200
LBut = 0: RBut = 0
PrintCoords
ELSE
Tool = 6
END IF
ELSEIF MRange(240, 1, 260, 19, Mx, My) THEN
IF Tool = 7 OR Tool = 70 OR Tool = 71 OR Tool = 710 THEN
MHideCurs
PCOPY 0, 2
Icon 240, 20, 20, 19, ""
CIRCLE (250, 30), 4, 0, , , 1
Icon 240, 40, 20, 19, ""
CIRCLE (250, 50), 4, 0, , , 1
PAINT (250, 50), 15, 0
Icon 240, 60, 20, 19, ""
CIRCLE (250, 70), 4, 0, , , 1.5
Icon 240, 80, 20, 19, ""
CIRCLE (250, 90), 4, 0, , , 1.5
PAINT (250, 90), 15, 0
MShowCurs
MSetRange 240, 20, 260, 100
LBut = 0
DO UNTIL LBut
MButton LBut, RBut, My, Mx, BBut
LOOP
MHideCurs
PCOPY 2, 0
MShowCurs
MSetRange 1, 1, 640, 200
Tool = 7
IF My > 40 THEN Tool = 70
IF My > 60 THEN Tool = 71
IF My > 80 THEN Tool = 710
LBut = 0: RBut = 0
PrintCoords
ELSE
Tool = 7
END IF
ELSEIF MRange(265, 1, 285, 17, Mx, My) THEN
IF Tool = 8 OR Tool = 80 OR Tool = 81 OR Tool = 810 THEN
MHideCurs
PCOPY 0, 2
Icon 275, 20, 20, 17, ""
GraphColor 0
GPrint "A", 282, 26, 2
Icon 275, 38, 20, 17, "A"
Icon 275, 56, 20, 17, ""
GPrint "A", 282, 60, 2
LINE (282, 68)-(288, 68), 0
Icon 275, 74, 20, 17, "A"
LINE (282, 88)-(289, 88), 0
MShowCurs
MSetRange 275, 20, 295, 92
LBut = 0
DO UNTIL LBut
MButton LBut, RBut, My, Mx, BBut
LOOP
MHideCurs
PCOPY 2, 0
MShowCurs
MSetRange 1, 1, 640, 200
Tool = 8
IF My > 38 THEN Tool = 80
IF My > 56 THEN Tool = 81
IF My > 74 THEN Tool = 810
LBut = 0: RBut = 0
PrintCoords
ELSE
Tool = 8
END IF
ELSEIF MRange(290, 1, 310, 19, Mx, My) THEN
MHideCurs
PCOPY 0, 2
Icon 180, 25, 130, 16, "How many sides?"
Icon 230, 45, 16, 16, ""
Side$ = " "
GLineEdit Side$, 235, 50, 1, 0, KeyCode
WHILE VAL(Side$) < 3: GLineEdit Side$, 235, 50, 1, 0, KeyCode: WEND
PCOPY 2, 0
MShowCurs
Sides = VAL(Side$)
Tool = 9
ELSEIF MRange(315, 1, 335, 19, Mx, My) THEN Tool = 10
ELSEIF MRange(340, 1, 360, 19, Mx, My) THEN Tool = 11
ELSEIF Mx < 40 AND Mx > 0 THEN
FOR Test = 190 TO 40 STEP -10
IF My > Test THEN
IF LBut THEN
FColor = (Test - 40) \ 10
MHideCurs
LINE (1, 21)-(40, 40), BColor, BF
LINE (10, 25)-(30, 35), FColor, BF
MShowCurs
EXIT FOR
ELSEIF RBut THEN
BColor = (Test - 40) \ 10
MHideCurs
LINE (1, 21)-(40, 40), BColor, BF
LINE (10, 25)-(30, 35), FColor, BF
MShowCurs
EXIT FOR
END IF
END IF
NEXT
END IF
END IF
IF LBut OR RBut AND Mx > 20 THEN
DrawingTools
END IF
LBut = 0: RBut = 0
SELECT CASE Tool
CASE IS <= 10: TTool = Tool
CASE 11: TTool = 1
CASE 80, 81, 810: TTool = 8
CASE 70, 71, 710: TTool = 7
CASE 60: TTool = 6
CASE 50: TTool = 5
END SELECT
IF Mx < 48 OR My < 24 THEN
IF OldTool <> -99 THEN CustomCursor 1
OldTool = -99
ELSE
IF OldTool <> TTool THEN
CustomCursor TTool
END IF
OldTool = TTool
END IF
IF Tool = 11 THEN TTool = 11
FOR Count = 0 TO 10
IF TTool = Count + 1 THEN
Clr = 12
ELSE
Clr = 1
END IF
PointX = 89 + (Count * 25)
PointX2 = 89 + (Count * 25) + 22
IF POINT(PointX, 1) <> Clr AND POINT(PointX2, 1) <> Clr THEN
MHideCurs
LINE (PointX, 1)-(PointX2, 20), Clr, B
LINE (PointX - 1, 1)-(PointX2 + 1, 20), Clr, B
MShowCurs
END IF
NEXT
LOOP
REM $STATIC
SUB CustomCursor (FileNum)
DIM reg AS RegType
IF FileNum MOD 10 = 0 THEN
File = FileNum \ 10
ELSE
File = FileNum
END IF
OPEN "Cursors.dat" FOR INPUT AS #1
FOR X = 1 TO FileNum
Temp$ = ""
DO UNTIL Temp$ = "CURSORDATA"
LINE INPUT #1, Temp$
LOOP
NEXT
FOR i = 1 TO 32
INPUT #1, Wrd
MMsk$ = MMsk$ + MKI$(Wrd)
NEXT i
INPUT #1, HotX
INPUT #1, HotY
CLOSE #1
reg.ax = 9
reg.bx = HotX: reg.cx = HotY
reg.dx = SADD(MMsk$)
CALL Interrupt(&H33, reg, reg)
reg.ax = 1
CALL Interrupt(&H33, reg, reg)
END SUB
SUB DrawingTools
IF My < 24 OR Mx < 48 THEN EXIT SUB
MSetRange 47, 24, 639, 199
MHideCurs
PCOPY 0, 3
PCOPY 0, 2: MShowCurs
IF LBut THEN
Clr = FColor
Clr2 = BColor
ELSEIF RBut THEN
Clr = BColor
Clr2 = FColor
END IF
GraphColor 0
IF Tool = 50 THEN GraphColor Clr
StartX = Mx: StartY = My
SELECT CASE Tool
CASE 2
GraphColor Clr
OldMx = Mx: OldMy = My
DO UNTIL NOT (LBut OR RBut)
IF OldMx <> Mx OR OldMy <> My THEN
MHideCurs
LINE (OldMx, OldMy)-(Mx, My), Clr
MShowCurs
PrintCoords
END IF
OldMx = Mx: OldMy = My
MButton LBut, RBut, My, Mx, BBut
MGetLoc My, Mx
LOOP
GOTO Ending
CASE 3
DO
MButton LBut, RBut, My, Mx, BBut
IF NOT (LBut OR RBut) THEN GOTO Ending
DO UNTIL OldMx <> Mx OR OldMy <> My
MButton LBut, RBut, My, Mx, BBut
MGetLoc My, Mx
IF NOT (LBut OR RBut) THEN GOTO EndSub
LOOP
PrintCoords
OldMx = Mx: OldMy = My: MHideCurs
LINE (Mx + 3, My + 2)-(Mx + 12, My + 11), Clr2, BF
PCOPY 0, 2: MShowCurs
LOOP
CASE 4
MHideCurs
Color1 = 15: Color2 = 0
IF Color2 = FColor THEN Color2 = 10
IF Color1 = BColor THEN Color1 = 12
PCOPY 0, 1
SCREEN 8, , 1, 0
FOR X = 47 TO 639
FOR Y = 24 TO 199
IF POINT(X, Y) <> BColor THEN
PSET (X, Y), Color1
ELSE
PSET (X, Y), Color2
END IF
NEXT
NEXT
PAINT (Mx, My), FColor, Color1
FOR Y = 24 TO 199
FillString(Y - 24) = SPACE$(592)
FOR X = 47 TO 639
IF POINT(X, Y) = FColor THEN
MID$(FillString(Y - 24), X - 46, 1) = "A"
END IF
NEXT
NEXT
SCREEN 8, , 0, 0
FOR Y = 24 TO 199
FOR X = 47 TO 639
IF MID$(FillString(Y - 24), X - 46, 1) = "A" THEN
PSET (X, Y), FColor
END IF
NEXT
NEXT
MShowCurs
GOTO Ending
CASE 8, 80, 81, 810
GraphColor Clr
IF RBut THEN
SWAP Clr, Clr2
END IF
Txt$ = SPACE$(80)
MHideCurs
GLineEdit Txt$, Mx, My, 2, 0, KeyCode
PCOPY 2, 0
IF KeyCode <> 27 THEN
IF Tool = 80 OR Tool = 810 THEN
GraphColor Clr2
GPrint Txt$, Mx + 1, My + 1, 2
GraphColor Clr
END IF
IF Tool = 81 OR Tool = 810 THEN
LINE (Mx, My + 8)-(Mx + (LEN(RTRIM$(Txt$)) * 8), My + 8), Clr
END IF
GPrint RTRIM$(Txt$), Mx, My, 2
END IF
MShowCurs
GOTO Ending
CASE 10
MSetRange 58, 34, 639, 199
MHideCurs
OMx = Mx: OMy = My
DO UNTIL NOT (LBut OR RBut)
MButton LBut, RBut, My, Mx, BBut
MGetLoc My, Mx
Px = INT(RND * 20) - 10 + Mx
Py = INT(RND * 20) - 10 + My
IF SQR((((Mx - Px) ^ 2) + ((My - Py) ^ 2))) <= 10 THEN PSET (Px, Py), Clr
IF OMx <> Mx OR OMy <> My THEN
PrintCoords
OMx = Mx: OMy = My
END IF
LOOP
MShowCurs
GOTO Ending
CASE 11
MHideCurs
Clr = POINT(Mx, My)
IF LBut THEN
FColor = Clr
ELSE
BColor = Clr
END IF
LINE (1, 21)-(40, 40), BColor, BF
LINE (10, 25)-(30, 35), FColor, BF
MShowCurs
GOTO Ending
END SELECT
MShowCurs
DO
MButton LBut, RBut, My, Mx, BBut
IF NOT (LBut OR RBut) THEN GOTO EndSub
OMx = Mx: OMy = My
MHideCurs
IF Tool <> 50 THEN PCOPY 2, 0
SELECT CASE Tool
CASE 5: LINE (StartX, StartY)-(Mx, My), 0
CASE 50: LINE (StartX, StartY)-(Mx, My), 0
CASE 6, 60: LINE (StartX, StartY)-(Mx, My), 0, B
CASE 7, 70
Radius = SQR(((StartX - Mx) ^ 2) + ((StartY - My) ^ 2))
CIRCLE (StartX, StartY), Radius, 0
CASE 71, 710
IF StartX <> Mx THEN
LINE (StartX, StartY)-(Mx, My), 0, B
Radius = ABS(StartX - Mx) / 2
Aspect! = ABS(StartY - My) / ABS(StartX - Mx)
IF Aspect! > 1 THEN Radius = Radius * Aspect!
CIRCLE ((StartX + Mx) \ 2, (StartY + My) \ 2), Radius, 0, , , Aspect!
END IF
CASE 9
IF StartY <> My THEN
Radius = SQR(((StartX - Mx) ^ 2) + ((2 * (StartY - My)) ^ 2))
Degrees = INT(ATN((StartX - Mx) / (StartY - My)) * 57.2958)
DRAW "C0 BM" + STR$(StartX) + "," + STR$(StartY)
FOR Count = 1 TO 360 STEP 360 \ Sides
Temp = Count + Degrees
IF My > StartY THEN Temp = Temp + 180
IF Temp > 360 THEN Temp = Temp - 360
IF Temp < 0 THEN Temp = 360 + Temp
DRAW "TA" + STR$(Temp) + "R" + STR$(Radius)
NEXT
END IF
END SELECT
PrintCoords
MShowCurs
DO UNTIL OMx <> Mx OR OMy <> My
MButton LBut, RBut, My, Mx, BBut
MGetLoc My, Mx
IF NOT (LBut OR RBut) THEN GOTO EndSub
LOOP
LOOP
EndSub:
GraphColor Clr
IF RBut THEN GraphColor Clr2
MHideCurs
IF Tool <> 50 THEN PCOPY 2, 0
SELECT CASE Tool
CASE 5: LINE (StartX, StartY)-(Mx, My), Clr
CASE 6: LINE (StartX, StartY)-(Mx, My), Clr, B
CASE 7
Radius = SQR(((StartX - Mx) ^ 2) + ((StartY - My) ^ 2))
CIRCLE (StartX, StartY), Radius, Clr
CASE 60
LINE (StartX, StartY)-(Mx, My), Clr, BF
IF StartX > Mx THEN SWAP StartX, Mx
IF StartY > My THEN SWAP StartY, My
LINE (StartX + 1, StartY + 1)-(Mx - 1, My - 1), Clr2, BF
CASE 70
IF StartX = Mx THEN
MShowCurs
EXIT SUB
END IF
SCREEN 8, , 1, 0
Radius = SQR(((StartX - Mx) ^ 2) + ((StartY - My) ^ 2))
LINE (1, 1)-(640, 200), 15, BF
CIRCLE (StartX, StartY), Radius, 0
PAINT (StartX, StartY), 0, 0
GET (StartX - Radius, StartY - (.5 * Radius))-(StartX + Radius, StartY + (.5 * Radius)), FillArea(26908 - (4 + INT((((StartX - Radius) - (StartX + Radius) + 1) + 7) / 8) * 4 * (((StartY - (.5 * Radius)) - (StartY + (.5 * Radius))) + 1)))
PCOPY 0, 1
PUT (StartX - Radius, StartY - (.5 * Radius)), FillArea(26908 - (4 + INT((((StartX - Radius) - (StartX + Radius) + 1) + 7) / 8) * 4 * (((StartY - (.5 * Radius)) - (StartY + (.5 * Radius))) + 1))), AND
CIRCLE (StartX, StartY), Radius, Clr2
PAINT (StartX, StartY), Clr2, Clr2
CIRCLE (StartX, StartY), Radius, Clr
PCOPY 1, 0
SCREEN 8, , 0, 0
CASE 71
Radius = ABS(StartX - Mx) / 2
Aspect! = ABS(StartY - My) / ABS(StartX - Mx)
IF Aspect! > 1 THEN Radius = Radius * Aspect!
CIRCLE ((StartX + Mx) \ 2, (StartY + My) \ 2), Radius, Clr, , , Aspect!
CASE 710
IF StartX = Mx THEN
MShowCurs
EXIT SUB
END IF
SCREEN 8, , 1, 0
Radius = ABS(StartX - Mx) / 2
Aspect! = ABS(StartY - My) / ABS(StartX - Mx)
IF Aspect! > 1 THEN Radius = Radius * Aspect!
PAINT (1, 1), 15
CIRCLE ((StartX + Mx) \ 2, (StartY + My) \ 2), Radius, 0, , , Aspect!
PAINT ((StartX + Mx) \ 2, (StartY + My) \ 2), 0, 0
IF StartX > Mx THEN
SWAP StartX, Mx
END IF
IF StartY > My THEN
SWAP StartY, My
END IF
GET (StartX - 1, StartY - 1)-(Mx, My), FillArea(26908 - (4 + INT(((Mx - StartX) * (1) + 7) / 8) * 4 * (My - StartY)))
PCOPY 0, 1
PUT (StartX - 1, StartY - 1), FillArea(26908 - (4 + INT(((Mx - StartX) * (1) + 7) / 8) * 4 * (My - StartY))), AND
CIRCLE ((StartX + Mx) \ 2, (StartY + My) \ 2), Radius, Clr2, , , Aspect!
PAINT ((StartX + Mx) \ 2, (StartY + My) \ 2), Clr2, Clr2
CIRCLE ((StartX + Mx) \ 2, (StartY + My) \ 2), Radius, Clr, , , Aspect!
PCOPY 1, 0
CLS
SCREEN 8, , 0, 0
CASE 9
IF StartY <> My THEN
Radius = SQR(((StartX - Mx) ^ 2) + ((2 * (StartY - My)) ^ 2))
Degrees = INT(ATN((StartX - Mx) / (StartY - My)) * 57.2958)
DRAW "C" + LTRIM$(STR$(Clr)) + "BM" + STR$(StartX) + "," + STR$(StartY)
FOR Count = 1 TO 360 STEP 360 \ Sides
Temp = Count + Degrees
IF My > StartY THEN Temp = Temp + 180
IF Temp > 360 THEN Temp = Temp - 360
IF Temp < 0 THEN Temp = 360 + Temp
DRAW "TA" + STR$(Temp) + "R" + STR$(Radius)
NEXT
END IF
END SELECT
MShowCurs
Ending:
MShowCurs
MSetRange 1, 1, 639, 199
END SUB
SUB FileLoad
OPEN FilName$ FOR BINARY ACCESS READ AS #1
FilePos = 0
FOR X = 47 TO 639
Temp = FilePos + 1
Blah$ = " "
DO UNTIL Blah$ = CHR$(13) + CHR$(10)
GET #1, Temp, Blah$
Temp = Temp + 1
LOOP
Temp$ = SPACE$(Temp - FilePos - 2)
GET #1, FilePos + 1, Temp$
FilePos = Temp
Y = 23
StringPos = 0
DO UNTIL StringPos >= LEN(Temp$)
Y = Y + 1
StringPos = StringPos + 1
Clr = ASC(MID$(Temp$, StringPos, 1)) - 66
IF Clr = 134 THEN
StringPos = StringPos + 1
Clr = ASC(MID$(Temp$, StringPos, 1)) - 66
StringPos = StringPos + 1
Size = ASC(MID$(Temp$, StringPos, 1))
LINE (X, Y)-(X, Y + Size), Clr
Y = Y + Size' + 1
ELSE
PSET (X, Y), Clr
StringPos = StringPos + 1
END IF
LOOP
NEXT
CLOSE #1
END SUB
SUB FileSave
PCOPY 0, 2
OPEN FilName$ FOR OUTPUT AS #1
FOR X = 47 TO 639
FOR Y = 24 TO 199
Clr = POINT(X, Y)
IF POINT(X, Y) = Clr AND POINT(X, Y + 1) = Clr AND POINT(X, Y + 3) = Clr AND POINT(X, Y + 4) = Clr THEN
TempY = Y
DO UNTIL POINT(X, TempY) <> Clr
TempY = TempY + 1
LOOP
Temp$ = Temp$ + CHR$(200) + CHR$(Clr + 66) + CHR$(TempY - Y)
Y = TempY
ELSE
Temp$ = Temp$ + CHR$(Clr + 66)
END IF
NEXT
PCOPY 2, 0
LINE (X, 24)-(X, 199), 12
PRINT #1, Temp$
Temp$ = ""
NEXT
CLOSE #1
END SUB
SUB Icon (X, Y, Wid, High, Title$)
LINE (X + 1, Y)-(X + Wid - 1, Y), 15
LINE (X, Y + 1)-(X, Y + High - 1), 15
LINE (X + 1, Y + High)-(X + Wid - 1, Y + High), 8
LINE (X + Wid, Y + 1)-(X + Wid, Y + High - 1), 8
LINE (X + 1, Y + 1)-(X + Wid - 1, Y + High - 1), 7, BF
GraphColor 7
GPrint Title$, X + (Wid \ 2) - (LEN(Title$) * 4) + 2, Y + (High \ 2) - 2, 0
GraphColor 15
GPrint Title$, X + (Wid \ 2) - (LEN(Title$) * 4) + 1, Y + (High \ 2) - 3, 3
END SUB
SUB InitScreen
LINE (44, 22)-(640, 22), BColor
LINE (44, 22)-(44, 200), BColor
PAINT (50, 50), BColor, BColor
PAINT (10, 10), 1, BColor
LINE (42, 21)-(640, 23), 0, BF
LINE (42, 21)-(46, 200), 0, BF
FOR Y = 40 TO 190 STEP 10
LINE (0, Y)-(40, Y + 11), (Y - 20) \ 10 - 2, BF
NEXT
LINE (1, 21)-(40, 40), BColor, BF
LINE (10, 25)-(30, 35), FColor, BF
Icon 2, 2, 40, 17, "File"
Icon 45, 2, 43, 17, "Edit"
FOR X = 0 TO 10
Icon 90 + (X * 25), 2, 20, 17, ""
IF X > 3 AND X < 9 THEN
LINE (90 + (X * 25) + 16, 16)-(90 + (X * 25) + 18, 16), 0
PSET (90 + (X * 25) + 17, 17), 0
END IF
NEXT
FOR X = 0 TO 3
READ Pic$
PutPic 95 + (X * 25), 6, Pic$
NEXT
READ Pic$
PutPic 320, 6, Pic$
READ Pic$
PutPic 345, 6, Pic$
LINE (196, 8)-(202, 14), 0
LINE (220, 8)-(228, 14), 0, B
CIRCLE (250, 11), 4, 0, , , 1
Icon 265, 2, 20, 17, "A"
LINE (281, 16)-(283, 16), 0
PSET (282, 17), 0
Icon 290, 2, 20, 17, "P"
LINE (306, 16)-(308, 16), 0
PSET (307, 17), 0
LINE (545, 2)-(640, 19), 15, BF
Mx = 320: My = 100: OMx = 320: OMy = 100
GraphColor 0
GPrint "X=", 553, 8, 2
GPrint "Y=", 596, 8, 2
GPrint STR$(Mx), 562, 8, 2
GPrint STR$(My), 605, 8, 2
END SUB
FUNCTION MRange (x0, y0, X1, Y1, Mx, My)
IF My < Y1 AND My > y0 AND Mx > x0 AND Mx < X1 THEN MRange = -1
END FUNCTION
SUB PrintCoords
GraphColor 0
LINE (545, 2)-(640, 19), 15, BF
GPrint "X=", 553, 8, 2
GPrint "Y=", 596, 8, 2
GPrint STR$(Mx - 47), 562, 8, 2
GPrint STR$(My - 24), 605, 8, 2
END SUB
SUB PutPic (X, Y, Pic$)
Temp = 0
FOR TempY = 1 TO 8
FOR TempX = 1 TO 8
Temp = Temp + 1
PSET (TempX + X, TempY + Y), ASC(MID$(Pic$, Temp, 1)) - 65
NEXT
NEXT
END SUB
SUB TeaseScreen
LINE (100, 50)-(100, 100), 0
LINE (110, 55)-(110, 95), 0
CIRCLE (110, 75), 48, 0, 1.5 * Pi, .5 * Pi
CIRCLE (100, 75), 66, 0, 1.5 * Pi, .5 * Pi, .4
PAINT (105, 53), 12, 0
CIRCLE (220, 65), 40, 0
CIRCLE (220, 65), 30, 0
PAINT (185, 65), 12, 0
CIRCLE (280, 95), 40, 0
CIRCLE (280, 95), 30, 0
PAINT (245, 95), 12, 0
LINE (330, 50)-(330, 100), 0
LINE (340, 55)-(340, 95), 0
CIRCLE (340, 75), 48, 0, 1.5 * Pi, .5 * Pi
CIRCLE (330, 75), 66, 0, 1.5 * Pi, .5 * Pi, .4
PAINT (345, 53), 12, 0
LINE (400, 50)-(400, 100), 0
LINE (400, 100)-(470, 100), 0
LINE (470, 100)-(470, 95), 0
LINE (470, 95)-(410, 95), 0
LINE (410, 95)-(410, 50), 0
LINE (410, 50)-(400, 50), 0
PAINT (405, 55), 12, 0
LINE (490, 50)-(490, 100), 0
LINE (490, 100)-(560, 100), 0
LINE (560, 100)-(560, 95), 0
LINE (560, 95)-(500, 95), 0
LINE (500, 95)-(500, 80), 0
LINE (500, 80)-(545, 80), 0
LINE (545, 80)-(545, 75), 0
LINE (545, 75)-(500, 75), 0
LINE (500, 75)-(500, 55), 0
LINE (500, 55)-(560, 55), 0
LINE (560, 55)-(560, 50), 0
LINE (560, 50)-(490, 50), 0
PAINT (495, 55), 12, 0
Temp$ = "By Tony Lieuallen"
FOR X = 1 TO LEN(Temp$)
GraphColor X MOD 7
GPrint MID$(Temp$, X, 1), 190 + 8 * X, 120, 2
NEXT
Temp$ = "Freeware notice..."
FOR X = 1 TO LEN(Temp$)
GraphColor X MOD 7
GPrint MID$(Temp$, X, 1), 200 + 8 * X, 140, 2
NEXT
Temp$ = "this is completely free!"
FOR X = 1 TO LEN(Temp$)
GraphColor X MOD 7
GPrint MID$(Temp$, X, 1), 240 + 8 * X, 150, 2
NEXT
X = 0: Y = 11
FOR Temp = 1 TO 2
FOR Temp2 = 0 TO 360
IF INKEY$ = "5" THEN EXIT SUB
LINE (220, 65)-(220 + X, 65 + Y), 15
LINE (280, 95)-(280 + X, 95 + Y), 15
X = SIN(Temp2 * (Pi / 180)) * 57.2958 * .5
Y = COS(Temp2 * (Pi / 180)) * 57.2958 * .2
LINE (220, 65)-(220 + X, 65 + Y), 0
LINE (280, 95)-(280 + X, 95 + Y), 0
FOR Temp3 = 1 TO 3000: NEXT
NEXT
NEXT
LINE (220, 65)-(220 + X, 65 + Y), 0
LINE (280, 95)-(280 + X, 95 + Y), 0
MShowCurs
Icon 150, 100, 20, 16, "Ok"
MSetLoc 108, 160
LBut = 0
DO UNTIL LBut AND MRange(150, 100, 170, 116, Mx, My)
MButton LBut, RBut, My, Mx, BBut
LOOP
MHideCurs
END SUB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.