it appears there was a bug in drawing vertical lines. this now works
it appears there was a bug in drawing vertical lines. this now works
Warning I'm not a teacher
Excellent! Hats off again Richard. This looked like a lot of work in putting it all together. If we ever meet, the drinks will definitely be on me!
Troy
Richard,
Another question: can we pass variables as parameters to these geometric routines?
Like:
DRAWLINE My_x1, My_y1, My_x2, My_y2, 1
So far I'm trying to pass byte size variables but getting illegal opcode messages at compile?
Troy
EASY , Just add the needed macro's to the include file, you can dial up whatever you likeAnother question: can we pass variables as parameters to these geometric routines?
http://www.picbasic.co.uk/forum/show...hlight=ssd1306
http://www.picbasic.co.uk/forum/show...hlight=usercmd
http://support.melabs.com/forum/picb...er/usercommand
Last edited by richard; - 3rd April 2021 at 14:03.
Warning I'm not a teacher
oookayEASY , Just add the needed macro's to the include file, you can dial up whatever you like![]()
You need a macro likeDRAWLINE My_x1, My_y1, My_x2, My_y2, 1
DRAWLINE?BBBBC
the error message will tell you this does not exist
the existing drawline macros
Code:;LINE DRAWLINE?WWWW macro X0in ,Y0in ,X1in ,Y1in MOVE?WB X0in ,_s_xstart MOVE?WB X1in ,_s_xend MOVE?WB Y0in ,_s_ystart MOVE?WB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?WWBW macro X0in ,Y0in ,X1in ,Y1in MOVE?WB X0in ,_s_xstart MOVE?BB X1in ,_s_xend MOVE?WB Y0in ,_s_ystart MOVE?WB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?WWBB macro X0in ,Y0in ,X1in ,Y1in MOVE?WB X0in ,_s_xstart MOVE?BB X1in ,_s_xend MOVE?WB Y0in ,_s_ystart MOVE?BB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?WWCC macro X0in ,Y0in ,X1in ,Y1in MOVE?WB X0in ,_s_xstart MOVE?CB X1in ,_s_xend MOVE?WB Y0in ,_s_ystart MOVE?CB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?WWWB macro X0in ,Y0in ,X1in ,Y1in MOVE?WB X0in ,_s_xstart MOVE?WB X1in ,_s_xend MOVE?WB Y0in ,_s_ystart MOVE?BB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?BBBB macro X0in ,Y0in ,X1in ,Y1in MOVE?BB X0in ,_s_xstart MOVE?BB X1in ,_s_xend MOVE?BB Y0in ,_s_ystart MOVE?BB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?CCCC macro X0in ,Y0in ,X1in ,Y1in MOVE?CB X0in ,_s_xstart MOVE?CB X1in ,_s_xend MOVE?CB Y0in ,_s_ystart MOVE?CB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?CCCB macro X0in ,Y0in ,X1in ,Y1in MOVE?CB X0in ,_s_xstart MOVE?CB X1in ,_s_xend MOVE?CB Y0in ,_s_ystart MOVE?BB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?CCCW macro X0in ,Y0in ,X1in ,Y1in MOVE?CB X0in ,_s_xstart MOVE?CB X1in ,_s_xend MOVE?CB Y0in ,_s_ystart MOVE?WB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?BBCC macro X0in ,Y0in ,X1in ,Y1in MOVE?BB X0in ,_s_xstart MOVE?CB X1in ,_s_xend MOVE?BB Y0in ,_s_ystart MOVE?CB Y1in ,_s_yend L?CALL _dline endm DRAWLINE?CCCCC macro X0in ,Y0in ,X1in ,Y1in,Col MOVE?CB Col ,_colour MOVE?CB X0in ,_s_xstart MOVE?CB X1in ,_s_xend MOVE?CB Y0in ,_s_ystart MOVE?CB Y1in ,_s_yend L?CALL _dline endm
you could add this
Code:DRAWLINE?BBBBC macro X0in ,Y0in ,X1in ,Y1in,Col MOVE?BB X0in ,_s_xstart MOVE?BB X1in ,_s_xend MOVE?BB Y0in ,_s_ystart MOVE?BB Y1in ,_s_yend MOVE?CB Col ,_colour L?CALL _dline endm
or set the colour manually
eg colour=1
and use
DRAWLINE My_x1, My_y1, My_x2, My_y2
which already exists
DRAWLINE?BBBB
with a mono display you probably wont change the colour too often
Warning I'm not a teacher
a 5 input user command has the potential to need 5 raised to the 7th power of macros to cover every input permutation possible
a ridiculous number, i only ever create what seems useful to me. it's trivially easy to add any other combination you app calls for
and the compiler error virtually spells it out for you
Warning I'm not a teacher
Bookmarks