home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
i
/
infobar
/
!InfoBar
/
0_04
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1994-09-26
|
23KB
|
577 lines
>InfoBar:0_04
Display time/date/free memory/mode simple readout
David G Jones, 1994
This software is PD, do what you will with it.
$; " (Error code ";
); ")":
SReplaceResource% =
:
Whether we create our own smaller ResourceFiler icon
MStopWelcome% =
:
Stop Welcome screen on starting up the desktop
1prog$ = "InfoBar": vers$="0.04 (25 Sep 1994)"
Start & Finish external coordinates of the various displays. Order of displays is
important within the rloop section
(DateX0% = 0 * 16: DateX1% = 7 * 16
(TimeX0% = 8 * 16: TimeX1% = 14 * 16
(ModeX0% = 15 * 16: ModeX1% = 18 * 16
(FreeX0% = 19 * 16: FreeX1% = 26 * 16
command$="Desktop_"+prog$
bl$ =
cr$ =
nl% = &0A0D
"Service_Reset = &27
"Service_StartWimp = &49
"Service_StartedWimp = &4A
"Service_MemoryMoved = &4E
"Service_DesktopWelcome = &7C
assembly
"OS_File", 10, prog$, &FFA,, code, O%
assembly
code 16383
pass% = 4
O% = code: P% = 0
[ OPT pass%
(! equd start
equd 0
*! equd final
+' equd serviceCall
,' equd titleString
-& equd helpString
.$ equd keyWords
equd 0
equd 0
equd 0
equd 0
4-.titleString equs prog$ +bl$: align
5O.helpString equs prog$+
(9)+vers$+" David G Jones"+bl$: align
.keyWords
80.startUpName equs command$ +bl$: align
9' equd startUpComm
equd 0
;' equd startUpHelp
<' equd startUpHelp
.keyWords_end equd 0
.startUpHelp equs "InfoBar displays a row of useful readouts along the top left of the icon bar; Date, time, mode and free memory.": equw nl%
@T equs "Do not use *"+command$+", use *Desktop instead.": equw nl%
A4 equs "Syntax: *"+command$+bl$
align
D2.serviceCall teq r1, #Service_StartWimp
E4 teqNE r1, #Service_StartedWimp
F. teqNE r1, #Service_Reset
G4 teqNE r1, #Service_MemoryMoved
StopWelcome%: [OPT pass%: teqNE r1, #Service_DesktopWelcome:]
I#[ OPT pass%: movNES pc, r14
K2 teq r1, #Service_StartWimp
L% bEQ startWimp
M4 teq r1, #Service_StartedWimp
N' bEQ startedWimp
O. teq r1, #Service_Reset
P( bEQ serviceReset
Q4 teq r1, #Service_MemoryMoved
R( strEQ r1, PollWord
StopWelcome%:[OPT pass%:teq r1, #Service_DesktopWelcome:]:
T"[ OPTpass%: movEQ r1, #0
V# movS pc, r14
X+.startWimp ldr r12, taskHandle
Y# teq r12, #0
Z# mvnEQ r12, #0
[+ strEQ r12, taskHandle
\+ adrEQ r0, startUpName
]" movEQ r1, #0
^# movS pc, r14
`+.startedWimp ldr r12, taskHandle
a# cmn r12, #1
b# movEQ r12, #0
c+ strEQ r12, taskHandle
d# movS pc, r14
f#.serviceReset mov r12, #0
g+ str r12, taskHandle
h# movS pc, r14
j..startUpComm stmfd r13!, {r0-r2, r14}
k" mov r2, r0
l" mov r0, #3
m/ swi "XWimp_ReadSysInfo"
n/ ldmVSfd r13!, {r0 - r2, pc}
o" teq r0, #0
p, adrEQ r0, notInDesktop
q. swiEQ "OS_GenerateError"
r+ adr r1, titleString
s" mov r0, #2
t( swi "XOS_Module"
u- ldmfd r13!, {r0-r2, pc}
.notInDesktop equd 0
x> equs "Use *Desktop to start "+prog$+bl$
align
.taskHandle equd 0
}'.wimpError ldr r1, PollMask
~O tst r1, #1 << 31 ; Are we still in wimp init?
$ movEQ r1, #%011
$ movNE r1, #%010
' adr r2, TaskName
- swi "Wimp_ReportError"
! teq r1, #1
# bEQ continue
$ b closeDown
L.NoTemplate equd 0: equs "Could not find window template" +bl$: align
:.TemplatesFN equs "InfoBar:Templates" +bl$: align
1.Grabkeys equs "grabkeys" +bl$: align
1.TaskName equs "Info Bar" +bl$: align
P.Messages equd &400c1: equd &400c2: equd &400c3: equd &400c4: equd 0
W.PollMask equd %0010000000001100001110000
(1 << 31) ;mark not set up yet
.PollWord equd 0
P.start mov r0, #256 ; Minimum version 3.10
- add r0, r0, #310 - 256
# ldr r1, TASK
' adr r2, TaskName
' adr r3, Messages
- swi "XWimp_Initialise"
$ bVS wimpError
) str r1, taskHandle
* adr r1, TemplatesFN
/ swi "XWimp_OpenTemplate"
$ bVS wimpError
*
adrl("", 1, WimpBlock)
' add r2, r1, #128
% add r3, r2, #0
! mvn r4, #0
' adr r5, Grabkeys
! mov r6, #0
/ swi "XWimp_LoadTemplate"
$ bVS wimpError
! teq r6, #0
) adrEQ r0, NoTemplate
$ bEQ wimpError
& mvn r2, #&10000
' str r2, [r1, #0]
( add r2, r2, #&100
' str r2, [r1, #8]
/ swi "XWimp_CreateWindow"
' strVC r0, [r1, #0]
1 swiVC "XWimp_GetWindowState"
- swiVC "XWimp_OpenWindow"
$ bVS wimpError
' add r2, r1, #128
% add r3, r2, #0
K mvn r4, #0 ; No font support
* adr r5, titleString
Z mov r6, #0 ; First search for template name
/ swi "XWimp_LoadTemplate"
$ bVS wimpError
S teq r6, #0 ; Was the template found?
L adrEQ r0, NoTemplate ; >No So complain
; bEQ wimpError ;
/ swiVC "XWimp_CreateWindow"
, strVC r0, InfoBarHandle
Q movVC r2, r0 ; r2 == info bar handle
R mvnVC r0, #1 ; icon bar window handle
' strVC r0, [r1, #0]
1 swiVC "XWimp_GetWindowState"
V add r4, r1, #4 ; r4 => visible area details
W ldmia r4, {r5 - r8} ; r5 == min x ... r8 == max y
Q ldrVC r3, [r1, #28] ; r3 == icon bar behind
S strVC r2, [r1, #0] ; Ok get info bar details
1 swiVC "XWimp_GetWindowState"
G addVC r7, r5, # FreeX1% ; r7 == max x
H mvnVC r0, #0 ; Current mode
F movVC r1, #5 ; YEigFactor
1 swiVC "XOS_ReadModeVariable"
W movVC r0, #1 ; vertical space around chars
) movVC r0, r0, LSL r2
W addVC r0, r0, #32 ; Static height of characters
G subVC r6, r8, r0 ; r6 == min y
V stmIA r4, {r5 - r8} ; store visible area details
K subVC r1, r4, #4 ; r1 => WimpBlock
O strVC r3, [r1, #28] ; open above icon bar
- swiVC "XWimp_OpenWindow"
$ bVS wimpError
0 swi "XWimp_CloseTemplate"
$ bVS wimpError
ReplaceResource%
[ OPT pass%
) mov r0, #&50000000
,
adrl("", 1, RomAppsIcon)
-