Menu

Is there an option to slow down execution?

2021-01-12
2021-01-18
  • Stephen Whitaker

    Hi Rob,
    Firstly, thanks for this project, I have been able to resurrect many of my old BASIC programs which rely on the PCjr video modes.
    However, I ran into an issue with several of them, in that they use busy loops for delays. So, in the end my programs/games run way too fast. Is there a way to have a line similar to:
    FOR P=1 to 500:NEXT
    delay for approximately 1 second? Not a big deal but it would be nice if there was a simple way to artificially slow things down.
    Also, I guess PC-BASIC is not 100% compatible as many of my old programs definitely worked on the PCjr but when run with PC-BASIC I get "Illegal function call in" errors! Of course these are all due to me not allocating large enough arrays. B-).
    Thanks,
    Steve

     
    • Rob Hagemans

      Rob Hagemans - 2021-01-12

      Hi Steve, unfortunately there's no way to change execution speed. If you're happy to change the code you could use the SOUND statement to emit a pause of a given time, this has quite precise timing.

      As to the Illegal function call errors, could you send me one or more examples? If it runs on original PCjr BASIC but not on PC-BASIC (with the appropriate settings) then that's a bug that I can look into if I have the details.

       
  • Stephen Whitaker

    That SOUND idea is a good work-around.

    Unfortunately I no longer have access to PCjr hardware (that's why I'm using PC-BASIC B-)). When I said they used to work, it's from 35 year old memories. And I would be surprised that these particular failures would be left in my old code(not that my code was bug free). I think it's good that PC-BASIC is detecting the issue as I suspect PCjr BASIC was just silently trampling memory.

    I will try to find examples. I guess another comparison would be DOSBox but I haven't had much luck with it but I might illustrate the difference in behaviour.
    Thanks

     
  • Stephen Whitaker

    Sorry for the delay. I was unable to reproduce this illegal function call issue I had previously seen. I'll let you know if it rears it's head. Thanks.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.