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


Groups > comp.sys.acorn.programmer > #1464 > unrolled thread

Reading the Hz of a numbered MODE

Started bycferris@freeRemoveuk.com.invalid
First post2012-02-29 13:17 +0000
Last post2012-03-29 20:46 +0200
Articles 6 — 4 participants

Back to article view | Back to comp.sys.acorn.programmer


Contents

  Reading the Hz of a numbered MODE cferris@freeRemoveuk.com.invalid - 2012-02-29 13:17 +0000
    Re: Reading the Hz of a numbered MODE Christopher Bazley <cs99cjb@gmail.com> - 2012-03-06 13:46 -0800
      Re: Reading the Hz of a numbered MODE John Kortink <kortink@inter.nl.net> - 2012-03-07 02:47 +0100
        Re: Reading the Hz of a numbered MODE druck <news@druck.org.uk> - 2012-03-07 09:56 +0000
        Re: Reading the Hz of a numbered MODE cferris@freeRemoveuk.com.invalid - 2012-03-29 12:03 +0100
          Re: Reading the Hz of a numbered MODE John Kortink <kortink@inter.nl.net> - 2012-03-29 20:46 +0200

#1464 — Reading the Hz of a numbered MODE

Fromcferris@freeRemoveuk.com.invalid
Date2012-02-29 13:17 +0000
SubjectReading the Hz of a numbered MODE
Message-ID<3d0d206952.cferris@cferris.freeuk.com>
Is there a way of reading the Hz of a Numbered MODE in RISC 0S?

ie from when in another MODE.


Thanks
-- 
Colin Ferris Cornwall UK

[toc] | [next] | [standalone]


#1471

FromChristopher Bazley <cs99cjb@gmail.com>
Date2012-03-06 13:46 -0800
Message-ID<41ace17c-4b59-45ec-86c1-8a7f6a2ff7ee@i2g2000vbv.googlegroups.com>
In reply to#1464
On Feb 29, 1:17 pm, cfer...@freeRemoveuk.com.invalid wrote:
> Is there a way of reading the Hz of a Numbered MODE in RISC 0S?
>
> ie from when in another MODE.

As that information doesn't seem to be available via SWI
OS_ReadModeVariable, I suspect the answer is 'no'. You could try
counting VSync events, but you would probably have to use IOC timer 1
for accuracy which risks conflict with other software and isn't very
portable.

Don't forget that the properties of numbered modes are inscribed on
stone tablets that Moses brought down from Mount Sinai, so you could
simply use a look-up table. That would also be faster than entering
and exiting the OS kernel.

--
Chris Bazley

[toc] | [prev] | [next] | [standalone]


#1474

FromJohn Kortink <kortink@inter.nl.net>
Date2012-03-07 02:47 +0100
Message-ID<gledl75kri7d5m4vk6dgia1acam75rs6b4@4ax.com>
In reply to#1471
On Tue, 6 Mar 2012 13:46:59 -0800 (PST), Christopher Bazley
<cs99cjb@gmail.com> wrote:

>On Feb 29, 1:17 pm, cfer...@freeRemoveuk.com.invalid wrote:
>> Is there a way of reading the Hz of a Numbered MODE in RISC 0S?
>>
>> ie from when in another MODE.
>
>As that information doesn't seem to be available via SWI
>OS_ReadModeVariable, I suspect the answer is 'no'.

It should be possible to use OS_ServiceCall &50 to look
up the VIDC list for the numbered mode. And determine
the refresh rate from that (add all horizontal timing,
add all vertical timing, multiply, divide pixel rate
by result to arrive at refresh rate).

>[...]
>
>Don't forget that the properties of numbered modes are inscribed on
>stone tablets that Moses brought down from Mount Sinai

I thought he preferred Macs. Especially on rainy days.

>, so you could simply use a look-up table. That would also be faster
>than entering and exiting the OS kernel.

I vaguely remember slight changes, depending on one or
perhaps several external factors (monitortype for one,
I think). I.e. a table may not be suitable.


John Kortink

-- 

Email    : kortink@inter.nl.net
Homepage : http://www.inter.nl.net/users/J.Kortink

There's something to be said, for getting out of bed.

[toc] | [prev] | [next] | [standalone]


#1476

Fromdruck <news@druck.org.uk>
Date2012-03-07 09:56 +0000
Message-ID<jj7bbv$4ef$1@dont-email.me>
In reply to#1474
On 07/03/2012 01:47, John Kortink wrote:
> On Tue, 6 Mar 2012 13:46:59 -0800 (PST), Christopher Bazley
> <cs99cjb@gmail.com>  wrote:
>> Don't forget that the properties of numbered modes are inscribed on
>> stone tablets that Moses brought down from Mount Sinai
>
> I thought he preferred Macs. Especially on rainy days.
>
>> , so you could simply use a look-up table. That would also be faster
>> than entering and exiting the OS kernel.
>
> I vaguely remember slight changes, depending on one or
> perhaps several external factors (monitortype for one,
> I think). I.e. a table may not be suitable.

And 3rd party modules may also alter the mode timings from those in ROM. 
For example !GameOn/!StronGuard provided 100Hz versions of the numbered 
modes, along with a module which halved the VSYNC callback rate.

This was because the number modes which were 50Hz on TV/CGA monitors 
were upped to 70Hz to allow VGA compatible monitors to lock on to them. 
Games which relied on VSYNC timing then ran too fast, but using 100Hz 
divided by 2, they then ran at the correct speed. It also got rid of the 
horrid letter boxing I recall used to happen.

---druck

[toc] | [prev] | [next] | [standalone]


#1547

Fromcferris@freeRemoveuk.com.invalid
Date2012-03-29 12:03 +0100
Message-ID<f4f9027852.cferris@cferris.freeuk.com>
In reply to#1474
In message <gledl75kri7d5m4vk6dgia1acam75rs6b4@4ax.com>
          John Kortink <kortink@inter.nl.net> wrote:

> 
> On Tue, 6 Mar 2012 13:46:59 -0800 (PST), Christopher Bazley
> <cs99cjb@gmail.com> wrote:
> 
> >On Feb 29, 1:17 pm, cfer...@freeRemoveuk.com.invalid wrote:
> >> Is there a way of reading the Hz of a Numbered MODE in RISC 0S?
> >>
> >> ie from when in another MODE.
> >
> >As that information doesn't seem to be available via SWI
> >OS_ReadModeVariable, I suspect the answer is 'no'.
> 
> It should be possible to use OS_ServiceCall &50 to look
> up the VIDC list for the numbered mode.

How would you go about doing this :-
Should this below give you R3 pointer to VIDC list and R4 pointer to
workspace list?

MODE =15 -1 any monitor type.
***
SYS "OS_ServiceCall" ,, &50,15,-1 TO R0,R1,R2,R3,R4
PRINT R0 R1 R2 R3  R4
****

Thanks
-- 
Colin Ferris Cornwall UK

[toc] | [prev] | [next] | [standalone]


#1548

FromJohn Kortink <kortink@inter.nl.net>
Date2012-03-29 20:46 +0200
Message-ID<7e99n7ld1tbugpamouunfi025njl5dbbad@4ax.com>
In reply to#1547
On Thu, 29 Mar 2012 12:03:12 +0100, cferris@freeRemoveuk.com.invalid
wrote:

>In message <gledl75kri7d5m4vk6dgia1acam75rs6b4@4ax.com>
>          John Kortink <kortink@inter.nl.net> wrote:
>
>> 
>> On Tue, 6 Mar 2012 13:46:59 -0800 (PST), Christopher Bazley
>> <cs99cjb@gmail.com> wrote:
>> 
>> >On Feb 29, 1:17 pm, cfer...@freeRemoveuk.com.invalid wrote:
>> >> Is there a way of reading the Hz of a Numbered MODE in RISC 0S?
>> >>
>> >> ie from when in another MODE.
>> >
>> >As that information doesn't seem to be available via SWI
>> >OS_ReadModeVariable, I suspect the answer is 'no'.
>> 
>> It should be possible to use OS_ServiceCall &50 to look
>> up the VIDC list for the numbered mode.
>
>How would you go about doing this :-
>Should this below give you R3 pointer to VIDC list and R4 pointer to
>workspace list?
>
>MODE =15 -1 any monitor type.
>***
>SYS "OS_ServiceCall" ,, &50,15,-1 TO R0,R1,R2,R3,R4
>PRINT R0 R1 R2 R3  R4
>****

After a look at my source code for !ModeInfo :

a) Use &50, mode number, -1, 1 << 30, 1 << 30 for compatibility
with later versions (>= 3.5) of RISC OS. See PRMs.

b) If R1 <> 0 you're screwed. No module claims to know the mode,
and RISC OS itself, for unknown reasons, never volunteers.

c) Check the VIDC list format (first word). If 3, you're there.
If 0 or 1, you're still screwed, because this specifies the mode
by listing deviations from a base mode. See PRMs.

But there is a way. The base mode specs /can/ be gleaned from
the RISC OS ROM. Yes, yuck, double yuck. But it works. Scan
the ROM for a word with value &302B2B93. Add 4 to its address,
call this 'anchor_address'. Then distill from this (snippet
of !ModeInfo code) :

=============================================================

Standard_Numbered_Modes% = anchor_address%?-8

DIM Mode_VIDC_Base%(Standard_Numbered_Modes%)

P% = Dummy_Block%

[OPT0
;
.to_table
;
 STMFD r13!,{r14}
;
 EQUD anchor_address%!4
 EQUD anchor_address%!8
;
 MOV r0,r14
;
 LDMFD r13!,{pc}
;
]

table_monitor_type_0% = USR(to_table) - (to_table + 4) +
(anchor_address% + 4)
table_monitor_type_1% = table_monitor_type_0% + 1 *
Standard_Numbered_Modes% * 4
table_monitor_type_2% = table_monitor_type_0% + 2 *
Standard_Numbered_Modes% * 4

FOR mode_number% = 0 TO Standard_Numbered_Modes% - 1

  table_offset% = table_monitor_type_1%!(mode_number% << 2)
  IF table_offset% = -1 THEN table_offset% =
table_monitor_type_2%!(mode_number% << 2)
  IF table_offset% = -1 THEN table_address% = 0 ELSE table_address% =
table_monitor_type_0% + table_offset%

  Mode_VIDC_Base%(mode_number%) = table_address%

NEXT

=============================================================

Should work. Good luck ...


John Kortink

-- 

Email    : kortink@inter.nl.net
Homepage : http://www.inter.nl.net/users/J.Kortink

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.acorn.programmer


csiph-web