This commit is contained in:
Gwenhael Le Moine 2024-04-13 13:41:30 +02:00
parent 46f45ff4b6
commit 42abcaba54
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
3 changed files with 5 additions and 5 deletions

View file

@ -172,4 +172,4 @@ void press_ON( void ) { kbd_on_pressed(); }
void release_ON( void ) { kbd_on_released(); } void release_ON( void ) { kbd_on_released(); }
void press_LoadFile( void ) {} void press_LoadFile( void ) {}
void release_LoadFile( void ) { load_file( "zeldahp.dir" ); } void release_LoadFile( void ) { load_file_on_stack( "zeldahp.dir" ); }

View file

@ -41,9 +41,9 @@ int file_size( char* name )
sprintf( fullpath, "%s/%s", WorkingPath, name ); sprintf( fullpath, "%s/%s", WorkingPath, name );
printf( "%s\n", fullpath ); printf( "%s\n", fullpath );
f = fopen( fullpath, "r" ); f = fopen( fullpath, "r" );
if ( !f ) { if ( !f )
return 0; return 0;
}
fseek( f, 0, SEEK_END ); // seek to end of file fseek( f, 0, SEEK_END ); // seek to end of file
int size = ( int )ftell( f ); // get current file pointer int size = ( int )ftell( f ); // get current file pointer
fseek( f, 0, SEEK_SET ); // seek back to beginning of file fseek( f, 0, SEEK_SET ); // seek back to beginning of file
@ -52,7 +52,7 @@ int file_size( char* name )
return size; return size;
} }
void load_file( char* name ) void load_file_on_stack( char* name )
{ {
FILE* f; FILE* f;
byte* buf; byte* buf;

View file

@ -6,6 +6,6 @@
extern char WorkingPath[ 512 ]; extern char WorkingPath[ 512 ];
extern int file_size( char* name ); extern int file_size( char* name );
extern void load_file( char* name ); extern void load_file_on_stack( char* name );
#endif #endif