Commit Graph

6653 Commits

Author SHA1 Message Date
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
Admiral H. Curtiss f15c07653c MemoryCard: Add support for folder memcards in GUI and make both implementation function side-by-side. 2015-07-12 14:37:49 +02:00
Admiral H. Curtiss 1d46800888 MemoryCard: Full initial implementation of the FolderMemoryCard.
FileMemoryCard: Log reads and writes so I know what kind of commands I have to deal with.

FolderMemoryCard: Create basic class/method outline based on FileMemoryCard.

FolderMemoryCard: Add a FolderMemoryCardAggregator so I don't have to write every method in a way that has to handle more than one memory ca

Also shuffle around the location of code because C++ cares about stuff
needing to be defined before they're usable.

FolderMemoryCard: Implement Open().

FolderMemoryCard: Implement GetSizeInfo().

FolderMemoryCard: Implement some basic structure of Read()

FolderMemoryCard: Implement parts of Read() and Save().

Shouldn't it be Write() or Load()? Anyway, this doesn't work yet, but it
gets part of the formatting procedure done which is at least something!

FolderMemoryCard: Add method to calculate ECC.

FolderMemoryCard: Start implementing the FAT.

MemoryCard: More logging.

FolderMemoryCard: Formatting works now!

Formatted memory card isn't actually recognized as formatted yet because I don't store folder metadata yet, but we're getting there!

FolderMemoryCard: Recognize when it's trying to access a data cluster.

FolderMemoryCard: Add directory/file entry support.

On further inspection this might not a be a good way to handle erasing.

FolderMemoryCard: Method to get a file entry and file path from a file's data cluster.

FolderMemoryCard: wxDirName is garbage, let's just use wxFileName for the folder too...

FolderMemoryCard: Fix Erase method.

FolderMemoryCard: Start implementing file writes.

This is still quite broken but we're getting somewhere here!

FolderMemoryCard: Load the data from the host file system into the memory card on emulation start.

Also store superblock to host file system on end.

FolderMemoryCard: Fix a few warnings.

FolderMemoryCard: Implement file reads.

FolderMemoryCard: Proper ECC reads.

FolderMemoryCard: Reads to unmapped locations should return all 0xFF.

FolderMemoryCard: Some sort of working WriteToFile.

(Note: Doesn't always work depending on what order data gets written...)

FolderMemoryCard: Forgot a 'b' for reading files in binary mode. Whoops.

FolderMemoryCard: Load timestamps from the host filesystem.

FolderMemoryCard: r+b needs the file to exist so create if it doesn't.

FolderMemoryCard: Failsafe to allow non-sequential writes.

FolderMemoryCard: Use a cache for writes. Does not flush to host FS yet!

FolderMemoryCard: Flush the data written to the cache to the host file system on exit.

FolderMemoryCard: Since we have a cache now, remove code related to formatting, it's no longer needed.

FolderMemoryCard: More binary file mode mistakes...

FolderMemoryCard: Make it actually possible to disable/eject cards.

FileMemoryCard: Revert changes made for logging data.

FolderMemoryCard: Remove excessive logging.

MemoryCard: Note that the superblock struct is no longer unused.

FolderMemoryCard: A disabled card shouldn't try writing data on exit.

FolderMemoryCard: Log when flushing data.

FolderMemoryCard: Replace plain constants with const variables.

Should make it easier in the future to change the memory card size, if
needed.

FolderMemoryCard: Sort of handle the case when the total size of files in the memory card folder exceed the size of the card.

Not elegant but prevents ugly errors. The file that caused the card to
"overflow" will be seen as corrupted data by the PS2 browser.

FolderMemoryCard: Some sanity checks.

FolderMemoryCard: superBlock member really should have that m_ too to be consistent.

MemoryCard: Switch back to FileMemoryCard for merging.

FolderMemoryCard: Implement GetCRC() via a timestamp of the last memory card write.

Reasoning:
Regarding auto-ejecting on save load, I see that the current
implementation checks that by comparing memory card CRC and reinserting
if it mismatches. Since it's actually just about seeing if the memory
card state of the savestate and the current state match, my GetCRC() now
returns a millisecond timestamp of the last time the card was written
to. This should work out to the intended result, though I had to use
wxGetLocalTimeMillis() instead of wxGetUTCTimeMillis() since the latter
isn't available for some reason.

Fix GCC warnings and error.

MemoryCard: Switch implementations via a #define.

FolderMemoryCard: Add a NextFrame() method that should be called once per frame. Flushes written data to the host file system after a certain amout of frames have passed without any writes (currently 60).

MemoryCard: Add the NextFrame() method to the plugin API.

Counters: If the FolderMemoryCard is selected, inform it every frame in VSyncEnd() that a frame has passed.

VSyncEnd: Probably better to inform the memory card before the frame limiting.

Fix error when using wxWidgets >= 3.0.

FolderMemoryCard: Extract into its own .h/.cpp files.

FolderMemoryCard: Change cache to a map to reduce memory usage.

FolderMemoryCard: More gracefully handle lack of space when adding files.
2015-07-12 14:37:49 +02:00
refractionpcsx2 875be67a7e Merge pull request #619 from pgert/master
Improvement of the HD-fix for Drakan 2 PAL.
2015-07-12 00:22:08 +01:00
Gregory Hainaut c660ea858b gsdx: move some CRC hacks to full level 2015-07-11 15:14:11 +02:00
Gregory Hainaut 5f8d3b9e4b gsdx-tc: remains in the memory
avoid a crash with kungfu panda
2015-07-11 14:35:35 +02:00
Gregory Hainaut a4bad8fdbc gsdx-ogl: avoid a bad conflict between accurate option 2015-07-11 14:35:35 +02:00
Gregory Hainaut 15b934eb2a gsdx-ogl: remove useless colclip message 2015-07-11 14:35:35 +02:00
Gregory Hainaut 91fbe6f108 gsdx-ogl: add some code to fix black netting on some renderings
Code is not yet enabled because it requires extensive test

The idea is to replace point by a 1 pixels sprite with the help of
a geometry shader. In 4x, point will be replaced by a 4x4 sprite.
2015-07-11 14:35:35 +02:00
Gregory Hainaut 5e7ce63ed1 glsl: add a geometry shader to upscale GS_POINT
The purpose is to avoid upscaling issue on POINT rendering (black netting on some FMVs)
2015-07-11 14:35:34 +02:00
Gregory Hainaut 2ccf108534 gsdx-ogl: add back a selector for the Geometry Shader 2015-07-11 14:35:34 +02:00
Gregory Hainaut b46f159ff2 Merge pull request #631 from turtleli/wxwidgets3_3rd_party_prep_v3
wxWidgets 3.0: Windows: Prepare 3rdparty files for switchover
2015-07-11 09:52:01 +02:00
Gregory Hainaut 67807908ca Merge pull request #641 from ssakash/patch-32
3rd party: update to latest version of Wglext.h and deprecate other glew files.
2015-07-11 09:49:14 +02:00
Gregory Hainaut 7f7f6c3b51 Merge pull request #640 from turtleli/gs-frame-title-fixes
GS frame title fixes
2015-07-11 09:47:27 +02:00
Gregory Hainaut 5ed45b6806 Merge pull request #644 from PCSX2/improve-texshuffle-detection
Improve texshuffle detection
2015-07-11 09:34:33 +02:00
Gregory Hainaut ec61ad3667 gsdx-tc: Add some code for the future
Partially invalidate RT when there is a write in the middle of it (actually 2 pages below)

Code is not yet enabled because
1/ I want to stabilize latest update
2/ not sure of the impact of the code
3/ maybe it need a more generic version
2015-07-10 22:35:26 +02:00
Gregory Hainaut 5888913052 gsdx-debug: don't print any "notify" message
Too verbose
2015-07-10 22:35:26 +02:00