Merge of r1709 into trunk: Atari Falcon port

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1710 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2011-02-06 19:30:55 +00:00
parent 57a1bda6de
commit d0aaabf6b2
23 changed files with 536 additions and 90 deletions

View File

@@ -2,6 +2,7 @@
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2011 Pawel Góralski
Copyright 2008 Peter Gordon
Copyright 2008 Yves Rizoud
Copyright 2008 Franck Charlet
@@ -33,6 +34,10 @@
#include <sys/vfs.h>
#elif defined(__HAIKU__)
#include "haiku.h"
#elif defined (__MINT__)
#include <mint/sysbind.h>
#include <mint/osbind.h>
#include <mint/ostruct.h>
#endif
#include "const.h"
@@ -640,7 +645,51 @@ void Button_Stats(void)
Print_in_window(10,35,"Build options:",STATS_TITLE_COLOR,MC_Black);
Print_in_window(146,35,TrueType_is_supported()?"TTF fonts":"no TTF fonts",STATS_DATA_COLOR,MC_Black);
#if defined (__MINT__)
// Affichage de la mémoire restante
Print_in_window(10,43,"Free memory: ",STATS_TITLE_COLOR,MC_Black);
freeRam=0;
char helpBuf[64];
unsigned long STRAM,TTRAM;
Atari_Memory_free(&STRAM,&TTRAM);
freeRam=STRAM+TTRAM;
buffer[0]='\0';
if(STRAM > (100*1024*1024))
sprintf(helpBuf,"ST:%u Mb ",(unsigned int)(STRAM/(1024*1024)));
else if(freeRam > 100*1024)
sprintf(helpBuf,"ST:%u Kb ",(unsigned int)(STRAM/1024));
else
sprintf(helpBuf,"ST:%u b ",(unsigned int)STRAM);
strncat(buffer,helpBuf,sizeof(char)*37);
if(TTRAM > (100ULL*1024*1024*1024))
sprintf(helpBuf,"TT:%u Gb",(unsigned int)(TTRAM/(1024*1024*1024)));
else if(TTRAM > (100*1024*1024))
sprintf(helpBuf,"TT:%u Mb",(unsigned int)(TTRAM/(1024*1024)));
else if(freeRam > 100*1024)
sprintf(helpBuf,"TT:%u Kb",(unsigned int)(TTRAM/1024));
else
sprintf(helpBuf,"TT:%u b",(unsigned int)TTRAM);
strncat(buffer,helpBuf,sizeof(char)*37);
if(freeRam > (100ULL*1024*1024*1024))
sprintf(helpBuf,"(%u Gb)",(unsigned int)(freeRam/(1024*1024*1024)));
else if(freeRam > (100*1024*1024))
sprintf(helpBuf,"(%u Mb)",(unsigned int)(freeRam/(1024*1024)));
else if(freeRam > 100*1024)
sprintf(helpBuf,"(%u Kb)",(unsigned int)(freeRam/1024));
else
sprintf(helpBuf,"(%u b)",(unsigned int)freeRam);
strncat(buffer,helpBuf,sizeof(char)*37);
Print_in_window(18,51,buffer,STATS_DATA_COLOR,MC_Black);
#else
// Affichage de la mémoire restante
Print_in_window(10,51,"Free memory: ",STATS_TITLE_COLOR,MC_Black);
@@ -654,8 +703,12 @@ void Button_Stats(void)
sprintf(buffer,"%u Kilobytes",(unsigned int)(freeRam/1024));
else
sprintf(buffer,"%u bytes",(unsigned int)freeRam);
Print_in_window(114,51,buffer,STATS_DATA_COLOR,MC_Black);
#endif
// Used memory
Print_in_window(10,59,"Used memory pages: ",STATS_TITLE_COLOR,MC_Black);
if(Stats_pages_memory > (100LL*1024*1024*1024))
@@ -685,6 +738,14 @@ void Button_Stats(void)
}
#elif defined(__HAIKU__)
mem_size = haiku_get_free_space(Main_current_directory);
#elif defined (__MINT__)
_DISKINFO drvInfo;
mem_size=0;
Dfree(&drvInfo,0);
//number of free clusters*sectors per cluster*bytes per sector;
// reports current drive
mem_size=drvInfo.b_free*drvInfo.b_clsiz*drvInfo.b_secsiz;
#else
// Free disk space is only for shows. Other platforms can display 0.
#warning "Missing code for your platform !!! Check and correct please :)"