Post Reply 
How do I create a Subroutine using System RPL?
09-30-2022, 06:53 PM
Post: #13
RE: How do I create a Subroutine using System RPL?
(09-30-2022 05:05 PM)wmundstock Wrote:  ...From documentation FlashMsg should display a message in the status area, it seems to clear that out but it does NOT display the message.

This does not work.
Code:
::
    "Hello World"
    FlashMsg
;
...
Not sure what could be wrong here. Any suggestion?

For someone just starting out with SysRPL, you are definitely getting a good start! Explorations like this one are common, as there are many situations like this where things seem different than you might expect.

You are on the right track, and using Nosy to check the workings of the command is (for me, at least) a common tactic when troubleshooting something broken that seems like it should be working.

I'll go out on a limb here and guess that you only tried the original program on an emulated calculator. If you had tried it on a real calculator, I believe you would find that it worked as expected. Looking at the internal code of the FlashMsg command provided the clue that was needed.

First: Save16Patch_ saves the top 16 rows of pixels as opposed to the entire display. You were definitely on the right track with that.

The FlashMsg command is actually working, but the "pause" section you identified is executing so quickly (unlike on a real calculator) that you simply don't see the string. Even 80 iterations of SLOW on an emulated calculator is soooooo fast that you never see the string before it is obliterated with Rest16Patch_. The reason is because the SLOW, VERYSLOW, and VERYVERYSLOW commands don't look at clock ticks, but rather perform a simple loop at the Saturn code level (the loop count varies depending on calculator model). The emulator steps through the loop much faster than a real calculator, even if set for "Authentic Calculator Speed".

There's no reason you would have known this kind of thing, but it's certainly part of the learning process for SysRPL development on emulated calculators based on Emu48. This is from the "Problems.txt" file which is included with Emu48:
Quote:- System-RPL commands VERYVERYSLOW, VERYSLOW and SLOW depends on PC speed (are realized as simple down counter in ROM)

I believe you identified the best course of action. This is simply a situation where you have to make choices depending on the intended platform for the final app. If you only need it working for an emulator, then you'll have to use some alternative for pausing.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How do I create a Subroutine using System RPL? - DavidM - 09-30-2022 06:53 PM



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