Register

FX-9860 GII system error when launching G1As

Discuss anything related to calculators. For specific help on certain games/programs check the Released Projects subforum.
Junior Member
Posts: 4
Joined: Sun Mar 12, 2017 12:19 am
Calculators: Casio fx-9860GII

FX-9860 GII system error when launching G1As

Postby wisemoth » Sun Mar 12, 2017 12:25 am

Hello

I've just got a new fx-9860 GII, running OS 02.09.0201. I've got a few G1As that are running OK in the emulator (eg Gravity Duck, and Periodic Table) but fail to start when I've sent them over FA-124. Each appears with their correct icon in the menu, but when I launch them I get "System ERROR". I've also got FTune, and that actually works fine on the calculator.

I'm I doing something wrong?

Thanks for any advice!

Junior Member
Posts: 4
Joined: Sun Mar 12, 2017 12:19 am
Calculators: Casio fx-9860GII

Re: FX-9860 GII system error when launching G1As

Postby wisemoth » Sun Mar 12, 2017 12:46 am

I should say my current guess is that it relates to the GII being an SH4 processor and the failing apps may have been coded for the original G/SH3 ?

I'd also rebuilt locally the Gravity Duck from source, which still fails. I suppose the new OS requires source changes rather than just a binary rebuild (changed syscalls ?) ?

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: FX-9860 GII system error when launching G1As

Postby SimonLothar » Sun Mar 12, 2017 11:34 am

Yes. There are a few syscalls, which are no longer supported with newer OSes (f. i. MMU syscalls).
Syscall 0x42E (Bfile_GetMediaFree_OS) is sometimes the reason for problems.
Some older addins bypass syscalls. The use of absolute addresses or direct register accesses usually leads to incompatible programs someday.

You have to inspect the source to find the problem.
Modify the source to encircle the cause of the error.

In Gravity Duck I suspect

unsigned char key_down(unsigned char code)

in key.c. It uses register addresses, which are not compatible with the SH7305.
I'll be back!

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: FX-9860 GII system error when launching G1As

Postby SimonLothar » Sun Mar 12, 2017 1:34 pm

Another issue in Gravity Duck's time.c:
Code: Select all
#include "time.h"

static int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
static int (*SysCall)( int R4, int R5, int R6, int R7, int FNo ) = (void*)&SysCallCode;
int time_getTicks()
{
   return (*SysCall)(0, 0, 0, 0, 0x3B);
}

static int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
must be replaced by
const int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};

It is not possible to run code out of RAM using virtual addresses with the newer machines.

Key.c and MonochromeLib.c are affected, too.
I'll be back!

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: FX-9860 GII system error when launching G1As

Postby SimonLothar » Sun Mar 12, 2017 3:37 pm

I also replaced key_down (in key.c) with
Code: Select all
unsigned char key_down(unsigned char code)
{
short keycode;
   keycode = ( ( code & 0xF0 ) << 4 ) | ( code & 0x0F );
   return (*SysCall)((int)&keycode, 0, 0, 0, 0x24A);
}

So far Gravity Duck runs without detectable errors.
I'll be back!

Junior Member
Posts: 4
Joined: Sun Mar 12, 2017 12:19 am
Calculators: Casio fx-9860GII

Re: FX-9860 GII system error when launching G1As

Postby wisemoth » Sun Mar 12, 2017 9:44 pm

Thanks so much Simon, much appreciated! I'll give that a go.

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: FX-9860 GII system error when launching G1As

Postby SimonLothar » Sun Mar 19, 2017 10:02 am

Alas, syscall 0x24A is no longer compatible between SH-3- and SH-4A-systems. Hence the SH-4A version would not work with SH-3 machines.
Above that syscall 024A is not able to detect more than one key hit at a time. Possibly this could be a problem with the difficult parts of the game.
So I provided for some different approach:
http://www.casiopeia.net/forum/download ... &df_id=157
G1A and changed source files are included.
I'll be back!

Junior Member
Posts: 4
Joined: Sun Mar 12, 2017 12:19 am
Calculators: Casio fx-9860GII

Re: FX-9860 GII system error when launching G1As

Postby wisemoth » Mon Apr 03, 2017 8:36 pm

Many thanks Simon - that's most interesting.

Return to General

Who is online

Users browsing this forum: No registered users and 56 guests