Merge pull request #15 from TASVideos/master

Sync code to the newest
This commit is contained in:
owomomo 2019-09-22 14:29:33 +08:00 committed by GitHub
commit 3fd6f9cb1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 23 deletions

View File

@ -47,30 +47,30 @@ if platform.system == "ppc":
env.Append(CCFLAGS = ['-Wall', '-Wno-write-strings', '-Wno-sign-compare']) env.Append(CCFLAGS = ['-Wall', '-Wno-write-strings', '-Wno-sign-compare'])
env.Append(CXXFLAGS = ['-std=c++0x']) env.Append(CXXFLAGS = ['-std=c++0x'])
if os.environ.has_key('PLATFORM'): if 'PLATFORM' in os.environ:
env.Replace(PLATFORM = os.environ['PLATFORM']) env.Replace(PLATFORM = os.environ['PLATFORM'])
if os.environ.has_key('CC'): if 'CC' in os.environ:
env.Replace(CC = os.environ['CC']) env.Replace(CC = os.environ['CC'])
if os.environ.has_key('CXX'): if 'CXX' in os.environ:
env.Replace(CXX = os.environ['CXX']) env.Replace(CXX = os.environ['CXX'])
if os.environ.has_key('WINDRES'): if 'WINDRES' in os.environ:
env.Replace(WINDRES = os.environ['WINDRES']) env.Replace(WINDRES = os.environ['WINDRES'])
if os.environ.has_key('CFLAGS'): if 'CFLAGS' in os.environ:
env.Append(CCFLAGS = os.environ['CFLAGS'].split()) env.Append(CCFLAGS = os.environ['CFLAGS'].split())
if os.environ.has_key('CXXFLAGS'): if 'CXXFLAGS' in os.environ:
env.Append(CXXFLAGS = os.environ['CXXFLAGS'].split()) env.Append(CXXFLAGS = os.environ['CXXFLAGS'].split())
if os.environ.has_key('CPPFLAGS'): if 'CPPFLAGS' in os.environ:
env.Append(CPPFLAGS = os.environ['CPPFLAGS'].split()) env.Append(CPPFLAGS = os.environ['CPPFLAGS'].split())
if os.environ.has_key('LDFLAGS'): if 'LDFLAGS' in os.environ:
env.Append(LINKFLAGS = os.environ['LDFLAGS'].split()) env.Append(LINKFLAGS = os.environ['LDFLAGS'].split())
if os.environ.has_key('PKG_CONFIG_PATH'): if 'PKG_CONFIG_PATH' in os.environ:
env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH'] env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH']
if not os.environ.has_key('PKG_CONFIG_PATH') and env['PLATFORM'] == 'darwin': if 'PKG_CONFIG_PATH' not in os.environ and env['PLATFORM'] == 'darwin':
env['ENV']['PKG_CONFIG_PATH'] = "/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig" env['ENV']['PKG_CONFIG_PATH'] = "/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig"
if os.environ.has_key('PKG_CONFIG_LIBDIR'): if 'PKG_CONFIG_LIBDIR' in os.environ:
env['ENV']['PKG_CONFIG_LIBDIR'] = os.environ['PKG_CONFIG_LIBDIR'] env['ENV']['PKG_CONFIG_LIBDIR'] = os.environ['PKG_CONFIG_LIBDIR']
print "platform: ", env['PLATFORM'] print("platform: ", env['PLATFORM'])
# compile with clang # compile with clang
if env['CLANG']: if env['CLANG']:
@ -104,18 +104,18 @@ else:
assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib" assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
if env['SDL2']: if env['SDL2']:
if not conf.CheckLib('SDL2'): if not conf.CheckLib('SDL2'):
print 'Did not find libSDL2 or SDL2.lib, exiting!' print('Did not find libSDL2 or SDL2.lib, exiting!')
Exit(1) Exit(1)
env.Append(CPPDEFINES=["_SDL2"]) env.Append(CPPDEFINES=["_SDL2"])
env.ParseConfig('pkg-config sdl2 --cflags --libs') env.ParseConfig('pkg-config sdl2 --cflags --libs')
else: else:
if not conf.CheckLib('SDL'): if not conf.CheckLib('SDL'):
print 'Did not find libSDL or SDL.lib, exiting!' print('Did not find libSDL or SDL.lib, exiting!')
Exit(1) Exit(1)
env.ParseConfig('sdl-config --cflags --libs') env.ParseConfig('sdl-config --cflags --libs')
if env['GTK']: if env['GTK']:
if not conf.CheckLib('gtk-x11-2.0'): if not conf.CheckLib('gtk-x11-2.0'):
print 'Could not find libgtk-2.0, exiting!' print('Could not find libgtk-2.0, exiting!')
Exit(1) Exit(1)
# Add compiler and linker flags from pkg-config # Add compiler and linker flags from pkg-config
config_string = 'pkg-config --cflags --libs gtk+-2.0' config_string = 'pkg-config --cflags --libs gtk+-2.0'
@ -157,13 +157,13 @@ else:
lua_link_flags = "-llua" lua_link_flags = "-llua"
lua_include_dir = "/usr/include/lua" lua_include_dir = "/usr/include/lua"
if os.environ.has_key('LUA_LINKFLAGS'): if 'LUA_LINKFLAGS' in os.environ:
lua_link_flags = os.environ['LUA_LINKFLAGS'] lua_link_flags = os.environ['LUA_LINKFLAGS']
if os.environ.has_key('LUA_INCDIR'): if 'LUA_INCDIR' in os.environ:
lua_include_dir = os.environ['LUA_INCDIR'] lua_include_dir = os.environ['LUA_INCDIR']
if not lua_link_flags or not lua_include_dir: if not lua_link_flags or not lua_include_dir:
print 'Could not find liblua, exiting!' print('Could not find liblua, exiting!')
Exit(1) Exit(1)
env.Append(LINKFLAGS = lua_link_flags.split()) env.Append(LINKFLAGS = lua_link_flags.split())
@ -179,7 +179,7 @@ else:
gd = conf.CheckLib('gd', autoadd=1) gd = conf.CheckLib('gd', autoadd=1)
if gd == 0: if gd == 0:
env['LOGO'] = 0 env['LOGO'] = 0
print 'Did not find libgd, you won\'t be able to create a logo screen for your avis.' print('Did not find libgd, you won\'t be able to create a logo screen for your avis.')
if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c', autoadd=1): if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c', autoadd=1):
conf.env.Append(CCFLAGS = "-DOPENGL") conf.env.Append(CCFLAGS = "-DOPENGL")
@ -193,8 +193,8 @@ if sys.byteorder == 'little' or env['PLATFORM'] == 'win32':
if env['FRAMESKIP']: if env['FRAMESKIP']:
env.Append(CPPDEFINES = ['FRAMESKIP']) env.Append(CPPDEFINES = ['FRAMESKIP'])
print "base CPPDEFINES:",env['CPPDEFINES'] print("base CPPDEFINES:",env['CPPDEFINES'])
print "base CCFLAGS:",env['CCFLAGS'] print("base CCFLAGS:",env['CCFLAGS'])
if env['DEBUG']: if env['DEBUG']:
env.Append(CPPDEFINES=["_DEBUG"], CCFLAGS = ['-g', '-O0']) env.Append(CPPDEFINES=["_DEBUG"], CCFLAGS = ['-g', '-O0'])

View File

@ -33,7 +33,7 @@ else:
platform_files = SConscript('drivers/sdl/SConscript') platform_files = SConscript('drivers/sdl/SConscript')
file_list.append(platform_files) file_list.append(platform_files)
print env['LINKFLAGS'] print(env['LINKFLAGS'])
if env['PLATFORM'] == 'win32': if env['PLATFORM'] == 'win32':
fceux = env.Program('fceux.exe', file_list) fceux = env.Program('fceux.exe', file_list)

View File

@ -184,7 +184,7 @@ static DECLFR(QTAiRead) {
// uint8 res2 = ((regs[0xD] & 1) << 7) | ((regs[0xC] & 0x1F) << 2) | (regs[0xB] & 3); // uint8 res2 = ((regs[0xD] & 1) << 7) | ((regs[0xC] & 0x1F) << 2) | (regs[0xB] & 3);
uint8 tabl = conv_tbl[(regs[0xC] >> 5) & 3][(regs[0xD] & 0x7F) >> 4]; uint8 tabl = conv_tbl[(regs[0xC] >> 5) & 3][(regs[0xD] & 0x7F) >> 4];
uint8 res1 = 0x40 | (tabl & 0x3F) | ((regs[0xD] >> 1) & 7); uint8 res1 = 0x40 | (tabl & 0x3F) | ((regs[0xD] >> 1) & 7) | ((regs[0xB] & 4) << 5);
uint8 res2 = ((regs[0xD] & 1) << 7) | ((regs[0xC] & 0x1F) << 2) | (regs[0xB] & 3); uint8 res2 = ((regs[0xD] & 1) << 7) | ((regs[0xC] & 0x1F) << 2) | (regs[0xB] & 3);
if (tabl & 0x40) if (tabl & 0x40)

View File

@ -115,12 +115,20 @@ pshift[1] <<= 8;
pshift[1] |= C[0]; pshift[1] |= C[0];
} }
#else #else
#ifdef PPU_VRC5FETCH
pshift[0] |= C[0];
if(tmpd & 0x40)
pshift[1] |= (tmpd & 0x80) ? 0xFF : 0x00;
else
pshift[1] |= C[8];
#else
if(ScreenON) if(ScreenON)
RENDER_LOGP(C); RENDER_LOGP(C);
pshift[0] |= C[0]; pshift[0] |= C[0];
if(ScreenON) if(ScreenON)
RENDER_LOGP(C + 8); RENDER_LOGP(C + 8);
pshift[1] |= C[8]; pshift[1] |= C[8];
#endif
#endif #endif
if ((RefreshAddr & 0x1f) == 0x1f) if ((RefreshAddr & 0x1f) == 0x1f)