Teletext Wimp Messages (&51C46) |
A Wimp message interface was introduced with version 1.51 to allow the software to be controlled by an external application.
The message action is &51C46. This is part of the message block (officially) allocated to me
for "BudgieMgr"; however by using an extra marker word, I can make the block
&51C40-&51C7F support 64 different applications!
The codes described below are written to block%!20
. Refer to the
example for more details.
$(block%+24)
is the null terminated name of the script to run.
block%!24 = New channel (1-9)
block%!28 = 0
block%!28
to a value
from 21 to 69 (the UHF channel). The fine tuning value is always set to zero.
block%!24 = Page number in &xxx form
(ie, p100 is &100 not 100).
block%!24 = Pointer to 1080 byte block
to transfer page into.
block%!24 = Cache tidy operation: 0 - Tidy the cache (remove expired pages). 1 - Flush the cache (remove EVERYTHING).This performs operations on the Teletext cache.
block%!24 = &58545452 ("RTTX"), check word. block%!28 = Teletext version * 100 block%!32 = Script version * 100 block%!36 = Current channel (1-9) block%!40 = Current page simple (&xxxyyyy form) block%!44 = Flags: bit 0 - Set if running a script bit 1 - Set if in configuration mode bit 2 - Set if browser is open [not implemented] bit 3 - Set if cache is in useThis is sent in response to a Teletext_Enquiry request.
$(block%+24) = Name of script
being executed (in scripts directory).
block%!24 = Page number
, in &xxxyyyy form.
The messages to !Teletext have been tested, those back from !Teletext have not been tested yet.
Please note that !Teletext will not include a 'cron' or 'alarm' system. There is plenty of software that can run a task at a defined, possibly repetetive, time...and it isn't difficult to cobble together an application to fire off the appropriate Wimp messages.
REM >WIMPmsgEX REM REM by Rick Murray, 22nd June 2003 REM REM This is an example program that will communicate REM with !Teletext using the Wimp message protocol REM to: REM a. Tidy the cache REM and: REM b. Run the "!startup" script. REM DIM block% 256 REM Begin... SYS "Wimp_Initialise", 200, &4B534154, "WIMPmsgEX" TO ,task% REM The WIMP sends us a few messages (ie, can this REM app cope with resizable slot, etc etc) so we'll REM poll until we get a non-event event. REPEAT SYS "Wimp_Poll", 0, block% TO reason% UNTIL reason% = 0 REM (we aren't a 'real' WIMP app, so we'll just REM ignore anything the WIMP asks of us...) REM First, tidy the cache. block%!0 = 28 block%!12 = 0 block%!16 = &51C46 block%!20 = 5 block%!24 = 0 : REM or '1' to flush the cache SYS "Wimp_SendMessage", 17, block%, 0, 0 REM Poll a few times, let's say ten times. FOR loop% = 0 TO 9 SYS "Wimp_Poll", 0, block% TO reason% NEXT REM Now get the script running. ALL scripts must be REM relative to "<Teletext$Scripts>". This script REM name is actually 'poked' into the script array, REM so you can generate scripts on-the-fly and then REM run them...without needing to re-start !Teletext REM to force a script re-scan. As long as the script REM exists, it'll be okay. block%!0 = 256 block%!12 = 0 block%!16 = &51C46 block%!20 = 1 $(block%+24) = "!startup" SYS "Wimp_SendMessage", 17, block%, 0, 0 REM Well, that's it. Playtime's over. SYS "Wimp_CloseDown", task%, &4B534154 END