GithubHelp home page GithubHelp logo

Comments (2)

lennart-benschop avatar lennart-benschop commented on July 22, 2024

Problem does not occur with PRINT TAB(POS,VPOS); Neither when you first assign variables with POS & VPOS and pass the variables to VDU 31.

Probably the root cause: the BASIC VDU command passes each byte to the VDP after it is evaluated, so 31 gets passed immediately after it is evaluated. Then POS and/or VPOS are evaluated and BASIC sends the VDU 23, 0,130 sequence to read the cursor position and wait for the result. But the first bytes of this sequence get interpreted as the parameters of VDU 31, so the cursor read command will never finish.

A fix would probably need to happen in BASIC, for example after each command that might output to the screen, call VDU 23,0,130 and store the cursor position locally. Evaluation of POS & VPOS just take those locally stored bytes. Or the VDU command has to buffer all bytes of that command into a local buffer and then output that buffer at once. The VDU command could buffer some of the VDU sequences until they are complete (VDU 23, 24, 28 and 31) and only output them as a whole.

Other versions of Beeb Basic do not send bytes to the VDU to retrieve cursor position information, so the problem does not occur here.

from agon-vdp.

tonedef71 avatar tonedef71 commented on July 22, 2024

Problem does not occur with PRINT TAB(POS,VPOS); Neither when you first assign variables with POS & VPOS and pass the variables to VDU 31.

Probably the root cause: the BASIC VDU command passes each byte to the VDP after it is evaluated, so 31 gets passed immediately after it is evaluated. Then POS and/or VPOS are evaluated and BASIC sends the VDU 23, 0,130 sequence to read the cursor position and wait for the result. But the first bytes of this sequence get interpreted as the parameters of VDU 31, so the cursor read command will never finish.

A fix would probably need to happen in BASIC, for example after each command that might output to the screen, call VDU 23,0,130 and store the cursor position locally. Evaluation of POS & VPOS just take those locally stored bytes. Or the VDU command has to buffer all bytes of that command into a local buffer and then output that buffer at once. The VDU command could buffer some of the VDU sequences until they are complete (VDU 23, 24, 28 and 31) and only output them as a whole.

Other versions of Beeb Basic do not send bytes to the VDU to retrieve cursor position information, so the problem does not occur here.

@lennart-benschop Thank you for performing an analysis of the issue. Does this issue now need to be opened in each of the Agon BASIC git repositories, https://github.com/breakintoprogram/agon-bbc-basic-adl/issues and https://github.com/breakintoprogram/agon-bbc-basic/issues?

from agon-vdp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.