Age | Commit message (Collapse) | Author |
|
For some Eboot .PBP game images, when loading a savestate, a zlib error
like 'uncompress failed with -5 for block 5383, sector 86132' would be
output to stdout/stderr. The savestate would still be playable, though.
Traced it down to cdrFreeze() failing to convert cdr.Prev from BCD->int
when calling ReadTrack(). Note that the odd 'cdr.Prev[0]++;' line seems
to be someone's hacky way of forcing ReadTrack() to avoid skipping what
it thinks is a duplicate sector read.
|
|
- This is fixed by adding the missing SaveMcd() to buwrite().
Tested on Wild Arms and Breath of Fire III
|
|
HLE BIOS improvements (based on nocash doc, pcsx4all, upstream pcsxr etc...)
|
|
Notaz said this could corrupt the emulator (even though
the console allowed this and it was a bug) so limit it to 0x3FF.
|
|
This should work as intended now.
|
|
This fixes Looney Tunes Sheep Raiders.
|
|
According to nocash PSX doc, ChangeThread and CloseThread should
always return 1. Fix it accordingly.
|
|
|
|
See Garbage Area at Address 00000000h in Nocash PSX Specifications for more inf>
R-types will refuse to boot if psxM[0] is zero.
Fade to Black can crash upon memory card access if psxM[5] is set to the wrong >
Crash Team Racing will refuse to boot if psxM[2] and psxM[3] are not zero.
(Previously, that region of memory would be overwritten above. No explanation why.)
It's set as such according to nocash :
[00000000h]=3C1A0000h ;<-- but overwritten by 00000003h after soon
[00000004h]=275A0C80h ;<-- or 275A0C50h (in older BIOS)
[00000008h]=03400008h
[0000000Ch]=00000000h
Note that setting 00000000h to 00000003h doesn't work for R-types.
|
|
|
|
I already fixed this for bufile :
ptr = Mcd##mcd##Data + 128 * (nfile + 1); \
instead of
ptr = Mcd##mcd##Data + 128 * nfile; \
But i forgot to also fix psxBios_firstfile accordingly.
So nfile would still start from block 2 and it would
cause all kinds of issues.
This was the original comment on pcsxr codeplex
as my patch was based on it :
"The HLE-Bios start to read memory card blocks at block 2. You need to change
ptr = Mcd##mcd##Data + 128 * nfile; \ to
ptr = Mcd##mcd##Data + 128 * (nfile + 1); \
for #define bufile(mcd) { \ and changing nfile = 1; to nfile = 0; for psxBios_firstfile() { // 42 Starts numbering slots in the right position."
|
|
|
|
Thanks DmitrySmagin for the fix.
|
|
|
|
|
|
Pretty much identical to get_card_status except it's supposed
to wait until a non-busy state occurs.
|
|
- Remove extra ffile, pfile.. as it is declared elsewhere.
- Remove extra condition as it's already being handled by pad_stopped.
- Remove n variable from function (pcsx4all did this) as it's useless
and documentation doesn't seem to specify it's needed.
|
|
|
|
|
|
|
|
|
|
|
|
Merging never-merged fix by Solus for Parasite Eve. I also fixed some GCC warnings
about dir->name going out of bounds too.
We also make sure to only add '/0' if string is not full and right after the last character in the dir array.
This fixes saving/loading in Parasite Eve II, Parasite Eve.
It also fixed regressions for the LEGO Racers where other games would break,
meaning this should be the proper fix for saves.
We're also using our own strlen implementation to avoid any issues or
relying on the libc's own strlen.
|
|
We are already doing that in WaitEvent. According to nocash documentation,
this also applies to TestEvent as well so let's implement it.
|
|
Since they don't do anything however, let's just add a default and break;
instead. Interestingly, trying to implement SYS(04h+ can actually crash
the HLE bios. Nocash documentation said that it should crash it
but due to other reasons, it doesn't and returns to main program instead.
|
|
Per what Nocash documentation says.
|
|
This should be closer to documentation.
|
|
This is needed for Burning Road. Fix comes from PCSX4ALL by dmitryssmagin.
|
|
Yes, it's supposed to have a lot of checks like these.
Also merge some more fixes from PCSX4ALL. (upstream did not have
these as far as i know)
|
|
According to a user on PCSX-Reloaded codeplex (now dead), this fixed loading/saving
in Final Fantasy Tactics.
|
|
- Don't allow malloc to init memory if heap is invalid
According to nocash documentation, malloc will not allocate if heap size
is too small or invalid.
- Also merge some fixes from PCSX4ALL fork by senquack in order to allow
Burning Road to run.
|
|
Always returns dst per documentation.
|
|
This now can be a tricky pony and an improper memset implementation means that
you can't play Tomb Raider 4 properly.
(Trying to put in the eye of horus will just result in Lara sidestepping)
This should hopefully be fixed (and follows nocash doc).
|
|
Always returns dst
|
|
Only return 0 if size is invalid. (0 or 0x7FFFFFFF), return dst if not.
|
|
Nocash documentation say that function refuses to copy any data
if dst is NULL or len greater than 0x7FFFFFFF.
(In any cases, return value is always dst)
|
|
Return 0 for index/rindex if src is 0x00.
|
|
Looks like it is only executed for memory cards, that makes sense i guess.
|
|
Someone reported that this fixed Negcon controls in Ridge Racer Revolution
and Grand Tour Racing.
I doubt this will suffer from regressions ?
|
|
Make sure to return 0xff is no TCBs are available.
Thanks senquack for the proper fix.
|
|
|
|
|
|
Nocash says it should return 0 if Event is unused, which it already does so it might be safe to remove the warning about it.
(see why below)
Then, it says that it should return 1 if event is ready (EvStALREADY). When that happens, it should also set it to ready (EvStACTIVE),
unless event mode is EvMdINTR. (aka Callback Events)
If it is a callback event, then documentation says it should be stuck in a loop forever.
It also says that it can sometime return 0 (a BUG according to nocash),
especially if it switched from EvStALREADY to EvStACTIVE.
Said return value was previously set to 1, for some reasons. Now that we are covering all the corner cases,
we should be returning 0 instead by default to cover the BUG.
This should cover how most games expects it to behave now and should make it more robust.
|
|
This should be closer to the real behaviour as described by nocash.
It doesn't do any bcopy though but it shouldn't be too much different
other than that.
|
|
Returns 0 if src or dst is 0x00.
|
|
Based on CTRX's code : https://github.com/machinamentum/CTRX/blob/master/bios/source/libc.c#L152
I'm not aware of any games using it but it doesn't hurt to have it
and it should work fine.
|
|
getc will need to be fixed later but this should do as it is.
No issues with putc. Both are similar to psxBios_read and psxBios_write,
except size is 1.
|
|
Nocash documentation says that it returns the I/O address.
I doubt any games use it so but it doesn't hurt to have it.
|
|
Nocash documentation says it should return 0 if one or
none of the bits were changed and return 1 of both bits were set.
This fixes Medievil 2, which would freeze upon starting up a game
and this properly fixes Digimon World crashing (with fixed strcat implementation).
It also possibly fix other games.
|
|
This also implements a bug which allows writes to 0x400
(Is supposed to only accept sector number between 0..3FFh).
Function should return 0 if sector is invalid.
|