The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Free42 with skins
Message #1 Posted by Thomas Okken on 2 Mar 2005, 4:26 p.m.

Hi all,

In case you were wondering when the skin support in Free42 would ever get done (and I wouldn't blame you!, I was in a bit of a slump the last month or so), the latest version now has skin support in the Windows and X versions. Skin support for the Palm is still in the design stages but will hopefully arrive in a week or two.
The skin format is not compatible with that of Emu42, but it's pretty simple. The two main limitations at the moment are: the skin bitmaps must be in GIF format, and there's no support for keyboard mapping yet.
Regarding the first limitation: it seems to me that the existing Emu42 skins don't suffer noticeably from the conversion from 24-bit BMP to 8-bit GIF; they don't use a very large range of colors, so as long as you use some tool that does a decent job of palette optimization and color quantization, the result will look pretty good. But, if enough people complain (i.e., more than one ;-)), I'll add support for some 24-bit format -- maybe BMP, maybe PNG, maybe both.
Regarding the second limitation: keyboard mapping is the next item on my to-do list; once that's done, I'll define extensions to the skin layout format to allow users to customize the mapping.

So, what else is missing? One other thing -- true-color skins look pretty bad on 8-bit screens under Windows. The X version handles 8-bit screens pretty well, but the code that takes care of that magic still needs to be adapted and transplanted to the Windows version.
Here's hoping there aren't too many people still using less than 16 bits per pixel under Windows! (If there are, I'm sure I'll hear about it soon enough!)

The latest Free42, plus a separate package containing a few skins, including my adaptation of "ehrling42sl", is now available on the Free42 home page.
NOTE: you don't actually need to get the skins package; Free42 has two skins built in, so installation is just as simple as before: all you need is the executable and you're good to go.

- Thomas

Edited: 2 Mar 2005, 4:33 p.m.

      
Re: Free42 with skins
Message #2 Posted by Namir on 2 Mar 2005, 4:58 p.m.,
in response to message #1 by Thomas Okken

Cool work Thomas! I like the skins feature. On my laptop the "natural" look is very cool!!!

Namir

      
Re: Free42 with skins
Message #3 Posted by Richard Garner on 2 Mar 2005, 5:05 p.m.,
in response to message #1 by Thomas Okken

The skins look great! I got a question. Why couldn't the skins go in the same folder as the program? Having one folder for all the files might cut down on any confusion later on. I first copied the skins into the same folder as the program and wondered why they did not show up until I read the read-me file. I then put them in the new folder and they worked. Just curious.

            
Re: Free42 with skins
Message #4 Posted by Thomas Okken on 2 Mar 2005, 5:24 p.m.,
in response to message #3 by Richard Garner

Why couldn't the skins go in the same folder as the program?

Good point. My main concern was secure multi-user installations: I wanted to support the scenario where Free42 is installed in one central location for multiple users (and that location may not be writeable for everyone), where any user-specific stuff (state and skins) should be in a user-specific directory (i.e., under My Documents).

But, there's something to be said for looking for skins in a central directory as well. I think I'll add that to the next version -- make it look in "My Documents\Free42" and in the directory containing the executable.
(That might be a nice idea for the X version as well, but it's a bit trickier there because Unix programs cannot reliably determine the location of the executable -- and while something like /usr/share/lib/free42 seems a reasonable choice to put a system-wide set of skins, I don't like hard-coding directory names. This will take some thought...)

- Thomas

                  
Re: Free42 with skins
Message #5 Posted by Vassilis Prevelakis on 2 Mar 2005, 9:37 p.m.,
in response to message #4 by Thomas Okken

Thomas Okken wrote:
> ... and while something like /usr/share/lib/free42 seems a
>  reasonable choice to put a system-wide set of skins, I 
> don't like hard-coding directory names.  

Of course X has its own way of specifying user options, using the Xresources. So you can have an Xresource that tells you where the directory is.

**vp

      
Re: Free42 with skins
Message #6 Posted by Eric Lundgren on 2 Mar 2005, 11:10 p.m.,
in response to message #1 by Thomas Okken

Hi Thomas,

Could you explain what "KML" files are? ______________________________________________________ Quote: The executable package of Emu42 for Pocket PC 2002 and 2003 v1.01 (ARM platform) without KML files ______________________________________________________

I run pocketPC, and have only been able to try a 15c emulator (pretty nice, btw). But the 42s would really be a treat!

Thanks, Eric Lundgren

            
Re: Free42 with skins
Message #7 Posted by Jeff O. on 3 Mar 2005, 7:44 a.m.,
in response to message #6 by Eric Lundgren

KML files are scripts that map keyboard functions to a bitmap for use with the emu family of emulators developed by Christoph Gießelink. Information on all of the emu emulators can be found here and for the 42s specifically can be found here. Some skins for use with emu42 and emu48 can be found here, as well as other places.
Be aware that you need rom images to run the emu emulators. The 42S rom is not publicly available, and is definitely not available at the above links. If you have access to a 42s and a 48G+ or 48GX, you can dump it yourself fairly easily.

            
Re: Free42 with skins
Message #8 Posted by Thomas Okken on 3 Mar 2005, 8:47 a.m.,
in response to message #6 by Eric Lundgren

Note that Free42 and Emu42 are completely separate projects.

Emu42 uses skin descriptions in KML format, and skin bitmaps in BMP format; it runs on Windows and Pocket PC; and it emulates the HP-42S at the hardware level, so you need a ROM image to use it; with different ROM images, it can also emulate other HP calculators that are based on the same hardware architecture. Emu42 was written by Christoph Gießelink, not by me; for more information, look at the Emu42 home page.

Free42 uses a different layout format (called, very imaginatively, "layout"), and skin bitmaps in GIF format; it runs on Windows, Unix, and PalmOS (NOT on Pocket PC (yet)). It emulates the HP-42S at the user level, so no ROM images are required (but note that it uses binary math, unlike the real HP-42S and Emu42, so it's not yet 100% compatible).

Hope that clears things up!

- Thomas

      
Re: Free42 with skins
Message #9 Posted by Mike (Stgt) on 3 Mar 2005, 5:37 a.m.,
in response to message #1 by Thomas Okken

Great!

I do not regard the use of 8-bit GIF as a limitation. All skins I use for Emu42 and Emu48 are BMPs reduced to 256 colors, two even to 16 only -- but that's for fun only.

I once asked Christoph "why BMPs only" and he replied "feel free to add the code for others". My idea was to use Stefan Peichl's LXPIC with the built-in programmer interface (using 16 bytes of the BIOS data area, see http://hplx.pgdn.de/lxpic.zip) to convert GIFs or JPGs to BMP on the fly. Well, I had a closer look to the source ... and - ah - you know... it would take some time just for the gain of saving some kB.

So using GIFs for Free42 is no limitation (IMHO).

Ciao.....Mike

            
Re: Free42 with skins
Message #10 Posted by Thomas Okken on 3 Mar 2005, 9:08 a.m.,
in response to message #9 by Mike (Stgt)

My main reason for supporting only GIF for skin bitmaps initially, is that I wanted to keep the build simple. I already had a GIF encoder/decoder that I had written for another project last summer, and so that was easy to integrate into Free42.

Adding PNG and JPEG support is relatively easy, as well -- there are excellent open-source/LGPL libraries out there, not too difficult to use, and integrating them into Free42 would be no problem, either. BUT it would mean adding third-party code to my project, or making it a multi-part project, or requiring people to download the libs in question separately, etc... I didn't want to deal with those issues just yet.

BMP might actually be the best option, as I suspect it's sufficiently easy to decode that I could just write my own decoder and not worry about third-party code and licensing issues etc. (Anyone have a link to a good, comprehensive, BMP file format spec?)

- Thomas

                  
Re: Free42 with skins
Message #11 Posted by Mike (Stgt) on 4 Mar 2005, 3:22 a.m.,
in response to message #10 by Thomas Okken

Did you see the disclaimer agreement for LXPIC?

LxPic is copyrighted freeware. If you bundle LxPic with your
software or use the internal interface of LxPic, you have to
ask me for permission and you have to mention LxPic and the
copyright somewhere in your product.
...
As your Fre42 is freeware too I am quite sure Stefan will aggree to use his little 20kB gem.

Ciao.....Mike

PS: I'll ask him if he may point me to the specs of the graphic formats. M.

Edited: 4 Mar 2005, 3:51 a.m.

            
Re: Free42 with skins
Message #12 Posted by Christoph Giesselink on 17 Mar 2005, 2:56 a.m.,
in response to message #9 by Mike (Stgt)

I recently recognized that the Win32 versions of Emu28/42/48 also accept RLE4 & RLE8 compressed bitmaps.

Regards

Christoph

                  
Re: Free42 with skins
Message #13 Posted by Mike (Stgt) on 17 Mar 2005, 4:51 a.m.,
in response to message #12 by Christoph Giesselink

Thank you very much for that info. It will give me some work as the compression for BMPs with 16 colors only (4 bit) is quite good (110kB to 20kB for my EMU42Sbeta.bmp), for 8 bit BMPs (256 colors) the ratio is not so good.

Tnx again.....M.

                        
Re: Free42 with skins
Message #14 Posted by Christoph Giesselink on 17 Mar 2005, 4:56 p.m.,
in response to message #13 by Mike (Stgt)

The compression rate also depends very much on the used encoder. Some sizes for a good compressable bitmap:

Size uncompressed: 130KB

Size RLE4: 4KB (with Paint Shop Pro 5.0)

Size RLE4: 128 Bytes! (with Photoshop 6.0)

The difference between Paint Shop Pro and Photoshop is, that Photoshop use the Delta Escape sequence. The pity is, that in many cases Photoshop 6.0 corrupts the bitmap when saving in RLE4 mode.

Then I replaced the black background with blue. Then Photoshop also need the 4KB from Paint Shop Pro. With palette renaming it would be possible to get still the 128 Bytes from the 1st example with black background.

Cheers

Christoph

                              
Re: Free42 with skins
Message #15 Posted by Mike (Stgt) on 18 Mar 2005, 5:24 a.m.,
in response to message #14 by Christoph Giesselink

Well, I never went too deep in that business, as with the tools I have at hand (Stefan Peichl's LXpic, XNview, IrfanView, PSP8) I am not sure if a pic's properties are analyzed correctly and if a format change (RLE, uncompressed, etc.) is saved according to the set options. I hope to meet Stefan next week and get some hints about formats.

Ciao.....Mike

                  
Re: Free42 with skins
Message #16 Posted by Thomas Okken on 18 Mar 2005, 7:57 p.m.,
in response to message #12 by Christoph Giesselink

Do you read the BMP files using CreateDIBSection()?
From what I understand, if you use that, you automagically support all BMP sub-variants.
I guess if that works as easily as I suspect, that would make it very easy to add BMP support to the Windows version of Free42. Of course I'd still be on my own for the Unix version, but of course there's always bmptoppm to use as sample code...

- Thomas

                        
Re: Free42 with skins
Message #17 Posted by Christoph Giesselink on 20 Mar 2005, 1:15 p.m.,
in response to message #16 by Thomas Okken

There are different methods for loading bitmaps under Win32. The emulators of my Win32 Emu family use CreateDIBitmap() (used in Emu48 sources / Files.c / Function LoadBitmapFile()), a little bit more high level function than CreateDIBSection().

The easiest way to load bitmaps is to use LoadImage(). But the disadvantage of this function is the difficult way to get the palette information necessary for high color bitmaps on 256 color devices.

Some words to CreateDIBSection(), I use this function in the PocketPC emulators because the Win32 function CreateDIBitmap() is missing in the PocketPC 2002 SDK. Furthermore the PocketPC only supports RGB bitmaps, the RLE decoder is missing. Because of this the limitation "Win32" in my previous post. But everything change, so the next versions of my PocketPC emulators (Emu42PPC v1.02 and Emu48PPC v1.02) will also support RLE coded bitmaps (a small addition). My current beta versions use them already especially for the VGA mode KML background bitmaps.

Finally some words to the use of different bitmap formats. RGB bitmaps are the best supported graphic format in windows. Furthermore, the base of Emu48, Win48 is now nearly 10! years old, or better Emu48 base on 10 years old source code. Until now, you can everthing do with bitmaps. So there was never a real need on PC's to have a different graphic format. Discussing bitmap sizes in the times of > 100GB hard disk space is IMHO useless. Also PocketPC devices getting more and more memory. Do we really need several faceplates for the same calculator at the same time? Do we really need more than one emulator on the Pocket PC device at the same time? --- I must confess on my Jornada 565 I have 5 emulators/simulators and on my Axim x50v I have 3 emulators installed.

But I don't agree with you that 256 colors are enough, there are many "real" Emu42 & Emu48 KML bitmaps using high or true color mode. Of course when you limit yourself onto "synthetic" KML scripts using only 16 or 256 colors a 8 bit limited graphic format will be enough.

Regards,

Christoph

                              
Re: Free42 with skins
Message #18 Posted by Thomas Okken on 20 Mar 2005, 1:27 p.m.,
in response to message #17 by Christoph Giesselink

Thanks for your insights -- I clearly have some reading to do but now I have a better idea where to look!

BTW, I agree that it would be better to support true-color skins; the reason why I decided 256 colors was good enough for now is that all the Emu42 skins that I have look excellent after conversion to 8 bpp... But of course there may well be "rainbow" skins (or "cloudy skies", etc.) that would look really bad in 256 colors. At any rate, nobody has complained *yet*. :-)

- Thomas

            
Dynamic conversion of various image file formats
Message #19 Posted by Cameron Paine on 18 Mar 2005, 11:31 p.m.,
in response to message #9 by Mike (Stgt)

Mike (and Christoph),

Micro$oft have an API which might make your job easier. It is only applicable to Wintel platforms. Check out OleLoadPicture() in the docs. If you find the docs too terse, Paul DiLascia wrote a tutorial on its use.

I wrap this function in a class which I use to load both BMP and JPEG skins on my 16C simulation.

This API is apparently emulated by Wine which makes it accessible to linux platforms too. I've been told that my simulation runs under Wine.

Cameron

                  
Re: Dynamic conversion of various image file formats
Message #20 Posted by Mike (Stgt) on 20 Mar 2005, 7:34 a.m.,
in response to message #19 by Cameron Paine

Tnx a lot 4 that hint.

Ciao.....Mike

                        
Re: Dynamic conversion of various image file formats
Message #21 Posted by Mike (Stgt) on 4 Apr 2005, 6:19 a.m.,
in response to message #20 by Mike (Stgt)

Hello!

I can't find the thread again where I promised to ask Stefan Peichl about his sources of the definitions of various graphic formats. Well, about JPG he once bought a book what is rather thick, GIF are about 10 pages, PCX about 2. All may be found in the Internet. That was all he did tell me.

Ciao.....Mike

BTW - something waaay off topic: http://www.marcelgotlib.com/NewMed/Popup/cont_pie_high.htm


[ Return to Index | Top of Index ]

Go back to the main exhibit hall