Initial revision
[ssr] / StraySrc / Libraries / Sapphire / s / progInfo
1 ;
2 ; progInfo.s
3 ;
4 ; The `About this program' box (MDW)
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Standard header ------------------------------------------------------
28
29 GET libs:header
30 GET libs:swis
31
32 ;----- External dependencies ------------------------------------------------
33
34 GET sapphire:dbox
35 GET sapphire:mbox
36 GET sapphire:sapphire
37
38 ;----- Icon numbers ---------------------------------------------------------
39
40 piIcon__title EQU 0
41 piIcon__name EQU 7
42 piIcon__purpose EQU 5
43 piIcon__author EQU 3
44 piIcon__version EQU 1
45
46 ;----- Main code ------------------------------------------------------------
47
48 AREA |Sapphire$$Code|,CODE,READONLY
49
50 ; --- progInfo ---
51 ;
52 ; On entry: R0 == pointer to purpose string
53 ; R1 == pointer to author string
54 ; R2 == pointer to version string
55 ;
56 ; On exit: May return an error
57 ;
58 ; Use: Displays an `About this program' dialogue box on the screen.
59
60 EXPORT progInfo
61 progInfo ROUT
62
63 STMFD R13!,{R0-R3,R14} ;Save some registers
64
65 ; --- Create the dialogue box ---
66
67 ADR R0,pi__dbName ;Point to the name string
68 BL dbox_create ;Create the dialogue box
69 ADDVS R13,R13,#4 ;If error, don't restore R0
70 LDMVSFD R13!,{R1-R3,PC} ;Return any errors here
71 MOV R3,R0 ;Save the dialogue handle
72
73 ; --- Fill in the various fields ---
74
75 BL sapphire_appName ;Find the application's name
76 MOV R2,R0 ;Move pointer around nicely
77 MOV R0,R3 ;Get the dialogue handle
78 MOV R1,#piIcon__name ;The `Name' icon
79 BL dbox_setField ;Fill it in
80 LDR R2,[R13,#0] ;Get the purpose string
81 MOV R1,#piIcon__purpose ;The `Purpose' icon
82 BL dbox_setField ;Fill it in
83 LDR R2,[R13,#4] ;Get the author string
84 MOV R1,#piIcon__author ;The `Author' icon
85 BL dbox_setField ;Fill that in too
86 LDR R2,[R13,#8] ;Get the version string
87 MOV R1,#piIcon__version ;The `Version' icon
88 BL dbox_setField ;And fill that one in
89
90 ; --- Display the dialogue box and return ---
91
92 ADR R1,pi__dbHelp ;Point to the help string
93 MOV R2,#piIcon__title ;The embedded title icon
94 BL mbox ;Handle the dialogue box
95 LDMFD R13!,{R0-R3,R14} ;Restore the registers
96 BICS PC,R14,#V_flag ;Return without error
97
98 pi__dbName DCB "progInfo",0
99 pi__dbHelp DCB "piHELP"
100
101 ;----- Workspace ------------------------------------------------------------
102 ;
103 ; None.
104
105 ;----- That's all, folks ----------------------------------------------------
106
107 END