I'm trying to make an ASM hack for the N64 that involves DMA. I just recently learned about DMA and so I'm just messing around and trying to get the hang of it. Unfortunately some very basic code that involves 2 almost-consecutive DMAs doesn't work, and crashes the emulator I'm using (Nemu). I've been unable to find a good tutorial online that fixes my problem so I hope somebody here has the expertise.
My code is for Super Smash 64, what I'm trying to do specifically isn't really relevant as I'm just testing stuff right now.
Here is my code:
JUMP OUT:
34C98 J 0x803A0000
34C9C NOP
NEW CODE:
3A0000 LUI k1,0x1022
4 ORI k1,k1,0xDDCC
8 BNE t6,k1,0x803A003C
C NOP
10 ORI k1,r0,0x03FF
4 SW k1,0x000C(t0)
8 NOP
C SW k1,0x0010(t0)
20 LW k1,0x0010(t0)
4 BNE k1,r0,-1
8 NOP
C LUI k1,0x8004
30 ORI k1,k1,0x3974
4 SW k1,0x0000(t0)
8 LUI k1,0x1022
C ORI k1,k1,0xDF48
40 SW k1,0x0004(t0)
4 ORI t9,r0,0x0007
8 J 0x80034CB8
C SW t9,0x000C(t0)