Originally posted by Kazeshin
im not too sure, but i would try giving the 0x06 command length byte 0x0C and jumping back with 07 04 00 00, since the jumps use some sort of stack and you could mess with it, the way you were doing it.
Nothing changed, still gives the same results. I tried moving commands around, no change. I tried using different RAM segments, but they all ended up at 0x800EA110. I am probably going to use the 0x0C segment as a temporary loading segment, since I don't need to keep the data after the level has loaded.
It's most likely the 0x11 command (in combination with my ASM code) that is doing something to make the game reset back to the title screen. If I remove the command from the segment, then the game works fine.
I used queueRAM's n64split program to find the assembly code for the 0x11 command. It looks like that it does a bit more than just calling an ASM function, can you take a guess on what the function does?
# begin 8037EA98 (0FB818)
LevelCommand_11:
addiu $sp, $sp, -0x20
sw $ra, 0x14($sp)
lw $t6, 0x8038be28 # lui $t6, 0x8039/lw $t6, -0x41d8($t6)
lw $t7, 4($t6)
sw $t7, 0x1c($sp)
lw $t9, 0x1c($sp)
lw $t8, 0x8038be28 # lui $t8, 0x8039/lw $t8, -0x41d8($t8)
lw $a1, 0x8038be24 # lui $a1, 0x8039/lw $a1, -0x41dc($a1)
jalr $t9
lh $a0, 2($t8)
lui $at, 0x8039
sw $v0, -0x41dc($at)
lw $t0, 0x8038be28 # lui $t0, 0x8039/lw $t0, -0x41d8($t0)
lui $at, 0x8039
lbu $t1, 1($t0)
addu $t2, $t0, $t1
sw $t2, -0x41d8($at)
b LLevelCommand_11_5C
nop
LLevelCommand_11_5C: # 8037EAF4
lw $ra, 0x14($sp)
addiu $sp, $sp, 0x20
jr $ra
nop
# end LevelCommand_11 8037EB04 (0FB884)
LevelCommand_11:
addiu $sp, $sp, -0x20
sw $ra, 0x14($sp)
lw $t6, 0x8038be28 # lui $t6, 0x8039/lw $t6, -0x41d8($t6)
lw $t7, 4($t6)
sw $t7, 0x1c($sp)
lw $t9, 0x1c($sp)
lw $t8, 0x8038be28 # lui $t8, 0x8039/lw $t8, -0x41d8($t8)
lw $a1, 0x8038be24 # lui $a1, 0x8039/lw $a1, -0x41dc($a1)
jalr $t9
lh $a0, 2($t8)
lui $at, 0x8039
sw $v0, -0x41dc($at)
lw $t0, 0x8038be28 # lui $t0, 0x8039/lw $t0, -0x41d8($t0)
lui $at, 0x8039
lbu $t1, 1($t0)
addu $t2, $t0, $t1
sw $t2, -0x41d8($at)
b LLevelCommand_11_5C
nop
LLevelCommand_11_5C: # 8037EAF4
lw $ra, 0x14($sp)
addiu $sp, $sp, 0x20
jr $ra
nop
# end LevelCommand_11 8037EB04 (0FB884)