Scaling in Win32 simulation for 320x480 instead of 320x240

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Scaling in Win32 simulation for 320x480 instead of 320x240

      Hi !

      I would like to change the resolution and scaling in y-direction, but it does not work.
      My GUI works fine in 320x240 (on native display hardware and in Win32, aspect ratio 4:3). I changed the hardware display to a high-DPI 320x480 type display, so we have a double y-resolution, but the same aspect ratio. The simulation shows real pixels 320x480 (1:1) - stretching in y, the display itself shows the aspect ratio according to the double density pixels, which is the same as in a 320x240 pixel display.
      Is there an option to scale the Win32 in y direction according to the real look and feel of the display? (same display representation/aspect ratio). Or is there a workaround for that?

      Is it possible to keep the 320x240 setting and scale it or magnify it for the 320x480 view (keep on working on 320x240 but compile for 320x480)? The WIN32 simulation does not know a half pixel width, only double.
      I also get in trouble with fonts. The representation should be 1:2, then. Magnification in y direction also increases the data size. Is it possible to do that on the fly (use the 320x240 font representation with scaling)?

      Best regards,

      HaJo
    • Found the solution!

      Setting XSIZE_PHYS 320 and YSIZE_PHYS to 480 instead of 240...

      SIM_GUI_SetMag(2,1); to double the x-resolution for the simulation (because 0.5 in y is not possible). X and Y have correct ratio on PC screen in frame.

      Change device.bmp where the GUISimulationDebug.exe resides to 640x480 (not 320x480!). Now the simulation shows the correct aspect ratio (double pixel size is OK).
      It does not work without device.bmp, since the black standard frame does not scale automatically, which was the main problem...

      I can use all my old bitmaps for 320x240 version just with GUI_DrawBitmapMag ((void*)PIC,x,y,1,2); Magnification x2 in y direction.
      I just had to generate new font files with magnification 2 and I have to change some y-coordinates or spacing and I am done.

      I also added a black canvas to the blank device.bmp and added SIM_GUI_SetLCDPos(5,5) to see a border around the final screen area.

      HaJo