Register

How to detect if running as strip

Discuss issues related to the Casio Prizm 3rd party development
Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

How to detect if running as strip

Postby gbl08ma » Wed Aug 13, 2014 9:57 pm

I have made some add-ins that can act as eActivity strips.
How can I detect whether the add-in is running as a strip? The fx-9860G SDK puts this information as arguments to main(), I would like to read the same values on the fx-CG 20 (are they really arguments put on the stack/registers when the add-in is loaded, or is the AddIn_main() of the fx-9860G SDK just a convenient pseudo-main with a wrapper around it?).
Right now I'm looking at the status area color to see whether it is green or not, but this doesn't work if the status area is not shown, or if the status area color for add-ins is changed in a later OS version...

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: How to detect if running as strip

Postby SimonLothar » Sat Aug 16, 2014 10:45 am

If I run INSIGHT from out of an EACT-strip, there are three variables (EACT1, EDIT_PAC and PACKDUMY) in the main memory directory @EACT.
If I run INSIGHT from out of the MAIN MENU, the main memory directory @EACT is empty.

You could check this out with syscall 0x1519 (MCS_SearchDirectoryItem), the interface of which is identical to the one of the fx-9860 syscall 0x376.
Code: Select all
int dummy;
if ( MCS_SearchDirectoryItem( "@EACT", "EACT1", &dummy, &dummy, &dummy, &dummy ) == 0){
  // EACT is currently running
  ...
};

I hope this will solve your problem.
I'll be back!

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: How to detect if running as strip

Postby gbl08ma » Wed Aug 20, 2014 1:26 pm

Thank you. It had not occurred to me that there could be different MCS files when running in a strip.

This brings the amount of ways to detect if running as strip to three:
- Checking whether the first pixel of the status area (and thus, first pixel of the screen) is green (a bit hackish, requires that the status area be shown and that its colors are not redefined);
- Checking if the total size of the main memory is much lower than 64048 bytes (the MCS available to strips is reduced to the amount of free space in the eActivity document, never above about 28 KB);
- Checking for the presence of the EACT1, EDIT_PAC and PACKDUMY files in the MCS folder @EACT.

I have decided to detect whether the add-in is running in a strip this way: https://github.com/gbl08ma/eigenmath/bl ... n.cpp#L564

Return to Casio Prizm SDK

Who is online

Users browsing this forum: No registered users and 18 guests