--- np2/macosx/sysmng.cpp 2003/10/20 10:14:27 1.4 +++ np2/macosx/sysmng.cpp 2004/01/11 16:58:47 1.11 @@ -1,11 +1,11 @@ #include "compiler.h" #include "np2.h" #include "dosio.h" -#include "i286.h" #include "sysmng.h" +#include "cpucore.h" #include "pccore.h" #include "fddfile.h" - +#include "diskdrv.h" UINT sys_updates; @@ -24,7 +24,7 @@ static struct { void sysmng_workclockreset(void) { workclock.tick = GETTICK(); - workclock.clock = I286_CLOCK; + workclock.clock = CPU_CLOCK; workclock.draws = drawcount; } @@ -39,27 +39,40 @@ BOOL sysmng_workclockrenewal(void) { workclock.tick += tick; workclock.fps = ((drawcount - workclock.draws) * 10000) / tick; workclock.draws = drawcount; - workclock.khz = (I286_CLOCK - workclock.clock) / tick; - workclock.clock = I286_CLOCK; + workclock.khz = (CPU_CLOCK - workclock.clock) / tick; + workclock.clock = CPU_CLOCK; return(TRUE); } void sysmng_updatecaption(BYTE flag) { + char name1[255], name2[255]; char work[256]; +#ifndef NP2GCC Str255 str; +#endif if (flag & 1) { strtitle[0] = '\0'; if (fdd_diskready(0)) { milstr_ncat(strtitle, " FDD1:", sizeof(strtitle)); - milstr_ncat(strtitle, file_getname((char *)fdd_diskname(0)), + if (getLongFileName(name1, fdd_diskname(0))) { + milstr_ncat(strtitle, name1, sizeof(strtitle)); + } + else { + milstr_ncat(strtitle, file_getname((char *)fdd_diskname(0)), sizeof(strtitle)); + } } if (fdd_diskready(1)) { milstr_ncat(strtitle, " FDD2:", sizeof(strtitle)); - milstr_ncat(strtitle, file_getname((char *)fdd_diskname(1)), + if (getLongFileName(name2, fdd_diskname(1))) { + milstr_ncat(strtitle, name2, sizeof(strtitle)); + } + else { + milstr_ncat(strtitle, file_getname((char *)fdd_diskname(1)), sizeof(strtitle)); + } } } if (flag & 2) { @@ -82,15 +95,21 @@ void sysmng_updatecaption(BYTE flag) { milstr_ncat(strclock, work, sizeof(strclock)); } } +#if defined(NP2GCC) + milstr_ncpy(work, np2oscfg.titles, sizeof(work)); +#else milstr_ncpy(work, "Neko Project II", sizeof(work)); +#endif milstr_ncat(work, strtitle, sizeof(work)); milstr_ncat(work, strclock, sizeof(work)); - mkstr255(str, work); #if defined(NP2GCC) - SetWindowTitleWithCFString(hWndMain, CFStringCreateWithPascalString(NULL, str, CFStringGetSystemEncoding())); + CFStringRef cfstr; + cfstr = CFStringCreateWithCString(NULL, work, CFStringGetSystemEncoding()); + SetWindowTitleWithCFString(hWndMain, cfstr); + CFRelease(cfstr); #else + mkstr255(str, work); SetWTitle(hWndMain, str); #endif } -