FX 02.46.0200

This commit is contained in:
CalcLoverHK 2024-01-25 03:21:40 +08:00
parent 3e0b083353
commit 31fa8e0beb
4 changed files with 40 additions and 37 deletions

View File

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

View File

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

View File

@ -1377,40 +1377,6 @@ int deleteFile( FONTCHARACTER *filename, int size ){
return 0; // ok
}
/* store bytecode into file */
int storeFile( const char *name, unsigned char* codes, int size )
{
int handle;
FONTCHARACTER filename[FONTCHARACTER_MAX];
FONTCHARACTER filename2[FONTCHARACTER_MAX];
int r,s;
unsigned int freehigh,freelow;
/* disable, just for call "Bfile_FindFirst" */
FONTCHARACTER buffer[FONTCHARACTER_MAX];
FILE_INFO info;
/* end */
CharToFont( name, filename );
CharToFont( name, filename2 );
r = deleteFile( filename2, size ) ;
if ( r ) return r;
FileListUpdate=1;
handle = Bfile_CreateFile( filename, size );
if( handle < 0 ) { ErrorMSGfile( "Can't create file", name, handle ); return 1 ; }
r = Bfile_CloseFile( handle );
handle = Bfile_OpenFile( filename, _OPENMODE_WRITE );
if( handle < 0 ) { ErrorMSG( "Can't open file", handle ); return 1 ; }
Bfile_WriteFile( handle, codes, size );
r = Bfile_CloseFile( handle );
if( r ) { ErrorMSG( "Close error", handle ); return 1 ; }
return 0 ;
}
int GetFileSize( const char *fname ) {
int handle;
FONTCHARACTER filename[FONTCHARACTER_MAX];
@ -1433,6 +1399,43 @@ int GetFileSize( const char *fname ) {
return size;
}
/* store bytecode into file */
int storeFile( const char *name, unsigned char* codes, int size )
{
int handle;
FONTCHARACTER filename[FONTCHARACTER_MAX];
FONTCHARACTER filename2[FONTCHARACTER_MAX];
int r,s,fsize;
unsigned int freehigh,freelow;
/* disable, just for call "Bfile_FindFirst" */
FONTCHARACTER buffer[FONTCHARACTER_MAX];
FILE_INFO info;
/* end */
CharToFont( name, filename );
CharToFont( name, filename2 );
FileListUpdate=1;
fsize = GetFileSize( name );
if ( ( fsize > size ) || ( fsize==0 ) || ( Is35E2==0 ) ) { // delete & create file
r = deleteFile( filename2, size ) ;
if ( r ) return r;
handle = Bfile_CreateFile( filename, size );
if( handle < 0 ) { ErrorMSGfile( "Can't create file", (char*)name, handle ); return 1 ; }
r = Bfile_CloseFile( handle );
}
handle = Bfile_OpenFile( filename, _OPENMODE_WRITE );
if( handle < 0 ) { ErrorMSG( "Can't open file", handle ); return 1 ; }
Bfile_WriteFile( handle, codes, size );
r = Bfile_CloseFile( handle );
if( r ) { ErrorMSG( "Close error", handle ); return 1 ; }
return 0 ;
}
int ExistFile( char *fname, int replace ) {
int handle;
FONTCHARACTER filename[FONTCHARACTER_MAX];

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 01 ", MINI_OVER );
PrintMini(13*6+2, 2*8+1, (unsigned char*)"build 02 ", MINI_OVER );
PrintMini( 2*6+2, 3*8+1, (unsigned char*)"(Casio Basic compatible+)", MINI_OVER );
// if ( ( UseHiddenRAM ) && ( IsHiddenRAM ) ) {