dressupgeekout / lunapurpura

Reimplementation of Purple Moon's games from the 1990s (WIP) - NOTE: ScummVM port in progress
https://dressupgeekout.github.io/lunapurpura/
BSD 2-Clause "Simplified" License
8 stars 1 forks source link

[WINDOWS] Unable to unpack PRX: Debug Assertion Failed - Expression: stream.valid() #27

Closed dressupgeekout closed 4 years ago

dressupgeekout commented 4 years ago

FYI @AlanisSmithee

Not able to list the contents of a PRX file from Tricky on Windows at runtime. I wonder if I have to use Windows's "secure" flavors of functions (the *_s() ones) or maybe everything will just go away if I disable debug assertions, somehow? Not sure if that's possible per se.

Nevertheless, I am curious to learn why Windows believes opening the PRX file isn't valid (whatever that means)

out

dressupgeekout commented 4 years ago

Oh, huh, apparently Visual Studio comes with Clang, I think we should just focus on that... ?

AlanisSmithee commented 4 years ago

Unfortunately, I can't personally provide any input or advice on all that. (If you couldn't tell, I've been getting outside help with programs and settings to try. I've been told that trying Clang might be a good route to go. If you're not trying it already.)

I did not realize until all this how much Windows and Mac/Linux absolutely refuse to play nice with each other. Companies...

dressupgeekout commented 4 years ago

Yeah, portability can be difficult to achieve. I'm glad to be focusing on Windows support now rather than later, heh.

Turns out Clang doesn't solve the problem directly, but it does give me error messages that are much easier for me to understand (I use Clang everywhere, hehe)

So it seems that the problem is that Windows' fclose() only works on FILEs which were opened successfully. This is different from most other OSes, so I might have a fix

dressupgeekout commented 4 years ago

OK, getting somewhere!

out

I'm 99% sure the garbagey output here is related to word-size issues, so that's a separate issue

dressupgeekout commented 4 years ago

Fixed in a5bfa877befec826a04b9b88c3f08ed3ef30dae8