Post Reply 
How do I create a Subroutine using System RPL?
09-30-2022, 08:03 PM
Post: #14
RE: How do I create a Subroutine using System RPL?
(09-30-2022 06:53 PM)DavidM Wrote:  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.

Thank you! It helps to know at least I was in the right path. I was using Nosy as per your earlier suggestion. Took me a little while to understand how it works but it is a great tool for learning.

(09-30-2022 06:53 PM)DavidM Wrote:  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.

Amazing! You guessed right and I was just trying it in the emulator.
It would probably take me some time to realize that! Interestingly there is a checkbox in the emulator that says "Authentic Calculator Speed" which is checked, but don't seem to have an effect on these particular commands.

I did try to use Nosy to see what's in the SLOW command, but it got down to assembly level. It seems like a loop of some sort, but I cannot follow that execution. I think that is too far for me for the time being. I found another document about the saturn assembly but I think I have to spend more time on System RPL level...
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? - wmundstock - 09-30-2022 08:03 PM



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