diff --git a/source/arm11/filebrowser.c b/source/arm11/filebrowser.c index b7c4aa2..4ad2484 100644 --- a/source/arm11/filebrowser.c +++ b/source/arm11/filebrowser.c @@ -532,7 +532,7 @@ static atp_error_t select_hostkey( atp_callerdata_t data, atp_counter_t index, a { cfg->text = key_name[index]; cfg->value = key_val[index]; - if( cfg->value == key ) + if( index == key ) { cfg->extra_text = '选中'; cfg->extra_text_color = ATP_COLOR_GREEN; @@ -797,7 +797,16 @@ static atp_pageopt_t serve_on_key( atp_callerdata_t data, atp_counter_t index, a if( cur->remix_type == REMIX_TYPE_CHEAT ) keys_count = 1; else if( host > 1 & host != 3 ) // N3DS/N3DSLL/N2DSLL keys_count = 14; - res = atp_select( "选择实机键位(单选)", keys_count, select_hostkey, NULL, (cur->device_keys<<16)|(keys_count&0xffff), 0, 0, &value); + u8 selected = 31; + for( int i=0; i < sizeof(key_val)/sizeof(u16); ++i ) + { + if( key_val[i] == cur->device_keys ) + { + selected = i; + break; + } + } + res = atp_select( "选择实机键位(单选)", keys_count, select_hostkey, NULL, (selected<<16)|(keys_count&0xffff), 0, 0, &value); if( res == ATP_SUCCESS ) { cur->device_keys = value;