box86 icon indicating copy to clipboard operation
box86 copied to clipboard

La-Mulana runs on RP Flip 2 only if dynarec is disabled

Open ben-willmore opened this issue 9 months ago • 3 comments

Thanks for your previous help with La-Mulana, it now works great on other platforms. On RP Flip2 (rocknix), it fails to launch with dynarec active. Without dynarec it works but very slowly. Using BOX86_NODYNAREC and binary search I narrowed the problem down to a single address(!), so it runs fine with BOX86_NODYNAREC=0x083aa402-0x083aa403.

Here is the info I have gathered so far:

BOX86_DYNAREC_TEST: No output (surprisingly to me)

BOX86_NODYNAREC=0x083aa402-0x083aa403: Game works!

BOX86_DYNAREC_DUMP: 
Last block is:
101029|Emitting 392 bytes for 106 x86 bytes ( => /storage/roms/ports/la-mulana/gamedata/LaMulana.bin.x86/main + 163)
0x81da223: 89 3C 24  MOV Ed, Gd
0xf61120d4: 1 emited opcodes, inst=0, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/0
	e588b000	STR r11, [r8, #0]
0x81da226: 8D BC 24 20 08 00 00  LEA Gd, Ed
0xf61120d8: 2 emited opcodes, inst=1, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=0
	e3002820	MOVW r2, #0x820
	e088b002	ADD r11, r8, r2
0x81da22d: C7 44 24 04 FE D5 3F 08  MOV Ed, Id
0xf61120e0: 3 emited opcodes, inst=2, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=1
	e30d35fe	MOVW r3, #0xd5fe
	e340383f	MOVT r3, #0x83f
	e5883004	STR r3, [r8, #4]
0x81da235: A3 D4 6D 9A 08  MOV Od, EAX
0xf61120ec: 3 emited opcodes, inst=3, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=2
	e3062dd4	MOVW r2, #0x6dd4
	e340289a	MOVT r2, #0x89a
	e5824000	STR r4, [r2, #0]
0x81da23a: A1 C0 A4 44 08  MOV EAX, Od
0xf61120f8: 3 emited opcodes, inst=4, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=3
	e30a24c0	MOVW r2, #0xa4c0
	e3402844	MOVT r2, #0x844
	e5924000	LDR r4, [r2, #0]
0x81da23f: 89 44 24 08  MOV Ed, Gd
0xf6112104: 1 emited opcodes, inst=5, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=4
	e5884008	STR r4, [r8, #8]
0x81da243: E8 20 6C EE FF  CALL Id (=> /storage/roms/ports/la-mulana/gamedata/LaMulana.bin.x86/longjmp@@GLIBC_2.0 + 416)
0xf6112108: 28 emited opcodes, inst=6, barrier=3 state=17/0(0), set=3F/0, use=0, need=0/0 sm=0/1, pred=5
	e30a2248	MOVW r2, #0xa248
	e340281d	MOVT r2, #0x81d
	e5282004	STR r2, [r8, #-4]!
Native Call to freopen64 (/usr/lib32/libc.so.6) (retn=0)
	e300e9db	MOVW LR, #0x9db
	e344e005	MOVT LR, #0x4005
	e1a0300e	MOV r3, LR
	e30b187c	MOVW r1, #0xb87c
	e34f178a	MOVT r1, #0xf78a
	e8805ff0	STM r0, {r4-r12, LR}
	e92d0009	STMFD {r0, r3}
	e30c36a0	MOVW r3, #0xc6a0
	e3463297	MOVT r3, #0x6297
	e12fff33	BLX r3
	e8bd0009	LDMEA {r0, r3}
	e8905ff0	LDM r0, {r4-r12, LR}
	e15e0003	CMP LR, r3
	1a000007	BNE +9
	e498e004	LDR LR, [r8], #4
	e30a3248	MOVW r3, #0xa248
	e340381d	MOVT r3, #0x81d
	e15e0003	CMP LR, r3
	1a000002	BNE +4
	e59012a8	LDR r1, [r0, #680]
	e3510001	CMP r1, #0x1
	1a000002	BNE +4
Jump to epilog
	e30524d0	MOVW r2, #0x54d0
	e34622b6	MOVT r2, #0x62b6
	e12fff12	BX r2
0x81da248: C7 44 24 0C ED 89 3D 08  MOV Ed, Id
0xf6112178: 3 emited opcodes, inst=7, barrier=3 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/0, pred=6
	e30839ed	MOVW r3, #0x89ed
	e340383d	MOVT r3, #0x83d
	e588300c	STR r3, [r8, #12]
0x81da250: C7 44 24 08 F5 89 3D 08  MOV Ed, Id
0xf6112184: 3 emited opcodes, inst=8, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=7
	e30839f5	MOVW r3, #0x89f5
	e340383d	MOVT r3, #0x83d
	e5883008	STR r3, [r8, #8]
0x81da258: C7 44 24 04 80 00 00 00  MOV Ed, Id
0xf6112190: 2 emited opcodes, inst=9, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=8
	e3003080	MOVW r3, #0x80
	e5883004	STR r3, [r8, #4]
0x81da260: 89 3C 24  MOV Ed, Gd
0xf6112198: 1 emited opcodes, inst=10, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=9
	e588b000	STR r11, [r8, #0]
0x81da263: A3 D4 6D 9A 08  MOV Od, EAX
0xf611219c: 3 emited opcodes, inst=11, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=10
	e3062dd4	MOVW r2, #0x6dd4
	e340289a	MOVT r2, #0x89a
	e5824000	STR r4, [r2, #0]
0x81da268: E8 1B 72 EE FF  CALL Id (=> /storage/roms/ports/la-mulana/gamedata/LaMulana.bin.x86/longjmp@@GLIBC_2.0 + 1984)
0xf61121a8: 28 emited opcodes, inst=12, barrier=3 state=17/0(0), set=3F/0, use=0, need=0/0 sm=0/1, pred=11
	e30a226d	MOVW r2, #0xa26d
	e340281d	MOVT r2, #0x81d
	e5282004	STR r2, [r8, #-4]!
Native Call to my2_SDL_snprintf (/roms/ports/la-mulana/gamedata/LaMulana.bin.x86) (retn=0)
	e300e39b	MOVW LR, #0x39b
	e344e003	MOVT LR, #0x4003
	e1a0300e	MOV r3, LR
	e3001d84	MOVW r1, #0xd84
	e346129d	MOVT r1, #0x629d
	e8805ff0	STM r0, {r4-r12, LR}
	e92d0009	STMFD {r0, r3}
	e30239dc	MOVW r3, #0x29dc
	e3463298	MOVT r3, #0x6298
	e12fff33	BLX r3
	e8bd0009	LDMEA {r0, r3}
	e8905ff0	LDM r0, {r4-r12, LR}
	e15e0003	CMP LR, r3
	1a000007	BNE +9
	e498e004	LDR LR, [r8], #4
	e30a326d	MOVW r3, #0xa26d
	e340381d	MOVT r3, #0x81d
	e15e0003	CMP LR, r3
	1a000002	BNE +4
	e59012a8	LDR r1, [r0, #680]
	e3510001	CMP r1, #0x1
	1a000002	BNE +4
Jump to epilog
	e30524d0	MOVW r2, #0x54d0
	e34622b6	MOVT r2, #0x62b6
	e12fff12	BX r2
0x81da26d: C7 44 24 0C 02 00 00 00  MOV Ed, Id
0xf6112218: 2 emited opcodes, inst=13, barrier=3 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/0, pred=12
	e3003002	MOVW r3, #0x2
	e588300c	STR r3, [r8, #12]
0x81da275: 89 7C 24 08  MOV Ed, Gd
0xf6112220: 1 emited opcodes, inst=14, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=13
	e588b008	STR r11, [r8, #8]
0x81da279: C7 44 24 04 E0 01 00 00  MOV Ed, Id
0xf6112224: 2 emited opcodes, inst=15, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=14
	e30031e0	MOVW r3, #0x1e0
	e5883004	STR r3, [r8, #4]
0x81da281: C7 04 24 80 02 00 00  MOV Ed, Id
0xf611222c: 2 emited opcodes, inst=16, barrier=0 state=0/0(0), set=0/0, use=0, need=0/0 sm=0/1, pred=15
	e3003280	MOVW r3, #0x280
	e5883000	STR r3, [r8, #0]
0x81da288: E8 23 9C 03 00  CALL Id (=> /storage/roms/ports/la-mulana/gamedata/LaMulana.bin.x86/_ZN3kog15SDLCreateWindowEiiPKcj)
0xf6112234: 10 emited opcodes, inst=17, barrier=0 state=17/0(0), set=3F/0, use=0, need=0/0 sm=0/1, pred=16
	e30a228d	MOVW r2, #0xa28d
	e340281d	MOVT r2, #0x81d
	e5282004	STR r2, [r8, #-4]!
Jump to next
	e3092ac8	MOVW r2, #0x9ac8
	e34f25ce	MOVT r2, #0xf5ce
	e303eeb0	MOVW LR, #0x3eb0
	e340e821	MOVT LR, #0x821
	e5923000	LDR r3, [r2, #0]
	e1a0100e	MOV r1, LR
	e12fff13	BX r3
---- END OF BLOCK ---- (18)

gdb:
(gdb) break SDL_CreateWindow
(gdb) run
Breakpoint 1, 0xf7a92f7c in SDL_CreateWindow ()
   from /usr/lib32/libSDL2-2.0.so.0
(gdb) step
Single stepping until exit from function SDL_CreateWindow,
which has no line number information.
[New Thread 0xf491c160 (LWP 100072)]
[New Thread 0xf411b160 (LWP 100073)]
[New Thread 0xf31ff160 (LWP 100074)]
[New Thread 0xf29fe160 (LWP 100075)]
[New Thread 0xf19ff160 (LWP 100076)]
[New Thread 0xf0dfe160 (LWP 100077)]

Thread 1 "LaMulana.bin.x8" received signal SIGSEGV, Segmentation fault.
0xf6732e70 in ?? ()
(gdb) bt
#0  0xf6732e70 in ?? ()
#1  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

ben-willmore avatar May 02 '25 06:05 ben-willmore

I would need the dump of the block the contains 0x083aa402.

ptitSeb avatar May 02 '25 10:05 ptitSeb

I haven't managed to identify the right block so far but perhaps I am just not seeing it

dump.zip

ben-willmore avatar May 02 '25 14:05 ben-willmore

the dump doesn't seems to include the address you need to exclude, wich is a bit strange.

ptitSeb avatar May 02 '25 15:05 ptitSeb