Register

[SOLVED] How to make own G1A run in SDK?

Discuss issues related to the fx-9860G Software Development Kit
Junior Member
User avatar
Posts: 7
Joined: Sat Sep 07, 2013 1:51 am
Location: The Land Down Under
Calculators: Casio fx-9860G AU PLUS

[SOLVED] How to make own G1A run in SDK?

Postby RunasSudo » Sun Sep 08, 2013 1:40 am

Background Information:
I am running Ubuntu Linux 12.04.2 amd64, running the Casio fx-9860G SDK under WINE/PlayOnLinux. I am compiling my programs using the method described on the UsingGCC page on the fxSDK wiki (I compiled my own sh3eb-elf-gcc).

I have written my own program to create G1A files based on the documentation in fxReverse2x.pdf in fx_calculators_SuperH_based_18.zip, the reason being that g1awrapper produced G1A files that were completely screwed up that the SDK emulator refused to load.

Here is the G1A file produced by int main(){return 1;}.

I am loading the G1A files into the emulator by copying my G1A files (actually symlinking, but same thing) into the SDCard directory of a random project, then loading it onto the storage memory through the MEMORY application. The application shows correctly on the menu screen, icon and all.

Problem:
The problem I am having is that when attempting to open the application, I get the ‘This Application is not available on the emulator.’ message. Other programs that I load on, such as Insight, do not show this error and open correctly.

What is the cause of this error, and how can I get my G1As to load correctly in the SDK emulator?
Last edited by RunasSudo on Mon Sep 09, 2013 8:26 am, edited 2 times in total.

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

Re: How to make own G1A run in SDK?

Postby SimonLothar » Sun Sep 08, 2013 8:37 am

RunasSudo wrote:The problem I am having is that when attempting to open the application, I get the ‘This Application is not available on the emulator.’ message. Other programs that I load on, such as Insight, do not show this error and open correctly.
I could reproduce this behaviour. Very interesting.

RunasSudo wrote:What is the cause of this error, and how can I get my G1As to load correctly in the SDK emulator?
Travel light. Let's hunt some bug...
I'll be back!

Junior Member
User avatar
Posts: 7
Joined: Sat Sep 07, 2013 1:51 am
Location: The Land Down Under
Calculators: Casio fx-9860G AU PLUS

Re: How to make own G1A run in SDK?

Postby RunasSudo » Sun Sep 08, 2013 9:17 am

I'm stumped. I can't see any differences in the headers of the two apart from title, filesize, etc.

EDIT: I stripped the header from INSIGHT.G1A and ran it through my G1A maker and it loads correctly. Something could be wrong with the way I'm compiling my programs, or with the programs themselves… I'm following the instructions here.
Last edited by RunasSudo on Sun Sep 08, 2013 9:31 am, edited 1 time in total.

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

Re: How to make own G1A run in SDK?

Postby SimonLothar » Sun Sep 08, 2013 9:27 am

Stay put. I think the problem is connected with byte 0x16 and 0x17 of the header. Some control bytes, which seem to be heeded for with the emulator, but not on the calculator. The moment I change either of these bytes, the "Application is not available on the emulator"-thing appears.
I'll be back!

Junior Member
User avatar
Posts: 7
Joined: Sat Sep 07, 2013 1:51 am
Location: The Land Down Under
Calculators: Casio fx-9860G AU PLUS

Re: How to make own G1A run in SDK?

Postby RunasSudo » Sun Sep 08, 2013 9:33 am

SimonLothar wrote:Stay put. I think the problem is connected with byte 0x16 and 0x17 of the header. Some control bytes, which seem to be heeded for with the emulator, but not on the calculator. The moment I change either of these bytes, the "Application is not available on the emulator"-thing appears.

I noticed when I was writing my program that those two bytes were different for some programs. I just decided to use the one from Insight; perhaps that's why my g1a generator works for Insight, but not for anything else?

EDIT: I just checked, the G1A files generated by the SDK have these two bits set, with different values than Insight. It could be a hash/checksum of some sort… Anyone here a cryptography expert?

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

Re: How to make own G1A run in SDK?

Postby SimonLothar » Sun Sep 08, 2013 4:38 pm

They tried to be smart. Alas, in vain...
The word at 0x16 is the inverted word sum of 8 words starting at 0x300.
This would be 0xD7A5 for your NULL.G1A.

BTW: with the fxCG (G3A) it is the inverted word sum of 8 words starting at 0x7100.
I'll be back!

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

Re: How to make own G1A run in SDK?

Postby gbl08ma » Sun Sep 08, 2013 10:28 pm

The checksums on the add-in headers are actually very useful to check that an add-in did not get corrupt in the transfer. That way we avoid problems because of broken files, they simply won't run. The trick is knowing how to calculate the checksum :)

Junior Member
User avatar
Posts: 7
Joined: Sat Sep 07, 2013 1:51 am
Location: The Land Down Under
Calculators: Casio fx-9860G AU PLUS

Re: How to make own G1A run in SDK?

Postby RunasSudo » Mon Sep 09, 2013 8:00 am

Whoo (number 1)!
It worked! Another detail to add to fx_calculators_SuperH_based.chm?

Whoo (number 2)!
My program didn't crash! I have successfully created a ‘miniSDK’ for the fx-9860G! Tappity tap, time to write instructions…

Un-Whoo…
xfer9860 is not working. Dammit. New thread-y time.
Last edited by RunasSudo on Mon Sep 09, 2013 8:26 am, edited 1 time in total.

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

Re: How to make own G1A run in SDK?

Postby SimonLothar » Mon Sep 09, 2013 8:20 am

RunasSudo wrote:Another detail to add to fx_calculators_SuperH_based.chm?
You bet!
I'll be back!

Senior Member
User avatar
Posts: 113
Joined: Sun Dec 16, 2012 2:59 pm
Calculators: None

Re: [SOLVED] How to make own G1A run in SDK?

Postby Casimo » Sat Sep 21, 2013 11:16 am

I don't know whether it's interesting for you, but the "locked" applications in the emulator can be started with system calls.
Image

Next

Return to Casio fx-9860 SDK

Who is online

Users browsing this forum: No registered users and 4 guests