VDU 24?

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
Ivan
Posts: 127
Joined: Tue 07 May 2019, 16:47

VDU 24?

Post by Ivan »

I'm writing a graphics program to use expensive fabric.

I use the full screen area in mode 30 with 3200 x 2400 grafical units when I draw and update the x and y rulers and numbers. I then use vdu 24,0;0;3200;2400; when I scroll the figures/small drawings sideways.

It somehow works but not correctly.

I need to update rulers with the full screen area and the scroll with limited area and it seems I can't do it right way?
BBC Model B - 1984-1989. 6502 assembler, Unicomal 1988-1994, Some C and C++, Pascal 1990-1994. Bought a copy of BBC-BASIC 2007, but started to program at a daily basis 2019. C++ in 2021.
DDRM

Re: VDU 24?

Post by DDRM »

Hi Ivan

I'm not clear from your post what you are trying to do. Could you explain a bit more?

I think your VDU 24 call may be failing because your second set of parameters are out of range: for a mode with 3200 x 2400 graphics units (1600 x 1200 pixels), the addresses will be 0 - 3199 in the x direction and 0 - 2399 in the Y direction, so (3200,2400) will be out of range.

As I recall, the graphics window determines which areas of the screen bitmap are available for plotting to, NOT which bits are being shown in the window. Are you trying to use it to scroll the image in the window? You might want to look at:
1) the example program SCROLL.BBC, which manipulates the system variables @ox% and @oy%, which are discussed in
2) the manual section on system variables, and/or
3) the section in the manual which talks about using Using windows larger than 1920 x 1440 pixels

Note that @ox% and @oy% give offsets in pixels, not screen units!

Code: Select all

      MODE 21
      CIRCLE 300,300,30
      FOR x%=2 TO 500 STEP 2
        @ox%=x%/2
        SYS "InvalidateRect", @hwnd%, 0, 0
        WAIT 5
      NEXT x%
Best wishes,

D
Ivan
Posts: 127
Joined: Tue 07 May 2019, 16:47

Re: VDU 24?

Post by Ivan »

Thanks.

I have attached a simpel drawing that might explain the situation better.

Is a convenient way of showing the visible figures and I don't have draw parts of figures when I have figures at the margins.

And because I dont want to destroy the rulers and avoid a lot of calculating witch part of the figures that are visible.

screen.jpg
You do not have the required permissions to view the files attached to this post.
BBC Model B - 1984-1989. 6502 assembler, Unicomal 1988-1994, Some C and C++, Pascal 1990-1994. Bought a copy of BBC-BASIC 2007, but started to program at a daily basis 2019. C++ in 2021.
RichardRussell

Re: VDU 24?

Post by RichardRussell »

DDRM wrote: Sat 05 Sep 2020, 10:14 I'm not clear from your post what you are trying to do. Could you explain a bit more?
Why was my reply deleted? I can guess, but I'd just like confirmation. :(
the addresses will be 0 - 3199 in the x direction and 0 - 2399 in the Y direction
As I pointed out in my reply, it's 0 - 3198 and 0 - 2398.

But I won't repeat what was in my previous reply as I assume this one will be deleted as well.
Ivan
Posts: 127
Joined: Tue 07 May 2019, 16:47

Re: VDU 24?

Post by Ivan »

"the addresses will be 0 - 3199 in the x direction and 0 - 2399 in the Y direction"

Yes, that did indeed solve my problem - thanks again.
BBC Model B - 1984-1989. 6502 assembler, Unicomal 1988-1994, Some C and C++, Pascal 1990-1994. Bought a copy of BBC-BASIC 2007, but started to program at a daily basis 2019. C++ in 2021.
DDRM

Re: VDU 24?

Post by DDRM »

Hi Richard,

I didn't see a reply from you, and I certainly didn't delete it! There's no record of it in the moderator's log, so nor did anyone else, as far as I can see. Please feel free to re-post what was clearly a more accurate post than mine!

Best wishes,

D
RichardRussell

Re: VDU 24?

Post by RichardRussell »

DDRM wrote: Mon 07 Sep 2020, 13:10 Please feel free to re-post what was clearly a more accurate post than mine!
Never mind. The OP has accepted your answer in preference to mine anyway.