Skip to content

Commit 07de1ad

Browse files
authored
Merge pull request #13 from ShutOstrich/master
2 parents 7e9cde3 + 23bc100 commit 07de1ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2917
-472
lines changed

FCEU.xcodeproj/project.pbxproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
8F28FD5229FD3E7D008FC4A9 /* inx007t.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F28FD4F29FD3E7D008FC4A9 /* inx007t.cpp */; };
7373
8F28FD5529FD3EA4008FC4A9 /* debugsymboltable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F28FD5329FD3EA4008FC4A9 /* debugsymboltable.cpp */; };
7474
8F28FD5829FD3EB8008FC4A9 /* mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F28FD5629FD3EB8008FC4A9 /* mutex.cpp */; };
75+
8F5A69CF2A9BF26400B405DB /* ld65dbg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F5A69CB2A9BF26400B405DB /* ld65dbg.cpp */; };
7576
945942D014E4F2DC0015D2AA /* FCEUX.icns in Resources */ = {isa = PBXBuildFile; fileRef = 945942CF14E4F2DC0015D2AA /* FCEUX.icns */; };
7677
949BBA741A9EF079007B49CC /* 01-222.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949BB7521A9EED55007B49CC /* 01-222.cpp */; };
7778
949BBA751A9EF079007B49CC /* 09-034a.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949BB7531A9EED55007B49CC /* 09-034a.cpp */; };
@@ -346,6 +347,12 @@
346347
8F28FD5429FD3EA4008FC4A9 /* debugsymboltable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debugsymboltable.h; sourceTree = "<group>"; };
347348
8F28FD5629FD3EB8008FC4A9 /* mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mutex.cpp; sourceTree = "<group>"; };
348349
8F28FD5729FD3EB8008FC4A9 /* mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutex.h; sourceTree = "<group>"; };
350+
8F5A69C72A9BF26400B405DB /* timeStamp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timeStamp.cpp; sourceTree = "<group>"; };
351+
8F5A69C82A9BF26400B405DB /* profiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = profiler.h; sourceTree = "<group>"; };
352+
8F5A69C92A9BF26400B405DB /* profiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = profiler.cpp; sourceTree = "<group>"; };
353+
8F5A69CA2A9BF26400B405DB /* timeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = timeStamp.h; sourceTree = "<group>"; };
354+
8F5A69CB2A9BF26400B405DB /* ld65dbg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ld65dbg.cpp; sourceTree = "<group>"; };
355+
8F5A69CC2A9BF26400B405DB /* ld65dbg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ld65dbg.h; sourceTree = "<group>"; };
349356
945942CE14E4EF180015D2AA /* OENESSystemResponderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OENESSystemResponderClient.h; path = ../OpenEmu/SystemPlugins/NES/OENESSystemResponderClient.h; sourceTree = "<group>"; };
350357
945942CF14E4F2DC0015D2AA /* FCEUX.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = FCEUX.icns; sourceTree = "<group>"; };
351358
949BB74E1A9EED55007B49CC /* asm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = asm.cpp; sourceTree = "<group>"; };
@@ -816,6 +823,8 @@
816823
949BB9A11A9EED59007B49CC /* input */,
817824
949BB9B61A9EED59007B49CC /* input.cpp */,
818825
949BB9B71A9EED59007B49CC /* input.h */,
826+
8F5A69CB2A9BF26400B405DB /* ld65dbg.cpp */,
827+
8F5A69CC2A9BF26400B405DB /* ld65dbg.h */,
819828
949BB9F71A9EED5A007B49CC /* lua-engine.cpp */,
820829
949BB9F81A9EED5A007B49CC /* movie.cpp */,
821830
949BB9F91A9EED5A007B49CC /* movie.h */,
@@ -832,6 +841,8 @@
832841
949BBA0B1A9EED5A007B49CC /* ppu.cpp */,
833842
949BBA0C1A9EED5A007B49CC /* ppu.h */,
834843
949BBA0D1A9EED5A007B49CC /* pputile.inc */,
844+
8F5A69C92A9BF26400B405DB /* profiler.cpp */,
845+
8F5A69C82A9BF26400B405DB /* profiler.h */,
835846
949BBA0F1A9EED5A007B49CC /* sound.cpp */,
836847
949BBA101A9EED5A007B49CC /* sound.h */,
837848
949BBA111A9EED5A007B49CC /* state.cpp */,
@@ -1185,6 +1196,8 @@
11851196
949BBA291A9EED5B007B49CC /* memory.h */,
11861197
8F28FD5629FD3EB8008FC4A9 /* mutex.cpp */,
11871198
8F28FD5729FD3EB8008FC4A9 /* mutex.h */,
1199+
8F5A69C72A9BF26400B405DB /* timeStamp.cpp */,
1200+
8F5A69CA2A9BF26400B405DB /* timeStamp.h */,
11881201
949BBA2B1A9EED5B007B49CC /* unzip.cpp */,
11891202
949BBA2C1A9EED5B007B49CC /* unzip.h */,
11901203
949BBA2D1A9EED5B007B49CC /* valuearray.h */,
@@ -1463,6 +1476,7 @@
14631476
949BBAF61A9EF07A007B49CC /* sa-9602b.cpp in Sources */,
14641477
870D6EA61D4C1F82001E8FC6 /* BMW8544.cpp in Sources */,
14651478
870D6EB41D4C20B3001E8FC6 /* inlnsf.cpp in Sources */,
1479+
8F5A69CF2A9BF26400B405DB /* ld65dbg.cpp in Sources */,
14661480
949BBAF71A9EF07A007B49CC /* sachen.cpp in Sources */,
14671481
949BBAF81A9EF07A007B49CC /* sc-127.cpp in Sources */,
14681482
870D6EB31D4C20B3001E8FC6 /* hp898f.cpp in Sources */,

Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundleSignature</key>
1818
<string>????</string>
1919
<key>CFBundleVersion</key>
20-
<string>2.6.5</string>
20+
<string>2.6.6</string>
2121
<key>NSPrincipalClass</key>
2222
<string>OEGameCoreController</string>
2323
<key>OEGameCoreClass</key>

src/CMakeLists.txt

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ if ( ${QHELP} )
2222
add_definitions( -D_USE_QHELP )
2323
endif()
2424

25+
if ( ${FCEU_PROFILER_ENABLE} )
26+
message( STATUS "FCEU Profiler Enabled")
27+
add_definitions( -D__FCEU_PROFILER_ENABLE__ )
28+
endif()
29+
30+
2531
if ( ${QT6} )
2632
find_package( Qt6 REQUIRED COMPONENTS Widgets OpenGL OpenGLWidgets ${QtHelpModule})
2733
add_definitions( ${Qt6Widgets_DEFINITIONS} ${Qt6Help_DEFINITIONS} ${Qt6OpenGLWidgets_DEFINITIONS} )
@@ -41,12 +47,15 @@ if(WIN32)
4147
add_definitions( -DMSVC -D_CRT_SECURE_NO_WARNINGS )
4248
add_definitions( -D__SDL__ -D__QT_DRIVER__ -DQT_DEPRECATED_WARNINGS )
4349
add_definitions( -DFCEUDEF_DEBUGGER )
50+
add_definitions( -D_USE_LIBARCHIVE )
4451
add_definitions( /wd4267 /wd4244 )
4552
#add_definitions( /wd4018 ) # Integer comparison sign mismatch warnings
4653
include_directories( ${SDL_INSTALL_PREFIX}/SDL2/include )
54+
include_directories( ${LIBARCHIVE_INSTALL_PREFIX}/libarchive/include )
4755
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/drivers/win/zlib )
4856
set( OPENGL_LDFLAGS OpenGL::GL )
4957
set( SDL2_LDFLAGS ${SDL_INSTALL_PREFIX}/SDL2/lib/x64/SDL2.lib )
58+
set( LIBARCHIVE_LDFLAGS ${LIBARCHIVE_INSTALL_PREFIX}/libarchive/lib/archive.lib )
5059
set( SYS_LIBS wsock32 ws2_32 vfw32 Htmlhelp )
5160
set(APP_ICON_RESOURCES_WINDOWS ${CMAKE_SOURCE_DIR}/icons/fceux.rc )
5261

@@ -93,6 +102,12 @@ else(WIN32)
93102
#endif()
94103
add_definitions( -D__QT_DRIVER__ -DQT_DEPRECATED_WARNINGS )
95104

105+
if ( ${GPROF_ENABLE} )
106+
add_definitions( -pg )
107+
set( GPROF_LDFLAGS -pg )
108+
message( STATUS "GNU Profiling Enabled" )
109+
endif()
110+
96111
if ( ${ASAN_ENABLE} )
97112
add_definitions( -fsanitize=address -fsanitize=bounds-strict )
98113
add_definitions( -fsanitize=undefined -fno-sanitize=vptr )
@@ -110,6 +125,13 @@ else(WIN32)
110125
add_definitions( -D_SYSTEM_MINIZIP ${MINIZIP_CFLAGS} )
111126
endif()
112127

128+
pkg_check_modules( LIBARCHIVE libarchive)
129+
130+
if ( ${LIBARCHIVE_FOUND} )
131+
message( STATUS "Using System Libarchive Library ${LIBARCHIVE_VERSION}" )
132+
add_definitions( -D_USE_LIBARCHIVE ${LIBARCHIVE_CFLAGS} )
133+
endif()
134+
113135
pkg_check_modules( X264 x264)
114136

115137
if ( ${X264_FOUND} )
@@ -287,11 +309,13 @@ set(SRC_CORE
287309
${CMAKE_CURRENT_SOURCE_DIR}/filter.cpp
288310
${CMAKE_CURRENT_SOURCE_DIR}/ines.cpp
289311
${CMAKE_CURRENT_SOURCE_DIR}/input.cpp
312+
${CMAKE_CURRENT_SOURCE_DIR}/ld65dbg.cpp
290313
${CMAKE_CURRENT_SOURCE_DIR}/movie.cpp
291314
${CMAKE_CURRENT_SOURCE_DIR}/netplay.cpp
292315
${CMAKE_CURRENT_SOURCE_DIR}/nsf.cpp
293316
${CMAKE_CURRENT_SOURCE_DIR}/oldmovie.cpp
294317
${CMAKE_CURRENT_SOURCE_DIR}/palette.cpp
318+
${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp
295319
${CMAKE_CURRENT_SOURCE_DIR}/ppu.cpp
296320
${CMAKE_CURRENT_SOURCE_DIR}/sound.cpp
297321
${CMAKE_CURRENT_SOURCE_DIR}/state.cpp
@@ -503,6 +527,7 @@ set(SRC_CORE
503527
${CMAKE_CURRENT_SOURCE_DIR}/utils/md5.cpp
504528
${CMAKE_CURRENT_SOURCE_DIR}/utils/memory.cpp
505529
${CMAKE_CURRENT_SOURCE_DIR}/utils/mutex.cpp
530+
${CMAKE_CURRENT_SOURCE_DIR}/utils/timeStamp.cpp
506531
)
507532

508533

@@ -525,6 +550,8 @@ set(SRC_DRIVERS_SDL
525550
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleWindow.cpp
526551
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleViewerGL.cpp
527552
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleViewerSDL.cpp
553+
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleViewerQWidget.cpp
554+
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleViewerInterface.cpp
528555
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/InputConf.cpp
529556
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/GamePadConf.cpp
530557
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/FamilyKeyboard.cpp
@@ -550,6 +577,7 @@ set(SRC_DRIVERS_SDL
550577
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleUtilities.cpp
551578
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleVideoConf.cpp
552579
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleSoundConf.cpp
580+
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/StateRecorderConf.cpp
553581
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/iNesHeaderEditor.cpp
554582
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/SplashScreen.cpp
555583
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/TraceLogger.cpp
@@ -634,14 +662,15 @@ add_executable( ${APP_NAME} ${SOURCES} ../resources.qrc
634662
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
635663
endif()
636664

637-
target_link_libraries( ${APP_NAME} ${ASAN_LDFLAGS}
665+
target_link_libraries( ${APP_NAME}
666+
${ASAN_LDFLAGS} ${GPROF_LDFLAGS}
638667
${${Qt}Widgets_LIBRARIES}
639668
${${Qt}Help_LIBRARIES}
640669
${${Qt}OpenGL_LIBRARIES}
641670
${${Qt}OpenGLWidgets_LIBRARIES}
642671
${OPENGL_LDFLAGS}
643672
${SDL2_LDFLAGS}
644-
${MINIZIP_LDFLAGS} ${ZLIB_LIBRARIES}
673+
${MINIZIP_LDFLAGS} ${ZLIB_LIBRARIES} ${LIBARCHIVE_LDFLAGS}
645674
${LUA_LDFLAGS} ${X264_LDFLAGS} ${X265_LDFLAGS} ${LIBAV_LDFLAGS}
646675
${SYS_LIBS}
647676
)

src/boards/15.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
static uint16 latchea;
2525
static uint8 latched;
2626
static uint8 *WRAM = NULL;
27-
static uint32 WRAMSIZE;
27+
static uint32 WRAMSIZE=0;
2828
static SFORMAT StateRegs[] =
2929
{
3030
{ &latchea, 2, "AREG" },
@@ -108,8 +108,7 @@ void Mapper15_Init(CartInfo *info) {
108108
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
109109
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
110110
if (info->battery) {
111-
info->SaveGame[0] = WRAM;
112-
info->SaveGameLen[0] = WRAMSIZE;
111+
info->addSaveGameBuf( WRAM, WRAMSIZE );
113112
}
114113
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
115114
AddExState(&StateRegs, ~0, 0, 0);

src/boards/164.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
static uint8 laststrobe, trigger;
2828
static uint8 reg[8];
2929
static uint8 *WRAM = NULL;
30-
static uint32 WRAMSIZE;
30+
static uint32 WRAMSIZE=0;
3131

3232
static writefunc pcmwrite;
3333

@@ -123,8 +123,7 @@ void Mapper164_Init(CartInfo *info) {
123123
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
124124

125125
if (info->battery) {
126-
info->SaveGame[0] = WRAM;
127-
info->SaveGameLen[0] = WRAMSIZE;
126+
info->addSaveGameBuf( WRAM, WRAMSIZE );
128127
}
129128

130129
GameStateRestore = StateRestore;
@@ -172,8 +171,7 @@ void Mapper163_Init(CartInfo *info) {
172171
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
173172

174173
if (info->battery) {
175-
info->SaveGame[0] = WRAM;
176-
info->SaveGameLen[0] = WRAMSIZE;
174+
info->addSaveGameBuf( WRAM, WRAMSIZE );
177175
}
178176
GameStateRestore = StateRestore;
179177
AddExState(&StateRegs, ~0, 0, 0);
@@ -223,8 +221,7 @@ void UNLFS304_Init(CartInfo *info) {
223221
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
224222

225223
if (info->battery) {
226-
info->SaveGame[0] = WRAM;
227-
info->SaveGameLen[0] = WRAMSIZE;
224+
info->addSaveGameBuf( WRAM, WRAMSIZE );
228225
}
229226

230227
GameStateRestore = StateRestore;

src/boards/177.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
static uint8 reg;
2424

2525
static uint8 *WRAM = NULL;
26-
static uint32 WRAMSIZE;
26+
static uint32 WRAMSIZE=0;
2727

2828
static SFORMAT StateRegs[] =
2929
{
@@ -73,8 +73,7 @@ void Mapper177_Init(CartInfo *info) {
7373
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
7474
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
7575
if (info->battery) {
76-
info->SaveGame[0] = WRAM;
77-
info->SaveGameLen[0] = WRAMSIZE;
76+
info->addSaveGameBuf( WRAM, WRAMSIZE );
7877
}
7978

8079
AddExState(&StateRegs, ~0, 0, 0);

src/boards/178.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
static uint8 reg[4];
2828

2929
static uint8 *WRAM = NULL;
30-
static uint32 WRAMSIZE;
30+
static uint32 WRAMSIZE=0;
3131

3232
// Tennis with VR sensor, very simple behaviour
3333
extern void GetMouseData(uint32 (&md)[3]);
@@ -192,8 +192,7 @@ void Mapper178_Init(CartInfo *info) {
192192
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
193193
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
194194
if (info->battery) {
195-
info->SaveGame[0] = WRAM;
196-
info->SaveGameLen[0] = WRAMSIZE;
195+
info->addSaveGameBuf( WRAM, WRAMSIZE );
197196
}
198197
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
199198

src/boards/18.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static uint8 preg[4], creg[8];
2424
static uint8 IRQa, mirr;
2525
static int32 IRQCount, IRQLatch;
2626
static uint8 *WRAM = NULL;
27-
static uint32 WRAMSIZE;
27+
static uint32 WRAMSIZE=0;
2828

2929
static SFORMAT StateRegs[] =
3030
{
@@ -125,8 +125,7 @@ void Mapper18_Init(CartInfo *info) {
125125
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
126126
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
127127
if (info->battery) {
128-
info->SaveGame[0] = WRAM;
129-
info->SaveGameLen[0] = WRAMSIZE;
128+
info->addSaveGameBuf( WRAM, WRAMSIZE );
130129
}
131130

132131
AddExState(&StateRegs, ~0, 0, 0);

src/boards/246.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
static uint8 regs[8];
2424
static uint8 *WRAM = NULL;
25-
static uint32 WRAMSIZE;
25+
static uint32 WRAMSIZE = 0;
2626

2727
static SFORMAT StateRegs[] =
2828
{
@@ -79,8 +79,7 @@ void Mapper246_Init(CartInfo *info) {
7979
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
8080

8181
if (info->battery) {
82-
info->SaveGame[0] = WRAM;
83-
info->SaveGameLen[0] = WRAMSIZE;
82+
info->addSaveGameBuf( WRAM, WRAMSIZE );
8483
}
8584

8685
AddExState(&StateRegs, ~0, 0, 0);

src/boards/252.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
static uint8 creg[8], preg[2];
2424
static int32 IRQa, IRQCount, IRQClock, IRQLatch;
2525
static uint8 *WRAM = NULL;
26-
static uint32 WRAMSIZE;
26+
static uint32 WRAMSIZE=0;
2727
static uint8 *CHRRAM = NULL;
28-
static uint32 CHRRAMSIZE;
28+
static uint32 CHRRAMSIZE=0;
2929

3030
static SFORMAT StateRegs[] =
3131
{
@@ -127,8 +127,7 @@ void Mapper252_Init(CartInfo *info) {
127127
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
128128
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
129129
if (info->battery) {
130-
info->SaveGame[0] = WRAM;
131-
info->SaveGameLen[0] = WRAMSIZE;
130+
info->addSaveGameBuf( WRAM, WRAMSIZE );
132131
}
133132
GameStateRestore = StateRestore;
134133
AddExState(&StateRegs, ~0, 0, 0);

0 commit comments

Comments
 (0)