SuperH-based fx calculators
fx display backlight

Port assignments:
fx-9860G slim: bit 5 of port D (0xA4000126 on SH-7337/SH-7355)
fx-9860GII : bit 7 of port G (0xA400012C on SH-7337/SH-7355)
fx-9860GII-2/fx-CG : bit 4 of port N (0xA4050138 on SH-7305)
 

To decide, which port has to be used, use the following scheme

	// check for calculator hardware type
	if ( *(unsigned int*)0x80000300 == 0x80005D7C ){
		if ( *(unsigned char*)0xA4000128 & 0x08 ){
			hardware = fx9860G;
			strcpy( (char*)x, "fx-9860G" );
		}
		else{
			hardware = fx9860G_SLIM;
			strcpy( (char*)x, "fx-9860G slim" );
		}
	}
	else {
		GlibGetOSVersionInfo( &v1, &v2, &v3, &v4 );
		if ( ( v1 == 2 ) && ( v2 == 2 ) ){
			hardware = fx9860GII_2;
			strcpy( (char*)x, "fx-9860GII-2" );
		}
		else if ( ( *(unsigned int*)0x80000304 & 0x00FF0000 ) == 0x00AA0000 ){
		// GII
			hardware = fx9860GII;
			strcpy( (char*)x, "fx-9860GII" );
		}
		else if ( ( *(unsigned int*)0x80000304 & 0x00FF0000 ) == 0x00550000 ){
		// GII (French)
			hardware = fx9860GII;
			strcpy( (char*)x, "fx-9860GII(F)" );
		}
	}

 

 

(14.10.2012 06:17:19)