Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Interesting patterns for HP-42S" ? revisited for DM42

412 views
Skip to first unread message

Stefan Wolfrum

unread,
Feb 24, 2018, 5:25:26 PM2/24/18
to

Hi all,


I just wanted to share a little graphics gem I recently stumbled upon.

First, have a look at Tom Grydeland's posting to the MoHPC forum dated from 6 Mar 2012:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv021.cgi?read=213505


As I'm always fascinated by mathematical graphics (especially on an HP calc!) and because I just got my brand new SwissMicros DM42 a couple of weeks ago, I wanted to adapt Tom's nice gem to the DM42's larger screen.


Good news: Tom's program "DPP" doesn't have to be changed at all for this.


And here's my new version of "PSHOW" (* is multiply, / is divide):


00 { 82-Byte Prgm }

01 LBL "PSHOW"

02 2

03 STO "GrMod"

04 CLLCD

05 ALENG

06 1E-5

07 *

08 RCL "ResX"

09 1E3

10 /

11 1

12 +

13 +

14 STO 00

15 RCL "ResY"

16 1E3

17 /

18 8E-5

19 +

20 1

21 +

22 STO 01

23 STO 02

24 LBL 01

25 RCL 02

26 STO 01

27 LBL 02

28 RCL 01

29 RCL 00

30 AGRAPH

31 ISG 01

32 GTO 02

33 ISG 00

34 GTO 01

35 END


In my new version the number in line 02 determines the graphics mode of the DM42: 0 for 131x16 (original HP-42 resolution), 2 for 200x120, 3 for 400x240.


Here are three example screenshots (200x120 pixel mode):

http://musicdiver.com/wordpress/wp-content/uploads/2018/02/20180224-21575777.png

http://musicdiver.com/wordpress/wp-content/uploads/2018/02/20180224-21575137.png

http://musicdiver.com/wordpress/wp-content/uploads/2018/02/20180224-21574358.png


Have fun, take care,

Stefan.

David Thompson

unread,
Jun 15, 2018, 11:22:58 AM6/15/18
to
On Saturday, February 24, 2018 at 2:25:26 PM UTC-8, Stefan Wolfrum wrote:

> I just wanted to share a little graphics gem I recently stumbled upon.

Stefan, that is just fun. I just ordered a DM42s and am looking forward to playing with it. I'll have to get the programs once the new calculator arrives.

Thanks!

DavidM

unread,
Jun 16, 2018, 2:58:49 PM6/16/18
to
On Saturday, February 24, 2018 at 5:25:26 PM UTC-5, Stefan Wolfrum wrote:
> Hi all,
> ...
> Have fun, take care,
>
> Stefan.

Those are indeed some interesting patterns!

Seeing this prompted me to give this a try on an old 48sx that has had its defective display replaced with a black-pixel version. While I was at it, I decided to see if I could come up with a single version of the program that would behave appropriately on all of the 48-49-50 systems.

This was a fun exercise in terms of finding code that would work the same way on all of the various incarnations of the 4x RPL systems. I was surprised how many commands I frequently use that are only available on post-48sx RPL units.

Instead of taking the pattern # from the stack, this one prompts you for it. So there's no need to pre-load the stack with the pattern # before execution. The list of patterns needs to have at least one entry, but can be edited as desired and the program will accommodate the changes.

DPP
\<<
@ local variables
RCWS
RCLF
{
#E8AACC17E8335515h
#F0990FE13C66C31Eh
#F0CC0F99F0330F66h
#17A33AD8C68D6C71h
#271BD8B18D4E72E4h
#17A3725CC68DE839h
#17C56CD88EA33972h
#27A96A5695E41BD8h
#27B16A568DE4599Ah
#1B63D436CA4DB1ACh
#2B53ACB24DCA35D4h
#2739CAB28D6C53D4h
#2739C6B2AC4D53D8h
#271B72B18D4ED8E4h
#2739D493AC4D72CAh
#0F69690FF09696F0h
#1763E84E9CC5B13Ah
#1763E45C8EC9B13Ah
#1771A33A4EC9E49Ch
#17A33AE88EC55C71h
}

@ prepare pattern number prompt
DUP SIZE
DUP DUP \->STR
SWAP LOG IP 1 + 1 SWAP SUB
"Enter pattern #" 10 CHR +
"(1-" + SWAP + ")" +

\-> sws sf pat cnt msg

\<<
@ set needed modes
64 STWS HEX

@ prompt for pattern number
0
WHILE
DUP NOT
REPEAT
msg "" INPUT STR\->
IF
cnt OVER \>=
OVER 1 \>=
AND
THEN
SWAP DROP
ELSE
DROP
CLLCD
"Invalid pattern #" 1 DISP
1 WAIT
END
END

@ get 8x8 pattern indicated by selection
pat SWAP GET

@ retrieve the hex digits as string
\->STR DUP SIZE 1 - 3 SWAP SUB

@ left pad with 0s to make 16 digits
WHILE
DUP SIZE 16 <
REPEAT
"0" SWAP +
END

@ convert hex string to GROB
"GROB 8 8 " SWAP + STR\->

@ tile the 8x8 pattern horizontally
#131d #8d BLANK
0 128 FOR N
N R\->B #0 2 \->LIST
3 PICK REPL
8 STEP

@ tile the 131x8 pattern vertically
LCD\->
DUP SIZE SWAP DROP B\->R 8 -
0 SWAP FOR N
#0 N R\->B 2 \->LIST
3 PICK REPL
8 STEP

@ show the pattern
\->LCD

@ clean up/restore settings
DROP2
sws STWS
sf STOF

@ freeze display
7 FREEZE
\>>
\>>
0 new messages