Advertisement
TheFastFish

pnt

May 24th, 2016
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.41 KB | None | 0 0
  1. '•PocketPaint•••••••••••••••
  2. 'See VERNUM$ for version
  3. '•••••••••••••••••••••••••••
  4. '•Entry Point•
  5. '-Start of Program-
  6. ACLS
  7. GPAGE 1,0,0
  8. GCLS
  9. BGMSTOP
  10. FOR I=1 TO 3
  11. GPAGE 1,I,I
  12. GCLS 0
  13. NEXT
  14. CLEAR
  15. SPPAGE 1
  16. BGPAGE 1
  17. BG=&B01101
  18. BA=&B01111
  19. FOR Y=0 TO 63
  20. FOR X=0 TO 63
  21. BGPUT 1,X,Y,BG
  22. SWAP BG,BA
  23. NEXT
  24. SWAP BG,BA
  25. NEXT
  26. BGPAGE 0
  27. GPAGE 0
  28. GPRIO 2
  29. GPAGE 1
  30. GPRIO 2
  31. CHRINIT"BGU0"
  32. CHRINIT"BGFU"
  33. CHRSET"BGU0",16,"DDDDFFFF"*4+"FFFFDDDD"*4
  34. CHRSET"BGFU",228,"FFFFFFFF"+"F000000F"*6+"FFFFFFFF"
  35. CHRSET"BGFU",229,"FFFFEEEE"+"F000000E"*3+"E000000F"*3+"EEEEFFFF"
  36. CHRINIT"SPS0"
  37. CHRSET"SPS0",4,"0011110001111110111111111111111111111111111111110111111000111100"
  38. PNLTYPE"OFF"
  39. VERNUM$="Contest Release"
  40. MENPNA=1
  41. MT=10
  42. OB1=256
  43. OB2=512
  44. BX=1
  45. BY=5
  46. XB=1
  47. TB=2
  48. TMX=1
  49. TMY=4
  50. PG=1
  51. PB=3
  52. REDRAW=1
  53. INK=16
  54. BGCHR=&B10000
  55. GPAGE 1,PG,PG
  56. SPRAY_DENS=5
  57. DIM F$[20]
  58. F$[ 0]="@PENCIL"
  59. F$[ 1]="@LINE"
  60. F$[ 2]="@ERASE"
  61. F$[ 3]="@PAINT"
  62. F$[ 4]="@BOX"
  63. F$[ 5]="@ELIPS"
  64. F$[ 6]="@DROPPER"
  65. F$[ 7]="@SPRAY"
  66. F$[ 8]="@BRUSH"
  67. F$[ 9]="@COPY"
  68. F$[10]="@PASTE"
  69. SIZE=5
  70. FOR I=0 TO 3
  71. SPSET I,1,0,0,0,0,8,8
  72. SPHOME I,4,4
  73. NEXT
  74. GOSUB @NCSR
  75. FOR I=0 TO 3
  76. BREPEAT I,15,1
  77. NEXT
  78. MENPGA=1
  79. GOTO @MENU
  80.  
  81. '•Runs after welcome menu•
  82. @START
  83. GOTO @MCOL
  84.  
  85. '•Main Loop•
  86. '-Program waits for input-
  87. @WAIT
  88. VSYNC 1
  89. GOSUB @BCOL
  90. IF TCHST THEN GOSUB @TCHK
  91. B=BUTTON(1)
  92. IF B GOTO @BCHK
  93. GOTO @WAIT
  94.  
  95. '•Checks button input•
  96. @BCHK
  97. IF B AND 32 THEN GOSUB @UNDO
  98. IF B AND 256 GOTO @PSW
  99. IF B AND 512 GOTO @MSW
  100. IF B AND 1024 GOTO @FM
  101. GOTO @MCHK
  102. GOTO @WAIT
  103.  
  104. '•Checks current menu•
  105. @MCHK
  106. ON MENPG GOTO @CMB,@TMB
  107. GOTO @WAIT
  108.  
  109. '•Checks current tool•
  110. @TCHK
  111. GOSUB @BCOL
  112. MENFLG=0
  113. IF !TCHST THEN RETURN
  114. GOSUB F$[TVAL]
  115. RETURN
  116.  
  117. '•Pencil Tool•
  118. @PENCIL
  119. GOSUB @UPDATE
  120. SX=TCHX
  121. SY=TCHY
  122. @PL
  123. VSYNC 1
  124. EX=TCHX
  125. EY=TCHY
  126. GLINE SX,SY,EX,EY,INK
  127. SX=EX
  128. SY=EY
  129. IF TCHST GOTO @PL
  130. RETURN
  131.  
  132. '•Line Tool•
  133. @LINE
  134. SX=TCHX
  135. SY=TCHY
  136. GDRAWMD 1
  137. XC=255 XOR INK
  138. @LL
  139. LNCSR=1
  140. EX=TCHX
  141. EY=TCHY
  142. GLINE SX,SY,EX,EY,XC
  143. GOSUB @YCSR
  144. GLINE SX,SY,EX,EY,XC
  145. IF TCHST GOTO @LL
  146. GOSUB @NCSR
  147. GDRAWMD XA
  148. GOSUB @UPDATE
  149. GLINE SX,SY,EX,EY,INK
  150. LNCSR=0
  151. RETURN
  152.  
  153. '•Eraser Tool•
  154. @ERASE
  155. GOSUB @UPDATE
  156. ECSR=1
  157. @ERSL
  158. SX=TCHX
  159. SY=TCHY
  160. GOSUB @YCSR
  161. GFILL SX-3,SY-3,SX+4,SY+4,0
  162. IF TCHST GOTO @ERSL
  163. GOSUB @NCSR
  164. ECSR=0
  165. RETURN
  166.  
  167. '•Box Tool•
  168. '-Free Mode-
  169. @BOX
  170. SX=TCHX
  171. SY=TCHY
  172. GDRAWMD 1
  173. XC=255 XOR INK
  174. @BL
  175. B=BUTTON(0)
  176. IF B AND OB1 GOTO @SQUARE
  177. EX=TCHX
  178. EY=TCHY
  179. GBOX SX,SY,EX,EY,XC
  180. GOSUB @YCSR
  181. GBOX SX,SY,EX,EY,XC
  182. IF TCHST GOTO @BL
  183. GOSUB @NCSR
  184. GDRAWMD XA
  185. B=BUTTON(0)
  186. GOSUB @UPDATE
  187. IF B AND OB2 THEN GFILL SX,SY,EX,EY,INK ELSE GBOX SX,SY,EX,EY,INK
  188. RETURN
  189.  
  190. '•Box Tool•
  191. '-Square Mode-
  192. @SQUARE
  193. GDRAWMD 1
  194. B=BUTTON(0)
  195. IF !(B AND OB1) GOTO @BL
  196. DIST=SQR(POW(TCHX-SX,2)+POW(TCHY-SY,2))
  197. XD=DIST
  198. YD=DIST
  199. IF TCHX<SX THEN XD=-XD
  200. IF TCHY<SY THEN YD=-YD
  201. EX=SX+XD
  202. EY=SY+YD
  203. GBOX SX,SY,EX,EY,XC
  204. GOSUB @YCSR
  205. GBOX SX,SY,EX,EY,XC
  206. IF TCHST GOTO @SQUARE
  207. GOSUB @NCSR
  208. GDRAWMD XA
  209. GOSUB @UPDATE
  210. IF B AND OB2 THEN GFILL SX,SY,EX,EY,INK ELSE GBOX SX,SY,EX,EY,INK
  211. RETURN
  212.  
  213. '•Spray Tool•
  214. @SPRAY
  215. GOSUB @UPDATE
  216. @SPRL
  217. VSYNC 1
  218. TX=TCHX
  219. TY=TCHY
  220. FOR I=0 TO SPRAY_DENS
  221. SA=RND(361)
  222. SR=RND(SIZE)
  223. DX=SR*COS(RAD(SA))+TX
  224. DY=SR*SIN(RAD(SA))+TY
  225. GPSET DX,DY,INK
  226. NEXT
  227. IF TCHST GOTO @SPRL
  228. RETURN
  229.  
  230. '•Ellipse Tool•
  231. '-Free Mode-
  232. @ELIPS
  233. DMF=1
  234. SX=TCHX
  235. SY=TCHY
  236. GDRAWMD 1
  237. XC=255 XOR INK
  238. @EL
  239. B=BUTTON(0)
  240. IF B AND OB1 GOTO @CIRC
  241. EX=TCHX
  242. EY=TCHY
  243. GOSUB @YCSR
  244. SWAP INK,XC
  245. GOSUB @DRWELP
  246. GOSUB @DRWELP
  247. SWAP INK,XC
  248. IF TCHST GOTO @EL
  249. GOSUB @NCSR
  250. GDRAWMD XA
  251. DMF=0
  252. @DRWELP
  253. IF !DMF THEN GOSUB @UPDATE
  254. MX=EX-SX
  255. MY=EY-SY
  256. CX=EX-(MX/2)
  257. CY=EY-(MY/2)
  258. RX=ABS(EX-CX)
  259. RY=ABS(EY-CY)
  260. PX=RX*COS(0)+CX
  261. PY=RY*SIN(0)+CY
  262. FOR I=1 TO 360 STEP 2
  263. R=RAD(I)
  264. DX=RX*COS(R)+CX
  265. DY=RY*SIN(R)+CY
  266. GLINE PX,PY,DX,DY,INK
  267. PX=DX
  268. PY=DY
  269. NEXT
  270. RETURN
  271.  
  272. '•Ellipse Tool•
  273. '-Circle Mode-
  274. @CIRC
  275. B=BUTTON(0)
  276. IF !(B AND OB1) GOTO @EL
  277. DIST=SQR(POW(TCHX-SX,2)+POW(TCHY-SY,2))
  278. TX=TCHX
  279. TY=TCHY
  280. XD=DIST
  281. YD=DIST
  282. IF TX<SX THEN XD=-DIST
  283. IF TY<SY THEN YD=-DIST
  284. EX=SX+XD
  285. EY=SY+YD
  286. GOSUB @YCSR
  287. SWAP INK,XC
  288. GOSUB @DRWCRC
  289. GOSUB @DRWCRC
  290. SWAP INK,XC
  291. IF TCHST GOTO @CIRC
  292. GOSUB @NCSR
  293. GDRAWMD XA
  294. DMF=0
  295. @DRWCRC
  296. IF !DMF THEN GOSUB @UPDATE
  297. CR=DIST/2
  298. XR=CR
  299. YR=CR
  300. IF TX<SX THEN XR=-CR
  301. IF TY<SY THEN YR=-CR
  302. CX=EX-XR
  303. CY=EY-YR
  304. GCIRCLE CX,CY,CR,INK
  305. RETURN
  306.  
  307. '•Fill Tool•
  308. @PAINT
  309. GOSUB @UPDATE
  310. GPAINT TCHX,TCHY,INK
  311. RETURN
  312.  
  313. '•Brush Tool•
  314. @BRUSH
  315. GOSUB @UPDATE
  316. @BRL
  317. VSYNC 1
  318. EX=TCHX
  319. EY=TCHY
  320. GCIRCLE EX,EY,SIZE,INK
  321. GPAINT EX,EY,INK
  322. RETURN
  323.  
  324. '•Dropper Tool•
  325. @DROPPER
  326. INK=GSPOIT(TCHX,TCHY)
  327. I$=HEX$(INK)
  328. IF LEN(I$)<2 THEN I$="0"+I$
  329. BY=VAL("&H"+LEFT$(I$,1))+4
  330. BX=VAL("&H"+RIGHT$(I$,1))+1
  331. GPAGE 0
  332. GFILL 136,32,247,39,INK
  333. GPAGE 1
  334. RETURN
  335.  
  336. '•Copy Tool•
  337. @COPY
  338. SX=TCHX
  339. SY=TCHY
  340. @CPYL
  341. B=BUTTON(0)
  342. EX=TCHX
  343. EY=TCHY
  344. GOSUB @YCSR
  345. IF TCHST THEN @CPYL
  346. GOSUB @NCSR
  347. BSX=SX
  348. BSY=SY
  349. BEX=EX
  350. BEY=EY
  351. GPAGE 1,2,PG
  352. GCOPY PG,SX,SY,EX,EY,SX,SY,1
  353. GPAGE 1,PG,PG
  354. IF B AND 256 THEN GFILL SX,SY,EX,EY,0
  355. IF !CFLG THEN CFLG=1
  356. RETURN
  357.  
  358. '•Paste Tool•
  359. @PASTE
  360. IF !CFLG THEN RETURN
  361. SX=TCHX
  362. SY=TCHY
  363. EX=TCHX+(BEX-BSX)
  364. EY=TCHY+(BEY-BSY)
  365. GOSUB @YCSR
  366. IF TCHST THEN @PASTE
  367. GOSUB @NCSR
  368. GOSUB @UPDATE
  369. GCOPY 2,BSX,BSY,BEX,BEY,SX,SY,1
  370. RETURN
  371.  
  372. '•Show Cursors•
  373. @YCSR
  374. SPOFS 0,SX,SY
  375. IF ECSR THEN RETURN
  376. SPOFS 1,EX,EY
  377. IF LNCSR THEN RETURN
  378. SPOFS 2,SX,EY
  379. SPOFS 3,EX,SY
  380. RETURN
  381.  
  382. '•Hide Cursors•
  383. @NCSR
  384. FOR I=0 TO 3
  385. SPOFS I,-8,-8
  386. NEXT
  387. RETURN
  388.  
  389. '•Increase RGB Value•
  390. @PM
  391. IF HY==6 THEN IR=IR-1
  392. IF HY==7 THEN IG=IG-1
  393. IF HY==8 THEN IB=IB-1
  394. IF IR<0 THEN IR=0
  395. IF IG<0 THEN IG=0
  396. IF IB<0 THEN IB=0
  397. GOTO @PS
  398.  
  399. '•Decrease RGB Value•
  400. @PP
  401. IF HY==6 THEN IR=IR+1
  402. IF HY==7 THEN IG=IG+1
  403. IF HY==8 THEN IB=IB+1
  404. IF IR>255 THEN IR=255
  405. IF IG>255 THEN IG=255
  406. IF IB>255 THEN IB=255
  407. GOTO @PS
  408.  
  409. '•RGB-To-Palette•
  410. @PS
  411. RH$=HEX$(IR,2)
  412. GH$=HEX$(IG,2)
  413. BH$=HEX$(IB,2)
  414. CS$=RH$+GH$+BH$
  415. GPAGE 0
  416. COLSET "GRP",INK,CS$
  417. GPAGE 1
  418. COLSET "GRP",INK,CS$
  419. GOTO @INKGET
  420.  
  421. '•File Menu•
  422. @FM
  423. GOSUB @BCOL
  424. MENFLG=0
  425. HX=1
  426. HY=4
  427. YMIN=4
  428. YMAX=10
  429. GPAGE 0
  430. GCLS
  431. GPAGE 1,PG,PG
  432. CLS
  433. BGPUT 1,1,4,0
  434. BGFILL 1,19,5,30,5,0
  435. COLOR 0
  436. REDRAW=1
  437. ?"PocketPaint "+VERNUM$
  438. ?"•"*32;
  439. ?"˜File™"
  440. ?"’•••••••••••••™"
  441. ?"– Save... –"
  442. ?"– Load... –"
  443. ?"– Reset... –"
  444. ?"– Color Change –"
  445. ?"– Documentation–"
  446. ?"– Close Menu –"
  447. ?"– Exit –"
  448. ?"š••••••••••••••›"
  449. LOCATE HX,HY
  450. ?"
  451. ";
  452. GOSUB @BPRT
  453. @FL
  454. VSYNC 1
  455. B=BUTTON(1)
  456. IF B AND 1 THEN GOSUB @CU
  457. IF B AND 2 THEN GOSUB @CD
  458. IF B AND 1024 GOTO @MINIT
  459. IF B!=16 GOTO @FL
  460. IF HY== 4 THEN GOSUB @SAVE
  461. IF HY== 5 THEN GOSUB @LOAD
  462. IF HY== 6 GOTO @RESET
  463. IF HY== 7 GOTO @CC
  464. IF HY== 8 THEN GOSUB @DOCS
  465. IF HY== 9 GOTO @MINIT
  466. IF HY==10 THEN @QUIT
  467. GOTO @FM
  468.  
  469. @SAVE
  470. CLS
  471. HY=4
  472. YMAX=6
  473. ?"PocketPaint "+VERNUM$
  474. ?"•"*32;
  475. ?"˜Save™"
  476. ?"’••••••••™"
  477. ?"– Drawing –"
  478. ?"– Palette –"
  479. ?"– <Back –"
  480. ?"š•••••••••›"
  481. LOCATE HX,HY
  482. ?"
  483. ";
  484. @SML
  485. VSYNC 1
  486. B=BUTTON(1)
  487. IF B AND 1 THEN GOSUB @CU
  488. IF B AND 2 THEN GOSUB @CD
  489. IF B AND 1024 GOTO @MINIT
  490. IF B!=16 GOTO @SML
  491. IF HY==4 GOTO @SGRP
  492. IF HY==5 GOTO @SCOL
  493. IF HY==6 THEN RETURN
  494. GOTO @SAVE
  495.  
  496. @LOAD
  497. CLS
  498. HY=4
  499. YMAX=6
  500. ?"PocketPaint "+VERNUM$
  501. ?"•"*32;
  502. ?"˜Load™"
  503. ?"’••••••••™"
  504. ?"– Drawing –"
  505. ?"– Palette –"
  506. ?"– <Back –"
  507. ?"š•••••••••›"
  508. LOCATE HX,HY
  509. ?"
  510. ";
  511. @LML
  512. VSYNC 1
  513. B=BUTTON(1)
  514. IF B AND 1 THEN GOSUB @CU
  515. IF B AND 2 THEN GOSUB @CD
  516. IF B AND 1024 GOTO @MINIT
  517. IF B!=16 GOTO @LML
  518. IF HY==4 GOTO @LGRP
  519. IF HY==5 GOTO @LCOL
  520. IF HY==6 THEN RETURN
  521. GOTO @LOAD
  522.  
  523. @RESET
  524. CLS
  525. HY=4
  526. YMAX=6
  527. ?"PocketPaint "+VERNUM$
  528. ?"•"*32;
  529. ?"˜File>Reset™"
  530. ?"’••••••••••”"
  531. ?"– Drawing –"
  532. ?"– Palette –"
  533. ?"– <Back –"
  534. ?"š••••••••••›"
  535. LOCATE HX,HY
  536. ?"
  537. ";
  538. @RML
  539. VSYNC 1
  540. B=BUTTON(1)
  541. IF B AND 1 THEN GOSUB @CU
  542. IF B AND 2 THEN GOSUB @CD
  543. IF B AND 1024 GOTO @MINIT
  544. IF B!=16 GOTO @RML
  545. IF HY==4 GOTO @RC
  546. IF HY==5 GOTO @RP
  547. IF HY==6 GOTO @FM
  548. GOTO @RESET
  549.  
  550. '•Reset Canvas•
  551. @RC
  552. CLS
  553. ?"PocketPaint "+VERNUM$
  554. ?"•"*32;
  555. ?"˜New•Drawing™"
  556. ?"’••••••••••••™"
  557. ?"–Are you sure?–"
  558. ?"’•••••••••••••”"
  559. ?"– :Yes :No –"
  560. ?"š•••••••••••••›"
  561. @RCL
  562. VSYNC 1
  563. B=BUTTON(1)
  564. IF B AND 16 THEN @RCR
  565. IF B AND 32 THEN @MINIT
  566. GOTO @RCL
  567. @RCR
  568. GOSUB @UPDATE
  569. GCLS
  570. GOTO @MINIT
  571.  
  572. '•Reset Palette•
  573. @RP
  574. CLS
  575. ?"PocketPaint "+VERNUM$
  576. ?"•"*32;
  577. ?"˜Reset•Palette™"
  578. ?"’•••••••••••••”"
  579. ?"–Are you sure?–"
  580. ?"’•••••••••••••”"
  581. ?"– :Yes :No –"
  582. ?"š•••••••••••••›"
  583. @RPL
  584. VSYNC 1
  585. B=BUTTON(1)
  586. IF B AND 16 THEN @RPR
  587. IF B AND 32 THEN @MINIT
  588. GOTO @RPL
  589. @RPR
  590. GPAGE 0
  591. COLINIT "GRP"
  592. GPAGE 1
  593. COLINIT "GRP"
  594. GOTO @MINIT
  595.  
  596. '•Generic Cursor Up•
  597. @CU
  598. COLOR 0
  599. LOCATE HX,HY
  600. ?" ";
  601. HY=HY-1
  602. IF HY<YMIN THEN HY=YMIN
  603. LOCATE HX,HY
  604. ?"
  605. "
  606. RETURN
  607.  
  608. '•Generic Cursor Down•
  609. @CD
  610. COLOR 0
  611. LOCATE HX,HY
  612. ?" ";
  613. HY=HY+1
  614. IF HY>YMAX THEN HY=YMAX
  615. LOCATE HX,HY
  616. ?"
  617. "
  618. RETURN
  619.  
  620. '•Welcome Menu•
  621. @MENU
  622. HX=1
  623. HY=4
  624. YMIN=4
  625. YMAX=7
  626. CLS
  627. ?"PocketPaint "+VERNUM$
  628. ?"•"*32;
  629. ?"˜Welcome™
  630. ?"’•••••••••••••™"
  631. ?"– New Drawing –"
  632. ?"– Load... –"
  633. ?"– Documentation–"
  634. ?"– Exit –"
  635. ?"š••••••••••••••›"
  636. LOCATE HX,HY
  637. ?"
  638. "
  639. @ML
  640. VSYNC 1
  641. B=BUTTON(1)
  642. IF B AND 16 GOTO @MS
  643. IF B AND 1 THEN GOSUB @CU
  644. IF B AND 2 THEN GOSUB @CD
  645. GOTO @ML
  646.  
  647. '•Welcome Menu  Check•
  648. @MS
  649. IF HY==4 THEN GOTO @START
  650. IF HY==5 THEN GOSUB @LOAD:GOTO @MENU
  651. IF HY==6 THEN GOSUB @DOCS
  652. IF HY==7 THEN @QUIT
  653. GOTO @MENU
  654.  
  655. '•Save Drawing•
  656. @SGRP
  657. CLS
  658. ?"PocketPaint "+VERNUM$
  659. ?"•"*32;
  660. ?"˜Save•Drawing™"
  661. ?"’•••••••••••••™"
  662. ?"–Input filename–"
  663. ?"š••••••••••••••›"
  664. LOCATE 0,7
  665. ?"•"*8
  666. @SDI
  667. LOCATE 0,6
  668. LINPUT FN$
  669. IF FN$=="" THEN LOCATE 0,8:?"String cannot be empty"+CHR$(0)*10:GOTO @SDI
  670. IF LEN(FN$)>8 THEN LOCATE 0,8:?"String too long"+CHR$(0)*17:LOCATE 0,6:?CHR$(0)*32;:GOTO @SDI
  671. LOCATE 0,8
  672. ?CHR$(0)*32
  673. SYSBEEP=0
  674. SAVE"GRP"+STR$(PG)+":"+FN$
  675. SYSBEEP=1
  676. GOTO @MINIT
  677.  
  678. '•Save Palette•
  679. @SCOL
  680. CLS
  681. ?"PocketPaint "+VERNUM$
  682. ?"•"*32;
  683. ?"˜Save•Palette™"
  684. ?"’•••••••••••••™"
  685. ?"–Input filename–"
  686. ?"š••••••••••••••›"
  687. LOCATE 0,7
  688. ?"•"*8
  689. @SPI
  690. LOCATE 0,6
  691. LINPUT FN$
  692. IF FN$=="" THEN LOCATE 0,8:?"String cannot be empty"+CHR$(0)*10;:GOTO @SDI
  693. IF LEN(FN$)>8 THEN LOCATE 0,8:?"String too long"+CHR$(0)*17:LOCATE 0,6:?CHR$(0)*32;:GOTO @SDI
  694. LOCATE 0,8
  695. ?CHR$(0)*32
  696. SYSBEEP=0
  697. SAVE"COL2U:"+FN$
  698. SYSBEEP=1
  699. GOTO @MINIT
  700.  
  701. '•Load Drawing•
  702. @LGRP
  703. CLS
  704. ?"PocketPaint "+VERNUM$
  705. ?"•"*32;
  706. ?"˜Load•Drawing™"
  707. ?"’•••••••••••••™"
  708. ?"–Input filename–"
  709. ?"š••••••••••••••›"
  710. LOCATE 0,7
  711. ?"•"*8
  712. @LPI
  713. LOCATE 0,6
  714. LINPUT FN$
  715. IF FN$=="" THEN LOCATE 0,8:?"String cannot be empty"+CHR$(0)*10;:GOTO @LPI
  716. IF LEN(FN$)>8 THEN LOCATE 0,8:?"String too long"+CHR$(0)*17:LOCATE 0,6:?CHR$(0)*32;:GOTO @LPI
  717. LOCATE 0,8
  718. ?CHR$(0)*32
  719. GOSUB @UPDATE
  720. SYSBEEP=0
  721. LOAD"GRP"+STR$(PG)+":"+FN$,0
  722. SYSBEEP=1
  723. GOTO @MINIT
  724.  
  725. '•Load Palette•
  726. @LCOL
  727. CLS
  728. ?"PocketPaint "+VERNUM$
  729. ?"•"*32;
  730. ?"˜Load•Drawing™"
  731. ?"’•••••••••••••™"
  732. ?"–Input filename–"
  733. ?"š••••••••••••••›"
  734. LOCATE 0,7
  735. ?"•"*8
  736. @LDI
  737. LOCATE 0,6
  738. LINPUT FN$
  739. IF FN$=="" THEN LOCATE 0,8:?"String cannot be empty"+CHR$(0)*10;:GOTO @LDI
  740. IF LEN(FN$)>8 THEN LOCATE 0,8:?"String too long"+CHR$(0)*17:LOCATE 0,6:?CHR$(0)*32;:GOTO @LDI
  741. LOCATE 0,8
  742. ?CHR$(0)*32
  743. SYSBEEP=0
  744. LOAD"COL2U:"+FN$,0
  745. LOAD"COL2L:"+FN$,0
  746. SYSBEEP=1
  747. FLP=1
  748. GOTO @MINIT
  749.  
  750. '•Documentation Screen•
  751. @DOCS
  752. CLS
  753. ?"PocketPaint "+VERNUM$
  754. ?"•"*32;
  755. ?"˜Documentation™"
  756. ?"’••••••••••••••••••••••™"
  757. ?"–Menu Controls –"
  758. ?"– /:Move Cursor –"
  759. ?"– :Select –"
  760. ?"– :Undo/Redo –"
  761. ?"– :Switch Panel –"
  762. ?"– :Switch Menu –"
  763. ?"– START:Toggle File Menu–"
  764. ?"š•••••••••••••••••••••••›"
  765. LOCATE 0,23
  766. ?"Press any button...";
  767. @DL
  768. VSYNC 1
  769. IF BUTTON(1) THEN RETURN
  770. GOTO @DL
  771.  
  772. '•Switch Menu•
  773. @MSW
  774. IF MENPN THEN FIXER=1:GOTO @PSW
  775. GOSUB @BCOL
  776. MENFLG=0
  777. SWAP MENPG,MENPGA
  778. GOTO @MINIT
  779.  
  780. '•Switch Panel•
  781. @PSW
  782. IF MENPG AND !FIXER THEN GOTO @MINIT
  783. GOSUB @BCOL
  784. MENFLG=0
  785. SWAP MENPN,MENPNA
  786. SWAP TA,TB
  787. IF FIXER THEN FIXER=0:GOTO @MSW
  788. GOTO @MINIT
  789.  
  790. '•Menu Init•
  791. '-Creates Top-Sceen Menus-
  792. @MINIT
  793. ON MENPG GOTO @MCOL,@MTOOL
  794. GOTO @WAIT
  795.  
  796. '•Color Menu•
  797. @MCOL
  798. HX=19
  799. HY=6
  800. YMIN=6
  801. YMAX=10
  802. CLS
  803. COLOR 0
  804. ?"PocketPaint "+VERNUM$
  805. ?"•"*32;
  806. '-Color Panel-
  807. COLOR TA
  808. ?"˜Color™"
  809. ?"’•••••••••••••••™"
  810. FOR I=0 TO 15
  811. ?"– –"
  812. NEXT
  813. ?"š••••••••••••••••›"
  814. BGFILL 1,17,4,30,4,0
  815. BGPUT 1,1,4,BGCHR
  816. GPAGE 0
  817. IF !REDRAW THEN @SKIP
  818. GCLS
  819. FOR Y=32 TO 152 STEP 8
  820. FOR X=8 TO 127+8 STEP 8
  821. GFILL X,Y,X+7,Y+7,MENCOL
  822. MENCOL=MENCOL+1
  823. NEXT
  824. NEXT
  825. GFILL 8,32,15,39,0
  826. @SKIP
  827. BGPUT 1,1,4,16,0,0,0
  828. MENCOL=0
  829. COLOR BCOL
  830. '-Options Panel-
  831. COLOR TB
  832. LOCATE 18,2
  833. ?" ˜Options™";
  834. LOCATE 18,CSRY
  835. ?"˜•••••••••••”";
  836. LOCATE 18,CSRY
  837. ?"–Color –";
  838. LOCATE 18,CSRY
  839. ?"– –";
  840. LOCATE 18,CSRY
  841. ?"– Red: –";
  842. LOCATE 18,CSRY
  843. ?"– Green: –";
  844. LOCATE 18,CSRY
  845. ?"– Blue: –";
  846. LOCATE 18,CSRY
  847. ?"– Reset Color–";
  848. LOCATE 18,CSRY
  849. ?"– :XOR Mode –";
  850. LOCATE 18,CSRY
  851. ?"š••••••••••••›"
  852. LOCATE HX,HY
  853. ?"
  854. ";
  855. IF !MENPN THEN LOCATE HX,HY:?" ";
  856. LOCATE 20,10
  857. ?"ä";
  858. IF XA THEN LOCATE 20,10:?"à";
  859. GDRAWMD 0
  860. GFILL 152,40,255-8,40+7,INK
  861. GDRAWMD XA
  862. 'GPAGE 1
  863. GOSUB @BPRT
  864. BGFILL 1,19,5,30,5,BGCHR
  865. REDRAW=0
  866. GOTO @INKGET
  867.  
  868. '•Tool Menu•
  869. @MTOOL
  870. REDRAW=1
  871. YMIN=4
  872. YMAX=12
  873. GPAGE 0
  874. BGPUT 1,1,4,0,0,0,0
  875. BGFILL 1,19,5,30,5,0
  876. GCLS
  877. CLS
  878. COLOR 0
  879. ?"PocketPaint "+VERNUM$
  880. ?"•"*32;
  881. '-Tool Panel-
  882. COLOR TA
  883. ?"˜Tool™
  884. ?"’•••••••••••••™"
  885. ?"– Pencil –"
  886. ?"– Line –"
  887. ?"– Eraser –"
  888. ?"– Fill –"
  889. ?"– Box –"
  890. ?"– Ellipse –"
  891. ?"– Dropper –"
  892. ?"– Spray Can –"
  893. ?"– Brush –"
  894. ?"– Copy –"
  895. ?"– Paste –"
  896. ?"š••••••••••••••›"
  897. LOCATE TMX,TMY
  898. ?"
  899. ";
  900. IF MENPN==1 THEN LOCATE TMX,TMY:?" ";
  901. GPAGE 1
  902. GOSUB @BPRT
  903. GOTO @TOOLGET
  904.  
  905. '•Tool Menu Panel Check•
  906. @TMB
  907. IF MENPN==0 GOTO @TP1
  908. IF MENPN==1 GOTO @TP2
  909. GOTO @WAIT
  910.  
  911. '•Tool Panel Input Check•
  912. @TP1
  913. IF B AND 1 GOTO @TU
  914. IF B AND 2 GOTO @TD
  915. GOTO @WAIT
  916.  
  917. '•Options Panel Input Check•
  918. @TP2
  919. GOTO @WAIT
  920.  
  921. '•Tool Cursor Up•
  922. @TU
  923. COLOR 0
  924. LOCATE TMX,TMY
  925. ?" ";
  926. TMY=TMY-1
  927. IF TMY<4 THEN TMY=4
  928. LOCATE TMX,TMY
  929. ?"
  930. ";
  931. GOTO @TOOLGET
  932.  
  933. '•Tool Cusor Down•
  934. @TD
  935. COLOR 0
  936. LOCATE TMX,TMY
  937. ?" ";
  938. TMY=TMY+1
  939. IF TMY>14 THEN TMY=14
  940. LOCATE TMX,TMY
  941. ?"
  942. ";
  943. GOTO @TOOLGET
  944.  
  945. '•Set Tool•
  946. @TOOLGET
  947. TVAL=TMY-4
  948. GOTO @TPINIT
  949.  
  950. '•Tool Tip Panel Init•
  951. '-Creates Tip Panels
  952. ' on the Tool Menu-
  953. @TPINIT
  954. GPAGE 0
  955. GCLS
  956. ON TVAL GOSUB @TPOFF,@LP,@TPOFF,@TPOFF,@BP,@EP,@DP,@TPOFF,@TPOFF,@CP,@TPOFF
  957. GPAGE 1
  958. GOTO @WAIT
  959.  
  960. '•Tool Tip Panel Clear•
  961. @TPOFF
  962. BGFILL 1,19,5,30,5,0
  963. BGFILL 1,17,4,30,4,0
  964. LOCATE 16,2
  965. ?" ";
  966. FOR I=2 TO 19
  967. LOCATE 16,CSRY
  968. ?" ";
  969. NEXT
  970. RETURN
  971.  
  972. '•Line Tip Panel•
  973. @LP
  974. GOSUB @TPOFF
  975. COLOR TB
  976. LOCATE 16,2
  977. ?" ˜Tip™";
  978. LOCATE 16,CSRY
  979. ?"˜•••••••••••••”";
  980. LOCATE 16,CSRY
  981. ?"–Hold for –";
  982. LOCATE 16,CSRY
  983. ?"–perfect  –";
  984. LOCATE 16,CSRY
  985. ?"–lines. –";
  986. LOCATE 16,CSRY
  987. ?"–Hold  for –";
  988. LOCATE 16,CSRY
  989. ?"–perfect 45ß –";
  990. LOCATE 16,CSRY
  991. ?"–lines. –";
  992. LOCATE 16,CSRY
  993. ?"š••••••••••••••›";
  994. RETURN
  995.  
  996. '•Box Tip Panel•
  997. @BP
  998. GOSUB @TPOFF
  999. COLOR TB
  1000. LOCATE 16,2
  1001. ?" ˜Tip™";
  1002. LOCATE 16,CSRY
  1003. ?"˜•••••••••••••”";
  1004. LOCATE 16,CSRY
  1005. ?"–Hold for a –";
  1006. LOCATE 16,CSRY
  1007. ?"–perfect square–";
  1008. LOCATE 16,CSRY
  1009. ?"–Hold  for a –";
  1010. LOCATE 16,CSRY
  1011. ?"–filled box. –";
  1012. LOCATE 16,CSRY
  1013. ?"š••••••••••••••›";
  1014. RETURN
  1015.  
  1016. '•Ellipse Tip Panel•
  1017. @EP
  1018. GOSUB @TPOFF
  1019. COLOR TB
  1020. LOCATE 16,2
  1021. ?" ˜Tip™";
  1022. LOCATE 16,CSRY
  1023. ?"˜•••••••••••••”";
  1024. LOCATE 16,CSRY
  1025. ?"–Hold for a –";
  1026. LOCATE 16,CSRY
  1027. ?"–perfect circle–";
  1028. LOCATE 16,CSRY
  1029. ?"š••••••••••••••›";
  1030. RETURN
  1031.  
  1032. '•Dropper Color Panel•
  1033. @DP
  1034. GOSUB @TPOFF
  1035. COLOR TB
  1036. LOCATE 16,2
  1037. ?" ˜Color™";
  1038. LOCATE 16,CSRY
  1039. ?"˜•••••••••••••”";
  1040. LOCATE 16,CSRY
  1041. ?"– –";
  1042. LOCATE 16,CSRY
  1043. ?"š••••••••••••••›";
  1044. GFILL 136,32,247,39,INK
  1045. BGFILL 1,17,4,30,4,BGCHR
  1046. GPAGE 1
  1047. RETURN
  1048.  
  1049. @CP
  1050. GOSUB @TPOFF
  1051. COLOR TB
  1052. LOCATE 16,2
  1053. ?" ˜Copy™";
  1054. LOCATE 16,CSRY
  1055. ?"˜•••••••••••••”";
  1056. LOCATE 16,CSRY
  1057. ?"–Hold to cut.–";
  1058. LOCATE 16,CSRY
  1059. ?"š••••••••••••••›";
  1060. RETURN
  1061.  
  1062. '•Color Menu Panel Check•
  1063. @CMB
  1064. IF !MENPN GOTO @CP1
  1065. IF MENPN GOTO @CP2
  1066. GOTO @WAIT
  1067.  
  1068. '•Color Panel Input Check•
  1069. @CP1
  1070. IF B AND 1 GOTO @BU
  1071. IF B AND 2 GOTO @BD
  1072. IF B AND 4 GOTO @BLF
  1073. IF B AND 8 GOTO @BR
  1074. GOTO @WAIT
  1075.  
  1076. '•Options Panel Input Check•
  1077. @CP2
  1078. IF B AND 1 THEN GOSUB @CU
  1079. IF B AND 2 THEN GOSUB @CD
  1080. IF B AND 4 GOTO @PM
  1081. IF B AND 8 GOTO @PP
  1082. IF B AND 16 GOTO @CP2A
  1083. GOTO @WAIT
  1084.  
  1085. '•Options Panel  Check•
  1086. @CP2A
  1087. IF HY==9 GOTO @INKINIT
  1088. IF HY==10 GOTO @XORTGL
  1089. GOTO @WAIT
  1090.  
  1091. '•Ink Palette Reset•
  1092. @INKINIT
  1093. GPAGE 0
  1094. COLINIT "GRP",INK
  1095. GPAGE 1
  1096. COLINIT "GRP",INK
  1097. COLREAD("GRP",INK),IR,IG,IB
  1098. GOTO @INKGET
  1099.  
  1100. '•Color Cursor Up•
  1101. @BU
  1102. MENFLG=1
  1103. COLOR BCOL
  1104. LOCATE BX,BY
  1105. ?" ";
  1106. BY=BY-1
  1107. IF BY<4 THEN BY=4
  1108. LOCATE BX,BY
  1109. ?"ä";
  1110. GOTO @INKSEL
  1111.  
  1112. '•Color Cursor Down•
  1113. @BD
  1114. MENFLG=1
  1115. COLOR BCOL
  1116. LOCATE BX,BY
  1117. ?" ";
  1118. BY=BY+1
  1119. IF BY>19 THEN BY=19
  1120. LOCATE BX,BY
  1121. ?"ä"
  1122. GOTO @INKSEL
  1123.  
  1124. '•Color Cursor Left•
  1125. @BLF
  1126. MENFLG=1
  1127. COLOR BCOL
  1128. LOCATE BX,BY
  1129. ?" ";
  1130. BX=BX-1
  1131. IF BX<1 THEN BX=1
  1132. LOCATE BX,BY
  1133. ?"ä";
  1134. GOTO @INKSEL
  1135.  
  1136. '•Color Cursor Right•
  1137. @BR
  1138. MENFLG=1
  1139. COLOR BCOL
  1140. LOCATE BX,BY
  1141. ?" ";
  1142. BX=BX+1
  1143. IF BX>16 THEN BX=16
  1144. LOCATE BX,BY
  1145. ?"ä";
  1146. GOTO @INKSEL
  1147.  
  1148. '•Ink Select•
  1149. @INKSEL
  1150. X$=HEX$(BX-1)
  1151. Y$=HEX$(BY-4)
  1152. C$="&H"+Y$+X$
  1153. INK=VAL(C$)
  1154. COLREAD("GRP",INK),IR,IG,IB
  1155. GOTO @INKGET
  1156.  
  1157. '•Get Ink Info•
  1158. @INKGET
  1159. COLOR TB
  1160. GPAGE 0
  1161. GDRAWMD 0
  1162. GFILL 152,40,255-8,40+7,INK
  1163. GDRAWMD XA
  1164. GPAGE 1
  1165. LOCATE 25,4
  1166. ?" "
  1167. LOCATE 25,4
  1168. ? INK
  1169. LOCATE 26,6
  1170. ?" ";
  1171. LOCATE 27,6
  1172. ? IR;
  1173. LOCATE 26,7
  1174. ?" ";
  1175. LOCATE 27,7
  1176. ? IG;
  1177. LOCATE 26,8
  1178. ?" ";
  1179. LOCATE 27,8
  1180. ? IB;
  1181. IF IR==0 THEN LOCATE 26,6:?" ";
  1182. IF IR==255 THEN LOCATE 30,6:?" ";
  1183. IF IG==0 THEN LOCATE 26,7:?" ";
  1184. IF IG==255 THEN LOCATE 30,7:?" ";
  1185. IF IB==0 THEN LOCATE 26,8:?" ";
  1186. IF IB==255 THEN LOCATE 30,8:?" ";
  1187. GOTO @WAIT
  1188.  
  1189. '•XOR Mode Toggle•
  1190. @XORTGL
  1191. COLOR TB
  1192. SWAP XA,XB
  1193. GDRAWMD XA
  1194. LOCATE 20,10
  1195. ?"ä";
  1196. IF XA THEN LOCATE 20,10:?"à";
  1197. GOTO @WAIT
  1198.  
  1199. '•Color Cursor Color•
  1200. @BCOL
  1201. IF MENPG OR MENPN THEN RETURN
  1202. LOCATE BX,BY
  1203. COLOR 15
  1204. COLREAD("GRP",INK),R,G,B
  1205. COLSET "BG",255,HEX$(255-R,2)+HEX$(255-G,2)+HEX$(255-B,2)
  1206. IF INK==0 THEN ?"å"; ELSE ?"ä";
  1207. RETURN
  1208.  
  1209. '•Print Button Map•
  1210. @BPRT
  1211. LOCATE 0,21
  1212. COLOR 0
  1213. ?":Select :Undo/Redo"
  1214. ?" :Switch Panel :Switch Menu"
  1215. ?"/:Move Cursor START:File Menu";
  1216. RETURN
  1217.  
  1218. '•Update Undo/Redo Buffer•
  1219. @UPDATE
  1220. GPAGE 1,PB,PG
  1221. GCOPY PG,0,0,255,191,0,0,1
  1222. SWAP PG,PB
  1223. GPAGE 1,PG,PG
  1224. RETURN
  1225.  
  1226. '•Undo/Redo•
  1227. @UNDO
  1228. SWAP PG,PB
  1229. GPAGE 1,PG,PG
  1230. RETURN
  1231.  
  1232. '•Color Changer
  1233. @CC
  1234. CLS
  1235. ?"PocketPaint "+VERNUM$
  1236. ?"•"*32;
  1237. ?"˜Color•Changer™"
  1238. ?"š•••••••••••••›"
  1239. INPUT "Color to replace";REPL
  1240. INPUT "Replace color with";COL
  1241. ?"Working..."
  1242. GOSUB @UPDATE
  1243. FOR Y=0 TO 191
  1244. FOR X=0 TO 255
  1245. IF GSPOIT(X,Y)==REPL THEN GPAINT X,Y,COL
  1246. NEXT
  1247. NEXT
  1248. GOTO @MINIT
  1249.  
  1250. @QUIT
  1251. FOR I=2 TO 3
  1252. GPAGE 1,I,I
  1253. GCLS 0
  1254. NEXT
  1255. ACLS
  1256. BGMSTOP
  1257. CHRINIT "BGU0"
  1258. CHRINIT "SPS0"
  1259. CLEAR
  1260. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement