rtissera / libchdr

Standalone library for reading MAME's CHDv1-v5 formats.
BSD 3-Clause "New" or "Revised" License
96 stars 38 forks source link

Loading CHD files >2GiB? #40

Closed whocares0101 closed 3 years ago

whocares0101 commented 3 years ago

I can't seem to load CHD files larger than 2GiB, all I get is CHDERR_DECOMPRESSION_ERROR, I used cmake and VS2019 x64 build. Everything compiles fine and loading smaller CHD files seems to work.

whocares0101 commented 3 years ago

The problem seems to be in coretypes.h, fseek and ftell are only good for 32 bit. I don't know what the best solution is for this but I switched to _fseeki64 and _ftelli64 also updated core_fsize to use 64 bit types and now it seems to work.

Large file support in C++ https://stackoverflow.com/q/965725/14044248

rtissera commented 3 years ago

Good catch can you submit a PR ? Good job on PCSX2 integration !

kcgen commented 3 years ago

Good job on PCSX2 integration !

.. and DOSBox-X integration !

CookiePLMonster commented 3 years ago

Hey @whocares0101, are you going to submit a PR addressing this?

rtissera commented 3 years ago

Closed by https://github.com/rtissera/libchdr/pull/43