Skip to content

VDU 23,16 support for controlling cursor movement and screen scrolling #55

@julianregel

Description

@julianregel

As a user, I want to be able to draw a screen using user defined graphics and PRINT TAB(X,Y). The current implementation has a problem where printing to the bottom right-most character forces a screen scroll.

This is the same behaviour as seen on the BBC Micro, but a workaround/new functionality was provided in the BBC Master MOS with the addition of VDU 23,16 (https://beebwiki.mdfs.net/VDU_23#VDU_23.2C16_-_Define_cursor_movement).

Please could VDU 23,16 support be added to facilitate this functionality?

This has previously been discussed on Stardot:

https://stardot.org.uk/forums/viewtopic.php?f=54&t=19452&p=270463
https://stardot.org.uk/forums/viewtopic.php?f=2&t=23312&p=333581

Example code, which when run in BeebEm shows the difference in behaviour between the BBC B (and Agon) and Master:

   10REM MODE 1 on the BBC: 40x32 characters (X=40, Y=32)
   20REM MODE 2 on the Agon: 40x25 characters (X=40, Y=25)
   30REM Set appropriate mode below and X,Y values
   50MODE 2
   60X=40
   70Y=25
   90REM Disable screen scrolling:
  100REM BBC Master only!
  110VDU 23,16,1,255,0,0,0,0,0,0
  130PROCdrawscreen
  150A=GET
  170END
  200DEF PROCdrawscreen
  220    REM Define border characters
  240    REM Horizontal Bar
  250    VDU 23,224,0,0,255,255,255,255,0,0
  260    REM Vertical Bar
  270    VDU 23,225,60,60,60,60,60,60,60,60
  280    REM Top Left Corner
  290    VDU 23,226,0,0,63,63,63,63,60,60
  300    REM Top Right Corner
  310    VDU 23,227,0,0,252,252,252,252,60,60
  320    REM Bottom Right Corner
  330    VDU 23,228,60,60,252,252,252,252,0,0
  340    REM Bottom Left Corner
  350    VDU 23,229,60,60,63,63,63,63,0,0
  370    REM Draw the frame
  390    REM *** Draw Line 0 ***
  410    PRINT TAB(0,0) CHR$(226);
  430    FOR J%=1 TO X-2
  440        PRINT TAB(J%,0) CHR$(224);
  450    NEXT J%
  470    PRINT TAB(X-1,0) CHR$(227);
  490    REM *** Draw middle lines ***
  510    FOR J%=1 TO Y-2
  520        PRINT TAB(0,J%) CHR$(225);
  530        PRINT TAB(X-1,J%) CHR$(225);
  540    NEXT J%
  560    REM *** Draw bottom line ***
  580    PRINT TAB(0,Y-1) CHR$(229);
  600    FOR J%=1 TO X-2
  610        PRINT TAB(J%,Y-1) CHR$(224);
  620    NEXT J%
  640    PRINT TAB(X-1,Y-1) CHR$(228);
  660ENDPROC

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions