Teletext paint program

bbc micro/electron/atom/risc os coding queries and routines
User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Tue Aug 25, 2020 1:06 pm

Were the BMP's cut off?

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Tue Aug 25, 2020 8:09 pm

Apologies Fourthstone. My mistake. It must have been a glitch at lunch.
I re-tried exporting again and is all well with the frames.

I'm going to experiment with a few things and see if I can load a digitised picture into it and duplicate it....that will be interesting.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Tue Aug 25, 2020 8:37 pm

Yeh I was just mucking around and tried to load this in but had no luck...of course I would really be using the ipad most of the time so it wouldn't really apply but I do sit at the computer as well...anyway I tried exporting as a .bin file from zxnet and imported it into the bbc basic folder but didn't have much luck loading it in...sorry I know I am alway trying to do so much and firing things at you all the time!

https://zxnet.co.uk/teletext/editor/#0: ... E=0:zx=AA0

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Tue Aug 25, 2020 8:48 pm

That is great the way you have got lines moving .....yet again just amazing.....how do you work these things out I wonder. My head spins. You have to use that Bresenham line algorithm but how do you plot points and give spaces in between and then make it move along a line. Arrgh just thinking about it makes me feel like I am doing an exam at school where you open the page and can't answer a single question!

I have a sense of Deja vu with it all from the last art program!

I get really excited at the thought these can be uploaded to real teletext sites. That is so cool.

The art programs mirror each other in a way....the 8 frames and colour cycling.....it's similar .....

It might be quite handy if you can chuck cursor keys left and right on a qwerty keyboard to move through the frames up and down if that isn't too much trouble. There are times I will be at the computer not the ipad...sometimes I do like to do things on a computer as it's different painting with a mouse....but at least the flexibility is there now to do what we like.

I wonder why those digitised pics don't load in.....
Oh another thing if this isn't too much bother.....in the file loader it would be good if one could sort by date saved as I had to do quite a lot of scrolling to get to my digitised pic at the bottom of the pile....even if it displayed most recent files first that might be better thank you.

I think soon we are ready to unleash it onto the world. We are going to have to come up with a name. Artelly is one that is catchy....I always like naming programs with something easy to remember as trying to remember the name of programs can be hard when you are going back through your memory looking for something.....Tele7 is another one.....art7eva is another...you will have to have a go Fourthstone! (or any suggestions appreciated)

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Tue Aug 25, 2020 11:00 pm

Added single file load, file must have ".bin" extension.

Added left and right cursor key to change frame, currently single key press per frame change, can be changed if you want it more fluid.

Added a really amateur file sort hack, it's basically a reverse sort, need to spend more time improving the load dialog but I'm still wrapping my head around the library.

With the name, it would be awesome to have a mode 7 animated screen which loads when the program is launched and shows off some of the abilities of the program itself. I like the names M7 or ART7, Tele7 is good too, a nice letter box design with a few animated parts flash up before the program loads would be awesome.

EDIT: Added rectangle animation, and it's faster now as I use the buffer to draw the updates... also how about TelePaint :mrgreen:

Code: Select all

      MODE 7

      REM *** TODO LIST ***

      REM *** INKEY(-256) MATRIX BRANYDY &4D (INCLUDE OTHERS)

      REM *** INVESTIGATE LOCAL VERSIONS OF LIBRARIES TO MAKE PROGRAM CROSS BASIC COMPATIBLE

      REM *** SCROLLING, POSSIBLY ADD TO DUPLICATE DIALOG SO A SCENE CAN BE COPIED AND SCROLLED

      REM *** LOAD SCREEN SORT BY NEWEST, HACKED A QUICK FIX

      REM *** COPY AND PASTE

      REM *** REDO, AND WHILE I'M AT IT ADD UNDOS & REDOS FOR EACH FRAME

      REM *** FLASHING COLOURS, THIS IS DRAWING SHAPES ACROSS FRAMES, HAVE BEGUN IMPLEMENTING ANIMATED LINE TOOL

      REM *** TODO LIST ***

      INSTALL @lib$+"sortlib"
      INSTALL @lib$+"stringlib"
      INSTALL @lib$+"dlglib"
      INSTALL @lib$+"filedlg"

      REM FOR 64 BIT COMPARISONS, ESC OFF FOR BACK ARROW ON SOME DEVICES
      *HEX 64
      *ESC OFF

      MOUSE ON 3

      REM drawing bounds used for < and >
      xMin%=1
      xMax%=80
      yMin%=2
      yMax%=75


      REM fill bounds & BUFFER used with < and >
      fxMin%=2
      fxMax%=80
      fyMin%=3
      fyMax%=74
      DIM fill{(100) x%,y%}

      REM UNDO TEST ARRAY
      UNDO_MAX%=19
      DIM UNDO_BUFFER(UNDO_MAX%,959)
      UNDO_INDEX%=0

      REM FRAME BUFFER ARRAY
      frame_max%=8
      DIM FRAME_BUFFER(frame_max%,959)

      REM OLD PIXEL & MOUSE COORDS
      OLD_PX%=0
      OLD_PY%=0
      OLD_MX%=0
      OLD_MY%=0
      OLD_TX%=0
      OLD_TY%=0

      REM MOUSE COORDS
      MX%=0
      MY%=0
      MB%=0

      REM TEXT & PIXEL COORDS FOR CURRENT MOUSE READ LOCATION
      TX%=0
      TY%=0
      PX%=0
      PY%=0

      REM TOOL VARS
      curcol%=7
      bakcol%=0
      toolsel%=1
      toolcursor%=15
      animateline%=0
      animaterect%=0
      erase%=0
      dither%=0
      frame%=1
      animation%=0
      menuext%=0

      REM FILE DIALOG
      N%=0

      PROCGR(curcol%,bakcol%)
      PROCdrawmenu

      FOR frame%=1 TO frame_max%
        PROCframesave(frame%)
        REM WAIT 10
      NEXT frame%
      frame%=1


      REPEAT

        PROCREADMOUSE

        IF MX%<>OLD_MX% OR MY%<>OLD_MY% OR MB% THEN
          IF TY%=0 THEN
            REM CLICK INSIDE MENU AREA
            IF MB%=4 THEN
              CASE TX% OF
                WHEN 0:
                  IF menuext%=0 THEN
                    menuext%=1: PROCundosave
                  ELSE
                    menuext%=0: PROCundorestore
                  ENDIF
                WHEN 1: curcol%=1
                WHEN 3: curcol%=2
                WHEN 5: curcol%=3
                WHEN 7: curcol%=4
                WHEN 9: curcol%=5
                WHEN 11: curcol%=6
                WHEN 13: curcol%=7

                WHEN 15: toolsel%=1:toolcursor%=TX%: REM PAINT
                WHEN 16: toolsel%=2:toolcursor%=TX%: REM DITHER
                WHEN 17: dither%=(dither%+1) MOD 5: REM DITHER SCALE
                WHEN 18: PROCundorestore: REM UNDO

                WHEN 20: erase%=(erase%+1) AND 1: REM TOGLE ERASER

                WHEN 22: PROCclearscreen : REM CLEARSCREEN
                WHEN 23: toolsel%=5:toolcursor%=TX%: REM BACKGROUND COLOUR
                WHEN 24: toolsel%=6:toolcursor%=TX%: REM FORGROUND

                WHEN 26: toolsel%=7:toolcursor%=TX%: REM CIRCEL
                WHEN 27: toolsel%=8:toolcursor%=TX%: REM RECTANGLE
                WHEN 28: toolsel%=9:toolcursor%=TX%: REM LINE
                WHEN 29: toolsel%=10:toolcursor%=TX%: REM FILL

                WHEN 31: PROCloadfile: REM LOAD
                WHEN 32: PROCsavefile: REM SAVE

                WHEN 34: animation%=(animation%+1) AND 1: REM TOGLE ANIMATION FRAME ADVANCE TOOL

                WHEN 36: REM frame%
                WHEN 37: PROCloadnextframe(-1,1) : REM SAVE CURRENT FRAME AND LOAD PREVIOUS FRAME
                WHEN 38: PROCloadnextframe(1,1) : REM SAVE CURRENT FRAME AND LOAD NEXT FRAME
                WHEN 39: PROCplay : REM SAVE CURRENT FRAME AND PLAY ALL FRAMES FROM FRAME 1


              ENDCASE

              REM CHANGE BACKGROUND COLOUR, TEMPORARY CLUDGE
              REMIF TX%<14 THEN
              REMFOR Y%=1 TO 24
              REMPRINTTAB(0,Y%) CHR$(144+curcol%);
              REMNEXT
              REMENDIF

              PROCWAITMOUSE(0)

              PROCdrawmenu

            ENDIF

          ELSE
            REM CHECK IF EXTENDED MENU IS ACTIVE
            IF menuext% AND TY%=1 THEN
              IF MB%=4 THEN
                CASE TX% OF
                  WHEN 18: animateline%=(animateline%+1) AND 1 : REM ANIMATED LINE TOGGLE
                  WHEN 20: animaterect%=(animaterect%+1) AND 1 : REM ANIMATED BOX
                  WHEN 22: : REM ANIMATED CIRCLE

                ENDCASE
                PROCWAITMOUSE(0)

                menuext%=0: PROCundorestore

              ENDIF

            ELSE

              IF toolsel%=5 OR toolsel%=6 THEN
                A$=STR$(GET(TX%,TY%) AND 255)
                IF LEN(A$)<3 THEN A$=STRING$(3-LEN(A$)," ")+A$
                VDU 23,1,0;0;0;0; : REM Disable cursor
                PRINTTAB(37,0)A$;
                VDU 23,1,1;0;0;0; : REM Enable cursor
              ENDIF

              REM CLICK INSIDE DRAWING AREA
              CASE MB% OF

                WHEN 1:
                  REM PLACE HOLDER FOR RIGHT MOUSE

                WHEN 2:
                  REM PLACE HOLDER FOR MIDDLE MOUSE

                WHEN 4:
                  REM LEFT MOUSE CLICK OR TOUCH SCREEN CLICK
                  IF menuext%=1 THEN menuext%=0: PROCundorestore

                  CASE toolsel% OF
                    WHEN 1: REM PAINT TOOL
                      PROCundosave
                      PROCpoint(PX%,PY%,1)
                      REPEAT
                        PROCREADMOUSE
                        IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN PROCpoint(PX%,PY%,1-erase%)
                        OLD_PX%=PX%
                        OLD_PY%=PY%
                      UNTIL MB%=0
                      IF animation% THEN PROCloadnextframe(1,1)

                    WHEN 2: REM DITHER TOOL
                      PROCundosave
                      D%=2^(dither%)
                      DA%=2
                      IF dither%=2 THEN DA%=4
                      IF dither%=3 THEN DA%=8

                      X%=(PX% DIV DA%)*DA%
                      Y%=(PY% DIV DA%)*DA%
                      IF dither%<4 THEN
                        PROCpoint(X%,Y%,1-erase%)
                        PROCpoint(X%+D%,Y%+D%,1-erase%)
                      ELSE
                        IF TX%>0 THEN VDU 31,TX%,TY%,255+(erase%=1)*95
                      ENDIF
                      REPEAT
                        PROCREADMOUSE
                        IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                          IF dither%<4 THEN
                            X%=(PX% DIV DA%)*DA%
                            Y%=(PY% DIV DA%)*DA%
                            PROCpoint(X%,Y%,1-erase%)
                            PROCpoint(X%+D%,Y%+D%,1-erase%)
                          ELSE
                            IF TX%>0 THEN VDU 31,TX%,TY%,255+(erase%=1)*95
                          ENDIF
                        ENDIF
                        OLD_PX%=PX%
                        OLD_PY%=PY%
                      UNTIL MB%=0
                      IF animation% THEN PROCloadnextframe(1,1)

                    WHEN 5: REM BACKGROUND COLOUR
                      PROCundosave
                      VDU 31,TX%,TY%,(curcol%+144),157-erase%
                      REPEAT
                        PROCREADMOUSE
                        IF TX%<>OLD_TX% OR TY%<>OLD_TY% THEN VDU 31,TX%,TY%,(curcol%+144),157-erase%
                        OLD_TX%=TX%
                        OLD_TY%=TY%
                      UNTIL MB%=0

                    WHEN 6: REM FORGROUND COLOUR
                      PROCundosave
                      VDU 31,TX%,TY%,(curcol%+144)
                      REPEAT
                        PROCREADMOUSE
                        IF TX%<>OLD_TX% OR TY%<>OLD_TY% THEN VDU 31,TX%,TY%,(curcol%+144)
                        OLD_TX%=TX%
                        OLD_TY%=TY%
                      UNTIL MB%=0

                    WHEN 7: REM CIRCLE TOOL
                      PROCundosave
                      startx%=PX%: starty%=PY%
                      OLD_PX%=PX% : OLD_PY%=PY%
                      REM PROCpoint(startx%,starty%,2)

                      REPEAT
                        PROCREADMOUSE
                        IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                          PROCcircle(startx%,starty%,startx%-OLD_PX%,2)
                          PROCcircle(startx%,starty%,startx%-PX%,2)
                          OLD_PX%=PX%
                          OLD_PY%=PY%
                        ENDIF
                      UNTIL MB%=0
                      PROCcircle(startx%,starty%,startx%-PX%,1-erase%)
                      IF animation% THEN PROCloadnextframe(1,1)

                    WHEN 8: REM RECTANGLE TOOL
                      PROCundosave
                      startx%=PX%: starty%=PY%
                      OLD_PX%=PX% : OLD_PY%=PY%
                      PROCpoint(startx%,starty%,2)

                      REPEAT
                        PROCREADMOUSE
                        IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                          PROCrectangle(startx%,starty%,OLD_PX%,OLD_PY%,2)
                          PROCrectangle(startx%,starty%,PX%,PY%,2)
                          OLD_PX%=PX%
                          OLD_PY%=PY%
                        ENDIF
                      UNTIL MB%=0
                      PROCrectangle(startx%,starty%,PX%,PY%,2)
                      IF animaterect%=1 THEN
                        oldframe%=frame%
                        PROCframesave(frame%)
                        PROCrectangle_buf(startx%,starty%,PX%,PY%,1-erase%)
                        frame%=oldframe%-1
                        PROCloadnextframe(1,0)
                      ELSE
                        PROCrectangle(startx%,starty%,PX%,PY%,1-erase%)
                        IF animation% THEN PROCloadnextframe(1,1)
                      ENDIF

                    WHEN 9: REM LINE TOOL
                      PROCundosave
                      startx%=PX%: starty%=PY%
                      OLD_PX%=PX% : OLD_PY%=PY%
                      PROCpoint(startx%,starty%,2)

                      REPEAT
                        PROCREADMOUSE
                        IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                          PROCbresenham(startx%,starty%,OLD_PX%,OLD_PY%,2)
                          PROCbresenham(startx%,starty%,PX%,PY%,2)
                          OLD_PX%=PX%
                          OLD_PY%=PY%
                        ENDIF
                      UNTIL MB%=0

                      PROCbresenham(startx%,starty%,PX%,PY%,2)
                      IF animateline% THEN
                        oldframe%=frame%
                        PROCframesave(frame%)
                        PROCbresenham_buf(startx%,starty%,PX%,PY%,1-erase%)
                        frame%=oldframe%-1
                        PROCloadnextframe(1,0)
                      ELSE
                        PROCbresenham(startx%,starty%,PX%,PY%,1-erase%)
                        IF animation% THEN PROCloadnextframe(1,1)
                      ENDIF


                    WHEN 10: REM FILL TOOL
                      PROCundosave
                      PROCfloodfill(PX%,PY%)
                      REPEAT
                        PROCREADMOUSE
                        WAIT 2
                      UNTIL MB%=0
                      IF animation% THEN PROCloadnextframe(1,1)

                  ENDCASE


              ENDCASE

            ENDIF
          ENDIF

        ELSE
          IF INKEY(-26) THEN PROCWAITNOKEY(-26) : PROCloadnextframe(-1,1) : REM SAVE CURRENT FRAME AND LOAD PREVIOUS FRAME
          IF INKEY(-122) THEN PROCWAITNOKEY(-122) : PROCloadnextframe(1,1) : REM SAVE CURRENT FRAME AND LOAD NEXT FRAME

          WAIT 2
        ENDIF

        REM SHOW ALL MOUSE TRACKING DETAILS
        REM PRINTTAB(0,0)SPC(40)
        REM PRINTTAB(0,0)"MX:";STR$(MX%);" MY:";STR$(MY%);" TX:";STR$(TX%);" TY:";STR$(TY%);" PX:";STR$(PX%);" PY:";STR$(PY%)


        REM REMEMBER MOUSE POSITION
        OLD_MX%=MX%
        OLD_MY%=MY%

      UNTIL 0

      END

      REM READ MOUSE AND CALCULATE TEXT AND SIXEL LOCATIONS
      DEF PROCREADMOUSE

      MOUSE MX%,MY%,MB%

      REM TEXT LOCATION RELEATIVE TO MOUSE
      TX%=MX% DIV 32
      TY%=(999-MY%) DIV 40

      REM SIXEL LOCATION RELEATIVE TO MOUSE
      PX%=MX% DIV 16
      PY%=(999-MY%)/13.3333333

      IF toolsel%=5 OR toolsel%=6 THEN
        VDU 31,TX%,TY%
      ELSE
        VDU 31,toolcursor%,0
      ENDIF


      ENDPROC

      REM WAIT FOR MOUSE TO BE A SPECIFIC BUTTON CLICK
      DEF PROCWAITMOUSE(M%)
      REPEAT
        PROCREADMOUSE
        WAIT 2
      UNTIL MB%=M%
      ENDPROC

      REM WAIT FOR NO KEY INPUT
      DEF PROCWAITNOKEY(W%)
      REPEAT

      UNTIL INKEY(W%)=0
      ENDPROC

      REM Read the point at the specified coordinates (1=set, 0=cleared)
      DEFFNpoint(x%,y%)
      LOCAL cx%,cy%,chr%,C%
      REM Get character cell
      cx% = x% DIV 2
      cy% = y% DIV 3
      chr%=GET(cx%,cy%) AND &5F
      C%=(x% AND 1)+(y% MOD 3)*2
      C%=2^C% - (C%=5)*32
      =SGN(chr% AND C%)

      REM Plot a Teletext sixel point
      REM SIXEL COORDINATES WITH 0,0 BEING TOP LEFT THE SAME AS THE TEXT SCREEN
      REM cmd% 0: Clear the point
      REM cmd% 1: Set the point
      REM cmd% 2: Toggle the point
      DEFPROCpoint(x%, y%, cmd%)

      IF x%>xMin% AND x%<xMax% AND y%>yMin% AND y%<yMax% THEN

        LOCAL cx%,cy%,chr%,C%
        REM Get character cell
        cx% = x% DIV 2
        cy% = y% DIV 3
        chr%=GET(cx%,cy%) AND &5F
        C%=(x% AND 1)+(y% MOD 3)*2
        C%=2^C% - (C%=5)*32
        CASE cmd% OF
          WHEN 0:chr% AND=(&5F - C%)
          WHEN 1:chr% OR=C%
          WHEN 2:chr% EOR=C%
        ENDCASE

        VDU 31,cx%, cy%,(chr%+160)
      ENDIF

      ENDPROC

      REM Read the point at the specified coordinates from specified buffer (1=set, 0=cleared)
      DEFFNpoint_buf(x%,y%,f%)
      LOCAL cx%,cy%,chr%,C%
      REM Get character cell
      cx% = x% DIV 2
      cy% = (y% DIV 3)-1
      chr%=FRAME_BUFFER(f%,cx%+cy%*40) AND &5F
      C%=(x% AND 1)+(y% MOD 3)*2
      C%=2^C% - (C%=5)*32
      =SGN(chr% AND C%)

      REM Plot a Teletext sixel point from specified buffer
      REM SIXEL COORDINATES WITH 0,0 BEING TOP LEFT THE SAME AS THE TEXT SCREEN
      REM cmd% 0: Clear the point
      REM cmd% 1: Set the point
      REM cmd% 2: Toggle the point
      DEFPROCpoint_buf(x%, y%, cmd%,f%)

      IF x%>xMin% AND x%<xMax% AND y%>yMin% AND y%<yMax% THEN

        LOCAL cx%,cy%,chr%,C%
        REM Get character cell
        cx% = x% DIV 2
        cy% = (y% DIV 3)-1
        chr%=FRAME_BUFFER(f%,cx%+cy%*40) AND &5F
        C%=(x% AND 1)+(y% MOD 3)*2
        C%=2^C% - (C%=5)*32
        CASE cmd% OF
          WHEN 0:chr% AND=(&5F - C%)
          WHEN 1:chr% OR=C%
          WHEN 2:chr% EOR=C%
        ENDCASE

        FRAME_BUFFER(f%,cx%+cy%*40)=chr%+160
      ENDIF

      ENDPROC


      REM LINE ROUTINE USE m% TO PERFORM 0=ERASE / 1=DRAW / 2=EOR
      DEF PROCbresenham(x1%,y1%,x2%,y2%,m%)
      LOCAL dx%, dy%, sx%, sy%, e
      dx% = ABS(x2% - x1%) : sx% = SGN(x2% - x1%)
      dy% = ABS(y2% - y1%) : sy% = SGN(y2% - y1%)
      IF dx% > dy% e = dx% / 2 ELSE e = dy% / 2
      REPEAT
        PROCpoint(x1%,y1%,m%)
        IF x1% = x2% IF y1% = y2% EXIT REPEAT
        IF dx% > dy% THEN
          x1% += sx% : e -= dy% : IF e < 0 e += dx% : y1% += sy%
        ELSE
          y1% += sy% : e -= dx% : IF e < 0 e += dy% : x1% += sx%
        ENDIF
      UNTIL FALSE
      ENDPROC

      REM LINE ROUTINE FOR BUFFER USE m% TO PERFORM 0=ERASE / 1=DRAW / 2=EOR
      DEF PROCbresenham_buf(x1%,y1%,x2%,y2%,m%)
      LOCAL dx%, dy%, sx%, sy%, e
      dx% = ABS(x2% - x1%) : sx% = SGN(x2% - x1%)
      dy% = ABS(y2% - y1%) : sy% = SGN(y2% - y1%)
      IF dx% > dy% e = dx% / 2 ELSE e = dy% / 2

      REPEAT
        PROCpoint_buf(x1%,y1%,m%,frame%)
        frame%=frame%+1
        IF frame%>frame_max% THEN frame%=1
        IF x1% = x2% IF y1% = y2% EXIT REPEAT
        IF dx% > dy% THEN
          x1% += sx% : e -= dy% : IF e < 0 e += dx% : y1% += sy%
        ELSE
          y1% += sy% : e -= dx% : IF e < 0 e += dy% : x1% += sx%
        ENDIF
      UNTIL FALSE
      ENDPROC

      REM RECTANGLE ROUTINE
      DEF PROCrectangle(x1%,y1%,x2%,y2%,m%)

      REM CHECK FOR SPECIAL CASES TO PRESERVE EOR OPERATIONS
      IF x1%=x2% AND y1%=y2% THEN
        PROCpoint(x1%,y1%,m%)
      ELSE
        IF x1%=x2% OR y1%=y2% THEN
          PROCbresenham(x1%,y1%,x2%,y2%,m%)
        ELSE
          PROCbresenham(x1%,y1%,x2%,y1%,m%)
          PROCbresenham(x1%,y2%,x2%,y2%,m%)
          IF ABS(y2%-y1%)>1 THEN
            IF y1%>y2% THEN SWAP y1%,y2%
            FOR Y%=y1%+1 TO y2%-1
              PROCpoint(x1%,Y%,m%)
              PROCpoint(x2%,Y%,m%)
            NEXT
          ENDIF
        ENDIF
      ENDIF
      ENDPROC

      REM RECTANGLE ROUTINE FOR BUFFER
      DEF PROCrectangle_buf(x1%,y1%,x2%,y2%,m%)

      REM CHECK FOR SPECIAL CASES TO PRESERVE EOR OPERATIONS
      IF x1%=x2% AND y1%=y2% THEN
        PROCpoint(x1%,y1%,m%)
      ELSE
        IF x1%=x2% OR y1%=y2% THEN
          PROCbresenham_buf(x1%,y1%,x2%,y2%,m%)
        ELSE
          IF x1%>x2% THEN SWAP x1%,x2%
          IF y1%>y2% THEN SWAP y1%,y2%
          PROCbresenham_buf(x1%,y1%,x2%,y1%,m%)
          PROCbresenham_buf(x2%,y1%+1,x2%,y2%-1,m%)
          PROCbresenham_buf(x2%,y2%,x1%,y2%,m%)
          PROCbresenham_buf(x1%,y2%-1,x1%,y1%+1,m%)
        ENDIF
      ENDIF
      ENDPROC


      REM CIRCLE ROUTINE
      DEF PROCcircle(x1%,y1%,r%,m%)
      LOCAL p,x%,y%

      r%=ABS(r%)
      p=(5-r%*4)/4
      x%=0
      y%=r%

      PROCcirclepoints(x1%,y1%,x%,y%,m%)

      WHILE x%<y%
        x%+=1
        IF p<0 THEN
          p+=2*x%+1
        ELSE
          y%-=1
          p+=2*(x%-y%)+1
        ENDIF
        PROCcirclepoints(x1%,y1%,x%,y%,m%)
      ENDWHILE

      ENDPROC

      REM THIS PLOTS THE POINTS FOR CIRCLE ROUTINE
      DEF PROCcirclepoints(cx%,cy%,x%,y%,m%)
      IF x%=0 THEN
        PROCpoint(cx%,cy%+y%,m%)
        PROCpoint(cx%,cy%-y%,m%)
        PROCpoint(cx%+y%,cy%,m%)
        PROCpoint(cx%-y%,cy%,m%)
      ELSE
        IF x%<=y% THEN
          PROCpoint(cx%+x%,cy%+y%,m%)
          PROCpoint(cx%-x%,cy%+y%,m%)
          PROCpoint(cx%+x%,cy%-y%,m%)
          PROCpoint(cx%-x%,cy%-y%,m%)
          IF x%<y% THEN
            PROCpoint(cx%+y%,cy%+x%,m%)
            PROCpoint(cx%-y%,cy%+x%,m%)
            PROCpoint(cx%+y%,cy%-x%,m%)
            PROCpoint(cx%-y%,cy%-x%,m%)
          ENDIF
        ENDIF
      ENDIF
      ENDPROC

      REM ### flood fill from ART4BBW
      DEF PROCfloodfill(sx%,sy%)

      IF sx%>xMin% AND sx%<xMax% AND sy%>yMin% AND sy%<yMax% THEN

        LOCAL uf,df,c%,x%,y%,mc%
        uf=0
        df=0

        REM fill with mask colour first
        bCnt%=0
        PROCaddFill(sx%,sy%)

        REPEAT
          REM get next fill point
          bCnt%-=1
          x%=fill{(bCnt%)}.x%
          y%=fill{(bCnt%)}.y%
          IF FNpoint(x%,y%) = 0 THEN

            uf=1 : df=1

            REM scan left
            WHILE x%>fxMin% AND FNpoint(x%-1,y%) =0
              x%-=1
            ENDWHILE

            REM scan right
            WHILE x%<fxMax% AND FNpoint(x%,y%) = 0
              PROCpoint(x%,y%,1)

              REM detect colour changes above and add to list
              IF y%<fyMax% THEN
                c%=FNpoint(x%,y%+1)
                IF uf AND c%=0 THEN PROCaddFill(x%,y%+1) : uf=0
                IF c%=1 THEN uf=1
              ENDIF

              REM detect colour changes below and add to list
              IF y%>fyMin% THEN
                c%=FNpoint(x%,y%-1)
                IF df AND c%=0 THEN PROCaddFill(x%,y%-1) : df=0
                IF c%=1 THEN df=1
              ENDIF
              x%+=1
            ENDWHILE
          ENDIF

        UNTIL bCnt%=0
      ENDIF

      ENDPROC

      REM ### fill quasi stack
      DEF PROCaddFill(x%,y%)
      fill{(bCnt%)}.x%=x%
      fill{(bCnt%)}.y%=y%
      IF bCnt%<100 THEN bCnt%+=1
      ENDPROC

      REM UPDATE CLEARSCREEN OPTIONS
      DEF PROCupdateCS
      PRINTTAB(5,7)"FORE  ";CHR$(234);SPC(17);CHR$(181);
      PRINTTAB(5,9)"BACK  ";CHR$(234);SPC(17);CHR$(181);

      IF bakcol%=0 THEN PRINTTAB(13,9)"B"

      FOR I%=1 TO 7
        PRINTTAB(12+I%*2,7)CHR$(144+I%);CHR$(255+(I%=curcol%)*185);
        PRINTTAB(12+I%*2,9)CHR$(144+I%);CHR$(255+(I%=bakcol%)*189);
      NEXT

      PRINTTAB(5,11)"OUTPUT";
      IF bakcol%>0 THEN
        VDU 144+bakcol%,157,144+curcol%
      ELSE
        VDU 32,32,144+curcol%
      ENDIF
      PRINTTAB(14,11)"abcdefghijklmno";CHR$(156);CHR$(151)

      ENDPROC

      REM CLEARSCREEN DIALOG
      DEF PROCclearscreen
      PROCundosave
      PROCWAITMOUSE(0)

      FOR L%=5 TO 18
        PRINTTAB(0,L%)SPC(40);
      NEXT

      PRINTTAB(2,5)CHR$(151);CHR$(232);STRING$(9,CHR$(172));CHR$(130);"CLEARSCREEN";CHR$(151);STRING$(9,CHR$(172));CHR$(180);
      FOR L%=6 TO 17
        PRINTTAB(2,L%)CHR$(151);CHR$(234);STRING$(30," ");CHR$(151);CHR$(181);
      NEXT

      PRINTTAB(5,13)CHR$(146);CHR$(157);CHR$(132);"ALL FRAMES  ";CHR$(156);" ";CHR$(145);CHR$(157);CHR$(131);"CANCEL  ";CHR$(156);

      PRINTTAB(5,14)CHR$(129);STRING$(25,"-")
      PRINTTAB(5,16)CHR$(146);CHR$(157);CHR$(132);"DUPE FRAME  ";CHR$(156);

      PRINTTAB(2,18)CHR$(151);CHR$(170);STRING$(31,CHR$(172));CHR$(165);

      PROCupdateCS

      done%=0
      col_old%=curcol%
      bak_old%=bakcol%
      REPEAT
        PROCREADMOUSE
        IF MB%=4 THEN
          REPEAT
            PROCREADMOUSE
            IF TY%=7 THEN
              IF TX%>13 AND TX%<28 THEN curcol%=(TX%-12) DIV 2
            ENDIF
            IF TY%=9 THEN
              IF TX%>11 AND TX%<28 THEN bakcol%=(TX%-12) DIV 2
            ENDIF

            IF TY%=13 THEN
              IF TX%>5 AND TX%<20 THEN done%=1
              IF TX%>23 AND TX%<33 THEN done%=-1
            ENDIF

            IF TY%=16 THEN
              IF TX%>5 AND TX%<20 THEN done%=2
            ENDIF
          UNTIL MB%=0
          IF col_old%<>curcol% OR bak_old%<>bakcol% THEN
            PROCupdateCS
            col_old%=curcol%
            bak_old%=bakcol%

          ENDIF
        ENDIF
      UNTIL done%

      PROCWAITMOUSE(0)

      CASE done% OF
        WHEN -1: PROCundorestore : REM CANCEL

        WHEN 1: REM NEW BACKGROUND COLOUR

          PROCGR(curcol%,bakcol%)

          FOR frame%=1 TO frame_max%
            PROCframesave(frame%)
            REM WAIT 10
          NEXT frame%
          frame%=1

        WHEN 2: REM DUPLICATE FRAME 1
          PROCundorestore
          PROCframesave(1)
          frame%=0
          PROCloadnextframe(1,0)
          FOR frame%=2 TO frame_max%
            PROCframesave(frame%)
            REM WAIT 10
          NEXT frame%
          frame%=1

      ENDCASE
      REMPROCloadnextframe(1,0)

      ENDPROC

      REM SAVE FRAME BUFFER
      DEF PROCframesave(f%)
      LOCAL U%

      FOR U%=0 TO 959
        FRAME_BUFFER(f%,U%)=GET(U% MOD 40,U% DIV 40+1)
      NEXT

      ENDPROC

      REM RESTORE FRAME BUFFER
      DEF PROCframerestore(f%)
      LOCAL U%

      FOR U%=0 TO 959
        VDU 31,(U% MOD 40),(U% DIV 40+1),FRAME_BUFFER(f%,U%)
      NEXT

      ENDPROC

      DEF PROCloadnextframe(F%,S%)

      IF S% THEN
        PROCWAITMOUSE(0)
        PROCframesave(frame%)
      ENDIF
      frame%+=F%
      IF frame%>frame_max% THEN frame%=1
      IF frame%<1 THEN frame%=frame_max%
      PROCframerestore(frame%)
      PROCdrawmenu
      ENDPROC

      REM SAVE UNDO SCREEN
      DEF PROCundosave
      LOCAL U%
      UNDO_INDEX%+=1
      IF UNDO_INDEX%>UNDO_MAX% THEN UNDO_INDEX%=0

      FOR U%=0 TO 959
        UNDO_BUFFER(UNDO_INDEX%,U%)=GET(U% MOD 40,U% DIV 40+1)
      NEXT

      ENDPROC

      REM SAVE UNDO SCREEN
      DEF PROCundorestore
      LOCAL U%

      FOR U%=0 TO 959
        VDU 31,(U% MOD 40),(U% DIV 40+1),UNDO_BUFFER(UNDO_INDEX%,U%)
      NEXT

      UNDO_INDEX%-=1
      IF UNDO_INDEX%<0 THEN UNDO_INDEX%=UNDO_MAX%

      ENDPROC

      REM SAVE BINARY FILE
      DEF PROCsavebinaryfile(F$)
      f%=OPENOUT(F$)
      FOR U%=0 TO 999
        BPUT#f%,GET(U% MOD 40,U% DIV 40)
      NEXT
      CLOSE#f%
      ENDPROC

      REM LOAD BINARY FILE
      DEF PROCloadbinaryfile(F$)
      f%=OPENIN(F$)

      FOR U%=0 TO 999
        char%=BGET#f%
        VDU 31,U% MOD 40,U% DIV 40,char%
      NEXT
      CLOSE#f%
      ENDPROC


      REM LOADFILE
      DEF PROCloadfile

      LOCAL N%
      DIM n$(10000)

      N% = FN_dirscan(n$(), "dir *.BIN", "", "", "")

      REM HACK SORT, NEED TO LOOK INTO READING FILE DATES AND SORTING NEWEST FIRST
      FOR I%=1 TO N% DIV 2
        SWAP n$(I%),n$(N%-I%+1)
      NEXT

      PROCWAITMOUSE(0)
      PROCundosave
      FOR L%=6 TO 18
        PRINTTAB(0,L%)SPC(40);
      NEXT


      PRINTTAB(2,6)CHR$(151);CHR$(232);STRING$(10,CHR$(172));CHR$(130);"LOAD FILE";CHR$(151);STRING$(10,CHR$(172));CHR$(180);
      FOR L%=7 TO 17
        PRINTTAB(2,L%)CHR$(151);CHR$(234);STRING$(30," ");CHR$(151);CHR$(181);
      NEXT
      PRINTTAB(2,18)CHR$(151);CHR$(170);STRING$(31,CHR$(172));CHR$(165);

      F%=0
      S%=0
      SEL%=0
      SELOLD%=0
      SELY%=-1
      INDEX%=1
      INDEXOLD%=1
      DC%=0


      FOR I%=INDEX% TO INDEX%+10
        IF I%<N% THEN PRINTTAB(6,6+I%)CHR$(131);LEFT$(n$(I%),24);
      NEXT

      REPEAT
        PROCREADMOUSE

        IF MB%=4 THEN
          IF MY%<>OLD_MY% THEN INDEX%+=SGN(MY%-OLD_MY%)
          IF INDEX%<1 THEN INDEX%=1
          IF INDEX%>N%-10 THEN INDEX%=N%-10
          IF SELY%=-1 THEN SELY%=MY%

        ENDIF

        IF MB%=0 THEN
          IF SELY%=MY% THEN
            S%=TY%-7
            IF S%>-1 AND S%<11 THEN SEL%=S%+INDEX%
            IF SEL%<1 THEN SEL%=1
            IF SEL%>N% THEN SEL%=N%
            F%=SEL%
            IF TX%<6 OR TX%>32 OR TY%<7 OR TY%>17 THEN F%=-1
          ENDIF
          SELY%=-1
        ENDIF

        IF INDEX%<>INDEXOLD% OR SELOLD%<>SEL% THEN
          FOR I%=0 TO 10
            K%=I%+INDEX%
            PRINTTAB(4,I%+7)SPC(30);
            IF K%<N%+1 THEN
              VDU 31,4,I%+7
              IF SEL%=K% THEN
                VDU 132,157
              ELSE
                VDU 32,32
              ENDIF
              PRINTCHR$(131);LEFT$(n$(K%),24);
              IF SEL%=K% THEN VDU 32,32,156
            ENDIF
          NEXT
          SELOLD%=SEL%
          INDEXOLD%=INDEX%
        ENDIF

        REM PRINTTAB(0,1)STR$(SEL%)

        OLD_MY%=MY%


        WAIT 2
      UNTIL F%<>0

      PROCundorestore

      IF F%>0 THEN
        IF LEFT$(FNUPPER(n$(SEL%)),3)="M7_" THEN
          F$=LEFT$(n$(SEL%),22)
          FOR frame%=1 TO frame_max%
            PROCloadbinaryfile(F$ + STR$(frame%)+".BIN")
            PROCframesave(frame%)
            REM WAIT 10
          NEXT
          PROCloadnextframe(1,0)
        ELSE
          IF RIGHT$(FNUPPER(n$(SEL%)),3)="BIN" THEN
            PROCloadbinaryfile(n$(SEL%))
            PROCframesave(frame%)
          ENDIF
        ENDIF
      ENDIF
      ENDPROC

      REM SAVEFILE
      DEF PROCsavefile
      PROCWAITMOUSE(0)

      PROCframesave(frame%)

      REM SAVE FRAMES
      T$=TIME$
      C%=FN_findreplace(T$, ".", "", 1)
      C%=FN_findreplace(T$, " ", "", 1)
      C%=FN_findreplace(T$, ",", "", 1)
      C%=FN_findreplace(T$, ":", "", 1)

      frame%=frame_max%
      FOR I%=1 TO frame_max%
        PROCloadnextframe(1,0)
        PROCsavebinaryfile("M7_" + T$ + "_" + STR$(frame%)+".BIN")
        OSCLI "SCREENSAVE ""M7_" + T$ + "_" + STR$(frame%)+".BMP"" 0,0,1280,1000"
        WAIT 10
      NEXT

      PROCloadnextframe(1,0)

      PROCundosave
      PRINTTAB(9,10)CHR$(151);CHR$(232);STRING$(18,CHR$(172));CHR$(180);CHR$(144+curcol%);
      FOR L%=11 TO 13
        PRINTTAB(9,L%)CHR$(151);CHR$(234);STRING$(17," ");CHR$(151);CHR$(181);CHR$(144+curcol%);
      NEXT
      PRINTTAB(9,14)CHR$(151);CHR$(170);STRING$(18,CHR$(172));CHR$(165);CHR$(144+curcol%);

      REM READ FILES
      PRINTTAB(13,12)CHR$(130);"FILE SAVED!";

      PROCWAITMOUSE(4)

      PROCWAITMOUSE(0)

      PROCundorestore

      ENDPROC

      REM ANIMATE ALL FRAMES IN SEQUENCE FROM 1 TO FRAME_MAX%
      DEF PROCplay

      PROCframesave(frame%)
      PROCWAITMOUSE(0)

      VDU 23,1,0;0;0;0; : REM Disable cursor

      D%=0

      frame%=frame_max%
      REPEAT
        PROCloadnextframe(1,0)
        FOR I%=0 TO 9
          PROCREADMOUSE
          IF MB%<>0 THEN D%=1
          WAIT 2
        NEXT
      UNTIL D%
      PROCWAITMOUSE(0)

      VDU 23,1,1;0;0;0; : REM Enable cursor

      ENDPROC

      REM Convert to upper case:
      DEF FNUPPER(a$) IF LENa$=0 THEN =""
      LOCAL p%%
      FOR p%% = PTR(a$) TO PTR(a$)+LENa$-1
        IF ?p%% >= 97 IF ?p%% <= 122 ?p%% -= 32
      NEXT
      = a$


      REM INITIALISE THE SCREEN
      DEF PROCGR(F%,B%)

      REM CLS
      VDU 12

      REM ADD GRAPHICS CODE TO LEFT SIDE OF CANVAS
      FOR Y%=1 TO 24
        VDU 31,0,Y%
        IF B% THEN VDU 144+B%,157
        VDU 144+F%
      NEXT

      ENDPROC

      REM PRINT PALETTE AND MENU
      DEF PROCdrawmenu
      FOR count%=1 TO 7
        PRINTTAB(count%*2-2,0) CHR$(128+count%);CHR$(255+(count%=curcol%)*213);
      NEXT count%
      PRINTTAB(14,0) CHR$(135);"PD";STR$(dither%+1);"U";CHR$(135-erase%*5);"E";CHR$(135);"CBF ORLF LS";CHR$(135-animation%*5);"A";CHR$(135);STR$(frame%);"<>P"
      IF menuext% THEN PRINTTAB(0,1)" Animation Tools:";CHR$(135-animateline%*5);"L";CHR$(135-animaterect%*5);"R";SPC(19);
      ENDPROC

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Wed Aug 26, 2020 6:38 am

Thank you. What a great birthday pressie.
Telepaint...I like that,
I’ll see what I can come up with.
Last edited by pixelblip on Wed Aug 26, 2020 6:11 pm, edited 1 time in total.

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Wed Aug 26, 2020 6:49 am

Happy Birthday old mate!! =D> :D \:D/

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Wed Aug 26, 2020 7:07 am

Thanks, a few days to go.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Wed Aug 26, 2020 7:12 am

Whilst I think of it Separated graphics are great to look at...it’s just a control code. I expect down the line you might add more control codes....I hope I get some time this weekend to paint in bed with a coffee.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Wed Aug 26, 2020 7:26 am

That rectangle animation is so clever

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Wed Aug 26, 2020 7:37 am

=D>

I've narrowed down where the app is failing on Android, it has to do with the extra libraries installed from @lib$ but am I am unsure of how to fix it as yet.

I've enumerated @lib$ to the following:
/data/data/com/rtrussell.bbcbasic/files/lib/

Whats great (sort of) is that if I comment out the include libraries the application mostly runs and I can draw and animate to my fat fingers content :D It really would be suited to an iPad with a slightly bigger footprint for the tool menu but it works!

I can't load or save though as the include libraries are used for the file operations dialog, will need to see if I can make it all native so that there are no external dependencies.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Wed Aug 26, 2020 12:27 pm

Well done.
When I tried *HEX 64 at the start of the program the errors went away on the ipad but this may have nothing to do with your file errors on Android.
Thanks for persevering.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Wed Aug 26, 2020 7:55 pm

Loading Screen Idea
Attachments
1CCF445B-1B2C-4F8F-AC02-5C9A1099B81A.gif
Last edited by pixelblip on Wed Aug 26, 2020 8:35 pm, edited 1 time in total.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Wed Aug 26, 2020 7:59 pm

I did that on the iPad. I had to save it out as a screenshot one frame at a time using the iOS capture into photos.
I have saved the frames...it’s just getting it off the iPad that is the challenge.
I do appreciate that using an iPad is more difficult to program compared to android esp getting at the file system. I do have an android tablet I can paint on...but I do prefer the bigger iPad.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Wed Aug 26, 2020 8:15 pm

I really like the auto animate A button. It makes doing animation like that really quick.
To report there are times when the menu mucks up a bit. In the right corner. The buttons still work but they don’t always display <>P. Sometimes they display numbers instead of <>. The menu does write itself at some point when selecting another command.

Another thing I have noticed is that it’s possible to click In the blank space inbetween the colours. Not a massive deal but sometimes I miss them accurately.

Also I noticed the clear menu saved as a screen one one slide. I’m trying to replicate that one. I think it was when I did an undo.

I would also say that if a tool isn’t selected it should try to revert to p ...sometimes it seems to go quiet as though one hasn’t selected any tool. I can’t describe that well and it’s not a big deal but for instance I think if you clear background it should then revert to tool p after you do so. That describes the problem better....

It’s a great effort. Well have to see how viable scrolling is...at some stage....

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Wed Aug 26, 2020 9:33 pm

pixelblip wrote:
Wed Aug 26, 2020 8:15 pm
To report there are times when the menu mucks up a bit. In the right corner. The buttons still work but they don’t always display <>P. Sometimes they display numbers instead of <>. The menu does write itself at some point when selecting another command.
This is actually by design, if 'F' or 'B' is selected it shows the control code under the cursor, quite handy to know but yes gets in the way, easy to turn it off for now if it helps. Maybe an option in the rumored options dialog :-k

Another thing I have noticed is that it’s possible to click In the blank space inbetween the colours. Not a massive deal but sometimes I miss them accurately.
I will include the black space as part of the colour next to it (on the right) so if you click on the colour or the square to the right it will still choose that colour.
Also I noticed the clear menu saved as a screen one one slide. I’m trying to replicate that one. I think it was when I did an undo.
I'll look at the code for this one, I'm throwing it all together very quick so I may be introducing errors in other parts as I add something new, what we need are good testers :wink:
I would also say that if a tool isn’t selected it should try to revert to p ...sometimes it seems to go quiet as though one hasn’t selected any tool. I can’t describe that well and it’s not a big deal but for instance I think if you clear background it should then revert to tool p after you do so. That describes the problem better....
Easily done =D>
It’s a great effort. Well have to see how viable scrolling is...at some stage....
Working my way up to it, it's a fair change so I need a good block of time to try out design and code ideas.

I'm thinking of moving the shape tools into the second menu to reclaim some tool bar realestate, it would mean a double tap to select box, circle, line but it makes more sense for these tools to be next to the animate shape options. Will add it in and you can test run it.

Oh yeah, from other earlier posts, *HEX 64 is in the code now, but I just checked it was below the library includes, will move it above the includes and test again.

Like the TelePaint banner, might have a go myself at this too :-)

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Thu Aug 27, 2020 6:57 am

If love to see you try some pics a :D
Thanks fo all your precious time you give to this. I know how difficult it is finding the time.

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Thu Aug 27, 2020 7:39 am

Something like this :idea:
TelePaint09.png
TelePaint09.png (48.41 KiB) Viewed 675 times

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Thu Aug 27, 2020 12:45 pm

That looks great.
But it is cheating. It's not teletext. Back to the drawing board Mr!

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Thu Aug 27, 2020 12:56 pm

Don't worry about the scrolling if that takes too long....sorry I thought that might be a simpler thing to do. Apologies.

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Thu Aug 27, 2020 1:22 pm

pixelblip wrote:
Thu Aug 27, 2020 12:45 pm
That looks great.
But it is cheating. It's not teletext. Back to the drawing board Mr!
I think we can get close to or an approximation of is what I was thinking :D I have started a few banner type splash screens, the devil is in the detail as they say.

Scrolling will happen, if you build it... they will come :)

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Thu Aug 27, 2020 9:29 pm

Hmm, needs a little something...
TelePaint.gif

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Thu Aug 27, 2020 9:51 pm

Bit of a tidy up today:

* Rejigged the menu overall and changed the way all menus are displayed and saved so that it uses a separate buffer than undo.
* 'S'hape menu now drops down with 'LRO' 'A' and Gap and Len options, gap and len not working just yet but have all the framework in place
* 'F'oreground and 'B'ackground now can progress the frame if 'A' is selected, this was really handy when painting my logo in previous post =D>
* 'R'edo placeholder on menu, not working as yet
* Noted bugs in load window, need to revisit but it is good enough for saving and loading images
* Need to revisit undo, it works for a single screen but is not frame aware so beware

Feels really nice to use and robust, but please report any further bugs and we'll squish em good.

EDIT: Added scroll copy, by chance a whole screen works perfectly with either 5 chars for horizontal or 3 chars for vertical, use both also! There is a bug with negative amounts, I will track this down next time but wanted to post this update for now as it's really cool!

Code: Select all

      MODE 7

      REM *** TODO LIST ***

      REM *** INKEY(-256) MATRIX BRANYDY &4D (INCLUDE OTHERS)

      REM *** INVESTIGATE LOCAL VERSIONS OF LIBRARIES TO MAKE PROGRAM CROSS BASIC COMPATIBLE

      REM *** SCROLLING, POSSIBLY ADD TO DUPLICATE DIALOG SO A SCENE CAN BE COPIED AND SCROLLED

      REM *** ADD OPTION FOR OTHER CONTROL CODES

      REM *** LOAD SCREEN SORT BY NEWEST, HACKED A QUICK FIX

      REM *** COPY AND PASTE

      REM *** REDO, AND WHILE I'M AT IT ADD UNDOS & REDOS FOR EACH FRAME

      REM *** FLASHING COLOURS, THIS IS DRAWING SHAPES ACROSS FRAMES, HAVE BEGUN IMPLEMENTING ANIMATED LINE TOOL

      REM *** TODO LIST ***

      REM FOR 64 BIT COMPARISONS, ESC OFF FOR BACK ARROW ON SOME DEVICES
      *HEX 64
      *ESC OFF

      INSTALL @lib$+"sortlib"
      INSTALL @lib$+"stringlib"
      INSTALL @lib$+"dlglib"
      INSTALL @lib$+"filedlg"

      MOUSE ON 3

      REM drawing bounds used for < and >
      xMin%=1
      xMax%=80
      yMin%=2
      yMax%=75


      REM fill bounds & BUFFER used with < and >
      fxMin%=2
      fxMax%=80
      fyMin%=3
      fyMax%=74
      DIM fill{(100) x%,y%}

      REM UNDO TEST ARRAY
      UNDO_MAX%=19
      DIM UNDO_BUFFER(UNDO_MAX%,959)
      UNDO_INDEX%=0

      REM FRAME BUFFER ARRAY
      frame_max%=8
      DIM FRAME_BUFFER(frame_max%,959)

      REM MENU BUFFER
      DIM MENU_BUFFER(959)

      REM OLD PIXEL & MOUSE COORDS
      OLD_PX%=0
      OLD_PY%=0
      OLD_MX%=0
      OLD_MY%=0
      OLD_TX%=0
      OLD_TY%=0

      REM MOUSE COORDS
      MX%=0
      MY%=0
      MB%=0

      REM TEXT & PIXEL COORDS FOR CURRENT MOUSE READ LOCATION
      TX%=0
      TY%=0
      PX%=0
      PY%=0

      REM TOOL VARS
      curcol%=7
      bakcol%=0
      toolsel%=1
      shapesel%=1
      toolcursor%=15
      animateshape%=0
      animategap%=0
      animategapcount%=0
      animatelen%=1
      animatelencount%=0
      scrollh%=0
      scrollv%=0
      erase%=0
      dither%=0
      frame%=1
      animation%=0
      menuext%=0

      REM FILE DIALOG
      N%=0

      PROCGR(curcol%,bakcol%)
      PROCdrawmenu

      FOR frame%=1 TO frame_max%
        PROCframesave(frame%)
        REM WAIT 10
      NEXT frame%
      frame%=1


      REPEAT

        PROCREADMOUSE

        IF MX%<>OLD_MX% OR MY%<>OLD_MY% OR MB% THEN
          IF TY%=0 THEN
            REM CLICK INSIDE MENU AREA
            IF MB%=4 THEN
              PROCWAITMOUSE(0)
              IF TY%=0 THEN
                CASE TX% OF
                  WHEN 0: REM OPTIONS MENU
                  WHEN 1,2: curcol%=1:PROCmenurestore : REM RED
                  WHEN 3,4: curcol%=2:PROCmenurestore : REM GREEN
                  WHEN 5,6: curcol%=3:PROCmenurestore : REM YELLOW
                  WHEN 7,8: curcol%=4:PROCmenurestore : REM BLUE
                  WHEN 9,10: curcol%=5:PROCmenurestore : REM MAGENTA
                  WHEN 11,12: curcol%=6:PROCmenurestore : REM CYAN
                  WHEN 13,14: curcol%=7:PROCmenurestore : REM WHITE

                  WHEN 15: toolsel%=1:toolcursor%=TX% : REM PAINT
                  WHEN 16: toolsel%=2:toolcursor%=TX% : REM DITHER
                  WHEN 17: dither%=(dither%+1) MOD 5:toolsel%=2:toolcursor%=16:PROCmenurestore : REM DITHER SCALE
                  WHEN 18: toolsel%=3:toolcursor%=TX% : REM FILL
                  WHEN 19: toolsel%=4:toolcursor%=TX% : REM SHAPE MENU
                    IF menuext%=0 THEN
                      menuext%=1: PROCmenusave
                    ELSE
                      PROCmenurestore
                    ENDIF

                  WHEN 21: erase%=(erase%+1) AND 1:PROCmenurestore : REM TOGLE ERASER

                  WHEN 23: PROCmenurestore:PROCundorestore : REM UNDO
                  WHEN 25: REM PROCredorestore: REM REDO

                  WHEN 27: PROCmenurestore:PROCclearscreen:toolsel%=1:toolcursor%=15 : REM CLEARSCREEN
                  WHEN 28: toolsel%=5:toolcursor%=TX% : REM BACKGROUND COLOUR
                  WHEN 29: toolsel%=6:toolcursor%=TX% : REM FORGROUND

                  WHEN 31: PROCmenurestore:PROCloadfile : REM LOAD
                  WHEN 32: PROCmenurestore:PROCsavefile : REM SAVE

                  WHEN 34: animation%=(animation%+1) AND 1:PROCmenurestore : REM TOGLE ANIMATION FRAME ADVANCE TOOL

                  WHEN 36: REM frame%
                  WHEN 37: PROCmenurestore:PROCloadnextframe(-1,1) : REM SAVE CURRENT FRAME AND LOAD PREVIOUS FRAME
                  WHEN 38: PROCmenurestore:PROCloadnextframe(1,1) : REM SAVE CURRENT FRAME AND LOAD NEXT FRAME
                  WHEN 39: PROCmenurestore:PROCplay : REM SAVE CURRENT FRAME AND PLAY ALL FRAMES FROM FRAME 1


                ENDCASE

                REM HIDE SHAPE MENU IF ANOTHER TOOL IS SELECTED
                IF toolsel%<>4 AND menuext%=1 THEN PROCmenurestore

                PROCdrawmenu
              ENDIF
            ENDIF

          ELSE
            REM CHECK IF EXTENDED MENU IS ACTIVE
            IF menuext% AND TY%=1 THEN
              IF MB%=4 THEN
                CASE TX% OF
                  WHEN 0: shapesel%=1 : REM LINE
                  WHEN 1: shapesel%=2 : REM RECTANGLE
                  WHEN 2: shapesel%=3 : REM CIRCEL

                  WHEN 4: animateshape%=(animateshape%+1) AND 1 : REM ANIMATEDSHAPE
                  WHEN 11:  REM ANIMATED GAP DECREMENT
                    animategap%-=1
                    IF animategap%<0 THEN animategap%=0
                  WHEN 15:  REM ANIMATED GAP INCREMENT
                    animategap%+=1
                    IF animategap%>5 THEN animategap%=5
                  WHEN 22:  REM ANIMATED LEN DECREMENT
                    animatelen%-=1
                    IF animatelen%<1 THEN animatelen%=1
                  WHEN 26:  REM ANIMATED LEN INCREMENT
                    animatelen%+=1
                    IF animatelen%>5 THEN animatelen%=5

                ENDCASE

                PROCWAITMOUSE(0)
                PROCdrawmenu

              ENDIF

            ELSE

              REM IF toolsel%=5 OR toolsel%=6 THEN
              REM A$=STR$(GET(TX%,TY%) AND 255)
              REM IF LEN(A$)<3 THEN A$=STRING$(3-LEN(A$)," ")+A$
              REM VDU 23,1,0;0;0;0; : REM Disable cursor
              REM PRINTTAB(37,0)A$;
              REM VDU 23,1,1;0;0;0; : REM Enable cursor
              REM ENDIF

              REM CLICK INSIDE DRAWING AREA
              CASE MB% OF

                WHEN 1:
                  REM PLACE HOLDER FOR RIGHT MOUSE

                WHEN 2:
                  REM PLACE HOLDER FOR MIDDLE MOUSE

                WHEN 4:
                  REM LEFT MOUSE CLICK OR TOUCH SCREEN CLICK
                  IF menuext%=1 THEN PROCmenurestore

                  CASE toolsel% OF
                    WHEN 1: REM PAINT TOOL
                      PROCundosave
                      PROCpoint(PX%,PY%,1)
                      REPEAT
                        PROCREADMOUSE
                        IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN PROCpoint(PX%,PY%,1-erase%)
                        OLD_PX%=PX%
                        OLD_PY%=PY%
                      UNTIL MB%=0
                      IF animation% THEN PROCloadnextframe(1,1)

                    WHEN 2: REM DITHER TOOL
                      PROCundosave
                      D%=2^(dither%)
                      DA%=2
                      IF dither%=2 THEN DA%=4
                      IF dither%=3 THEN DA%=8

                      X%=(PX% DIV DA%)*DA%
                      Y%=(PY% DIV DA%)*DA%
                      IF dither%<4 THEN
                        PROCpoint(X%,Y%,1-erase%)
                        PROCpoint(X%+D%,Y%+D%,1-erase%)
                      ELSE
                        IF TX%>0 THEN VDU 31,TX%,TY%,255+(erase%=1)*95
                      ENDIF
                      REPEAT
                        PROCREADMOUSE
                        IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                          IF dither%<4 THEN
                            X%=(PX% DIV DA%)*DA%
                            Y%=(PY% DIV DA%)*DA%
                            PROCpoint(X%,Y%,1-erase%)
                            PROCpoint(X%+D%,Y%+D%,1-erase%)
                          ELSE
                            IF TX%>0 THEN VDU 31,TX%,TY%,255+(erase%=1)*95
                          ENDIF
                        ENDIF
                        OLD_PX%=PX%
                        OLD_PY%=PY%
                      UNTIL MB%=0
                      IF animation% THEN PROCloadnextframe(1,1)

                    WHEN 3: REM FILL TOOL
                      PROCundosave
                      PROCfloodfill(PX%,PY%)
                      REPEAT
                        PROCREADMOUSE
                        WAIT 2
                      UNTIL MB%=0
                      IF animation% THEN PROCloadnextframe(1,1)

                    WHEN 4: REM SHAPE TOOLS
                      CASE shapesel% OF
                        WHEN 1: REM LINE TOOL
                          PROCundosave
                          startx%=PX%: starty%=PY%
                          OLD_PX%=PX% : OLD_PY%=PY%
                          PROCpoint(startx%,starty%,2)

                          REPEAT
                            PROCREADMOUSE
                            IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                              PROCbresenham(startx%,starty%,OLD_PX%,OLD_PY%,2)
                              PROCbresenham(startx%,starty%,PX%,PY%,2)
                              OLD_PX%=PX%
                              OLD_PY%=PY%
                            ENDIF
                          UNTIL MB%=0

                          PROCbresenham(startx%,starty%,PX%,PY%,2)
                          IF animateshape% THEN
                            oldframe%=frame%
                            PROCframesave(frame%)
                            PROCbresenham_buf(startx%,starty%,PX%,PY%,1-erase%)
                            frame%=oldframe%-1
                            PROCloadnextframe(1,0)
                          ELSE
                            PROCbresenham(startx%,starty%,PX%,PY%,1-erase%)
                            IF animation% THEN PROCloadnextframe(1,1)
                          ENDIF

                        WHEN 2: REM RECTANGLE TOOL
                          PROCundosave
                          startx%=PX%: starty%=PY%
                          OLD_PX%=PX% : OLD_PY%=PY%
                          PROCpoint(startx%,starty%,2)

                          REPEAT
                            PROCREADMOUSE
                            IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                              PROCrectangle(startx%,starty%,OLD_PX%,OLD_PY%,2)
                              PROCrectangle(startx%,starty%,PX%,PY%,2)
                              OLD_PX%=PX%
                              OLD_PY%=PY%
                            ENDIF
                          UNTIL MB%=0
                          PROCrectangle(startx%,starty%,PX%,PY%,2)
                          IF animateshape%=1 THEN
                            oldframe%=frame%
                            PROCframesave(frame%)
                            PROCrectangle_buf(startx%,starty%,PX%,PY%,1-erase%)
                            frame%=oldframe%-1
                            PROCloadnextframe(1,0)
                          ELSE
                            PROCrectangle(startx%,starty%,PX%,PY%,1-erase%)
                            IF animation% THEN PROCloadnextframe(1,1)
                          ENDIF

                        WHEN 3: REM CIRCLE TOOL
                          PROCundosave
                          startx%=PX%: starty%=PY%
                          OLD_PX%=PX% : OLD_PY%=PY%
                          REM PROCpoint(startx%,starty%,2)

                          REPEAT
                            PROCREADMOUSE
                            IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                              PROCcircle(startx%,starty%,startx%-OLD_PX%,2)
                              PROCcircle(startx%,starty%,startx%-PX%,2)
                              OLD_PX%=PX%
                              OLD_PY%=PY%
                            ENDIF
                          UNTIL MB%=0
                          PROCcircle(startx%,starty%,startx%-PX%,1-erase%)
                          IF animation% THEN PROCloadnextframe(1,1)

                      ENDCASE

                    WHEN 5: REM BACKGROUND COLOUR
                      PROCundosave
                      VDU 31,TX%,TY%,(curcol%+144),157-erase%
                      REPEAT
                        PROCREADMOUSE
                        IF TX%<>OLD_TX% OR TY%<>OLD_TY% THEN VDU 31,TX%,TY%,(curcol%+144),157-erase%
                        OLD_TX%=TX%
                        OLD_TY%=TY%
                      UNTIL MB%=0
                      IF animation% THEN PROCloadnextframe(1,1)
                    WHEN 6: REM FORGROUND COLOUR
                      PROCundosave
                      VDU 31,TX%,TY%,(curcol%+144)
                      REPEAT
                        PROCREADMOUSE
                        IF TX%<>OLD_TX% OR TY%<>OLD_TY% THEN VDU 31,TX%,TY%,(curcol%+144)
                        OLD_TX%=TX%
                        OLD_TY%=TY%
                      UNTIL MB%=0
                      IF animation% THEN PROCloadnextframe(1,1)


                  ENDCASE


              ENDCASE

            ENDIF
          ENDIF

        ELSE
          IF INKEY(-26) THEN PROCWAITNOKEY(-26) : PROCloadnextframe(-1,1) : REM SAVE CURRENT FRAME AND LOAD PREVIOUS FRAME
          IF INKEY(-122) THEN PROCWAITNOKEY(-122) : PROCloadnextframe(1,1) : REM SAVE CURRENT FRAME AND LOAD NEXT FRAME

          WAIT 2
        ENDIF

        REM SHOW ALL MOUSE TRACKING DETAILS
        REM PRINTTAB(0,0)SPC(40)
        REM PRINTTAB(0,0)"MX:";STR$(MX%);" MY:";STR$(MY%);" TX:";STR$(TX%);" TY:";STR$(TY%);" PX:";STR$(PX%);" PY:";STR$(PY%)


        REM REMEMBER MOUSE POSITION
        OLD_MX%=MX%
        OLD_MY%=MY%

      UNTIL 0

      END

      REM READ MOUSE AND CALCULATE TEXT AND SIXEL LOCATIONS
      DEF PROCREADMOUSE

      MOUSE MX%,MY%,MB%

      REM TEXT LOCATION RELEATIVE TO MOUSE
      TX%=MX% DIV 32
      TY%=(999-MY%) DIV 40

      REM SIXEL LOCATION RELEATIVE TO MOUSE
      PX%=MX% DIV 16
      PY%=(999-MY%)/13.3333333


      IF toolsel%=5 OR toolsel%=6 THEN
        VDU 31,TX%,TY%
      ELSE
        IF menuext%=1 THEN
          VDU 31,shapesel%-1,1
        ELSE
          VDU 31,toolcursor%,0
        ENDIF
      ENDIF


      ENDPROC

      REM WAIT FOR MOUSE TO BE A SPECIFIC BUTTON CLICK
      DEF PROCWAITMOUSE(M%)
      REPEAT
        PROCREADMOUSE
        WAIT 2
      UNTIL MB%=M%
      ENDPROC

      REM WAIT FOR NO KEY INPUT
      DEF PROCWAITNOKEY(W%)
      REPEAT

      UNTIL INKEY(W%)=0
      ENDPROC

      REM Read the point at the specified coordinates (1=set, 0=cleared)
      DEFFNpoint(x%,y%)
      LOCAL cx%,cy%,chr%,C%
      REM Get character cell
      cx% = x% DIV 2
      cy% = y% DIV 3
      chr%=GET(cx%,cy%) AND &5F
      C%=(x% AND 1)+(y% MOD 3)*2
      C%=2^C% - (C%=5)*32
      =SGN(chr% AND C%)

      REM Plot a Teletext sixel point
      REM SIXEL COORDINATES WITH 0,0 BEING TOP LEFT THE SAME AS THE TEXT SCREEN
      REM cmd% 0: Clear the point
      REM cmd% 1: Set the point
      REM cmd% 2: Toggle the point
      DEFPROCpoint(x%, y%, cmd%)

      IF x%>xMin% AND x%<xMax% AND y%>yMin% AND y%<yMax% THEN

        LOCAL cx%,cy%,chr%,C%
        REM Get character cell
        cx% = x% DIV 2
        cy% = y% DIV 3
        chr%=GET(cx%,cy%) AND &5F
        C%=(x% AND 1)+(y% MOD 3)*2
        C%=2^C% - (C%=5)*32
        CASE cmd% OF
          WHEN 0:chr% AND=(&5F - C%)
          WHEN 1:chr% OR=C%
          WHEN 2:chr% EOR=C%
        ENDCASE

        VDU 31,cx%, cy%,(chr%+160)
      ENDIF

      ENDPROC

      REM Read the point at the specified coordinates from specified buffer (1=set, 0=cleared)
      DEFFNpoint_buf(x%,y%,f%)
      LOCAL cx%,cy%,chr%,C%
      REM Get character cell
      cx% = x% DIV 2
      cy% = (y% DIV 3)-1
      chr%=FRAME_BUFFER(f%,cx%+cy%*40) AND &5F
      C%=(x% AND 1)+(y% MOD 3)*2
      C%=2^C% - (C%=5)*32
      =SGN(chr% AND C%)

      REM Plot a Teletext sixel point from specified buffer
      REM SIXEL COORDINATES WITH 0,0 BEING TOP LEFT THE SAME AS THE TEXT SCREEN
      REM cmd% 0: Clear the point
      REM cmd% 1: Set the point
      REM cmd% 2: Toggle the point
      DEFPROCpoint_buf(x%, y%, cmd%,f%)

      IF x%>xMin% AND x%<xMax% AND y%>yMin% AND y%<yMax% THEN

        LOCAL cx%,cy%,chr%,C%
        REM Get character cell
        cx% = x% DIV 2
        cy% = (y% DIV 3)-1
        chr%=FRAME_BUFFER(f%,cx%+cy%*40) AND &5F
        C%=(x% AND 1)+(y% MOD 3)*2
        C%=2^C% - (C%=5)*32
        CASE cmd% OF
          WHEN 0:chr% AND=(&5F - C%)
          WHEN 1:chr% OR=C%
          WHEN 2:chr% EOR=C%
        ENDCASE

        FRAME_BUFFER(f%,cx%+cy%*40)=chr%+160
      ENDIF

      ENDPROC


      REM LINE ROUTINE USE m% TO PERFORM 0=ERASE / 1=DRAW / 2=EOR
      DEF PROCbresenham(x1%,y1%,x2%,y2%,m%)
      LOCAL dx%, dy%, sx%, sy%, e
      dx% = ABS(x2% - x1%) : sx% = SGN(x2% - x1%)
      dy% = ABS(y2% - y1%) : sy% = SGN(y2% - y1%)
      IF dx% > dy% e = dx% / 2 ELSE e = dy% / 2
      REPEAT
        PROCpoint(x1%,y1%,m%)
        IF x1% = x2% IF y1% = y2% EXIT REPEAT
        IF dx% > dy% THEN
          x1% += sx% : e -= dy% : IF e < 0 e += dx% : y1% += sy%
        ELSE
          y1% += sy% : e -= dx% : IF e < 0 e += dy% : x1% += sx%
        ENDIF
      UNTIL FALSE
      ENDPROC

      REM LINE ROUTINE FOR BUFFER USE m% TO PERFORM 0=ERASE / 1=DRAW / 2=EOR
      DEF PROCbresenham_buf(x1%,y1%,x2%,y2%,m%)
      LOCAL dx%, dy%, sx%, sy%, e
      dx% = ABS(x2% - x1%) : sx% = SGN(x2% - x1%)
      dy% = ABS(y2% - y1%) : sy% = SGN(y2% - y1%)
      IF dx% > dy% e = dx% / 2 ELSE e = dy% / 2

      REPEAT
        IF animategapcount%=0 THEN
          PROCpoint_buf(x1%,y1%,m%,frame%)
          frame%=frame%+1
          IF frame%>frame_max% THEN frame%=1
        ELSE
          animategapcount%-=1
        ENDIF
        IF x1% = x2% IF y1% = y2% EXIT REPEAT
        IF dx% > dy% THEN
          x1% += sx% : e -= dy% : IF e < 0 e += dx% : y1% += sy%
        ELSE
          y1% += sy% : e -= dx% : IF e < 0 e += dy% : x1% += sx%
        ENDIF
      UNTIL FALSE
      ENDPROC

      REM RECTANGLE ROUTINE
      DEF PROCrectangle(x1%,y1%,x2%,y2%,m%)

      REM CHECK FOR SPECIAL CASES TO PRESERVE EOR OPERATIONS
      IF x1%=x2% AND y1%=y2% THEN
        PROCpoint(x1%,y1%,m%)
      ELSE
        IF x1%=x2% OR y1%=y2% THEN
          PROCbresenham(x1%,y1%,x2%,y2%,m%)
        ELSE
          PROCbresenham(x1%,y1%,x2%,y1%,m%)
          PROCbresenham(x1%,y2%,x2%,y2%,m%)
          IF ABS(y2%-y1%)>1 THEN
            IF y1%>y2% THEN SWAP y1%,y2%
            FOR Y%=y1%+1 TO y2%-1
              PROCpoint(x1%,Y%,m%)
              PROCpoint(x2%,Y%,m%)
            NEXT
          ENDIF
        ENDIF
      ENDIF
      ENDPROC

      REM RECTANGLE ROUTINE FOR BUFFER
      DEF PROCrectangle_buf(x1%,y1%,x2%,y2%,m%)

      REM CHECK FOR SPECIAL CASES TO PRESERVE EOR OPERATIONS
      IF x1%=x2% AND y1%=y2% THEN
        PROCpoint(x1%,y1%,m%)
      ELSE
        IF x1%=x2% OR y1%=y2% THEN
          PROCbresenham_buf(x1%,y1%,x2%,y2%,m%)
        ELSE
          IF x1%>x2% THEN SWAP x1%,x2%
          IF y1%>y2% THEN SWAP y1%,y2%
          PROCbresenham_buf(x1%,y1%,x2%,y1%,m%)
          PROCbresenham_buf(x2%,y1%+1,x2%,y2%-1,m%)
          PROCbresenham_buf(x2%,y2%,x1%,y2%,m%)
          PROCbresenham_buf(x1%,y2%-1,x1%,y1%+1,m%)
        ENDIF
      ENDIF
      ENDPROC


      REM CIRCLE ROUTINE
      DEF PROCcircle(x1%,y1%,r%,m%)
      LOCAL p,x%,y%

      r%=ABS(r%)
      p=(5-r%*4)/4
      x%=0
      y%=r%

      PROCcirclepoints(x1%,y1%,x%,y%,m%)

      WHILE x%<y%
        x%+=1
        IF p<0 THEN
          p+=2*x%+1
        ELSE
          y%-=1
          p+=2*(x%-y%)+1
        ENDIF
        PROCcirclepoints(x1%,y1%,x%,y%,m%)
      ENDWHILE

      ENDPROC

      REM THIS PLOTS THE POINTS FOR CIRCLE ROUTINE
      DEF PROCcirclepoints(cx%,cy%,x%,y%,m%)
      IF x%=0 THEN
        PROCpoint(cx%,cy%+y%,m%)
        PROCpoint(cx%,cy%-y%,m%)
        PROCpoint(cx%+y%,cy%,m%)
        PROCpoint(cx%-y%,cy%,m%)
      ELSE
        IF x%<=y% THEN
          PROCpoint(cx%+x%,cy%+y%,m%)
          PROCpoint(cx%-x%,cy%+y%,m%)
          PROCpoint(cx%+x%,cy%-y%,m%)
          PROCpoint(cx%-x%,cy%-y%,m%)
          IF x%<y% THEN
            PROCpoint(cx%+y%,cy%+x%,m%)
            PROCpoint(cx%-y%,cy%+x%,m%)
            PROCpoint(cx%+y%,cy%-x%,m%)
            PROCpoint(cx%-y%,cy%-x%,m%)
          ENDIF
        ENDIF
      ENDIF
      ENDPROC

      REM ### flood fill from ART4BBW
      DEF PROCfloodfill(sx%,sy%)

      IF sx%>xMin% AND sx%<xMax% AND sy%>yMin% AND sy%<yMax% THEN

        LOCAL uf,df,c%,x%,y%,mc%
        uf=0
        df=0

        REM fill with mask colour first
        bCnt%=0
        PROCaddFill(sx%,sy%)

        REPEAT
          REM get next fill point
          bCnt%-=1
          x%=fill{(bCnt%)}.x%
          y%=fill{(bCnt%)}.y%
          IF FNpoint(x%,y%) = 0 THEN

            uf=1 : df=1

            REM scan left
            WHILE x%>fxMin% AND FNpoint(x%-1,y%) =0
              x%-=1
            ENDWHILE

            REM scan right
            WHILE x%<fxMax% AND FNpoint(x%,y%) = 0
              PROCpoint(x%,y%,1)

              REM detect colour changes above and add to list
              IF y%<fyMax% THEN
                c%=FNpoint(x%,y%+1)
                IF uf AND c%=0 THEN PROCaddFill(x%,y%+1) : uf=0
                IF c%=1 THEN uf=1
              ENDIF

              REM detect colour changes below and add to list
              IF y%>fyMin% THEN
                c%=FNpoint(x%,y%-1)
                IF df AND c%=0 THEN PROCaddFill(x%,y%-1) : df=0
                IF c%=1 THEN df=1
              ENDIF
              x%+=1
            ENDWHILE
          ENDIF

        UNTIL bCnt%=0
      ENDIF

      ENDPROC

      REM ### fill quasi stack
      DEF PROCaddFill(x%,y%)
      fill{(bCnt%)}.x%=x%
      fill{(bCnt%)}.y%=y%
      IF bCnt%<100 THEN bCnt%+=1
      ENDPROC

      REM UPDATE CLEARSCREEN OPTIONS
      DEF PROCupdateCS
      PRINTTAB(5,7)"FORE  ";CHR$(234);SPC(17);CHR$(181);
      PRINTTAB(5,9)"BACK  ";CHR$(234);SPC(17);CHR$(181);

      IF bakcol%=0 THEN PRINTTAB(13,9)"B"

      FOR I%=1 TO 7
        PRINTTAB(12+I%*2,7)CHR$(144+I%);CHR$(255+(I%=curcol%)*185);
        PRINTTAB(12+I%*2,9)CHR$(144+I%);CHR$(255+(I%=bakcol%)*189);
      NEXT

      PRINTTAB(5,11)"OUTPUT";
      IF bakcol%>0 THEN
        VDU 144+bakcol%,157,144+curcol%
      ELSE
        VDU 32,32,144+curcol%
      ENDIF
      PRINTTAB(14,11)"abcdefghijklmno";CHR$(156);CHR$(151)

      ENDPROC

      REM CLEARSCREEN DIALOG
      DEF PROCclearscreen
      PROCmenusave : menuext%=2
      PROCWAITMOUSE(0)

      FOR L%=5 TO 18
        PRINTTAB(0,L%)SPC(40);
      NEXT

      PRINTTAB(1,5)CHR$(151);CHR$(232);STRING$(10,CHR$(172));CHR$(130);"CLEARSCREEN";CHR$(151);STRING$(10,CHR$(172));CHR$(180);
      FOR L%=6 TO 17
        PRINTTAB(1,L%)CHR$(151);CHR$(234);STRING$(32," ");CHR$(151);CHR$(181);
      NEXT

      PRINTTAB(4,13)CHR$(146);CHR$(157);CHR$(132);"ALL FRAMES  ";CHR$(156);" ";CHR$(145);CHR$(157);CHR$(131);" CANCEL   ";CHR$(156);

      PRINTTAB(4,14)CHR$(129);STRING$(29,"-")

      PRINTTAB(4,15)CHR$(132);"SCROLL OFFSET:  ";CHR$(134);"HORZ   VERT"
      A$=STR$(scrollh%)
      IF LEN(A$)<2 THEN A$=A$+" "
      B$=STR$(scrollv%)
      IF LEN(B$)<2 THEN B$=B$+" "

      PRINTTAB(4,16)CHR$(146);CHR$(157);CHR$(132);"DUPE FRAME  ";CHR$(156);CHR$(135)+"-"+CHR$(131)+A$+CHR$(135)+"+ -"+CHR$(131)+B$+CHR$(135)+"+"

      PRINTTAB(1,18)CHR$(151);CHR$(170);STRING$(33,CHR$(172));CHR$(165);

      PROCupdateCS

      done%=0
      col_old%=curcol%
      bak_old%=bakcol%
      h_old%=scrollh%
      v_old%=scrollv%

      REPEAT
        PROCREADMOUSE
        IF MB%=4 THEN
          PROCWAITMOUSE(0)
          IF TY%=7 THEN
            IF TX%>13 AND TX%<28 THEN curcol%=(TX%-12) DIV 2
          ENDIF
          IF TY%=9 THEN
            IF TX%>11 AND TX%<28 THEN bakcol%=(TX%-12) DIV 2
          ENDIF

          IF TY%=13 THEN
            IF TX%>5 AND TX%<20 THEN done%=1
            IF TX%>23 AND TX%<34 THEN done%=-1
          ENDIF

          IF TY%=16 THEN
            IF TX%>5 AND TX%<20 THEN done%=2

            CASE TX% OF
              WHEN 21 : REM HORIZONTAL DECREMENT
                scrollh%-=1
                IF scrollh%<-5 THEN scrollh%=-5
              WHEN 26 : REM HORIZONTAL INCREMENT
                scrollh%+=1
                IF scrollh%>5 THEN scrollh%=5
              WHEN 28 : REM VERTICAL DECREMENT
                scrollv%-=1
                IF scrollv%<-5 THEN scrollv%=-5
              WHEN 33 : REM VERTICAL INCREMENT
                scrollv%+=1
                IF scrollv%>5 THEN scrollv%=5
            ENDCASE

          ENDIF
          IF col_old%<>curcol% OR bak_old%<>bakcol% THEN
            PROCupdateCS
            col_old%=curcol%
            bak_old%=bakcol%

          ENDIF
          IF h_old%<>scrollh% THEN
            A$=STR$(scrollh%)
            IF LEN(A$)<2 THEN A$=A$+" "
            PRINTTAB(23,16)A$;
            h_old%=scrollh%
          ENDIF
          IF v_old%<>scrollv% THEN
            A$=STR$(scrollv%)
            IF LEN(A$)<2 THEN A$=A$+" "
            PRINTTAB(30,16)A$;
            v_old%=scrollv%
          ENDIF

        ENDIF
      UNTIL done%

      PROCWAITMOUSE(0)

      PROCmenurestore
      CASE done% OF
        WHEN -1:  REM CANCEL

        WHEN 1: REM NEW BACKGROUND COLOUR

          PROCGR(curcol%,bakcol%)

          FOR frame%=1 TO frame_max%
            PROCframesave(frame%)
            REM WAIT 10
          NEXT frame%
          frame%=1

        WHEN 2: REM DUPLICATE FRAME 1
          PROCframesave(1)
          frame%=0
          PROCloadnextframe(1,0)
          hindex%=scrollh%
          vindex%=scrollv%
          FOR frame%=2 TO frame_max%
            IF scrollh%<>0 OR scrollv%<>0 THEN
              PROCcopyframe(1,frame%,hindex%,vindex%)
              hindex%+=scrollh%
              vindex%+=scrollv%
            ELSE
              PROCframesave(frame%)
            ENDIF
          NEXT frame%
          frame%=1

      ENDCASE
      REMPROCloadnextframe(1,0)

      ENDPROC

      REM SAVE FRAME BUFFER
      DEF PROCframesave(f%)
      LOCAL U%

      FOR U%=0 TO 959
        FRAME_BUFFER(f%,U%)=GET(U% MOD 40,U% DIV 40+1)
      NEXT

      ENDPROC

      REM RESTORE FRAME BUFFER
      DEF PROCframerestore(f%)
      LOCAL U%

      FOR U%=0 TO 959
        VDU 31,(U% MOD 40),(U% DIV 40+1),FRAME_BUFFER(f%,U%)
      NEXT

      ENDPROC

      REM COPY A FRAME STARTING FROM OFFSET
      DEF PROCcopyframe(S%,D%,H%,V%)
      LOCAL U%,X%,Y%,xofs%,yofs%

      FOR X%=1 TO 39
        xofs%=X%+H%
        IF xofs%<1 THEN xofs%=39-xofs%
        IF xofs%>39 THEN xofs%=xofs%-39
        FOR Y%=0 TO 23
          yofs%=Y%+V%
          IF yofs%<0 THEN yofs%=23-yofs%
          IF yofs%>23 THEN yofs%=yofs%-23

          FRAME_BUFFER(D%,X%+Y%*40)=FRAME_BUFFER(S%,xofs%+yofs%*40)
        NEXT
      NEXT

      ENDPROC

      DEF PROCloadnextframe(F%,S%)

      IF S% THEN
        PROCWAITMOUSE(0)
        PROCframesave(frame%)
      ENDIF
      frame%+=F%
      IF frame%>frame_max% THEN frame%=1
      IF frame%<1 THEN frame%=frame_max%
      PROCframerestore(frame%)
      PROCdrawmenu
      ENDPROC

      REM SAVE UNDO SCREEN
      DEF PROCundosave
      LOCAL U%
      UNDO_INDEX%+=1
      IF UNDO_INDEX%>UNDO_MAX% THEN UNDO_INDEX%=0

      FOR U%=0 TO 959
        UNDO_BUFFER(UNDO_INDEX%,U%)=GET(U% MOD 40,U% DIV 40+1)
      NEXT

      ENDPROC

      REM SAVE UNDO SCREEN
      DEF PROCundorestore
      LOCAL U%

      FOR U%=0 TO 959
        VDU 31,(U% MOD 40),(U% DIV 40+1),UNDO_BUFFER(UNDO_INDEX%,U%)
      NEXT

      UNDO_INDEX%-=1
      IF UNDO_INDEX%<0 THEN UNDO_INDEX%=UNDO_MAX%

      ENDPROC

      REM MENU BUFFER SAVE SCREEN
      DEF PROCmenusave
      LOCAL U%
      FOR U%=0 TO 959
        MENU_BUFFER(U%)=GET(U% MOD 40,U% DIV 40+1)
      NEXT

      ENDPROC

      REM MENU BUFFER UNDO SCREEN
      DEF PROCmenurestore
      LOCAL U%

      IF menuext% THEN
        FOR U%=0 TO 959
          VDU 31,(U% MOD 40),(U% DIV 40+1),MENU_BUFFER(U%)
        NEXT
        menuext%=0
      ENDIF
      ENDPROC


      REM SAVE BINARY FILE
      DEF PROCsavebinaryfile(F$)
      f%=OPENOUT(F$)
      FOR U%=0 TO 999
        BPUT#f%,GET(U% MOD 40,U% DIV 40)
      NEXT
      CLOSE#f%
      ENDPROC

      REM LOAD BINARY FILE
      DEF PROCloadbinaryfile(F$)
      f%=OPENIN(F$)

      FOR U%=0 TO 999
        char%=BGET#f%
        VDU 31,U% MOD 40,U% DIV 40,char%
      NEXT
      CLOSE#f%
      ENDPROC


      REM LOADFILE
      DEF PROCloadfile

      LOCAL N%
      DIM n$(10000)

      N% = FN_dirscan(n$(), "dir *.BIN", "", "", "")

      REM HACK SORT, NEED TO LOOK INTO READING FILE DATES AND SORTING NEWEST FIRST
      FOR I%=1 TO N% DIV 2
        SWAP n$(I%),n$(N%-I%+1)
      NEXT

      PROCWAITMOUSE(0)
      PROCmenusave : menuext%=2
      FOR L%=6 TO 18
        PRINTTAB(0,L%)SPC(40);
      NEXT


      PRINTTAB(2,6)CHR$(151);CHR$(232);STRING$(10,CHR$(172));CHR$(130);"LOAD FILE";CHR$(151);STRING$(10,CHR$(172));CHR$(180);
      FOR L%=7 TO 17
        PRINTTAB(2,L%)CHR$(151);CHR$(234);STRING$(30," ");CHR$(151);CHR$(181);
      NEXT
      PRINTTAB(2,18)CHR$(151);CHR$(170);STRING$(31,CHR$(172));CHR$(165);

      F%=0
      S%=0
      SEL%=0
      SELOLD%=0
      SELY%=-1
      INDEX%=1
      INDEXOLD%=1
      DC%=0


      FOR I%=INDEX% TO INDEX%+10
        IF I%<N% THEN PRINTTAB(6,6+I%)CHR$(131);LEFT$(n$(I%),24);
      NEXT

      REPEAT
        PROCREADMOUSE

        IF MB%=4 THEN
          IF MY%<>OLD_MY% THEN INDEX%+=SGN(MY%-OLD_MY%)
          IF INDEX%<1 THEN INDEX%=1
          IF INDEX%>N%-10 THEN INDEX%=N%-10
          IF SELY%=-1 THEN SELY%=MY%

        ENDIF

        IF MB%=0 THEN
          IF SELY%=MY% THEN
            S%=TY%-7
            IF S%>-1 AND S%<11 THEN SEL%=S%+INDEX%
            IF SEL%<1 THEN SEL%=1
            IF SEL%>N% THEN SEL%=N%
            F%=SEL%
            IF TX%<6 OR TX%>32 OR TY%<7 OR TY%>17 THEN F%=-1
          ENDIF
          SELY%=-1
        ENDIF

        IF INDEX%<>INDEXOLD% OR SELOLD%<>SEL% THEN
          FOR I%=0 TO 10
            K%=I%+INDEX%
            IF K%<N%+1 AND K%>0 THEN
              VDU 31,4,I%+7
              IF SEL%=K% THEN
                VDU 132,157
              ELSE
                VDU 32,32
              ENDIF
              PRINTCHR$(131);LEFT$(n$(K%),24);
              IF SEL%=K% THEN VDU 32,32,156
            ENDIF
          NEXT
          SELOLD%=SEL%
          INDEXOLD%=INDEX%
        ENDIF

        REM PRINTTAB(0,1)STR$(SEL%)

        OLD_MY%=MY%


        WAIT 2
      UNTIL F%<>0

      PROCmenurestore

      IF F%>0 THEN
        IF LEFT$(FNUPPER(n$(SEL%)),3)="M7_" THEN
          F$=LEFT$(n$(SEL%),22)
          FOR frame%=1 TO frame_max%
            PROCloadbinaryfile(F$ + STR$(frame%)+".BIN")
            PROCframesave(frame%)
            REM WAIT 10
          NEXT
          PROCloadnextframe(1,0)
        ELSE
          IF RIGHT$(FNUPPER(n$(SEL%)),3)="BIN" THEN
            PROCloadbinaryfile(n$(SEL%))
            PROCframesave(frame%)
          ENDIF
        ENDIF
      ENDIF
      ENDPROC

      REM SAVEFILE
      DEF PROCsavefile
      PROCWAITMOUSE(0)

      PROCframesave(frame%)

      REM SAVE FRAMES
      T$=TIME$
      C%=FN_findreplace(T$, ".", "", 1)
      C%=FN_findreplace(T$, " ", "", 1)
      C%=FN_findreplace(T$, ",", "", 1)
      C%=FN_findreplace(T$, ":", "", 1)

      frame%=frame_max%
      FOR I%=1 TO frame_max%
        PROCloadnextframe(1,0)
        PROCsavebinaryfile("M7_" + T$ + "_" + STR$(frame%)+".BIN")
        OSCLI "SCREENSAVE ""M7_" + T$ + "_" + STR$(frame%)+".BMP"" 0,0,1280,1000"
        WAIT 10
      NEXT

      PROCloadnextframe(1,0)

      PROCmenusave : menuext%=2
      PRINTTAB(9,10)CHR$(151);CHR$(232);STRING$(18,CHR$(172));CHR$(180);CHR$(144+curcol%);
      FOR L%=11 TO 13
        PRINTTAB(9,L%)CHR$(151);CHR$(234);STRING$(17," ");CHR$(151);CHR$(181);CHR$(144+curcol%);
      NEXT
      PRINTTAB(9,14)CHR$(151);CHR$(170);STRING$(18,CHR$(172));CHR$(165);CHR$(144+curcol%);

      REM READ FILES
      PRINTTAB(13,12)CHR$(130);"FILE SAVED!";

      PROCWAITMOUSE(4)

      PROCWAITMOUSE(0)

      PROCmenurestore

      ENDPROC

      REM ANIMATE ALL FRAMES IN SEQUENCE FROM 1 TO FRAME_MAX%
      DEF PROCplay

      PROCframesave(frame%)
      PROCWAITMOUSE(0)

      VDU 23,1,0;0;0;0; : REM Disable cursor

      D%=0

      frame%=frame_max%
      REPEAT
        PROCloadnextframe(1,0)
        FOR I%=0 TO 9
          PROCREADMOUSE
          IF MB%<>0 THEN D%=1
          WAIT 2
        NEXT
      UNTIL D%
      PROCWAITMOUSE(0)

      VDU 23,1,1;0;0;0; : REM Enable cursor

      ENDPROC

      REM Convert to upper case:
      DEF FNUPPER(a$) IF LENa$=0 THEN =""
      LOCAL p%%
      FOR p%% = PTR(a$) TO PTR(a$)+LENa$-1
        IF ?p%% >= 97 IF ?p%% <= 122 ?p%% -= 32
      NEXT
      = a$


      REM INITIALISE THE SCREEN
      DEF PROCGR(F%,B%)

      REM CLS
      VDU 12

      REM ADD GRAPHICS CODE TO LEFT SIDE OF CANVAS
      FOR Y%=1 TO 24
        VDU 31,0,Y%
        IF B% THEN VDU 144+B%,157
        VDU 144+F%
      NEXT

      ENDPROC

      REM PRINT PALETTE AND MENU
      DEF PROCdrawmenu
      FOR count%=1 TO 7
        PRINTTAB(count%*2-2,0) CHR$(128+count%);CHR$(255+(count%=curcol%)*213);
      NEXT count%
      PRINTTAB(14,0) CHR$(135);"PD";STR$(dither%+1);"FS";CHR$(135-erase%*5);"E";CHR$(135);"U R CBF LS";CHR$(135-animation%*5);"A";CHR$(135);STR$(frame%);"<>P"
      IF menuext%=1 THEN
        d%=135-animateshape%*5

        A$="LRO"+CHR$(d%)+"A"+CHR$(134)+"GAP:"+CHR$(135)+"-"+CHR$(131)+STR$(animategap%)+CHR$(135)+"+"+CHR$(134)+"LEN:"+CHR$(135)+"-"+CHR$(131)+STR$(animatelen%)+CHR$(135)+"+"

        PRINTTAB(0,1)A$;SPC(40-LEN(A$))
      ENDIF
      ENDPROC
Last edited by FourthStone on Sat Aug 29, 2020 6:26 am, edited 2 times in total.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Fri Aug 28, 2020 6:20 am

That loading screen is really is great Fourthstone. I thought wow is that mode 7.
I’m going to get you to do a painting....there is an artist in there.
Thanks for all you have done this week on it. So much progress has been made. I couldn’t have done it.
Hope you have a well deserved weekend.

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Fri Aug 28, 2020 7:12 am

Thanks Pixel :D

Questions swirling about scrolling... have you got an image that you have already done manually that I can use as an example?

Do you want to scroll what's currently displayed, without changing frames?

Do you want to have an option to copy the frame left or right and scroll (up, down, left, right)?

Do you need an option to copy a frame and scroll to all other frames? ... e.g. scroll current frame x pixels left and copy to all other frames while incrementing the offset by x pixels for each frame..

Cyclic scrolling? e.g. Scroll image for 4 frames and then return to the starting position..

Anything else? Will try defining parameters so I can start to implement something.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Fri Aug 28, 2020 7:16 am

Hi
Sorry I’m on the iPad just about to go to work so don’t have an image offhand. Apologies.
I think the easiest thing is have a static image on frame 1. When you apply the scroll in spreads it over 8 frames in a loop.
Up down left or right.
We can see how that goes. The idea is to make a man walk down the street. Yes cycling scrolling, even if it’s in character block intervals. Pixel scrolling would be nice but that involve Increasing the number of frames. So maybe we should just stick with 8 frames to keep it simple.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Fri Aug 28, 2020 6:55 pm

That drop down menu is a really good idea. You sure are squeezing the most out of the screen real estate.

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Fri Aug 28, 2020 6:56 pm

On another note I see it’s 27c in Brisbane. That is your winter. Over here it will be 10c on Saturday for our summer. :lol:

User avatar
FourthStone
Posts: 1028
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Fri Aug 28, 2020 9:16 pm

pixelblip wrote:
Fri Aug 28, 2020 6:56 pm
On another note I see it’s 27c in Brisbane. That is your winter. Over here it will be 10c on Saturday for our summer. :lol:
You'd have to travel about 2500 km south of Brisbane to find similar weather to the UK, Tasmania probably comes close but the UK is further north than anything south around this part of the globe. Brrrrr :-

Speaking of drop downs, I've started adding an offset scroll tool to the duplicate frame section of the clear screen dialog.

What would be the maximum you'd want to scroll in one step do you think?

User avatar
pixelblip
Posts: 2197
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sat Aug 29, 2020 1:11 am

We had a week of 33c and I have to say it was such a treat.....

Thanks for adding that feature. 🙏
The max scroll offset. Ummm.....not sure. I guess if we have 8 frames it will be 40/8....So that is 5 characters.
Ok you can wish me happy birthday now. I plan on going for a greasy spoon...and doing some teletext paintings of course :)

Post Reply

Return to “programming”