@* See COPYING file in the top-level directory.
@*
-.global ssp_drc_entry
-.global ssp_drc_next
-.global ssp_drc_next_patch
-.global ssp_drc_end
-.global ssp_hle_800
-.global ssp_hle_902
-.global ssp_hle_07_030
-.global ssp_hle_07_036
-.global ssp_hle_07_6d6
-.global ssp_hle_11_12c
-.global ssp_hle_11_384
-.global ssp_hle_11_38a
+#include "../../arm_features.h"
+.syntax unified
.text
.align 2
+@ externals
+#define cache_flush_d_inval_i ESYM(cache_flush_d_inval_i)
+#define ssp_get_iram_context ESYM(ssp_get_iram_context)
+#define ssp_pm_read ESYM(ssp_pm_read)
+#define ssp_pm_write ESYM(ssp_pm_write)
+#define ssp_translate_block ESYM(ssp_translate_block)
+#define tr_unhandled ESYM(tr_unhandled)
+
@ SSP_GR0, SSP_X, SSP_Y, SSP_A,
@ SSP_ST, SSP_STACK, SSP_PC, SSP_P,
@ SSP_PM0, SSP_PM1, SSP_PM2, SSP_XST,
.endm @ ssp_drc_do_next
-ssp_drc_entry:
+FUNCTION(ssp_drc_entry):
stmfd sp!, {r4-r11, lr}
- mov r11, r0
+ mov r7, r0 @ ssp
+ mov r11, r1
ssp_regfile_load:
- ldr r7, =ssp
- ldr r7, [r7]
add r2, r7, #0x400
add r2, r2, #4
ldmia r2, {r3,r4,r5,r6,r8}
mov r0, r0, lsr #16
-ssp_drc_next:
+FUNCTION(ssp_drc_next):
ssp_drc_do_next 0
-ssp_drc_next_patch:
+FUNCTION(ssp_drc_next_patch):
ssp_drc_do_next 1
ssp_drc_do_patch:
bx r2
-ssp_drc_end:
+FUNCTION(ssp_drc_end):
mov r0, r0, lsl #16
str r0, [r7, #(SSP_OFFS_GR+SSP_PC*4)]
mov r9, r6, lsr #13
and r9, r9, #(7<<16) @ STACK
mov r3, r6, lsl #28
- msr cpsr_flg, r3 @ to to ARM PSR
+ msr cpsr_f, r3 @ to to ARM PSR
and r6, r6, #0x670
mov r6, r6, lsl #12
orrmi r6, r6, #0x80000000 @ N
@ ld A, PM0
@ andi 2
@ bra z=1, gloc_0800
-ssp_hle_800:
+FUNCTION(ssp_hle_800):
ldr r0, [r7, #(SSP_OFFS_GR+SSP_PM0*4)]
ldr r1, [r7, #SSP_OFFS_EMUSTAT]
tst r0, #0x20000
ldrh r0, [r1]
.endm
-ssp_hle_902:
+FUNCTION(ssp_hle_902):
cmp r11, #0
ble ssp_drc_end
bgt ssp_hle_902_loop
tst r12, #1
- ldrneh r0, [r2], #2
- strneh r0, [r3], #2
+ ldrhne r0, [r2], #2
+ strhne r0, [r3], #2
ldr r0, [r7, #SSP_OFFS_IRAM_ROM]
add r1, r7, #0x200
add r8, r8, #(1<<24)
.endm
-ssp_hle_11_12c:
+FUNCTION(ssp_hle_11_12c):
cmp r11, #0
ble ssp_drc_end
b ssp_drc_next
-ssp_hle_11_384:
+FUNCTION(ssp_hle_11_384):
mov r3, #2
b ssp_hle_11_38x
-ssp_hle_11_38a:
+FUNCTION(ssp_hle_11_38a):
mov r3, #3 @ r5
ssp_hle_11_38x:
b ssp_drc_next
-ssp_hle_07_6d6:
+FUNCTION(ssp_hle_07_6d6):
cmp r11, #0
ble ssp_drc_end
b ssp_drc_next
-ssp_hle_07_030:
+FUNCTION(ssp_hle_07_030):
ldrh r0, [r7]
mov r0, r0, lsl #4
orr r0, r0, r0, lsr #16
strh r0, [r7]
sub r11,r11,#3
-ssp_hle_07_036:
+FUNCTION(ssp_hle_07_036):
ldr r1, [r7, #0x1e0] @ F1h F0h
rsb r5, r1, r1, lsr #16
mov r5, r5, lsl #16 @ AL not needed
mov r12, #0x4000
orr r12,r12,#0x0018
subs r12,r3, r12
- subnes r12,r12,#0x0400
+ subsne r12,r12,#0x0400
blne tr_unhandled
orr r2, r2, r2, lsl #16
hle_07_036_no_ovrwr:
tst r1, #2
- strneh r2, [r1], #0x3e @ align
+ strhne r2, [r1], #0x3e @ align
subne r0, r0, #1
subs r0, r0, #4
blt hle_07_036_l2
tst r0, #2
strne r2, [r1], #0x40
tst r0, #1
- strneh r2, [r1], #2
+ strhne r2, [r1], #2
b hle_07_036_end_copy
hle_07_036_ovrwr:
hle_07_036_ol2:
tst r0, #1
- ldrneh r3, [r1]
+ ldrhne r3, [r1]
andne r3, r3, r12
orrne r3, r3, r2
- strneh r3, [r1], #2
+ strhne r3, [r1], #2
hle_07_036_end_copy:
ldr r2, [r7, #SSP_OFFS_DRAM]