pcsx_rearmed.git
2 years agodrc: always clear full decoded_insn
notaz [Tue, 14 Dec 2021 22:04:11 +0000 (00:04 +0200)]
drc: always clear full decoded_insn

Some stuff was left after INTCALL conversion and broke branch in delay
slot handling, like in Rayman 2.

2 years agominor cleanup
notaz [Tue, 14 Dec 2021 19:10:58 +0000 (21:10 +0200)]
minor cleanup

2 years agofix some issues and warnings seen on ctr build
notaz [Tue, 14 Dec 2021 19:09:45 +0000 (21:09 +0200)]
fix some issues and warnings seen on ctr build

2 years agodrc: reapply some libretro changes
notaz [Tue, 14 Dec 2021 19:03:25 +0000 (21:03 +0200)]
drc: reapply some libretro changes

2 years agoMerge pull request #586 from notaz/libretro_overwrite_drc
Autechre [Tue, 14 Dec 2021 12:41:28 +0000 (13:41 +0100)]
Merge pull request #586 from notaz/libretro_overwrite_drc

overwrite dynarec related code with upstream version

2 years agooverwrite dynarec related code with upstream version
notaz [Mon, 13 Dec 2021 23:14:23 +0000 (01:14 +0200)]
overwrite dynarec related code with upstream version

This gives a fast arm64 dynarec and many other ari64 dynarec fixes
from upstream. Although I tried to take care not to overwrite libretro
specific changes like lightrec, some things may have got lost or
broken. Only tested on rpi4 in 64bit mode.

Warning: untested on Android and most other platforms. If there are
issues from this merge, post a comment and tag me and I'll try to take
a look at it while I'm still active, at least for the time being.

3 years agoMerge pull request #579 from gameblabla/pio_writes_sen_lib
gameblabla [Wed, 10 Nov 2021 19:28:45 +0000 (19:28 +0000)]
Merge pull request #579 from gameblabla/pio_writes_sen_lib

psxmem: Writes to PIO Expansion area have no effect.

3 years agopsxmem: Writes to PIO Expansion area have no effect.
gameblabla [Wed, 10 Nov 2021 19:27:06 +0000 (20:27 +0100)]
psxmem: Writes to PIO Expansion area have no effect.

This is related to the Tetris with Card Captor fix a while back.
However, i forgot to merge this one as well related to writes,
even though it was not really necessary to fix that particular game.

Co-authored-by: senquack <dansilsby@gmail.com>
3 years agoMerge pull request #578 from gameblabla/counters_lib
gameblabla [Wed, 10 Nov 2021 19:25:15 +0000 (19:25 +0000)]
Merge pull request #578 from gameblabla/counters_lib

One more on odd lines for PAL HSYNC

3 years agoOne more on odd lines for PAL HSYNC
gameblabla [Wed, 10 Nov 2021 19:23:55 +0000 (20:23 +0100)]
One more on odd lines for PAL HSYNC

As done by Duckstation
https://github.com/stenzek/duckstation/blob/bbcf1c67d1aefd5de9cdc9c158f92bc7aaecaa63/src/core/gpu.h#L56

3 years agoMerge pull request #576 from gameblabla/cdrom_regression_remove
gameblabla [Wed, 10 Nov 2021 19:20:17 +0000 (19:20 +0000)]
Merge pull request #576 from gameblabla/cdrom_regression_remove

Remove CdlGetLocP hack

3 years agoMerge pull request #577 from gameblabla/cdrom_setloc_lib
gameblabla [Wed, 10 Nov 2021 19:20:10 +0000 (19:20 +0000)]
Merge pull request #577 from gameblabla/cdrom_setloc_lib

Move CdlSetLoc to CdrInterrupt and return invalid arg error

3 years agoMove CdlSetLoc to CdrInterrupt and return invalid arg error
gameblabla [Wed, 10 Nov 2021 19:16:02 +0000 (20:16 +0100)]
Move CdlSetLoc to CdrInterrupt and return invalid arg error

So far, i could only find Simple 1500 Series Vol. 31 - The Sound Novel to be affected by this.
In Duckstation, this was causing extra delays without it.
However in our case, this doesn't seem to be the case and i couldn't find much find about it.

3 years agoRemove CdlGetLocP hack
gameblabla [Wed, 10 Nov 2021 19:05:09 +0000 (20:05 +0100)]
Remove CdlGetLocP hack

This was added back in 2013 or so in PCSX Rearmed
and according to some tests against Tomb Raider 1 (which is affected by the GetLocP code),
it works properly without this hack.

So let's just remove it as we are now doing it properly.

Notaz also forgot the reason why he introduced the hack
in the first place, see :
https://github.com/notaz/pcsx_rearmed/pull/235#issuecomment-955026232

3 years agoMerge pull request #574 from rtissera/rpi3_64
Autechre [Tue, 2 Nov 2021 10:35:59 +0000 (11:35 +0100)]
Merge pull request #574 from rtissera/rpi3_64

Add Raspberry Pi 3 64-bit target

3 years agoAdd Raspberry Pi 3 64-bit target
Romain TISSERAND [Tue, 2 Nov 2021 09:55:17 +0000 (10:55 +0100)]
Add Raspberry Pi 3 64-bit target

3 years agoMerge pull request #569 from gameblabla/gte_stalling_libretro
gameblabla [Sat, 23 Oct 2021 22:15:27 +0000 (22:15 +0000)]
Merge pull request #569 from gameblabla/gte_stalling_libretro

GTE stalls/timings

3 years agoMerge pull request #571 from gameblabla/cdrom_audio_fix_attempt
gameblabla [Sat, 23 Oct 2021 22:03:24 +0000 (22:03 +0000)]
Merge pull request #571 from gameblabla/cdrom_audio_fix_attempt

Fix stutter before speech samples in Castlevania Symphony of the Night

3 years agoHack fix for CDROM timings regression (Castlevania, Megaman X4)
gameblabla [Sat, 23 Oct 2021 22:00:04 +0000 (00:00 +0200)]
Hack fix for CDROM timings regression (Castlevania, Megaman X4)

See https://github.com/libretro/pcsx_rearmed/issues/557.

The CDROM timings changes from Redux fixed a bunch of games
(Crash Team Racing's intro no longer cuts off too early,
Worms Pinball gets further instead of just crashing,
FF8 Lunar Cry FMV no longer crashes etc...)
but it broke the other games that relied on ADPCM samples,
which is most noticeable in games like Castlevania or Megaman X4.

According to nicolasnoble, we should not cause a delay if seek destination is close to the current location.
However, this would require a lot more work so in the meantime,
let's do just that and add a comment.

3 years agoMerge pull request #572 from gameblabla/cd_volume_fix_lib
Autechre [Thu, 14 Oct 2021 11:15:18 +0000 (13:15 +0200)]
Merge pull request #572 from gameblabla/cd_volume_fix_lib

Fix CD Volume issue in Star Wars Dark Forces

3 years agoMerge pull request #564 from jdorigao/rpi1
Autechre [Wed, 13 Oct 2021 21:35:04 +0000 (23:35 +0200)]
Merge pull request #564 from jdorigao/rpi1

Added rpi1 to makefile

3 years agoFix CD Volume issue in Star Wars Dark Forces
gameblabla [Wed, 13 Oct 2021 20:21:08 +0000 (22:21 +0200)]
Fix CD Volume issue in Star Wars Dark Forces

CD Volume is 16-bits signed, not unsigned.
Otherwise in Star Wars - Dark Forces :
if you lower the music volume slider all the way down,
the volume will wrap around and instead be set at the highest volume.

3 years agoGTE stalls/timings
gameblabla [Sun, 10 Oct 2021 16:30:12 +0000 (18:30 +0200)]
GTE stalls/timings

This is to fix an issue with Battle Arena Toshinden 1 going too fast.
Zero Divide is also said to be affected by this as well.

Note that this doesn't fix it for gte_arm.S :
We would still need to increase the cycle count here.

Co-authored-by: firnis <firnis@ya.ru>
3 years agoMerge pull request #570 from Sanaki/drop_ps3
Autechre [Sun, 10 Oct 2021 12:26:31 +0000 (14:26 +0200)]
Merge pull request #570 from Sanaki/drop_ps3

Revert "libretro: Add support for ps1_rom.bin (PS3 BIOS)"

3 years agoRevert "libretro: Add support for ps1_rom.bin (PS3 BIOS)"
Sanaki [Sun, 10 Oct 2021 09:59:18 +0000 (02:59 -0700)]
Revert "libretro: Add support for ps1_rom.bin (PS3 BIOS)"

This reverts commit c5c20552af08fd4158cc0e7894c1798d95f0d35b.

3 years agoMerge pull request #567 from gameblabla/fix_minor_close_iso
gameblabla [Wed, 6 Oct 2021 05:06:39 +0000 (05:06 +0000)]
Merge pull request #567 from gameblabla/fix_minor_close_iso

Fix minor issue when closing ISO.

3 years agoFix minor issue when closing ISO.
gameblabla [Wed, 6 Oct 2021 05:04:13 +0000 (07:04 +0200)]
Fix minor issue when closing ISO.

3 years agoMerge pull request #566 from gameblabla/neon_fix_libretro
gameblabla [Tue, 5 Oct 2021 21:25:22 +0000 (21:25 +0000)]
Merge pull request #566 from gameblabla/neon_fix_libretro

Always look up verify_dirty literals from offsets by neonloop

3 years agoAlways look up verify_dirty literals from offsets by neonloop
gameblabla [Tue, 5 Oct 2021 21:17:54 +0000 (23:17 +0200)]
Always look up verify_dirty literals from offsets by neonloop

Literals are deduplicated, so there's no guarantee they will be stored
next to each other, even if they're written sequentially. verify_dirty
and get_bounds must use the offsets on each instruction, instead of
assuming values are stored sequentially.

Thanks neonloop for the fix

Co-authored-by: neonloop <neonloop@pm.me>
3 years agoAdded rpi1 to makefile
Juliano Dorigão [Tue, 5 Oct 2021 01:23:07 +0000 (21:23 -0400)]
Added rpi1 to makefile

3 years agodrflac - assume DRFLAC_NO_STDIO by default
twinaphex [Mon, 4 Oct 2021 00:25:55 +0000 (02:25 +0200)]
drflac - assume DRFLAC_NO_STDIO by default

3 years agoMerge pull request #563 from gameblabla/remove_junk
gameblabla [Sat, 2 Oct 2021 17:40:53 +0000 (17:40 +0000)]
Merge pull request #563 from gameblabla/remove_junk

Remove junk files and fix lack of clearing icache when loading new games

3 years agoRemove junk files and fix regression in icache mode with Armored Core.
gameblabla [Sat, 2 Oct 2021 17:36:43 +0000 (19:36 +0200)]
Remove junk files and fix regression in icache mode with Armored Core.

3 years agoMerge pull request #562 from gameblabla/cdrom_fixes_libretro_precautions
gameblabla [Sat, 2 Oct 2021 16:40:35 +0000 (16:40 +0000)]
Merge pull request #562 from gameblabla/cdrom_fixes_libretro_precautions

Revert some changes as they were not tested or are not required

3 years agoRevert some changes as they were not tested or are not required
gameblabla [Sat, 2 Oct 2021 16:39:05 +0000 (18:39 +0200)]
Revert some changes as they were not tested or are not required

Per feedback from notaz, thanks to him.

3 years agoMerge pull request #545 from gameblabla/icache_emulation
gameblabla [Sat, 2 Oct 2021 16:25:33 +0000 (16:25 +0000)]
Merge pull request #545 from gameblabla/icache_emulation

ICache emulation (Interpreter) from PCSX redux

3 years agoFix comment to be more precise about lightrec's status.
gameblabla [Sat, 2 Oct 2021 16:23:49 +0000 (18:23 +0200)]
Fix comment to be more precise about lightrec's status.

3 years agoCulling off cache bits from the hardware addresses.
gameblabla [Sat, 2 Oct 2021 16:14:44 +0000 (18:14 +0200)]
Culling off cache bits from the hardware addresses.

Co-authored-by: Nicolas Noble <nicolasnoble@users.noreply.github.com>
3 years agoInterpreter fixes for BREAK and a few other instructions.
gameblabla [Sat, 2 Oct 2021 16:13:04 +0000 (18:13 +0200)]
Interpreter fixes for BREAK and a few other instructions.

This should fix F1 2000. (but it's possible that game
needs some tweaks to the CDROM timings as it's quite sensitive to them)

Co-authored-by: Nicolas Noble <nicolasnoble@users.noreply.github.com>
3 years ago[Interpreter] Link even if branch is not taken in BGEZAL/BLTZAL
gameblabla [Sat, 2 Oct 2021 16:12:35 +0000 (18:12 +0200)]
[Interpreter] Link even if branch is not taken in BGEZAL/BLTZAL

Source :
grumpycoders/pcsx-redux@c1a0569

Co-authored-by: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com>
3 years agoOpenBus changes from PCSX-Redux
gameblabla [Sat, 2 Oct 2021 16:11:29 +0000 (18:11 +0200)]
OpenBus changes from PCSX-Redux

Co-authored-by: Nicolas Noble <nicolasnoble@users.noreply.github.com>
3 years agoMerge Icache emulation from PCSX Redux + Senquack changes from PCSX4ALL
gameblabla [Sat, 2 Oct 2021 16:10:23 +0000 (18:10 +0200)]
Merge Icache emulation from PCSX Redux + Senquack changes from PCSX4ALL

See (Redux) :
https://github.com/grumpycoders/pcsx-redux/commit/1923ce5

See original icache implementation (mirror of PCSX Reloaded):
https://github.com/gameblabla/pcsxr/commit/6916151

Without icache emulation, F1 2001 will greatly misbehave :
if you accelerate, the car will go around like crazy.
With icache emulation, it works as intended.

Note that our code is slightly different from theirs as i found out that
having the icache arrays in psxregs would cause crashes so instead
what i'm doing is to taking them out of there and only allocating them
on the heap (due to their great size).

Known issue(s) : Instruction cache emulation code fails to run
Spyro 2 PAL version. (or is it because of SBI?)

Co-authored-by: Nicolas Noble <nicolasnoble@users.noreply.github.com>
Co-authored-by: senquack <dansilsby@gmail.com>
3 years agoMerge pull request #552 from libretro/fp_fix_libretro
gameblabla [Sat, 2 Oct 2021 13:10:22 +0000 (13:10 +0000)]
Merge pull request #552 from libretro/fp_fix_libretro

Implement fix from Mednafen for Fantastic Pinball Kyuutenkai.

3 years agoMerge pull request #561 from gameblabla/sony_armored_fix_libretro
gameblabla [Sat, 2 Oct 2021 02:39:36 +0000 (02:39 +0000)]
Merge pull request #561 from gameblabla/sony_armored_fix_libretro

Fix for Armored Core misdetecting a Link cable being detected

3 years agoFix for Armored Core misdetecting a Link cable being detected
gameblabla [Sat, 2 Oct 2021 02:37:04 +0000 (04:37 +0200)]
Fix for Armored Core misdetecting a Link cable being detected

For some reason, the game detects that a link cable is plugged in
and disables the local multiplayer as a result.

Thanks @sony for fixing the issue in their PS Classic branch, a
simpler fix is done here instead.

Co-authored-by: Sony
3 years agoUpdate custom-issue-report.md
gameblabla [Sat, 25 Sep 2021 22:36:26 +0000 (22:36 +0000)]
Update custom-issue-report.md

Point out that people should try on PCSX-Redux, PCSX Reloaded... as well in case we suffer from a regression or forgot to merge a fix.

3 years agoMerge pull request #559 from gameblabla/cdrom_various_fixes
gameblabla [Sat, 25 Sep 2021 13:37:10 +0000 (13:37 +0000)]
Merge pull request #559 from gameblabla/cdrom_various_fixes

Various CDROM fixes from Duckstation and Mednafen

3 years agoUse the "magic numbers" from Duckstation for CDLPause
gameblabla [Sat, 25 Sep 2021 13:33:10 +0000 (15:33 +0200)]
Use the "magic numbers" from Duckstation for CDLPause

We need to make sure not to break Gundam Battle Assault 2 in PAL mode
as otherwise it will lockup.
Amusingly, Mednafen currently cannot run this game in PAL mode.

3 years agoFix CdlGetTD according to Mednafen's implementation.
gameblabla [Sat, 25 Sep 2021 13:32:27 +0000 (15:32 +0200)]
Fix CdlGetTD according to Mednafen's implementation.

3 years agoCdlGetmode is GetParam, fix it according to Mednafen's implementation
gameblabla [Sat, 25 Sep 2021 13:23:40 +0000 (15:23 +0200)]
CdlGetmode is GetParam, fix it according to Mednafen's implementation

The result size for GetParam (previously Getmode) should be only 5 and done this way.

Here's Mednafen implementation :
https://github.com/libretro-mirrors/mednafen-git/blob/1899500078169e787f86eb5302a3f35abdaa8764/src/psx/cdc.cpp#L2095

Nocash's documentation also shows that our previous implementation was wrong :
https://problemkaputt.de/psx-spx.htm
(See CDROM Controller Command Summary section or CDROM - Status Commands)

3 years agoDon't throw an error for CdlGetQ.
gameblabla [Sat, 25 Sep 2021 13:22:35 +0000 (15:22 +0200)]
Don't throw an error for CdlGetQ.

I doubt this is used by any game but who knows.

See Mednafen for reference :
https://github.com/libretro-mirrors/mednafen-git/blob/1899500078169e787f86eb5302a3f35abdaa8764/src/psx/cdc.cpp#L2527

3 years agoImprove SetLoc CDROM command from Duckstation
gameblabla [Sat, 25 Sep 2021 13:22:00 +0000 (15:22 +0200)]
Improve SetLoc CDROM command from Duckstation

See Duckstation's CDROM for reference :
https://github.com/stenzek/duckstation/blob/18241978ea056a81ff9847f0ad89658f886153ea/src/core/cdrom.cpp#L1087

3 years agoCdlSync should be NULL and return an error.
gameblabla [Sat, 25 Sep 2021 13:20:52 +0000 (15:20 +0200)]
CdlSync should be NULL and return an error.

This has been confirmed by both Mednafen and nocash's documentation.

3 years agoImplement fix from Mednafen for Fantastic Pinball Kyuutenkai.
gameblabla [Sat, 25 Sep 2021 12:20:49 +0000 (14:20 +0200)]
Implement fix from Mednafen for Fantastic Pinball Kyuutenkai.

This is taken from the way Mednafen implemented it.
https://github.com/libretro-mirrors/mednafen-git/blob/563b72e377fa8284559df4df0271108d4935c9f1/src/psx/cdc.cpp#L941

This properly fixes the freeze issue in Fantastic Pinball Kyuutenkai.
Thanks notaz for assisting me with the code.

It seems not to work properly on ARM though ?

3 years agoMerge pull request #558 from gameblabla/cdrom_fixes_libretro_popo
gameblabla [Sat, 25 Sep 2021 11:58:19 +0000 (11:58 +0000)]
Merge pull request #558 from gameblabla/cdrom_fixes_libretro_popo

Merge several fixes from PCSX Redux and adjust delay for SetLocPending.

3 years agoMerge several fixes from PCSX Redux and adjust delay for SetLocPending.
gameblabla [Sat, 25 Sep 2021 11:53:58 +0000 (13:53 +0200)]
Merge several fixes from PCSX Redux and adjust delay for SetLocPending.

There's a game, PoPoLoCrois Monogatari II, that unfortunately locks up
during the intro screen.
I should have known that code was wrong as Mednafen did not have anything
like that in their code either, hence the confusion.

Their fix however still don't include the Driver fix so the game would still
crash if we don't have the "+ Seektime".
To be honest, i'm not sure why the PCSX Reloaded team did it this way...

I noticed that the fastforward and fastbackward code was pretty much unused.
Looked at Mednafen and all they do is just adjust the cursector
and make sure that fastword & backword trigger the AUTO_REPORT code
so i did the latter.

There was also a mysterious leftover code from PCSX Reloaded in Cdlplay:
that had a condition that forced it to SEEK_DONE
(with a comment even saying that it should be set to SEEK instead)
so i set it to SEEK_PENDING instead.
(Mednafen's code seems to suggest so as well)

3 years agoFix regression caused by #9361a5aa4fef73e06bc78b7c462eb28a7d12e3d0
gameblabla [Sat, 25 Sep 2021 11:24:52 +0000 (13:24 +0200)]
Fix regression caused by #9361a5aa4fef73e06bc78b7c462eb28a7d12e3d0

Not sure why it caused that but it causes the function to fail.
I don't want to wait months for him to fix it properly
so let's just do that for now.

3 years agoMerge pull request #553 from gameblabla/football_fix_libretro
gameblabla [Wed, 25 Aug 2021 20:54:08 +0000 (20:54 +0000)]
Merge pull request #553 from gameblabla/football_fix_libretro

CDROM: Rename Reset+Init commands, fix "This is Football 2" lockup

3 years agoCDROM: Rename Reset+Init commands, fix "This is Football 2" lockup
gameblabla [Wed, 25 Aug 2021 20:35:07 +0000 (22:35 +0200)]
CDROM: Rename Reset+Init commands, fix "This is Football 2" lockup

Upon the reset command being issued, we need to set the Mode to 0x20
(as it was confirmed in Mednafen) and also disable the muting.

We also change the seektime for the reset command appropriately.
Please see Mednafen's implementation as reference :
https://github.com/libretro-mirrors/mednafen-git/blob/1899500078169e787f86eb5302a3f35abdaa8764/src/psx/cdc.cpp#L2007

This fixes the black screen issue in "This is Football 2".
This also fixes the black screen issue in Pooh's Party
after you selected a character.

3 years agoProperly fix the extern to const void instead of just void.
gameblabla [Wed, 25 Aug 2021 11:25:51 +0000 (13:25 +0200)]
Properly fix the extern to const void instead of just void.

3 years agoMerge pull request #551 from gameblabla/hle_compil
gameblabla [Wed, 25 Aug 2021 11:21:13 +0000 (11:21 +0000)]
Merge pull request #551 from gameblabla/hle_compil

Fix broken HLE PR

3 years agoFix broken HLE PR.
gameblabla [Wed, 25 Aug 2021 11:18:43 +0000 (13:18 +0200)]
Fix broken HLE PR.

3 years agoMerge pull request #543 from gameblabla/hle_fies_corruption_libretro
gameblabla [Wed, 25 Aug 2021 09:39:02 +0000 (09:39 +0000)]
Merge pull request #543 from gameblabla/hle_fies_corruption_libretro

Properly protect the HLE instructions against corrupted memory.

3 years agoMerge pull request #547 from gameblabla/blues_clues_fix_audio_fmv
gameblabla [Sun, 22 Aug 2021 20:57:57 +0000 (20:57 +0000)]
Merge pull request #547 from gameblabla/blues_clues_fix_audio_fmv

CDROM: Ignore sectors with channel number 255

3 years agoCDROM: Ignore sectors with channel number 255
gameblabla [Sun, 22 Aug 2021 13:16:01 +0000 (15:16 +0200)]
CDROM: Ignore sectors with channel number 255

This was inspired by the fix in Duckstation :
https://github.com/stenzek/duckstation/commit/0710e3b6d384526ed939f742f8f657623bb354bb

Some games have junk audio sectors with a channel number of 255.
If these are not skipped, then they will play wrong file.

This was tested on "Blue's Clues : Blue's Big Musical" and
it fixed the missing audio there.

Taxi 2 is also said to be affected by this.

3 years agoMerge pull request #544 from gameblabla/gpu_hle_rewrite_libretro
Autechre [Sat, 21 Aug 2021 16:26:42 +0000 (18:26 +0200)]
Merge pull request #544 from gameblabla/gpu_hle_rewrite_libretro

Rewrite GPU bios functions according to OpenBIOS.

3 years agoMerge pull request #542 from gameblabla/mdec_fix
Autechre [Sat, 21 Aug 2021 16:06:01 +0000 (18:06 +0200)]
Merge pull request #542 from gameblabla/mdec_fix

mdec.cpp: Dare to set MDEC_BIAS to 10

3 years agoMerge pull request #541 from gameblabla/spu_fix_libretro
Autechre [Sat, 21 Aug 2021 16:05:42 +0000 (18:05 +0200)]
Merge pull request #541 from gameblabla/spu_fix_libretro

Fixes Diablo 1 SPU bug properly and remove Diablo hack.

3 years agoRewrite GPU bios functions according to OpenBIOS.
gameblabla [Sat, 21 Aug 2021 16:02:10 +0000 (18:02 +0200)]
Rewrite GPU bios functions according to OpenBIOS.

See PCSX-Redux :
https://github.com/grumpycoders/pcsx-redux/blob/93653ba5281487d3bed57371d7b64c32dfc669f0/src/mips/openbios/gpu/gpu.c

3 years agoProperly protect the HLE instructions against corrupted memory.
gameblabla [Sat, 21 Aug 2021 15:49:19 +0000 (17:49 +0200)]
Properly protect the HLE instructions against corrupted memory.

Fix is from PCSX-redux :
grumpycoders/pcsx-redux@99c9508

This should hopefully fix HDHOSHY's experimental patch properly.

Co-authored-by: Nicolas Noble <nicolasnoble@users.noreply.github.com>
3 years agoFixes Diablo 1 SPU bug properly and remove Diablo hack.
gameblabla [Sat, 21 Aug 2021 15:23:33 +0000 (17:23 +0200)]
Fixes Diablo 1 SPU bug properly and remove Diablo hack.

(Mostly) inspired by the fixes done in PCSX Redux :
https://github.com/grumpycoders/pcsx-redux/blob/93653ba5281487d3bed57371d7b64c32dfc669f0/src/spu/registers.cc#L504

It seems that there was an attempt to initially implement it
in PCSX Reloaded (hence the bIgnoreLoop in freeze.c) but it was never
implemented properly.

Co-authored-by: Nicolas Noble <nicolasnoble@users.noreply.github.com>
3 years agoMerge pull request #539 from gameblabla/spustate_register_fix_libretro
Autechre [Thu, 19 Aug 2021 08:49:25 +0000 (10:49 +0200)]
Merge pull request #539 from gameblabla/spustate_register_fix_libretro

[SPU] Emulate SPUSTAT[5:0] as a mirror of SPUCNT[5:0]

3 years agoMerge pull request #540 from gameblabla/gte_senquack_fix_libretro
Autechre [Thu, 19 Aug 2021 08:49:03 +0000 (10:49 +0200)]
Merge pull request #540 from gameblabla/gte_senquack_fix_libretro

gte: Fix gteH division and sign extension (from PCSX4ALL)

3 years agogte: Fix gteH division and sign extension (from PCSX4ALL)
gameblabla [Thu, 19 Aug 2021 04:36:22 +0000 (06:36 +0200)]
gte: Fix gteH division and sign extension (from PCSX4ALL)

gteH register is u16, not s16. DIVIDE macro/func assumed it was
s16 for some reason. Behavior now matches Mednafen.

Co-authored-by: senquack <dansilsby@gmail.com>
3 years ago[SPU] Emulate SPUSTAT[5:0] as a mirror of SPUCNT[5:0]
gameblabla [Thu, 19 Aug 2021 04:26:28 +0000 (06:26 +0200)]
[SPU] Emulate SPUSTAT[5:0] as a mirror of SPUCNT[5:0]

Fix is from PCSX-Redux :
grumpycoders/pcsx-redux@4e905d7

I have tested the fix against Loonies 8192 (a PSn00bSDK made homebrew game) and it no longer
locks up during loading.

Co-authored-by: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com>
3 years agoMerge pull request #538 from gameblabla/fix_cdom_savestate
Autechre [Wed, 18 Aug 2021 15:13:45 +0000 (17:13 +0200)]
Merge pull request #538 from gameblabla/fix_cdom_savestate

Fix save state compatibility that was broken by my CDrom timing changes.

3 years agomdec.cpp: Dare to set MDEC_BIAS to 10
gameblabla [Mon, 16 Aug 2021 01:29:24 +0000 (03:29 +0200)]
mdec.cpp: Dare to set MDEC_BIAS to 10

This fixes graphic artifacts during cinematics in :
- Vandal Hearts
- R-Types
- Galerians

Dmitrysmagin had a similar fix in PCSX4ALL but he set it to 6.
It turns out MDEC_BIAS set to 6 was still not enough for Galerians
to look properly so it was set to 10.
It seems so far that other games are unaffected.

Co-authored-by: Dmitry Smagin <exmortis@yandex.ru>
3 years agoFix save state compatibility that was broken by my CDrom timing changes.
gameblabla [Tue, 17 Aug 2021 04:27:02 +0000 (06:27 +0200)]
Fix save state compatibility that was broken by my CDrom timing changes.

3 years agoMerge pull request #537 from embercold/warningless-build
Autechre [Tue, 17 Aug 2021 03:36:24 +0000 (05:36 +0200)]
Merge pull request #537 from embercold/warningless-build

Sort out compiler warnings, all of them

3 years agoSort out compiler warnings, all of them
Ember Cold [Tue, 17 Aug 2021 02:19:02 +0000 (05:19 +0300)]
Sort out compiler warnings, all of them

3 years agoMerge pull request #536 from gameblabla/cdrom_fixes
Autechre [Mon, 16 Aug 2021 05:14:52 +0000 (07:14 +0200)]
Merge pull request #536 from gameblabla/cdrom_fixes

CDRom timings changes

3 years agoCDRom timings changes
gameblabla [Fri, 13 Aug 2021 16:00:47 +0000 (18:00 +0200)]
CDRom timings changes

Upstreamed changes from PCSX Redux as seen here :
https://github.com/grumpycoders/pcsx-redux/commit/5730e04f0183f37038bc1d133cf9f9092425b90a

This apparently fixes Deus Fight in Xenogears.

Co-authored-by: Nicolas Noble <nicolasnoble@users.noreply.github.com>
3 years agoMerge pull request #532 from davidgfnet/master
Autechre [Sat, 31 Jul 2021 17:57:15 +0000 (19:57 +0200)]
Merge pull request #532 from davidgfnet/master

Fix initialization on Frontends without variable support.

3 years agoFix initialization on Frontends without variable support.
David Guillen Fandos [Fri, 30 Jul 2021 18:54:08 +0000 (20:54 +0200)]
Fix initialization on Frontends without variable support.

Frontends that do not support RETRO_ENVIRONMENT_GET_VARIABLE (like
miniretro & nanoarch) cause a segfault in the CPU emulation path unless
the BIOS file is present. This is due to the emulator not supporting
running without a BIOS in dynarec mode and the code not being able to
swap CPU types (unless the callback returns true).

3 years agoMerge pull request #530 from embercold/fix-div-insn
Autechre [Wed, 21 Jul 2021 13:01:10 +0000 (15:01 +0200)]
Merge pull request #530 from embercold/fix-div-insn

Handle DIV overflow in lightrec and the interpreter

3 years agoHandle DIV overflow in lightrec and the interpreter
Ember Cold [Wed, 21 Jul 2021 12:04:23 +0000 (15:04 +0300)]
Handle DIV overflow in lightrec and the interpreter

3 years agoAttempt to fix Android build
twinaphex [Thu, 8 Jul 2021 13:32:51 +0000 (15:32 +0200)]
Attempt to fix Android build

3 years agoMerge pull request #529 from negativeExponent/nodebugger
Autechre [Thu, 8 Jul 2021 11:57:33 +0000 (13:57 +0200)]
Merge pull request #529 from negativeExponent/nodebugger

Do not compile debugger codes by default

3 years agoDo not compile debugger codes by default
negativeExponent [Wed, 7 Jul 2021 00:49:59 +0000 (08:49 +0800)]
Do not compile debugger codes by default

- Reduces binary to about half the size
- Compile with DEBUG=1 to build core with debug code

3 years agoMerge pull request #522 from negativeExponent/patch-2
Autechre [Sun, 30 May 2021 09:31:11 +0000 (11:31 +0200)]
Merge pull request #522 from negativeExponent/patch-2

Set inputs to use "standard" by default

3 years agoSet inputs to use "standard" by default
negativeExponent [Sun, 30 May 2021 04:28:16 +0000 (12:28 +0800)]
Set inputs to use "standard" by default

3 years agoMerge pull request #520 from negativeExponent/multitap_option_description
Autechre [Sun, 16 May 2021 21:25:53 +0000 (23:25 +0200)]
Merge pull request #520 from negativeExponent/multitap_option_description

Update multitap option description

3 years agoThese are now unnecessary
negativeExponent [Sun, 16 May 2021 05:36:17 +0000 (13:36 +0800)]
These are now unnecessary

3 years agoUpdate multitap option description
negativeExponent [Sun, 16 May 2021 04:30:42 +0000 (12:30 +0800)]
Update multitap option description

3 years agoMerge pull request #517 from negativeExponent/input
Autechre [Tue, 11 May 2021 15:15:07 +0000 (17:15 +0200)]
Merge pull request #517 from negativeExponent/input

Fix reporting for connected or unconnected inputs

3 years agoMerge pull request #516 from negativeExponent/vfs
Autechre [Tue, 11 May 2021 15:14:47 +0000 (17:14 +0200)]
Merge pull request #516 from negativeExponent/vfs

start adding libretro vfs

3 years agoFix reporting for connected or unconnected inputs
negativeExponent [Thu, 6 May 2021 05:38:18 +0000 (13:38 +0800)]
Fix reporting for connected or unconnected inputs

Current implementation assumes all inputs are plugged, regardless of
input type settings, so input reporting in games also says its
connected.

This PR fix this minor issue, by sending appropriate input register
values when no controllers are attached.

Related issue (what i used as well for testing):
https://github.com/libretro/duckstation/issues/35

3 years agoFix fgets param
negativeExponent [Sat, 1 May 2021 20:48:10 +0000 (04:48 +0800)]
Fix fgets param

3 years agoAdd libretro VFS and use VFS for windows target
negativeExponent [Wed, 21 Apr 2021 03:05:01 +0000 (11:05 +0800)]
Add libretro VFS and use VFS for windows target

- Reverts the use of fopen_utf8 from previous commit and use
  "file_stream_transforms.h" instead: \7fhttps://github.com/libretro/pcsx_rearmed/commit/270c6dd14f876b8a67929aa22abefc47f4588324#diff-2065d1414bac1198fb423574b4874d5bf92a2114a2f3e235c469d8fd6288dd10

- Enable the use of VFS for windows by default.

- compile with USE_LIBRETRO_VFS=1 to enable vfs when compiling for other
  platforms (including android if needed)

3 years agoMerge pull request #514 from negativeExponent/fopen_utf8
Autechre [Wed, 28 Apr 2021 20:28:57 +0000 (22:28 +0200)]
Merge pull request #514 from negativeExponent/fopen_utf8

libchdr: Use also fopen_utf8 here