Register

[Solved]Detect Add-In Exiting and Loading

Discuss issues related to the Casio Prizm 3rd party development
Junior Member
Posts: 3
Joined: Thu May 15, 2014 7:53 pm
Calculators: Casio fx-CG20

[Solved]Detect Add-In Exiting and Loading

Postby merthsoft » Thu May 15, 2014 7:55 pm

Hello everyone, is there a way to detect that an addin is exiting and loading? For example, to save state? I want to be able to save and re-load the board in Minesweeper when the user exits/returns.

Senior Member
Posts: 68
Joined: Tue May 08, 2012 5:40 pm

Re: Detect Add-In Exiting and Loading

Postby happy » Fri May 16, 2014 8:25 am

Code: Select all
void quit()
   {
   //save game state
   }
   
int AddIn_main(int isAppli, unsigned short OptionNum)
   {
   //snip
   SetQuitHandler((void *) quit);
   //load game state
   //snip
   }


Addin "quits" when user presses [MENU] and enters another addin.

Junior Member
Posts: 3
Joined: Thu May 15, 2014 7:53 pm
Calculators: Casio fx-CG20

Re: Detect Add-In Exiting and Loading

Postby merthsoft » Fri May 16, 2014 2:53 pm

Is that a syscall? I don't see it documented in the SDK documentation I have (SuperH-based fx calculators (version 18)).

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: Detect Add-In Exiting and Loading

Postby SimonLothar » Sat May 17, 2014 8:07 am

merthsoft wrote:Is that a syscall? I don't see it documented in the SDK documentation I have (SuperH-based fx calculators (version 18)).
It is syscall 0x494 with fx-9860G-calculators. On fx-CG-calculators it is 0x1E6E. The latter I did not check yet. But do not use the name "CallbackAtQuitMainFunction", which I assigned to syscall 0x494. Use "SetQuitHandler" instead.

EDIT: I just checked 0x1E6E on one of my prizms and it looks as if it's working.
I'll be back!

Junior Member
Posts: 3
Joined: Thu May 15, 2014 7:53 pm
Calculators: Casio fx-CG20

Re: Detect Add-In Exiting and Loading

Postby merthsoft » Sat May 17, 2014 7:34 pm

Awesome, that worked! I've also uploaded the program to your archives:
Minesweeper 2.0
:)

Member
User avatar
Posts: 31
Joined: Wed Apr 18, 2012 4:48 pm

Re: Detect Add-In Exiting and Loading

Postby Cartix » Sun May 18, 2014 12:14 pm

Great, a new prizm add-in ;)
Image

Return to Casio Prizm SDK

Who is online

Users browsing this forum: No registered users and 4 guests