}\r
}\r
\r
+u32 pcd_stopwatch_read(int sub)\r
+{\r
+ // ugh..\r
+ u32 d = sub ? SekCyclesDoneS68k() : pcd_cycles_m68k_to_s68k(SekCyclesDone());\r
+ d = (d - Pico_mcd->m.stopwatch_base_c) / 384;\r
+ return d & 0x0fff;\r
+}\r
+\r
#ifndef _ASM_CD_MEMORY_C\r
static u32 m68k_reg_read16(u32 a)\r
{\r
case 8:\r
d = cdc_host_r();\r
goto end;\r
- case 0xA:\r
+ case 0xa:\r
elprintf(EL_UIO, "m68k FIXME: reserved read");\r
goto end;\r
- case 0xC: // 384 cycle stopwatch timer\r
- // ugh..\r
- d = pcd_cycles_m68k_to_s68k(SekCyclesDone());\r
- d = (d - Pico_mcd->m.stopwatch_base_c) / 384;\r
- d &= 0x0fff;\r
+ case 0xc: // 384 cycle stopwatch timer\r
+ d = pcd_stopwatch_read(0);\r
elprintf(EL_CDREGS, "m68k stopwatch timer read (%04x)", d);\r
goto end;\r
}\r
case 8:\r
d = cdc_host_r();\r
goto end;\r
- case 0xC:\r
- d = SekCyclesDoneS68k() - Pico_mcd->m.stopwatch_base_c;\r
- d /= 384;\r
- d &= 0x0fff;\r
+ case 0xc:\r
+ d = pcd_stopwatch_read(1);\r
elprintf(EL_CDREGS, "s68k stopwatch timer read (%04x)", d);\r
goto end;\r
case 0x30:\r
ldrb r0, [r1, #0x73] @ IRQ vector
bx lr
m_m68k_read8_r07:
+ PIC_LDR(r1, r2, Pico)
+ ldr r1, [r1, #OFS_Pico_rom]
ldrb r0, [r1, #0x72]
bx lr
m_m68k_read8_r08:
mov r0, #0
b cdc_host_r
m_m68k_read8_r0c:
- add r1, r1, #0x110000
- add r1, r1, #0x002200
- ldr r0, [r1, #0x14] @ Pico_mcd->m.timer_stopwatch
- mov r0, r0, lsr #24
+ mov r1, #0
+ bl pcd_stopwatch_read
+ mov r0, r0, lsr #8
bx lr
m_m68k_read8_r0d:
- add r1, r1, #0x110000
- add r1, r1, #0x002200
- ldr r0, [r1, #0x14]
- mov r0, r0, lsr #16
- bx lr
+ mov r1, #0
+ b pcd_stopwatch_read
m_m68k_read8_hi:
cmp r0, #0x30
add r1, r1, #0x110000
m_m68k_read16_m68k_regs:
PIC_LDR(r1, r2, Pico_mcd)
and r0, r0, #0x3e
- ldr r1, [r1, @ Pico.mcd
+ ldr r1, [r1] @ Pico.mcd
cmp r0, #0x0e
PIC_XB(lt ,r0, lsl #1)
b m_m68k_read16_hi
mov r0, r0, lsl #8
bx lr
m_m68k_read16_r06:
+ PIC_LDR(r1, r2, Pico)
+ ldr r1, [r1, #OFS_Pico_rom]
ldrh r0, [r1, #0x72] @ IRQ vector
bx lr
m_m68k_read16_r08:
mov r0, #0
b cdc_host_r
m_m68k_read16_r0c:
- add r1, r1, #0x110000
- add r1, r1, #0x002200
- ldr r0, [r1, #0x14]
- mov r0, r0, lsr #16
- bx lr
+ mov r1, #0
+ b pcd_stopwatch_read
m_m68k_read16_hi:
cmp r0, #0x30
add r1, r1, #0x110000