Senryoku / Deecy

Experimental Dreamcast emulator written in Zig
3 stars 0 forks source link

Metropolis Street Racer crashes after intro cutscene #43

Closed Senryoku closed 2 weeks ago

Senryoku commented 1 month ago

Interpreter doesn't help.

panic_debug: PC: 8C14655E
Invalid _get_memory @1C60E73C
thread 16180 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 commented 1 month ago

Just ignoring the faulty write seems to work... (9d5882368dbf9aef69afdc419209711b8afedf89 and 8a5fc4e7ff2da870025f9b62a8e3486e1a09190f) The current GDROM DMA timings prevents from going in game. Simply reducing this delay: https://github.com/Senryoku/Deecy/blob/329e3fc04282b5a47f7647b225664746e6427d9e/src/dreamcast.zig#L601 is enough to go further into the menus and crash on something unrelated.