Post Reply 
[50G] Question
04-23-2015, 02:15 AM
Post: #61
RE: [50G] Question
(04-21-2015 08:37 PM)Tugdual Wrote:  
(04-21-2015 08:32 PM)Voldemar Wrote:  You can erase L226, L227 and L229. In this way you will lose the equation libraries and periodic table. To restore these files, you will need to reflash the ROM.

Thanks Voldemar.
To my second question, I found the beginning of an answer. After warm reset, the 50g is evaluating 'STARTUP'. So I created a small RPL ':2:Settings' that sets defaults things such as KEYTIME. Then I created 'STARTUP' in Home that evaluates ':2:Settings'.
Works quite nicely except for the contrast that I cannot tune manually yet.

Edit:Also found trhis: http://www.hpcalc.org/details.php?id=3384 but still doesn't address contrast.

The Equation Library & Periodic Table Library are available separately in this zip file containing the 2.15 update. You don't need to reflash the ROM just for those libraries.

As you have already determined, creating a STARTUP program object allows you to run your own RPL code after a system warmstart. You're probably already aware of this, but just as a reminder you can set quite a few mode settings simultaneously by storing binary strings into the system flags (see the documentation for RCLF/STOF). While this is quick and concise, for this kind of application I still prefer to do individual changes in setup programs so that it's easier to modify them later.

Changing the contrast via a program is a more interesting topic. While this was fairly straightforward to do on the pre-ARM 48/49 systems using native Saturn code, it seems that there were some changes made to how this works on the ARM-based 49g+/50g; most (if not all) of the older apps that did this didn't work properly on the ARM systems. It seems that it should be possible, and indeed at least one older 49g program I've tested seems to adjust the contrast on my 50g. It doesn't support a non-interactive setting, however. It also wasn't designed for the larger display area of the 49g+/50g, but that's a different issue.

So it appears that it should be possible to set the contrast via Saturn code, though I'm not aware of any current apps that allow you to pass a stack-based parameter for the target. Anyone else aware of something that will do this on a 50g?
Find all posts by this user
Quote this message in a reply
05-01-2015, 05:09 PM (This post was last modified: 05-01-2015 05:10 PM by Tugdual.)
Post: #62
RE: [50G] Question
Just found that the 50g doesn't seem to know the equivalence in between complex exponential and sin/cos. For example the following equation doesn't evaluate to zero.
$$cos(x)+i.\sin { \left( x \right) } -{ e }^{ i.x }$$

Is there a special setting to define that? I find that disturbing to say the less...
Find all posts by this user
Quote this message in a reply
05-01-2015, 05:29 PM (This post was last modified: 05-01-2015 05:38 PM by Gilles.)
Post: #63
RE: [50G] Question
(05-01-2015 05:09 PM)Tugdual Wrote:  Just found that the 50g doesn't seem to know the equivalence in between complex exponential and sin/cos. For example the following equation doesn't evaluate to zero.
$$cos(x)+i.\sin { \left( x \right) } -{ e }^{ i.x }$$

Is there a special setting to define that? I find that disturbing to say the less...


Hi, you can do :

$$cos(x)+i.\sin { \left( x \right) } -{ e }^{ i.x }$$

LIN : RShift ALG = Linearize expression involving exponential terms
-> 0

or

EXPLN EVAL
-> 0

EXPLN : LShift EXP&LN = Transform trigonometric term to exponential and logarithm
Find all posts by this user
Quote this message in a reply
05-01-2015, 06:41 PM
Post: #64
RE: [50G] Question
(05-01-2015 05:29 PM)Gilles Wrote:  
(05-01-2015 05:09 PM)Tugdual Wrote:  Just found that the 50g doesn't seem to know the equivalence in between complex exponential and sin/cos. For example the following equation doesn't evaluate to zero.
$$cos(x)+i.\sin { \left( x \right) } -{ e }^{ i.x }$$

Is there a special setting to define that? I find that disturbing to say the less...


Hi, you can do :

$$cos(x)+i.\sin { \left( x \right) } -{ e }^{ i.x }$$

LIN : RShift ALG = Linearize expression involving exponential terms
-> 0

or

EXPLN EVAL
-> 0

EXPLN : LShift EXP&LN = Transform trigonometric term to exponential and logarithm
Thanks Gilles. Just found the SINCOS function that does all the magic...
It is not documented in the user guide, only in the advanced user guide.

Anyway the two functions to remember are EXPLN and SINCOS.
Find all posts by this user
Quote this message in a reply
05-03-2015, 12:50 AM
Post: #65
RE: [50G] Question
(04-23-2015 02:15 AM)DavidM Wrote:  So it appears that it should be possible to set the contrast via Saturn code, though I'm not aware of any current apps that allow you to pass a stack-based parameter for the target. Anyone else aware of something that will do this on a 50g?

A late reply, but it should be trivial to write a C program to take a number from the stack and call lcd_setcontrast(). Using hpgcc 2.0 or hpgcc3 this is very reliable on all ARM machines.
Find all posts by this user
Quote this message in a reply
05-03-2015, 08:10 AM
Post: #66
RE: [50G] Question
(04-23-2015 02:15 AM)DavidM Wrote:  So it appears that it should be possible to set the contrast via Saturn code, though I'm not aware of any current apps that allow you to pass a stack-based parameter for the target. Anyone else aware of something that will do this on a 50g?

Does this attached program of mine work for you?

Put the number from 0 (lowest contrast) to 31 (highest contrast) on the stack and execute CTR49 ...


Attached File(s)
.zip  CTR49.ZIP (Size: 386 bytes / Downloads: 22)

https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
05-03-2015, 08:49 AM (This post was last modified: 05-03-2015 08:52 AM by Gerald H.)
Post: #67
RE: [50G] Question
Works good on 49G versions 1.19-6 & 2.10-7, also on 50G 2.10-7.

By the way, were you, HrastProgrammer, the source of the XTABLE that has entries Z1_ & similar?
Find all posts by this user
Quote this message in a reply
05-03-2015, 09:25 AM
Post: #68
RE: [50G] Question
(05-03-2015 08:49 AM)Gerald H Wrote:  By the way, were you, HrastProgrammer, the source of the XTABLE that has entries Z1_ & similar?

No, I am not. Which library is that?

BTW, I updated CTR49 so it now limits the argument to 0..31 because the initial version just took the lowest 5 bits of the argument.

https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
05-03-2015, 09:30 AM (This post was last modified: 05-03-2015 09:37 AM by Tugdual.)
Post: #69
RE: [50G] Question
(05-03-2015 08:10 AM)HrastProgrammer Wrote:  
(04-23-2015 02:15 AM)DavidM Wrote:  So it appears that it should be possible to set the contrast via Saturn code, though I'm not aware of any current apps that allow you to pass a stack-based parameter for the target. Anyone else aware of something that will do this on a 50g?

Does this attached program of mine work for you?

Put the number from 0 (lowest contrast) to 31 (highest contrast) on the stack and execute CTR49 ...
Thanks, this is nice!
Does work on my 50g above limits of system!
Looks like ON+/- doesn't have the full range fo values Smile
BTW, wouldn't it totally make sense top have the "getContrast" counterpart?

Off topic edit: just found that you were doing music. Oh wow must give a try to that tranzistow!!
Find all posts by this user
Quote this message in a reply
05-03-2015, 09:51 AM (This post was last modified: 05-03-2015 09:53 AM by Gerald H.)
Post: #70
RE: [50G] Question
(05-03-2015 09:25 AM)HrastProgrammer Wrote:  
(05-03-2015 08:49 AM)Gerald H Wrote:  By the way, were you, HrastProgrammer, the source of the XTABLE that has entries Z1_ & similar?

No, I am not. Which library is that?

BTW, I updated CTR49 so it now limits the argument to 0..31 because the initial version just took the lowest 5 bits of the argument.

Library 258, extable (possibly known as extable2).
Find all posts by this user
Quote this message in a reply
05-03-2015, 10:25 AM
Post: #71
RE: [50G] Question
(05-03-2015 09:30 AM)Tugdual Wrote:  Thanks, this is nice!
Does work on my 50g above limits of system!
Looks like ON+/- doesn't have the full range fo values Smile
BTW, wouldn't it totally make sense top have the "getContrast" counterpart?

Updated. CTR49 will now return the current contrast as well and won't change it if argument >31 has been provided so you can, for example, use 32 CTR49 just to retrieve the contrast. BTW, I have to correct myself here: negative values will default to zero contrast.

Strictly speaking, this should be put into library but I don't have time to do this at the moment as I am trying to finish the manual for my HRAST BASIC I am about to release.

Quote:Off topic edit: just found that you were doing music. Oh wow must give a try to that tranzistow!!

Yes, I was a lot into Electronic Music and Digital Signal Processing during the last couple of years. That's the reason why, until recently, I wasn't a lot into calculators since 2008.

Tranzistow is the culmination of my DSP work, this is my ultimate software synthesizer which has everything I wanted and needed as far as sound synthesis is concerned. I even developed additive and FM synthesis engine which runs on a GPU in parallel with the main engine running on the CPU Smile

https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
05-03-2015, 10:55 AM
Post: #72
RE: [50G] Question
(05-03-2015 09:51 AM)Gerald H Wrote:  Library 258, extable (possibly known as extable2).

Ah, me blind ...

https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
05-03-2015, 04:17 PM
Post: #73
RE: [50G] Question
(05-03-2015 08:10 AM)HrastProgrammer Wrote:  Does this attached program of mine work for you?

Put the number from 0 (lowest contrast) to 31 (highest contrast) on the stack and execute CTR49 ...

Works well! Did you create this with hpgcc2? Just curious which approach you took.

Thanks!
Find all posts by this user
Quote this message in a reply
05-03-2015, 05:07 PM
Post: #74
RE: [50G] Question
As it works on the 49G I guess not.
Find all posts by this user
Quote this message in a reply
05-03-2015, 05:14 PM
Post: #75
RE: [50G] Question
(05-03-2015 04:17 PM)DavidM Wrote:  Works well! Did you create this with hpgcc2? Just curious which approach you took.

No, I am enjoying pure Saturn machine language programming (with some SysRPL where needed) very much for almost 20 years Smile

https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
05-03-2015, 06:00 PM
Post: #76
RE: [50G] Question
(05-03-2015 05:14 PM)HrastProgrammer Wrote:  
(05-03-2015 04:17 PM)DavidM Wrote:  Works well! Did you create this with hpgcc2? Just curious which approach you took.

No, I am enjoying pure Saturn machine language programming (with some SysRPL where needed) very much for almost 20 years Smile

Father, forgive them, for they do not know what they are saying.
Big Grin Big Grin Big Grin Big Grin Big Grin

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
05-03-2015, 06:17 PM
Post: #77
RE: [50G] Question
(05-03-2015 05:07 PM)Gerald H Wrote:  As it works on the 49G I guess not.

Good point! I didn't catch that the first time around.

(05-03-2015 05:14 PM)HrastProgrammer Wrote:  No, I am enjoying pure Saturn machine language programming (with some SysRPL where needed) very much for almost 20 years Smile

Any chance you'd be willing to share your source code for this? I'd like to compare this with the earlier versions of Saturn code I've seen (which don't work on the Saturnators).

(05-03-2015 06:00 PM)Massimo Gnerucci Wrote:  Father, forgive them, for they do not know what they are saying.
Big Grin Big Grin Big Grin Big Grin Big Grin

Mea culpa! Confused I'm just happy to see that there are still a few folks left doing Saturn coding for this platform.
Find all posts by this user
Quote this message in a reply
05-03-2015, 06:30 PM
Post: #78
RE: [50G] Question
(05-03-2015 06:17 PM)DavidM Wrote:  Mea culpa! :S I'm just happy to see that there are still a few folks left doing Saturn coding for this platform.

:)

Let me only say that Hrast's creations are pure genius.

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
05-03-2015, 06:38 PM (This post was last modified: 05-03-2015 06:55 PM by HrastProgrammer.)
Post: #79
RE: [50G] Question
(05-03-2015 06:17 PM)DavidM Wrote:  Any chance you'd be willing to share your source code for this? I'd like to compare this with the earlier versions of Saturn code I've seen (which don't work on the Saturnators).

No problem, here it is:

Code:


        IFNDEF HP49G
        NIBASC \HPHP48-R\
        ELSE
        NIBASC \HPHP49-B\
        ENDIF

        CON(5) =DOCOL
        CON(5) =DOCODE
        REL(5) ~CNTRST
        A=PC
        D0=A
        D0=D0+ 16
        A=DAT0 A
        D0=D0+ 5
        PC=(A)
        CON(5) =DOCOL
        CON(5) =CK1NOLASTWD
        CON(5) =CKREAL
        CON(5) =COERCE
        CON(5) =DOCODE
        REL(5) ~CODE
        A=DAT1 A
        D1=D1+ 5
        D=D+1 A
        GOSBVL =SAVPTR
        D0=A
        D0=D0+ 5
        A=DAT0 A
        D0=(5) #00101
        C=0 A
        C=DAT0 B
        R0=C
        LC(2) #1F
        ?A>C A
        GOYES +
        DAT0=A B
+       GOVLNG =PUSH#LOOP

~CODE   CON(5) =SEMI
        CON(5) =UNCOERCE
~CNTRST CON(5) =SEMI

https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
05-03-2015, 06:39 PM
Post: #80
RE: [50G] Question
(05-03-2015 06:00 PM)Massimo Gnerucci Wrote:  Father, forgive them, for they do not know what they are saying.
Big Grin Big Grin Big Grin Big Grin Big Grin

Big Grin Big Grin Big Grin Big Grin Big Grin

https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 9 Guest(s)