The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Writing RPL programs on OS X
Message #1 Posted by Sean Freeman on 27 Nov 2013, 3:01 p.m.

All of the discussions on this that I can find are either older and suggesting software that is not compatible with current computers, or using wine to run a windows hp emulator.

I would like to be able to write longer programs on my computer and transfer them via SD card. My problem is that I'm not understanding a way to type the special characters that my calculator uses.

For example the square root symbol, x-bar, or greek characters, etc.

Does anyone know of a way to allow me to type these HP 50g compatible characters on a mac running OS X?

I'm pretty uneducated on the topic of character coding, all I've been able to find is that the 50g uses ISO-8859-1 character map with certain characters altered. I was able to load the ISO-8859-1 character set on my computer, and I can (with the help of an hp 48 font map) insert characters (using the top and left legend) in this ISO-8859-1 character set which do show up as the intended character once displayed on my 50g. But as the image shows, the characters on my computer are just empty boxes, so I have to use that table on the web page linked to find them. It's quite a pain.

Hopefully there is a more graceful way to do this?

Edited: 27 Nov 2013, 4:59 p.m.

      
Re: Writing RPL programs on OS X
Message #2 Posted by Egan Ford on 27 Nov 2013, 6:25 p.m.,
in response to message #1 by Sean Freeman

Hi Sean, IIRC there is a 48/50 TTF font floating around for documentation. Whether or not that aligns with the codes in the 50g is unknown to me. However you can probably use it as a base for a custom font. Unicode fonts will probably have all the characters, but then you need to make it ISO-8859-1.

After you figure the fonts out, then the next step is to download and run Ukelele so that you can create a custom keyboard map using the option/alt key for example. This is how I use APL on my Mac. APL has an alien dialect. :-)

After running Ukelele, put your custom keylayout in $HOME/Library/Keyboard Layouts as 50g,keylayout. Then from System PrefLang & Text/Input Sources, select your 50g keylayout. I'd also check "Allow a diff for each document" so that as you jump around apps, they keylayout will remain with your editor/emulator.

Lastly from System Pref/Keyboard/Keyboard Shortcuts/Spotlight, uncheck "show spotlight window". This way you can use the default opt-cmd-space to switch keylayouts quickly.

Oh, instead of a custom font, use unicode chars and define that with Ukelele. Then write a small program to convert your text file from unicode to ISO-8859-1 and vv. I have not found an easy way to make fonts on the Mac based on other fonts, etc...

Good luck.

            
Re: Writing RPL programs on OS X
Message #3 Posted by carey on 29 Nov 2013, 8:15 a.m.,
in response to message #2 by Egan Ford

Egan - just wondering which APL implementation you run on the Mac? I use NARS2000 on Windows and the new GNU APL on Linux but haven't found an APL for MAC OSX. Thanks!

                  
Re: Writing RPL programs on OS X
Message #4 Posted by Egan Ford on 29 Nov 2013, 4:22 p.m.,
in response to message #3 by carey

Quote:
Egan - just wondering which APL implementation you run on the Mac?
GNU APL.
./configure --prefix=/usr/local;make;sudo make install
                        
Re: Writing RPL programs on OS X
Message #5 Posted by carey on 29 Nov 2013, 8:29 p.m.,
in response to message #4 by Egan Ford

Thanks Egan for the command-line installation instructions -- it worked!

                              
Re: Writing RPL programs on OS X
Message #6 Posted by Egan Ford on 29 Nov 2013, 10:44 p.m.,
in response to message #5 by carey

I run apl with Terminal with the fonts and layout from: http://www.dyalog.com/resources/. However I've made a few minor changes to the key layout using Ukelele to align with GNU APL. The unicode that GNU APL expects does not always align with Dyalog. You can either change the keymap or hack Avec.* in GNU APL.

      
Re: Writing RPL programs on OS X
Message #7 Posted by Egan Ford on 27 Nov 2013, 6:32 p.m.,
in response to message #1 by Sean Freeman

Another alternative is slash notation:

HP48G/HP49G Backslash Equivalences

HP49G ANSI Back- Description CHARS Char- slash Code actor Equi- valent

128 &#128; \<) Angle symbol for polar notation 129 \x- x with bar above it 130 &#130; \.V 131 &#131; \v/ Square root symbol 132 &#132; \.S Integral symbol 133 &#133; \GS Uppercase Greek Sigma 134 &#134; \|> 135 &#135; \pi Lowercase Greek pi 136 &#136; \.d Differentiation symbol 137 &#137; \<= Less-than or equal-to symbol 138 &#138; \>= Greater-than or equal-to symbol 139 &#139; \=/ Not-equal-to symbol 140 &#140; \Ga Lowercase Greek alpha 141 \-> Right arrow 142 &#142; \<- Left arrow 143 \|v Down arrow 144 \|^ Up arrow 145 &#145; \Gg Lowercase Greek gamma 146 &#146; \Gd Lowercase Greek delta 147 &#147; \Ge Lowercase Greek epsilon 148 &#148; \Gn Lowercase Greek eta 149 &#149; \Gh Lowercase Greek theta 150 &#150; \Gl Lowercase Greek lambda 151 &#151; \Gr Lowercase Greek rho 152 &#152; \Gs Lowercase Greek sigma 153 &#153; \Gt Lowercase Greek tau 154 &#156; \Gw Lowercase Greek omega 155 &#155; \GD Uppercase Greek Delta 156 &#156; \GP Uppercase Greek Pi 157 \GW Uppercase Greek Omega 158 &#158; [] 159 &#159; \oo Infinity symbol 171 \<< Start of program delimiter (<<) 176 \^o Degree symbol 181 \Gm Lowercase Greek mu 187 \>> End of program delimiter (>>) 215 \.x Cross-product operator 216 \O/ Slashed Oh 223 \Gb Lowercase Greek beta 247 \:- Division symbol

      
Re: Writing RPL programs on OS X
Message #8 Posted by Paul Onions on 28 Nov 2013, 8:35 a.m.,
in response to message #1 by Sean Freeman

Hi Sean,

As an alternative you might consider my Hoppi program at:-

www.bitbucket.org/cloudycat/hoppi

that transfers programs via USB or serial cable. It features automatic translation between hp50g character codes and UTF-8 (native Mac encoding, see the README).

It's free! If you try it then please let me know if you like it (or not -- all feedback welcome).

Thanks, Paul

            
Re: Writing RPL programs on OS X
Message #9 Posted by Egan Ford on 28 Nov 2013, 1:37 p.m.,
in response to message #8 by Paul Onions

Paul, this is awesome, esp. with the translation. +1 for using Lisp too. :-)

This is very quick/dirty keylayout for OS/X that uses the unicode from your source:

To use, go to http://sense.net/~egan/RPL/ and download the keylayout and icns file and put in $HOME/Library/Keyboard Layouts, then from Sys Pref/Lang & Text/Input Sources select RPL and/or follow my directions above.

I've only tested with TextEdit and VIM from Terminal.

If others want to improve the icon or or layout go ahead and send to me and I'll update it.

                  
Re: Writing RPL programs on OS X
Message #10 Posted by Paul Onions on 28 Nov 2013, 5:29 p.m.,
in response to message #9 by Egan Ford

Hi Egan,

Thanks for the keyboard layout, that's very useful!

When I get the time I want to integrate a text editor into Hoppi to enable editing of RPL objects and transferring them to/from the stack. This shouldn't be too difficult since there is an editor built-in to the Clozure Common Lisp environment. It will just take a little time for me to figure out how to do it (I'm no expert with Cocoa).

Paul

                  
Re: Writing RPL programs on OS X
Message #11 Posted by Sean Freeman on 29 Nov 2013, 12:07 p.m.,
in response to message #9 by Egan Ford

Wow thanks fellas, these options are excellent! I've just gotten both Hoppi and Ukelele.

                  
Re: Writing RPL programs on OS X
Message #12 Posted by Sean Freeman on 29 Nov 2013, 12:18 p.m.,
in response to message #9 by Egan Ford

Is this keyboard layout using unicode characters? There will still need to be a step that converts the text file to ISO-8859-1 right?

                        
Re: Writing RPL programs on OS X
Message #13 Posted by Egan Ford on 29 Nov 2013, 4:24 p.m.,
in response to message #12 by Sean Freeman

Quote:
Is this keyboard layout using unicode characters?
Correct, using the unicode recognized by Hoppi. BTW, I made some minor changes, please look at the PDF for the proper map.
Quote:
There will still need to be a step that converts the text file to ISO-8859-1 right?
No. Hoppi does that automatically when transferring to and from the 50g.

You should be ready to go.

Edited: 29 Nov 2013, 4:25 p.m.

            
Re: Writing RPL programs on OS X
Message #14 Posted by Sean Freeman on 29 Nov 2013, 11:42 p.m.,
in response to message #8 by Paul Onions

Paul, I'm having some trouble figuring out how to transfer files with Hoppi. I downloaded the .dmg package and moved the application over to my Applications folder. When I run Hoppi it sees and connects to the calculator, but past that I'm not understanding how to send a file to the calculator, or pull one from it.

One time I was able to select a file in Hoppi but it said that the transfer failed. Every other time I have clicked the button in the top left of Hoppi that is labeled with my home directory, all files are greyed out.

I'm not exactly sure when or how to use the RECV command on the 50g.

Sorry for my ignorance ;)

                  
Re: Writing RPL programs on OS X
Message #15 Posted by Paul Onions on 30 Nov 2013, 8:14 a.m.,
in response to message #14 by Sean Freeman

Hi Sean,

I really need to improve the documentation :-)

With a 50g the easiest way to transfer files is via the FILER application (left-shift APPS key).

To send a file to the computer select it in the FILER then press the SEND soft-key (2nd page of the soft menu).

To transfer a file from the computer to the calculator go to the File->Send File... menu command in Hoppi, select the appropriate file from the file dialog then press the Send button. On the calculator within the FILER press the RECV soft key.

The problem with the 50g (as opposed to the 48g) is that the "Transfer.." app does not seem to work correctly (at least in Kermit mode): it sends nonsense packets when it should be requesting a directory listing, so a fully calculator controlled transfer is not possible (yet).

Hope this helps, Paul

                        
Re: Writing RPL programs on OS X
Message #16 Posted by Egan Ford on 30 Nov 2013, 12:15 p.m.,
in response to message #15 by Paul Onions

Hi Paul,

Last time I use this it worked: http://hpconnect.sourceforge.net/

Perhaps there are some hints in the source.

                              
Re: Writing RPL programs on OS X
Message #17 Posted by Paul Onions on 30 Nov 2013, 2:40 p.m.,
in response to message #16 by Egan Ford

Hi Egan,

It doesn't use Kermit. It uses the Xmodem protocol and requires the calculator to be in server mode running the XSERV command.

Paul

                                    
Re: Writing RPL programs on OS X
Message #18 Posted by Egan Ford on 30 Nov 2013, 6:37 p.m.,
in response to message #17 by Paul Onions

Yeah I know. Is that a problem? Xmodem is faster than Kermit too.

                        
Re: Writing RPL programs on OS X
Message #19 Posted by Sean Freeman on 30 Nov 2013, 3:59 p.m.,
in response to message #15 by Paul Onions

Ah, thanks. It seems obvious now that I've done it. Worked perfectly, now I can type notes or formulas exactly as I had hoped, thank you!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall