mirror of
https://gitee.com/anod/open_agb_firm.git
synced 2025-05-06 05:44:11 +08:00
修正include的逻辑
This commit is contained in:
parent
b6261d3e81
commit
8834685ee5
@ -10,6 +10,8 @@ typedef instruction_t* CodeLocation;
|
||||
#define CodeAtLocation(p) (*(p))
|
||||
|
||||
#define MAKE_ENT(hole,key) (((key)<<16) | (hole))
|
||||
#define ENT_KEY(id) ((id)>>16)
|
||||
#define ENT_HOLE(id) ((id)&0xffff)
|
||||
#define ROM_LOC ((CodeLocation)0x20000000u)
|
||||
#define GBA_KEYCODE(k) (0x3ff & (~(k)))
|
||||
|
||||
@ -44,8 +46,8 @@ cheat_error_t init_current_cheat( u32 id, u16 len )
|
||||
cheat_error_t put_current_cheat( acl_entryid_t entid )
|
||||
{
|
||||
if( setting.chtId == 0 ) return CCHT_NOT_INIT;
|
||||
u16 index = entid & 0xffff;
|
||||
u16 option = entid >> 16;
|
||||
u16 index = ENT_HOLE(entid);
|
||||
u16 option = ENT_KEY(entid);
|
||||
if( index == 0 ) return CCHT_INVALID;
|
||||
|
||||
if( index <= setting.entLen )
|
||||
@ -80,12 +82,12 @@ cheat_error_t include_current_cheat( acl_entryid_t id )
|
||||
{
|
||||
if( setting.chtId == 0 ) return CCHT_NOT_INIT;
|
||||
|
||||
int index = id & 0xffff;
|
||||
int index = ENT_HOLE(id);
|
||||
if( index == 0 ) return CCHT_OK;
|
||||
else if( index < setting.entLen )
|
||||
{
|
||||
acl_index_t val = setting.entArr[index-1];
|
||||
if( val != 0 ) return CCHT_OK;
|
||||
if( val == ENT_KEY(id) ) return CCHT_OK;
|
||||
else return CCHT_INVALID;
|
||||
}
|
||||
else return CCHT_INVALID;
|
||||
@ -238,10 +240,10 @@ static int rom_search_hookpoint( CodeLocation addr, int addrlen, CodeLocation ho
|
||||
hookpoint[hookpoint_idx++] = pc;
|
||||
|
||||
else
|
||||
if( MASK_PC0(0xffff0000) == 0xe92d0000 &&
|
||||
MASK_PC1(0xffff0fff) == 0xe3a00301 &&
|
||||
MASK_PC2(0xfff00fff) == 0xe5b00200 &&
|
||||
MASK_PC3(0xffff0000) != 0xe59f0000 )
|
||||
if( MASK_PC0(0XFFFF0000) == 0XE92D0000 &&
|
||||
MASK_PC1(0XFFFF0FFF) == 0XE3A00301 &&
|
||||
MASK_PC2(0XFFF00FFF) == 0XE5B00200 &&
|
||||
MASK_PC3(0XFFFF0000) != 0XE59F0000 )
|
||||
hookpoint[hookpoint_idx++] = pc;
|
||||
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user