New Fahrplan l0dable and scd files

This commit is contained in:
roy rocket 2011-12-25 00:27:44 +01:00
parent 4af4cfdf38
commit 4c7ed0c200
3 changed files with 25 additions and 20 deletions

View File

@ -18,6 +18,8 @@ typedef uint8_t uchar;
static unsigned long iter=0;
static int getint3fromf(FIL *file);
void ram(void) {
getInputWaitRelease();
@ -38,7 +40,8 @@ void ram(void) {
lcdClear();
setExtFont(GLOBAL(nickfont));
/* setExtFont(GLOBAL(nickfont)); */
setExtFont(NULL);
/* nickheight=getFontHeight(); */
@ -54,16 +57,12 @@ void ram(void) {
res+=f_read(&file, (char *)favers, 4, &readbytes);
favers[4]=0;
res+=f_read(&file, (char *)&ob, 1, &readbytes);
evcur=ob;
res+=f_read(&file, (char *)&ob, 1, &readbytes);
evcur+=ob*256;
lcdClear();
DoString(0,0,"Fahrplan ");
DoString(60,0,favers);
DoString(0,16,"SW Rel. V0.001");
if(filvers!=1) {
if(filvers!=2) {
DoString(0,24,"Incompatible ");
DoString(0,32,"Binary. Get ");
DoString(0,40,"update from ");
@ -87,6 +86,8 @@ void ram(void) {
getInputWait();
getInputWaitRelease();
evcur=getint3fromf(&file);
while (1) {
++iter;
lcdDisplay();
@ -100,20 +101,9 @@ void ram(void) {
#ifndef SIMULATOR
f_lseek(&file,evcur);
res+=f_read(&file, (char *)&ob, 1, &readbytes);
eventid=ob;
res+=f_read(&file, (char *)&ob, 1, &readbytes);
eventid+=ob*256;
res+=f_read(&file, (char *)&ob, 1, &readbytes);
evprv=ob;
res+=f_read(&file, (char *)&ob, 1, &readbytes);
evprv+=ob*256;
res+=f_read(&file, (char *)&ob, 1, &readbytes);
evnext=ob;
res+=f_read(&file, (char *)&ob, 1, &readbytes);
evnext+=ob*256;
eventid=getint3fromf(&file);
evprv=getint3fromf(&file);
evnext=getint3fromf(&file);
res+=f_read(&file, (char *)title, 15, &readbytes);
res+=f_read(&file, (char *)info, 15, &readbytes);
@ -184,3 +174,18 @@ void ram(void) {
}
return;
}
static int getint3fromf(FIL *file) {
unsigned char ob;
UINT readbytes;
int res;
f_read(file, (char *)&ob, 1, &readbytes);
res=ob;
f_read(file, (char *)&ob, 1, &readbytes);
res+=ob*256;
f_read(file, (char *)&ob, 1, &readbytes);
res+=ob*256*256;
return res;
}

Binary file not shown.

Binary file not shown.