Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #785

Re: SWI / BASIC command to read number of Pixels in a screen mode

From Martin Wuerthner <spamtrap@mw-software.com>
Newsgroups comp.sys.acorn.programmer
Subject Re: SWI / BASIC command to read number of Pixels in a screen mode
Date 2011-09-28 10:47 +0200
Organization MW Software
Message-ID <379db81952.martin@bach.planiverse.com> (permalink)
References <11510590.202.1317160195012.JavaMail.geo-discussion-forums@yqnk41> <4e824566$0$289$14726298@news.sunsite.dk> <87167f1952.martin@blueyonder.co.uk>

Show all headers | View raw


In message <87167f1952.martin@blueyonder.co.uk>
          Martin Bazley <martin.bazley@blueyonder.co.uk> wrote:

> The following bytes were arranged on 27 Sep 2011 by Alex Macfarlane Smith :

>> On 27/09/2011 22:49, Michael wrote:
>>> I have been traversing the Strong help OS Manual, looking for a
>>> suitable SWI to return the width of a MODE MODE'd Screen (basically
>>> so I run in the same resolution the Machine is already in).
>>
>> I think it might be OS_ReadVduVariables, although I can't remember the
>> number you need for it.

> DIM b% 19
> !b%=11:REM XWindLimit
> b%!4=12:REM YWindLimit
> b%!8=4:REM XEigFactor
> b%!12=5:REM YEigFactor
> b%!16=-1:REM terminator
> SYS "OS_ReadVduVariables",b%,b%
> screen_width%=!b%<<b%!8:REM in OS units
> screen_height%=b%!4<<b%!12

> Testing performed on above routine: no more than everything else ever
> posted to csap late at night.  Warranty given: none.

That code will miss a pixel in either direction. Oddly enough, 
variables 11 and 12 give the number of pixels *minus 1*.

So, you need :

screen_width%=((!b%) + 1)<<b%!8
screen_height%=((b%!4) + 1)<<b%!12

-- 
Martin
---------------------------------------------------------------------
Martin Wuerthner         MW Software      http://www.mw-software.com/
        RISC OS Software for Design, Printing and Publishing
---------------------------------------------------------------------

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

SWI / BASIC command to read number of Pixels in a screen mode Michael <michaelremerton@gmail.com> - 2011-09-27 14:49 -0700
  Re: SWI / BASIC command to read number of Pixels in a screen mode Alex Macfarlane Smith <nospam@archifishal.co.uk> - 2011-09-27 22:51 +0100
    Re: SWI / BASIC command to read number of Pixels in a screen mode Michael <michaelremerton@gmail.com> - 2011-09-27 15:02 -0700
      Re: SWI / BASIC command to read number of Pixels in a screen mode Michael <michaelremerton@gmail.com> - 2011-09-27 15:18 -0700
        Re: SWI / BASIC command to read number of Pixels in a screen mode Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-09-27 23:36 +0100
      Re: SWI / BASIC command to read number of Pixels in a screen mode Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-09-27 23:34 +0100
        Re: SWI / BASIC command to read number of Pixels in a screen mode Michael <michaelremerton@gmail.com> - 2011-09-27 16:10 -0700
    Re: SWI / BASIC command to read number of Pixels in a screen mode Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-09-27 23:19 +0100
      Re: SWI / BASIC command to read number of Pixels in a screen mode Michael <michaelremerton@gmail.com> - 2011-09-27 16:14 -0700
        Re: SWI / BASIC command to read number of Pixels in a screen mode Steve Drain <steve@kappa.me.uk> - 2011-09-28 11:33 +0100
          Re: SWI / BASIC command to read number of Pixels in a screen mode Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-09-28 17:27 +0200
          Re: SWI / BASIC command to read number of Pixels in a screen mode Michael <michaelremerton@gmail.com> - 2011-09-28 18:57 -0700
        Re: SWI / BASIC command to read number of Pixels in a screen mode Gazza <usenet@garethlock.com> - 2011-10-18 16:12 -0700
          Re: SWI / BASIC command to read number of Pixels in a screen mode "Ste (news)" <steve@revi11.plus.com> - 2011-10-25 14:33 +0100
      Re: SWI / BASIC command to read number of Pixels in a screen mode Martin Wuerthner <spamtrap@mw-software.com> - 2011-09-28 10:47 +0200
        Re: SWI / BASIC command to read number of Pixels in a screen mode Steve Drain <steve@kappa.me.uk> - 2011-09-28 12:02 +0100
          Re: SWI / BASIC command to read number of Pixels in a screen mode Steve Drain <steve@kappa.me.uk> - 2011-09-28 12:09 +0100
            Re: SWI / BASIC command to read number of Pixels in a screen mode "Ste (news)" <steve@revi11.plus.com> - 2011-09-28 15:13 +0100
              Re: SWI / BASIC command to read number of Pixels in a screen mode Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-09-28 17:36 +0200
                Re: SWI / BASIC command to read number of Pixels in a screen mode Steve Drain <steve@kappa.me.uk> - 2011-09-28 17:32 +0100
        Re: SWI / BASIC command to read number of Pixels in a screen mode Martin <News03@avisoft.f9.co.uk> - 2011-09-28 12:55 +0100
        Re: SWI / BASIC command to read number of Pixels in a screen mode Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-09-28 17:34 +0200
      Re: SWI / BASIC command to read number of Pixels in a screen mode Gazza <usenet@garethlock.com> - 2011-10-18 16:10 -0700
        Re: SWI / BASIC command to read number of Pixels in a screen mode Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-19 06:49 +0200
          Re: SWI / BASIC command to read number of Pixels in a screen mode Steve Drain <steve@kappa.me.uk> - 2011-10-19 10:19 +0100
          Re: SWI / BASIC command to read number of Pixels in a screen mode Erik G <erikg@noname.invalid> - 2011-10-19 15:24 +0200
            Re: SWI / BASIC command to read number of Pixels in a screen mode Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-19 19:47 +0200
              Re: SWI / BASIC command to read number of Pixels in a screen mode druck <news@druck.org.uk> - 2011-10-19 20:36 +0100
                Re: SWI / BASIC command to read number of Pixels in a screen mode Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-20 17:40 +0200
                Re: SWI / BASIC command to read number of Pixels in a screen mode druck <news@druck.org.uk> - 2011-10-20 20:13 +0100
  Re: SWI / BASIC command to read number of Pixels in a screen mode Chris Johnson <chrisjohnson+news@spamcop.net> - 2011-09-27 23:21 +0100
  Re: SWI / BASIC command to read number of Pixels in a screen mode Bryan Hogan <spam@nowhere.invalid> - 2011-09-28 01:49 +0100
    Re: SWI / BASIC command to read number of Pixels in a screen mode Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-09-28 18:22 +0200
      Re: SWI / BASIC command to read number of Pixels in a screen mode Michael <michaelremerton@gmail.com> - 2011-09-28 19:12 -0700
        Re: SWI / BASIC command to read number of Pixels in a screen mode "Ste (news)" <steve@revi11.plus.com> - 2011-09-29 12:42 +0100
          Re: SWI / BASIC command to read number of Pixels in a screen mode Steve Drain <steve@kappa.me.uk> - 2011-09-29 16:14 +0100
            Re: SWI / BASIC command to read number of Pixels in a screen mode "Ste (news)" <steve@revi11.plus.com> - 2011-09-30 00:12 +0100
              Re: SWI / BASIC command to read number of Pixels in a screen mode Steve Drain <steve@kappa.me.uk> - 2011-09-30 10:48 +0100

csiph-web