Page 1 of 1

[DM42 Bug?] CLLCD not working right

Posted: Mon Apr 02, 2018 6:21 pm
by keithdalby
After printing the LCD, CLLCD isn't clearing the LCD before PIXEL draws pixels. Best to explain with the code below:

Code: Select all

LBL "TEST"
MAN
PRON
0
STO "GrMod"
5
5
CLLCD
PIXEL
PRLCD
CLLCD
2
STO "GrMod"
100
100
CLLCD
PIXEL
END
The code sticks a pixel at 5,5 in GrMod 0, prints, then attempts to show a pixel at 100,100 in GrMod 2, but the CLLCDs aren't doing what I'd expect them to do.

Is this normal behaviour or a bug?

Re: [DM42 Bug?] CLLCD not working right

Posted: Tue Apr 03, 2018 9:36 am
by whuyse
I altered the program to remove the printing commands, and added a STOP after the first PIXEL. Executing first shows the pixel at (5,5).
Upon pressing R/S, the busy annunciator remains lit, and the result of drawing the pixel at (100,100) is not shown. Pressing PRGM shows the code has run till the end (RTN before the LBL 14).
If I remove the CLLCD right after the stop it works OK.
I must say I tried it first with the printing commands, then turned printing off with PROFF and removed the commands. Firmware 3.5.

Code: Select all

>LBL "TEST"
0
XEQ 14
5
ENTER
CLLCD
PIXEL
STOP
CLLCD
2
XEQ 14
100
ENTER
CLLCD
PIXEL
RTN
>LBL 14
STO "GrMod"
END
Cheers, Werner

Re: [DM42 Bug?] CLLCD not working right

Posted: Tue Apr 03, 2018 1:22 pm
by keithdalby
whuyse wrote:
Tue Apr 03, 2018 9:36 am
If I remove the CLLCD right after the stop it works OK.
Thanks for looking at this. I ran the code as you wrote it and had exactly the same behaviour whether I include the CLLCD just after the STOP or not. The CLLCD is not CLing the LCD. Same firmware as you.

Now, if I run up to the stop, then type something into the X register before resuming with R/S, I get the expected behaviour. So, I conclude that CLLCD isn't working right

Re: [DM42 Bug?] CLLCD not working right

Posted: Tue Apr 03, 2018 2:05 pm
by mcc
Hi,

just a quick guess:
Is this dependant on the refresh settings via virtual variables for the LCD?

Cheers!
Meino

Re: [DM42 Bug?] CLLCD not working right

Posted: Wed Apr 04, 2018 11:56 am
by keithdalby
mcc wrote:
Tue Apr 03, 2018 2:05 pm
Is this dependant on the refresh settings via virtual variables for the LCD?
Afraid not. Tried with every permissible value of RefLCD, and got exactly the same broken behaviour.

Re: [DM42 Bug?] CLLCD not working right

Posted: Sat Apr 07, 2018 11:07 pm
by Thomas Okken
whuyse wrote:
Tue Apr 03, 2018 9:36 am
I altered the program to remove the printing commands, and added a STOP after the first PIXEL. Executing first shows the pixel at (5,5).
Upon pressing R/S, the busy annunciator remains lit, and the result of drawing the pixel at (100,100) is not shown. Pressing PRGM shows the code has run till the end (RTN before the LBL 14).
If the program pointer points *at* the RTN, something is wrong; the CLLCD has caused program execution to stop. When a program encounters a RTN with an empty return stack, it behaves like STOP, and the program pointer ends up pointing to the first line *after* the RTN.

Re: [DM42 Bug?] CLLCD not working right

Posted: Sun Apr 08, 2018 10:05 pm
by whuyse
Hi Thomas,
no, it points beyond the RTN, at LBL 14.
But something's wrong anyway: why is the busy annunciator lit, and the result not shown?
If I remove the CLLCD right after the STOP, it works as it should.
Perhaps it's the combination of CLLCD and subsequently changing GrMod that is the culprit.

Cheers, Werner

Re: [DM42 Bug?] CLLCD not working right

Posted: Sun Apr 08, 2018 10:29 pm
by keithdalby
whuyse wrote:
Sun Apr 08, 2018 10:05 pm
If I remove the CLLCD right after the STOP, it works as it should.
Not for me

Re: [DM42 Bug?] CLLCD not working right

Posted: Sat Apr 14, 2018 2:04 pm
by PierreMengisen
[MD42 v3.5]

Je fais tous mes graphs en mode graphique 3. Jamais de problèmes.
Mais …
En mode graphique 2 et trois, l'instruction PIXEL génère automatiquement un CLLCD.
En mode 0, ce n'est pas le cas. De plus en mode 0, les pixels affichés sont formés d'une matrice de pixels-écran 3x4 ???
En mode 2 et 3 ils sont formés sur une matrice 2x2 et 1x1
Je pense donc qu'il ne faut pas mêler les sessions 0 avec celles en 2 ou 3.

I do all my graphics in graphic mode 3. Never have problems.
But ...
In Graph 2 and 3 mode, the PIXEL instruction automatically generates a CLLCD.
In mode 0, this is not the case. In addition to mode 0, the pixels displayed are formed of a matrix of 3x4 screen pixels ???
In mode 2 and 3 they are formed on a 2x2 and 1x1 matrix
So I think we should not mix sessions 0 with those in 2 or 3.

Pierre