Calculator Community > HP Calculators

HP 39gII BASIC(?) speed testing

(1/4) > >>

DJ Omnimaga:

--- Code: ---EXPORT Test()
BEGIN
0->A
WHILE 1 DO
A+1->A;
TEXTOUT(A,1,1,2,0,65,2); // str/var,Y,X,FontSize,Color1,Width,BackgroundColor (0=black, 1=dark gray, 2=light gray, 3=white, transparent bg if not setup)
TEXTOUT(A,2,1,2,0);
TEXTOUT(A,3,1,2,3);
TEXTOUT(A,4,1,2,3);
END;
END;
--- End code ---

Result: Bold text counter with a shadow behind. In 1 second, I can reach 150! This might look a bit slow, but I used 4 text commands per loop and 3 shades of gray (For some reason the speed seems to get faster sometimes, so much that I reached 400 once)

Also fun fact: The calculator language has rectangle commands, filled, not filled and inverted.


--- Code: ---EXPORT Test()
BEGIN
0->A
WHILE 1 DO
A+1->A;
INVERT(); (no arguments inverts the entire screen by default. Light gray pixels becomes dark gray or vice-versa)
TEXTOUT(A,1,1,2,0,65,2);
TEXTOUT(A,2,1,2,0);
TEXTOUT(A,3,1,2,3);
TEXTOUT(A,4,1,2,3);
END;
END;
--- End code ---

This time, I get 30 frames per second! However, it seems that the LCD is unable to keep up being updated in its entirety at such speed, so there's a lot of frame skipping and tearing (at least it doesn't appear to bottleneck program execution, though)

As a result of the slow LCD, I was unable to check how fast INVERT() alone in a loop was, since it just took like 4 seconds to update at such speed (with some static appearing at times as it inverted gradually)


Now for regular text:


--- Code: ---EXPORT Test()
BEGIN
0->A
WHILE 1 DO
A+1->A;
TEXTOUT(A,1,1,2,0,65,2);
END;
END;
--- End code ---

500 in 1 second. Frame skipping appears to occur, though. This tells me that if a game happens to run incredibly fast, it might need to be adapted so that it looks nice at lower framerate.


Now for the following code:


--- Code: ---EXPORT TF()
BEGIN
FOR A FROM 0 TO 99999 DO
END;
END;
--- End code ---

Executes in 4 seconds.


Have you taken note, TI? :P

Lionel Debroux:
Heh :)

totoyo:

--- Quote ---Have you taken note, TI?  :P
--- End quote ---
And Casio too  ;D

DJ Omnimaga:
Yeah too.

The only disappointment, though, is:

-Lots of bugs and crashes (had to pull all batteries a few times, although that didn't cause much data damage)
-Being forced to add ; after every line of code can get annoying at times, especially considering you need to press shift everytime
-You need to have the exact same firmware as the calc emu to send programs (and the latest firmwares for both aren't in sync), so basically I am unable to transfer files (although the connectivity kit lets me edit code, so I can copy it easily on the computer)
-There are barely any instructions about sending stuff, nor for the calc maintenance (for example, it isn't told anywhere how to use the flash memory).
-The lower the batteries, the slower the calc gets. This can be problematic for game programming, since nobody got the same battery level. It seems we can change this via the maintenance menu (ON+F4), but then it gets slower again and again so you have to constantly change it back to Full :X .
-The latest firmware I just got appears a bit slower in general.


The funny thing, though, is that despite running at 20 MHz, my Tunnel program actually runs faster than if an equivalent was done in TI-BASIC (in HP's case it is helped a lot by rectangle commands) or Casio BASIC.

This calc can be interesting for programming purposes and has some potential, but I would wait before buying it because it's not fully mature yet. IIRC it was released in China in 2012 before being released here and it's like if it was still in beta stages. If HP gets their act together maybe it could become great, otherwise it probably won't have a very bright future.

TravisE:
Interesting. I take it the 39gII is a recently released calc model? And it appears to support grayscale directly in the user programming language? That sounds pretty cool.

The HP 50g is rather weird—there is SysRPL (no UserRPL) support for manipulating grayscale graphics, but none for actually displaying them—they apparently leave that up to third-party libraries. Go figure. :P Actually, though, there was a grayscale Easter egg on some ROM versions, and I sometimes see gray pixels when I crash it with bad SysRPL code… I've never really explored grayscale on the 50g yet, so I don't know.

Navigation

[0] Message Index

[#] Next page

Go to full version