Merge branch 'development' into linux-cheats

This commit is contained in:
Matthew Budd 2020-05-08 23:55:29 -04:00
commit 77471eb1a0
7 changed files with 46 additions and 19 deletions

View File

@ -19,8 +19,8 @@ opts.AddVariables(
BoolVariable('FRAMESKIP', 'Enable frameskipping', 1),
BoolVariable('OPENGL', 'Enable OpenGL support', 1),
BoolVariable('LUA', 'Enable Lua support', 1),
BoolVariable('GTK', 'Enable GTK2 GUI (SDL only)', 1),
BoolVariable('GTK3', 'Enable GTK3 GUI (SDL only)', 0),
BoolVariable('GTK', 'Enable GTK2 GUI (SDL only)', 0),
BoolVariable('GTK3', 'Enable GTK3 GUI (SDL only)', 1),
BoolVariable('NEWPPU', 'Enable new PPU core', 1),
BoolVariable('CREATE_AVI', 'Enable avi creation support (SDL only)', 1),
BoolVariable('LOGO', 'Enable a logoscreen when creating avis (SDL only)', 1),

View File

@ -5,12 +5,12 @@
trigger:
- master
- linux-cheats
- development
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
which scons-3
displayName: 'Build'
./azure/linux_build.sh
displayName: 'make'

23
azure/linux_build.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
id
pwd
cat /etc/os-release
gcc --version
python2 --version
python3 --version
sudo apt-get install lua5.1-dev
sudo apt-get install libsdl1.2-dev
sudo apt-get install libsdl2-dev
sudo apt-get install libminizip-dev
#sudo apt-get install libxml2-dev
#sudo apt-get install libgtk2.0-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install libgtksourceview-3.0-dev
sudo apt-get install scons
scons GTK3=1 SYSTEM_LUA=1 SYSTEM_MINIZIP=1 CREATE_AVI=1
ls -ltr ./bin/*

View File

@ -133,7 +133,7 @@ void EMUFILE::write64le(u64 val)
size_t EMUFILE::read64le(u64 *Bufo)
{
u64 buf;
u64 buf=0;
if(fread((char*)&buf,8) != 8)
return 0;
#ifndef LOCAL_BE
@ -174,7 +174,7 @@ size_t EMUFILE::read32le(s32* Bufo) { return read32le((u32*)Bufo); }
size_t EMUFILE::read32le(u32* Bufo)
{
u32 buf;
u32 buf=0;
if(fread(&buf,4)<4)
return 0;
#ifndef LOCAL_BE
@ -213,7 +213,7 @@ size_t EMUFILE::read16le(s16* Bufo) { return read16le((u16*)Bufo); }
size_t EMUFILE::read16le(u16* Bufo)
{
u32 buf;
u32 buf=0;
if(fread(&buf,2)<2)
return 0;
#ifndef LOCAL_BE

View File

@ -104,12 +104,14 @@ void ApplyIPS(FILE *ips, FCEUFILE* fp)
if((offset+size)>(uint32)fp->size)
{
// Probably a little slow.
buf=(char *)realloc(buf,offset+size);
if(!buf)
char *newbuf=(char *)realloc(buf,offset+size);
if(!newbuf)
{
free(buf); buf=NULL;
FCEU_printf(" Oops. IPS patch %d(type RLE) goes beyond end of file. Could not allocate memory.\n",count);
goto end;
}
buf=newbuf;
memset(buf+fp->size,0,offset+size-fp->size);
fp->size=offset+size;
}
@ -127,12 +129,14 @@ void ApplyIPS(FILE *ips, FCEUFILE* fp)
if((offset+size)>(uint32)fp->size)
{
// Probably a little slow.
buf=(char *)realloc(buf,offset+size);
if(!buf)
char *newbuf=(char *)realloc(buf,offset+size);
if(!newbuf)
{
free(buf); buf=NULL;
FCEU_printf(" Oops. IPS patch %d(type normal) goes beyond end of file. Could not allocate memory.\n",count);
goto end;
}
buf=newbuf;
memset(buf+fp->size,0,offset+size-fp->size);
}
fread(buf+offset,1,size,ips);
@ -475,9 +479,9 @@ void FCEUI_SetDirOverride(int which, char *n)
va_list ap;
int ret;
va_start(ap,fmt);
if(!(*strp=(char*)FCEU_dmalloc(2048))) //mbg merge 7/17/06 cast to char*
return(0);
va_start(ap,fmt);
ret=vsnprintf(*strp,2048,fmt,ap);
va_end(ap);
return(ret);

View File

@ -275,7 +275,7 @@ int write64le(uint64 b, EMUFILE* os)
int read32le(uint32 *Bufo, EMUFILE *fp)
{
uint32 buf;
uint32 buf=0;
if(fp->_fread(&buf,4)<4)
return 0;
#ifdef LOCAL_LE
@ -288,7 +288,7 @@ int read32le(uint32 *Bufo, EMUFILE *fp)
int read16le(u16 *Bufo, EMUFILE *is)
{
u16 buf;
u16 buf=0;
if(is->_fread((char*)&buf,2) != 2)
return 0;
#ifdef LOCAL_LE
@ -301,7 +301,7 @@ int read16le(u16 *Bufo, EMUFILE *is)
int read64le(uint64 *Bufo, EMUFILE *is)
{
uint64 buf;
uint64 buf=0;
if(is->_fread((char*)&buf,8) != 8)
return 0;
#ifdef LOCAL_LE

View File

@ -28,10 +28,10 @@ uint32 uppow2(uint32 n)
int x;
for(x=31;x>=0;x--)
if(n&(1<<x))
if(n&(1u<<x))
{
if((1<<x)!=n)
return(1<<(x+1));
if((1u<<x)!=n)
return(1u<<(x+1));
break;
}
return n;