Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyro 2 PAL does not boot due to ICache emulation code #650

Open
gameblabla opened this issue Oct 10, 2021 · 8 comments
Open

Spyro 2 PAL does not boot due to ICache emulation code #650

gameblabla opened this issue Oct 10, 2021 · 8 comments

Comments

@gameblabla
Copy link
Contributor

Shortly after boot, the game gets stuck on the Insomniac screen :
spyro2

Mednafen used to have this issue in that game because they implemented CdlSync as a Nop and did not return an error.
As a result, the game would lock up like this. (my PR explicitly fixes that #648)
However in our case, the issue is different.

It turns out after i merged back your ICache code back to PCSX rearmed (See notaz/pcsx_rearmed#198), that Read_Icache was for some reason causing the game to misbehave (true cause still unknown) and disabling icache emulation would make it work again.

However, because there is no way to disable icache emulation, the game will stay stuck (at least in interpreter mode).

@wheremyfoodat
Copy link
Collaborator

Reportedly works on both JIT and interp, can't test myself atm though.

@lorn10
Copy link

lorn10 commented Jun 24, 2022

For the record, I can confirm that a self-made (AcetoneISO) Spyro 2 Gateway to Glimmer PAL (SCES-02104) ISO image works absolutely fine in PCSX-Redux 5435d5e and stock SCPH-7502 BIOS v4.1. I have used the needed LibCrypt sbi file from here.

So it looks that the original issue is no longer present. If so, this can be closed. @wheremyfoodat

Note, - I think there exist an other issue in recent builds with the PSX OpenBIOS and Crash Bandicoot Warped. Under Linux I get in some cases a "DynaRec" error during booting. Or it completely refuses to start the game. The Windows build works under Wine until I exit PCSX-Redux. Then it usually crashes also there.

@Spyromain
Copy link

I have this issue with the latest version of PCSX-Redux.

The game gets stuck on the Insomniac Games screen and the window is not responding. After a few minutes, the line Capture buffer is overflowing. Increase CB_SIZE. appears in the logs and the game continues to run normally but is a bit laggy, I can even start a game until it gets stuck again, thus making the game unplayable.

PCSX-Redux version: 14198.20230331.6.x64 (Windows x64)
Tested BIOS: openbios and SCPH-7502
Tested ROM: SCES-02104, both .cue/.bin and .iso formats
SBI file included

Output logs (using SCPH-7502 bios + .cue/.bin format + .sbi file):

Warning: OpenGL error reporting disabled. See About dialog for more information.
Loading memory card memcard1.mcd
Loading memory card memcard2.mcd
PCSX-Redux booting
Copyright (C) 2019-2023 PCSX-Redux authors
Loaded BIOS: .\SCPH-7502.BIN
Known BIOS detected: SCPH-7502 (EU) (318178bf)
Loaded CD Image: .\Spyro.cue[+cue]Loaded SBI file: .\Spyro.sbi.
[+sbi].
Track 01 (DATA) - Start 00:00:00, Length 70:36:30
CD-ROM Label:
CD-ROM ID: SCES02104
CD-ROM EXE Name: SCES_021.04;1
BIOS Trace1: 0x0f
BIOS Trace1: 0x0e
BIOS Trace1: 0x01
BIOS Trace1: 0x02
BIOS Trace1: 0x03
BIOS Trace1: 0x04
BIOS Trace1: 0x01
BIOS Trace1: 0x03
BIOS Trace1: 0x04
BIOS Trace1: 0x05
BIOS Trace1: 0x06
BIOS Trace1: 0x02
BIOS Trace1: 0x05
PS-X Realtime Kernel Ver.2.5
Copyright 1993,1994 (C) Sony Computer Entertainment Inc.
BIOS Trace1: 0x06
KERNEL SETUP!
Configuration : EvCB	0x10		TCB	0x04
BIOS Trace1: 0x07
System ROM Version 4.1 12/16/97 E
Copyright 1993-1997 (C) Sony Computer Entertainment Inc.
ResetCallback: _96_remove ..
BIOS Trace1: 0x00
BIOS Trace1: 0x01
System Controller ROM Version 98/06/10 c3
BIOS Trace1: 0x02
BIOS Trace1: 0x00
SetGraphDebug:level:1,type:0 reverse:0
BIOS Trace1: 0x05
BIOS Trace1: 0x08
BOOTSTRAP LOADER Type C Ver 2.1   03-JUL-1994
Copyright 1993,1994 (C) Sony Computer Entertainment Inc.
BIOS Trace1: 0x09
setup file    : cdrom:SYSTEM.CNF;1
TCB	00000004
EVENT	00000016
STACK	801ffff0
BOOT =	cdrom:\SCES_021.04;1
argument =
KERNEL SETUP!
Configuration : EvCB	0x16		TCB	0x04
boot file     : cdrom:\SCES_021.04;1
EXEC:PC0(80056b38)  T_ADDR(80010000)  T_SIZE(0005c800)
boot address  : 80056b38 801ffff0
Execute !
                S_ADDR(801ffff0)  S_SIZE()
ResetGraph:jtb=8006b81c,env=8006b864
CD_init:addr=8006bf7c
Saving memory card memcard1.mcd
Saving memory card memcard2.mcd
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Unknown command for pad: 43
Saving memory card memcard1.mcd
Saving memory card memcard2.mcd
Capture buffer is overflowing. Increase CB_SIZE.

@nicolasnoble
Copy link
Member

I have this issue with the latest version of PCSX-Redux.

The game gets stuck on the Insomniac Games screen and the window is not responding. After a few minutes, the line Capture buffer is overflowing. Increase CB_SIZE. appears in the logs and the game continues to run normally but is a bit laggy, I can even start a game until it gets stuck again, thus making the game unplayable.

PCSX-Redux version: 14198.20230331.6.x64 (Windows x64) Tested BIOS: openbios and SCPH-7502 Tested ROM: SCES-02104, both .cue/.bin and .iso formats SBI file included

Are you running with the dynarec and/or interpreter?

@Spyromain
Copy link

I used a fresh install where Dynarec CPU was activated by default.
I tried without dynarec, the game still gets stuck on the Insomniac Games screen but not in the same way. PCSX-Redux becomes idle and these lines appear in the logs:

Encountered reserved opcode from 0x80082780, firing an exception
First chance exception: ReservedInstruction from 0x80082780

If I resume, it halts:

=== Unimplemented A0:40 syscall from 0x0000283C ===
epc = 0x80082780 - status = 0x40000410 - cause = 0x00000028 - badv = 0x00000000
r0 = 0x00000000 - at = 0x80070038 - v0 = 0xE1800000 - v1 = 0x8006A3C8
a0 = 0x00000000 - a1 = 0x00000000 - a2 = 0xFFFFFFFF - a3 = 0x00000400
t0 = 0x00000001 - t1 = 0x00000000 - t2 = 0x00000000 - t3 = 0x0BB504E0
t4 = 0x73F75A1B - t5 = 0x25EFEF00 - t6 = 0x1F800028 - t7 = 0x80060000
s0 = 0x00000002 - s1 = 0x8006BF79 - s2 = 0x00000000 - s3 = 0x8006BF78
s4 = 0x8006A700 - s5 = 0x00000002 - s6 = 0xBFC10000 - s7 = 0xBFC09280
t8 = 0x00000001 - t9 = 0x00000000 - k0 = 0x00000000 - k1 = 0x00000000
gp = 0x8006C0B4 - sp = 0x8006B6C4 - s8 = 0x801FFFF8 - ra = 0x80060AD4
hi = 0x80082780 - lo = 0x00000000
=== halting ===

If it can help, I checked the 0x80082780 address and it is part of one of the two obfuscated LibCrypt sections in Spyro. The obfuscated value at this address is translated from 0x7bf553ff to 0x080209e4 corresponding to the instruction j 0x80082790. But this jump instruction doesn't seem to work when it is executed.

@lorn10
Copy link

lorn10 commented Jul 29, 2023

A new addition. It looks that this bug is still present. 😞

I am now on PCSX-Redux eaf8ae7 and I can confirm this issue when the normal interpreter is used. This does not happen with the dynarec and is reproducible also on the Windows build PCSX-Redux 15686 (via Wine).

It doesn't matter if a stock BIOS or the PSX OpenBIOS is used. The only difference between the Windows and Linux build is that the game runs on Linux far to fast after the Sony / PSX logo. (Does not happen with dynarec.)

Note, when I let the game to go into the demo mode it crashes reproducible with an Unrecoverable error while running recompiler Program counter: 8007D5F4 message.

@marcovoc
Copy link
Contributor

The game on my side since my fix don't crash anymore before the main menu.
But still crash when launching the demo, or when loading a level other than Glimmer or Summer forest hub. But for what i have understand it's more related to bad data read from cd.
So this issue is fixed and another one is created (#1784).

@lorn10
Copy link

lorn10 commented Oct 20, 2024

I can confirm that the problem seems to be resolved. So I am able to enter the game properly with the normal interpreter as well as with the dynarec interpreter. Great work @marcovoc! 👍

And also in my case it is not possible to load a level from the memory card. It always crashes shortly after selecting that option. So I am hitting also #1784. (But my ISO dump is definitely fine. I have made it at my own from an original CD which is in a very good condition.)

However, on Kubuntu 22.04 LTS the game runs at the beginning after the Sony / PSX logo still clearly too fast. And that is now the case for both interpreter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants