n64decomp/mk64

ROM built with mips64-elf toolchain crashes mupen64plus

Tatsh opened this issue · 7 comments

Tatsh commented

This is with latest build and fixed based on what I surmised in #14

Core: Goodname: MARIOKART64 (unknown rom)
Core: Name: MARIOKART64
Core: MD5: 6A644C475DFD19B56F86B59979819484
Core: CRC: 3E505A64 9626FBEE
Core: Imagetype: .z64 (native)
Core: Rom size: 12582912 bytes (or 12 Mb or 96 Megabits)
Core: Version: 1446
Core: Manufacturer: Nintendo
Core: Country: USA
UI-Console Status: Cheat codes disabled.
UI-Console: using Video plugin: 'GLideN64 rev.' v2.0.0
UI-Console: using Audio plugin: 'Mupen64Plus SDL Audio Plugin' v2.5.9
UI-Console: using Input plugin: 'Mupen64Plus raphnetraw Input Plugin' v1.1.0
UI-Console: using RSP plugin: 'Hacktarux/Azimer High-Level Emulation RSP Plugin' v2.5.9
Core: input plugin did not specify a render callback; there will be no on screen display by the input plugin.
Start listing
Hid enumerate returned NULL
Input Error: No adapters detected

RSP: RSP Fallback disabled !
Core Status: Selected state slot: 6
Core: Using video capture backend: dummy
Core: Game controller 0 (Standard controller) has nothing plugged in
Core: Game controller 1 (Standard controller) has nothing plugged in
Core: Game controller 2 (Standard controller) has nothing plugged in
Core: Game controller 3 (Standard controller) has nothing plugged in
Core: Using CIC type X102
Core: Setting video mode: 3840x2160
[New Thread 0x7fffc4110640 (LWP 1834917)]
[New Thread 0x7fffc390f640 (LWP 1834918)]
[New Thread 0x7fffc310e640 (LWP 1834919)]
[New Thread 0x7fffc290d640 (LWP 1834920)]
[New Thread 0x7fffc210c640 (LWP 1834921)]
[New Thread 0x7fffc190b640 (LWP 1834922)]
[New Thread 0x7fffc110a640 (LWP 1834923)]
[New Thread 0x7fffc0909640 (LWP 1834924)]
[New Thread 0x7fffc0108640 (LWP 1834925)]
[Thread 0x7fffc390f640 (LWP 1834918) exited]
[Thread 0x7fffc4110640 (LWP 1834917) exited]
[Thread 0x7fffc190b640 (LWP 1834922) exited]
[Thread 0x7fffc0909640 (LWP 1834924) exited]
[Thread 0x7fffc210c640 (LWP 1834921) exited]
[Thread 0x7fffc110a640 (LWP 1834923) exited]
[Thread 0x7fffc290d640 (LWP 1834920) exited]
[Thread 0x7fffc310e640 (LWP 1834919) exited]
[Thread 0x7fffc0108640 (LWP 1834925) exited]
Audio: Using resampler speex
[New Thread 0x7fffc0108640 (LWP 1834935)]
[New Thread 0x7fffcdc21640 (LWP 1834936)]
Audio: Initializing SDL audio subsystem...
[New Thread 0x7fffc0909640 (LWP 1834937)]
Core Warning: OSD not compatible with OpenGL core context. OSD deactivated.
Core: Initializing 4 RDRAM modules for a total of 8 MB
Core: Starting R4300 emulator: Dynamic Recompiler

Thread 1 "mupen64plus" received signal SIGSEGV, Segmentation fault.
0x00007ffff1fc1736 in cart_rom_dma_write (opaque=0x7ffff70a98b8 <g_dev+19407896>, dram=0x7fffd17ee010 "\r\200\032<\300\021Z'\b", dram_addr=4294967288, cart_addr=<optimized out>,
    length=6160) at ../../src/device/cart/cart_rom.c:97
97      ../../src/device/cart/cart_rom.c: No such file or directory.
(ins)(gdb) bt
#0  0x00007ffff1fc1736 in cart_rom_dma_write (opaque=0x7ffff70a98b8 <g_dev+19407896>, dram=0x7fffd17ee010 "\r\200\032<\300\021Z'\b", dram_addr=4294967288,
    cart_addr=<optimized out>, length=6160) at ../../src/device/cart/cart_rom.c:97
#1  0x00007ffff1fdff3f in dma_pi_write (pi=0x7ffff6f28fc0 <g_dev+17832736>) at ../../src/device/rcp/pi/pi_controller.c:100
#2  write_pi_regs (opaque=0x7ffff6f28fc0 <g_dev+17832736>, address=<optimized out>, value=<optimized out>, mask=<optimized out>) at ../../src/device/rcp/pi/pi_controller.c:164
#3  0x00007ffff1fdf221 in mem_write32 (handler=<optimized out>, handler=<optimized out>, mask=4294967295, value=6159, address=<optimized out>)
    at ../../src/device/memory/memory.h:87
#4  r4300_write_aligned_word (r4300=0x7ffff5e274a0 <g_dev>, address=<optimized out>, value=6159, mask=4294967295) at ../../src/device/r4300/r4300_core.c:353
#5  0x00007fffc329a984 in ?? ()
#6  0x00007ffff5e274a0 in ?? () from /usr/lib64/libmupen64plus.so.2
#7  0x00007ffff1fdf221 in mem_write32 (handler=<optimized out>, handler=<optimized out>, mask=0, value=4125259424, address=<optimized out>) at ../../src/device/memory/memory.h:87
#8  r4300_write_aligned_word (r4300=0x7ffff1ff6200 <dynarec_write_aligned_word>, address=<optimized out>, value=4125259424, mask=0) at ../../src/device/r4300/r4300_core.c:353
#9  0x00007ffff5e274a0 in ?? () from /usr/lib64/libmupen64plus.so.2
#10 0x0000000000000000 in ?? ()
Tatsh commented

Confirmed it's not caused by the input plugin I am using.

If the command prompt says "ok" after building then this issue is not relevant to this repo.

I use mupen version 1.01 from feb 10 2021.

../src/device/cart/cart_rom.c: No such file or directory.
It sounds like you did not build mupen correctly.

Tatsh commented

That line is like that because I'm on Gentoo and it does not keep the source around unfortunately after building.

My build output has this issue:

build/us/mk64.us.z64: FAILED
sha1sum: WARNING: 1 computed checksum did NOT match
make: *** [Makefile:163: all] Error 1

I'm using mips64-elf crossdev environment built with Gentoo's crossdev tool. I built qemu-irix from source as well.

Try deleting the project and re-downloading or
make clean
make distclean
make -C tools
and then run make again. (use make -j4) for faster compile if you have 4 cpu cores.

If that doesn't work what does python3 first-diff.py output?

Tatsh commented
 $ python3 first-diff.py
Assuming version us
First difference at ROM addr 0x92814, in func_80091B78 (ram 0x80091b78, rom 0x092778, build/us/asm/code_80091750.o)
Bytes: 24:a5:84:cd vs 24:a5:84:d0
Instruction difference at ROM addr 0x825800, in data_825800 (ram 0x0c008d80, rom 0x8257fd, build/us/data/data_825800.o)
Bytes: 30:00:00:94 vs 4d:49:4f:30
Tons of differences, must be a shifted ROM.
To find ROM shifts, copy a clean .map file to mk64.us.map and rerun this script.

Are you able to join the Discord server?

Make sure you're using the US version of mk64. Only unmodified .z64 files will work with the repo. Try git clone into a new folder that has not been used with a repo before. Do not modify any repo files prior to building.

Tatsh commented

Issue to do with toolchain and alignment.