Initial port to Linux (using Allegro).
64-bit fixes. Some changes to aid portability. A few other tweaks.
This commit is contained in:
parent
4b3f77c926
commit
56b455844e
70 changed files with 12702 additions and 282 deletions
38
src/nvr.c
38
src/nvr.c
|
|
@ -1,5 +1,4 @@
|
|||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "nvr.h"
|
||||
|
|
@ -11,46 +10,11 @@ int nvrmask=63;
|
|||
uint8_t nvrram[128];
|
||||
int nvraddr;
|
||||
|
||||
SYSTEMTIME systemtime;
|
||||
|
||||
int nvr_dosave = 0;
|
||||
|
||||
void getnvrtime()
|
||||
{
|
||||
int c,d;
|
||||
uint8_t baknvr[10];
|
||||
// memset(nvrram,0,10);
|
||||
// return;
|
||||
memcpy(baknvr,nvrram,10);
|
||||
GetLocalTime(&systemtime);
|
||||
d=systemtime.wSecond%10;
|
||||
c=systemtime.wSecond/10;
|
||||
nvrram[0]=d|(c<<4);
|
||||
d=systemtime.wMinute%10;
|
||||
c=systemtime.wMinute/10;
|
||||
nvrram[2]=d|(c<<4);
|
||||
d=systemtime.wHour%10;
|
||||
c=systemtime.wHour/10;
|
||||
nvrram[4]=d|(c<<4);
|
||||
d=systemtime.wDayOfWeek%10;
|
||||
c=systemtime.wDayOfWeek/10;
|
||||
nvrram[6]=d|(c<<4);
|
||||
d=systemtime.wDay%10;
|
||||
c=systemtime.wDay/10;
|
||||
nvrram[7]=d|(c<<4);
|
||||
d=systemtime.wMonth%10;
|
||||
c=systemtime.wMonth/10;
|
||||
nvrram[8]=d|(c<<4);
|
||||
d=systemtime.wYear%10;
|
||||
c=(systemtime.wYear/10)%10;
|
||||
nvrram[9]=d|(c<<4);
|
||||
if (baknvr[0]!=nvrram[0] ||
|
||||
baknvr[2]!=nvrram[2] ||
|
||||
baknvr[4]!=nvrram[4] ||
|
||||
baknvr[6]!=nvrram[6] ||
|
||||
baknvr[7]!=nvrram[7] ||
|
||||
baknvr[8]!=nvrram[8] ||
|
||||
baknvr[9]!=nvrram[9]) nvrram[0xA]|=0x80;
|
||||
time_get(nvrram);
|
||||
}
|
||||
|
||||
void nvr_recalc()
|
||||
|
|
|
|||
Loading…
Reference in a new issue