Commit Graph

40 Commits

Author SHA1 Message Date
refractionpcsx2 c40e132284 SIO/MCD: hugely improved memcard swapping + reinsertion 2023-06-26 14:45:50 +01:00
Tyler Wilding 199db12565 input-rec: integrate with new SIO code 2022-11-27 20:02:29 +00:00
Connor McLaughlin d0673f9133 Sio: Fix host pointer getting serialized
[SAVEVERSION+] It wasn't saving the FIFO anyway. Sorry for the save
state bump, but it's unavoidable :(
2022-11-21 13:40:01 +00:00
RedPanda4552 1146175648 SIO: Separate SIO2 from SIO0, reimplement memcard protocol
[SAVEVERSION+] Fixes memcard issues in MGS3, Shining Force EXA, and others which do 4 sector reads
2022-11-19 02:08:13 +00:00
TellowKrinkle 738c8cb630 Core: Remove trailing whitespace from all files 2022-09-16 00:52:28 -05:00
Connor McLaughlin 59412b1673 Qt: Implement multitap 2022-06-11 14:37:57 +01:00
Connor McLaughlin 547b2fc9e8 VMManager: Cycle/autoeject memory cards when files change
Hopefully should fix card changes not getting picked up in some games.
2022-06-07 15:09:41 +01:00
Connor McLaughlin ea051c6d5f Everything: Get rid of wx entirely from the Qt build 2022-05-22 13:58:56 +01:00
Connor McLaughlin 640e955c38 Move MemoryCard{File,Folder} out of GUI 2021-10-01 23:46:52 -04:00
Connor McLaughlin e2992cbc02 Remove gui/ directory from target-wide includes 2021-09-17 22:03:00 -04:00
Gauvain 'GovanifY' Roussel-Tarbouriech e68a3606a9 mcd: finish to remove the remnants of the plugin interface 2021-07-03 18:16:11 -04:00
Gauvain 'GovanifY' Roussel-Tarbouriech 27cb700259 mcd: begin to remove the plugin interface 2021-07-03 18:16:11 -04:00
arcum42 f3d738d771 Remove an extern that goes to a function not in the code. 2018-09-16 00:40:07 -07:00
Brian e4777f6563 Allow PSX memcard creation, dynamic SIO delay type. 2017-09-15 11:19:33 -04:00
Gregory Hainaut 270d7191ce sio: increase buffer to avoid overflow
memcardWrite will use "sio.buf[data + 5] = mcd->term;" and data is 8 bits

Reported by coverity
2016-11-01 13:41:03 +01:00
Robert 35fa20d965 psxmode: changes to sio that allow psx pads to work 2016-09-24 20:08:46 +02:00
Admiral H. Curtiss 97a68becb9 Handle filter management in the folder memcard class rather than outside.
This prevents desync between what is assumed to be the active filter and
what is actually the active filter, fixing errors like #1179 where the
memory cards are closed and reopened for whatever reason.
2016-04-02 15:22:11 +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 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 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
refraction e8f31a3e3e SIO: KrossX new changes for Memcards, seems ok on a test of random 10-15 random games, please report if any errors appear!
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5781 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-12-29 21:57:17 +00:00
avihal@gmail.com 92487e2618 (Patch by KrossX): Fixed multitap - Part 2 - (e.g. Timesplitters), New: support raw PSX
memcards (mcd/mcr), Fixed issues with pad 2 (e.g. issue 1326).

These are changes which were left out at r5622, updated to pach v9 by KrossX from http://forums.pcsx2.net/Thread-Multitap-PCSX2 .

- Please report any issues with memcards corruption/incompatibilities here.
- Please feedback on multitap improvements here.

Thanks, KrossX! :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5703 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-07-19 13:43:33 +00:00
avihal@gmail.com c75334bc11 MCD manager: refinements and improvements:
1. automatic apply of create/delete/copy/rename without the annoying "do this and that" dialogs.
2. auto-eject/insert mcd after mcd changes (useful especially when replacing one enabled-and-used card with another).
3. double-click/enter a line at the list invokes rename/create
4. only disabled ports are gray (easier to look at - previously: also empty)
5. when creating a new card, enter (at the name selection box) is enough to continue
6. list now stretched properly with the page.
7. Automatic creation of mcd file when opening the manager and a card is enabled but doesn't exist (easier to manage, would've been created on boot anyway).
8. as a result, now properly handles initial post-install/setup state.
9. auto eject/insert of mcd now displays at the console (also for loadstate, if applicable)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4433 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-03-14 21:20:23 +00:00
Jake.Stine 70d47bf240 Copyright 2010 : PCSX2 and plugins! (notable exception: didn't update copyright info in any Gabest plugins)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2937 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-05-03 14:08:02 +00:00
sudonim1 4457fe40fc Removed all trailing whitespace in *.c *.cpp *.h because it irritates me.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2897 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-25 00:31:27 +00:00
ramapcsx2 9d2699529a Enable the SIO_INLINE_IRQS define, to free some load from the IOP event handler.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2586 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-02-11 10:04:00 +00:00
Jake.Stine 4fbc2c26aa Fixed a bug in BiosTools.cpp that caused Bios-Not-Found errors.
MemoryCard / Multitap Renovations:
 * Memorycards should now support multitap (somewhat untested)
 * Implemented a memorycard plugin interface, using the new API defined in PluginCallbacks.h (still prelim and hackish)
 * Memorycard settings are saved to ini!
 * Multitap is now controlled by PCSX2 instead of the pad plugin (which means no multitap until we implement the gui toggles to enable it)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1817 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-13 17:11:35 +00:00
Jake.Stine d2fbb22076 Upgraded PCSX2 core and utilities to GPLv3.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1783 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-08 12:08:10 +00:00
Jake.Stine 980afabc30 wxgui:
* Moved some files around in an attempt to improve CoreEmu and UI separation.
 * Major upgrade to the UI's handling of savestates
 * Maintenance work to the C++ exception handling
 * Some improved error handling and message popups here or there

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1714 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-08-31 03:47:05 +00:00
Jake.Stine e93b101f49 Cleanup: Moved some rather intrusive instances of global namespace pollution in Sio.h into a new sio_internal.h, so that the rest of the world doesn't have to ensure the pain of having BREAK and RTS macro'd to integers. ;)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1198 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-16 00:43:46 +00:00
mattmenke a6d330448c Fixed a simple bug from one of arcum42's cleanups.
Cleaned up multitap code a little in both PCSX2 and LilyPad.

Some extra safety checks in LilyPad when loading state.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@906 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-04-04 11:21:35 +00:00
mattmenke ee7008ded8 Pcsx2: Added experimental mtap support, must be enabled through pad plugin. Fixed bug in default PADfreeze function that would fail to load states created with LilyPad when using other pad plugins. Added support for disconnected pads (Mostly a convenience for mtap support, for games that use pad presence to assign pads to players).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@854 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-03-29 06:24:28 +00:00
Jake.Stine 4bd685485d New Speed Hack! And a good one! This is an idea I had a while back, as implemented by Pseudonym, and is intended as an eventual replacement for all EE speed hacks (x2, x3, etc). Expect huge speedups in most games way beyond even X3, and it shouldn't break FMVs or cause graphical artifacts either like the old hacks do.
Memorycard Fixups:
 * Replaced the old disfunctional memcard manager with a neat and practical one, with options!
 * Improved memcard hotswapping support.
 * Added memcard CRC checks to savestates, so that memory cards are only ejected when needed (should fix Guitar Hero problems from Issue 32)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@532 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-19 09:51:21 +00:00
Jake.Stine fe6f45e45e Updated the Copyright to reflect the passing of another year. :)
Updated the pcsx2_suite_2008.sln; changed SPU2ghz to SPU2-X.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@502 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-15 23:23:46 +00:00
Jake.Stine 6ebfae8ef1 Re-Added eol-style:native properties to the repository. The settings got lost when we merged from Playground to Official.
Added interface.cpp (plugin/pcsx2 interface) and savestate.cpp to SPU2ghz, to help clean up SPU2.cpp.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@463 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-09 21:15:56 +00:00
Jake.Stine 632b73ccad Added preliminary hotswapping and "Memorycard Not Present" support to the SIO. Among other things, this fixes memcard problems when using savestates, where-by some games would fail to recognize that the memory card had changed. So those of you with savestates for games that refuse to save to a newly-formatted memcard, this *should* allow you to save now. :)
Added several new files to organize some large files: HwRead.cpp, HwWrite.cpp, MemoryCard.cpp, MemoryCard.h.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@459 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-09 17:53:35 +00:00
Jake.Stine fcad9f8ebc Added NTFS compression to the memcards folder and any memory cards used from pcsx2. Most memory cards compress exceptionally well (from 16M to 3M typically).
Also in this commit: Some minor code cleanups to sio.cpp, and added some missing setup code to the Iop Counters savestate loader; psxhblankgate and psxvblankgate weren't being re-initialized.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@456 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-09 06:02:46 +00:00
refraction aa94c30dc3 Should be the last of the trunk, gotta finish the branches/tags, but thats the main bulk transferred.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@426 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-02-06 20:04:37 +00:00
refraction 57616b8916 git-svn-id: http://pcsx2.googlecode.com/svn/trunk@407 96395faa-99c1-11dd-bbfe-3dabce05a288 2009-02-06 18:28:52 +00:00
laurence.muller a2791d843e Using standard SVN folder structure
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@398 96395faa-99c1-11dd-bbfe-3dabce05a288
2008-11-06 23:27:06 +00:00