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: 43
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, Prime G2 CASIO fx-9750gii, fx-991ex classwiz, fx-CG50, TEXET fx1500, TI nspire CX II-T
DA74254
Posts: 193
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, WP43 Pilot SN:00002, DM32 SN: 00045 (Listed in obtained order).
User avatar
dalremnei
Posts: 43
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, Prime G2 CASIO fx-9750gii, fx-991ex classwiz, fx-CG50, TEXET fx1500, TI nspire CX II-T
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: 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: 23
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: 1122
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: 43
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, Prime G2 CASIO fx-9750gii, fx-991ex classwiz, fx-CG50, TEXET fx1500, TI nspire CX II-T
jwiede
Posts: 44
Joined: Mon Oct 18, 2021 11:17 pm
Location: San Jose, CA USA

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

Post by jwiede »

Just remember that high refresh rate == high power consumption.
DM42, DM16L, and a menagerie of HPs thanks to CAS (Calc Acq Syndrome)!
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

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

Post by rprosperi »

dalremnei wrote:
Tue Aug 10, 2021 7:56 pm
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.
If you are requesting a customized version of the DMCP OS, then the answer is no. If this setting is available with the current DMCP APIs then maybe one of the custom developers here would entertain helping you out, but as warned above, such a change would have a large impact on battery life, so likely not worthwhile, but only you can decide about the cost of such a hack.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Post Reply