mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-17 11:10:45 +00:00
CMS50 Code review and cleanup
This commit is contained in:
parent
b302f528bc
commit
7c46b36b53
@ -8295,7 +8295,7 @@
|
|||||||
<sleeplib/machine.h>
|
<sleeplib/machine.h>
|
||||||
<list>
|
<list>
|
||||||
|
|
||||||
1307409339 /home/mark/projects/git/sleepyhead/src/version.h
|
1307412369 /home/mark/projects/git/sleepyhead/src/version.h
|
||||||
|
|
||||||
1307358939 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h
|
1307358939 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h
|
||||||
"machine.h"
|
"machine.h"
|
||||||
@ -8312,7 +8312,7 @@
|
|||||||
"preferences.h"
|
"preferences.h"
|
||||||
"tinyxml/tinyxml.h"
|
"tinyxml/tinyxml.h"
|
||||||
|
|
||||||
1307376956 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp
|
1307409337 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp
|
||||||
"wx_pch.h"
|
"wx_pch.h"
|
||||||
"version.h"
|
"version.h"
|
||||||
<wx/app.h>
|
<wx/app.h>
|
||||||
@ -8368,7 +8368,7 @@
|
|||||||
<wx/stdpaths.h>
|
<wx/stdpaths.h>
|
||||||
"preferences.h"
|
"preferences.h"
|
||||||
|
|
||||||
1307372029 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/profiles.cpp
|
1307411755 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/profiles.cpp
|
||||||
<wx/filefn.h>
|
<wx/filefn.h>
|
||||||
<wx/filename.h>
|
<wx/filename.h>
|
||||||
<wx/utils.h>
|
<wx/utils.h>
|
||||||
@ -8413,7 +8413,7 @@
|
|||||||
1307358939 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.h
|
1307358939 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.h
|
||||||
"sleeplib/machine_loader.h"
|
"sleeplib/machine_loader.h"
|
||||||
|
|
||||||
1307372542 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp
|
1307412363 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp
|
||||||
<wx/log.h>
|
<wx/log.h>
|
||||||
<wx/progdlg.h>
|
<wx/progdlg.h>
|
||||||
"cms50_loader.h"
|
"cms50_loader.h"
|
||||||
|
@ -57,7 +57,7 @@ bool CMS50Loader::OpenCMS50(wxString & path, Profile *profile)
|
|||||||
bool cont=dir.GetFirst(&filename);
|
bool cont=dir.GetFirst(&filename);
|
||||||
|
|
||||||
while (cont) {
|
while (cont) {
|
||||||
if (filename.EndsWith(wxT(".spoR"))) {
|
if (filename.Lower().EndsWith(wxT(".spor"))) {
|
||||||
pathname=path+wxFileName::GetPathSeparator()+filename;
|
pathname=path+wxFileName::GetPathSeparator()+filename;
|
||||||
files.push_back(pathname);
|
files.push_back(pathname);
|
||||||
}
|
}
|
||||||
@ -100,19 +100,27 @@ bool CMS50Loader::OpenSPORFile(wxString path,Machine *mach,Profile *profile)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
f.Read(tmp,2);
|
br=f.Read(tmp,2);
|
||||||
|
if (br!=2) return false;
|
||||||
data_starts=tmp[0] | (tmp[1] << 8);
|
data_starts=tmp[0] | (tmp[1] << 8);
|
||||||
f.Read(tmp,2);
|
|
||||||
|
br=f.Read(tmp,2);
|
||||||
|
if (br!=2) return false;
|
||||||
some_code=tmp[0] | (tmp[1] << 8); // == 512
|
some_code=tmp[0] | (tmp[1] << 8); // == 512
|
||||||
f.Read(tmp,2);
|
|
||||||
|
br=f.Read(tmp,2);
|
||||||
|
if (br!=2) return false;
|
||||||
num_records=tmp[0] | (tmp[1] << 8);
|
num_records=tmp[0] | (tmp[1] << 8);
|
||||||
num_records <<= 1;
|
num_records <<= 1;
|
||||||
|
|
||||||
f.Read(tmp,2);
|
br=f.Read(tmp,2);
|
||||||
some_more_code=tmp[0] | (tmp[1] << 8); // == 512
|
if (br!=2) return false;
|
||||||
|
some_more_code=tmp[0] | (tmp[1] << 8); // == 0
|
||||||
|
|
||||||
f.Read(tmp,34);
|
br=f.Read(tmp,34);
|
||||||
|
if (br!=34) return false;
|
||||||
|
|
||||||
|
// Widechar date string in format 'DD/MM/YY HH:MM:SS'
|
||||||
for (int i=0;i<17;i++) {
|
for (int i=0;i<17;i++) {
|
||||||
tmp[i]=tmp[i << 1];
|
tmp[i]=tmp[i << 1];
|
||||||
}
|
}
|
||||||
@ -124,10 +132,12 @@ bool CMS50Loader::OpenSPORFile(wxString path,Machine *mach,Profile *profile)
|
|||||||
//wxLogMessage(datestr);
|
//wxLogMessage(datestr);
|
||||||
|
|
||||||
f.Seek(data_starts,wxFromStart);
|
f.Seek(data_starts,wxFromStart);
|
||||||
buffer=new char [num_records*2];
|
|
||||||
|
buffer=new char [num_records];
|
||||||
br=f.Read(buffer,num_records);
|
br=f.Read(buffer,num_records);
|
||||||
if (br!=num_records) {
|
if (br!=num_records) {
|
||||||
wxLogDebug(wxT("Short .spoR File: ")+path);
|
wxLogError(wxT("Short .spoR File: ")+path);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime last_pulse_time=date;
|
wxDateTime last_pulse_time=date;
|
||||||
|
@ -171,7 +171,7 @@ void Profile::Import(wxString path)
|
|||||||
wxLogMessage(wxT("Importing ")+path);
|
wxLogMessage(wxT("Importing ")+path);
|
||||||
list<MachineLoader *>loaders=GetLoaders();
|
list<MachineLoader *>loaders=GetLoaders();
|
||||||
for (list<MachineLoader *>::iterator i=loaders.begin(); i!=loaders.end(); i++) {
|
for (list<MachineLoader *>::iterator i=loaders.begin(); i!=loaders.end(); i++) {
|
||||||
c+=(*i)->Open(path,this);
|
if (c+=(*i)->Open(path,this)) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,14 +16,14 @@ namespace AutoVersion{
|
|||||||
//Standard Version Type
|
//Standard Version Type
|
||||||
static const long MAJOR = 0;
|
static const long MAJOR = 0;
|
||||||
static const long MINOR = 7;
|
static const long MINOR = 7;
|
||||||
static const long BUILD = 3335;
|
static const long BUILD = 3342;
|
||||||
static const long REVISION = 1351;
|
static const long REVISION = 1381;
|
||||||
|
|
||||||
//Miscellaneous Version Types
|
//Miscellaneous Version Types
|
||||||
static const long BUILDS_COUNT = 506;
|
static const long BUILDS_COUNT = 520;
|
||||||
#define RC_FILEVERSION 0,7,3335,1351
|
#define RC_FILEVERSION 0,7,3342,1381
|
||||||
#define RC_FILEVERSION_STRING "0, 7, 3335, 1351\0"
|
#define RC_FILEVERSION_STRING "0, 7, 3342, 1381\0"
|
||||||
static const char FULLVERSION_STRING[] = "0.7.3335.1351";
|
static const char FULLVERSION_STRING[] = "0.7.3342.1381";
|
||||||
|
|
||||||
//These values are to keep track of your versioning state, don't modify them.
|
//These values are to keep track of your versioning state, don't modify them.
|
||||||
static const long BUILD_HISTORY = 0;
|
static const long BUILD_HISTORY = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user