kanyun157 / psxjin

Automatically exported from code.google.com/p/psxjin
0 stars 0 forks source link

Ape Escape Black Screen/Freezes On Intro #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Starting the game 
2. Waiting for the game to load
3. No response from the game, works fine on other emulators

What is the expected output? What do you see instead?

I expect the game to start normally like on other emulators, but that is not 
the case, as the game loads up to the "This game requires Dualshock to work 
properly" screen, and  after that the game screen goes black and doesnt 
finishing loading the intro, rather it freezes. Game works fine on other 
emulators.

What version of the product are you using? On what operating system?

V2.0.2 Win 7 x64

Please provide any additional information below.

Original issue reported on code.google.com by aget...@gmail.com on 9 Jul 2013 at 10:45

GoogleCodeExporter commented 9 years ago
This is due to some weird behaviour in the game itself; namely that it performs 
a 0-sized CDROM DMA (and expects it to transfer something!). To elaborate:

The game correctly locates a file on disc (DEMO/TITLE.ALL;1), commands the 
CDROM to read it, and then performs a 0-sized CDROM DMA (ie. it writes 
0x00010000 to D3_BCR) to read the file's header. From this it expects to see at 
least 0x24B of data at the desired address, which it then uses to find the size 
of the file. Since this is (incorrectly) all 0 bytes, it reads a size of 0,
and the loader routine fails due to underflowing the size, causing it to try to 
load 4GB of data into the PSX memory.

On real PSX hardware, performing such a 0-sized CDROM (or OTC) DMA causes it to 
read 0x10000 words (0x40000B), not 0! The data after the sector is padded with 
a byte from the first sector (see the attached patch). This has been verified 
on real hardware.

Attached is a patch (against latest SVN trunk (r722)) which correctly emulates 
this behaviour, making Ape Escape work correctly.

This might fix other games too, and hopefully won't break any others...

Thanks to Martin Korth (nocash.emubase.de) for finding out the behaviour of 
these DMAs on real hardware!

Original comment by tiber...@gmail.com on 6 Aug 2013 at 12:33

Attachments:

GoogleCodeExporter commented 9 years ago
I should mention that this 0-sized DMA seems to be due to a bug in the game 
itself; it should be setting the amount of data to DMA for the last sector in 
the loading routine's callback to 0x800, not 0.

Also, there are some obvious sound issues, for which turning the sound to mono 
in the in-game options seems to help.

Original comment by tiber...@gmail.com on 6 Aug 2013 at 12:45

GoogleCodeExporter commented 9 years ago
Fixed in r725.

Original comment by tiber...@gmail.com on 24 Oct 2013 at 9:27

GoogleCodeExporter commented 9 years ago
how do you patch this??

Original comment by MatthewD...@gmail.com on 7 Jul 2014 at 6:13

GoogleCodeExporter commented 9 years ago
what do you actually do with that patch? i have this issue

Original comment by MatthewD...@gmail.com on 7 Jul 2014 at 6:13