VDU variable anomaly

I've been comparing the values that ARM BASIC V and Matrix Brandy give for some of the 'VDU variables' and I'm seeing a difference I wasn't expecting. Running this program:
MODE 0
ORIGIN 100,101
MOVE 102,103
PRINT VDU(136) VDU(137)
PRINT VDU(138) VDU(139)
Gives this in ARM BASIC V:
       100       101
       102       103
and this in Matrix Brandy:
       100       101
       102       100

Comments

  • Yep - a bug where I was erroneously clamping the value to the pixel boundary based on the screen mode scaling. Fixed, and a new nightly build is running.
  • Another difference between ARM BASIC V and Matrix Brandy that I don't understand arises from this code:
    MODE 0
    MOVE 123,456
    VDU 5,65,4
    PRINT VDU(144) VDU(145)
    PRINT VDU(146) VDU(147)
    
    ARM BASIC 5 outputs this:
            69       114
            61       114
    
    whereas Matrix Brandy outputs this:
            69       114
            69       114
    
    I'm puzzled about what the distinction between the 'current' graphics cursor (VDU 144/145) and the 'new' graphics cursor (VDU 146/147) is supposed to be: in my BASICs they are the same thing.
  • I couldn't get my head around how they're supposed to be different. Similarly to yours, in Matrix Brandy they are implemented as the same thing.
  • Soruk wrote: »
    I couldn't get my head around how they're supposed to be different. Similarly to yours, in Matrix Brandy they are implemented as the same thing.
    From the observed behaviour it seems that outputting a character in VDU 5 mode changes the 'current' graphics coordinates but not the 'new' coordinates - which I deduce are probably only changed by PLOT etc.

    But like you I don't see what the benefit is. I did wonder whether the idea was that you could output some VDU 5 text mid-way through drawing (say) a triangle without the vertices being affected, but experimentally it's not the case.