pcsx_rearmed.git
5 years agopsxbios : Several fixes to malloc.
gameblabla [Thu, 18 Jul 2019 00:21:53 +0000 (02:21 +0200)]
psxbios : Several fixes to malloc.

- 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.

5 years agopsxbios: Add checks for memmove.
gameblabla [Thu, 18 Jul 2019 00:19:07 +0000 (02:19 +0200)]
psxbios: Add checks for memmove.

Always returns dst per documentation.

5 years agopsxbios : Add checks to memset.
gameblabla [Thu, 18 Jul 2019 00:17:35 +0000 (02:17 +0200)]
psxbios : Add checks to memset.

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).

5 years agopsxbios: Add checks to memcpy.
gameblabla [Thu, 18 Jul 2019 00:16:41 +0000 (02:16 +0200)]
psxbios: Add checks to memcpy.

Always returns dst

5 years agopsxbios: Add checks for bzero.
gameblabla [Thu, 18 Jul 2019 00:15:27 +0000 (02:15 +0200)]
psxbios: Add checks for bzero.

Only return 0 if size is invalid. (0 or 0x7FFFFFFF), return dst if not.

5 years agopsxbios: Add checks for bcopy
gameblabla [Thu, 18 Jul 2019 00:13:13 +0000 (02:13 +0200)]
psxbios: Add checks for bcopy

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)

5 years agopsxbios : Add checks to index and rindex calls
gameblabla [Thu, 18 Jul 2019 00:12:23 +0000 (02:12 +0200)]
psxbios : Add checks to index and rindex calls

Return 0 for index/rindex if src is 0x00.

5 years agopsxbios: Merge upstream fix for Deliverevent in firstfile
gameblabla [Thu, 18 Jul 2019 00:11:40 +0000 (02:11 +0200)]
psxbios: Merge upstream fix for Deliverevent in firstfile

Looks like it is only executed for memory cards, that makes sense i guess.

5 years agopsxbios: Should fix input issues in some games.
gameblabla [Thu, 18 Jul 2019 00:10:43 +0000 (02:10 +0200)]
psxbios: Should fix input issues in some games.

Someone reported that this fixed Negcon controls in Ridge Racer Revolution
and Grand Tour Racing.
I doubt this will suffer from regressions ?

5 years agopsxbios: Fix out-of-bounds issue.
gameblabla [Thu, 18 Jul 2019 00:09:56 +0000 (02:09 +0200)]
psxbios: Fix out-of-bounds issue.

Make sure to return 0xff is no TCBs are available.
Thanks senquack for the proper fix.

5 years agoOnly PCSX4ALL uses ResetIoCycle. Remove it for now.
gameblabla [Thu, 18 Jul 2019 00:08:32 +0000 (02:08 +0200)]
Only PCSX4ALL uses ResetIoCycle. Remove it for now.

5 years agoFixup buread & buwrite being undefined.
gameblabla [Thu, 18 Jul 2019 00:07:56 +0000 (02:07 +0200)]
Fixup buread & buwrite being undefined.

5 years agopsxbios: Improve WaitEvent behaviour according to documentation
gameblabla [Thu, 18 Jul 2019 00:02:48 +0000 (02:02 +0200)]
psxbios: Improve WaitEvent behaviour according to documentation

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.

5 years agopsxbios: Better realloc implementation
gameblabla [Thu, 18 Jul 2019 00:01:34 +0000 (02:01 +0200)]
psxbios: Better realloc implementation

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.

5 years agopsxbios : Add checks for strncat
gameblabla [Thu, 18 Jul 2019 00:00:11 +0000 (02:00 +0200)]
psxbios : Add checks for strncat

Returns 0 if src or dst is 0x00.

5 years agopsxbios: Add todigit implementation
gameblabla [Wed, 17 Jul 2019 23:59:35 +0000 (01:59 +0200)]
psxbios: Add todigit implementation

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.

5 years agopsxbios: Adds putc and getc implementation
gameblabla [Wed, 17 Jul 2019 23:58:44 +0000 (01:58 +0200)]
psxbios: Adds putc and getc implementation

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.

5 years agopsxbios: Return 0x1f801814 for gpu_abort_dma
gameblabla [Wed, 17 Jul 2019 23:57:53 +0000 (01:57 +0200)]
psxbios: Return 0x1f801814 for gpu_abort_dma

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.

5 years agopsxbios: Better EnterCiritcal implementation
gameblabla [Wed, 17 Jul 2019 23:57:08 +0000 (01:57 +0200)]
psxbios: Better EnterCiritcal implementation

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.

5 years agopsxbios: Add checks for card_write, card_read
gameblabla [Wed, 17 Jul 2019 23:55:57 +0000 (01:55 +0200)]
psxbios: Add checks for card_write, card_read

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.

5 years agopsxbios: Merging improved card_info function from upstream
gameblabla [Wed, 17 Jul 2019 23:54:58 +0000 (01:54 +0200)]
psxbios: Merging improved card_info function from upstream

It should be closer to the real thing, and this commit and the previous one
definitely fixes the save issues in Digimon World.

5 years agopsxbios: Merging fixes from upstream.
gameblabla [Wed, 17 Jul 2019 23:44:03 +0000 (01:44 +0200)]
psxbios: Merging fixes from upstream.

DeliverEvent functions are executed right after writing/reading instead of after setting v0.
This fixes saving in games like LEGO Racers.

5 years agopsxbios: Add checks to PAD_init
gameblabla [Wed, 17 Jul 2019 23:10:33 +0000 (01:10 +0200)]
psxbios: Add checks to PAD_init

Nocash documentation says that function fails if type is not 0x20000000
or 0x20000001. In case of failure, it should return 0.
If not, then it should return 2.

This fixes input in Digimon World.

5 years agopsxbios: Add checks to strcat
gameblabla [Wed, 17 Jul 2019 23:09:21 +0000 (01:09 +0200)]
psxbios: Add checks to strcat

Nocash documentation says that function fails if src or dst is 0.
If so, then it must return 0.

This fix is required for fixing crash on bootup in Digimon World.

7 years agoMerge pull request #98 from psyke83/master
notaz [Tue, 17 Oct 2017 09:02:00 +0000 (12:02 +0300)]
Merge pull request #98 from psyke83/master

RPI: add Mesa override & update vendor library names

7 years agoRPI: add Mesa override & update vendor library names
Conn O'Griofa [Mon, 16 Oct 2017 16:50:42 +0000 (17:50 +0100)]
RPI: add Mesa override & update vendor library names

* Update RPI vendor library names to allow compatibility with recent
firmwares that have obsoleted the originally named duplicate libraries.
* Add override to build against VC4 Mesa driver via "VIDEOCORE=no"

7 years agouse pc-relative offsets for PIC too
notaz [Tue, 2 May 2017 23:52:15 +0000 (02:52 +0300)]
use pc-relative offsets for PIC too

8 years agodrc: fix a mistake from w^x change
notaz [Fri, 30 Sep 2016 10:58:12 +0000 (13:58 +0300)]
drc: fix a mistake from w^x change

Fixes: d148d265

8 years agodrc: some vita and 3ds support
notaz [Tue, 20 Sep 2016 23:07:16 +0000 (02:07 +0300)]
drc: some vita and 3ds support

not tested, mostly just guesswork

8 years agodrc: avoid MAP_FIXED
notaz [Tue, 20 Sep 2016 22:06:32 +0000 (01:06 +0300)]
drc: avoid MAP_FIXED

it's almost never a good idea, it will override some other mapping
and make things crash

8 years agodrc: try to support w^x platforms like iOS
notaz [Sun, 18 Sep 2016 23:40:17 +0000 (02:40 +0300)]
drc: try to support w^x platforms like iOS

untested...

8 years agodrc: remove unnecessary cache flushing
notaz [Sun, 18 Sep 2016 21:00:48 +0000 (00:00 +0300)]
drc: remove unnecessary cache flushing

should already be flushed or not matter at this point

8 years agodrc: enable and fix warnings
notaz [Sun, 18 Sep 2016 20:58:17 +0000 (23:58 +0300)]
drc: enable and fix warnings

these were kept for compat with Ari64's code, which is removed, see
previous commit messages

8 years agodrc: mark things static
notaz [Sun, 18 Sep 2016 20:43:04 +0000 (23:43 +0300)]
drc: mark things static

8 years agodrc: strip eol blanks
notaz [Sun, 18 Sep 2016 17:10:06 +0000 (20:10 +0300)]
drc: strip eol blanks

Because people send patches while using editors that strip blanks
and the patch becomes a mess.

8 years agodrc: drop less obvious dead code
notaz [Sun, 18 Sep 2016 17:04:25 +0000 (20:04 +0300)]
drc: drop less obvious dead code

8 years agodrc: drop heaps of dead code
notaz [Sun, 18 Sep 2016 16:22:58 +0000 (19:22 +0300)]
drc: drop heaps of dead code

I've kept it around to keep the code similar to Ari64's version,
so that it would be easier to merge back his fixes. However Mupen64plus
has long reformatted the code and it kind of went different direction
anyway, so there is no point to keep all this code now.

8 years agolibretro: try to prevent bad builds
notaz [Sat, 9 Jul 2016 23:09:08 +0000 (02:09 +0300)]
libretro: try to prevent bad builds

8 years agofix build on some archs
notaz [Thu, 31 Mar 2016 23:34:52 +0000 (02:34 +0300)]
fix build on some archs

just some unneeded preprocessor check

8 years agodon't use __ARM_ARCH_7A__
notaz [Thu, 31 Mar 2016 22:49:55 +0000 (01:49 +0300)]
don't use __ARM_ARCH_7A__

github issue #68

8 years agouse __ARM_ARCH
notaz [Thu, 31 Mar 2016 22:16:56 +0000 (01:16 +0300)]
use __ARM_ARCH

8 years agolarge file support
notaz [Sat, 5 Mar 2016 01:20:41 +0000 (03:20 +0200)]
large file support

not tested if it actually reads over 2GB

8 years agopsxmem: use rounding that's more likely to work
notaz [Sun, 28 Feb 2016 21:36:59 +0000 (23:36 +0200)]
psxmem: use rounding that's more likely to work

8 years agodrc: handle any immediate
notaz [Sun, 28 Feb 2016 21:03:44 +0000 (23:03 +0200)]
drc: handle any immediate

8 years agomenu: fix input config for device names ending with space
notaz [Thu, 7 Jan 2016 21:47:01 +0000 (23:47 +0200)]
menu: fix input config for device names ending with space

reported by KP142EH12 and perhaps somebody else I forgot
also take the opportunity to update libpicofe

9 years agopsxmem: fix error handling
notaz [Tue, 24 Mar 2015 22:39:24 +0000 (00:39 +0200)]
psxmem: fix error handling

also bump libpicofe for mmap fix

9 years agoarm_features.h Add ARM architectures 8A and 6M
gizmo98 [Fri, 13 Feb 2015 15:33:04 +0000 (16:33 +0100)]
arm_features.h Add ARM architectures 8A and 6M

Just copied macros from gcc source code:
https://github.com/gcc-mirror/gcc/blob/113a5d9f83975b703ec06a1d2baa30604d322cf1/libatomic/config/arm/arm-config.h#L54

9 years agolibretro: always use fixed samples per frame
notaz [Thu, 5 Feb 2015 23:26:44 +0000 (01:26 +0200)]
libretro: always use fixed samples per frame

9 years agorelease r22 r22
notaz [Thu, 5 Feb 2015 00:50:46 +0000 (02:50 +0200)]
release r22

9 years agogpulib: remove unneeded hack
notaz [Thu, 5 Feb 2015 00:37:56 +0000 (02:37 +0200)]
gpulib: remove unneeded hack

9 years agodma: some timing hacks
notaz [Thu, 5 Feb 2015 00:36:58 +0000 (02:36 +0200)]
dma: some timing hacks

untested

9 years agodma: do some madr updates
notaz [Thu, 5 Feb 2015 00:29:23 +0000 (02:29 +0200)]
dma: do some madr updates

untested, but makes ff7 behave better with linked lists
(dither problem)

9 years agogpu_unai: fix some 64bit issues
notaz [Tue, 3 Feb 2015 22:31:01 +0000 (00:31 +0200)]
gpu_unai: fix some 64bit issues

9 years agofrontend: fix minor glitches on video mode changes
notaz [Tue, 3 Feb 2015 01:10:06 +0000 (03:10 +0200)]
frontend: fix minor glitches on video mode changes

9 years agofrontend: update libpicofe
notaz [Mon, 2 Feb 2015 23:35:33 +0000 (01:35 +0200)]
frontend: update libpicofe

9 years agospu: c64x: fix cache handling, enable l2
notaz [Mon, 2 Feb 2015 02:13:30 +0000 (04:13 +0200)]
spu: c64x: fix cache handling, enable l2

9 years agospu: fix some thread safety issues
notaz [Mon, 2 Feb 2015 01:51:40 +0000 (03:51 +0200)]
spu: fix some thread safety issues

reverb and stuff

9 years agoreadme: fix a link
notaz [Sat, 31 Jan 2015 22:08:24 +0000 (00:08 +0200)]
readme: fix a link

9 years agoconvert readme to markdown
notaz [Sat, 31 Jan 2015 22:04:05 +0000 (00:04 +0200)]
convert readme to markdown

9 years agotravis: add dependencies
notaz [Sat, 31 Jan 2015 21:45:09 +0000 (23:45 +0200)]
travis: add dependencies

9 years agolet's try Travis CI
notaz [Sat, 31 Jan 2015 21:28:41 +0000 (23:28 +0200)]
let's try Travis CI

9 years agogte_arm.S: Use ARMv6 if possible
gizmo98 [Thu, 29 Jan 2015 17:08:24 +0000 (18:08 +0100)]
gte_arm.S: Use ARMv6 if possible

Replace HAVE_ARMv7 with HAVE_ARMv6 if the instructions are supported by ARMv6.
ssat, usat and sxth are present under ARMv6: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473k/dom1361289925707.html

9 years agoassem_arm.c: Use ARMv6 instructions if possible
gizmo98 [Thu, 29 Jan 2015 17:04:27 +0000 (18:04 +0100)]
assem_arm.c: Use ARMv6 instructions if possible

Replace HAVE_ARMv7 with HAVE_ARMv6 if the instructions are supported by ARMv6.
uxth, sxth and sxtb are present under ARMv6: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473k/dom1361289925707.html

9 years agoAdd __ARM_ARCH_7S__ architecture
gizmo98 [Thu, 29 Jan 2015 16:55:38 +0000 (17:55 +0100)]
Add __ARM_ARCH_7S__ architecture

See http://sourceforge.net/p/predef/wiki/Architectures/
Apple A6 is an __ARM__ARCH_7S__ architecture.

9 years agofrontend: pandora: work around r20a vs r21 versioning
notaz [Tue, 13 Jan 2015 22:47:44 +0000 (00:47 +0200)]
frontend: pandora: work around r20a vs r21 versioning

otherwise PNDManager doesn't want to update..

9 years agotry to fix r-pi build
notaz [Tue, 13 Jan 2015 01:32:24 +0000 (03:32 +0200)]
try to fix r-pi build

9 years agorelease r21 r21
notaz [Sun, 11 Jan 2015 22:25:49 +0000 (00:25 +0200)]
release r21

9 years agofrontend: tune scanline implementation a bit
notaz [Sun, 11 Jan 2015 22:10:02 +0000 (00:10 +0200)]
frontend: tune scanline implementation a bit

9 years agofrontend: show C64x option
notaz [Sun, 11 Jan 2015 21:35:35 +0000 (23:35 +0200)]
frontend: show C64x option

9 years agospu: put reverb on the thread too
notaz [Sun, 11 Jan 2015 01:35:32 +0000 (03:35 +0200)]
spu: put reverb on the thread too

and more stuff to work struct

9 years agogpulib: use more conservative loop detection
notaz [Sat, 10 Jan 2015 19:54:34 +0000 (21:54 +0200)]
gpulib: use more conservative loop detection

the old one was causing too many cache misses

9 years agosome random improvements
notaz [Sat, 10 Jan 2015 01:51:44 +0000 (03:51 +0200)]
some random improvements

9 years agospu: fix some skip accuracy issues
notaz [Mon, 12 Jan 2015 01:00:12 +0000 (03:00 +0200)]
spu: fix some skip accuracy issues

9 years agospu: don't block on audio
notaz [Mon, 5 Jan 2015 21:50:33 +0000 (23:50 +0200)]
spu: don't block on audio

9 years agospu: support multiple pending buffers
notaz [Fri, 9 Jan 2015 23:55:24 +0000 (01:55 +0200)]
spu: support multiple pending buffers

for threaded implementation

9 years agospu: finish offload code to TI C64x DSP
notaz [Mon, 5 Jan 2015 02:27:03 +0000 (04:27 +0200)]
spu: finish offload code to TI C64x DSP

rather disappointing result so far, though :(

9 years agospu: start offload code to TI C64x DSP
notaz [Sat, 3 Jan 2015 23:43:23 +0000 (01:43 +0200)]
spu: start offload code to TI C64x DSP

9 years agospu: threaded implementation
notaz [Fri, 2 Jan 2015 02:13:50 +0000 (04:13 +0200)]
spu: threaded implementation

unlike original P.E.Op.S. implementation, the goal here is to carefully
avoid any side effects caused by having the thread enabled

9 years agospu: get rid of bStop, clean up
notaz [Fri, 2 Jan 2015 02:12:35 +0000 (04:12 +0200)]
spu: get rid of bStop, clean up

9 years agospu: move more things to StartSound
notaz [Thu, 1 Jan 2015 17:35:16 +0000 (19:35 +0200)]
spu: move more things to StartSound

9 years agospu: reduce use of globals
notaz [Wed, 31 Dec 2014 00:15:08 +0000 (02:15 +0200)]
spu: reduce use of globals

to be used by upcoming threaded code..

9 years agospu: handle stop better, split main func more
notaz [Sat, 27 Dec 2014 21:24:15 +0000 (23:24 +0200)]
spu: handle stop better, split main func more

9 years agomingw build fixes
notaz [Sat, 3 Jan 2015 00:22:14 +0000 (02:22 +0200)]
mingw build fixes

9 years agorelease r20 r20
notaz [Thu, 25 Dec 2014 15:17:05 +0000 (17:17 +0200)]
release r20

9 years agodrc: more timing hacks
notaz [Thu, 25 Dec 2014 18:27:43 +0000 (20:27 +0200)]
drc: more timing hacks

b6e87b2bc096 broke R-Type sound, try to recover..
also check PE2

9 years agofrontend: savestate autoload support
notaz [Thu, 25 Dec 2014 16:16:46 +0000 (18:16 +0200)]
frontend: savestate autoload support

9 years agofrontend: fix broken cropping
notaz [Thu, 25 Dec 2014 14:27:00 +0000 (16:27 +0200)]
frontend: fix broken cropping

9 years agofrontend: scanline efect and memcard saving
notaz [Thu, 25 Dec 2014 02:44:22 +0000 (04:44 +0200)]
frontend: scanline efect and memcard saving

9 years agocspace_neon: don't trash callee-save registers
notaz [Wed, 24 Dec 2014 23:40:04 +0000 (01:40 +0200)]
cspace_neon: don't trash callee-save registers

9 years agofrontend: add 2x scaling option
notaz [Wed, 24 Dec 2014 22:35:21 +0000 (00:35 +0200)]
frontend: add 2x scaling option

9 years agomenu: file browser fixes
notaz [Wed, 24 Dec 2014 02:23:04 +0000 (04:23 +0200)]
menu: file browser fixes

9 years agocdrom: handle old savestates better
notaz [Tue, 23 Dec 2014 23:18:16 +0000 (01:18 +0200)]
cdrom: handle old savestates better

I still have to many of them and use them for testing..

9 years agodrc: implement block addr list saving
notaz [Mon, 22 Dec 2014 02:10:25 +0000 (04:10 +0200)]
drc: implement block addr list saving

should give better experience after savestate load

9 years agodrc: replace unused reg32 with new reg_sv_flags
notaz [Tue, 23 Dec 2014 00:44:24 +0000 (02:44 +0200)]
drc: replace unused reg32 with new reg_sv_flags

9 years agopsxbios: don't crash on negative length
notaz [Sun, 21 Dec 2014 19:27:02 +0000 (21:27 +0200)]
psxbios: don't crash on negative length

Contra Legacy of War does memset(..., -1)

9 years agomisc: merge from pcsxr r91261,r91276
notaz [Sun, 21 Dec 2014 19:00:34 +0000 (21:00 +0200)]
misc: merge from pcsxr r91261,r91276

Author: edgbla
Small fixes. 11834, 11836 (Lioncash);

9 years agocdriso: merge from pcsxr r90558
notaz [Sun, 21 Dec 2014 18:43:23 +0000 (20:43 +0200)]
cdriso: merge from pcsxr r90558

Author: edgbla
cdriso: cbn/cbin detection fix;

9 years agopsxbios: merge from pcsxr r90224-r90227
notaz [Sun, 21 Dec 2014 18:31:42 +0000 (20:31 +0200)]
psxbios: merge from pcsxr r90224-r90227

Author: weimingzhi
psxbios: format()

9 years agomisc: merge from pcsxr r86908
notaz [Sun, 21 Dec 2014 17:03:56 +0000 (19:03 +0200)]
misc: merge from pcsxr r86908

Author: edgbla
CdromId fix;

9 years agolibretro: enable dither for peops plugin
notaz [Sun, 21 Dec 2014 00:57:09 +0000 (02:57 +0200)]
libretro: enable dither for peops plugin