Why is the DM42's framerate so terrible?

This is where developers can exchange ideas and ask questions relevant to the DM42 firmware.

Please note that Swiss Micros staff are unable to provide answers here as a general rule. This is intended as a community-driven forum.
Post Reply
User avatar
dalremnei
Posts: 25
Joined: Thu Dec 10, 2020 11:32 am
Location: Scotland

Why is the DM42's framerate so terrible?

Post by dalremnei »

Not sure if this is the right subforum for this, but after watching a demonstration of Sharp memory LCD technology and finding out about the Panic Playdate, I knew that the DM42's sluggishness and low framerate were not an unavoidable fact of its display technology.

Is the DM42 just slow, or is there a way to possibly fix this through custom firmware? Because I'd gladly sacrifice battery life for a DM42 that maintained a similar framerate to the playdate.
SwissMicros DM42, DM16L, HP 12c Platinum, CASIO fx-9750gii, fx-991ex classwiz, CA-53W-1ER, TEXET fx1500, TI nspire CX II-T
DA74254
Posts: 82
Joined: Tue Oct 03, 2017 11:20 pm
Location: Norway/Latvia

Re: Why is the DM42's framerate so terrible?

Post by DA74254 »

The framerate specifically or the clock speed of the calc?
You can plug the DM42 to a computer or a power bank via USB to triple the clock speed (and probably the framerate, as I've never thought that a problem).
The small one-cell power banks are often giveaways at sales conventions or they cost less thsan €10,- at your nearest "cheap electro" store.
Esben
DM42 SN: 00245
User avatar
dalremnei
Posts: 25
Joined: Thu Dec 10, 2020 11:32 am
Location: Scotland

Re: Why is the DM42's framerate so terrible?

Post by dalremnei »

The framerate. I've noticed that when running programs that plot a lot of pixels to the screen, they appear in clumps at a very choppy framerate, and when the stack is visible while a program is running, it updates at a low framerate too.

Sometimes the low framerate is apparent when typing in numbers or pressing delete a lot.
SwissMicros DM42, DM16L, HP 12c Platinum, CASIO fx-9750gii, fx-991ex classwiz, CA-53W-1ER, TEXET fx1500, TI nspire CX II-T
Thomas Okken
Posts: 949
Joined: Tue May 02, 2017 5:48 pm
Location: United States → Netherlands
Contact:

Re: Why is the DM42's framerate so terrible?

Post by Thomas Okken »

The DM42 updates the display constantly (at least while running programs), unlike Free42 which only updates the display on VIEW, AVIEW, PIXEL, etc. You can tell the difference when you run something like CLLCD LBL 00 1 + GTO 00, which doesn't update the display at all while the program is running in Free42 or on the HP-42S, but does update the display on the DM42.

In order to prevent the constant display updates from monopolizing the CPU, they have to keep the rate at which these updates happen low. It would be better if the system were to update the display only when needed, possibly with a limit on the update frequency in order to prevent it from wasting CPU cycles updating the display faster than the human eye can follow.
Florian
Posts: 12
Joined: Mon Apr 26, 2021 1:19 pm
Location: Japan

Re: Why is the DM42's framerate so terrible?

Post by Florian »

I am not really sure whether this is really going into the direction of your question/interest, but have you taken a look at the DM42 user manual?

Section 3.1.1. explains the RefLCD virtual variable in good detail. This variable allows you to control which parts of the screen are refreshed and when. It also seems to be possible to programmatically force a (partial) refresh of the screen by setting negative variable values. So this might be a possibility to make the screen more responsive according to your needs.

Cheers
Florian
grsbanks
Posts: 1121
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Why is the DM42's framerate so terrible?

Post by grsbanks »

The "framerate" of the DM42 is low because it's a calculator, not a video playback device.

With the LCD of the DM42 being much larger than that of the HP-42S, the CPU would be spending most of its time redrawing the LCD after each operation if we wanted things to be updated in real time, and since the purpose of a programmable calculator is mainly to crunch numbers and run programs, we thought it would be better if we let the CPU get on with precisely that instead of updating the LCD all the time. To that effect, the LCD is redrawn every 200ms if memory serves.

If you need to squeeze more processing power out of the CPU then you can turn off LCD updates altogether (or only allow updates of specific areas), and if you need your program to redraw the LCD "now" then you can do that too. Deactivating screen updates, only allowing parts to update and ad-hoc updates are described in the relevant chapter of the user manual:

https://technical.swissmicros.com/dm42/ ... _variables
There are only 10 kinds of people in the world: those who understand binary and those who do not.
User avatar
dalremnei
Posts: 25
Joined: Thu Dec 10, 2020 11:32 am
Location: Scotland

Re: Why is the DM42's framerate so terrible?

Post by dalremnei »

So I've tried the setting RefLCD to -1 trick and was impressed by how quickly the CPU can redraw the display. Would changing the 200ms timeout to, say, 20ms be a quick and easy change to integrate into custom firmware, or even provide a setting allowing the user to choose their timeout?

I understand that because it's a calculator that a high refresh rate is not necessary for its operation, but neither is off images or seeing the whole stack. It's something I'd prefer just for aesthetic reasons.
SwissMicros DM42, DM16L, HP 12c Platinum, CASIO fx-9750gii, fx-991ex classwiz, CA-53W-1ER, TEXET fx1500, TI nspire CX II-T
Post Reply