FX 02.46.0301

This commit is contained in:
CalcLoverHK 2024-01-25 03:22:10 +08:00
parent 31fa8e0beb
commit 9bf5b08f55
22 changed files with 353 additions and 139 deletions

View File

@ -5,7 +5,7 @@
[BINDATA] : "FXADDINror.bin"
[DISPNAME] : "CBASIC"
[APPNAME] : "@CBASIC"
[VERSION] : "02.46.2000"
[VERSION] : "02.46.3001"
[APL_ICON] : "MainIcon.bmp"
[MODULE_NUM] : 0
[MOD1_TITLE] : "CBASIC"

View File

@ -1,6 +1,6 @@
[DLSimProject]
Name=CBASIC
Version=02.46.2000
Version=02.46.3001
Model=:fx-9860G.dlm
SourcePath=.
MemoryPath=INIT

View File

@ -1331,7 +1331,7 @@ int CB_Ticks( char *SRC ) {
do {
if ( KeyScanDownAC() ) { KeyRecover(); if ( BreakCheck ) BreakPtr=ExecPtr; return t; } // [AC] break?
t=CB_RTC_GetTicks(high);
} while ( abs( t-Hitickstmp ) <= n ) ;
} while ( abs( t-Hitickstmp ) < n ) ;
Hitickstmp=CB_RTC_GetTicks(high);
return Hitickstmp;
} else {
@ -1339,7 +1339,7 @@ int CB_Ticks( char *SRC ) {
do {
if ( KeyScanDownAC() ) { KeyRecover(); if ( BreakCheck ) BreakPtr=ExecPtr; return t; } // [AC] break?
t=CB_RTC_GetTicks(high);
} while ( abs( t-tickstmp ) <= n ) ;
} while ( abs( t-tickstmp ) < n ) ;
tickstmp=CB_RTC_GetTicks(high);
return tickstmp;
}

View File

@ -334,6 +334,41 @@ void CB_Except( char*SRC ) {
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
int CB_GetRGB( char *SRC, int mode ){ // GetRGB/HSV/HSL() -> ListAns
int c,d,r,g,b,m;
int h,s,v;
int base=MatBase;
int errorCheck=1;
int pipe=mode & 0xF0;
mode &= 0x0F;
d = CB_EvalInt( SRC );
if ( SRC[ExecPtr] == ',' ) {
c=SRC[++ExecPtr];
if ( ( c == 'N' ) || ( c == 'N' ) ) { ExecPtr++; errorCheck=0; }
}
if ( SRC[ExecPtr] == ')' ) ExecPtr++;
b = ((d&0x001F) << 3);
g = ((d&0x07E0) >> 3);
r = ((d&0xF800) >> 8);
h=r; s=g; v=b;
// if ( mode ) {
// if ( ( errorCheck ) && ( pipe==0 ) ) {
// if ( (d==0x003F) || (d==0x041F) || (d==0xF820) || (d==0xFC00) ) { if ( CannotSupportERROR( d ) ) return 0; } // Can not support error
// }
// if ( mode==1 ) rgb2hsv(r,g,b,&h,&s,&v); // rgb->HSV
// if ( mode==2 ) rgb2hsl(r,g,b,&h,&s,&v); // rgb->HSL
// }
dspflag=4; // List ans
NewMatListAns( 3, 1, base, 32 ); // List Ans[3]
m=base;
WriteMatrix( CB_MatListAnsreg, m++, base, h ) ; //
WriteMatrix( CB_MatListAnsreg, m++, base, s ) ; //
WriteMatrix( CB_MatListAnsreg, m , base, v ) ; //
return d;
}
int CB_RGBlistsub( char *SRC, int*r, int*g, int*b ){
int reg;
int m,n;

View File

@ -1050,8 +1050,6 @@ unsigned int EditRun(int run){ // run:1 exec run:2 edit
PrevLinePhyN( ymax, SrcBase, &offset, &offset_y ); // csrY adjust
UpdateLineNum=1;
if ( run == 1 ) { key=KEY_CTRL_F6; goto directrun; } // direct run
if ( DebugMode ) DebugMenuSw=1;
PutKey( KEY_CTRL_SHIFT, 1 ); GetKey(&key);
PutKey( KEY_CTRL_SHIFT, 1 ); GetKey(&key);
@ -1061,6 +1059,8 @@ unsigned int EditRun(int run){ // run:1 exec run:2 edit
else Cursor_SetFlashOn(0x6); // overwrite mode cursor
KeyRecover();
if ( run == 1 ) { key=KEY_CTRL_F6; goto directrun; } // direct run
while ( cont ) {
if ( DebugMode==0 ) DebugMenuSw=0;
mini=(EditFontSize & 0x0F);
@ -1624,6 +1624,7 @@ unsigned int EditRun(int run){ // run:1 exec run:2 edit
ClipStartPtr = -1 ; // ClipMode cancel
break;
case KEY_CTRL_F6:
directrun:
execptr=csrPtr;
if ( SearchMode ) goto searchStart; // Retry search
if ( ClipStartPtr >= 0 ) { // Clip -> del '
@ -1657,7 +1658,6 @@ unsigned int EditRun(int run){ // run:1 exec run:2 edit
csrPtr=OpcodeLinePtr( offset_y, SrcBase, offset);
if ( SrcBase[offset] == 0 ) PrevLinePhyN( ymax, SrcBase, &offset, &offset_y );
} else {
directrun:
if ( ( 1 <= DebugMode ) && ( DebugMode <=3 ) ) { // ====== Debug Mode ======
if ( DebugScreen == 1 ) { DebugMenuSw = 1; DebugScreen = 2; }
else
@ -2311,7 +2311,7 @@ int CB_BreakStop() {
if ( BreakPtr == -7 ) return BreakPtr; // return to main program
if ( ErrorNo == StackERR ) { BreakPtr=-999; TryFlag=0; return BreakPtr; } // stack error
if ( TryFlag ) return 0;
if ( ( BreakPtr == 0 ) && ( TryFlag ) ) return 0;
HiddenRAM_MatAryStore(); // MatAry ptr -> HiddenRAM
Bdisp_PutDisp_DD();

View File

@ -88,6 +88,9 @@ void CB_ErrMsg(int ErrNo) {
case ReceiveERR:
ERROR(" Receive ERROR");
break;
case InvalidType:
ERROR(" Invalid Type");
break;
case NextWithoutForERR:
ERROR("Next without For");

View File

@ -561,10 +561,10 @@ int Check_Favorite( char*folder, char *sname ) {
char buf1[32];
char buf2[32];
strcpy( buf1, sname );
ToLower( buf1 );
if ( ( StorageMode & 2 ) ==0 ) ToLower( buf1 ); // non MCS mode
while ( i < FavoritesMAX ) { // file matching search
strcpy( buf2, Favoritesfiles[i].filename );
ToLower( buf2 );
if ( ( StorageMode & 2 ) ==0 ) ToLower( buf2 ); // non MCS mode
if ( strcmp( buf1, buf2 )== 0 )
if ( strcmp( Favoritesfiles[i].folder , folder)== 0 ) break; // already favorite exist
i++;
@ -768,7 +768,7 @@ unsigned int Explorer( int size, char *folder )
k=files[i + top].filesize;
if ( buf2[j-3]=='g' ) {
// k -= 0x38; // file size adjust G1M
if ( StorageMode & 2 ) {
if ( StorageMode & 2 ) { // MCS mode
buf2[j-4]='\0';
k = (k+21) & 0xFFFFFFFC; // file size adjust G1M
}
@ -934,7 +934,7 @@ unsigned int Explorer( int size, char *folder )
case 0:
key=FileCMD_NEW;
if ( Isfolder ) {
strcpy( folder, files[index].filename );
// strcpy( folder, files[index].filename );
index = 0;
}
cont =0 ;
@ -1240,11 +1240,11 @@ unsigned int Explorer( int size, char *folder )
}
}
SaveFavorites();
}
if ( alphalock ) { PutKey( KEY_CTRL_ALPHA, 1 ); i=key; GetKey(&key); key=i; }
SaveFavorites();
Bkey_Set_RepeatTime(FirstCount,NextCount); // restore repeat time
return key;
@ -3060,16 +3060,8 @@ void LoadConfig1(){
double *bufdbl;
int size,i;
int handle,state;
char folder[32]="CBasic"; // default C.Basic working folder
if ( LoadConfigReadFile( buffer, fname, ConfigMAX ) < 0 ) {
if ( Is35E2 ) {
CreateDirectorySub( folder, 1 ); // creat default C.Basic folder for III model
root2[0]='\\';
strcpy( root2+1, folder ); // current folder
}
return;
}
if ( LoadConfigReadFile( buffer, fname, ConfigMAX ) < 0 ) return;
bufshort=(short*)buffer;
bufint=(int*)buffer;
@ -3144,8 +3136,16 @@ void LoadConfig2(){
double *bufdbl;
int size,i;
int handle,state;
char folder[32]="CBasic"; // default C.Basic working folder
if ( LoadConfigReadFile( buffer, fname, ConfigMAX2 ) < 0 ) return;
if ( LoadConfigReadFile( buffer, fname, ConfigMAX2 ) < 0 ) {
if ( Is35E2 ) {
CreateDirectorySub( folder, 1 ); // creat default C.Basic folder for III model
root2[0]='\\';
strcpy( root2+1, folder ); // current folder
}
return;
}
bufshort=(short*)buffer;
bufint=(int*)buffer;

View File

@ -140,7 +140,7 @@ int MCS_Save( char *filebase, char *dirname, char *itemname, int size, int flag0
}
r = MCS_SearchDirectoryItem( (unsigned char *)dirname, (unsigned char *)itemname, &flags_0, (TDirectoryItem *)&tmp, &data_ptr, &data_length );
item = (TDirectoryItem*)tmp[0];
if ( flag0==0xC7 ) item->flags[0] = flag0; // basic progmam
if ( flag0==0xC7 ) item->flags[0] = flag0; // basic program
return r;
}
@ -151,6 +151,7 @@ int MCS_SaveG1M( char *filebase ) { // g1m file -> MCS
G1MHeaderTobasname8( filebase, basname);
size = FixSrcSize(filebase);
size = ( ( size +10 +3 ) & 0xFFFFFFFC ) ; // file size 4byte align adjust
SetSrcSize( filebase, size );
r = MCS_Save( filebase, (char*)MCSdir_system, basname, size, 0xC7 ) ; // g1m file -> MCS
return r;
}

View File

@ -367,6 +367,10 @@ void GetGenuineCmdF1( unsigned int *code ){
switch ( CommandPage ) {
case 0: (*code)=0xF91C;return; // File
} break;
case CMD_SETUP_TVAR:
switch ( CommandPage ) {
case 0: (*code)=0xF788;return; // VarRange
} break;
default:
break;

View File

@ -357,6 +357,10 @@ void GetGenuineCmdF2( unsigned int *code ){
switch ( CommandPage ) {
case 0: (*code)=0xF909;return; // a+bi
} break;
case CMD_SETUP_TVAR:
switch ( CommandPage ) {
case 0: (*code)=0xF91D;return; // VarList
} break;
default:
break;

View File

@ -52,7 +52,7 @@ void VerDispSub( int flag ) {
locate( 3, 5 ); Print( (unsigned char*)" by sentaro21" );
locate( 3, 6 ); Print( (unsigned char*)" (c)2023" );
PrintMini(13*6+2, 2*8+1, (unsigned char*)"build 02 ", MINI_OVER );
PrintMini(13*6+2, 2*8+1, (unsigned char*)"build 03 ", MINI_OVER );
PrintMini( 2*6+2, 3*8+1, (unsigned char*)"(Casio Basic compatible+)", MINI_OVER );
// if ( ( UseHiddenRAM ) && ( IsHiddenRAM ) ) {

View File

@ -169,3 +169,12 @@ int CB_SigmaInt( char *SRC ) ; // Sigma(X^2,X,1.10)
double CB_Integral( char *SRC ); // Integral( FX, start, end, sci )
double CB_Differ( char *SRC ); // Differ( FX, start, end, sci )
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
extern short VarListRange;
void CB_VarList( char *SRC ) ;
void CB_VarRange( char *SRC ) ;
void CB_F_Result( char *SRC ) ;
void CB_DispF_Tbl( char *SRC ) ;

View File

@ -196,3 +196,4 @@ double CB_Differ( char *SRC ){ // Differ( FX, tol )
return 0;
}

View File

@ -46,6 +46,7 @@ void GetNewAry8( int reg, int aryN, int aryMax ) ;
int CheckQuotCR( char *SRC, int ptr ) ;
int CB_GetQuotOpcode(char *SRC, char *buffer, int Maxlen) ;
int GetStrYFnNo( char *SRC, int reg, int aryN, int aryMax ) ; // -> StringNo
char* GetStrYFnPtr( char *SRC, int reg, int aryN, int aryMax ) ;
char* GetStrYFnPtrSub( int reg, int dimA, int dimB ) ;
int CB_IsStr( char *SRC, int execptr ) ;
@ -106,9 +107,24 @@ int CB_Bin( char *SRC ); // Bin(
int CB_StrBase( char *SRC ); // StrBase( Str1,base1,base2 )->str2
int CB_StrRepl( char *SRC ); // StrRepl( Str1,Str2,Str3,n )->str4
int StrSplit( char *buffer, char *srcstr, int ptr, int maxlen ); // ptr:1- ->MatAns
int CB_StrSplit( char *SRC ) ; // StrStip( "123,4567,89","[n,]) -> MatAns[["1232]["4567"]["89"]]
char* CB_RecallString(int type ); // ----------- Recall String type: 0:string 1:fn 2:GraphY
int CB_StoreString(int type, char *clipbuffer ); // ----------- Store String type: 0:string 1:fn 2:GraphY
char* CB_SeeString(int type, int *select, char *clipbuffer ); // ----------- See String type: 0:string 1:fn 2:GraphY
//-----------------------------------------------------------------------------
void StoreGraphY( char *fstring, int FuncNo );
void StoreGraphr( char *fstring, int FuncNo );
void StoreGraphXt( char *fstring, int FuncNo );
void StoreGraphYt( char *fstring, int FuncNo );
void StoreGraphX( char *fstring, int FuncNo );
char* ReadGraphY( int FuncNo );
char* ReadGraphr( int FuncNo );
char* ReadGraphXt( int FuncNo );
char* ReadGraphYt( int FuncNo );
char* ReadGraphX( int FuncNo );

View File

@ -188,9 +188,9 @@ char* CB_SeeString(int type, int *select, char *clipbuffer ){ // ----------- See
Fkey_Icon( FKeyNo1, 69 ); // Fkey_dispR( FKeyNo1, "STORE");
Fkey_Icon( FKeyNo2, 70 ); // Fkey_dispR( FKeyNo2, "RECALL");
if ( type==1 ) Fkey_Icon( FKeyNo3, 240 ); // Fkey_dispR( FKeyNo3, " fn ");
Fkey_Icon( FKeyNo4, 241 ); // Fkey_dispN( FKeyNo4, " SEE");
if ( ReEnterSEE == 0 ) Fkey_Icon( FKeyNo5, 389 ); // Fkey_dispR( FKeyNo5,"EDIT");
// if ( ReEnterSEE == 0 ) Fkey_Icon( FKeyNo5, 42 ); // Fkey_dispN( FKeyNo5, "Edit");
// Fkey_Icon( FKeyNo4, 241 ); // Fkey_dispN( FKeyNo4, " SEE");
// if ( ReEnterSEE == 0 ) Fkey_Icon( FKeyNo5, 389 ); // Fkey_dispR( FKeyNo5,"EDIT");
if ( ReEnterSEE == 0 ) Fkey_Icon( FKeyNo4, 42 ); // Fkey_dispN( FKeyNo4, "Edit");
// Bdisp_PutDisp_DD();
@ -238,7 +238,7 @@ char* CB_SeeString(int type, int *select, char *clipbuffer ){ // ----------- See
cont=0;
break;
case KEY_CTRL_F5:
case KEY_CTRL_F4:
case KEY_CTRL_LEFT:
case KEY_CTRL_RIGHT:
if ( ReEnterSEE == 0 ) {

View File

@ -13,11 +13,12 @@ void Text(int y, int x, unsigned char*str);
extern int skip_count;
void DrawBusy(); // BusyInd=0: running indicator off, BusyInd=1: on
int Check_skip_count( void ) ;
void Bdisp_PutDisp_DD_DrawBusy();
void Bdisp_PutDisp_DD_DrawBusy_skip();
void Bdisp_PutDisp_DD_DrawBusy_through( char *SRC ) ;
void Bdisp_PutDisp_DD_DrawBusy_skip_through( char *SRC ) ;
void CB_PutDispDD( char*SRC );
//-----------------------------------------------------------------------------
int VWtoPXY(double x, double y, int *px, int *py); // ViewWwindow(x,y) -> pixel(x,y)

View File

@ -134,7 +134,7 @@
#define CMD_SETUP_SWIN 0x522
#define CMD_SETUP_LIST 0x523
#define CMD_SETUP_LOCS 0x524
#define CMD_SETUP_TVAR 0x530
#define CMD_SETUP_TVAR 0x524 // <- 0x530
#define CMD_SETUP_SDSP 0x531
#define CMD_SETUP_RESID 0x532
#define CMD_SETUP_CPLX 0x521 // <- 0x533

View File

@ -378,6 +378,7 @@ void CB_BackColor( char *SRC );
void CB_TransparentColor( char *SRC );
int CB_GetColor( char *SRC );
unsigned short CB_RGB( char *SRC, int mode ) ; // n or (r,g,b) return : color code // mode 0:RGB 1:HSV 2:HSL
int CB_GetRGB( char *SRC, int mode ); // GetRGB/HSV/HsL() -> ListAns
void CB_GraphFunc( char *SRC, int c ) ;

View File

@ -392,26 +392,32 @@ void CB_GetOperandNDbl( char *SRC, int n, double*ary ){
}
}
void CB_Screen( char *SRC ){ // Screen.G Screen.T
int ToUpperC( int c ){
if ( ( 'a' <= c ) && ( c <= 'z' ) ) c +=('A'-'a');
return c;
}
void CB_Screen( char *SRC ){ // Screen.G Screen.T Screen.R Screen # Screen % Screen.VG Screen.VT
double ScrOp[4];
double x,y;
int px,py;
int c;
dspflag=0; //
c=SRC[ExecPtr++];
if ( c == '.' ) { c=SRC[ExecPtr++];
if ( ( c=='G' ) || ( c=='g' ) ) goto scrG; // Select Graphic Screen
if ( ( c=='T' ) || ( c=='t' ) ) goto scrT; // Select Text Screen
if ( ( c=='R' ) || ( c=='r' ) ) goto scrR; // ScreenR to reverse screen
if ( c == '.' ) { c=SRC[ExecPtr++]; c=ToUpperC(c);
if ( ( c=='G' ) ) goto scrG; // Select Graphic Screen
if ( ( c=='T' ) ) goto scrT; // Select Text Screen
if ( ( c=='R' ) ) goto scrR; // ScreenR to reverse screen
if ( ( c=='V' ) ) goto scrV; // Screen.V to change current Vram
if ( c == '#' ) goto scrCod;
if ( c == '%' ) goto scrCod2;
{ ExecPtr--; CB_Error(SyntaxERR); return; } // Syntax error
} else
if ( ( c=='G' ) || ( c=='g' ) ) goto scrG; // Select Graphic Screen
if ( ( c=='G' ) ) goto scrG; // Select Graphic Screen
else
if ( ( c=='T' ) || ( c=='t' ) ) goto scrT; // Select Text Screen
if ( ( c=='T' ) ) goto scrT; // Select Text Screen
else
if ( ( c=='R' ) || ( c=='r' ) ) { // ScreenR to reverse screen
if ( ( c=='R' ) ) { // ScreenR to reverse screen
scrR:
// Bdisp_AreaReverseVRAM(0,0,127,63);
ML_rectangle( 0, 0, 127, 63, 0, 0, 2);
@ -459,6 +465,14 @@ void CB_Screen( char *SRC ){ // Screen.G Screen.T
else goto scrT; // Select Text Screen
} else { ExecPtr--;
switch ( CB_EvalInt( SRC ) ) {
case -1:
scrV:
c=SRC[ExecPtr++]; c=ToUpperC(c);
if ( c=='T' ) { ExecPtr++; PictAry[0]=(unsigned char*)TVRAM; } // Screen.VT to override screen & recover Text Vram
else
if ( c=='G' ) { ExecPtr++; PictAry[0]=(unsigned char*)GVRAM; } // Screen.VG to GraphicsText Vram
else PictAry[0]=(unsigned char*)GetVRAMAddress();
break;
case 0:
scrT:
CB_SelectTextVRAM(); // Select Text Screen
@ -1147,7 +1161,7 @@ void CB_ReadGraph( char *SRC ){ // ReadGraph(px1,py1, px2,py2)->Mat C
DISPBOX box;
// if ( RangeErrorCK( SRC ) ) return;
CB_ChangeGraphicMode( SRC ); // Select Graphic Mode
// CB_ChangeGraphicMode( SRC ); // Select Graphic Mode
CB_DotOprand( SRC, &px1, &py1);
if ( SRC[ExecPtr] != ',' ) { CB_Error(SyntaxERR); return; } // Syntax error
ExecPtr++;
@ -1176,7 +1190,7 @@ void CB_ReadGraph( char *SRC ){ // ReadGraph(px1,py1, px2,py2)->Mat C
Bdisp_ReadArea_VRAM( &box, ptr);
}
} else { CB_Error(SyntaxERR); return; } // Syntax error
if ( scrmode==0 ) CB_SelectTextVRAM(); // Select Text Screen
// if ( scrmode==0 ) CB_SelectTextVRAM(); // Select Text Screen
}
void CB_WriteGraph( char *SRC ){ // WriteGraph x,y,wx,wy,Mat A ([2,2]),modify,kind
@ -1195,7 +1209,7 @@ void CB_WriteGraph( char *SRC ){ // WriteGraph x,y,wx,wy,Mat A ([2,2]),modify,ki
int ElementSize;
// if ( RangeErrorCK( SRC ) ) return;
CB_ChangeGraphicMode( SRC ); // Select Graphic Mode
// CB_ChangeGraphicMode( SRC ); // Select Graphic Mode
CB_DotOprand( SRC, &px, &py);
if ( SRC[ExecPtr] != ',' ) { CB_Error(SyntaxERR); return; } // Syntax error
ExecPtr++;
@ -1253,7 +1267,7 @@ void CB_DotGet( char *SRC ){ // DotGet(px1,py1, px2,py2)->Mat B [x,y]
int ElementSize=1;
int scrmode=ScreenMode;
if ( CB_RangeErrorCK_ChangeGraphicMode( SRC ) ) return; // Select Graphic Mode
// if ( CB_RangeErrorCK_ChangeGraphicMode( SRC ) ) return; // Select Graphic Mode
CB_DotOprand( SRC, &px1, &py1);
if ( SRC[ExecPtr] != ',' ) { CB_Error(SyntaxERR); return; } // Syntax error
ExecPtr++;
@ -1285,7 +1299,7 @@ void CB_DotGet( char *SRC ){ // DotGet(px1,py1, px2,py2)->Mat B [x,y]
y++;
}
} else { CB_Error(SyntaxERR); return; } // Syntax error
if ( scrmode==0 ) CB_SelectTextVRAM(); // Select Text Screen
// if ( scrmode==0 ) CB_SelectTextVRAM(); // Select Text Screen
}
void CB_DotPut( char *SRC ){ // DotPut(Mat B[x,y], px1,py1, px2,py2) [-> Mat C]
@ -1362,7 +1376,7 @@ void CB_DotPut( char *SRC ){ // DotPut(Mat B[x,y], px1,py1, px2,py2) [-> Mat C]
// dspflag=0;
UseGraphic=0;
} else { // -> VRAM
CB_ChangeGraphicMode( SRC ); // Select Graphic Mode
// CB_ChangeGraphicMode( SRC ); // Select Graphic Mode
mode=CB_SetPointMode( SRC );
i=x;
for ( py=py1; py<=py2 ; py++) {
@ -1436,7 +1450,7 @@ void CB_DotTrim( char *SRC ){ // DotTrim(Mat A,x1,y1,x2,y2)->Mat B =>[X,Y]
}
} else {
if ( CB_RangeErrorCK_ChangeGraphicMode( SRC ) ) return; // Select Graphic Mode
// if ( CB_RangeErrorCK_ChangeGraphicMode( SRC ) ) return; // Select Graphic Mode
CB_DotOprand( SRC, &px1, &py1);
if ( SRC[ExecPtr] != ',' ) { CB_Error(SyntaxERR); return; } // Syntax error
ExecPtr++;
@ -2492,77 +2506,6 @@ void CB_RclVWin( char *SRC ) {
CB_ChangeViewWindow() ;
}
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
void CB_GraphFunc( char *SRC, int c ) {
int n,d;
char *buffer;
if ( ( 0x63<=c ) && ( c<=0x6F) ) {
switch ( c ) {
case 0x63: d= 0; break; // Y=Type
case 0x64: d= 1; break; // r=Type
case 0x65: d= 2; break; // ParamType
// case 0x66: //
case 0x67: d= 3; break; // X=Type
case 0x68: d= 8; break; // X>Type
case 0x69: d= 9; break; // X<Type
case 0x6A: d= 4; break; // Y>Type
case 0x6B: d= 5; break; // Y<Type
case 0x6C: d= 6; break; // Y>=Type
case 0x6D: d= 7; break; // Y<=Type
case 0x6E: d=10; break; // X>=Type
case 0x6F: d=11; break; // X<=Type
}
FuncType = d;
return;
}
if ( c == 0xFFFFFF98 ) { // SetG-Color
c = CB_GetColor( SRC );
if ( SRC[ExecPtr]!=',' ) { CB_Error(SyntaxERR); goto exit; } // Syntax error
ExecPtr++;
buffer = GetStrYFnPtr( SRC, defaultGraphAry, defaultGraphAryN, defaultGraphArySize ) ;
if ( buffer[7-1] ) {
buffer[5-1] = c/256;
buffer[6-1] = c%256;
}
goto exit;
}
buffer = GetStrYFnPtr( SRC, defaultGraphAry, defaultGraphAryN, defaultGraphArySize ) ;
if ( buffer[7-1] == 0 ) goto exit;
switch ( c ) {
case 0x2B: // NormalG
buffer[4-1] = 0x02;
break;
case 0x2C: // ThickG
buffer[4-1] = 0x03;
break;
case 0x2D: // BrokenThickG
buffer[4-1] = 0x05;
break;
case 0x3F: // DotG
buffer[4-1] = 0x08;
break;
case 0xFFFFFFF5: // ThinG
buffer[4-1] = 0x12;
break;
case 0xFFFFFFC8: // G SelOn
buffer[3-1] |= 0x80;
break;
case 0xFFFFFFC9: // T SelOn
buffer[3-1] |= 0x20;
break;
case 0xFFFFFFD8: // G SelOff
buffer[3-1] &= 0x7F;
break;
case 0xFFFFFFD9: // T SelOff
buffer[3-1] &= 0xDF;
break;
}
exit:
dspflag=0;
}
//----------------------------------------------------------------------------------------------
int GObjectAlign4d( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4e( unsigned int n ){ return n; } // align +4byte
@ -2576,17 +2519,24 @@ int GObjectAlign4l( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4m( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4n( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4o( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4p( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4q( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4r( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4s( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4t( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4u( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4v( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4w( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4x( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4y( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4z( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4A( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4B( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4p( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4q( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4r( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4s( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4t( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4u( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4v( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4w( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4x( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4y( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4z( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4A( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4B( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4C( unsigned int n ){ return n; } // align +4byte
int GObjectAlign4D( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4E( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4F( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4G( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4H( unsigned int n ){ return n; } // align +4byte
//int GObjectAlign4I( unsigned int n ){ return n; } // align +4byte
//----------------------------------------------------------------------------------------------

View File

@ -157,6 +157,16 @@ void HiddenRAM_MatAryStore(){ // MatAry ptr -> HiddenRAM
iptr2[0]=(int)HiddenRAM_MatTopPtr;
}
}
void HiddenRAM_MatAryClear(){ // MatAry ptr clear
int *iptr1=(int*)(HIDDENRAM_Top+12);
int *iptr2=(int*)(HiddenRAM_End+12);
if ( IsHiddenRAM ) {
memset( (char *)HIDDENRAM_Top, 0, sizeof(MatAryCheckStr) );
memset( HiddenRAM_End, 0, sizeof(MatAryCheckStr) );
}
FileListUpdate= 1;
HiddenRAM_MatAryInit();
}
int HiddenRAM_MatAryRestore(){ // HiddenRAM -> MatAry ptr
char buffer[10];
int *iptr1=(int*)(HIDDENRAM_Top+12);
@ -484,14 +494,14 @@ void ProgressBar(int current, int max) {
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
//int IObjectAlign4a( unsigned int n ){ return n; } // align +4byte
//int IObjectAlign4b( unsigned int n ){ return n; } // align +4byte
//int IObjectAlign4c( unsigned int n ){ return n; } // align +4byte
//int IObjectAlign4d( unsigned int n ){ return n; } // align +4byte
//int IObjectAlign4e( unsigned int n ){ return n; } // align +4byte
//int IObjectAlign4f( unsigned int n ){ return n; } // align +4byte
//int IObjectAlign4g( unsigned int n ){ return n; } // align +4byte
//int IObjectAlign4h( unsigned int n ){ return n; } // align +4byte
//int IObjectAlign4i( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4a( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4b( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4c( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4d( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4e( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4f( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4g( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4h( unsigned int n ){ return n; } // align +4byte
int IObjectAlign4i( unsigned int n ){ return n; } // align +4byte
//----------------------------------------------------------------------------------------------

View File

@ -42,6 +42,7 @@ void HiddenRAM_freeProg( void *ptr );
void HiddenRAM_freeMat( int reg );
void HiddenRAM_MatAryInit(); // HiddenRAM Initialize
void HiddenRAM_MatAryStore(); // MatAry ptr -> HiddenRAM
void HiddenRAM_MatAryClear(); // MatAry ptr clear
int HiddenRAM_MatAryRestore(); // HiddenRAM -> MatAry ptr 1:ok
void HiddenRAM_ExtFontAryInit() ;

178
fx/KeyScan_Slim.h Normal file
View File

@ -0,0 +1,178 @@
//
// fx-9860G Slim KeyScan
//
// original source by SuperH-based fx calculators
//
// this modified source is written by sentaro21
//
//
// 06 05 04 03 02 01 00 (SH4A)
//--------------------------------------
//0B DIAG OSUPD 0B A44B000B
//0A 0A A44B000A
//09 F1 F2 F3 F4 F5 F6 09 A44B0009
//08 SHIFT OPTN VARS MENU <20>© <20>ª 08 A44B0008
//07 ALPHA ^2 ^ EXIT <20>« <20>¨ 07 A44B0007
//06 XTT log ln sin cos tan 06 A44B0006
//05 ab/c F<>D ( ) , <20>¨ 05 A44B0005
//04 7 8 9 DEL 04 A44B0004
//03 4 5 6 x div 03 A44B0003
//02 1 2 3 + - 02 A44B0002
//01 0 . EXP (-) EXE 01 A44B0001
//00 AC 00 A44B0000
//--------------------------------------
// 06 05 04 03 02 01 00 (SH4A)
// SLIM
// 06 05 04 03 02 01 00 (SLIM)
//--------------------------------------
//0B DIAG OSUPD 0B
//0A 0A
//09 MENU XTT SHIFT ALPHA 09
//08 F1 log ^2 ^ <20>© <20>ª 08
//07 F2 ln , OPTN <20>« <20>¨ 07
//06 F3 sin <20>¨ VARS HELP LIGHT 06
//05 F4 cos 7 4 1 0 05
//04 F5 tan 8 5 2 . 04
//03 F6 ab/c 9 6 3 EXP 03
//02 EXIT F<>D DEL + - (-) 02
//01 ( ) div EXE - 01
//00 AC 00
//--------------------------------------
// 06 05 04 03 02 01 00 (SLIM)
const short keyrow_slim_table[9][6]{
{KEYSC_MENU, KEYSC_XTT, KEYSC_SHIFT, KEYSC_ALPHA, 0, 0 },
{KEYSC_F1, KEYSC_LOG, KEYSC_SQUARE, KEYSC_POW, KEYSC_LEFT, KEYSC_UP },
{KEYSC_F2, KEYSC_LN, KEYSC_COMMA, KEYSC_OPTN, KEYSC_DOWN, KEYSC_RIGHT },
{KEYSC_F3, KEYSC_SIN, KEYSC_STORE, KEYSC_VARS, -1, -1 },
{KEYSC_F4, KEYSC_COS, KEYSC_7, KEYSC_4, KEYSC_1, KEYSC_0 },
{KEYSC_F5, KEYSC_TAN, KEYSC_8, KEYSC_5, KEYSC_2, KEYSC_DP },
{KEYSC_F6, KEYSC_FRAC, KEYSC_9, KEYSC_6, KEYSC_3, KEYSC_EXP },
{KEYSC_EXIT, KEYSC_FD, KEYSC_DEL, KEYSC_MULT, KEYSC_PLUS, KEYSC_PMINUS },
{0, KEYSC_LPAR, KEYSC_RPAR, KEYSC_DIV, KEYSC_EXE, KEYSC_MINUS }
};
/*
#define KB_1ST_ROW 9
#define KB_2ND_ROW 8
#define KB_3RD_ROW 7
#define KB_4TH_ROW 6
#define KB_5TH_ROW 5
#define KB_6TH_ROW 4
#define KB_7TH_ROW 3
#define KB_8TH_ROW 2
#define KB_9TH_ROW 1
#define KB_0TH_ROW 0
#define KB_F1_ROW KB_1ST_ROW
#define KB_SHIFT_ROW KB_2ND_ROW
#define KB_ALPHA_ROW KB_3RD_ROW
#define KB_XTT_ROW KB_4TH_ROW
#define KB_ABC_ROW KB_5TH_ROW
#define KB_7_ROW KB_6TH_ROW
#define KB_4_ROW KB_7TH_ROW
#define KB_1_ROW KB_8TH_ROW
#define KB_0_ROW KB_9TH_ROW
#define KB_AC_ROW KB_0TH_ROW
#define KB_1ST_COL 0x40
#define KB_2ND_COL 0x20
#define KB_3RD_COL 0x10
#define KB_4TH_COL 0x08
#define KB_5TH_COL 0x04
#define KB_6TH_COL 0x02
#define KB_7TH_COL 0x01
#define KB_AC_COL 0x00
#define KB_ALPHA_COL KB_1ST_COL
#define KB_SQUARE_COL KB_2ND_COL
#define KB_POW_COL KB_3RD_COL
#define KB_EXIT_COL KB_4TH_COL
#define KB_DOWN_COL KB_5TH_COL
#define KB_RIGHT_COL KB_6TH_COL
*/
#define KEYSC_F1 0x408
#define KEYSC_F2 0x407
#define KEYSC_F3 0x406
#define KEYSC_F4 0x405
#define KEYSC_F5 0x404
#define KEYSC_F6 0x403
#define KEYSC_SHIFT 0x109
#define KEYSC_OPTN 0x087
#define KEYSC_VARS 0x086
#define KEYSC_MENU 0x409
#define KEYSC_LEFT 0x048
#define KEYSC_UP 0x028
#define KEYSC_ALPHA 0x089
#define KEYSC_SQUARE 0x108
#define KEYSC_POW 0x088
#define KEYSC_EXIT 0x402
#define KEYSC_DOWN 0x047
#define KEYSC_RIGHT 0x027
#define KEYSC_XTT 0x209
#define KEYSC_LOG 0x208
#define KEYSC_LN 0x207
#define KEYSC_SIN 0x206
#define KEYSC_COS 0x205
#define KEYSC_TAN 0x204
#define KEYSC_FRAC 0x203
#define KEYSC_FD 0x202
#define KEYSC_LPAR 0x201
#define KEYSC_RPAR 0x101
#define KEYSC_COMMA 0x107
#define KEYSC_STORE 0x106
#define KEYSC_7 0x105
#define KEYSC_8 0x104
#define KEYSC_9 0x103
#define KEYSC_DEL 0x182
#define KEYSC_4 0x085
#define KEYSC_5 0x084
#define KEYSC_6 0x083
#define KEYSC_MULT 0x082
#define KEYSC_DIV 0x081
#define KEYSC_1 0x045
#define KEYSC_2 0x044
#define KEYSC_3 0x043
#define KEYSC_PLUS 0x042
#define KEYSC_MINUS 0x021
#define KEYSC_0 0x025
#define KEYSC_DP 0x024
#define KEYSC_EXP 0x023
#define KEYSC_PMINUS 0x022
#define KEYSC_EXE 0x041
#define KEYSC_AC 0x010 //
int CheckKeyRow( int row );
int CheckKeyRow7305( int row );
int KeyScanDown(int keyscan_code);
int KeyScanDownAC();
int GetKey_DisableMenu( unsigned int *key ) ;
int CB_KeyCodeCnvt( unsigned int key ) ; // CasioBasic Getkey SDK compatible
int KeyCheckAC();
int KeyCheckEXE();
int KeyCheckEXIT();
int KeyCheckF1();
int KeyCheckCHAR4();
int KeyCheckCHAR3();
int KeyCheckCHAR6();
int CB_Getkey();
int CB_Getkey0();
int CB_Getkey1(int sdkcode);
int CB_Getkey2(int sdkcode);
int CB_GetkeyN( int n, int disableCatalog, int sdkcode) ; // CasioBasic Getkey
int BackLight( int n ); // 0:off 1:on 2:xor