The Museum of HP Calculators

HP Forum Archive 18

[ Return to Index | Top of Index ]

Emu48PPC display resolution
Message #1 Posted by Christoph Giesselink on 27 Jan 2008, 6:14 p.m.

Hello together,

we all know that standard Windows PDA's have the QVGA resolution of 240x320 pixel. Emulating the HP48 with its 131 pixel width display has the problem that we can show the display only with Zoom 1 in portrait mode, because with Zoom 2 the display is getting too large (2 * 131 = 262 > 240 !!). The old Emu48CE had the possibilty using fraction zoom factors by the use of the command ZoomDiv. I added this command a while ago to Emu48PPC but I never found a KML script using this command. So I made a KML script testing a HP48GX with zoom factor 1.5.

I want to hear your opinion about the zoom factor 1.5. Left KML is using the standard Zoom 1 mode, right KML using a Zoom 1.5 mode.

The display font on the right is quite ugly because of the limited display resolution of the PDA. Which KML script do you prefer for working with?

On your reaction I will decide to add the script and maybe further ones to my next Emu48PPC distribution or not. At the moment I personally tend to finish the experiment and don't add them, IMHO the display of the right one is too ugly.

Cheers

Christoph

Edited: 29 Jan 2008, 2:40 p.m. after one or more responses were posted

      
Re: Emu48PPC display resolution
Message #2 Posted by Eric Smith on 27 Jan 2008, 6:37 p.m.,
in response to message #1 by Christoph Giesselink

I don't have a PDA running any variant of Windows, but if I did, I think I'd want a landscape-orientation interface. If you don't already have it, perhaps addition to the fractional display zoom feature you could add a rotate feature.

All of my PDAs are running either PalmOS (Treo 650, Abacus watch) or Linux (Zaurus 5500, Nokia 770, Nokia N800, HP Jornada X25). I'm not holding my breath for anyone to port Emu48 to Linux, though people have ported my Nonpareil simulator to the Nokia.

            
Re: Emu48PPC display resolution
Message #3 Posted by Christoph Giesselink on 27 Jan 2008, 6:58 p.m.,
in response to message #2 by Eric Smith

Hello Eric,

this question is only about portrait mode. Emu48PPC has the ability to rotate the screen 90 degree clock or anti clock wise for landscape mode and then using the Zoom 2 factor.

But IMHO with Zoom 2 diplay mode the keys of the virtual keyboard are getting very small and further I personally have problems with the non standard keyboard layout.

Christoph

                  
Re: Emu48PPC display resolution
Message #4 Posted by Dave on 29 Jan 2008, 1:53 p.m.,
in response to message #3 by Christoph Giesselink

Christoph,

I agree that the fractional scale looks terrible, but IMHO it's better to leave the capability in if it's not too difficult. It's probably enough to just document it in the KML spec. I wouldn't bother including any scripts that actually use it in your distribution.

However, I personally prefer zoom 2 in spite of the tiny, often mixed up buttons. So I think it's best to have as many display options as possible to accomodate different tastes, within reason of course.

                        
Re: Emu48PPC display resolution
Message #5 Posted by Marcus von Cube, Germany on 29 Jan 2008, 4:44 p.m.,
in response to message #4 by Dave

I think there is a way to improve legibility vastly: Implement anti aliasing.

Use a virtual resolution which is double (or more) of the physical display resolution of your PPC device (in each direction). Then use the mean of four neighboring virtual pixels to compute the gray value of the physical display pixel. This should improve the legibility of small key legends as well. The arithmetic mean is probably not the best interpolation method, but this has to be tested.

Marcus

                              
Re: Emu48PPC display resolution
Message #6 Posted by Eric Smith on 29 Jan 2008, 6:47 p.m.,
in response to message #5 by Marcus von Cube, Germany

Interpolation is great for removing "jaggies" when you have enough pixels to work with, but when there aren't, it just results in a grey smear. That's what I think would happen in this case, though perhaps someone can prove me wrong.

                                    
Re: Emu48PPC display resolution
Message #7 Posted by Marcus von Cube, Germany on 30 Jan 2008, 5:38 a.m.,
in response to message #6 by Eric Smith

I tried it with the Gimp on my Mac:

I picked a screenshot of the undistorted display area and upscaled it by a factor of 3 whithout interpolation.

The left half of the picture shows the result after scaling the big picture down to 50% with linear interpolation, the right half without.

The left version is much easier to my eyes then the right one.

                                          
Re: Emu48PPC display resolution
Message #8 Posted by Christoph Giesselink on 30 Jan 2008, 4:43 p.m.,
in response to message #7 by Marcus von Cube, Germany

Looks very nice, but there's one big problem. The necessary command SetStretchBltMode() for BILINEAR stretching is added since Win CE5.0. So the also supported platforms "Pocket PC 2002" and "Windows Mobile 2003 (SE)" will not working any more. Only solution is making the linear interpolation by myself.

This isn't really a trivial task, so this is something for a much later version. But when somebody want to add this to Emu48PCC, the Emu48 sources are under the GPL and can be found on my homepage. :)

Christoph

                                                
Re: Emu48PPC display resolution
Message #9 Posted by Eric Smith on 30 Jan 2008, 5:52 p.m.,
in response to message #8 by Christoph Giesselink

Couldn't you just call SetStretchBltMode() only if the Wince version is 5 or newer?

                                                
Re: Emu48PPC display resolution
Message #10 Posted by Marcus von Cube, Germany on 31 Jan 2008, 3:02 a.m.,
in response to message #8 by Christoph Giesselink

A simple 3:2 interpolation scheme could be the following:

P0 | P1           Q0 |Q01| Q1
---+---  becomes  ---+---+---
P2 | P3           Q02|<Q>|Q13
                  ---+---+---
                  Q2 |Q23| Q3
Qi = Pi
Qij = (Pi+Pj)/2
<Q> = (P0+P1+P2+P3)/4
You get levels of 0, 25%, 50%, 75% and 100%.

This shouldn't be too hard to implement. It might be worth fiddeling with the true intensities but the simple approch will be a good starting point.

                                                      
Re: Emu48PPC display resolution
Message #11 Posted by Christoph Giesselink on 1 Feb 2008, 10:55 a.m.,
in response to message #10 by Marcus von Cube, Germany

Hello Marcus,

I think your solution

P0 | P1           Q0 |Q01| Q1
---+---  becomes  ---+---+---
P2 | P3           Q02|<Q>|Q13
                  ---+---+---
                  Q2 |Q23| Q3
Qi = Pi
Qij = (Pi+Pj)/2
<Q> = (P0+P1+P2+P3)/4

will generate IMHO a no satisfactory result.

Let's have look what happen with more than two pixels

P0 | P1 | P2 | P3           Q0 |Q01|Q1 |Q2 |Q23| Q3
---+----+----+---  becomes  ---+---+---+---+---+---
P4 | P5 | P6 | P7           Q04|<Q>|Q15|Q26|<Q>|Q37
                            ---+---+---+---+---+---
                            Q4 |Q45|Q5 |Q6 |Q67| Q7
Qi = Pi
Qij = (Pi+Pj)/2

There no transmission pixel between the Q1 and Q2 pixel. On the linear interpolation method P1 and P2 will be influenced by every neighbor with a resulting Q1' and Q2'.

Futhermore Emu48PPC use a more general approach with the two KML commands "Zoom" and "ZoomDiv". If I want to have a zoom factor for example of 1.75 the fraction is '7/4' resulting the "Zoom 7" and "ZoomDiv 4" settings.

Christoph

                                                            
Re: Emu48PPC display resolution
Message #12 Posted by Marcus von Cube, Germany on 1 Feb 2008, 12:11 p.m.,
in response to message #11 by Christoph Giesselink

Christoph, I don't think you want to interpolate each pixel! Think of an integer zoom factor: Each pixel depends on exactly one source pixel. This is the sharpest display you can get.

Regarding generic zoom and zoomdiv factors: This can be taken literally by the software: reserve a pixel area with dimensions multiplied by zoom and draw in this area without interpolation. Then scale down the result by zoomdiv and interpolate by averaging the pixel values in blocks of zoomdiv^2 pixels.

                                          
Re: Emu48PPC display resolution
Message #13 Posted by Eric Smith on 30 Jan 2008, 5:48 p.m.,
in response to message #7 by Marcus von Cube, Germany

I'm impressed. I didn't think it would look anywhere near that good.

Nonpareil already uses antialiasing for the display, but it doesn't yet simulate any models that use a dot matrix display, so I hadn't had occasion to try to do this.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall