1 ; This is the ucode used to "unlock" memcards
2 ; RE purely out of interest, and hunch that it does trickies
20 halt ; Exception 0-6 nop slide to here
37 ; 0xdcd10000 is the init mail
38 call wait_for_dsp_mbox
42 ; Wait for cpu to say "go!" - i think
44 call wait_for_cpu_mbox
47 jnz wait_for_start_cmd
49 dma_dram_and_prepare_for_crazy_irom_func:
50 call wait_for_cpu_mbox
52 lrs $AC0.L, @CMBL ; main ram addr.l
53 andi $AC0.M, #0x0fff ; main ram addr.h & 0x0fff
54 lri $AX0.L, #0x0400 ; dsp addr
55 lri $AX0.H, #0x0010 ; length (bytes)
56 lri $AX1.L, #0x0000 ; dsp dram to cpu
59 call IROM_BASE+0x0644; holy mother of jesus that func is gonna be hard
61 ; 0xdcd10003 means finished unlocking?
62 call wait_for_dsp_mbox
67 call wait_for_cpu_mbox
69 jnz dma_dram_and_prepare_for_crazy_irom_func
74 jz IROM_BASE ; End of this ucode, wait for a new one
75 jmp dma_dram_and_prepare_for_crazy_irom_func
76 halt ; Prolly never reached
78 ; 10 mails from cpu then irom func - looks interesting
81 call wait_for_cpu_mbox
83 call wait_for_cpu_mbox
85 call wait_for_cpu_mbox
87 call wait_for_cpu_mbox
91 call wait_for_cpu_mbox
93 call wait_for_cpu_mbox
95 call wait_for_cpu_mbox
97 call wait_for_cpu_mbox
101 call wait_for_cpu_mbox
103 call wait_for_cpu_mbox
107 jmp IROM_BASE+0x00b5; IROM - can dma stuff
112 andcf $AC1.M, #0x8000
113 jlz wait_for_dsp_mbox
118 andcf $AC1.M, #0x8000
119 jlnz wait_for_cpu_mbox
130 andcf $AC0.M, #0x0004
134 ; Trailing nops...pad to 32bytes
150 ; uCode is 0xb0 words