The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

HP-16C in Nonpareil release 0.61
Message #1 Posted by Eric Smith on 12 May 2005, 4:46 a.m.

The HP-16C is supported in the newly released Nonpareil 0.61. Also bugs have been fixed, so now the HP-34C, HP-37E, HP-38E, and HP-38C work correctly. Building from source code now uses SCons instead of make.

But perhaps the biggest news is that Nonpareil now saves and restores the calculator state. Now there is continuous memory, even for calculators that didn't originally have it.

Still working on Windows support. I'm not sure when that will be ready.

      
Nonpareil release 0.61 under cygwin
Message #2 Posted by Mike (Stgt) on 12 May 2005, 8:52 a.m.,
in response to message #1 by Eric Smith

Hi Eric,

I installed SCons so I assume no need to unpack scons-local. Got following displayed:

$ scons
scons: Reading SConscript files ...

scons: warning: Ignoring missing SConscript 'scons-local/SConscript' File "SConstruct", line 163, in ? scons: done reading SConscript files. scons: Building targets ... gcc -Wall -g -Ibuild -Isrc -I/usr/include/libxml2 -c -o build/util.o src/util.c gcc -Wall -g -Ibuild -Isrc -I/usr/include/libxml2 -c -o build/arch.o src/arch.c gcc -Wall -g -DNONPAREIL_RELEASE=0.61 -Ibuild -Isrc -c -o build/release.o src/re lease.c gcc -Wall -g -Ibuild -Isrc -I/usr/include/libxml2 -c -o build/state_write.o src/ state_write.c In file included from src/state_write.c:33: src/proc.h:45: error: conflicting types for `addr_t' /usr/include/cygwin/types.h:197: error: previous declaration of `addr_t' scons: *** [build/state_write.o] Error 1 scons: building terminated because of errors.

IMHO, that is not an hint that I did something wrong with SCons.

TIA.....Mike

Edited: 12 May 2005, 8:57 a.m.

      
Re: HP-16C in NutEm
Message #3 Posted by Mike (Stgt) on 12 May 2005, 11:12 a.m.,
in response to message #1 by Eric Smith

As the HP-16C has nearly the same CPU as the HP-41 I traced it's execution with NutEm. I see it going through some debounce logic and stop at 108E in light sleep mode with the display filled with @s. Any key hit results in deep sleep (OFF). I assume only some fiddling with the display driver, key codes and debounce and NutEm could do the Voyagers too.

Following the first steps of the HP-16C (the substituted jump destination are labels only meaningful for the HP-41).

0000: 1CF JC     +39 0039   
0039: 231 *                 
003A: 00C NCXQ   038C       
038C: 260 SETHEX            
038D: 0A0 PT=P              
038E: 2E5 *                 
038F: 000 NCXQ   00B9       
00B9: 130 LDI               
00BA: 004 CON       4       
00BB: 3C8 CLRKEY            
00BC: 3CC ?KEY              
00BD: 266 C=C-1  X          
00BE: 3EB JNC    -03 =ERRIGN
00BB: 3C8 CLRKEY            
00BC: 3CC ?KEY              
00BD: 266 C=C-1  X          
00BE: 3EB JNC    -03 =ERRIGN
00BB: 3C8 CLRKEY            
00BC: 3CC ?KEY              
00BD: 266 C=C-1  X          
00BE: 3EB JNC    -03 =ERRIGN
00BB: 3C8 CLRKEY            
00BC: 3CC ?KEY              
00BD: 266 C=C-1  X          
00BE: 3EB JNC    -03 =ERRIGN

Ciao.....Mike

            
Re: HP-16C in NutEm
Message #4 Posted by HrastProgrammer on 12 May 2005, 1:02 p.m.,
in response to message #3 by Mike (Stgt)

I assume only some fiddling with the display driver, key codes and debounce and NutEm could do the Voyagers too.

Mainly ... but you will have to resolve a few things in order to make everything work correctly :-)

BTW, the display organization is 100% different compared to the HP-41C (forget all these rotate/shift instructions because all LCD segments and annunciators are memory mapped).

                  
Re: HP-16C in NutEm
Message #5 Posted by Mike (Stgt) on 13 May 2005, 4:05 a.m.,
in response to message #4 by HrastProgrammer

Yes, of cause, when I say "only some fiddling" I was aware that this will not be done with a finger snap. But the core of the CPU simulation seem to work. Anyway - tnx 4 Ur hint.

Ciao.....Mike

            
Re: HP-16C in NutEm
Message #6 Posted by Eric Smith on 12 May 2005, 4:29 p.m.,
in response to message #3 by Mike (Stgt)

The display is completely different than that of the 41C, as HrastProgrammer has pointed out. There are a total of 100 display segments, which are individually controlled from the upper 50 bits of "RAM" locations 0x09 and 0x0a.

HrastProgrammer also discovered that RAM address 0x08 is a hardware register of some type, and the firmware will not work correctly if it behaves like RAM. It seems OK if one ignores writes and returns zeros for reads.

The 16C firmware supplied in Nonpareil is modified from the original in the calculator, and is copyrighted. It is not freely redistributable.

Eric

                  
Re: HP-16C in NutEm
Message #7 Posted by Jonathan Purvis (New Zealand) on 12 May 2005, 7:18 p.m.,
in response to message #6 by Eric Smith

Quote:
The 16C firmware supplied in Nonpareil is modified from the original in the calculator, and is copyrighted. It is not freely redistributable.

What are the terms for distributing the rom images that come with Nonpareil? 0.61 only mentions that the software is under the GPL, which would make them freely redistributable, even though they're copyrighted. If i were to eventally port Nonpareil to PalmOS, would i be able to distribute the rom images with it?

                        
Re: HP-16C in NutEm
Message #8 Posted by Eric Smith on 12 May 2005, 8:47 p.m.,
in response to message #7 by Jonathan Purvis (New Zealand)

(I wasn't really prepared to get into a copyright/licensing discussion now, but I walked right into it...)

The ROM images are not GPL'd. In earlier Nonpareil releases there was accidentally a GPL notice attached to the ones supplied as object code only, but it doesn't apply since they are not provided as source code. (Thus it is not possible for anyone to comply with the GPL terms for those files anyhow.)

However, upon request I will be happy to offer a license to include the ROM images to be distributed with any software that qualifies as Free Software based on the FSF's definition, provided that the copyright notice is maintained. A port of Nonpareil certainly qualifies.

I'm willing to negotiate licenses for the ROM images to be distributed in non-Free software.

Eric

                        
Porting Nonpareil
Message #9 Posted by Eric Smith on 12 May 2005, 8:56 p.m.,
in response to message #7 by Jonathan Purvis (New Zealand)

By the way, part of the purpose of some of the recent internal changes in Nonpareil has been an attempt to make it easier to port to other platforms. I'd definitely like to encourage a PalmOS port.

For most ports, the GUI code (csim.c) should just be thrown away, and not used for anything but a model.

On platforms that support multithreading, I recommend using it. All of the thread-aware code is in the single source file proc.c. It uses the threading and asynchronous queue primitives from glib, but it doesn't use very many of them, and doesn't do anything too exotic. The porting approach I suggest, for target platforms that aren't supported by glib, is to write equivalents to those routines.

For platforms that only support a single thread, the porting will be a bit more complex. I need to give a bit more thought to it. The naive approach would probably be to do away with proc.c entirely, but perhaps it would be better for me to put a bit of effort into cleaning up things to more easily fit into a single-threaded model.

Part of such a cleanup is already planned. I want to split proc.c into two separate source files, based on which thread the functions run in. A new header file will be created to document the message-passing interface between the two threads (currently at the top of proc.c).

Where possible, I'd like to integrate ports to other platforms like PalmOS or MacOS X into the standard Nonpareil distribution.

Eric

                  
Re: HP-16C in NutEm
Message #10 Posted by HrastProgrammer on 13 May 2005, 1:50 a.m.,
in response to message #6 by Eric Smith

In the final version of HP-11E/16E, I just write zero into register 8 on entering the POWOFF instruction and everything is working OK. Eric noticed that it is perhaps an auto power off counter or something like that. When the calculator wake up and find a non-zero value there, it just returns to the deep sleep ...

                        
Re: HP-16C in NutEm
Message #11 Posted by Mike (Stgt) on 13 May 2005, 4:17 a.m.,
in response to message #10 by HrastProgrammer

At POWOFF to deep sleep or to light sleep too? When I wake up from deep sleep I set Carry and it goes to light sleep (ON for the user) even with non-zero RAM.

Ciao.....Mike

                              
Re: HP-16C in NutEm
Message #12 Posted by HrastProgrammer on 13 May 2005, 4:50 a.m.,
in response to message #11 by Mike (Stgt)

At POWOFF to deep sleep or to light sleep too?

Both ...

                  
Re: HP-16C in NutEm
Message #13 Posted by Bill Wiese on 13 May 2005, 8:50 p.m.,
in response to message #6 by Eric Smith

Quote:
The 16C firmware supplied in Nonpareil is modified from the original in the calculator, and is copyrighted. It is not freely redistributable

Hmmm, interesting. Is this because you can't run the stock 16C firmware? What mods were made?

Bill Wiese
San Jose CA

                  
Re: HP-16C in NutEm
Message #14 Posted by Thomas Okken on 14 May 2005, 6:32 a.m.,
in response to message #6 by Eric Smith

The 16C firmware supplied in Nonpareil is modified from the original in the calculator, and is copyrighted. It is not freely redistributable.

How can you claim copyright to something you didn't write? It seems like you could only copyright your modifications, and that the original ROM is in the public domain (assuming your interpretation of U.S. copyright law, given on your web site, is correct).
No criticism here, just curious...

                        
Re: HP-16C in NutEm
Message #15 Posted by Eric Smith on 14 May 2005, 10:08 p.m.,
in response to message #14 by Thomas Okken

Quote:
How can you claim copyright to something you didn't write?

The same way Disney can copyright folk stories that are hundreds of years old.

Material that is in the public domain may be modified and/or copyrighted by anyone. If someone wants unmodified Voyager ROMs, or doesn't want to deal with my copyright, he or she is free to obtain the ROM images by some other means.

Eric


[ Return to Index | Top of Index ]

Go back to the main exhibit hall