Project

General

Profile

Emulator Issues #12438

AD16 implementation is incorrect

Added by pokechu22 about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name?

GameCube IPL.

What's the problem? Describe what went wrong.

Dolphin's implementation of the AD16 is incorrect. The AD16Reg union is defined as union AD16Reg { u32 U32 = 0; u32 U8[4]; }; but it needs to be union AD16Reg { u32 U32 = 0; u8 U8[4]; }; as the U8 field is intended to access data one byte at a time. Due to this incorrect implementation, the init code returns 00000000 instead of 04120000, and the AD16 is not detected.

However, note that if this is fixed, the IPL will fail to start, because BS1 performs a memory test that overwrites the entirety of memory (including BS1). On hardware, it boots from fff00100, which is mapped to an EXI transfer (and this only works with the de-scrambling due to icache). Since dolphin instead loads it into memory at 81200000, the data is clobbered (and icache doesn't seem to save it for some reason). (Note also that BS1 loads BS2, so dolphin has no reason to load BS2 itself.)

I have the start of a set of changes to fix this, but since I've got no idea when I'll be done with then, I figured I'd report this just so that it's documented.

Is the issue present in the latest development version?

Yes, 5.0-13698.

Is the issue present in the latest stable version?

Based on code only, it should also be present in 5.0 (and in fact since the initial megacommit).

Also available in: Atom PDF