Commit graph

180 commits

Author SHA1 Message Date
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Megamouse 2cee26c3e7 Cleanup some includes 2020-10-31 11:53:46 +01:00
Eladash b8fa6fb4c4 Win32 FS: Rewrite (fix) vfs::host::rename 2020-09-24 18:06:51 +03:00
Eladash 2620a51cc9 cellSaveData: Minor fix 2020-09-19 13:53:04 +01:00
Megamouse a2da187615 HLE: localize most - if not all - exposed strings 2020-09-14 18:24:18 +02:00
Eladash 0c85d4c0d0
cellSaveData: Fix loss of "BLIST" and files' information in PARAM.SFO (#8706) 2020-08-08 23:40:47 +01:00
Eladash 54b87b6dbb cellSaveData: Increase sleep time 2020-07-23 13:45:58 +03:00
Eladash ab9cdc70ad cellSaveData: Emulate PPU processing of auto/list post-fixed callback 2020-06-25 19:50:33 +03:00
Eladash 01cafc042d cellSaveData: Ensure savedata_context members are 16-byte aligned
I saw stvx v128{0} (aligned 16-bytes store) usage on the first 16-bytes of CellSaveDataCBResult before funcStat in fw.
Also I saw 4 stw of u32{0} on it as well before funcFile, funcFixed and funcList.
So just add the resets for result before all callbacks, and make all
members of savedata_ontext 16 -byte aligned in case there are more
members guaranteed to be aligned.
2020-03-21 19:05:20 +03:00
Eladash ceaee0ec68 cellSaveData: Clear traces of setList setup from setBuf->buf, add missing memset
* Always memset 0 setBuf->buf (to bufSize) before funcStat if the direcory is not new.
* Always memset 0 setBuf->buf (to bufSize) if listGet->dirNum became non-zero (listGet->dirListNum can be zero yet memset still occurs) .
* Clear traces of setList setup before funcStat (after funcFixed/List, only if listGet->dirNum != 0, callback can hack this value and prevent the memset).
2020-03-21 19:05:20 +03:00
Eladash b6a288d383 cellSaveData: Skip directory items in savedata_get_list_item 2020-03-21 19:05:20 +03:00
Eladash be0e586671 cellSaveData: Add error checks for cellSaveData(User)GetListItem 2020-03-21 19:05:20 +03:00
Eladash 66916df4ae cellSaveData: Set listSet->focusPosition to LISTHEAD by default 2020-03-21 19:05:20 +03:00
Eladash fae46bf194 cellSaveData: Add CELL_SAVEDATA_ERROR_NOUSER 2020-03-21 19:05:20 +03:00
Eladash c3d36940c7 cellSaveData: do not allow to read/write/delete system files in funcFile
Return param error 70 as realhw in this case.
2020-03-14 16:12:18 +03:00
Eladash db71d4852a cellSaveData: Fix adding file entries to PARAM.SFO on error 2020-03-14 16:12:18 +03:00
Eladash 88ee198d78 cellSaveData: return ERROR_FAILURE on funcFile deletion failures 2020-03-14 16:12:18 +03:00
Eladash 5d78d81c00 cellSaveData: Filter directory lists to allowed savedata directories
Filters "." and "..", as well as possible wrong directories added by the user.
2020-03-13 22:43:27 +03:00
Eladash b21b4faca8 cellSaveData: Fixed savedata lock after fmt::throw_exception 2020-03-13 22:43:27 +03:00
Eladash d58f52ff31 cellSaveData: Add some listSet error checks
* Check listSet->fixedListNum.
* Check listSet->fixedList for nullptr and its directory items names.
* Check listSet->focusDirName for nullptr and directory name.
* Check listSet->newData->iconPosition.
* Check listSet->newData->dirName for nullptr and directory string.
* Check statSet->setParam->parental_level for old sdk.
* Return an error if listSet->focusPosition is NEWDATA and listSet->newData is nullptr.
* Simplify savedata directory list selection.
2020-03-13 22:43:27 +03:00
Eladash 54af8ec544 cellSaveData: funcFile fixes
* Allow '_' at filenames start and extension.
* Check if reading offset is valid, fix error code to CELL_SAVEDATA_ERROR_FAILURE.
* Don't create empty file on error of write ops.
* Don't allow "." and ".." filenames on funcFile, return CELL_SAVEDATA_ERROR_BROKEN.
2020-03-13 22:43:27 +03:00
Eladash fdf47f43d8 cellSaveData: refactor param error 70 checks
Also extend the check to check empty name.
2020-03-13 22:43:27 +03:00
Nekotekina Aux1 250736ece5 Fix warnings in emucore 2020-03-04 21:23:34 +03:00
Eladash de1774d8f2
cellSaveData: fix doneGet->sizeKB (#7674)
* cellSaveData: fix doneGet->sizeKB

* [⚠️] Warning: beware of typos [⚠️]
2020-03-03 11:24:49 +03:00
Eladash 7dfd50d5cc cellSaveData: followup to #7652 2020-03-01 20:09:46 +03:00
Eladash ffd5a9e91c cellSaveData: Add some error checks for fixedSet, fileSet params 2020-03-01 10:56:41 +02:00
Eladash 655f7ce8a2 cellSaveData: Add null funcStat check
it's ordered specially for some functions
2020-03-01 00:14:45 +03:00
Eladash 34a0c3f488 cellSaveData: Add error param 72, 73 checks for file write ops 2020-02-29 13:06:14 +03:00
Eladash 30f7c81cc5 cellSaveData: Implement/Fix param error 22 for funcFile, funcDone, funcFixed and funcList 2020-02-28 16:47:51 +01:00
Eladash 0eabfdcadd cellSavedata: reset padding of g_savedata_context 2020-02-27 22:31:31 +03:00
Eladash d86241bbcd cellSaveData: reset fileSet and fileGet->reserved everytime 2020-02-27 22:31:31 +03:00
Eladash 42a0512c66 cellSaveData: Avoid passing vm pointer to native API 2020-02-27 22:31:31 +03:00
Eladash 556aba46b5 cellSaveData: do not fail on empty directory 2020-02-27 22:31:31 +03:00
gamerforEA 93552a5958 Apply some Clang-Tidy fixes 2020-02-27 00:38:55 +03:00
JohnHolmesII 9b7d28b5dd cellSaveData.cpp: Use ref instead of copy 2020-02-23 09:38:04 +03:00
Nekotekina 92e3eaf3ff Fix signed-unsigned comparisons and mark warning as error (part 2). 2020-02-19 22:54:58 +03:00
Nekotekina 771eff273b First part of fixing sign-compare warning (inside be_t). 2020-02-19 22:54:58 +03:00
Nekotekina f08c778d2c Use more starts_with/ends_with.
Remove ends_with global func.
2020-02-18 14:53:23 +03:00
Megamouse fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
Megamouse b3ad89cc8b cellSaveData: remove duplicate yield 2020-01-03 14:22:40 +01:00
Megamouse 7af2ebb6f4 cellSaveData: use errDialog to skip error dialogs 2020-01-02 05:49:03 +01:00
Megamouse a5c5927468 cellSaveData: only show dialogs in fixed functions 2019-12-31 14:15:43 +01:00
Megamouse 45dc5d9b02 cellSaveData: improve ppu schedule during dialogs 2019-12-29 14:22:58 +01:00
Megamouse c4b4ce46b8 cellSaveData: don't pause apps during dialogs 2019-12-29 14:22:58 +01:00
Megamouse 0b78404337 cellSaveData: get confirmation if not CELL_SAVEDATA_OPTION_NOCONFIRM 2019-12-29 01:19:04 +01:00
Megamouse bb7848f6e5 cellSaveData: add error dialog to callback result errors 2019-12-29 01:19:04 +01:00
Megamouse 47da907366 cellSaveData: add confirmation dialog for save data interactions 2019-12-29 01:19:04 +01:00
Megamouse d73f04da13 cellSaveData: avoid nullptr if there is no dialog 2019-12-03 07:59:10 +01:00
Eladash 1986944c61 Implement sysutil_check_name_string
* Fully implement 3, 4, 16 and 17 error checks of cellSaveData.
* cellSysCacheMount restrict characters in ID.
* cellHddGameCheck restricts characters in dirName.
2019-11-10 14:32:15 +03:00
MSuih f3ed26e9db Small warnings cleanup (#6671)
* Ignore more warnings

These are intentional

* Signed/unsigned mismatch when comparing

* Explictly cast values

* Intentionally discard a nodiscard value

* Change ppu_tid to u32

* Do not use POSIX function name on Windows

* Qt: Use horizontalAdvance instead of width

* Change progress variables to u32
2019-10-25 13:32:21 +03:00
Eladash 75ee668922 Log fs::g_tls_error on ACCESS_ERROR errors 2019-10-14 20:44:23 +03:00
Nekotekina bd1a24b894 Tidy endianness support (se_t) implementation
Move se_t and se_storage to util/endian.hpp
Use single template instead of two specializations.
Add minor optimization for MSVC.
Remove v128 dependency.
Try to enable intrinsics for unaligned data.
Fix minor bug in u16/u32/u64 specializations.
2019-09-28 15:39:50 +03:00
Nekotekina 57f2189b1a cellSaveData: fix VFS escape usage 2019-09-27 19:04:16 +03:00
Nekotekina cd843bda6e cellSaveData: always commit changes on error in funcFile loop
Make sure the changes which are already done are written.
2019-09-25 18:47:38 +03:00
Nekotekina f841b47b6b cellSaveData: add auto maintenance routine in Emu.Init()
This routine:
1) Removes junk backup directories
2) Fixes interrupted save data process in edge case
This case can happen if emu terminates between two atomic renames.

Also use directory renaming technique for delete op.
Also rewrite recreate operation to be part of atomic process.
2019-09-25 18:47:38 +03:00
Nekotekina 40fcd457bf cellSaveData fixup 2019-09-23 03:15:41 +03:00
Eladash 2494091353 cellSaveData: Log param error code (#6587) 2019-09-23 03:07:23 +03:00
Nekotekina d0db7ca6bd cellSaveData fixup (#6393)
Increase entry max size
2019-09-05 14:49:03 +03:00
RipleyTom 8de1239132 Simulate BSD FS for file order presentation in savedata 2019-09-05 03:01:46 +03:00
Megamouse 32b5b11a83 cellSaveData/overlays: prevent possible array out of bounds in list view 2019-08-26 21:09:20 +02:00
Megamouse 94dd6c2007 cellSaveData: improve param.sfo creation 2019-08-22 08:05:12 +02:00
Megamouse 896cfd2ade cellSaveData/cellMsgDialog: implement cellSaveDataDelete 2019-08-22 08:05:12 +02:00
Megamouse 0b720aeb59 cellSaveData: ignore dot and dotdot 2019-08-22 08:05:12 +02:00
Megamouse b3c1759853 cellSaveData/overlays/Qt: fix some warnings and a possible nullptr deref 2019-08-22 08:05:12 +02:00
Megamouse 8debdfcd09 handle empty callback returns 2019-08-14 23:54:09 +02:00
Eladash 997e3046e3 vm/sys_overlay Improvements
- Implement sys_overlay_load_module_by_fd.
- Implement special segment allocation when ppc_seg flag is specified.
2019-07-28 14:23:58 +03:00
msuih d57124d075 Explicitly cast size_t to integer types 2019-07-01 04:33:23 +03:00
eladash 450e2c9a0e cellSaveData: Add missing SDK version check for setParam->reserved2 check 2019-04-20 20:43:58 +01:00
eladash ae5a4b697e Fix cellSaveDataListAutoSave/Load unk flags 2019-04-20 01:04:41 +03:00
eladash 9446bd2d3f Handle a few more cellSaveData errors
* Check directory existence if setParam is NULL (dont create directory)
* Fix mask for reCreateMode
* Check a few setParam fields including reserved buffers.
* Fix sizeKb when the dir is empty except from PARAM.SFO
* Fix error checking when CELL_SAVEDATA_RECREATE_YES is specified but setParam is NULL (Doesnt do anything, simply errors)
2019-04-20 01:04:41 +03:00
eladash ff11d9a3bd Improve scheduler control for cellSaveData
TODO: There are probably more spots where we should yield.
A little more at the start because PacketRead is called twice.
Dont use sys_timer_usleep because it will just call this_thread::yield() repeatedly.
2019-04-20 01:04:41 +03:00
eladash 9497270da5 Implement initial arguments error checking for cellSaveData 2019-04-20 01:04:41 +03:00
eladash 2b4bc588dc Put missing check_state() in some places
Fixes a few verification failures while closing the emulator with HLE liblv2
2019-04-20 01:04:41 +03:00
Nekotekina 9736773c04 Implement vfs::host::rename
With spurious access error workaround
2019-04-10 13:58:12 +03:00
elad b7da3ea5cd Release ppu thread before ShowSaveDataDialog, Fixes #4031 2019-03-08 23:44:46 +03:00
Nekotekina 400718dfd9 cellSaveData: try to handle occasional failures
Retry moving directory on FILE_ACCESS_ERROR
2019-01-31 01:08:30 +03:00
Megamouse 58a22d1461 cellSaveData: add error_code 2019-01-14 21:12:13 +01:00
Nekotekina 453344c232 cellSaveData: workaround possible issues with symlinks
Don't use ../ location for temporary directories
2019-01-13 14:45:36 +03:00
Nekotekina f750b4c420 cellSaveData: try to address #5415 2018-12-24 16:04:46 +03:00
Nekotekina d6afba96f1 cellSaveData: fix 'Already exists' error 2018-12-10 01:43:47 +03:00
RipleyTom 5207b00973 Extra Handling of result value of funcStat CB. 2018-12-08 18:44:00 +03:00
Nekotekina 65ca934452 cellSaveData: fix truncation size (regression) 2018-11-17 14:40:11 +03:00
Nekotekina 12ceceff19 cellSaveData: restore atime/mtime for unmodified files 2018-11-17 14:40:11 +03:00
Nekotekina eaa17b7f7c cellSaveData: anti-corruption precautions
Try to commit changes atomically
2018-11-05 13:14:11 +03:00
Nekotekina ca5158a03e Cleanup semaphore<> (sema.h) and mutex.h (shared_mutex)
Remove semaphore_lock and writer_lock classes, replace with std::lock_guard
Change semaphore<> interface to Lockable (+ exotic try_unlock method)
2018-09-03 23:00:36 +03:00
Nekotekina 363811981d Reintroduce LOG_CHANNEL
Groundwork for further improvements
2018-08-25 15:39:00 +03:00
Megamouse f6a3659a14 user_manager: megamouse fixes 4 2018-07-26 03:16:51 +04:00
mpm11011 68202eb2b7 user-manager: replacing fmt::format with string concat.
(cherry picked from commit 63379afc7a402edb2159912318281febc3e7438a)
2018-07-26 03:16:51 +04:00
mpm11011 948bd3673e user-manager: squash all commits for this feature. 2018-07-26 03:16:51 +04:00
Nekotekina d2d07abcc5 cellSaveData: print SECUREFILE secureId
This can help to decrypt savedata
2018-07-21 12:18:07 +03:00
Ofek d3596fbc95 Change all hddFreeSizeKB to 40gb-1 2018-07-11 02:16:14 +04:00
Megamouse 5454f57dd0 cellSaveData: handle fatal error fs::file is_null (read-only files) 2018-06-08 23:41:56 +03:00
Nekotekina 182259e4a5 cellSaveData fix 2018-05-21 21:47:04 +03:00
Megamouse 68fff54a8b cellSaveData: don't return after funcStat was successful in savedata_op
also add some missing constants
2018-05-20 23:16:11 +04:00
Nekotekina da9baac842 Improve save data dialog
Bug fix: don't display new data entry when not asked for
Use icon/title provided by the game for the new data entry
Display new data entry at the beginning of list when necessary
Minor cellSaveData cleanup
2018-04-02 16:27:28 +03:00
jjsat 4620fa8bd8 Return parameter error if the result of funcFixed is invalid. 2018-04-01 01:04:37 +04:00
jjsat 1dc87a0704 Corrected logic for handling number of returned save data list entries and total number of save entries. 2018-04-01 01:04:37 +04:00
jjsat bba7184090 Handle some invalid save function parameters. 2018-04-01 01:04:37 +04:00
jjsat d973337c4e Calculate save data file size more accurately and return size in savedata_get_list_item if requested. 2018-04-01 01:04:37 +04:00
kd-11 71f69d1d48
rsx/overlays: Introduce 'native' HUD UI and implement some common dialogs (#4011) 2018-01-17 19:14:00 +03:00