fx-9860G/GII detect the MAIN MENU (C)

Learn how to program. Code snippets for creating sprites etc. Submit your own or use those of others.
Senior Member
User avatar
Posts: 603
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

fx-9860G/GII detect the MAIN MENU (C)

Postby SimonLothar » Tue May 01, 2012 8:44 pm

Purobaz asked:
when using a persitent timer on a fx-9860G/GII, how can we detect, whether the MAIN MENU or some Addin/BuildIn is on top, inside of the timer handler.

A fitting syscall has not been found to achieve this.
But the following code finds the address of a certain system variable, which gives the answer.
This should be OS-independent.

Code: Select all
unsigned int ea;
unsigned int j;
ea = *(unsigned int*)0x8001007C;
ea += 0x0490*4;
ea = *(unsigned int*)( ea );
j = *(unsigned char*)( ea + 1 );
j *= 4;
j = ( ea + j + 4 ) & 0xFFFFFFFC;
j = *(unsigned int*)( j ) + 1;

return *(unsigned char*)j;

returns 3 if the MAIN MENU is active
else 0

Purobaz verified this within a timer.

The scheme should work with interrupt handlers as well.
I'll be back!

Return to Tutorials & Code Snippets

Who is online

Users browsing this forum: No registered users and 4 guests