5 * This work is licensed under the terms of MAME license.
6 * See COPYING file in the top-level directory.
9 .equ M68K_MEM_SHIFT, 16
11 .global cyclone_checkpc
12 .global cyclone_fetch8
13 .global cyclone_fetch16
14 .global cyclone_fetch32
16 .global cyclone_read16
17 .global cyclone_read32
18 .global cyclone_write8
19 .global cyclone_write16
20 .global cyclone_write32
22 @ Warning: here we abuse the fact that we are only called
23 @ from Cyclone, and assume that r7 contains context pointer.
25 ldr r1, [r7, #0x60] @ membase
27 bic r0, r0, #0xff000000
31 ldr r1, [r7, #0x6c] @ read16 map
32 mov r2, r0, lsr #M68K_MEM_SHIFT
33 ldr r1, [r1, r2, lsl #2]
37 str r1, [r7, #0x60] @ membase
45 ldr r0, [r7, #0x40] @ reload PC + membase
49 cyclone_read8: @ u32 a
51 bic r0, r0, #0xff000000
52 ldr r1, [r7, #0x68] @ read8 map
53 mov r2, r0, lsr #M68K_MEM_SHIFT
54 ldr r1, [r1, r2, lsl #2]
62 cyclone_read16: @ u32 a
64 bic r0, r0, #0xff000000
65 ldr r1, [r7, #0x6c] @ read16 map
66 mov r2, r0, lsr #M68K_MEM_SHIFT
67 ldr r1, [r1, r2, lsl #2]
75 cyclone_read32: @ u32 a
77 bic r0, r0, #0xff000000
78 ldr r1, [r7, #0x6c] @ read16 map
79 mov r2, r0, lsr #M68K_MEM_SHIFT
80 ldr r1, [r1, r2, lsl #2]
85 orrcc r0, r1, r0, lsl #16
99 orr r0, r1, r0, lsr #16
103 cyclone_write8: @ u32 a, u8 d
104 bic r0, r0, #0xff000000
105 ldr r2, [r7, #0x74] @ write8 map
106 mov r3, r0, lsr #M68K_MEM_SHIFT
107 ldr r2, [r2, r3, lsl #2]
115 cyclone_write16: @ u32 a, u16 d
116 bic r0, r0, #0xff000000
117 ldr r2, [r7, #0x78] @ write16 map
118 mov r3, r0, lsr #M68K_MEM_SHIFT
119 ldr r2, [r2, r3, lsl #2]
127 cyclone_write32: @ u32 a, u32 d
128 bic r0, r0, #0xff000000
129 ldr r2, [r7, #0x78] @ write16 map
130 mov r3, r0, lsr #M68K_MEM_SHIFT
131 ldr r2, [r2, r3, lsl #2]
134 movcc r3, r1, lsr #16
147 @ vim:filetype=armasm