SDL: fixed input issue and making Lua optional again

This commit is contained in:
shinydoofy 2009-04-15 03:40:08 +00:00
parent 06e22c91a8
commit 0aee98b006
5 changed files with 24 additions and 14 deletions

View File

@ -8,6 +8,7 @@ opts.AddOptions(
BoolOption('OPENGL', 'Enable OpenGL support', 1),
BoolOption('LSB_FIRST', 'Least signficant byte first (non-PPC)', 1),
BoolOption('DEBUG', 'Build with debugging symbols', 0),
BoolOption('LUA', 'Enable Lua support', 1),
BoolOption('NEWPPU', 'Enable new PPU core', 0),
BoolOption('CREATE_AVI', 'Enable avi creation support (SDL only)', 0),
BoolOption('LOGO', 'Enable a logoscreen when creating avis (SDL only)', '1')
@ -56,12 +57,12 @@ else:
if not conf.CheckLib('z', autoadd=1):
print 'Did not find libz or z.lib, exiting!'
Exit(1)
lua51 = conf.CheckLib('lua5.1', autoadd=1)
lua = conf.CheckLib('lua', autoadd=1)
if lua == 0 and lua51 == 0:
print 'Did not find liblua5.1, liblua, lua.lib or lua5.1.lib, exiting!'
Exit(1)
if env['LUA']:
lua51 = conf.CheckLib('lua5.1', autoadd=1)
lua = conf.CheckLib('lua', autoadd=1)
if lua == 0 and lua51 == 0:
print 'Did not find liblua5.1, liblua, lua.lib or lua5.1.lib, compiling anyway!'
env['LUA'] = 0
### Search for zenity if we're not in windows
if env['PLATFORM'] != 'win32' and env['PLATFORM'] != 'cygwin':
@ -102,12 +103,13 @@ else:
conf.env.Append(CPPDEFINES = ['PSS_STYLE=1'])
# parse SDL cflags/libs
env.ParseConfig('sdl-config --cflags --libs')
# parse liblua cflags
if lua51:
env.Append(CPPPATH = ['/usr/local/include/lua5.1', '/usr/include/lua5.1'])
if lua:
env.Append(CPPPATH = ['/usr/local/include/lua', '/usr/include/lua'])
env.Append(CPPDEFINES=["_S9XLUA_H"])
if env['LUA']:
# parse liblua cflags
if lua51:
env.Append(CPPPATH = ['/usr/local/include/lua5.1', '/usr/include/lua5.1'])
if lua:
env.Append(CPPPATH = ['/usr/local/include/lua', '/usr/include/lua'])
env.Append(CPPDEFINES=["_S9XLUA_H"])
env = conf.Finish()
if sys.byteorder == 'little' or env['PLATFORM'] == 'win32':

View File

@ -1,3 +1,4 @@
15-apr-2009 - shinydoofy - sdl - Lua is optional again, fixed the real issue
14-apr-2009 - punkrockguy - sdl - LUA is NO longer optional, so the SConscripts have been updated to reflect that change. This fixes the mysterious non-working input issue.
12-apr-2009 - shinydoofy - sdl - implemented saving/loading a savestate from a specific file on Alt+S/L
11-apr-2009 - shinydoofy - sdl - implemented starting an FM2 movie on Alt+R

View File

@ -12,7 +12,6 @@ file.cpp
filter.cpp
ines.cpp
input.cpp
lua-engine.cpp
netplay.cpp
nsf.cpp
oldmovie.cpp
@ -41,6 +40,9 @@ mappers
Import('env')
Export('env')
if env['LUA']:
file_list.append('lua-engine.cpp')
if env['CREATE_AVI']:
subdirs.append('drivers/videolog')

View File

@ -6,7 +6,6 @@ rgbtorgb.cpp
Import('env')
if env['LOGO']:
env.Append(LIBS = ["gd"])
env.Append(CCFLAGS = "-DHAVE_GD")
for x in range(len(my_list)):

View File

@ -202,6 +202,9 @@ static void UpdateGP(int w, void *data, int arg)
joy[2]= FCEU_LuaUsingJoypad(2) ? (FCEU_LuaReadJoypad(2) | (*(uint32 *)joyports[0].ptr >> 16)) : *(uint32 *)joyports[0].ptr >> 16;
if (FCEU_LuaReadJoypadFalse(2))
joy[2] &= FCEU_LuaReadJoypadFalse(2);
#else // without this, there seems to be no input at all without Lua
joy[0] = *(uint32 *)joyports[0].ptr;;
joy[2] = *(uint32 *)joyports[0].ptr >> 16;
#endif
}
else
@ -215,6 +218,9 @@ static void UpdateGP(int w, void *data, int arg)
joy[3]= FCEU_LuaUsingJoypad(3) ? (FCEU_LuaReadJoypad(3) | (*(uint32 *)joyports[1].ptr >> 24)) : *(uint32 *)joyports[1].ptr >> 24;
if (FCEU_LuaReadJoypadFalse(3))
joy[3] &= FCEU_LuaReadJoypadFalse(3);
#else // same goes for the other two pads
joy[1] = *(uint32 *)joyports[1].ptr >> 8;
joy[3] = *(uint32 *)joyports[1].ptr >> 24;
#endif
}