Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '•PocketPaint•••••••••••••••
- 'See VERNUM$ for version
- '•••••••••••••••••••••••••••
- '•Entry Point•
- '-Start of Program-
- ACLS
- GPAGE 1,0,0
- GCLS
- BGMSTOP
- FOR I=1 TO 3
- GPAGE 1,I,I
- GCLS 0
- NEXT
- CLEAR
- SPPAGE 1
- BGPAGE 1
- BG=&B01101
- BA=&B01111
- FOR Y=0 TO 63
- FOR X=0 TO 63
- BGPUT 1,X,Y,BG
- SWAP BG,BA
- NEXT
- SWAP BG,BA
- NEXT
- BGPAGE 0
- GPAGE 0
- GPRIO 2
- GPAGE 1
- GPRIO 2
- CHRINIT"BGU0"
- CHRINIT"BGFU"
- CHRSET"BGU0",16,"DDDDFFFF"*4+"FFFFDDDD"*4
- CHRSET"BGFU",228,"FFFFFFFF"+"F000000F"*6+"FFFFFFFF"
- CHRSET"BGFU",229,"FFFFEEEE"+"F000000E"*3+"E000000F"*3+"EEEEFFFF"
- CHRINIT"SPS0"
- CHRSET"SPS0",4,"0011110001111110111111111111111111111111111111110111111000111100"
- PNLTYPE"OFF"
- VERNUM$="Contest Release"
- MENPNA=1
- MT=10
- OB1=256
- OB2=512
- BX=1
- BY=5
- XB=1
- TB=2
- TMX=1
- TMY=4
- PG=1
- PB=3
- REDRAW=1
- INK=16
- BGCHR=&B10000
- GPAGE 1,PG,PG
- SPRAY_DENS=5
- DIM F$[20]
- F$[ 0]="@PENCIL"
- F$[ 1]="@LINE"
- F$[ 2]="@ERASE"
- F$[ 3]="@PAINT"
- F$[ 4]="@BOX"
- F$[ 5]="@ELIPS"
- F$[ 6]="@DROPPER"
- F$[ 7]="@SPRAY"
- F$[ 8]="@BRUSH"
- F$[ 9]="@COPY"
- F$[10]="@PASTE"
- SIZE=5
- FOR I=0 TO 3
- SPSET I,1,0,0,0,0,8,8
- SPHOME I,4,4
- NEXT
- GOSUB @NCSR
- FOR I=0 TO 3
- BREPEAT I,15,1
- NEXT
- MENPGA=1
- GOTO @MENU
- '•Runs after welcome menu•
- @START
- GOTO @MCOL
- '•Main Loop•
- '-Program waits for input-
- @WAIT
- VSYNC 1
- GOSUB @BCOL
- IF TCHST THEN GOSUB @TCHK
- B=BUTTON(1)
- IF B GOTO @BCHK
- GOTO @WAIT
- '•Checks button input•
- @BCHK
- IF B AND 32 THEN GOSUB @UNDO
- IF B AND 256 GOTO @PSW
- IF B AND 512 GOTO @MSW
- IF B AND 1024 GOTO @FM
- GOTO @MCHK
- GOTO @WAIT
- '•Checks current menu•
- @MCHK
- ON MENPG GOTO @CMB,@TMB
- GOTO @WAIT
- '•Checks current tool•
- @TCHK
- GOSUB @BCOL
- MENFLG=0
- IF !TCHST THEN RETURN
- GOSUB F$[TVAL]
- RETURN
- '•Pencil Tool•
- @PENCIL
- GOSUB @UPDATE
- SX=TCHX
- SY=TCHY
- @PL
- VSYNC 1
- EX=TCHX
- EY=TCHY
- GLINE SX,SY,EX,EY,INK
- SX=EX
- SY=EY
- IF TCHST GOTO @PL
- RETURN
- '•Line Tool•
- @LINE
- SX=TCHX
- SY=TCHY
- GDRAWMD 1
- XC=255 XOR INK
- @LL
- LNCSR=1
- EX=TCHX
- EY=TCHY
- GLINE SX,SY,EX,EY,XC
- GOSUB @YCSR
- GLINE SX,SY,EX,EY,XC
- IF TCHST GOTO @LL
- GOSUB @NCSR
- GDRAWMD XA
- GOSUB @UPDATE
- GLINE SX,SY,EX,EY,INK
- LNCSR=0
- RETURN
- '•Eraser Tool•
- @ERASE
- GOSUB @UPDATE
- ECSR=1
- @ERSL
- SX=TCHX
- SY=TCHY
- GOSUB @YCSR
- GFILL SX-3,SY-3,SX+4,SY+4,0
- IF TCHST GOTO @ERSL
- GOSUB @NCSR
- ECSR=0
- RETURN
- '•Box Tool•
- '-Free Mode-
- @BOX
- SX=TCHX
- SY=TCHY
- GDRAWMD 1
- XC=255 XOR INK
- @BL
- B=BUTTON(0)
- IF B AND OB1 GOTO @SQUARE
- EX=TCHX
- EY=TCHY
- GBOX SX,SY,EX,EY,XC
- GOSUB @YCSR
- GBOX SX,SY,EX,EY,XC
- IF TCHST GOTO @BL
- GOSUB @NCSR
- GDRAWMD XA
- B=BUTTON(0)
- GOSUB @UPDATE
- IF B AND OB2 THEN GFILL SX,SY,EX,EY,INK ELSE GBOX SX,SY,EX,EY,INK
- RETURN
- '•Box Tool•
- '-Square Mode-
- @SQUARE
- GDRAWMD 1
- B=BUTTON(0)
- IF !(B AND OB1) GOTO @BL
- DIST=SQR(POW(TCHX-SX,2)+POW(TCHY-SY,2))
- XD=DIST
- YD=DIST
- IF TCHX<SX THEN XD=-XD
- IF TCHY<SY THEN YD=-YD
- EX=SX+XD
- EY=SY+YD
- GBOX SX,SY,EX,EY,XC
- GOSUB @YCSR
- GBOX SX,SY,EX,EY,XC
- IF TCHST GOTO @SQUARE
- GOSUB @NCSR
- GDRAWMD XA
- GOSUB @UPDATE
- IF B AND OB2 THEN GFILL SX,SY,EX,EY,INK ELSE GBOX SX,SY,EX,EY,INK
- RETURN
- '•Spray Tool•
- @SPRAY
- GOSUB @UPDATE
- @SPRL
- VSYNC 1
- TX=TCHX
- TY=TCHY
- FOR I=0 TO SPRAY_DENS
- SA=RND(361)
- SR=RND(SIZE)
- DX=SR*COS(RAD(SA))+TX
- DY=SR*SIN(RAD(SA))+TY
- GPSET DX,DY,INK
- NEXT
- IF TCHST GOTO @SPRL
- RETURN
- '•Ellipse Tool•
- '-Free Mode-
- @ELIPS
- DMF=1
- SX=TCHX
- SY=TCHY
- GDRAWMD 1
- XC=255 XOR INK
- @EL
- B=BUTTON(0)
- IF B AND OB1 GOTO @CIRC
- EX=TCHX
- EY=TCHY
- GOSUB @YCSR
- SWAP INK,XC
- GOSUB @DRWELP
- GOSUB @DRWELP
- SWAP INK,XC
- IF TCHST GOTO @EL
- GOSUB @NCSR
- GDRAWMD XA
- DMF=0
- @DRWELP
- IF !DMF THEN GOSUB @UPDATE
- MX=EX-SX
- MY=EY-SY
- CX=EX-(MX/2)
- CY=EY-(MY/2)
- RX=ABS(EX-CX)
- RY=ABS(EY-CY)
- PX=RX*COS(0)+CX
- PY=RY*SIN(0)+CY
- FOR I=1 TO 360 STEP 2
- R=RAD(I)
- DX=RX*COS(R)+CX
- DY=RY*SIN(R)+CY
- GLINE PX,PY,DX,DY,INK
- PX=DX
- PY=DY
- NEXT
- RETURN
- '•Ellipse Tool•
- '-Circle Mode-
- @CIRC
- B=BUTTON(0)
- IF !(B AND OB1) GOTO @EL
- DIST=SQR(POW(TCHX-SX,2)+POW(TCHY-SY,2))
- TX=TCHX
- TY=TCHY
- XD=DIST
- YD=DIST
- IF TX<SX THEN XD=-DIST
- IF TY<SY THEN YD=-DIST
- EX=SX+XD
- EY=SY+YD
- GOSUB @YCSR
- SWAP INK,XC
- GOSUB @DRWCRC
- GOSUB @DRWCRC
- SWAP INK,XC
- IF TCHST GOTO @CIRC
- GOSUB @NCSR
- GDRAWMD XA
- DMF=0
- @DRWCRC
- IF !DMF THEN GOSUB @UPDATE
- CR=DIST/2
- XR=CR
- YR=CR
- IF TX<SX THEN XR=-CR
- IF TY<SY THEN YR=-CR
- CX=EX-XR
- CY=EY-YR
- GCIRCLE CX,CY,CR,INK
- RETURN
- '•Fill Tool•
- @PAINT
- GOSUB @UPDATE
- GPAINT TCHX,TCHY,INK
- RETURN
- '•Brush Tool•
- @BRUSH
- GOSUB @UPDATE
- @BRL
- VSYNC 1
- EX=TCHX
- EY=TCHY
- GCIRCLE EX,EY,SIZE,INK
- GPAINT EX,EY,INK
- RETURN
- '•Dropper Tool•
- @DROPPER
- INK=GSPOIT(TCHX,TCHY)
- I$=HEX$(INK)
- IF LEN(I$)<2 THEN I$="0"+I$
- BY=VAL("&H"+LEFT$(I$,1))+4
- BX=VAL("&H"+RIGHT$(I$,1))+1
- GPAGE 0
- GFILL 136,32,247,39,INK
- GPAGE 1
- RETURN
- '•Copy Tool•
- @COPY
- SX=TCHX
- SY=TCHY
- @CPYL
- B=BUTTON(0)
- EX=TCHX
- EY=TCHY
- GOSUB @YCSR
- IF TCHST THEN @CPYL
- GOSUB @NCSR
- BSX=SX
- BSY=SY
- BEX=EX
- BEY=EY
- GPAGE 1,2,PG
- GCOPY PG,SX,SY,EX,EY,SX,SY,1
- GPAGE 1,PG,PG
- IF B AND 256 THEN GFILL SX,SY,EX,EY,0
- IF !CFLG THEN CFLG=1
- RETURN
- '•Paste Tool•
- @PASTE
- IF !CFLG THEN RETURN
- SX=TCHX
- SY=TCHY
- EX=TCHX+(BEX-BSX)
- EY=TCHY+(BEY-BSY)
- GOSUB @YCSR
- IF TCHST THEN @PASTE
- GOSUB @NCSR
- GOSUB @UPDATE
- GCOPY 2,BSX,BSY,BEX,BEY,SX,SY,1
- RETURN
- '•Show Cursors•
- @YCSR
- SPOFS 0,SX,SY
- IF ECSR THEN RETURN
- SPOFS 1,EX,EY
- IF LNCSR THEN RETURN
- SPOFS 2,SX,EY
- SPOFS 3,EX,SY
- RETURN
- '•Hide Cursors•
- @NCSR
- FOR I=0 TO 3
- SPOFS I,-8,-8
- NEXT
- RETURN
- '•Increase RGB Value•
- @PM
- IF HY==6 THEN IR=IR-1
- IF HY==7 THEN IG=IG-1
- IF HY==8 THEN IB=IB-1
- IF IR<0 THEN IR=0
- IF IG<0 THEN IG=0
- IF IB<0 THEN IB=0
- GOTO @PS
- '•Decrease RGB Value•
- @PP
- IF HY==6 THEN IR=IR+1
- IF HY==7 THEN IG=IG+1
- IF HY==8 THEN IB=IB+1
- IF IR>255 THEN IR=255
- IF IG>255 THEN IG=255
- IF IB>255 THEN IB=255
- GOTO @PS
- '•RGB-To-Palette•
- @PS
- RH$=HEX$(IR,2)
- GH$=HEX$(IG,2)
- BH$=HEX$(IB,2)
- CS$=RH$+GH$+BH$
- GPAGE 0
- COLSET "GRP",INK,CS$
- GPAGE 1
- COLSET "GRP",INK,CS$
- GOTO @INKGET
- '•File Menu•
- @FM
- GOSUB @BCOL
- MENFLG=0
- HX=1
- HY=4
- YMIN=4
- YMAX=10
- GPAGE 0
- GCLS
- GPAGE 1,PG,PG
- CLS
- BGPUT 1,1,4,0
- BGFILL 1,19,5,30,5,0
- COLOR 0
- REDRAW=1
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜File™"
- ?"’•••••••••••••™"
- ?"– Save... –"
- ?"– Load... –"
- ?"– Reset... –"
- ?"– Color Change –"
- ?"– Documentation–"
- ?"– Close Menu –"
- ?"– Exit –"
- ?"š••••••••••••••›"
- LOCATE HX,HY
- ?"
- ";
- GOSUB @BPRT
- @FL
- VSYNC 1
- B=BUTTON(1)
- IF B AND 1 THEN GOSUB @CU
- IF B AND 2 THEN GOSUB @CD
- IF B AND 1024 GOTO @MINIT
- IF B!=16 GOTO @FL
- IF HY== 4 THEN GOSUB @SAVE
- IF HY== 5 THEN GOSUB @LOAD
- IF HY== 6 GOTO @RESET
- IF HY== 7 GOTO @CC
- IF HY== 8 THEN GOSUB @DOCS
- IF HY== 9 GOTO @MINIT
- IF HY==10 THEN @QUIT
- GOTO @FM
- @SAVE
- CLS
- HY=4
- YMAX=6
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Save™"
- ?"’••••••••™"
- ?"– Drawing –"
- ?"– Palette –"
- ?"– <Back –"
- ?"š•••••••••›"
- LOCATE HX,HY
- ?"
- ";
- @SML
- VSYNC 1
- B=BUTTON(1)
- IF B AND 1 THEN GOSUB @CU
- IF B AND 2 THEN GOSUB @CD
- IF B AND 1024 GOTO @MINIT
- IF B!=16 GOTO @SML
- IF HY==4 GOTO @SGRP
- IF HY==5 GOTO @SCOL
- IF HY==6 THEN RETURN
- GOTO @SAVE
- @LOAD
- CLS
- HY=4
- YMAX=6
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Load™"
- ?"’••••••••™"
- ?"– Drawing –"
- ?"– Palette –"
- ?"– <Back –"
- ?"š•••••••••›"
- LOCATE HX,HY
- ?"
- ";
- @LML
- VSYNC 1
- B=BUTTON(1)
- IF B AND 1 THEN GOSUB @CU
- IF B AND 2 THEN GOSUB @CD
- IF B AND 1024 GOTO @MINIT
- IF B!=16 GOTO @LML
- IF HY==4 GOTO @LGRP
- IF HY==5 GOTO @LCOL
- IF HY==6 THEN RETURN
- GOTO @LOAD
- @RESET
- CLS
- HY=4
- YMAX=6
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜File>Reset™"
- ?"’••••••••••”"
- ?"– Drawing –"
- ?"– Palette –"
- ?"– <Back –"
- ?"š••••••••••›"
- LOCATE HX,HY
- ?"
- ";
- @RML
- VSYNC 1
- B=BUTTON(1)
- IF B AND 1 THEN GOSUB @CU
- IF B AND 2 THEN GOSUB @CD
- IF B AND 1024 GOTO @MINIT
- IF B!=16 GOTO @RML
- IF HY==4 GOTO @RC
- IF HY==5 GOTO @RP
- IF HY==6 GOTO @FM
- GOTO @RESET
- '•Reset Canvas•
- @RC
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜New•Drawing™"
- ?"’••••••••••••™"
- ?"–Are you sure?–"
- ?"’•••••••••••••”"
- ?"– :Yes :No –"
- ?"š•••••••••••••›"
- @RCL
- VSYNC 1
- B=BUTTON(1)
- IF B AND 16 THEN @RCR
- IF B AND 32 THEN @MINIT
- GOTO @RCL
- @RCR
- GOSUB @UPDATE
- GCLS
- GOTO @MINIT
- '•Reset Palette•
- @RP
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Reset•Palette™"
- ?"’•••••••••••••”"
- ?"–Are you sure?–"
- ?"’•••••••••••••”"
- ?"– :Yes :No –"
- ?"š•••••••••••••›"
- @RPL
- VSYNC 1
- B=BUTTON(1)
- IF B AND 16 THEN @RPR
- IF B AND 32 THEN @MINIT
- GOTO @RPL
- @RPR
- GPAGE 0
- COLINIT "GRP"
- GPAGE 1
- COLINIT "GRP"
- GOTO @MINIT
- '•Generic Cursor Up•
- @CU
- COLOR 0
- LOCATE HX,HY
- ?" ";
- HY=HY-1
- IF HY<YMIN THEN HY=YMIN
- LOCATE HX,HY
- ?"
- "
- RETURN
- '•Generic Cursor Down•
- @CD
- COLOR 0
- LOCATE HX,HY
- ?" ";
- HY=HY+1
- IF HY>YMAX THEN HY=YMAX
- LOCATE HX,HY
- ?"
- "
- RETURN
- '•Welcome Menu•
- @MENU
- HX=1
- HY=4
- YMIN=4
- YMAX=7
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Welcome™
- ?"’•••••••••••••™"
- ?"– New Drawing –"
- ?"– Load... –"
- ?"– Documentation–"
- ?"– Exit –"
- ?"š••••••••••••••›"
- LOCATE HX,HY
- ?"
- "
- @ML
- VSYNC 1
- B=BUTTON(1)
- IF B AND 16 GOTO @MS
- IF B AND 1 THEN GOSUB @CU
- IF B AND 2 THEN GOSUB @CD
- GOTO @ML
- '•Welcome Menu Check•
- @MS
- IF HY==4 THEN GOTO @START
- IF HY==5 THEN GOSUB @LOAD:GOTO @MENU
- IF HY==6 THEN GOSUB @DOCS
- IF HY==7 THEN @QUIT
- GOTO @MENU
- '•Save Drawing•
- @SGRP
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Save•Drawing™"
- ?"’•••••••••••••™"
- ?"–Input filename–"
- ?"š••••••••••••••›"
- LOCATE 0,7
- ?"•"*8
- @SDI
- LOCATE 0,6
- LINPUT FN$
- IF FN$=="" THEN LOCATE 0,8:?"String cannot be empty"+CHR$(0)*10:GOTO @SDI
- IF LEN(FN$)>8 THEN LOCATE 0,8:?"String too long"+CHR$(0)*17:LOCATE 0,6:?CHR$(0)*32;:GOTO @SDI
- LOCATE 0,8
- ?CHR$(0)*32
- SYSBEEP=0
- SAVE"GRP"+STR$(PG)+":"+FN$
- SYSBEEP=1
- GOTO @MINIT
- '•Save Palette•
- @SCOL
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Save•Palette™"
- ?"’•••••••••••••™"
- ?"–Input filename–"
- ?"š••••••••••••••›"
- LOCATE 0,7
- ?"•"*8
- @SPI
- LOCATE 0,6
- LINPUT FN$
- IF FN$=="" THEN LOCATE 0,8:?"String cannot be empty"+CHR$(0)*10;:GOTO @SDI
- IF LEN(FN$)>8 THEN LOCATE 0,8:?"String too long"+CHR$(0)*17:LOCATE 0,6:?CHR$(0)*32;:GOTO @SDI
- LOCATE 0,8
- ?CHR$(0)*32
- SYSBEEP=0
- SAVE"COL2U:"+FN$
- SYSBEEP=1
- GOTO @MINIT
- '•Load Drawing•
- @LGRP
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Load•Drawing™"
- ?"’•••••••••••••™"
- ?"–Input filename–"
- ?"š••••••••••••••›"
- LOCATE 0,7
- ?"•"*8
- @LPI
- LOCATE 0,6
- LINPUT FN$
- IF FN$=="" THEN LOCATE 0,8:?"String cannot be empty"+CHR$(0)*10;:GOTO @LPI
- IF LEN(FN$)>8 THEN LOCATE 0,8:?"String too long"+CHR$(0)*17:LOCATE 0,6:?CHR$(0)*32;:GOTO @LPI
- LOCATE 0,8
- ?CHR$(0)*32
- GOSUB @UPDATE
- SYSBEEP=0
- LOAD"GRP"+STR$(PG)+":"+FN$,0
- SYSBEEP=1
- GOTO @MINIT
- '•Load Palette•
- @LCOL
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Load•Drawing™"
- ?"’•••••••••••••™"
- ?"–Input filename–"
- ?"š••••••••••••••›"
- LOCATE 0,7
- ?"•"*8
- @LDI
- LOCATE 0,6
- LINPUT FN$
- IF FN$=="" THEN LOCATE 0,8:?"String cannot be empty"+CHR$(0)*10;:GOTO @LDI
- IF LEN(FN$)>8 THEN LOCATE 0,8:?"String too long"+CHR$(0)*17:LOCATE 0,6:?CHR$(0)*32;:GOTO @LDI
- LOCATE 0,8
- ?CHR$(0)*32
- SYSBEEP=0
- LOAD"COL2U:"+FN$,0
- LOAD"COL2L:"+FN$,0
- SYSBEEP=1
- FLP=1
- GOTO @MINIT
- '•Documentation Screen•
- @DOCS
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Documentation™"
- ?"’••••••••••••••••••••••™"
- ?"–Menu Controls –"
- ?"– /:Move Cursor –"
- ?"– :Select –"
- ?"– :Undo/Redo –"
- ?"– :Switch Panel –"
- ?"– :Switch Menu –"
- ?"– START:Toggle File Menu–"
- ?"š•••••••••••••••••••••••›"
- LOCATE 0,23
- ?"Press any button...";
- @DL
- VSYNC 1
- IF BUTTON(1) THEN RETURN
- GOTO @DL
- '•Switch Menu•
- @MSW
- IF MENPN THEN FIXER=1:GOTO @PSW
- GOSUB @BCOL
- MENFLG=0
- SWAP MENPG,MENPGA
- GOTO @MINIT
- '•Switch Panel•
- @PSW
- IF MENPG AND !FIXER THEN GOTO @MINIT
- GOSUB @BCOL
- MENFLG=0
- SWAP MENPN,MENPNA
- SWAP TA,TB
- IF FIXER THEN FIXER=0:GOTO @MSW
- GOTO @MINIT
- '•Menu Init•
- '-Creates Top-Sceen Menus-
- @MINIT
- ON MENPG GOTO @MCOL,@MTOOL
- GOTO @WAIT
- '•Color Menu•
- @MCOL
- HX=19
- HY=6
- YMIN=6
- YMAX=10
- CLS
- COLOR 0
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- '-Color Panel-
- COLOR TA
- ?"˜Color™"
- ?"’•••••••••••••••™"
- FOR I=0 TO 15
- ?"– –"
- NEXT
- ?"š••••••••••••••••›"
- BGFILL 1,17,4,30,4,0
- BGPUT 1,1,4,BGCHR
- GPAGE 0
- IF !REDRAW THEN @SKIP
- GCLS
- FOR Y=32 TO 152 STEP 8
- FOR X=8 TO 127+8 STEP 8
- GFILL X,Y,X+7,Y+7,MENCOL
- MENCOL=MENCOL+1
- NEXT
- NEXT
- GFILL 8,32,15,39,0
- @SKIP
- BGPUT 1,1,4,16,0,0,0
- MENCOL=0
- COLOR BCOL
- '-Options Panel-
- COLOR TB
- LOCATE 18,2
- ?" ˜Options™";
- LOCATE 18,CSRY
- ?"˜•••••••••••”";
- LOCATE 18,CSRY
- ?"–Color –";
- LOCATE 18,CSRY
- ?"– –";
- LOCATE 18,CSRY
- ?"– Red: –";
- LOCATE 18,CSRY
- ?"– Green: –";
- LOCATE 18,CSRY
- ?"– Blue: –";
- LOCATE 18,CSRY
- ?"– Reset Color–";
- LOCATE 18,CSRY
- ?"– :XOR Mode –";
- LOCATE 18,CSRY
- ?"š••••••••••••›"
- LOCATE HX,HY
- ?"
- ";
- IF !MENPN THEN LOCATE HX,HY:?" ";
- LOCATE 20,10
- ?"ä";
- IF XA THEN LOCATE 20,10:?"à";
- GDRAWMD 0
- GFILL 152,40,255-8,40+7,INK
- GDRAWMD XA
- 'GPAGE 1
- GOSUB @BPRT
- BGFILL 1,19,5,30,5,BGCHR
- REDRAW=0
- GOTO @INKGET
- '•Tool Menu•
- @MTOOL
- REDRAW=1
- YMIN=4
- YMAX=12
- GPAGE 0
- BGPUT 1,1,4,0,0,0,0
- BGFILL 1,19,5,30,5,0
- GCLS
- CLS
- COLOR 0
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- '-Tool Panel-
- COLOR TA
- ?"˜Tool™
- ?"’•••••••••••••™"
- ?"– Pencil –"
- ?"– Line –"
- ?"– Eraser –"
- ?"– Fill –"
- ?"– Box –"
- ?"– Ellipse –"
- ?"– Dropper –"
- ?"– Spray Can –"
- ?"– Brush –"
- ?"– Copy –"
- ?"– Paste –"
- ?"š••••••••••••••›"
- LOCATE TMX,TMY
- ?"
- ";
- IF MENPN==1 THEN LOCATE TMX,TMY:?" ";
- GPAGE 1
- GOSUB @BPRT
- GOTO @TOOLGET
- '•Tool Menu Panel Check•
- @TMB
- IF MENPN==0 GOTO @TP1
- IF MENPN==1 GOTO @TP2
- GOTO @WAIT
- '•Tool Panel Input Check•
- @TP1
- IF B AND 1 GOTO @TU
- IF B AND 2 GOTO @TD
- GOTO @WAIT
- '•Options Panel Input Check•
- @TP2
- GOTO @WAIT
- '•Tool Cursor Up•
- @TU
- COLOR 0
- LOCATE TMX,TMY
- ?" ";
- TMY=TMY-1
- IF TMY<4 THEN TMY=4
- LOCATE TMX,TMY
- ?"
- ";
- GOTO @TOOLGET
- '•Tool Cusor Down•
- @TD
- COLOR 0
- LOCATE TMX,TMY
- ?" ";
- TMY=TMY+1
- IF TMY>14 THEN TMY=14
- LOCATE TMX,TMY
- ?"
- ";
- GOTO @TOOLGET
- '•Set Tool•
- @TOOLGET
- TVAL=TMY-4
- GOTO @TPINIT
- '•Tool Tip Panel Init•
- '-Creates Tip Panels
- ' on the Tool Menu-
- @TPINIT
- GPAGE 0
- GCLS
- ON TVAL GOSUB @TPOFF,@LP,@TPOFF,@TPOFF,@BP,@EP,@DP,@TPOFF,@TPOFF,@CP,@TPOFF
- GPAGE 1
- GOTO @WAIT
- '•Tool Tip Panel Clear•
- @TPOFF
- BGFILL 1,19,5,30,5,0
- BGFILL 1,17,4,30,4,0
- LOCATE 16,2
- ?" ";
- FOR I=2 TO 19
- LOCATE 16,CSRY
- ?" ";
- NEXT
- RETURN
- '•Line Tip Panel•
- @LP
- GOSUB @TPOFF
- COLOR TB
- LOCATE 16,2
- ?" ˜Tip™";
- LOCATE 16,CSRY
- ?"˜•••••••••••••”";
- LOCATE 16,CSRY
- ?"–Hold for –";
- LOCATE 16,CSRY
- ?"–perfect –";
- LOCATE 16,CSRY
- ?"–lines. –";
- LOCATE 16,CSRY
- ?"–Hold for –";
- LOCATE 16,CSRY
- ?"–perfect 45ß –";
- LOCATE 16,CSRY
- ?"–lines. –";
- LOCATE 16,CSRY
- ?"š••••••••••••••›";
- RETURN
- '•Box Tip Panel•
- @BP
- GOSUB @TPOFF
- COLOR TB
- LOCATE 16,2
- ?" ˜Tip™";
- LOCATE 16,CSRY
- ?"˜•••••••••••••”";
- LOCATE 16,CSRY
- ?"–Hold for a –";
- LOCATE 16,CSRY
- ?"–perfect square–";
- LOCATE 16,CSRY
- ?"–Hold for a –";
- LOCATE 16,CSRY
- ?"–filled box. –";
- LOCATE 16,CSRY
- ?"š••••••••••••••›";
- RETURN
- '•Ellipse Tip Panel•
- @EP
- GOSUB @TPOFF
- COLOR TB
- LOCATE 16,2
- ?" ˜Tip™";
- LOCATE 16,CSRY
- ?"˜•••••••••••••”";
- LOCATE 16,CSRY
- ?"–Hold for a –";
- LOCATE 16,CSRY
- ?"–perfect circle–";
- LOCATE 16,CSRY
- ?"š••••••••••••••›";
- RETURN
- '•Dropper Color Panel•
- @DP
- GOSUB @TPOFF
- COLOR TB
- LOCATE 16,2
- ?" ˜Color™";
- LOCATE 16,CSRY
- ?"˜•••••••••••••”";
- LOCATE 16,CSRY
- ?"– –";
- LOCATE 16,CSRY
- ?"š••••••••••••••›";
- GFILL 136,32,247,39,INK
- BGFILL 1,17,4,30,4,BGCHR
- GPAGE 1
- RETURN
- @CP
- GOSUB @TPOFF
- COLOR TB
- LOCATE 16,2
- ?" ˜Copy™";
- LOCATE 16,CSRY
- ?"˜•••••••••••••”";
- LOCATE 16,CSRY
- ?"–Hold to cut.–";
- LOCATE 16,CSRY
- ?"š••••••••••••••›";
- RETURN
- '•Color Menu Panel Check•
- @CMB
- IF !MENPN GOTO @CP1
- IF MENPN GOTO @CP2
- GOTO @WAIT
- '•Color Panel Input Check•
- @CP1
- IF B AND 1 GOTO @BU
- IF B AND 2 GOTO @BD
- IF B AND 4 GOTO @BLF
- IF B AND 8 GOTO @BR
- GOTO @WAIT
- '•Options Panel Input Check•
- @CP2
- IF B AND 1 THEN GOSUB @CU
- IF B AND 2 THEN GOSUB @CD
- IF B AND 4 GOTO @PM
- IF B AND 8 GOTO @PP
- IF B AND 16 GOTO @CP2A
- GOTO @WAIT
- '•Options Panel Check•
- @CP2A
- IF HY==9 GOTO @INKINIT
- IF HY==10 GOTO @XORTGL
- GOTO @WAIT
- '•Ink Palette Reset•
- @INKINIT
- GPAGE 0
- COLINIT "GRP",INK
- GPAGE 1
- COLINIT "GRP",INK
- COLREAD("GRP",INK),IR,IG,IB
- GOTO @INKGET
- '•Color Cursor Up•
- @BU
- MENFLG=1
- COLOR BCOL
- LOCATE BX,BY
- ?" ";
- BY=BY-1
- IF BY<4 THEN BY=4
- LOCATE BX,BY
- ?"ä";
- GOTO @INKSEL
- '•Color Cursor Down•
- @BD
- MENFLG=1
- COLOR BCOL
- LOCATE BX,BY
- ?" ";
- BY=BY+1
- IF BY>19 THEN BY=19
- LOCATE BX,BY
- ?"ä"
- GOTO @INKSEL
- '•Color Cursor Left•
- @BLF
- MENFLG=1
- COLOR BCOL
- LOCATE BX,BY
- ?" ";
- BX=BX-1
- IF BX<1 THEN BX=1
- LOCATE BX,BY
- ?"ä";
- GOTO @INKSEL
- '•Color Cursor Right•
- @BR
- MENFLG=1
- COLOR BCOL
- LOCATE BX,BY
- ?" ";
- BX=BX+1
- IF BX>16 THEN BX=16
- LOCATE BX,BY
- ?"ä";
- GOTO @INKSEL
- '•Ink Select•
- @INKSEL
- X$=HEX$(BX-1)
- Y$=HEX$(BY-4)
- C$="&H"+Y$+X$
- INK=VAL(C$)
- COLREAD("GRP",INK),IR,IG,IB
- GOTO @INKGET
- '•Get Ink Info•
- @INKGET
- COLOR TB
- GPAGE 0
- GDRAWMD 0
- GFILL 152,40,255-8,40+7,INK
- GDRAWMD XA
- GPAGE 1
- LOCATE 25,4
- ?" "
- LOCATE 25,4
- ? INK
- LOCATE 26,6
- ?" ";
- LOCATE 27,6
- ? IR;
- LOCATE 26,7
- ?" ";
- LOCATE 27,7
- ? IG;
- LOCATE 26,8
- ?" ";
- LOCATE 27,8
- ? IB;
- IF IR==0 THEN LOCATE 26,6:?" ";
- IF IR==255 THEN LOCATE 30,6:?" ";
- IF IG==0 THEN LOCATE 26,7:?" ";
- IF IG==255 THEN LOCATE 30,7:?" ";
- IF IB==0 THEN LOCATE 26,8:?" ";
- IF IB==255 THEN LOCATE 30,8:?" ";
- GOTO @WAIT
- '•XOR Mode Toggle•
- @XORTGL
- COLOR TB
- SWAP XA,XB
- GDRAWMD XA
- LOCATE 20,10
- ?"ä";
- IF XA THEN LOCATE 20,10:?"à";
- GOTO @WAIT
- '•Color Cursor Color•
- @BCOL
- IF MENPG OR MENPN THEN RETURN
- LOCATE BX,BY
- COLOR 15
- COLREAD("GRP",INK),R,G,B
- COLSET "BG",255,HEX$(255-R,2)+HEX$(255-G,2)+HEX$(255-B,2)
- IF INK==0 THEN ?"å"; ELSE ?"ä";
- RETURN
- '•Print Button Map•
- @BPRT
- LOCATE 0,21
- COLOR 0
- ?":Select :Undo/Redo"
- ?":Switch Panel :Switch Menu"
- ?"/:Move Cursor START:File Menu";
- RETURN
- '•Update Undo/Redo Buffer•
- @UPDATE
- GPAGE 1,PB,PG
- GCOPY PG,0,0,255,191,0,0,1
- SWAP PG,PB
- GPAGE 1,PG,PG
- RETURN
- '•Undo/Redo•
- @UNDO
- SWAP PG,PB
- GPAGE 1,PG,PG
- RETURN
- '•Color Changer
- @CC
- CLS
- ?"PocketPaint "+VERNUM$
- ?"•"*32;
- ?"˜Color•Changer™"
- ?"š•••••••••••••›"
- INPUT "Color to replace";REPL
- INPUT "Replace color with";COL
- ?"Working..."
- GOSUB @UPDATE
- FOR Y=0 TO 191
- FOR X=0 TO 255
- IF GSPOIT(X,Y)==REPL THEN GPAINT X,Y,COL
- NEXT
- NEXT
- GOTO @MINIT
- @QUIT
- FOR I=2 TO 3
- GPAGE 1,I,I
- GCLS 0
- NEXT
- ACLS
- BGMSTOP
- CHRINIT "BGU0"
- CHRINIT "SPS0"
- CLEAR
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement