diff --git a/fx/AddinInfo.txt b/fx/AddinInfo.txt index 7b51a94..197618f 100644 --- a/fx/AddinInfo.txt +++ b/fx/AddinInfo.txt @@ -5,7 +5,7 @@ [BINDATA] : "FXADDINror.bin" [DISPNAME] : "CBASIC" [APPNAME] : "@CBASIC" -[VERSION] : "02.45.1307" +[VERSION] : "02.45.1401" [APL_ICON] : "MainIcon.bmp" [MODULE_NUM] : 0 [MOD1_TITLE] : "CBASIC" diff --git a/fx/CBASIC.g1w b/fx/CBASIC.g1w index 77fe224..b81d143 100644 --- a/fx/CBASIC.g1w +++ b/fx/CBASIC.g1w @@ -1,6 +1,6 @@ [DLSimProject] Name=CBASIC -Version=02.45.1307 +Version=02.45.1401 Model=:fx-9860G.dlm SourcePath=. MemoryPath=INIT diff --git a/fx/CBZ_inp.c b/fx/CBZ_inp.c index c9a05ca..f97af3d 100644 --- a/fx/CBZ_inp.c +++ b/fx/CBZ_inp.c @@ -2752,7 +2752,7 @@ short selectPRGM=0; char lowercase=0; int InputStrSubC(int x, int y, int width, int ptrX, char* buffer, int MaxStrlen, char* SPC, int rev_mode, int float_mode, int exp_mode, int alpha_mode, int hex_mode, int pallet_mode, int exit_cancel, int ac_cancel, int fn_cancel) { - char buffer2[256]; + char buffer2[512]; char buf[22]; char fnbuf[16*8]; unsigned int key=0; @@ -2779,7 +2779,7 @@ int InputStrSubC(int x, int y, int width, int ptrX, char* buffer, int MaxStrlen, if ( x + width > 22 ) width=22-x; csrwidth=width; if ( x + csrwidth > 20 ) csrwidth=21-x; - if ( MaxStrlen > 255 ) MaxStrlen = 255; + if ( MaxStrlen > 511) MaxStrlen = 511; for(i=0; i<=MaxStrlen; i++) buffer2[i]=buffer[i]; // backup CursorStyle=Cursor_GetFlashStyle(); diff --git a/fx/CBZ_setup.c b/fx/CBZ_setup.c index b35924a..d7fb817 100644 --- a/fx/CBZ_setup.c +++ b/fx/CBZ_setup.c @@ -52,7 +52,7 @@ void VerDispSub( int flag ) { locate( 3, 5 ); Print( (unsigned char*)" by sentaro21" ); locate( 3, 6 ); Print( (unsigned char*)" (c)2020" ); - PrintMini(13*6+2, 2*8+1, (unsigned char*)"build 13 ", MINI_OVER ); + PrintMini(13*6+2, 2*8+1, (unsigned char*)"build 14.", MINI_OVER ); PrintMini( 2*6+2, 3*8+1, (unsigned char*)"(Casio Basic compatible+)", MINI_OVER ); // if ( ( UseHiddenRAM ) && ( IsHiddenRAM ) ) { diff --git a/fx/CB_Str.c b/fx/CB_Str.c index e40dc2c..972ff13 100644 --- a/fx/CB_Str.c +++ b/fx/CB_Str.c @@ -710,7 +710,7 @@ int CB_IsStr( char *SRC, int execptr ) { } else if ( c == 0x7F ) { c=SRC[execptr+1]; - if ( c == 0xFFFFFFF0 ) return c; // GraphY + if ( ( 0xFFFFFFF0 <= c ) && ( c <= 0xFFFFFFF4 ) ) return c; // GraphY else if ( ( c == 0x51 ) || ( (0x6A<=c)&&(c<=0x6F) ) ) { // List [0]? extmp = ExecPtr; @@ -730,6 +730,7 @@ char* CB_GetOpStrSub( char *SRC ,int *maxlen, int c ) { // String -> buffer ret int reg,dimA,dimB; int aryN,aryMax; char *buffer; + int type; switch ( c ) { case 1: // """" @@ -758,9 +759,27 @@ char* CB_GetOpStrSub( char *SRC ,int *maxlen, int c ) { // String -> buffer ret (*maxlen)=MatAry[reg].SizeB; break; case 0xFFFFFFF0: // GraphY + case 0xFFFFFFF1: // Graphr + case 0xFFFFFFF2: // GraphXt + case 0xFFFFFFF3: // GraphYt + case 0xFFFFFFF4: // GraphX reg=defaultGraphAry; ExecPtr+=2; buffer = GetStrYFnPtr( SRC, reg, defaultGraphAryN, defaultGraphArySize ) +6; + type = ( buffer[0]<<8 ) + ( buffer[1] ); + switch ( c ) { + case 0xFFFFFFF0: // GraphY + c=0x0108; break; + case 0xFFFFFFF1: // Graphr + c=0x040A; break; + case 0xFFFFFFF2: // GraphXt + c=0x0409; break; + case 0xFFFFFFF3: // GraphYt + buffer = strstr(buffer,"\xF6\x00"); + c=0x0409; break; + case 0xFFFFFFF4: // GraphX + c=0x0208; break; + } (*maxlen)=MatAry[reg].SizeB; break; case 0x30: // StrJoin( @@ -921,11 +940,22 @@ void StorStrStr( char *SRC ) { // "String" -> Sto 1-20 void StorStrGraphY( char *SRC ) { // "String" -> GraphY 1-5 int reg,dimA,dimB; - char *MatAryC; + char *MatAryC,*ptr; + int size; + int c = SRC[ExecPtr-1]; reg=defaultGraphAry; MatAryC = GetStrYFnPtr( SRC, reg, defaultGraphAryN, defaultGraphArySize ) +6; if ( ErrorNo ) return ; // error - OpcodeCopy( MatAryC, CB_CurrentStr, MatAry[reg].SizeB-1 ); + size = MatAry[reg].SizeB-1-6; + if ( ( c==0xFFFFFFF2 ) ) { // Yt + ptr=strstr(MatAryC, "\xF6\x00"); + if ( ptr == NULL ) { + MatAryC[0]='\0'; + } else { + + } + } + OpcodeCopy( MatAryC, CB_CurrentStr, MatAry[reg].SizeB-1-6 ); } void StorStrFn( char *SRC ) { // "String" -> fn 1-9 @@ -1050,6 +1080,10 @@ void CB_StorStrSub( char *SRC, int c ) { StorStrFn( SRC ) ; break; case 0xFFFFFFF0: // GraphY + case 0xFFFFFFF1: // Graphr + case 0xFFFFFFF2: // GraphXt + case 0xFFFFFFF3: // GraphYt + case 0xFFFFFFF4: // GraphX ExecPtr+=2; StorStrGraphY( SRC ) ; break; diff --git a/fx/CB_StrExt.c b/fx/CB_StrExt.c index 53600c1..2c25f26 100644 --- a/fx/CB_StrExt.c +++ b/fx/CB_StrExt.c @@ -1,5 +1,7 @@ #include "CB.h" +char ReEnterSEE=0; + const char TypeTitle[][10]={"Strings ","Function ","Graphics "}; const char TypeStr[][2]={"S","f","Y"}; @@ -13,12 +15,13 @@ int SelectMemoryNum( int type, int max, int store, unsigned int *key ) { // PopUpWin(4); FkeyClearAll(); locate( 3,2); if ( store ) Print((unsigned char *)"Store In"); else Print((unsigned char *)"Recall From"); - locate( 3,3); Print((unsigned char *)TypeTitle[type]); + locate( 5,3); Print((unsigned char *)TypeTitle[type]); locate(14,3); Print((unsigned char *)"Memory"); locate( 3,5); sprintf(buffer,"%s[%d~%d]:",TypeStr[type],1,max); Print((unsigned char *)buffer); buffer[0]='\0'; while (1) { n=InputNumD(13+strlen(buffer), 5, log10(max)+1, n, " ", REV_OFF, FLOAT_OFF, EXP_OFF, &(*key)); // 0123456789 + if ( (*key) == KEY_CTRL_EXIT ) break; if ( n == n0 ) break; if ( (1<=n)&&(n<=max) ) break; n=n0; @@ -67,6 +70,14 @@ char* GetStringPtr(int type, int n ){ // ----------- Store String type: 0:st return str; } +char* RecallStringSub( int reg, int select ) { + char *str; + if ( ( MatAry[reg].SizeA < select ) ) return NULL; + str = MatrixPtr( reg, select, 1 ) ; + if ( str[0]=='\0' ) return NULL; + return str; +} + char* CB_RecallString(int type ){ // ----------- Recall String type: 0:string 1:fn 2:GraphY unsigned int key; int reg,dimA; @@ -74,13 +85,13 @@ char* CB_RecallString(int type ){ // ----------- Recall String type: 0:string char *string; LoadStringType( type, ®, &opNum ); dimA = MatAry[reg].SizeA ; + n = SelectMemoryNum( type, opNum, 0, &key ); + if ( key == KEY_CTRL_EXIT ) return 0; if ( dimA == 0 ) { string = NULL; } else { - n = SelectMemoryNum( type, opNum, 0, &key ); - if ( key == KEY_CTRL_EXIT ) return 0; if ( dimA >= n ) { - string = MatrixPtr(reg, n, 1); + string = RecallStringSub(reg, n ); } else string = NULL; } return string; @@ -124,7 +135,8 @@ char* CB_SeeString(int type, int *select, char *clipbuffer ){ // ----------- See int reg,dimA,dimB,ElementSize; int base; char *string=0,*str=0; - + char opcodeFN[]="\xF9\x1B"; + char *scrbuf[896]; memcpy( scrbuf, PictAry[0], 896); // store VRAM @@ -175,8 +187,10 @@ 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"); - Fkey_Icon( FKeyNo3, 240 ); // Fkey_dispR( FKeyNo3, " fn "); + 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"); // Bdisp_PutDisp_DD(); @@ -185,13 +199,6 @@ char* CB_SeeString(int type, int *select, char *clipbuffer ){ // ----------- See // ElementSize=MatAry[reg].ElementSize; GetKey( &key ); - if ( KEY_CTRL_XTT == key ) (*select)=23; // X - if ( KEY_CHAR_ANS == key ) (*select)=28; // Ans - if ( KEY_CHAR_THETA == key ) (*select)=27; // Theta - if ( KEY_CHAR_VALR == key ) (*select)=26; // - if ( ( 'A' <= key ) && ( key <= 'z' ) ) { - (*select)=key-'A'; - } switch (key) { case KEY_CTRL_EXIT: cont=0; @@ -203,38 +210,61 @@ char* CB_SeeString(int type, int *select, char *clipbuffer ){ // ----------- See case KEY_CTRL_UP: (*select) -= 1; if ( (*select)<1 ) (*select)=opNum; -// if ( abs(i-(*select))>1 ) seltop=(*select); break; case KEY_CTRL_DOWN: (*select) += 1; if ( (*select)>opNum ) (*select)=1; -// if ( abs(i-(*select))>1 ) seltop=(*select); break; - case KEY_CTRL_LEFT: + case KEY_CTRL_PAGEUP: (*select) -= 6; if ( (*select)<1 ) (*select)=opNum; -// if ( abs(i-(*select))>1 ) seltop=(*select); break; - case KEY_CTRL_RIGHT: - (*select) -= 6; + case KEY_CTRL_PAGEDOWN: + (*select) += 6; if ( (*select)>opNum ) (*select)=1; -// if ( abs(i-(*select))>1 ) seltop=(*select); break; case KEY_CTRL_F1: // store CB_StoreStringSub( type, (*select), clipbuffer ); break; case KEY_CTRL_F2: // recall - str = MatrixPtr( reg, (*select), 1 ) ; + str = RecallStringSub( reg, (*select) ) ; cont=0; break; - case KEY_CTRL_F3: // fn - str='\0'; - cont=0; - break; -// case KEY_CTRL_F4: -// break; + case KEY_CTRL_F3: // + if ( type!=1 ) break; + str=opcodeFN; + cont=0; + break; + + case KEY_CTRL_F5: + case KEY_CTRL_LEFT: + case KEY_CTRL_RIGHT: + if ( ReEnterSEE == 0 ) { + FkeyClearAll(); + Bdisp_AreaReverseVRAM(0, y*8, 127, y*8+7); // reverse (*select) line + string=GetStringPtr(type, (*select) ); + ReEnterSEE=1; + if ( key==KEY_CTRL_RIGHT ) { + key=InputStrSub( 5, y+1, 17, 0, string, MatAry[reg].SizeB-1, " ", REV_OFF, FLOAT_ON, EXP_ON, ALPHA_ON, HEX_OFF, PAL_ON, EXIT_CANCEL_OFF, AC_CANCEL_OFF); + } else { + key=InputStr( 5, y+1, 17, string, MatAry[reg].SizeB-1, " ", REV_OFF); + } + ReEnterSEE=0; + } + break; + +// case KEY_CHAR_STORE: +// if ( ReEnterSEE == 0 ) { +// FkeyClearAll(); +// Bdisp_AreaReverseVRAM(0, y*8, 127, y*8+7); // reverse (*select) line +// string=GetStringPtr(type, (*select) ); +// ReEnterSEE=1; +// key=InputStr( 5, y+1, 17, string, MatAry[reg].SizeB-1, " ", REV_OFF); +// ReEnterSEE=0; +// } +// break; default: break;