Commit Graph

501 Commits

Author SHA1 Message Date
refractionpcsx2 b5eed53db0 CDVD: Fix rotational delay, don't apply to seek commands.
Fixes #4955
2021-11-01 12:07:42 +00:00
refractionpcsx2 6348fe7362 CDVD: Fix handling of Dual Layer disc latencies
Fixes #4962
2021-10-30 20:49:03 +01:00
Ty Lamontagne 0fed1cbedd clang-format: pcsx2/CDVD/CDVD.cpp 2021-10-26 09:56:41 +01:00
Ty Lamontagne f5a9b98578 CDVD: Reset VM on sceCdPowerOff writes 2021-10-26 09:56:41 +01:00
refractionpcsx2 bb494af6b0 CDVD: Buffer up to 16 sectors 2021-10-25 09:42:00 +01:00
Ziemas 3f6ac2fa68 Debugger: Separate EE and IOP symbol maps
Previously they shared a single map which dosen't make sense.
2021-10-17 04:08:35 +01:00
refractionpcsx2 9109751ff0 CDVD: Insert step on swap for Generic Detect before type detect 2021-10-14 23:16:48 +01:00
refractionpcsx2 f14c9e7ddd CDVD: Fix tray closure on No Disc 2021-10-14 22:22:37 +01:00
refractionpcsx2 d736c8b281 CDVD: Use CD or DVD detecting types 2021-10-14 21:51:48 +01:00
refractionpcsx2 54d10d21ec CDVD: Simulate 1 sector read ahead 2021-10-11 00:16:00 +01:00
refractionpcsx2 b8f4a8ffb3 CDVD: Added simple rotational latency
Also removed DMA delay
2021-10-05 13:25:12 +01:00
refractionpcsx2 6bed14cb26 CDVD: Time reads by sectors per second instead of bytes 2021-10-05 13:25:12 +01:00
refractionpcsx2 8d92c0668c
CDVD: Implement Disc Swapping (#4860)
Inspired by the work by fldef, fixes up swapping support for ISO's and physical discs

CDVD: Set the disk type to none/detecting when seeking.
Also disable the skip BIOS flag if we're not skipping the BIOS
CDVD: Fix up swapping behaviour, Singstar etc
2021-10-03 17:27:15 +01:00
refractionpcsx2 d0d58ded29 CDVD: Redesign and fix the Fast CDVD speedhack
Rather than setting it to a constant cycle count, it just halves all cycle counts being passed to it which aren't full seeks.
2021-10-03 10:49:51 +01:00
refractionpcsx2 8476fc3b5a CDVD: Implement correct SpindleCtrl handling
Semi decouple end of CDVD DMA's
Fix alternative reading method for reading not picking the correct speeds for DVD's
2021-10-02 04:47:11 +01:00
Connor McLaughlin a41ec422d2 Config: Move some Current fields to wx and fix UTF8 handling 2021-10-01 23:46:52 -04:00
Connor McLaughlin 4d8905abd6 Config: Swap out wxString for std::string
Also in CDVD.
2021-10-01 23:46:52 -04:00
Connor McLaughlin f79f85480b CDVD: Use ANSI variants on Windows for disc access
The drive path is not going to contain unicode characters.
2021-10-01 23:46:52 -04:00
Connor McLaughlin 307feefa87 Config: Move gzip index template to base config 2021-10-01 23:46:52 -04:00
Connor McLaughlin 77a890ff4a Config: Move Folders/BaseFilenames to base config 2021-10-01 23:46:52 -04:00
Connor McLaughlin 97b94acd86 CDVD: Fix possible uncaught exception in CheckDiskTypeFS 2021-10-01 13:26:08 +01:00
Connor McLaughlin e2992cbc02 Remove gui/ directory from target-wide includes 2021-09-17 22:03:00 -04:00
Silent f343614640 Target Windows 8 via project settings
It's needed for the next commit, as thanks to wxWidgets
anything using the precompiled header would default to 0x0600 (Vista)
instead of 0x0602 (Win8).

Now-redundant WINNT definitions resulting in macro redefinition
warnings have been removed.
2021-09-16 17:31:45 -04:00
refractionpcsx2 9722bcd3c3 CDVD: Revert seek status.
WRC didn't like "Seek" being on the seek... We're going to need to run tests for this.
2021-09-09 02:55:16 +01:00
refractionpcsx2 33ac2e7d15 CDVD: Fix up Pause and some Status behaviour 2021-09-06 20:54:16 +01:00
kojin 8fdaaa2eab common: reorganize 2021-09-04 18:28:07 -04:00
kojin 38f1a9a762 util: purge fixed-point library 2021-09-01 08:32:14 -04:00
kojin c6fc357c43 vs: fix a few compiler warnings 2021-08-29 19:51:24 -04:00
kozarovv 94910216f7 CDVD: Implement SCMD 0x27
Fix PS1 mode for SCPH-50009, and DTL-H50009.
2021-08-07 13:11:04 +01:00
kozarovv 167a4b4d12 CDVD: Fix CdlReadS for PS1 games with CDDA.
Fix Legend of Dragoon, maybe more.
2021-08-05 23:04:01 +01:00
Ziemas 080ba94ed2 CHD: Fix parent search on windows
Apparently you can't use the constructor to concat a literal and a
wxString like that.
2021-07-21 08:51:57 +01:00
TellowKrinkle d4f87112ec CDVD: Add minimum buffer size to ThreadedFileReader
If buffers are smaller than the threshold PCSX2 uses to decide whether to time a read as a seek, ThreadedFileReader fails to provide data in time for the very small linear read time cutoff
2021-07-19 22:01:41 +02:00
TellowKrinkle f3ac8ee464 CDVD: Clean up CHD initialization
Now with 100% less `delete`s
2021-07-19 22:01:41 +02:00
TellowKrinkle c39598b98d CDVD: Make CHD file reader threaded 2021-07-19 22:01:41 +02:00
TellowKrinkle ae945f49e3 CDVD: Make CSO file reader threaded 2021-07-19 22:01:41 +02:00
TellowKrinkle bdcfcc65ea CDVD: Add ThreadedFileReader 2021-07-19 22:01:41 +02:00
Gauvain 'GovanifY' Roussel-Tarbouriech 136c326059 pcsx2: clean up references to plugins 2021-07-03 18:16:11 -04:00
Gauvain 'GovanifY' Roussel-Tarbouriech fa9b30fa9e pcsx2: remove relative imports
gosh that was a pain, please don't make me do that again
2021-07-03 18:16:11 -04:00
Jonathan Li 982ef41814 cdvd: Simplify and fix disc variable handling
This fixes an issue on Windows where the previously selected disc drive
choice is cleared if there is no disc in the drive when PCSX2 is opened.
2021-06-20 10:00:31 +01:00
Jonathan Li 7f8ca17752 cdvd:windows: Fix disc path
The disc path was not always in the correct format.

Fixes a regression from the CDVD merge.
2021-06-20 10:00:31 +01:00
Romain TISSERAND b436898d2a Formatting: clang-format + copyright headers 2021-03-23 11:06:48 +00:00
SleepyMan 0599e675a0 CDVD: Add support for CHD format 2021-03-23 11:06:48 +00:00
RedPanda4552 0af847bd29 Change visibility of end of file error
We want this to be visible at all times so ISO damage issues are more visible without enabling advanced logs. Conversely, we don't want this to show up as a big red error, since it is not necessarily a critical error as mentioned in li's comment.
2021-03-20 04:54:38 +00:00
ty bbf248fc46 CDVD: Implement mechacon command 0xEF 2021-02-23 00:22:16 +00:00
t o 6a6fd48af9 CDVD.cpp: Cleared old reset from write14. Cleaned up logging and added comment. cdrom.cpp: fixed bad logging statements 2021-01-31 22:14:06 +00:00
refractionpcsx2 4f9ec8caa0 CDVD: Increase buffer for DVD_LAYER_DESCRIPTOR
Also added some extra messages if that fails (and not because it's a CD)
2021-01-17 13:45:39 +00:00
refractionpcsx2 ee890c508e BIOS/CDVD: Set language defaults instead of making the user do it.
Removed message nobody read.
2020-12-17 22:56:42 +00:00
Tyler Wilding 9fa484dbab GameDB/MSVC: renamed _Target_ to _InstrucTarget_ to avoid collisions 2020-12-16 09:31:58 +00:00
refractionpcsx2 4a90499ec9 CDVD: Adjust read speed depending on if in inner/outer edge
Fixes Shadowman 2 Second Coming textures
Fixes Arctic Thunder loading problems
2020-12-13 22:02:09 +00:00
refractionpcsx2 142082837c CDVD/NVM: Plan B, force user to set up their BIOS first run. 2020-11-21 17:01:14 +00:00
refractionpcsx2 358f098b65 BIOS/HLE: Match ODS Config names to Syscalls
CDVD/NVM: Write default language/screen settings to be English, 4:3, GMT Timezone
2020-11-21 16:31:36 +00:00
refractionpcsx2 e8ebb7d23d BIOSHLE: Get all OSDSYS Parameters. Only use when Fast Boot is enabled 2020-11-19 11:22:40 +00:00
Gauvain 'GovanifY' Roussel-Tarbouriech 961715ab62 CDVD: fix logic bug introduced in ada80474 2020-11-11 10:11:52 -05:00
Timothy O'Barr ada8047419
PSX/CDVD: Check register 14 (ps1 status register) for cd speed and CDDA (#3899)
Fix to CD speed courtesy of Ref
Restored amount of old PCSX code for CDDA courtesy of pcsxr
2020-11-05 18:03:49 +00:00
GovanifY eea4e383f9 DEV9: windows support mostly done, unicode thingies to fix 2020-10-31 16:35:38 +00:00
kozarovv 51976aa06b CDVD: Fix iLink issues
Previously iLinkId was writen/overwriten to .nvm only when user not supplied own file.
But when user supplied file with empty iLinkId, then value is never set. So games fail to get correct data.
That implementation return hardcoded ilinkId when read is requested, and correct iLinkId is not found.
2020-10-18 18:05:34 +01:00
Timothy O'Barr 73b02c204b
SPU2: Set sample rate correctly for PS1 mode (#3532)
* Moved ps1 init. Added Sample Rate change for SPU that gets set but not applied
* SPU: misc fixes on SPU ps1 mode init
* Init the soundbuffer to apply sample rate. Actually set the correct sample rate for the ps1 though it still won't apply

Co-authored-by: Gauvain 'GovanifY' Roussel-Tarbouriech <gauvain@govanify.com>
Co-authored-by: kenshen112 <obarrtimothy@gmail.com>
2020-09-21 01:04:40 +01:00
Gauvain 'GovanifY' Roussel-Tarbouriech 1f327346f7 CDVD: remove non-fatal logging 2020-09-19 01:37:43 +01:00
GovanifY 4b1467ea69 CDVD: safety fixes on hard swaps 2020-09-19 01:37:43 +01:00
Gauvain 'GovanifY' Roussel-Tarbouriech f9be4286bd CDVD: clang-format 2020-09-19 01:37:43 +01:00
Gauvain 'GovanifY' Roussel-Tarbouriech c4fa3e3304 CDVD: polishing rebase and fixing nullptr bug 2020-09-19 01:37:43 +01:00
Gauvain 'GovanifY' Roussel-Tarbouriech fd70ddda02 CDVD: reproducing old behavior, boot in BIOS if invalid drive found 2020-09-19 01:37:43 +01:00
unknown 4df5c0ee1e CDVD: check if CDVD thread is already open 2020-09-19 01:37:43 +01:00
Filjo Abraham 656efa5e20 CDVD: drive selection submenu and OS-specific fixes 2020-09-19 01:37:43 +01:00
Filjo Abraham 2c5a23b696 CDVD: ensure thread/state is ok before proceeding 2020-09-19 01:37:43 +01:00
Filjo Abraham 029461c5ae CDVD: merging and removing remnants of plugin 2020-09-19 01:37:43 +01:00
Filjo Abraham a70bfbdaa9 CDVD: add menu item for discReader and gui for drive selection 2020-09-19 01:37:43 +01:00
Jonathan Li 92aa43fe91 cdvd: Fix end-of-disc issues (#3051)
* cdvd: Fix off-by-one end of file checks

* cdvd: Fix loading for games that attempt to read non-existent sectors

Some games will hang when attempting to read non-existent sectors.
Just do nothing when it occurs instead of erroring out.

* cdvdgigaherz: Fix loading for games that attempt to read non-existent sectors

Some games will hang when attempting to read non-existent sectors.
Just do nothing when it occurs instead of erroring out.

* cdvd: Don't write non-existent sectors to blockdump
2019-08-25 16:09:28 +02:00
Akash a36d5a0221 CDVD: Add fallback path for blockdump source name unavailability
2 pass fallback cases for the untitled scenario was mentioned in the TODO comment to be completed, added  one of them. (Still doesn't seem reliable enough, but honestly when do we  Also modified blank space indentation at a part to tab space to satisfy lightning boi.
2019-07-01 11:29:35 +05:30
Akash 7290576a2a CDVD: Add configurable directory for blockdumps storage
Previously the blockdumps will be automatically stored in the root directory of PCSX2, added an INI option in "PCSX2_ui.ini" named "CurrentBlockdump" to modify the directory to whatever is preferred by the user. (Some people were requesting for this)

A GUI could also be added if anyone wants, but considering the popularity of this I'm not sure as blockdumps will only be used my less percentile of users and mostly by testers and developers for debugging.
2019-06-30 11:48:12 +05:30
lightningterror 811d8781ab cdvd: Get rid of code that disabled loading psx discs.
Not used anymore.
2019-03-01 17:21:13 +05:30
arcum42 d05163a26f
Remove gigaherz old wip 'new' iopdma code. (#2703)
* Remove gigaherz old wip new iopdma code.

* Second pass removing dma code I missed last time.
2018-12-09 18:00:04 -08:00
Robert Neumann 6f2ded8222 psxmode: move pgifInit() over to EE reset; start porting recent (later than ~2001) changes in CdRom.cpp, starting with labels; add a note on missing video timing recalculation when entering psxmode 2018-06-08 21:53:36 +02:00
Robert Neumann 30b722b807 psxmode: actually apply the new iop / cd read timings; add seek delays that mimic real ones; altogether this at least fixes fmv playing way too quickly (music in Chrono Cross intro is fine now, for example) 2018-06-08 03:57:14 +02:00
Timothy O'Barr 342c10bd85 PS1 mode: Adjustments to processor clock speed and CD read speed. (#2447)
switch IOP clock, CD read speed and EE/IOP cycle ratio for PSX mode
2018-05-26 13:20:02 +02:00
Jonathan Li eeca9f61bf cdvd: Fix writing of CD blockdumps
Write the full CD sector (not including subchannels) to a blockdump
instead of just a partial CD sector that isn't offset correctly.
2018-01-27 22:28:29 +00:00
Jonathan Li 79d57e2949 cdvd: Fix and switch to writing v2 format blockdumps
Switch to using vector for the dump sector table, and also fix a bug
where memory was not allocated when writing to a v2 format block dump,
causing a null pointer dereference.

Also switch to using the v2 block dump format, which generally produces
smaller dump files (the dumps also seem smaller than the ones generated
by cdvdiso, which seems to repeat sectors).
2018-01-27 22:28:29 +00:00
Gregory Hainaut 47264dc350 core: use = default for trivial destructor
Again not reported by clang-tidy and done with sed
2017-05-13 10:38:35 +02:00
Gregory Hainaut 2ff43f2ed8 core: remove throw specifier on destructor
It is the 'default' on C++11
2017-05-13 10:38:35 +02:00
Gregory Hainaut 585ccc1b24 core: use = default instead of trivial constructor/destructor
reported by clang-tidy

Note: drop throw() specifier as it is the 'default' in C++11 for
destructor
2017-05-13 10:38:35 +02:00
Gregory Hainaut b9e62be3c1 modernize: use std::make_unique instead of std::unique_ptr
I didn't update GSdx and cdvdGigaherz because we need to pull
common include files
2017-05-03 12:03:38 +02:00
Jonathan Li 1ff6eec1e3 isoreader:gzip: Avoid shallow copying z_stream objects
This prevents the internal state of the objects from becoming
inconsistent, which causes inflate() to fail with recent zlib versions
(1.2.9 and later).
2017-02-18 15:49:00 +00:00
Jonathan Li c65e467c83 pcsx2:windows: Fix unreferenced local variable warning
Also fix some typos in the warning messages.
2017-01-31 22:26:03 +00:00
ramapcsx2 80be9d92ca Merge pull request #1709 from turtleli/cdvd-street-fighter-ex3
cdvd: Street Fighter EX3 (NTSC-J) black screen fix.
2017-01-06 22:21:03 +01:00
Akash c92830b103 PCSX2-Counters: Fix RTC counting at certain cases
Previously, the seconds variable of the RTC was updated on progressive modes after every 50 Vsyncs, which was obviously wrong. The code has been adjusted to update the RTC with respect to the vertical frequencies of various other video modes.
2016-12-24 11:54:25 +05:30
Jonathan Li f441efd776 cdvd: Set the data ready flag after a finished transfer
Fixes a black screen loading issue in Street Fighter EX3 (NTSC-J).
2016-12-18 16:27:05 +00:00
Jonathan Li 5c53708f43 cdvd: cdvdRead08 is interrupt reason, not status
It seems there was a bad copy paste that caused PwOff to be changed to
Status in bc9e0b08ad.
2016-12-18 16:25:52 +00:00
FlatOutPS2 ff98dac104 psxmode: Correct exe name for several PSX titles
Several PSX titles lack a backslash in the elf path, which made the disc
serial contain 'cdrom:', this caused savestate issues in those ganes.

Solves: https://github.com/PCSX2/pcsx2/issues/1692
2016-12-13 17:32:26 +01:00
Akash 83eb79c9d9 PCSX2-WX: Proper source medium on menuitem
Previously the boot menu items always displayed "Boot CDVD" regardless of the current source medium, this behavior has been fixed to properly adjust the text when source medium is changed. Now it'll display Boot CDVD/ISO/BIOS with respect to the current source medium.

v2: Some instances of "Iso" have been changed to "ISO" for consistency.
v3: Remove the unnecessary "Reboot" on menu item labels, saves some string translations.
v4: Add a new shortcut key for the primary boot menu item.
2016-12-10 12:35:57 +00:00
Akash b86518ef24 CDVD: Convert CDVD_SourceType into enum class
* Add a template function for underlying type conversions of enumerations
2016-12-10 12:35:57 +00:00
Gregory Hainaut c5d727da39 CDVD: check return value of ToLong
Reported by coverity
2016-11-12 19:36:44 +01:00
Gregory Hainaut 5e5b927abd gzip reader: bad find interface
Find => return int
find => return size_t (behave as STL)

Thanks to gcc for the useful warning

+ a cast to avoid an useless warning
2016-11-12 18:41:07 +01:00
Robert Neumann ca59ce45c0 psxmode: Make cd read delays longer to avoid mdec glitches and possibly some other data corruption. Proper read timings can be added later using cdvd.cpp as an example. 2016-10-07 21:36:06 +02:00
Robert Neumann 98c22b9acb psxmode: tried to put the hardware reconfiguration reset in the proper location. didn't work for some reason. 2016-10-01 12:16:56 +02:00
Robert 5e460c57f8 psxmode: add all the rest on core side. psx mode works now.
- include a small game exe detection so pcsx2 doesn't believe it's running the bios
- cdrom.cpp has a hack to account for pcsx2's wrong iop dma timing when mixing mdec and cdrom dmas. This should be properly fixed for the benefit of all ps2 / psx software!
- dmasif2 is disabled since pgpu already handles it
2016-09-24 20:11:32 +02:00
Gregory Hainaut 1a8825b374 pcsx2|common|gsdx: use empty() instead of .size() ==/!= 0 check
Enhance readability reported by clang tidy
2016-08-21 17:20:13 +02:00
Gregory Hainaut 252c043409 Merge pull request #1518 from PCSX2/pcsx2-high-level-fopen
Pcsx2 high level fopen
2016-08-15 15:41:27 +02:00
Pseudonym 07e21427b9 When PS1 loading was enabled, someone neglected to check that allowing the function to continue wouldn't cause any problems.
Fixes #1515
2016-08-15 14:23:43 +01:00
Gregory Hainaut 0f1c10230a CDVD: catch MEC/NVM file exception
It will stop the emulation and open a nice box with an error message instead of terminate PCSX2
2016-08-15 14:09:01 +02:00
Gregory Hainaut deb7121fde CDVD: Use wxFFile API to handle MEC file too
again nicer, exception safe, less compilation warning :)

v2:
* check file is properly opened in write mode
* only print an error when result is bad
2016-08-15 13:08:54 +02:00
Gregory Hainaut 534e01e2d6 CDVD: Use wxFFile API to handle NVM file
Nicer, exception safe, less compilation warning :)

v2: check fp is properly open in write mode
2016-08-15 13:06:34 +02:00
Gregory Hainaut 9182a287e2 Merge pull request #1469 from PCSX2/valgrind-memleak
Valgrind memleak
2016-07-22 18:17:37 +02:00
Gregory Hainaut b322ef286e CDVD: initialize a temporary buffer
I'm not sure to understand why Valgrind reports it as we populate the buffer
during the ReadAsync. Maybe Valgrind doesn't like async IO from the kernel.

In doubt, the init will avoid those warnings

==19897== Thread 6 EE Core:
==19897== Conditional jump or move depends on uninitialised value(s)
==19897==    at 0x80FE9E1: BlockdumpFileReader::DetectBlockdump(AsyncFileReader*) (BlockdumpFileReader.cpp:40)
==19897==    by 0x8109EE5: InputIsoFile::Open(wxString const&, bool) (InputIsoFile.cpp:229)
==19897==    by 0x810939E: ISOopen(char const*) (CDVDisoReader.cpp:57)
==19897==    by 0x810194E: DoCDVDopen() (CDVDaccess.cpp:359)
==19897==    by 0x80B651C: SysCorePlugins::OpenPlugin_CDVD() (PluginManager.cpp:1219)
2016-07-21 09:51:16 +02:00
Akash a1fdf1e625 PCSX2-Counters: Rename "GS_RegionMode" to "GS_VideoMode"
Technically there's no term called "RegionMode" and the values obtained through the SMODE1 register is actually used for identifying the video mode of the game not any region modes.

* Convert "GS_VideoMode" into an enum class
2016-07-09 21:50:28 +05:30
ramapcsx2 ec07571069 Revert "PCSX2-Counters: Some Changes to Video mode counter stuffs" 2016-06-09 00:44:14 +02:00
Akash 1a41053c76 PCSX2-Counters: Improved video mode detection
* The detected values using the SMODE registers were for the video modes and not the region of the game, changed the variable naming to video modes to prevent any confusions.
* Fix a bug where 1080I was reported as progressive
* Convert GS_VideMode into an enum class
* Move VideoMode init code from _gsSMODEwrite to SYSCALL
* PCSX2 will now correctly report whether the video mode is NTSC/PAL/VESA/480p/576p/720p/1080i/1080p
2016-06-04 22:10:27 +05:30
refractionpcsx2 ad61503d83 CDVD: Fix drive status on BREAK.
-Formula One 2001 expects the drive to be paused after break.
-The command breaks from the current command, it doesn't stop the drive :)
2016-05-18 21:44:13 +01:00
Jonathan Li d89043d8ac pcsx2: Remove wx2.8 code and uses of wxMAJOR_VERSION
Technically wxMAJOR_VERSION wasn't the right thing to use, but it was
good enough.
2016-04-29 00:09:47 +01:00
Jonathan Li 5d303c793b cdvd:iso: Use Volume Descriptor to find layer break
The DVD layer 0 sector count is stored in the Volume Space Size field of
the Primary Volume Descriptor on DVD layer 0. This value is the same as
the total sector count for a single layer DVD and the first layer 1 LSN
of a dual layer DVD.

Let's use that to determine the layer 1 start LSN instead of using the
brute force approach. Since this approach is much faster than the
previous approach, the layer break is no longer cached.
2016-03-20 21:42:35 +00:00
Jonathan Li 115b14bc94 cdvd: Replace ScopedPtr with unique_ptr 2016-02-08 22:31:45 +00:00
Jonathan Li 04a8efd8c3 pcsx2|common: Use _WIN32 for Windows preprocessor macro
It's predefined, unlike WIN32 and _WINDOWS (and other variants), which
are defined in the property sheets.
2016-01-27 22:41:45 +00:00
Jonathan Li e7ca031d1e pcsx2: Replace ScopedArray with unique_ptr
Same functionality, but we don't have to maintain code ourselves.
2016-01-17 22:54:22 +00:00
ramapcsx2 20c8b89bb7 cdvd: return 0xff instead of 0 on unknown 8 bit reads. improves compatibility with popstarter a bit.
Unfortunately, it then fails to load pops with "loadmodule: fname rom0:UDNL args 5 arg crap:"
2016-01-16 14:36:09 +01:00
Juha Laukkanen 592aacb25a Darwin/OSX __POSIX__ definitions. 2015-12-02 05:00:41 +02:00
Gregory Hainaut 1aa6749956 cdvd: remove break after return
cppcheck:[pcsx2/CDVD/CDVD.cpp:1120]: (style) Consecutive return, break, continue, goto or throw statements are unnecessary.
2015-11-06 23:01:58 +01:00
Akash f6f8dc1a22 CDVD: Initialze all class members
CID 147025 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)8. uninit_member: Non-static class member m_current_count is not initialized in this constructor nor in any functions that it calls.
2015-10-25 14:11:43 +05:30
refractionpcsx2 3618983aaa CDVD: Comment out unreachable code.
-Left in so future checks can see what's going on.
-Coverity CID 146818: In ISOreadSector(unsigned char *, unsigned int, int): Code can never be reached because of a logical contradiction (CWE-561)
2015-10-04 14:39:57 +01:00
Gregory Hainaut 78ed0495ce pcsx2:CDVD: init members in constructor 2015-09-23 09:47:27 +02:00
Gregory Hainaut 23591deb81 pcsx2: initialize members in constructor of objects 2015-09-23 09:47:27 +02:00
Gregory Hainaut 4184d6eef5 pcsx2:cso: NULL pointer check
Coverity:

CID 146846 (#1 of 1): Dereference after null check (FORWARD_NULL)
5. var_deref_model: Passing null pointer fp to fclose, which dereferences it
2015-09-23 09:39:08 +02:00
Jonathan Li 39c5cd4f84 pcsx2:cdvd: Fix memleak
CID 146832 (#4-1 of 6): Non-array delete for scalars (DELETE_ARRAY)

ScopedPtr is for non-array objects only. Use ScopedArray instead.
2015-09-21 20:13:55 +01:00
Gregory Hainaut bfe1236d98 pcsx2|lilypad: Unintentional integer overflow
Add some cast to do the intermediate operation in 64 bits
2015-09-11 16:50:02 +02:00
Gregory Hainaut 6c7ce3465e pcsx2:CDVD: guarantee that index of mg_zones array is below than 8
CID 146917 (#1 of 1): Untrusted array index read (TAINTED_SCALAR)
tainted_data: Using tainted variable cdvd.Result[1] as an index into an array mg_zones
2015-09-11 09:25:09 +02:00
Gregory Hainaut ac8f4e69d6 pcsx2|gsdx: avoid potential null deferencement 2015-09-11 08:54:29 +02:00
Gregory Hainaut 0bcaff4214 pcsx2:cdvd/debug: various uninitialized data
Most of the time, code is correct. In doubt always init the value.
2015-09-10 13:45:42 +02:00
Gregory Hainaut 5c933a7faf pcsx2:gzip: free the index
Normally index will be NULL if len is 0 but it won't hurt
2015-09-10 13:41:22 +02:00
Miguel A. Colón Vélez 6462393aaf Introduce end-of-line normalization
Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
2015-08-04 23:52:48 +02:00
ramapcsx2 a749367300 small tweak to cdvd read console logs. a little alignment > much more readable. 2015-07-10 21:08:55 +02:00
Jonathan Li 283d4fa57c Use wc_str for Windows only code
This fixes the build for wxWidgets 3.0. The paths are Windows specific,
so c_str and WX_STR already evaluate to a wide string in wxWidgets 2.8.
2015-06-19 22:14:47 +01:00
Unknown W. Brackets 7b1214849a Add disabled code to use a cache for cso reading.
It doesn't seem like the cache is worth it, unfortunately.
2015-04-15 10:27:59 -07:00
Unknown W. Brackets 427fa039ba Note why multiple blocks aren't optimized in CSO. 2015-04-15 09:47:20 -07:00
Unknown W. Brackets 49cfc3424b Keep around z_stream between decompression passes.
Slightly more efficient to avoid reallocating the state for each block.
2015-04-15 09:03:00 -07:00
Unknown W. Brackets 17a58103e2 Move shared file access to compressed utils. 2015-04-15 08:30:19 -07:00
Unknown W. Brackets 8e89418f45 Prefix some defines in GzippedFileReader. 2015-04-15 08:25:32 -07:00
Unknown W. Brackets 5bfd4c7bf8 Refactor ISO creation to avoid duplicate code. 2015-04-14 19:24:22 -07:00
Unknown W. Brackets 334f648eaa Separate compressed file types into separate files.
Cleaner this way.
2015-04-14 19:24:21 -07:00
Unknown W. Brackets 4ffbd3765b Add a link to a description of the CSO format. 2015-04-14 17:46:44 -07:00
Unknown W. Brackets 8edffd32c8 Add support for loading CSO-compressed ISOs. 2015-04-14 10:14:06 -07:00
Avi Halachmi (:avih) 6b48784709 gzip iso: reduce seek time on fragmented files by OS prefetch on win32
ask the OS to asynchronously fetch the next chunk from disk before we actually
use it. We then cancel this request and ignore the data before the next extract
but it's very likely that when extract tries to read from disk the data will
already be cached by the OS.

This frequently allows to overcome HDD seek time (mostly due to fragmentation)
of the compressed file.
2015-02-22 16:53:51 +02:00
Avi Halachmi (:avih) f2657ae450 gzip iso: 2nd attempt to fix non-english file names (windows only) 2015-02-10 22:49:29 +02:00
Avi Halachmi (:avih) 7b7a977d11 gzip ISO: fix broken handling of file names with non-english chars
this uses <wxString>.mbc_str() instead of .toUTF8() for all file related
stuff.

also normalizes all Console outputs to use WX_STR(str).

TODO: this was only tested on windows.

if someone could test on linux (wx 2.8 and 3.0) that english-only and not
english-only iso.gz file names work correctly (open the file, create the index,
read the index on next boot and that all console prints are good), please
post a comment.
2015-01-09 12:16:13 +02:00
Avi Halachmi (:avih) 5933db386a gzip ISO: fix compile issues on linux 2015-01-03 18:50:07 +02:00
Avi Halachmi (:avih) e525f95f22 gzip ISO: allow custom index file name/location via a template
At PCSX2_ui.ini: default:  GzipIsoIndexTemplate=$(f).pindex.tmp
The rules:
- must contain one and only one instance of '$(f)' (without the quotes)
- if starts with $(f) then it expands to the full path + file name.
- if doesn't start with $(f) then the path is ignored (name+ext only)
- if doesn't start with $(f) and ends up relative,
  then it's relative to pcsx2.exe (not to cwd)
- No checks are performed if the result file name can be created, so the dir
  should exist.
- PCSX2 will not try to rename/move older index files to the new name/location.
  If it's modified - the user should take care of rename/move before loading
  gzipped iso files or else it will create a new index according to the template

Examples:
$(f).pindex.tmp - the default - same dir as the iso, loads older index files.
$(f).pindex     - a popular request.
cache.gz/$(f)   - relative to pcsx2.exe (if the dir exists).
%appdata%/pcsx2/cache.gz/$(f) - should end up at the default install docs dir.
2015-01-02 03:27:06 +02:00
Gregory Hainaut fd7b692d00 Merge pull request #251 from xsacha/memzero_ptr
Remove redundant memzero_ptr. All compilers use SSE implementation
2014-09-21 17:15:54 +02:00
Sacha ad3b76c4d8 Remove all custom memcpy usage from core pcsx2 and remove memcpy_fast from plugins. 2014-08-27 13:45:23 +10:00
Sacha 3f7cb991e4 Remove some slow, redundant memcpy implementations: memcpy_const/memcpy_qwc/memcpy_aligned. 2014-08-27 13:13:48 +10:00
Sacha 7a260c9885 Remove redundant memzero_ptr. All compilers use SSE implementation anyway. 2014-08-17 23:23:55 +10:00
Pseudonym 05b33012b7 Merge pull request #241 from Kingcom/Debugger
Always enable debugger
2014-08-15 23:31:23 +01:00
Kingcom f5fe75a73b Allow to share writing to the ISO through an ini option 2014-08-15 23:52:45 +02:00
Kingcom df0fb9551f Always enable debugger 2014-08-15 21:25:30 +02:00