diff --git a/SConstruct b/SConstruct index c2e6b021..1c6a3246 100644 --- a/SConstruct +++ b/SConstruct @@ -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), diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fe2ace3f..e0acee95 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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' diff --git a/azure/linux_build.sh b/azure/linux_build.sh new file mode 100755 index 00000000..3b6bba04 --- /dev/null +++ b/azure/linux_build.sh @@ -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/* diff --git a/src/emufile.cpp b/src/emufile.cpp index 162e8df0..e0e83115 100644 --- a/src/emufile.cpp +++ b/src/emufile.cpp @@ -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 diff --git a/src/file.cpp b/src/file.cpp index 9860d87e..dfbba02e 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -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); diff --git a/src/utils/endian.cpp b/src/utils/endian.cpp index 71732ff1..56704d41 100644 --- a/src/utils/endian.cpp +++ b/src/utils/endian.cpp @@ -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 diff --git a/src/utils/general.cpp b/src/utils/general.cpp index c84d9e70..9f49a19b 100644 --- a/src/utils/general.cpp +++ b/src/utils/general.cpp @@ -28,10 +28,10 @@ uint32 uppow2(uint32 n) int x; for(x=31;x>=0;x--) - if(n&(1<