Commit Graph

6822 Commits

Author SHA1 Message Date
Jonathan Li db6a32ac33 windows: switch to wxWidgets 3.0
This replaces wxWidgets 2.8 with wxWidgets 3.0 plus all the necessary
include/referencing to get PCSX2 to compile.

VS2012 change is untested.
2015-07-13 21:19:12 +01:00
Gregory Hainaut 6ed137dc9c gsdx-ogl: log openGL driver version 2015-07-13 12:35:55 +02:00
Gregory Hainaut 45e0cfae01 linux: add an example for the validation of tfx fs shader of GSdx 2015-07-13 12:06:32 +02:00
Gregory Hainaut 363a3100c0 linux: use latest profile on cg to validate shader
Otherwise it doesn't work with GSdx
2015-07-13 12:06:32 +02:00
refractionpcsx2 854403af81 Merge pull request #654 from TheLastRar/empty-ethernet-setting-crash
Dev9ghz: Fix crash when ethernet adapter is not selected
2015-07-12 22:34:04 +01:00
TheLastRar ebafb24099 dev9ghz: proper casing 2015-07-12 18:38:23 +01:00
TheLastRar 820323bc1e dev9ghz: Check if user has selected an adapter
Avoid copying from an invalid pointer
2015-07-12 18:37:38 +01:00
Gregory Hainaut c9d6ce3b63 Merge pull request #653 from PCSX2/texture-shuffle-again
gsdx: texture shuffle detection
2015-07-12 18:48:00 +02:00
Gregory Hainaut 8be32e4661 gsdx-tc: fix a memory leak when depth isn't fully supported
Fix issue #642
2015-07-12 17:57:42 +02:00
Gregory Hainaut f6f28042bd gsdx: texture shuffle detection
Don't check rt 32 bits state, it give false positive on suikoden
2015-07-12 15:21:04 +02:00
Admiral H. Curtiss 6bd578ccbe FolderMemoryCard: Reduce unnecessary file I/O by only flushing files that have actually changed since the last known memory card state on the host file system.
This means that we are now no longer touching files that haven't technically been written to. Some games use timestamp information to automatically highlight the save that was last written to, so this should fix a small but annoying bug where it would highlight the wrong one.

Do note that while there is a much simpler check that looks like this:
	// Remove (== don't flush) all memory card pages that haven't actually changed.
	for ( auto oldIt = m_oldDataCache.begin(); oldIt != m_oldDataCache.end(); ++oldIt ) {
		auto newIt = m_cache.find( oldIt->first );
		assert( newIt != m_cache.end() ); // if this isn't true something broke somewhere, the two maps should always contain the same pages
		if ( memcmp( &oldIt->second.raw[0], &newIt->second.raw[0], PageSize ) == 0 ) {
			m_cache.erase( newIt );
		}
	}
	m_oldDataCache.clear();
It can fail in edge cases that don't actually seem too unlikely. Imagine a save being deleted, and then a new save from the same game but in a different slot being created quickly afterwards. It seems quite possible that the new save's file data then occupies the exact same pages as the old save's, and since it's from the same game it might be close enough to where a page sized section (juse 0x200 bytes!) matches the data from the old save that previously resided in that location -- which would cause this code to throw away and not flush this data! It's a shame too, since this variant would be a few ms faster as well, but I feel it's better to be safe than sorry here.
2015-07-12 14:38:21 +02:00
Admiral H. Curtiss 03a6be28c0 FolderMemoryCard: Write the SuperBlock as part of Flush() instead of when the card is Close()d.
This mainly means that the superblock is now no longer written every single time the memory card is closed, but only when it's changed (which should be exactly once, when the memory card is formatted). It also means that you can format a memory card and then have the emulator crash later without having to reformat the card next time.
2015-07-12 14:38:20 +02:00
Admiral H. Curtiss 3a55360572 FolderMemoryCard: Fix a bug where the cache wouldn't be populated properly on first write to any given page.
I'm kinda surprised this didn't horribly break things, honestly. I guess it's because memory card data is always written in blocks, but still.
2015-07-12 14:38:20 +02:00
Admiral H. Curtiss 8e92d25b75 FolderMemoryCard: Add support for deleting of files/folders.
We're not actually deleting files though, we just rename them to prepend _pcsx2_deleted_, in case something breaks or whatever, so the user can in an emergency just restore the save by removing that part of the filename.
2015-07-12 14:38:19 +02:00
Admiral H. Curtiss 798ec3eb9c FolderMemoryCard: Some code cleanup. Use more named constants, mark methods as const where appropriate, and some other minor things. 2015-07-12 14:38:18 +02:00
Admiral H. Curtiss c0cc91fd0a FolderMemoryCard: Only add folders if all files and subfolders in it also fit into the remaining memory card space.
This avoids situations where, for example, it would only add the icon file but not the game data file because the memory card was near-full.
2015-07-12 14:38:18 +02:00
Admiral H. Curtiss c4570750ea FolderMemoryCard: Put the initialization of the file entry flushing logic into its own method. 2015-07-12 14:38:17 +02:00
Admiral H. Curtiss fbc8d30b67 FolderMemoryCard: Cleaned filenames should be used for directories, as well. 2015-07-12 14:38:16 +02:00
Admiral H. Curtiss 65058df3da Move the CopyDirectory() and RemoveDirectory() functions into FileUtils.cpp. 2015-07-12 14:38:16 +02:00
Admiral H. Curtiss 40e6a5c515 FolderMemoryCard: Don't assume that C limits are defined. 2015-07-12 14:38:15 +02:00
Admiral H. Curtiss a886f6e7e1 Fix some gcc warnings. 2015-07-12 14:38:15 +02:00
Admiral H. Curtiss eab49dbfa3 FolderMemoryCard: Reduce console logs. 2015-07-12 14:38:14 +02:00
Admiral H. Curtiss c651d28cc0 Clear memory card ejection timeout when a game boots.
This eliminates prompts at the start of a game complaining about no
memory card being inserted.
I'm honestly not entirely sure if this is safe (is there some memory
card driver that could cache results between different executables?) but
if it isn't we'll see it soon enough!
2015-07-12 14:38:14 +02:00
Admiral H. Curtiss e774011d71 FolderMemoryCard: Load the network configuration file regardless of filters. 2015-07-12 14:38:13 +02:00
Admiral H. Curtiss af3dfd39b0 FolderMemoryCard: Create directories recursively. 2015-07-12 14:38:13 +02:00
Admiral H. Curtiss 0976e124e8 FolderMemoryCard: More robust way of checking validity of a subdirectory.
Fixes this memory card:
http://forums.pcsx2.net/Thread-New-feature-Needs-testing-Automatically-managed-Folder-Memory-Card-Public-Test?pid=463506#pid463506
Presumably related to something LaunchElf writes into the memory card
file entries.
2015-07-12 14:38:12 +02:00
Admiral H. Curtiss 50ad3a8bf5 FolderMemoryCard: Clean PS2 filenames that would be illegal in Windows and write the actual names into the metadata files.
This fixes issues with game such as Rayman Revolution, http://forums.pcsx2.net/Thread-New-feature-Needs-testing-Automatically-managed-Folder-Memory-Card-Public-Test?pid=463482#pid463482
2015-07-12 14:38:12 +02:00
Admiral H. Curtiss 92c794f03b FolderMemoryCard: Fix bug that could cause crashes on memory cards that have leftover data from older saves in their file entry clusters. 2015-07-12 14:38:11 +02:00
Admiral H. Curtiss 385bdfb869 FolderMemoryCard: Further optimize file access times.
* Reduce the amount of times path strings are constructed.
* Move file metadata writing to the file helper, which means it will only be written once per consecutive file access instead of on every file chunk.
2015-07-12 14:38:10 +02:00
Admiral H. Curtiss 80feb1087c FolderMemoryCard: Add a helper structure to quickly access a file entry from a file data FAT cluster. Speeds up file access, especially when a lot of files are loaded in the virtual memory card. 2015-07-12 14:38:10 +02:00
Admiral H. Curtiss bee4f0578d GameIndex.dbf: Add Armored Core Memcard filters. 2015-07-12 14:38:09 +02:00
Admiral H. Curtiss c3694c4ad1 FolderMemoryCard: Abort Flush operation when remnants of an incomplete save operation are found. 2015-07-12 14:38:08 +02:00
Admiral H. Curtiss 541a254c60 FolderMemoryCard: Clean up Flush logic. 2015-07-12 14:38:07 +02:00
Admiral H. Curtiss f731e3dc1b FolderMemoryCard: On reads and writes to actual data, check if the relevant data is actually in use according to the FAT.
This allows us to skip a bunch of accesses trying to find a matching file or memory location, presumably without actual consequences. This isn't really gonna change much in actual game use, but does speed up conversions of FileMemoryCards.
2015-07-12 14:38:07 +02:00
Admiral H. Curtiss 41c3eacb6f FolderMemoryCard: Move file existence check into the helper class, so that it gets called much less often.
This *drastically* increases performance, bizarrely enough.
2015-07-12 14:38:06 +02:00
Admiral H. Curtiss f73db1a572 FolderMemoryCard: Optimize file access by keeping a file open between consecutive reads/writes to the same file. 2015-07-12 14:38:05 +02:00
Admiral H. Curtiss 5f8391f9f1 FolderMemoryCard: Fix sneaky bug that could occur in directories with odd number of files.
It was possible for an invalid (because never written to, so filled with 0xFF) file entry to be recognized as valid in GetFileEntryPointer(), which cascaded up to it flushing file data as fileEntryDict data and thus losing the relevant file data page.

Not sure if the other two entry accesses changed here are affected as well but better be safe than sorry, I suppose.
2015-07-12 14:38:04 +02:00
Admiral H. Curtiss 7e194f1a26 MemoryCard: Add option to convert a memory card to another type in the Memory Card Manager. 2015-07-12 14:38:04 +02:00
Admiral H. Curtiss d19facfb43 FolderMemoryCard: Add abililty to (re)set simulated memory card size.
This will probably only be used to reset a converted card back to 8MB.
Actually using a card as over 8MB is completely untested.
2015-07-12 14:37:58 +02:00
Admiral H. Curtiss 8029412fb7 FolderMemoryCard: Some code cleanup. 2015-07-12 14:37:58 +02:00
Admiral H. Curtiss f40b679653 Add option to enable/disable the filtering of the FolderMemoryCard. 2015-07-12 14:37:56 +02:00
Admiral H. Curtiss 72dcb9b94c MemoryCardListPanel: Minor visual bugfix.
If you inserted a PSX memory card into a slot, then swapped that with a
PS2 one, the memory card manager still displayed that card as a PSX one
with "MBit" instead of "MiB" as the size unit. Fixed.
2015-07-12 14:37:56 +02:00
Admiral H. Curtiss f32f42678c FolderMemoryCard: Filter only system data by default.
This reduces memory card initialization time.
Without this, it always indexes all files when the emulator boots, which
can take a few seconds if you have lots of files.
With this, the only file indexed is the PS2 "your system configuration"
file.

This has the side-effect of not being able to see save files in the PS2
BIOS unless you insert a game disc matching the files you want to see. I
don't think this is a big problem, but there should probably be a "don't
filter" option somewhere in case you want to manage files in the BIOS.
2015-07-12 14:37:55 +02:00
Admiral H. Curtiss b4b55289d6 FolderMemoryCard: Remember filter so it can be reapplied when memory cards are changed while game is running. 2015-07-12 14:37:55 +02:00
Admiral H. Curtiss 02ae12c555 GameIndex.dbf: Add a the initial set of Memory Card Filters.
This informs PCSX2 which games want to access more than just their own save files so it can load them into the virtual folder memory card.
This includes:
- Multi-disc games which obviously need to access saves from the other disc(s).
- Games that allow importing data from prequels.
- Games that unlock bonuses if they find data from other games in the series, by the same developer, etc.

This is almost certainly not all games that would want to access other saves, but it should cover a lot them.
2015-07-12 14:37:54 +02:00
Admiral H. Curtiss bcb71ae368 GameIndex.dbf: Fixed a few names, added a few missing games and multi-discs, added a few missing regions. 2015-07-12 14:37:53 +02:00
Admiral H. Curtiss 98012f82aa MemoryCard: Add support to override the memory card filter string via GameIndex.dbf. 2015-07-12 14:37:53 +02:00
Admiral H. Curtiss 2ee1cb81dd FolderMemoryCard: Allow multiple save names in the save file filtering.
Split multiple save names to be filtered with a "/", ie the filter "A/B" matches both save folders that contain "A" and save folders that contain "B".
2015-07-12 14:37:52 +02:00
Admiral H. Curtiss 880be6f602 FolderMemoryCard: Only load data relevant to game. Please read commit description!
Essentially, I'm telling the memory card to re-index itself with a
filter based on the game's disc serial every time a new executable boots
in the emulator.

This currently works for a lot of games, but fails in edge cases where
the game disc's serial does not match the game serial that is written to
the memory card as part of the save file's directory name. This affects
mostly (only?) games that have multiple discs. We could circumvent this
by adding a "save game serial" or something into the GameDatabase which
tells us what we should filter by for those cases.

Apart from this edge case, this appears to work surprisingly well. Try
it and see if you can find other issues!
2015-07-12 14:37:51 +02:00
Admiral H. Curtiss 139e28988d FolderMemoryCard: Store nonstandard file and folder metadata. Fixes issues with Star Ocean 3 battle trophies, and probably some other games. 2015-07-12 14:37:50 +02:00