mirror of
https://gitee.com/anod/open_agb_firm.git
synced 2025-05-06 05:44:11 +08:00
将key_onoff改为边缘检测而非电平检测
This commit is contained in:
parent
6ef29933ac
commit
e0d9d73374
@ -145,25 +145,31 @@ const instruction_t IRQ_WRAPPER_INSTR[] = {
|
||||
const instruction_t KEY_ONOFF_INSTR[] = {
|
||||
0xe3a00301, // mov r0, #67108864 ; 0x4000000
|
||||
0xe5900130, // ldr r0, [r0, #304] ; 0x130
|
||||
0xe1df12b4, // ldrh r1, [pc, #36] ; 0x34
|
||||
0xe1df22b2, // ldrh r2, [pc, #34] ; 0x36
|
||||
0xe1df13bc, // ldrh r1, [pc, #60] ; 0x4c
|
||||
0xe1df23ba, // ldrh r2, [pc, #58] ; 0x4e
|
||||
0xe0000002, // and r0, r0, r2
|
||||
0xe59f201c, // ldr r2, [pc, #28] ; 0x38
|
||||
0xe59f2034, // ldr r2, [pc, #52] ; 0x50
|
||||
0xe5d23000, // ldrb r3, [r2]
|
||||
0xe1500001, // cmp r0, r1
|
||||
0x02233001, // eoreq r3, r3, #1 ; 0x1
|
||||
0x05c23000, // streqb r3, [r2]
|
||||
0x0a000005, // beq 0x3c
|
||||
0xe2131010, // ands r1, r3, #16 ; 0x10
|
||||
0x1203300f, // andne r3, r3, #15 ; 0xf
|
||||
0x15c23000, // strneb r3, [r2]
|
||||
0xe3530000, // cmp r3, #0 ; 0x0
|
||||
0x1a000002, // bne 0x3c
|
||||
0x1a000006, // bne 0x54
|
||||
0xe12fff1e, // bx lr
|
||||
0xe2131010, // ands r1, r3, #16 ; 0x10
|
||||
0x02233011, // eoreq r3, r3, #17 ; 0x11
|
||||
0x05c23000, // streqb r3, [r2]
|
||||
0xeafffff8, // b 0x30
|
||||
0x03ff0000, // mask-data and key-data
|
||||
0 // addr to store on/off flag
|
||||
};
|
||||
|
||||
#define KOO_INSTR_SIZE sizeof(KEY_ONOFF_INSTR)
|
||||
#define KOO_INSTR_LEN (KOO_INSTR_SIZE/sizeof(instruction_t))
|
||||
#define KOO_INSTR_KEYDATA 13
|
||||
#define KOO_INSTR_MEMADDR 14
|
||||
#define KOO_INSTR_KEYDATA 19
|
||||
#define KOO_INSTR_MEMADDR 20
|
||||
|
||||
const instruction_t KEY_ENABLE_INSTR[] = {
|
||||
0xe3a00301, // mov r0, #67108864 ; 0x4000000
|
||||
@ -247,12 +253,12 @@ static int rom_search_hookpoint( CodeLocation addr, int addrlen, CodeLocation ho
|
||||
hookpoint[hookpoint_idx++] = pc;
|
||||
|
||||
else
|
||||
if( MASK_PC0(0xffff0fff) == 0xe3a00640 &&
|
||||
MASK_PC1(0xfff00fff) == 0xe5b00200 &&
|
||||
MASK_PC2(0xfff00000) == 0xe1d00000 &&
|
||||
MASK_PC5(0xffff0000) != 0xe59f0000 &&
|
||||
MASK_PC6(0xffff0000) != 0xe59f0000 &&
|
||||
MASK_PC7(0xffff0000) != 0xe59f0000 )
|
||||
if( MASK_PC0(0XFFFF0FFF) == 0XE3A00640 &&
|
||||
MASK_PC1(0XFFF00FFF) == 0XE5B00200 &&
|
||||
MASK_PC2(0XFFF00000) == 0XE1D00000 &&
|
||||
MASK_PC5(0XFFFF0000) != 0XE59F0000 &&
|
||||
MASK_PC6(0XFFFF0000) != 0XE59F0000 &&
|
||||
MASK_PC7(0XFFFF0000) != 0XE59F0000 )
|
||||
hookpoint[hookpoint_idx++] = pc;
|
||||
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user