First successful build of Qt windows fceux.
This commit is contained in:
parent
1307adc115
commit
35bb4be6f6
|
@ -11,17 +11,16 @@ set(CMAKE_AUTOUIC ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_WIN})
|
find_package(OpenGL REQUIRED)
|
||||||
include_directories( ${CMAKE_SOURCE_DIR}/src/drivers/win/directx ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib )
|
find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED)
|
||||||
add_definitions(
|
add_definitions( ${Qt5Widgets_DEFINITIONS} )
|
||||||
-DWIN32
|
include_directories( ${Qt5Widgets_INCLUDE_DIRS} )
|
||||||
-DFCEUDEF_DEBUGGER
|
add_definitions( -DMSVC )
|
||||||
-D_USE_SHARED_MEMORY_
|
add_definitions( -D__QT_DRIVER__ -DQT_DEPRECATED_WARNINGS )
|
||||||
-DPSS_STYLE=2
|
add_definitions( -DFCEUDEF_DEBUGGER )
|
||||||
-DNOMINMAX
|
include_directories( C:/SDL2/include )
|
||||||
-D_S9XLUA_H
|
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib )
|
||||||
)
|
set( SDL2_LDFLAGS C:/SDL2/lib/x64/SDL2.lib )
|
||||||
link_directories( ${CMAKE_SOURCE_DIR}/src/drivers/win/directx )
|
|
||||||
else(WIN32)
|
else(WIN32)
|
||||||
# Non Windows System
|
# Non Windows System
|
||||||
# UNIX (Linux or Mac OSX)
|
# UNIX (Linux or Mac OSX)
|
||||||
|
@ -149,6 +148,24 @@ else(WIN32)
|
||||||
|
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
|
set( ZLIB_SOURCE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/adler32.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/compress.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/crc32.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/deflate.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/gzio.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/infblock.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/infcodes.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/inffast.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/inflate.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/inftrees.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/infutil.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/trees.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/uncompr.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/unzip.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib/zutil.c
|
||||||
|
)
|
||||||
|
|
||||||
include_directories( ${CMAKE_SOURCE_DIR}/src )
|
include_directories( ${CMAKE_SOURCE_DIR}/src )
|
||||||
include_directories( ${CMAKE_SOURCE_DIR}/src/drivers )
|
include_directories( ${CMAKE_SOURCE_DIR}/src/drivers )
|
||||||
|
|
||||||
|
@ -189,6 +206,7 @@ set(SRC_CORE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/wave.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/wave.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/x6502.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/x6502.cpp
|
||||||
${LUA_ENGINE_SOURCE}
|
${LUA_ENGINE_SOURCE}
|
||||||
|
${ZLIB_SOURCE}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/boards/01-222.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/boards/01-222.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/boards/09-034a.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/boards/09-034a.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/boards/103.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/boards/103.cpp
|
||||||
|
@ -403,8 +421,8 @@ set(SRC_DRIVERS_COMMON
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/common/vidblit.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/common/vidblit.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/common/os_utils.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/common/os_utils.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/common/nes_ntsc.c
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/common/nes_ntsc.c
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/videolog/nesvideos-piece.cpp
|
#${CMAKE_CURRENT_SOURCE_DIR}/drivers/videolog/nesvideos-piece.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/videolog/rgbtorgb.cpp
|
#${CMAKE_CURRENT_SOURCE_DIR}/drivers/videolog/rgbtorgb.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if ( ${GTK} )
|
if ( ${GTK} )
|
||||||
|
@ -514,7 +532,7 @@ else()
|
||||||
target_link_libraries( ${APP_NAME}
|
target_link_libraries( ${APP_NAME}
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
${Qt5OpenGL_LIBRARIES}
|
${Qt5OpenGL_LIBRARIES}
|
||||||
${OPENGL_LDFLAGS}
|
${OPENGL_LDFLAGS} OpenGL::GL
|
||||||
${SDL2_LDFLAGS}
|
${SDL2_LDFLAGS}
|
||||||
${MINIZIP_LDFLAGS} ${ZLIB_LIBRARIES}
|
${MINIZIP_LDFLAGS} ${ZLIB_LIBRARIES}
|
||||||
${LUA_LDFLAGS}
|
${LUA_LDFLAGS}
|
||||||
|
@ -522,6 +540,10 @@ target_link_libraries( ${APP_NAME}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries( ${APP_NAME} wsock32 ws2_32 )
|
||||||
|
|
||||||
|
set_target_properties(${APP_NAME} PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
|
||||||
install( TARGETS ${APP_NAME}
|
install( TARGETS ${APP_NAME}
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#include "../../asm.h"
|
#include "../../asm.h"
|
||||||
#include "../../ppu.h"
|
#include "../../ppu.h"
|
||||||
#include "../../x6502.h"
|
#include "../../x6502.h"
|
||||||
|
#include "../../common/os_utils.h"
|
||||||
#include "common/configSys.h"
|
#include "common/configSys.h"
|
||||||
|
|
||||||
#include "Qt/main.h"
|
#include "Qt/main.h"
|
||||||
|
@ -2592,7 +2593,7 @@ void FCEUD_DebugBreakpoint( int bpNum )
|
||||||
frameAdvance_Delay_count++;
|
frameAdvance_Delay_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
usleep(16667);
|
msleep(16);
|
||||||
}
|
}
|
||||||
// since we unfreezed emulation, reset delta_cycles counter
|
// since we unfreezed emulation, reset delta_cycles counter
|
||||||
ResetDebugStatisticsDeltaCounters();
|
ResetDebugStatisticsDeltaCounters();
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <unistd.h>
|
//#include <unistd.h>
|
||||||
|
|
||||||
#include "Qt/nes_shm.h"
|
#include "Qt/nes_shm.h"
|
||||||
#include "Qt/fceuWrapper.h"
|
#include "Qt/fceuWrapper.h"
|
||||||
|
|
|
@ -145,6 +145,7 @@ consoleWin_t::consoleWin_t(QWidget *parent)
|
||||||
|
|
||||||
if ( opt )
|
if ( opt )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio, nice;
|
int policy, prio, nice;
|
||||||
|
|
||||||
g_config->getOption( "SDL.GuiSchedPolicy", &policy );
|
g_config->getOption( "SDL.GuiSchedPolicy", &policy );
|
||||||
|
@ -154,6 +155,7 @@ consoleWin_t::consoleWin_t(QWidget *parent)
|
||||||
setNicePriority( nice );
|
setNicePriority( nice );
|
||||||
|
|
||||||
setSchedParam( policy, prio );
|
setSchedParam( policy, prio );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1983,6 +1985,7 @@ void consoleWin_t::openMsgLogWin(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(__APPLE__) || defined(__unix__)
|
||||||
int consoleWin_t::setNicePriority( int value )
|
int consoleWin_t::setNicePriority( int value )
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -2135,6 +2138,7 @@ int consoleWin_t::setSchedParam( int policy, int priority )
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void consoleWin_t::syncActionConfig( QAction *act, const char *property )
|
void consoleWin_t::syncActionConfig( QAction *act, const char *property )
|
||||||
{
|
{
|
||||||
|
@ -2232,6 +2236,7 @@ void emulatorThread_t::init(void)
|
||||||
|
|
||||||
if ( opt )
|
if ( opt )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio, nice;
|
int policy, prio, nice;
|
||||||
|
|
||||||
g_config->getOption( "SDL.EmuSchedPolicy", &policy );
|
g_config->getOption( "SDL.EmuSchedPolicy", &policy );
|
||||||
|
@ -2241,6 +2246,7 @@ void emulatorThread_t::init(void)
|
||||||
setNicePriority( nice );
|
setNicePriority( nice );
|
||||||
|
|
||||||
setSchedParam( policy, prio );
|
setSchedParam( policy, prio );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2254,6 +2260,7 @@ void emulatorThread_t::setPriority( QThread::Priority priority_req )
|
||||||
//printf("Set Priority: %i \n", priority() );
|
//printf("Set Priority: %i \n", priority() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(__unix__) || defined(__APPLE__)
|
||||||
int emulatorThread_t::setNicePriority( int value )
|
int emulatorThread_t::setNicePriority( int value )
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -2384,6 +2391,7 @@ int emulatorThread_t::setSchedParam( int policy, int priority )
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void emulatorThread_t::run(void)
|
void emulatorThread_t::run(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,11 +23,16 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <Windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include "../../fceu.h"
|
#include "../../fceu.h"
|
||||||
|
#include "../../common/os_utils.h"
|
||||||
|
|
||||||
#ifdef _S9XLUA_H
|
#ifdef _S9XLUA_H
|
||||||
#include "../../fceulua.h"
|
#include "../../fceulua.h"
|
||||||
|
@ -429,7 +434,7 @@ int LuaKillMessageBox(void)
|
||||||
|
|
||||||
while ( openLuaKillMsgBox )
|
while ( openLuaKillMsgBox )
|
||||||
{
|
{
|
||||||
usleep(100000);
|
msleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
return luaKillMsgBoxRetVal;
|
return luaKillMsgBoxRetVal;
|
||||||
|
|
|
@ -25,10 +25,12 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
@ -47,6 +49,7 @@
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static bool hasNicePermissions( int val )
|
static bool hasNicePermissions( int val )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int usrID;
|
int usrID;
|
||||||
bool usrRoot;
|
bool usrRoot;
|
||||||
|
|
||||||
|
@ -74,6 +77,7 @@ static bool hasNicePermissions( int val )
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -103,9 +107,13 @@ TimingConfDialog_t::TimingConfDialog_t(QWidget *parent)
|
||||||
emuSchedPrioLabel = new QLabel( tr("Priority (RT)") );
|
emuSchedPrioLabel = new QLabel( tr("Priority (RT)") );
|
||||||
emuSchedNiceLabel = new QLabel( tr("Priority (Nice)") );
|
emuSchedNiceLabel = new QLabel( tr("Priority (Nice)") );
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
emuSchedPolicyBox->addItem( tr("SCHED_OTHER") , SCHED_OTHER );
|
emuSchedPolicyBox->addItem( tr("SCHED_OTHER") , SCHED_OTHER );
|
||||||
emuSchedPolicyBox->addItem( tr("SCHED_FIFO") , SCHED_FIFO );
|
emuSchedPolicyBox->addItem( tr("SCHED_FIFO") , SCHED_FIFO );
|
||||||
emuSchedPolicyBox->addItem( tr("SCHED_RR") , SCHED_RR );
|
emuSchedPolicyBox->addItem( tr("SCHED_RR") , SCHED_RR );
|
||||||
|
#else
|
||||||
|
emuSchedPolicyBox->addItem( tr("TODO") , 0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Policy") ), 0, 0 );
|
grid->addWidget( new QLabel( tr("Policy") ), 0, 0 );
|
||||||
grid->addWidget( emuSchedPolicyBox, 0, 1 );
|
grid->addWidget( emuSchedPolicyBox, 0, 1 );
|
||||||
|
@ -126,9 +134,13 @@ TimingConfDialog_t::TimingConfDialog_t(QWidget *parent)
|
||||||
guiSchedPrioLabel = new QLabel( tr("Priority (RT)") );
|
guiSchedPrioLabel = new QLabel( tr("Priority (RT)") );
|
||||||
guiSchedNiceLabel = new QLabel( tr("Priority (Nice)") );
|
guiSchedNiceLabel = new QLabel( tr("Priority (Nice)") );
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
guiSchedPolicyBox->addItem( tr("SCHED_OTHER") , SCHED_OTHER );
|
guiSchedPolicyBox->addItem( tr("SCHED_OTHER") , SCHED_OTHER );
|
||||||
guiSchedPolicyBox->addItem( tr("SCHED_FIFO") , SCHED_FIFO );
|
guiSchedPolicyBox->addItem( tr("SCHED_FIFO") , SCHED_FIFO );
|
||||||
guiSchedPolicyBox->addItem( tr("SCHED_RR") , SCHED_RR );
|
guiSchedPolicyBox->addItem( tr("SCHED_RR") , SCHED_RR );
|
||||||
|
#else
|
||||||
|
guiSchedPolicyBox->addItem( tr("TODO") , 0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Policy") ), 0, 0 );
|
grid->addWidget( new QLabel( tr("Policy") ), 0, 0 );
|
||||||
grid->addWidget( guiSchedPolicyBox, 0, 1 );
|
grid->addWidget( guiSchedPolicyBox, 0, 1 );
|
||||||
|
@ -199,6 +211,7 @@ void TimingConfDialog_t::emuSchedCtlChange( int state )
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::saveValues(void)
|
void TimingConfDialog_t::saveValues(void)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio, nice;
|
int policy, prio, nice;
|
||||||
|
|
||||||
if ( consoleWindow == NULL )
|
if ( consoleWindow == NULL )
|
||||||
|
@ -226,10 +239,12 @@ void TimingConfDialog_t::saveValues(void)
|
||||||
//printf("GUI Sched: %i %i %i\n", policy, prio, nice );
|
//printf("GUI Sched: %i %i %i\n", policy, prio, nice );
|
||||||
|
|
||||||
g_config->save();
|
g_config->save();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::emuSchedNiceChange(int val)
|
void TimingConfDialog_t::emuSchedNiceChange(int val)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
if ( consoleWindow == NULL )
|
if ( consoleWindow == NULL )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -253,10 +268,12 @@ void TimingConfDialog_t::emuSchedNiceChange(int val)
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
}
|
}
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::emuSchedPrioChange(int val)
|
void TimingConfDialog_t::emuSchedPrioChange(int val)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio;
|
int policy, prio;
|
||||||
|
|
||||||
if ( consoleWindow == NULL )
|
if ( consoleWindow == NULL )
|
||||||
|
@ -284,10 +301,12 @@ void TimingConfDialog_t::emuSchedPrioChange(int val)
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
}
|
}
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::emuSchedPolicyChange( int index )
|
void TimingConfDialog_t::emuSchedPolicyChange( int index )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio;
|
int policy, prio;
|
||||||
|
|
||||||
if ( consoleWindow == NULL )
|
if ( consoleWindow == NULL )
|
||||||
|
@ -320,10 +339,12 @@ void TimingConfDialog_t::emuSchedPolicyChange( int index )
|
||||||
updateSliderLimits();
|
updateSliderLimits();
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::guiSchedNiceChange(int val)
|
void TimingConfDialog_t::guiSchedNiceChange(int val)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
if ( consoleWindow == NULL )
|
if ( consoleWindow == NULL )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -347,10 +368,12 @@ void TimingConfDialog_t::guiSchedNiceChange(int val)
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
}
|
}
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::guiSchedPrioChange(int val)
|
void TimingConfDialog_t::guiSchedPrioChange(int val)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio;
|
int policy, prio;
|
||||||
|
|
||||||
if ( consoleWindow == NULL )
|
if ( consoleWindow == NULL )
|
||||||
|
@ -378,10 +401,12 @@ void TimingConfDialog_t::guiSchedPrioChange(int val)
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
}
|
}
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::guiSchedPolicyChange( int index )
|
void TimingConfDialog_t::guiSchedPolicyChange( int index )
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio;
|
int policy, prio;
|
||||||
|
|
||||||
if ( consoleWindow == NULL )
|
if ( consoleWindow == NULL )
|
||||||
|
@ -414,10 +439,12 @@ void TimingConfDialog_t::guiSchedPolicyChange( int index )
|
||||||
updateSliderLimits();
|
updateSliderLimits();
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::updatePolicyBox(void)
|
void TimingConfDialog_t::updatePolicyBox(void)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio;
|
int policy, prio;
|
||||||
|
|
||||||
if ( consoleWindow == NULL )
|
if ( consoleWindow == NULL )
|
||||||
|
@ -445,11 +472,12 @@ void TimingConfDialog_t::updatePolicyBox(void)
|
||||||
guiSchedPolicyBox->setCurrentIndex( j );
|
guiSchedPolicyBox->setCurrentIndex( j );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::updateSliderValues(void)
|
void TimingConfDialog_t::updateSliderValues(void)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
int policy, prio;
|
int policy, prio;
|
||||||
bool hasNicePerms;
|
bool hasNicePerms;
|
||||||
|
|
||||||
|
@ -496,7 +524,7 @@ void TimingConfDialog_t::updateSliderValues(void)
|
||||||
|
|
||||||
guiSchedNiceLabel->setEnabled( hasNicePerms );
|
guiSchedNiceLabel->setEnabled( hasNicePerms );
|
||||||
guiSchedNiceSlider->setEnabled( hasNicePerms );
|
guiSchedNiceSlider->setEnabled( hasNicePerms );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::updateSliderLimits(void)
|
void TimingConfDialog_t::updateSliderLimits(void)
|
||||||
|
@ -506,6 +534,7 @@ void TimingConfDialog_t::updateSliderLimits(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
emuSchedNiceSlider->setMinimum( -20 );
|
emuSchedNiceSlider->setMinimum( -20 );
|
||||||
emuSchedNiceSlider->setMaximum( 20 );
|
emuSchedNiceSlider->setMaximum( 20 );
|
||||||
emuSchedPrioSlider->setMinimum( consoleWindow->emulatorThread->getMinSchedPriority() );
|
emuSchedPrioSlider->setMinimum( consoleWindow->emulatorThread->getMinSchedPriority() );
|
||||||
|
@ -515,6 +544,7 @@ void TimingConfDialog_t::updateSliderLimits(void)
|
||||||
guiSchedNiceSlider->setMaximum( 20 );
|
guiSchedNiceSlider->setMaximum( 20 );
|
||||||
guiSchedPrioSlider->setMinimum( consoleWindow->getMinSchedPriority() );
|
guiSchedPrioSlider->setMinimum( consoleWindow->getMinSchedPriority() );
|
||||||
guiSchedPrioSlider->setMaximum( consoleWindow->getMaxSchedPriority() );
|
guiSchedPrioSlider->setMaximum( consoleWindow->getMaxSchedPriority() );
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "../../ines.h"
|
#include "../../ines.h"
|
||||||
#include "../../nsf.h"
|
#include "../../nsf.h"
|
||||||
#include "../../movie.h"
|
#include "../../movie.h"
|
||||||
|
#include "../../common/os_utils.h"
|
||||||
|
|
||||||
#include "Qt/ConsoleUtilities.h"
|
#include "Qt/ConsoleUtilities.h"
|
||||||
#include "Qt/TraceLogger.h"
|
#include "Qt/TraceLogger.h"
|
||||||
|
@ -367,7 +368,7 @@ void TraceLoggerDialog_t::logMaxLinesChanged(int index)
|
||||||
logPrev = logging;
|
logPrev = logging;
|
||||||
logging = 0;
|
logging = 0;
|
||||||
|
|
||||||
usleep(1000);
|
msleep(1);
|
||||||
|
|
||||||
initTraceLogBuffer( maxLines );
|
initTraceLogBuffer( maxLines );
|
||||||
|
|
||||||
|
@ -382,7 +383,7 @@ void TraceLoggerDialog_t::toggleLoggingOnOff(void)
|
||||||
if ( logging )
|
if ( logging )
|
||||||
{
|
{
|
||||||
logging = 0;
|
logging = 0;
|
||||||
usleep( 1000 );
|
msleep( 1 );
|
||||||
pushMsgToLogBuffer("Logging Finished");
|
pushMsgToLogBuffer("Logging Finished");
|
||||||
startStopButton->setText( tr("Start Logging") );
|
startStopButton->setText( tr("Start Logging") );
|
||||||
|
|
||||||
|
|
|
@ -34,16 +34,17 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <unistd.h>
|
//#include <unistd.h>
|
||||||
|
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <sys/time.h>
|
//#include <sys/time.h>
|
||||||
#include <sys/stat.h>
|
//#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
//#include <sys/types.h>
|
||||||
|
#include <direct.h>
|
||||||
|
|
||||||
static const char* HotkeyStrings[HK_MAX] = {
|
static const char* HotkeyStrings[HK_MAX] = {
|
||||||
"CheatMenu",
|
"CheatMenu",
|
||||||
|
@ -321,6 +322,10 @@ InitConfig()
|
||||||
config->addOption("periodicsaves", "SDL.PeriodicSaves", 0);
|
config->addOption("periodicsaves", "SDL.PeriodicSaves", 0);
|
||||||
|
|
||||||
char* home_dir = getenv("HOME");
|
char* home_dir = getenv("HOME");
|
||||||
|
if ( home_dir == NULL )
|
||||||
|
{
|
||||||
|
home_dir = "";
|
||||||
|
}
|
||||||
// prefixed with _ because they are internal (not cli options)
|
// prefixed with _ because they are internal (not cli options)
|
||||||
config->addOption("_lastopenfile", "SDL.LastOpenFile", home_dir);
|
config->addOption("_lastopenfile", "SDL.LastOpenFile", home_dir);
|
||||||
config->addOption("_laststatefrom", "SDL.LastLoadStateFrom", home_dir);
|
config->addOption("_laststatefrom", "SDL.LastLoadStateFrom", home_dir);
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "../../fceu.h"
|
#include "../../fceu.h"
|
||||||
#include "../../movie.h"
|
#include "../../movie.h"
|
||||||
#include "../../version.h"
|
#include "../../version.h"
|
||||||
|
#include "../../common/os_utils.h"
|
||||||
|
|
||||||
#ifdef _S9XLUA_H
|
#ifdef _S9XLUA_H
|
||||||
#include "../../fceulua.h"
|
#include "../../fceulua.h"
|
||||||
|
@ -61,6 +62,11 @@
|
||||||
#include "../videolog/nesvideos-piece.h"
|
#include "../videolog/nesvideos-piece.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
//not #if defined(_WIN32) || defined(_WIN64) because we have strncasecmp in mingw
|
||||||
|
#define strncasecmp _strnicmp
|
||||||
|
#define strcasecmp _stricmp
|
||||||
|
#endif
|
||||||
//*****************************************************************
|
//*****************************************************************
|
||||||
// Define Global Variables to be shared with FCEU Core
|
// Define Global Variables to be shared with FCEU Core
|
||||||
//*****************************************************************
|
//*****************************************************************
|
||||||
|
@ -136,13 +142,17 @@ EMUFILE_FILE* FCEUD_UTF8_fstream(const char *fn, const char *m)
|
||||||
//return new std::fstream(fn,mode);
|
//return new std::fstream(fn,mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *s_linuxCompilerString = "g++ " __VERSION__;
|
#ifdef _MSC_VER
|
||||||
|
static const char *s_CompilerString = "MSVC";
|
||||||
|
#else
|
||||||
|
static const char *s_CompilerString = "g++ " __VERSION__;
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* Returns the compiler string.
|
* Returns the compiler string.
|
||||||
*/
|
*/
|
||||||
const char *FCEUD_GetCompilerString(void)
|
const char *FCEUD_GetCompilerString(void)
|
||||||
{
|
{
|
||||||
return s_linuxCompilerString;
|
return s_CompilerString;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -314,7 +324,7 @@ int LoadGame(const char *path, bool silent)
|
||||||
}
|
}
|
||||||
isloaded = 1;
|
isloaded = 1;
|
||||||
|
|
||||||
FCEUD_NetworkConnect();
|
//FCEUD_NetworkConnect();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,7 +871,7 @@ FCEUD_Update(uint8 *XBuf,
|
||||||
int Count)
|
int Count)
|
||||||
{
|
{
|
||||||
int blitDone = 0;
|
int blitDone = 0;
|
||||||
extern int FCEUDnetplay;
|
//extern int FCEUDnetplay;
|
||||||
|
|
||||||
#ifdef CREATE_AVI
|
#ifdef CREATE_AVI
|
||||||
if (LoggingEnabled == 2 || (eoptions&EO_NOTHROTTLE))
|
if (LoggingEnabled == 2 || (eoptions&EO_NOTHROTTLE))
|
||||||
|
@ -955,19 +965,19 @@ FCEUD_Update(uint8 *XBuf,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //else puts("Skipped");
|
} //else puts("Skipped");
|
||||||
else if (!NoWaiting && FCEUDnetplay && (uflow || tmpcan >= (Count * 1.8)))
|
//else if (!NoWaiting && FCEUDnetplay && (uflow || tmpcan >= (Count * 1.8)))
|
||||||
{
|
//{
|
||||||
if (Count > tmpcan) Count=tmpcan;
|
// if (Count > tmpcan) Count=tmpcan;
|
||||||
while(tmpcan > 0)
|
// while(tmpcan > 0)
|
||||||
{
|
// {
|
||||||
// printf("Overwrite: %d\n", (Count <= tmpcan)?Count : tmpcan);
|
// // printf("Overwrite: %d\n", (Count <= tmpcan)?Count : tmpcan);
|
||||||
#ifdef CREATE_AVI
|
// #ifdef CREATE_AVI
|
||||||
if (!mutecapture)
|
// if (!mutecapture)
|
||||||
#endif
|
// #endif
|
||||||
WriteSound(Buffer, (Count <= tmpcan)?Count : tmpcan);
|
// WriteSound(Buffer, (Count <= tmpcan)?Count : tmpcan);
|
||||||
tmpcan -= Count;
|
// tmpcan -= Count;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1076,7 +1086,7 @@ int fceuWrapperUpdate( void )
|
||||||
// sleep to allow request to be serviced.
|
// sleep to allow request to be serviced.
|
||||||
if ( mutexPending > 0 )
|
if ( mutexPending > 0 )
|
||||||
{
|
{
|
||||||
usleep( 100000 );
|
msleep( 100 );
|
||||||
}
|
}
|
||||||
|
|
||||||
lock_acq = fceuWrapperTryLock();
|
lock_acq = fceuWrapperTryLock();
|
||||||
|
@ -1087,7 +1097,7 @@ int fceuWrapperUpdate( void )
|
||||||
{
|
{
|
||||||
printf("Error: Emulator Failed to Acquire Mutex\n");
|
printf("Error: Emulator Failed to Acquire Mutex\n");
|
||||||
}
|
}
|
||||||
usleep( 100000 );
|
msleep( 100 );
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1116,7 +1126,7 @@ int fceuWrapperUpdate( void )
|
||||||
|
|
||||||
emulatorHasMutux = 0;
|
emulatorHasMutux = 0;
|
||||||
|
|
||||||
usleep( 100000 );
|
msleep( 100 );
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1540,9 +1540,9 @@ static ButtConfig fkbmap[0x48] = {
|
||||||
MK (LEFTSHIFT), MK (Z), MK (X), MK (C), MK (V), MK (B), MK (N), MK (M),
|
MK (LEFTSHIFT), MK (Z), MK (X), MK (C), MK (V), MK (B), MK (N), MK (M),
|
||||||
MK (COMMA),
|
MK (COMMA),
|
||||||
MK (PERIOD), MK (SLASH), MK (RIGHTALT), MK (RIGHTSHIFT), MK (LEFTALT),
|
MK (PERIOD), MK (SLASH), MK (RIGHTALT), MK (RIGHTSHIFT), MK (LEFTALT),
|
||||||
MK (SPACE),
|
MK (SPACE)
|
||||||
MK (DELETE), MK (END), MK (PAGEDOWN),
|
//MK (DELETE), MK (END), MK (PAGEDOWN),
|
||||||
MK (CURSORUP), MK (CURSORLEFT), MK (CURSORRIGHT), MK (CURSORDOWN)
|
//MK (CURSORUP), MK (CURSORLEFT), MK (CURSORRIGHT), MK (CURSORDOWN)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1788,7 +1788,7 @@ int DWaitButton (const uint8_t * text, ButtConfig * bc, int *buttonConfigStatus
|
||||||
{
|
{
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
|
||||||
usleep(10000);
|
SDL_Delay(10);
|
||||||
timeout_ms -= 10;
|
timeout_ms -= 10;
|
||||||
|
|
||||||
if ( timeout_ms <= 0 )
|
if ( timeout_ms <= 0 )
|
||||||
|
|
|
@ -51,6 +51,7 @@ static void MessageOutput(QtMsgType type, const QMessageLogContext &context, con
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef main // undef main in case SDL_Main
|
||||||
|
|
||||||
int main( int argc, char *argv[] )
|
int main( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
|
@ -59,6 +60,8 @@ int main( int argc, char *argv[] )
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
const char *styleSheetEnv = NULL;
|
const char *styleSheetEnv = NULL;
|
||||||
|
|
||||||
|
printf("test\n");
|
||||||
|
|
||||||
styleSheetEnv = ::getenv("FCEUX_QT_STYLESHEET");
|
styleSheetEnv = ::getenv("FCEUX_QT_STYLESHEET");
|
||||||
|
|
||||||
if ( styleSheetEnv != NULL )
|
if ( styleSheetEnv != NULL )
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
//#include <unistd.h>
|
||||||
#include <sys/types.h>
|
//#include <sys/types.h>
|
||||||
#include <sys/ipc.h>
|
//#include <sys/ipc.h>
|
||||||
#include <sys/shm.h>
|
//#include <sys/shm.h>
|
||||||
#include <sys/stat.h>
|
//#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
//#include <fcntl.h>
|
||||||
#include <errno.h>
|
//#include <errno.h>
|
||||||
|
|
||||||
#include "Qt/nes_shm.h"
|
#include "Qt/nes_shm.h"
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
#include "Qt/sdl-joystick.h"
|
#include "Qt/sdl-joystick.h"
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <unistd.h>
|
//#include <unistd.h>
|
||||||
#include <fcntl.h>
|
//#include <fcntl.h>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
|
||||||
//#define MAX_JOYSTICKS 32
|
//#define MAX_JOYSTICKS 32
|
||||||
|
|
|
@ -239,7 +239,7 @@ int highPrecSleep( double timeSeconds )
|
||||||
|
|
||||||
ret = nanosleep( &req, &rem );
|
ret = nanosleep( &req, &rem );
|
||||||
#else
|
#else
|
||||||
SDL_Delay( (long)(time_left * 1e3) );
|
SDL_Delay( (long)(timeSeconds * 1e3) );
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,18 +34,18 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "common/configSys.h"
|
#include "common/configSys.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <cstring>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#else
|
#else
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <dirent.h>
|
|
||||||
|
//#include <dirent.h>
|
||||||
|
|
||||||
#include "../../types.h"
|
#include "../../types.h"
|
||||||
#include "configSys.h"
|
#include "configSys.h"
|
||||||
|
@ -559,6 +560,7 @@ Config::parse(int argc,
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
// try to read cfg.d/*
|
// try to read cfg.d/*
|
||||||
std::string cfgd_dir_name = _dir + "/" + "cfg.d/";
|
std::string cfgd_dir_name = _dir + "/" + "cfg.d/";
|
||||||
DIR *d;
|
DIR *d;
|
||||||
|
@ -585,7 +587,9 @@ Config::parse(int argc,
|
||||||
|
|
||||||
closedir(d);
|
closedir(d);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// FIXME TODO WIN32
|
||||||
|
#endif
|
||||||
// parse the arguments
|
// parse the arguments
|
||||||
return _parseArgs(argc, argv);
|
return _parseArgs(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <direct.h>
|
||||||
|
#include <io.h>
|
||||||
#else
|
#else
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -15,8 +17,8 @@ int fceu_mkdir( const char *path )
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
retval = mkdir(path);
|
retval = _mkdir(path);
|
||||||
chmod(path, 755);
|
_chmod(path, 755);
|
||||||
#else
|
#else
|
||||||
retval = mkdir(path, S_IRWXU);
|
retval = mkdir(path, S_IRWXU);
|
||||||
|
|
||||||
|
@ -67,7 +69,7 @@ bool fceu_file_exists( const char *filepath )
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
fp = ::fopen( filename, "r" );
|
fp = ::fopen( filepath, "r" );
|
||||||
|
|
||||||
if ( fp != NULL )
|
if ( fp != NULL )
|
||||||
{
|
{
|
||||||
|
@ -85,3 +87,14 @@ bool fceu_file_exists( const char *filepath )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//************************************************************
|
//************************************************************
|
||||||
|
int msleep( int ms )
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
#ifdef WIN32
|
||||||
|
Sleep(ms);
|
||||||
|
#else
|
||||||
|
ret = usleep(ms*1000);
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
//************************************************************
|
||||||
|
|
|
@ -7,3 +7,4 @@ int fceu_mkpath( const char *path );
|
||||||
|
|
||||||
bool fceu_file_exists( const char *filepath );
|
bool fceu_file_exists( const char *filepath );
|
||||||
|
|
||||||
|
int msleep( int ms );
|
||||||
|
|
|
@ -219,7 +219,7 @@ public:
|
||||||
reserve(pos+(s32)bytes);
|
reserve(pos+(s32)bytes);
|
||||||
memcpy(buf()+pos,ptr,bytes);
|
memcpy(buf()+pos,ptr,bytes);
|
||||||
pos += (s32)bytes;
|
pos += (s32)bytes;
|
||||||
len = std::max(pos,len);
|
len = std::max<int>(pos,len);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int fseek(int offset, int origin){
|
virtual int fseek(int offset, int origin){
|
||||||
|
|
34
src/fceu.cpp
34
src/fceu.cpp
|
@ -43,7 +43,7 @@
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "vsuni.h"
|
#include "vsuni.h"
|
||||||
#include "ines.h"
|
#include "ines.h"
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
#include "drivers/win/pref.h"
|
#include "drivers/win/pref.h"
|
||||||
#include "utils/xstring.h"
|
#include "utils/xstring.h"
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ extern void RefreshThrottleFPS();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//TODO - we really need some kind of global platform-specific options api
|
//TODO - we really need some kind of global platform-specific options api
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
#include "drivers/win/main.h"
|
#include "drivers/win/main.h"
|
||||||
#include "drivers/win/memview.h"
|
#include "drivers/win/memview.h"
|
||||||
#include "drivers/win/cheat.h"
|
#include "drivers/win/cheat.h"
|
||||||
|
@ -161,7 +161,7 @@ void FCEU_TogglePPU(void) {
|
||||||
FCEUI_printf("Old PPU loaded");
|
FCEUI_printf("Old PPU loaded");
|
||||||
}
|
}
|
||||||
normalscanlines = (dendy ? 290 : 240)+newppu; // use flag as number!
|
normalscanlines = (dendy ? 290 : 240)+newppu; // use flag as number!
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
SetMainWindowText();
|
SetMainWindowText();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ static void FCEU_CloseGame(void)
|
||||||
FCEUSS_Save(FCEU_MakeFName(FCEUMKF_RESUMESTATE, 0, 0).c_str(), false);
|
FCEUSS_Save(FCEU_MakeFName(FCEUMKF_RESUMESTATE, 0, 0).c_str(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
extern char LoadedRomFName[2048];
|
extern char LoadedRomFName[2048];
|
||||||
if (storePreferences(mass_replace(LoadedRomFName, "|", ".").c_str()))
|
if (storePreferences(mass_replace(LoadedRomFName, "|", ".").c_str()))
|
||||||
FCEUD_PrintError("Couldn't store debugging data");
|
FCEUD_PrintError("Couldn't store debugging data");
|
||||||
|
@ -193,7 +193,7 @@ static void FCEU_CloseGame(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameInfo->type != GIT_NSF) {
|
if (GameInfo->type != GIT_NSF) {
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (disableAutoLSCheats == 2)
|
if (disableAutoLSCheats == 2)
|
||||||
FCEU_FlushGameCheats(0, 1);
|
FCEU_FlushGameCheats(0, 1);
|
||||||
else if (disableAutoLSCheats == 1)
|
else if (disableAutoLSCheats == 1)
|
||||||
|
@ -496,7 +496,7 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
|
||||||
if (load_result == LOADER_OK)
|
if (load_result == LOADER_OK)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
// ################################## Start of SP CODE ###########################
|
// ################################## Start of SP CODE ###########################
|
||||||
extern char LoadedRomFName[2048];
|
extern char LoadedRomFName[2048];
|
||||||
extern int loadDebugDataFailed;
|
extern int loadDebugDataFailed;
|
||||||
|
@ -516,7 +516,7 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
|
||||||
FCEU_OpenGenie())
|
FCEU_OpenGenie())
|
||||||
{
|
{
|
||||||
FCEUI_SetGameGenie(false);
|
FCEUI_SetGameGenie(false);
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
genie = 0;
|
genie = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -555,7 +555,7 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
|
||||||
|
|
||||||
ResetScreenshotsCounter();
|
ResetScreenshotsCounter();
|
||||||
|
|
||||||
#if defined (WIN32) || defined (WIN64)
|
#ifdef __WIN_DRIVER__
|
||||||
DoDebuggerDataReload(); // Reloads data without reopening window
|
DoDebuggerDataReload(); // Reloads data without reopening window
|
||||||
CDLoggerROMChanged();
|
CDLoggerROMChanged();
|
||||||
if (hMemView) UpdateColorTable();
|
if (hMemView) UpdateColorTable();
|
||||||
|
@ -703,7 +703,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
|
||||||
// the user is holding Frame Advance key
|
// the user is holding Frame Advance key
|
||||||
// clear paused flag temporarily
|
// clear paused flag temporarily
|
||||||
EmulationPaused &= ~EMULATIONPAUSED_PAUSED;
|
EmulationPaused &= ~EMULATIONPAUSED_PAUSED;
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
// different emulation speed when holding Frame Advance
|
// different emulation speed when holding Frame Advance
|
||||||
if (fps_scale_frameadvance > 0)
|
if (fps_scale_frameadvance > 0)
|
||||||
{
|
{
|
||||||
|
@ -713,7 +713,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (fps_scale_frameadvance > 0)
|
if (fps_scale_frameadvance > 0)
|
||||||
{
|
{
|
||||||
// restore emulation speed when Frame Advance is not held
|
// restore emulation speed when Frame Advance is not held
|
||||||
|
@ -758,7 +758,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
|
||||||
|
|
||||||
FCEU_PutImage();
|
FCEU_PutImage();
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
//These Windows only dialogs need to be updated only once per frame so they are included here
|
//These Windows only dialogs need to be updated only once per frame so they are included here
|
||||||
// CaH4e3: can't see why, this is only cause problems with selection
|
// CaH4e3: can't see why, this is only cause problems with selection
|
||||||
// adelikat: selection is only a problem when not paused, it should be paused to select, we want to see the values update
|
// adelikat: selection is only a problem when not paused, it should be paused to select, we want to see the values update
|
||||||
|
@ -797,7 +797,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
|
||||||
{
|
{
|
||||||
EmulationPaused = EMULATIONPAUSED_PAUSED; // restore EMULATIONPAUSED_PAUSED flag and clear EMULATIONPAUSED_FA flag
|
EmulationPaused = EMULATIONPAUSED_PAUSED; // restore EMULATIONPAUSED_PAUSED flag and clear EMULATIONPAUSED_FA flag
|
||||||
JustFrameAdvanced = true;
|
JustFrameAdvanced = true;
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (soundoptions & SO_MUTEFA) //mute the frame advance if the user requested it
|
if (soundoptions & SO_MUTEFA) //mute the frame advance if the user requested it
|
||||||
*SoundBufSize = 0; //keep sound muted
|
*SoundBufSize = 0; //keep sound muted
|
||||||
#endif
|
#endif
|
||||||
|
@ -962,7 +962,7 @@ void PowerNES(void) {
|
||||||
|
|
||||||
timestampbase = 0;
|
timestampbase = 0;
|
||||||
X6502_Power();
|
X6502_Power();
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
ResetDebugStatisticsCounters();
|
ResetDebugStatisticsCounters();
|
||||||
#endif
|
#endif
|
||||||
FCEU_PowerCheats();
|
FCEU_PowerCheats();
|
||||||
|
@ -971,7 +971,7 @@ void PowerNES(void) {
|
||||||
extern uint8 *XBackBuf;
|
extern uint8 *XBackBuf;
|
||||||
memset(XBackBuf, 0, 256 * 256);
|
memset(XBackBuf, 0, 256 * 256);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
Update_RAM_Search(); // Update_RAM_Watch() is also called.
|
Update_RAM_Search(); // Update_RAM_Watch() is also called.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1109,7 +1109,7 @@ void FCEUI_SetRegion(int region, int notify) {
|
||||||
totalscanlines = normalscanlines + (overclock_enabled ? postrenderscanlines : 0);
|
totalscanlines = normalscanlines + (overclock_enabled ? postrenderscanlines : 0);
|
||||||
FCEUI_SetVidSystem(pal_emulation);
|
FCEUI_SetVidSystem(pal_emulation);
|
||||||
RefreshThrottleFPS();
|
RefreshThrottleFPS();
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
UpdateCheckedMenuItems();
|
UpdateCheckedMenuItems();
|
||||||
PushCurrentVideoSettings();
|
PushCurrentVideoSettings();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1260,7 +1260,7 @@ bool FCEU_IsValidUI(EFCEUI ui) {
|
||||||
case FCEUI_INSERT_COIN:
|
case FCEUI_INSERT_COIN:
|
||||||
if (!GameInfo) return false;
|
if (!GameInfo) return false;
|
||||||
if (FCEUMOV_Mode(MOVIEMODE_RECORD)) return true;
|
if (FCEUMOV_Mode(MOVIEMODE_RECORD)) return true;
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR) && isTaseditorRecording()) return true;
|
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR) && isTaseditorRecording()) return true;
|
||||||
#endif
|
#endif
|
||||||
if (!FCEUMOV_Mode(MOVIEMODE_INACTIVE)) return false;
|
if (!FCEUMOV_Mode(MOVIEMODE_INACTIVE)) return false;
|
||||||
|
@ -1401,7 +1401,7 @@ uint8 FCEU_ReadRomByte(uint32 i) {
|
||||||
|
|
||||||
void FCEU_WriteRomByte(uint32 i, uint8 value) {
|
void FCEU_WriteRomByte(uint32 i, uint8 value) {
|
||||||
if (i < 16)
|
if (i < 16)
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
MessageBox(hMemView, "Sorry", "You can't edit the ROM header.", MB_OK | MB_ICONERROR);
|
MessageBox(hMemView, "Sorry", "You can't edit the ROM header.", MB_OK | MB_ICONERROR);
|
||||||
#else
|
#else
|
||||||
printf("Sorry, you can't edit the ROM header.\n");
|
printf("Sorry, you can't edit the ROM header.\n");
|
||||||
|
|
|
@ -98,7 +98,7 @@ extern bool movieSubtitles;
|
||||||
|
|
||||||
//#include "driver.h"
|
//#include "driver.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct fceu_settings_struct {
|
||||||
int PAL;
|
int PAL;
|
||||||
int NetworkPlay;
|
int NetworkPlay;
|
||||||
int SoundVolume; //Master volume
|
int SoundVolume; //Master volume
|
||||||
|
|
|
@ -1008,7 +1008,7 @@ static void CommandSelectSaveSlot(void)
|
||||||
{
|
{
|
||||||
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
handleEmuCmdByTaseditor(execcmd);
|
handleEmuCmdByTaseditor(execcmd);
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
|
@ -1026,7 +1026,7 @@ static void CommandStateSave(void)
|
||||||
{
|
{
|
||||||
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
handleEmuCmdByTaseditor(execcmd);
|
handleEmuCmdByTaseditor(execcmd);
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
|
@ -1047,7 +1047,7 @@ static void CommandStateLoad(void)
|
||||||
{
|
{
|
||||||
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
handleEmuCmdByTaseditor(execcmd);
|
handleEmuCmdByTaseditor(execcmd);
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
|
@ -1110,7 +1110,7 @@ void LagCounterToggle(void)
|
||||||
|
|
||||||
static void LaunchTasEditor(void)
|
static void LaunchTasEditor(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
extern bool enterTASEditor();
|
extern bool enterTASEditor();
|
||||||
enterTASEditor();
|
enterTASEditor();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1118,56 +1118,56 @@ static void LaunchTasEditor(void)
|
||||||
|
|
||||||
static void LaunchMemoryWatch(void)
|
static void LaunchMemoryWatch(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
CreateMemWatch();
|
CreateMemWatch();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LaunchDebugger(void)
|
static void LaunchDebugger(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
DoDebug(0);
|
DoDebug(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LaunchNTView(void)
|
static void LaunchNTView(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
DoNTView();
|
DoNTView();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LaunchPPU(void)
|
static void LaunchPPU(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
DoPPUView();
|
DoPPUView();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LaunchHex(void)
|
static void LaunchHex(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
DoMemView();
|
DoMemView();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LaunchTraceLogger(void)
|
static void LaunchTraceLogger(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
DoTracer();
|
DoTracer();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LaunchCodeDataLogger(void)
|
static void LaunchCodeDataLogger(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
DoCDLogger();
|
DoCDLogger();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LaunchCheats(void)
|
static void LaunchCheats(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
extern HWND hCheat;
|
extern HWND hCheat;
|
||||||
ConfigCheats(hCheat);
|
ConfigCheats(hCheat);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1175,7 +1175,7 @@ static void LaunchCheats(void)
|
||||||
|
|
||||||
static void LaunchRamWatch(void)
|
static void LaunchRamWatch(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
extern void OpenRamWatch(); //adelikat: Blah blah hacky, I know
|
extern void OpenRamWatch(); //adelikat: Blah blah hacky, I know
|
||||||
OpenRamWatch();
|
OpenRamWatch();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1183,14 +1183,14 @@ static void LaunchRamWatch(void)
|
||||||
|
|
||||||
static void LaunchRamSearch(void)
|
static void LaunchRamSearch(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
extern void OpenRamSearch();
|
extern void OpenRamSearch();
|
||||||
OpenRamSearch();
|
OpenRamSearch();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RamSearchOpLT(void) {
|
static void RamSearchOpLT(void) {
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (GameInfo)
|
if (GameInfo)
|
||||||
{
|
{
|
||||||
extern void SetSearchType(int SearchType);
|
extern void SetSearchType(int SearchType);
|
||||||
|
@ -1202,7 +1202,7 @@ static void RamSearchOpLT(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RamSearchOpGT(void) {
|
static void RamSearchOpGT(void) {
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (GameInfo)
|
if (GameInfo)
|
||||||
{
|
{
|
||||||
extern void SetSearchType(int SearchType);
|
extern void SetSearchType(int SearchType);
|
||||||
|
@ -1214,7 +1214,7 @@ static void RamSearchOpGT(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RamSearchOpLTE(void) {
|
static void RamSearchOpLTE(void) {
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (GameInfo)
|
if (GameInfo)
|
||||||
{
|
{
|
||||||
extern void SetSearchType(int SearchType);
|
extern void SetSearchType(int SearchType);
|
||||||
|
@ -1226,7 +1226,7 @@ static void RamSearchOpLTE(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RamSearchOpGTE(void) {
|
static void RamSearchOpGTE(void) {
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (GameInfo)
|
if (GameInfo)
|
||||||
{
|
{
|
||||||
extern void SetSearchType(int SearchType);
|
extern void SetSearchType(int SearchType);
|
||||||
|
@ -1238,7 +1238,7 @@ static void RamSearchOpGTE(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RamSearchOpEQ(void) {
|
static void RamSearchOpEQ(void) {
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (GameInfo)
|
if (GameInfo)
|
||||||
{
|
{
|
||||||
extern void SetSearchType(int SearchType);
|
extern void SetSearchType(int SearchType);
|
||||||
|
@ -1250,7 +1250,7 @@ static void RamSearchOpEQ(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RamSearchOpNE(void) {
|
static void RamSearchOpNE(void) {
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (GameInfo)
|
if (GameInfo)
|
||||||
{
|
{
|
||||||
extern void SetSearchType(int SearchType);
|
extern void SetSearchType(int SearchType);
|
||||||
|
@ -1263,7 +1263,7 @@ static void RamSearchOpNE(void) {
|
||||||
|
|
||||||
static void DebuggerStepInto()
|
static void DebuggerStepInto()
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (GameInfo)
|
if (GameInfo)
|
||||||
{
|
{
|
||||||
extern void DoDebuggerStepInto();
|
extern void DoDebuggerStepInto();
|
||||||
|
@ -1279,7 +1279,7 @@ static void FA_SkipLag(void)
|
||||||
|
|
||||||
static void OpenRom(void)
|
static void OpenRom(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
extern HWND hAppWnd;
|
extern HWND hAppWnd;
|
||||||
LoadNewGamey(hAppWnd, 0);
|
LoadNewGamey(hAppWnd, 0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1287,14 +1287,14 @@ static void OpenRom(void)
|
||||||
|
|
||||||
static void CloseRom(void)
|
static void CloseRom(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
CloseGame();
|
CloseGame();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReloadRom(void)
|
void ReloadRom(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
||||||
{
|
{
|
||||||
// load most recent project
|
// load most recent project
|
||||||
|
@ -1326,14 +1326,14 @@ static void UndoRedoSavestate(void)
|
||||||
|
|
||||||
static void FCEUI_DoExit(void)
|
static void FCEUI_DoExit(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
DoFCEUExit();
|
DoFCEUExit();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToggleFullscreen()
|
void ToggleFullscreen()
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
extern int SetVideoMode(int fs); //adelikat: Yeah, I know, hacky
|
extern int SetVideoMode(int fs); //adelikat: Yeah, I know, hacky
|
||||||
extern void UpdateCheckedMenuItems();
|
extern void UpdateCheckedMenuItems();
|
||||||
|
|
||||||
|
@ -1349,20 +1349,20 @@ void ToggleFullscreen()
|
||||||
|
|
||||||
static void TaseditorRewindOn(void)
|
static void TaseditorRewindOn(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
mustRewindNow = true;
|
mustRewindNow = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
static void TaseditorRewindOff(void)
|
static void TaseditorRewindOff(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
mustRewindNow = false;
|
mustRewindNow = false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TaseditorCommand(void)
|
static void TaseditorCommand(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
if (FCEUMOV_Mode(MOVIEMODE_TASEDITOR))
|
||||||
handleEmuCmdByTaseditor(execcmd);
|
handleEmuCmdByTaseditor(execcmd);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "utils/memory.h"
|
#include "utils/memory.h"
|
||||||
#include "utils/xstring.h"
|
#include "utils/xstring.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#ifdef CREATE_AVI
|
#ifdef CREATE_AVI
|
||||||
#include "drivers/videolog/nesvideos-piece.h"
|
#include "drivers/videolog/nesvideos-piece.h"
|
||||||
|
@ -28,6 +29,8 @@
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#ifdef __WIN_DRIVER__
|
||||||
#include "./drivers/win/common.h"
|
#include "./drivers/win/common.h"
|
||||||
#include "./drivers/win/window.h"
|
#include "./drivers/win/window.h"
|
||||||
extern void AddRecentMovieFile(const char *filename);
|
extern void AddRecentMovieFile(const char *filename);
|
||||||
|
@ -35,6 +38,8 @@ extern void AddRecentMovieFile(const char *filename);
|
||||||
extern bool mustEngageTaseditor;
|
extern bool mustEngageTaseditor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int RAMInitOption;
|
extern int RAMInitOption;
|
||||||
extern int RAMInitSeed;
|
extern int RAMInitSeed;
|
||||||
|
|
||||||
|
@ -619,7 +624,7 @@ static void LoadFM2_binarychunk(MovieData& movieData, EMUFILE* fp, int size)
|
||||||
fp->fseek(curr,SEEK_SET);
|
fp->fseek(curr,SEEK_SET);
|
||||||
|
|
||||||
//the amount todo is the min of the limiting size we received and the remaining contents of the file
|
//the amount todo is the min of the limiting size we received and the remaining contents of the file
|
||||||
int todo = std::min(size, flen);
|
int todo = std::min<int>(size, flen);
|
||||||
|
|
||||||
int numRecords = todo/recordsize;
|
int numRecords = todo/recordsize;
|
||||||
if (movieData.loadFrameCount!=-1 && movieData.loadFrameCount<numRecords)
|
if (movieData.loadFrameCount!=-1 && movieData.loadFrameCount<numRecords)
|
||||||
|
@ -866,7 +871,7 @@ static void OnMovieClosed()
|
||||||
freshMovie = false; //No longer a fresh movie loaded
|
freshMovie = false; //No longer a fresh movie loaded
|
||||||
if (bindSavestate) AutoSS = false; //If bind movies to savestates is true, then there is no longer a valid auto-save to load
|
if (bindSavestate) AutoSS = false; //If bind movies to savestates is true, then there is no longer a valid auto-save to load
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(__WIN_DRIVER__)
|
||||||
SetMainWindowText();
|
SetMainWindowText();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1032,7 +1037,7 @@ bool FCEUI_LoadMovie(const char *fname, bool _read_only, int _pauseframe)
|
||||||
return true; //adelikat: file did not fail to load, so return true (false is only for file not exist/unable to open errors
|
return true; //adelikat: file did not fail to load, so return true (false is only for file not exist/unable to open errors
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
//Fix relative path if necessary and then add to the recent movie menu
|
//Fix relative path if necessary and then add to the recent movie menu
|
||||||
extern std::string BaseDirectory;
|
extern std::string BaseDirectory;
|
||||||
|
|
||||||
|
@ -1099,7 +1104,7 @@ bool FCEUI_LoadMovie(const char *fname, bool _read_only, int _pauseframe)
|
||||||
else
|
else
|
||||||
FCEU_DispMessage("Replay started Read+Write.",0);
|
FCEU_DispMessage("Replay started Read+Write.",0);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
SetMainWindowText();
|
SetMainWindowText();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1129,7 +1134,7 @@ void FCEUI_SaveMovie(const char *fname, EMOVIE_FLAG flags, std::wstring author)
|
||||||
if (NULL == openRecordingMovie(fname))
|
if (NULL == openRecordingMovie(fname))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
//Add to the recent movie menu
|
//Add to the recent movie menu
|
||||||
AddRecentMovieFile(fname);
|
AddRecentMovieFile(fname);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1176,7 +1181,7 @@ void FCEUI_SaveMovie(const char *fname, EMOVIE_FLAG flags, std::wstring author)
|
||||||
//either dumps the current joystick state or loads one state from the movie
|
//either dumps the current joystick state or loads one state from the movie
|
||||||
void FCEUMOV_AddInputState()
|
void FCEUMOV_AddInputState()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if (movieMode == MOVIEMODE_TASEDITOR)
|
if (movieMode == MOVIEMODE_TASEDITOR)
|
||||||
{
|
{
|
||||||
// if movie length is less or equal to currFrame, pad it with empty frames
|
// if movie length is less or equal to currFrame, pad it with empty frames
|
||||||
|
@ -1410,7 +1415,7 @@ bool FCEUMOV_ReadState(EMUFILE* is, uint32 size)
|
||||||
{
|
{
|
||||||
if (currMovieData.loadFrameCount >= 0)
|
if (currMovieData.loadFrameCount >= 0)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
int result = MessageBox(hAppWnd, "This movie is a TAS Editor project file.\nIt can be modified in TAS Editor only.\n\nOpen it in TAS Editor now?", "Movie Replay", MB_YESNO);
|
int result = MessageBox(hAppWnd, "This movie is a TAS Editor project file.\nIt can be modified in TAS Editor only.\n\nOpen it in TAS Editor now?", "Movie Replay", MB_YESNO);
|
||||||
if (result == IDYES)
|
if (result == IDYES)
|
||||||
mustEngageTaseditor = true;
|
mustEngageTaseditor = true;
|
||||||
|
@ -1498,7 +1503,7 @@ bool FCEUMOV_ReadState(EMUFILE* is, uint32 size)
|
||||||
if(tempMovieData.guid != currMovieData.guid)
|
if(tempMovieData.guid != currMovieData.guid)
|
||||||
{
|
{
|
||||||
//mbg 8/18/08 - this code can be used to turn the error message into an OK/CANCEL
|
//mbg 8/18/08 - this code can be used to turn the error message into an OK/CANCEL
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
std::string msg = "There is a mismatch between savestate's movie and current movie.\ncurrent: " + currMovieData.guid.toString() + "\nsavestate: " + tempMovieData.guid.toString() + "\n\nThis means that you have loaded a savestate belonging to a different movie than the one you are playing now.\n\nContinue loading this savestate anyway?";
|
std::string msg = "There is a mismatch between savestate's movie and current movie.\ncurrent: " + currMovieData.guid.toString() + "\nsavestate: " + tempMovieData.guid.toString() + "\n\nThis means that you have loaded a savestate belonging to a different movie than the one you are playing now.\n\nContinue loading this savestate anyway?";
|
||||||
int result = MessageBox(hAppWnd, msg.c_str(), "Error loading savestate", MB_OKCANCEL);
|
int result = MessageBox(hAppWnd, msg.c_str(), "Error loading savestate", MB_OKCANCEL);
|
||||||
if(result == IDCANCEL)
|
if(result == IDCANCEL)
|
||||||
|
@ -1892,7 +1897,7 @@ void FCEUI_MoviePlayFromBeginning(void)
|
||||||
{
|
{
|
||||||
if (movieMode == MOVIEMODE_TASEDITOR)
|
if (movieMode == MOVIEMODE_TASEDITOR)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
handleEmuCmdByTaseditor(EMUCMD_MOVIE_PLAY_FROM_BEGINNING);
|
handleEmuCmdByTaseditor(EMUCMD_MOVIE_PLAY_FROM_BEGINNING);
|
||||||
#endif
|
#endif
|
||||||
} else if (movieMode != MOVIEMODE_INACTIVE)
|
} else if (movieMode != MOVIEMODE_INACTIVE)
|
||||||
|
@ -1925,7 +1930,7 @@ void FCEUI_MoviePlayFromBeginning(void)
|
||||||
//currMovieData.loadSavestateFrom(&currMovieData.savestate); //TODO: make something like this work instead so it doesn't have to reload
|
//currMovieData.loadSavestateFrom(&currMovieData.savestate); //TODO: make something like this work instead so it doesn't have to reload
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
SetMainWindowText();
|
SetMainWindowText();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//TODO - we really need some kind of global platform-specific options api
|
//TODO - we really need some kind of global platform-specific options api
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
#include "drivers/win/main.h"
|
#include "drivers/win/main.h"
|
||||||
#include "drivers/win/cheat.h"
|
#include "drivers/win/cheat.h"
|
||||||
#include "drivers/win/ram_search.h"
|
#include "drivers/win/ram_search.h"
|
||||||
|
@ -312,7 +312,7 @@ static bool ReadStateChunks(EMUFILE* is, int32 totalsize)
|
||||||
|
|
||||||
//MBG TODO - can this be moved to a better place?
|
//MBG TODO - can this be moved to a better place?
|
||||||
//does it even make sense, displaying XBuf when its XBackBuf we just loaded?
|
//does it even make sense, displaying XBuf when its XBackBuf we just loaded?
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FCEUD_BlitScreen(XBuf);
|
FCEUD_BlitScreen(XBuf);
|
||||||
|
@ -795,7 +795,7 @@ bool FCEUSS_Load(const char *fname, bool display_message)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
Update_RAM_Search(); // Update_RAM_Watch() is also called.
|
Update_RAM_Search(); // Update_RAM_Watch() is also called.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -874,7 +874,7 @@ void AddExState(void *v, uint32 s, int type, const char *desc)
|
||||||
std::string desc = tmp;
|
std::string desc = tmp;
|
||||||
if(names.find(desc) != names.end())
|
if(names.find(desc) != names.end())
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef __WIN_DRIVER__
|
||||||
MessageBox(NULL,"OH NO!!! YOU HAVE AN INVALID SFORMAT! POST A BUG TICKET ALONG WITH INFO ON THE ROM YOURE USING\n","OOPS",MB_OK);
|
MessageBox(NULL,"OH NO!!! YOU HAVE AN INVALID SFORMAT! POST A BUG TICKET ALONG WITH INFO ON THE ROM YOURE USING\n","OOPS",MB_OK);
|
||||||
#else
|
#else
|
||||||
printf("OH NO!!! YOU HAVE AN INVALID SFORMAT! POST A BUG TICKET ALONG WITH INFO ON THE ROM YOURE USING\n");
|
printf("OH NO!!! YOU HAVE AN INVALID SFORMAT! POST A BUG TICKET ALONG WITH INFO ON THE ROM YOURE USING\n");
|
||||||
|
|
|
@ -131,6 +131,10 @@ typedef uint32_t uint32;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(WIN32) && !defined(__QT_DRIVER__)
|
||||||
|
#define __WIN_DRIVER__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef void (*writefunc)(uint32 A, uint8 V);
|
typedef void (*writefunc)(uint32 A, uint8 V);
|
||||||
typedef uint8 (*readfunc)(uint32 A);
|
typedef uint8 (*readfunc)(uint32 A);
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#define __FCEU_VERSION
|
#define __FCEU_VERSION
|
||||||
|
|
||||||
//todo - everyone will want to support this eventually, i suppose
|
//todo - everyone will want to support this eventually, i suppose
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) && !defined(__QT_DRIVER__)
|
||||||
#include "scmrev.h"
|
#include "scmrev.h"
|
||||||
#else
|
#else
|
||||||
#ifdef SVN_REV
|
#ifdef SVN_REV
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "fceulua.h"
|
#include "fceulua.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
#include "drivers/win/common.h" //For DirectX constants
|
#include "drivers/win/common.h" //For DirectX constants
|
||||||
#include "drivers/win/input.h"
|
#include "drivers/win/input.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -289,7 +289,7 @@ void FCEU_PutImage(void)
|
||||||
uint32 ci = 0;
|
uint32 ci = 0;
|
||||||
uint32 color;
|
uint32 color;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
// This doesn't work in anything except windows for now.
|
// This doesn't work in anything except windows for now.
|
||||||
// It doesn't get set anywhere in other ports.
|
// It doesn't get set anywhere in other ports.
|
||||||
if (!oldInputDisplay)
|
if (!oldInputDisplay)
|
||||||
|
|
|
@ -24,7 +24,7 @@ void FCEU_WriteWaveData(int32 *Buffer, int Count)
|
||||||
int16 *dest;
|
int16 *dest;
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef __WIN_DRIVER__
|
||||||
if(!soundlog) return;
|
if(!soundlog) return;
|
||||||
#else
|
#else
|
||||||
if(!soundlog && !FCEUI_AviIsRecording()) return;
|
if(!soundlog && !FCEUI_AviIsRecording()) return;
|
||||||
|
@ -46,7 +46,7 @@ void FCEU_WriteWaveData(int32 *Buffer, int Count)
|
||||||
if(soundlog)
|
if(soundlog)
|
||||||
wsize+=fwrite(temp,1,Count*sizeof(int16),soundlog);
|
wsize+=fwrite(temp,1,Count*sizeof(int16),soundlog);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef __WIN_DRIVER__
|
||||||
if(FCEUI_AviIsRecording())
|
if(FCEUI_AviIsRecording())
|
||||||
{
|
{
|
||||||
FCEUI_AviSoundUpdate((void*)temp, Count);
|
FCEUI_AviSoundUpdate((void*)temp, Count);
|
||||||
|
|
Loading…
Reference in New Issue