uptr s68k_write8_map [0x1000000 >> M68K_MEM_SHIFT];\r
uptr s68k_write16_map[0x1000000 >> M68K_MEM_SHIFT];\r
\r
+#ifndef _ASM_CD_MEMORY_C\r
MAKE_68K_READ8(s68k_read8, s68k_read8_map)\r
MAKE_68K_READ16(s68k_read16, s68k_read16_map)\r
MAKE_68K_READ32(s68k_read32, s68k_read16_map)\r
MAKE_68K_WRITE8(s68k_write8, s68k_write8_map)\r
MAKE_68K_WRITE16(s68k_write16, s68k_write16_map)\r
MAKE_68K_WRITE32(s68k_write32, s68k_write16_map)\r
+#endif\r
\r
// -----------------------------------------------------------------\r
\r
bx lr
m_m68k_read8_r03:
add r1, r1, #0x110000
- push {r1, lr}
+ stmfd sp!, {r1, lr}
bl m68k_comm_check
- pop {r1, lr}
+ ldmfd sp!, {r1, lr}
ldrb r0, [r1, #3]
and r0, r0, #0xc7
bx lr
add r1, r1, #0x110000
movge r0, #0
bxge lr
- add r1, r0
- push {r1, lr}
+ add r1, r1, r0
+ stmfd sp!, {r1, lr}
bl m68k_comm_check
- pop {r1, lr}
+ ldmfd sp!, {r1, lr}
ldrb r0, [r1]
bx lr
bx lr
m_m68k_read16_r02:
add r1, r1, #0x110000
- push {r1, lr}
+ stmfd sp!, {r1, lr}
bl m68k_comm_check
- pop {r1, lr}
+ ldmfd sp!, {r1, lr}
ldrb r2, [r1, #3]
ldrb r0, [r1, #2]
and r2, r2, #0xc7
bxge lr
add r1, r0, r1
- push {r1, lr}
+ stmfd sp!, {r1, lr}
bl m68k_comm_check
- pop {r0, lr}
+ ldmfd sp!, {r0, lr}
ldrh r0, [r0]
mov r1, r0, lsr #8
and r0, r0, #0xff
strb r1, [r2, r0] @ if (a == 0xe) s68k_regs[0xf] = d;
bx lr
+.global s68k_read8
+.global s68k_read16
+.global s68k_write8
+.global s68k_write16
+
+s68k_read8:
+ ldr r3, =s68k_read8_map
+ bic r0, r0, #0xff000000
+ mov r2, r0, lsr #16
+ ldr r3, [r3, r2, lsl #2]
+ eor r2, r0, #1
+ movs r3, r3, lsl #1
+ ldrccb r0, [r3, r2]
+ bxcc lr
+ bx r3
+
+s68k_read16:
+ ldr r3, =s68k_read16_map
+ bic r0, r0, #0xff000000
+ mov r2, r0, lsr #16
+ ldr r3, [r3, r2, lsl #2]
+ bic r0, r0, #1
+ movs r3, r3, lsl #1
+ ldrcch r0, [r3, r0]
+ bxcc lr
+ bx r3
+
+s68k_read32:
+ ldr r3, =s68k_read16_map
+ bic r0, r0, #0xff000000
+ mov r2, r0, lsr #16
+ ldr r3, [r3, r2, lsl #2]
+ bic r0, r0, #1
+ movs r3, r3, lsl #1
+ ldrcch r1, [r3, r0]!
+ ldrcch r0, [r3, #2]
+ orrcc r0, r0, r1, lsl #16
+ bxcc lr
+
+ stmfd sp!, {r0, r3, r4, lr}
+ mov lr, pc
+ bx r3
+ ldmfd sp!, {r1, r3}
+ str r0, [sp]
+ add r0, r1, #2
+ mov lr, pc
+ bx r3
+ ldmfd sp!, {r1, lr}
+ mov r0, r0, lsl #16
+ mov r1, r1, lsl #16
+ orr r0, r1, r0, lsr #16
+ bx lr
+
+s68k_write8:
+ ldr r3, =s68k_write8_map
+ bic r0, r0, #0xff000000
+ mov r2, r0, lsr #16
+ ldr r3, [r3, r2, lsl #2]
+ eor r2, r0, #1
+ movs r3, r3, lsl #1
+ strccb r1, [r3, r2]
+ bxcc lr
+ bx r3
+
+s68k_write16:
+ ldr r3, =s68k_write16_map
+ bic r0, r0, #0xff000000
+ mov r2, r0, lsr #16
+ ldr r3, [r3, r2, lsl #2]
+ bic r0, r0, #1
+ movs r3, r3, lsl #1
+ strcch r1, [r3, r0]
+ bxcc lr
+ bx r3
+
+s68k_write32:
+ ldr r3, =s68k_write16_map
+ bic r0, r0, #0xff000000
+ mov r2, r0, lsr #16
+ ldr r3, [r3, r2, lsl #2]
+ bic r0, r0, #1
+ movs r3, r3, lsl #1
+ movcc r2, r1, lsr #16
+ strcch r2, [r3, r0]!
+ strcch r1, [r3, #2]
+ bxcc lr
+
+ stmfd sp!, {r0, r1, r3, lr}
+ mov r1, r1, lsr #16
+ mov lr, pc
+ bx r3
+ ldmfd sp!, {r0, r1, r3, lr}
+ add r0, r0, #2
+ bx r3
+
.pool
@ vim:filetype=armasm
m68k_write16_map[i] = (addr >> 1) | MAP_FLAG;\r
}\r
\r
+#ifndef _ASM_MEMORY_C\r
MAKE_68K_READ8(m68k_read8, m68k_read8_map)\r
MAKE_68K_READ16(m68k_read16, m68k_read16_map)\r
MAKE_68K_READ32(m68k_read32, m68k_read16_map)\r
MAKE_68K_WRITE8(m68k_write8, m68k_write8_map)\r
MAKE_68K_WRITE16(m68k_write16, m68k_write16_map)\r
MAKE_68K_WRITE32(m68k_write32, m68k_write16_map)\r
+#endif\r
\r
// -----------------------------------------------------------------\r
\r
d = EEPROM_read();\r
if (!(a & 1))\r
d >>= 8;\r
+ d &= 0xff;\r
} else\r
d = *(u8 *)(Pico.sv.data - Pico.sv.start + a);\r
elprintf(EL_SRAMIO, "sram r8 [%06x] %02x @ %06x", a, d, SekPc);\r
ldmfd sp!,{r1,lr}\r
tst r1, #1\r
moveq r0, r0, lsr #8\r
+ and r0, r0, #0xff\r
bx lr\r
\r
\r
strb r2, [r3, #OFS_Pico_m_sram_reg]\r
bx lr\r
\r
+.global m68k_read8\r
+.global m68k_read16\r
+.global m68k_write8\r
+.global m68k_write16\r
+\r
+m68k_read8:\r
+ ldr r3, =m68k_read8_map\r
+ bic r0, r0, #0xff000000\r
+ mov r2, r0, lsr #16\r
+ ldr r3, [r3, r2, lsl #2]\r
+ eor r2, r0, #1\r
+ movs r3, r3, lsl #1\r
+ ldrccb r0, [r3, r2]\r
+ bxcc lr\r
+ bx r3\r
+\r
+m68k_read16:\r
+ ldr r3, =m68k_read16_map\r
+ bic r0, r0, #0xff000000\r
+ mov r2, r0, lsr #16\r
+ ldr r3, [r3, r2, lsl #2]\r
+ bic r0, r0, #1\r
+ movs r3, r3, lsl #1\r
+ ldrcch r0, [r3, r0]\r
+ bxcc lr\r
+ bx r3\r
+\r
+m68k_read32:\r
+ ldr r3, =m68k_read16_map\r
+ bic r0, r0, #0xff000000\r
+ mov r2, r0, lsr #16\r
+ ldr r3, [r3, r2, lsl #2]\r
+ bic r0, r0, #1\r
+ movs r3, r3, lsl #1\r
+ ldrcch r1, [r3, r0]!\r
+ ldrcch r0, [r3, #2]\r
+ orrcc r0, r0, r1, lsl #16\r
+ bxcc lr\r
+\r
+ stmfd sp!, {r0, r3, r4, lr}\r
+ mov lr, pc\r
+ bx r3\r
+ ldmfd sp!, {r1, r3}\r
+ str r0, [sp]\r
+ add r0, r1, #2\r
+ mov lr, pc\r
+ bx r3\r
+ ldmfd sp!, {r1, lr}\r
+ mov r0, r0, lsl #16\r
+ mov r1, r1, lsl #16\r
+ orr r0, r1, r0, lsr #16\r
+ bx lr\r
+\r
+m68k_write8:\r
+ ldr r3, =m68k_write8_map\r
+ bic r0, r0, #0xff000000\r
+ mov r2, r0, lsr #16\r
+ ldr r3, [r3, r2, lsl #2]\r
+ eor r2, r0, #1\r
+ movs r3, r3, lsl #1\r
+ strccb r1, [r3, r2]\r
+ bxcc lr\r
+ bx r3\r
+\r
+m68k_write16:\r
+ ldr r3, =m68k_write16_map\r
+ bic r0, r0, #0xff000000\r
+ mov r2, r0, lsr #16\r
+ ldr r3, [r3, r2, lsl #2]\r
+ bic r0, r0, #1\r
+ movs r3, r3, lsl #1\r
+ strcch r1, [r3, r0]\r
+ bxcc lr\r
+ bx r3\r
+\r
+m68k_write32:\r
+ ldr r3, =m68k_write16_map\r
+ bic r0, r0, #0xff000000\r
+ mov r2, r0, lsr #16\r
+ ldr r3, [r3, r2, lsl #2]\r
+ bic r0, r0, #1\r
+ movs r3, r3, lsl #1\r
+ movcc r2, r1, lsr #16\r
+ strcch r2, [r3, r0]!\r
+ strcch r1, [r3, #2]\r
+ bxcc lr\r
+\r
+ stmfd sp!, {r0, r1, r3, lr}\r
+ mov r1, r1, lsr #16\r
+ mov lr, pc\r
+ bx r3\r
+ ldmfd sp!, {r0, r1, r3, lr}\r
+ add r0, r0, #2\r
+ bx r3\r
+\r
.pool\r
\r
@ vim:filetype=armasm\r