That's interresting, I've also been working on a version of the DPLOT program for the DM42, but I started from the DPLOT version from Thomas, included with the DM42:

dplot_thomas: Modified version of DPLOT; like the original, with SOLVE support added

As you, I added the support of the different graphic modes, but by leveraging the soft keys from the m3435 program (HP for the 131x16 original resolution, 200 for 200x120 and 400 for 400x240), I also added a vertical axis at x=0, as well as some rough zoom in and zoom out capability with the + and - keys.

As an example, here is a plot of the FNX function from the Solver section in the HP-42S manual, with the same parameters: YMIN=-50, YMAX=25, XMIN=-3, XMAX=7.

Code: Select all

```
00 { 29-Byte Prgm }
01▸LBL "FNX"
02 MVAR "X"
03 RCL "X"
04 ENTER
05 X↑2
06 LASTX
07 5
08 ×
09 -
10 10
11 -
12 ×
13 20
14 +
15 END
```

And here is my version of DPLOT for the DM42, comments and improvements are welcome:

Code: Select all

```
00 { 813-Byte Prgm }
01▸LBL "DPLOT"
02 MVAR "YMIN"
03 MVAR "YMAX"
04 MVAR "AXIS"
05 MVAR "XMIN"
06 MVAR "XMAX"
07▸LBL A
08 RCL "GrMod"
09 "HP"
10 X=0?
11 ├"•"
12 KEY 1 GTO 12
13 "200"
14 2
15 -
16 X=0?
17 ├"•"
18 KEY 2 GTO 13
19 1
20 -
21 "400"
22 X=0?
23 ├"•"
24 KEY 3 GTO 14
25 CLA
26 KEY 4 GTO A
27 KEY 5 GTO A
28 "Next▸"
29 KEY 6 GTO B
30 KEY 9 GTO 17
31 MENU
32 STOP
33 GTO A
34▸LBL 12
35 CLX
36▸LBL 16
37 STO "GrMod"
38 GTO A
39▸LBL 13
40 2
41 GTO 16
42▸LBL 14
43 3
44 GTO 16
45▸LBL 17
46 EXITALL
47 STOP
48 GTO A
49▸LBL 18
50 RCL "YMAX"
51 RCL- "YMIN"
52 0.1
53 ×
54 STO+ "YMAX"
55 STO- "YMIN"
56 RCL "XMAX"
57 RCL- "XMIN"
58 0.1
59 ×
60 STO+ "XMAX"
61 STO- "XMIN"
62 GTO 05
63▸LBL 19
64 RCL "YMAX"
65 RCL- "YMIN"
66 0.1
67 ×
68 STO- "YMAX"
69 STO+ "YMIN"
70 RCL "XMAX"
71 RCL- "XMIN"
72 0.1
73 ×
74 STO- "XMAX"
75 STO+ "XMIN"
76 GTO 05
77▸LBL B
78 VARMENU "DPLOT"
79 "Enter limits; t"
80 ├"hen R/S"
81 PROMPT
82▸LBL 00
83 "FCN=?"
84 SF 25
85 RCL "PFCN"
86 FC?C 25
87 GTO 01
88 ├" <"
89 ARCL ST X
90 ├">"
91▸LBL 01
92 AVIEW
93 CLA
94 SF 25
95 ARCL "PFCN"
96 CF 25
97 AON
98 STOP
99 AOFF
100 ALENG
101 X=0?
102 GTO 00
103 ASTO "PFCN"
104 SF 25
105 VARMENU IND "PFCN"
106 FS?C 25
107 GTO 02
108 CLA
109 ASTO "PIND"
110 GTO 05
111▸LBL 02
112 "Set vars; selec"
113 ├"t 'x'"
114 PROMPT
115 ASTO "PIND"
116 ALENG
117 X=0?
118 GTO 02
119 CLMENU
120 "EVAL"
121 KEY 1 GTO 03
122 "SOLVE"
123 KEY 2 GTO 04
124 MENU
125 "Evaluate or sol"
126 ├"ve?"
127 PROMPT
128▸LBL 03
129 CLA
130 ASTO "PDEP"
131 GTO 05
132▸LBL 04
133 VARMENU IND "PFCN"
134 "Select 'y'"
135 PROMPT
136 ASTO "PDEP"
137▸LBL 05
138 EXITALL
139 CLLCD
140 RCL "YMAX"
141 RCL- "AXIS"
142 LASTX
143 RCL- "YMIN"
144 ÷
145 X<0?
146 GTO 20
147 1
148 X<>Y
149 X>Y?
150 GTO 20
151 RCL "ResY"
152 1
153 -
154 ×
155 1
156 +
157 +/-
158 1
159 PIXEL
160▸LBL 20
161 RCL "XMAX"
162 ENTER
163 RCL- "XMIN"
164 ÷
165 X<0?
166 GTO 06
167 1
168 X<>Y
169 X>Y?
170 GTO 06
171 -
172 RCL "ResX"
173 1
174 -
175 ×
176 1
177 +
178 +/-
179 PIXEL
180▸LBL 06
181 RCL "XMAX"
182 RCL "XMIN"
183 STO 00
184 -
185 RCL "ResX"
186 1
187 -
188 ÷
189 STO 01
190 RCL "ResX"
191 1ᴇ-3
192 ×
193 1
194 +
195 STO 02
196 RCL "YMIN"
197 RCL- "YMAX"
198 STO 03
199 CLA
200 ARCL "PIND"
201 ALENG
202 X≠0?
203 GTO 07
204 8
205 STO 04
206 GTO 08
207▸LBL 07
208 CLA
209 ARCL "PDEP"
210 ALENG
211 X≠0?
212 GTO 07
213 9
214 STO 04
215 GTO 09
216▸LBL 07
217 10
218 STO 04
219 PGMSLV IND "PFCN"
220 GTO 10
221▸LBL 08
222 RCL 00
223 XEQ IND "PFCN"
224 GTO 11
225▸LBL 09
226 RCL 00
227 STO IND "PIND"
228 XEQ IND "PFCN"
229 GTO 11
230▸LBL 10
231 RCL 00
232 STO IND "PIND"
233 RCL "YMIN"
234 STO IND "PDEP"
235 RCL "YMAX"
236 SOLVE IND "PDEP"
237▸LBL 11
238 RCL- "YMAX"
239 RCL÷ 03
240 RCL "ResY"
241 1
242 -
243 ×
244 1
245 +
246 X<0?
247 GTO 07
248 RCL 02
249 PIXEL
250▸LBL 07
251 RCL 01
252 STO+ 00
253 ISG 02
254 GTO IND 04
255 GETKEY
256 32
257 X=Y?
258 GTO 18
259 5
260 +
261 X=Y?
262 GTO 19
263 END
```