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

Legacy of Kain - Soul Reaver immediate crash #51

Closed
Senryoku opened this issue Aug 4, 2024 · 2 comments
Closed

Legacy of Kain - Soul Reaver immediate crash #51

Senryoku opened this issue Aug 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Senryoku
Copy link
Owner

Senryoku commented Aug 4, 2024

PC: 0C012156
Invalid _get_memory @1C3032D0
thread 24536 panic: Invalid _get_memory @{X:0>8}

Looks similar to #43. Interpreter doesn't help.

panic_debug: PC: 8C012172
Invalid _get_memory @1C3032D0
thread 11612 panic: Invalid _get_memory @{X:0>8}
H:\Source\Deecy\src\sh4.zig:867:9: 0x1a26f45 in panic_debug__anon_12735 (Deecy.exe.lto.obj)
        @panic(fmt);
        ^
H:\Source\Deecy\src\sh4_interpreter.zig:132:56: 0x1a8c59e in movl_Rm_atRn (Deecy.exe.lto.obj)
    cpu.write32(cpu.R(opcode.nmd.n).*, cpu.R(opcode.nmd.m).*);
                                                       ^
H:\Source\Deecy\src\dreamcast.zig:439:40: 0x1a2736d in tick (Deecy.exe.lto.obj)
        const cycles = self.cpu.execute(max_instructions);
                                       ^
H:\Software\zig\0.13.0-dev.351+64ef45eb0\files\lib\std\Thread.zig:518:30: 0x1b4ddda in entryFn (Deecy.exe.lto.obj)
                return callFn(f, self.fn_args);
@Senryoku Senryoku added the bug Something isn't working label Aug 4, 2024
@Senryoku
Copy link
Owner Author

Senryoku commented Aug 9, 2024

CPU Trace:

[8C012146] 1001000101001010 mov.w @(74,PC),R1    R1 =8C2C3F10, R4 =8C0596C0, T=1, Q=0, M=0
[8C012146]             914A                      R1 =00002060, R4 =8C0596C0, T=1, Q=0, M=0
[8C012148] 0110001100100010 mov.l @R2,R3         R3 =8C2C9720, R2 =8C2C9720, T=1, Q=0, M=0
[8C012148]             6322                      R3 =8C2C3AB0, R2 =8C2C9720, T=1, Q=0, M=0
[8C01214A] 1001001001001000 mov.w @(72,PC),R2    R2 =8C2C9720, R4 =8C0596C0, T=1, Q=0, M=0
[8C01214A]             9248                      R2 =00002060, R4 =8C0596C0, T=1, Q=0, M=0
[8C01214C] 0000110100011010 sts MACL,R13         R13=544F4853, R1 =00002060, T=1, Q=0, M=0
[8C01214C]              D1A                      R13=00000000, R1 =00002060, T=1, Q=0, M=0
[8C01214E] 0011001000111100 add R3,R2            R2 =00002060, R3 =8C2C3AB0, T=1, Q=0, M=0
[8C01214E]             323C                      R2 =8C2C5B10, R3 =8C2C3AB0, T=1, Q=0, M=0
[8C012150] 0000111010110111 mul.l R11,R14        R14=00000000, R11=00000350, T=1, Q=0, M=0
[8C012150]              EB7                      R14=00000000, R11=00000350, T=1, Q=0, M=0
[8C012152] 0011001011011100 add R13,R2           R2 =8C2C5B10, R13=00000000, T=1, Q=0, M=0
[8C012152]             32DC                      R2 =8C2C5B10, R13=00000000, T=1, Q=0, M=0
[8C012154] 0000001011000110 mov.l R12,@(R0,R2)   R2 =8C2C5B10, R12=4D545350, T=1, Q=0, M=0
[8C012154]              2C6                      R2 =8C2C5B10, R12=4D545350, T=1, Q=0, M=0
[8C012156] 0110001101000010 mov.l @R4,R3         R3 =8C2C3AB0, R4 =8C0596C0, T=1, Q=0, M=0
[8C012156]             6342                      R3 =8C2C9720, R4 =8C0596C0, T=1, Q=0, M=0
[8C012158] 0110001000110010 mov.l @R3,R2         R2 =8C2C5B10, R3 =8C2C9720, T=1, Q=0, M=0
[8C012158]             6232                      R2 =8C2C3AB0, R3 =8C2C9720, T=1, Q=0, M=0
[8C01215A] 0110001111110011 mov R15,R3           R3 =8C2C9720, R15=8C00F38C, T=1, Q=0, M=0
[8C01215A]             63F3                      R3 =8C00F38C, R15=8C00F38C, T=1, Q=0, M=0
[8C01215C] 0100001100001000 shll2 R3             R3 =8C00F38C, R0 =00000064, T=1, Q=0, M=0
[8C01215C]             4308                      R3 =3003CE30, R0 =00000064, T=1, Q=0, M=0
[8C01215E] 0011000100101100 add R2,R1            R1 =00002060, R2 =8C2C3AB0, T=1, Q=0, M=0
[8C01215E]             312C                      R1 =8C2C5B10, R2 =8C2C3AB0, T=1, Q=0, M=0
[8C012160] 1001001000111110 mov.w @(62,PC),R2    R2 =8C2C3AB0, R3 =3003CE30, T=1, Q=0, M=0
[8C012160]             923E                      R2 =00000290, R3 =3003CE30, T=1, Q=0, M=0
[8C012162] 0011110100011100 add R1,R13           R13=00000000, R1 =8C2C5B10, T=1, Q=0, M=0
[8C012162]             3D1C                      R13=8C2C5B10, R1 =8C2C5B10, T=1, Q=0, M=0
[8C012164] 0010110111100000 mov.b R14,@R13       R13=8C2C5B10, R14=00000000, T=1, Q=0, M=0
[8C012164]             2DE0                      R13=8C2C5B10, R14=00000000, T=1, Q=0, M=0
[8C012166] 0110000001000010 mov.l @R4,R0         R0 =00000064, R4 =8C0596C0, T=1, Q=0, M=0
[8C012166]             6042                      R0 =8C2C9720, R4 =8C0596C0, T=1, Q=0, M=0
[8C012168] 0000110100011010 sts MACL,R13         R13=8C2C5B10, R1 =8C2C5B10, T=1, Q=0, M=0
[8C012168]              D1A                      R13=00000000, R1 =8C2C5B10, T=1, Q=0, M=0
[8C01216A] 0101000000000001 mov.l @(1,R0),R0     R0 =8C2C9720, R0 =8C2C9720, T=1, Q=0, M=0
[8C01216A]             5001                      R0 =8C2C6210, R0 =8C2C6210, T=1, Q=0, M=0
[8C01216C] 0011000011011100 add R13,R0           R0 =8C2C6210, R13=00000000, T=1, Q=0, M=0
[8C01216C]             30DC                      R0 =8C2C6210, R13=00000000, T=1, Q=0, M=0
[8C01216E] 0011001000001100 add R0,R2            R2 =00000290, R0 =8C2C6210, T=1, Q=0, M=0
[8C01216E]             320C                      R2 =8C2C64A0, R0 =8C2C6210, T=1, Q=0, M=0
[8C012170] 0011001100101100 add R2,R3            R3 =3003CE30, R2 =8C2C64A0, T=1, Q=0, M=0
[8C012170]             332C                      R3 =BC3032D0, R2 =8C2C64A0, T=1, Q=0, M=0
[8C012172] 0010001101010010 mov.l R5,@R3         R3 =BC3032D0, R5 =00000000, T=1, Q=0, M=0
panic_debug: PC: 8C012172
Invalid _get_memory @1C3032D0
thread 17668 panic: Invalid _get_memory @{X:0>8}

With a small hack redirecting the write from BC3032D0 to 0C3032D0 the game goes a little bit further (intros play, mostly black menu and Software Reset on start), but this is obviously not a fix.

(Note: I think the writes to 0xBC... only happens in the PAL version)

@Senryoku
Copy link
Owner Author

Senryoku commented Oct 23, 2024

Trace showing a jump to 0x000000000 (leading to the software reset): SR.txt

It's searching for the end of the string "acDmaResume - DMA handler not installed" before crashing, don't know how relevant that is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant