int ea65_decode(struct ir_remote *remote, ir_code *prep,ir_code *codep,ir_code *postp, int *repeat_flagp, lirc_t *min_remaining_gapp, lirc_t *max_remaining_gapp) { lirc_t d = 0; if (!map_code(remote, prep, codep, postp, 0, 0, CODE_LENGTH, code, 0, 0)) return 0; if (start.tv_sec - last.tv_sec >= 2) { *repeat_flagp = 0; } else { d = (start.tv_sec - last.tv_sec) * 1000000 + start.tv_usec - last.tv_usec; if (d < 960000) { *repeat_flagp = 1; } else { *repeat_flagp = 0; } } *min_remaining_gapp = 0; *max_remaining_gapp = 0; return 1; }
int livedrive_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp, lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp) { lirc_t gap; if (!map_code(remote, prep, codep, postp, 16, pre, 16, code, 0, 0)) return (0); gap = 0; if (start.tv_sec - last.tv_sec >= 2) *repeat_flagp = 0; else { gap = time_elapsed(&last, &start); if (gap < 300000) *repeat_flagp = 1; else *repeat_flagp = 0; } LOGPRINTF(1, "repeat_flag: %d", *repeat_flagp); LOGPRINTF(1, "gap: %lu", (__u32) gap); return (1); }
int hiddev_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp, lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp) { LOGPRINTF(1, "hiddev_decode"); if (!map_code(remote, prep, codep, postp, pre_code_length, pre_code, main_code_length, main_code, 0, 0)) { return (0); } LOGPRINTF(1, "lirc code: 0x%X", *codep); map_gap(remote, &start, &last, 0, repeat_flagp, min_remaining_gapp, max_remaining_gapp); /* override repeat */ switch (repeat_state) { case RPT_NO: *repeat_flagp = 0; break; case RPT_YES: *repeat_flagp = 1; break; default: break; } return 1; }
static int decode(struct ir_remote* remote, struct decode_ctx_t* ctx) { if (!map_code(remote, ctx, 0, 0, 8, code, 0, 0)) return 0; ctx->repeat_flag = repeat_flag; ctx->min_remaining_gap = 0; ctx->max_remaining_gap = 0; return 1; }
int creative_infracd_decode(struct ir_remote *remote, ir_code *prep,ir_code *codep,ir_code *postp, int *repeat_flagp,lirc_t *remaining_gapp) { if(!map_code(remote,prep,codep,postp,16,0x8435,16,code,0,0)) { return 0; } return 1; }
int mp3anywhere_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp, lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp) { if (!map_code(remote, prep, codep, postp, 24, pre, 8, code, 0, 0)) { return (0); } map_gap(remote, &start, &last, signal_length, repeat_flagp, min_remaining_gapp, max_remaining_gapp); return (1); }
static int atwf83_decode(struct ir_remote* remote, struct decode_ctx_t* ctx) { LOGPRINTF(1, "atwf83_decode"); if (!map_code(remote, ctx, 0, 0, main_code_length, main_code, 0, 0)) return 0; map_gap(remote, ctx, &start, &last, 0); /* override repeat */ ctx->repeat_flag = repeat_state; return 1; }
/************************************************************************** * This function is called by the LIRC daemon during the transform of a * received code into an lirc event. * * It gets the global variable code (remote keypress code). * * It returns: * prep Code prefix (zero for this LIRC driver) * codep Code of keypress * postp Trailing code (zero for this LIRC dirver) * repeat_flagp True if the keypress is a repeated keypress * min_remaining_gapp Min extimated time gap remaining before next code * max_remaining_gapp Max extimated time gap remaining before next code **************************************************************************/ int mplay_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp, lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp) { LOGPRINTF(1, "Entering mplay_decode(), code = %u\n", (unsigned int)mplay_local_data.rc_code); if (!map_code(remote, prep, codep, postp, 0, 0, MPLAY_CODE_LENGTH, mplay_local_data.rc_code, 0, 0)) { return (0); } *repeat_flagp = mplay_local_data.repeat_flag; *min_remaining_gapp = 0; *max_remaining_gapp = 0; return 1; }
int silitek_decode(struct ir_remote* remote, struct decode_ctx_t* ctx) { if (!map_code(remote, ctx, 0, 0, 24, code, 0, 0)) return 0; map_gap(remote, ctx, ¤t, &last, 0); if (!do_repeat) ctx->repeat_flag = 0; LOGPRINTF(1, "repeat_flagp: %d", ctx->repeat_flag); return 1; }
int tira_decode (struct ir_remote *remote, ir_code *prep, ir_code *codep, ir_code *postp, int *repeat_flagp, lirc_t *min_remaining_gapp, lirc_t *max_remaining_gapp) { if(!map_code(remote, prep, codep, postp, 0, 0, CODE_LENGTH, code, 0, 0)) { return 0; } map_gap(remote, &start, &last, 0, repeat_flagp, min_remaining_gapp, max_remaining_gapp); return 1; }
int pixelview_decode(struct ir_remote *remote, ir_code *prep,ir_code *codep,ir_code *postp, int *repeat_flagp,lirc_t *remaining_gapp) { #if 0 if(remote->pone!=0 || remote->sone!=833) return(0); if(remote->pzero!=833 || remote->szero!=0) return(0); #endif if(!map_code(remote,prep,codep,postp, 10,pre,20,code,0,0)) { return(0); } gap=0; if(start.tv_sec-last.tv_sec>=2) /* >1 sec */ { *repeat_flagp=0; } else { gap=(start.tv_sec-last.tv_sec)*1000000+ start.tv_usec-last.tv_usec; if(gap<remote->remaining_gap*(100+remote->eps)/100 || gap<=remote->remaining_gap+remote->aeps) *repeat_flagp=1; else *repeat_flagp=0; } *remaining_gapp=is_const(remote) ? (remote->gap>signal_length ? remote->gap-signal_length:0): remote->gap; LOGPRINTF(1,"pre: %llx",(unsigned long long) *prep); LOGPRINTF(1,"code: %llx",(unsigned long long) *codep); LOGPRINTF(1,"repeat_flag: %d",*repeat_flagp); LOGPRINTF(1,"gap: %lu",(unsigned long) gap); LOGPRINTF(1,"rem: %lu",(unsigned long) remote->remaining_gap); LOGPRINTF(1,"signal length: %lu",(unsigned long) signal_length); return(1); }
int pinsys_decode(struct ir_remote *remote, ir_code *prep,ir_code *codep,ir_code *postp, int *repeat_flagp,lirc_t *remaining_gapp) { if(!map_code(remote,prep,codep,postp, 0,0,8,code&(~REPEAT_FLAG),0,0)) { return(0); } gap=0; if(start.tv_sec-last.tv_sec>=2) /* >1 sec */ { *repeat_flagp=0; } else { gap=(start.tv_sec-last.tv_sec)*1000000+ start.tv_usec-last.tv_usec; if(gap<remote->remaining_gap*(100+remote->eps)/100 || gap<=remote->remaining_gap+remote->aeps) *repeat_flagp=1; else *repeat_flagp=0; /* let's believe the remote */ if(code&REPEAT_FLAG) { *repeat_flagp=1; } } *remaining_gapp=is_const(remote) ? (remote->gap>signal_length ? remote->gap-signal_length:0): remote->gap; LOGPRINTF(1,"code: %llx\n",(unsigned long long) *codep); LOGPRINTF(1,"repeat_flag: %d\n",*repeat_flagp); LOGPRINTF(1,"gap: %lu\n",(unsigned long) gap); LOGPRINTF(1,"rem: %lu\n",(unsigned long) remote->remaining_gap); LOGPRINTF(1,"signal length: %lu\n",(unsigned long) signal_length); return(1); }
int silitek_decode(struct ir_remote *remote, ir_code *prep,ir_code *codep,ir_code *postp, int *repeat_flagp, lirc_t *min_remaining_gapp, lirc_t *max_remaining_gapp) { if(!map_code(remote, prep, codep, postp, 0, 0, 24, code, 0, 0)) { return(0); } map_gap(remote, ¤t, &last, 0, repeat_flagp, min_remaining_gapp, max_remaining_gapp); if(!do_repeat) *repeat_flagp = 0; LOGPRINTF(1, "repeat_flagp: %d", *repeat_flagp); return(1); }
int tevii_decode (struct hardware const*, struct ir_remote *remote, ir_code *prep, ir_code *codep, ir_code *postp, int *repeat_flagp, lirc_t *min_remaining_gapp, lirc_t *max_remaining_gapp) { //========== int success; //========== success = 0; success = map_code(remote, prep, codep, postp, 0, 0, CODE_LENGTH, irCode, 0, 0); if(!success) return 0; map_gap(remote, &start, &last, 0, repeat_flagp,min_remaining_gapp, max_remaining_gapp); return 1; }
int pinsys_decode(struct ir_remote* remote, struct decode_ctx_t* ctx) { if (!map_code (remote, ctx, 0, 0, BITS_COUNT, code & REPEAT_FLAG ? code ^ REPEAT_MASK : code, 0, 0)) return 0; map_gap(remote, ctx, &start, &last, signal_length); if (start.tv_sec - last.tv_sec < 2) { /* let's believe the remote */ if (code & REPEAT_FLAG) { ctx->repeat_flag = 1; LOGPRINTF(1, "repeat_flag: %d\n", ctx->repeat_flag); } } return 1; }
int pinsys_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp, lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp) { if (!map_code (remote, prep, codep, postp, 0, 0, BITS_COUNT, code & REPEAT_FLAG ? code ^ REPEAT_MASK : code, 0, 0)) { return (0); } map_gap(remote, &start, &last, signal_length, repeat_flagp, min_remaining_gapp, max_remaining_gapp); if (start.tv_sec - last.tv_sec < 2) { /* let's believe the remote */ if (code & REPEAT_FLAG) { *repeat_flagp = 1; LOGPRINTF(1, "repeat_flag: %d\n", *repeat_flagp); } } return (1); }
static int beholder_decode(struct hardware const*,struct ir_remote *remote, ir_code *prep, ir_code *codep, ir_code *postp, int *repeat_flagp, lirc_t *min_remaining_gapp, lirc_t *max_remaining_gapp) { //========== int success; //========== success = 0; EnterCriticalSection(&criticalSection); success = map_code(remote, prep, codep, postp, 0, 0, CODE_LENGTH, irCode, 0, 0); LeaveCriticalSection(&criticalSection); if(!success) return 0; map_gap(remote, &start, &last, 0, repeat_flagp,min_remaining_gapp, max_remaining_gapp); return 1; }
int mp3anywhere_decode(struct ir_remote *remote, ir_code *prep,ir_code *codep,ir_code *postp, int *repeat_flagp,lirc_t *remaining_gapp) { if(!map_code(remote,prep,codep,postp, 24,pre,8,code,0,0)) { return(0); } gap=0; if(start.tv_sec-last.tv_sec>=2) /* >1 sec */ { *repeat_flagp=0; } else { gap=(start.tv_sec-last.tv_sec)*1000000+ start.tv_usec-last.tv_usec; if(gap<remote->remaining_gap*(100+remote->eps)/100 || gap<=remote->remaining_gap+remote->aeps) *repeat_flagp=1; else *repeat_flagp=0; } *remaining_gapp=is_const(remote) ? (remote->gap>signal_length ? remote->gap-signal_length:0): remote->gap; LOGPRINTF(1,"pre: %llx",(unsigned long long) *prep); LOGPRINTF(1,"code: %llx",(unsigned long long) *codep); LOGPRINTF(1,"repeat_flag: %d",*repeat_flagp); LOGPRINTF(1,"gap: %lu",(unsigned long) gap); LOGPRINTF(1,"rem: %lu",(unsigned long) remote->remaining_gap); LOGPRINTF(1,"signal length: %lu",(unsigned long) signal_length); return(1); }
void Nes_Cpu::reset( void const* unmapped_page ) { check( cpu_state == &cpu_state_ ); cpu_state = &cpu_state_; r.flags = irq_inhibit_mask; r.sp = 0xFF; r.pc = 0; r.a = 0; r.x = 0; r.y = 0; cpu_state_.time = 0; cpu_state_.base = 0; irq_time_ = future_time; end_time_ = future_time; error_count_ = 0; set_code_page( page_count, unmapped_page ); map_code( 0, 0x10000, unmapped_page, page_size ); blargg_verify_byte_order(); }
int caraca_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp, lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp) { if (!map_code(remote, prep, codep, postp, 0, 0, hw_caraca.code_length, code, 0, 0)) { return (0); } gap = 0; if (start.tv_sec - last.tv_sec >= 2) { /* >1 sec */ *repeat_flagp = 0; } else { gap = (start.tv_sec - last.tv_sec) * 1000000 + start.tv_usec - last.tv_usec; if (gap < 120000) *repeat_flagp = 1; else *repeat_flagp = 0; } *min_remaining_gapp = 0; *max_remaining_gapp = 0; LOGPRINTF(1, "code: %llx", (__u64) * codep); return (1); }
int livedrive_decode(struct ir_remote* remote, struct decode_ctx_t* ctx) { lirc_t gap; if (!map_code(remote, ctx, 16, pre, 16, code, 0, 0)) return 0; gap = 0; if (start.tv_sec - last.tv_sec >= 2) { ctx->repeat_flag = 0; } else { gap = time_elapsed(&last, &start); if (gap < 300000) ctx->repeat_flag = 1; else ctx->repeat_flag = 0; } LOGPRINTF(1, "repeat_flag: %d", ctx->repeat_flag); LOGPRINTF(1, "gap: %lu", (__u32)gap); return 1; }
//------------------------------------------------------------------------- // This function is called by the LIRC daemon during the transform of a // received code into an lirc event. // // It gets the global variable code (remote keypress code). // // It returns: // prep Code prefix (zero for this LIRC driver) // codep Code of keypress // postp Trailing code (zero for this LIRC dirver) // repeat_flagp True if the keypress is a repeated keypress // remaining_gapp Extimated time gap remaining before next code? //------------------------------------------------------------------------- int accent_decode (struct ir_remote *remote, ir_code *prep, ir_code *codep, ir_code *postp, int *repeat_flagp, lirc_t *remaining_gapp) { LOGPRINTF(LOG_DEBUG, "Entering accent_decode(), code = %016llx\n", code); LOGPRINTF(LOG_DEBUG, "accent_decode() is calling map_code()"); if (!map_code(remote, prep, codep, postp, 0, 0, ACCENT_CODE_LENGTH, code, 0, 0)) { return(0); } // Check the time gap between the last keypress and this one. if (start.tv_sec - last.tv_sec >= 2) { // Gap of 2 or more seconds: this is not a repeated keypress. *repeat_flagp = 0; gap = 0; } else { // Calculate the time gap in microseconds. gap = (start.tv_sec - last.tv_sec) * 1000000 + (start.tv_usec - last.tv_usec); if(expect_at_most(remote, gap, remote->remaining_gap)) { // The gap is shorter than a standard gap // (with relative or aboslute tolerance): this // is a repeated keypress. *repeat_flagp = 1; } else { // Standard gap: this is a new keypress. *repeat_flagp = 0; } } // Calculate extimated time gap remaining for the next code. if (is_const(remote)) { // The sum (signal_length + gap) is always constant // so the gap is shorter when the code is longer. if (remote->gap > signal_length) { *remaining_gapp = remote->gap - signal_length; } else { *remaining_gapp = 0; } } else { // The gap after the signal is always constant. // This is the case of Kanam Accent serial remote. *remaining_gapp = remote->gap; } LOGPRINTF(LOG_DEBUG, "Exiting accent_decode()"); LOGPRINTF(LOG_DEBUG, "prep: %016llx\n", *prep); LOGPRINTF(LOG_DEBUG, "codep: %016llx\n", *codep); LOGPRINTF(LOG_DEBUG, "postp: %016llx\n", *postp); LOGPRINTF(LOG_DEBUG, "repeat_flagp: %d\n", *repeat_flagp); LOGPRINTF(LOG_DEBUG, "code: %016llx\n", code); LOGPRINTF(LOG_DEBUG, "is_const(remote): %d\n", is_const(remote)); LOGPRINTF(LOG_DEBUG, "remote->gap: %lu\n", (unsigned long) remote->gap); LOGPRINTF(LOG_DEBUG, "remote->remaining_gap: %lu\n", (unsigned long) remote->remaining_gap); LOGPRINTF(LOG_DEBUG, "signal length: %lu\n", (unsigned long) signal_length); LOGPRINTF(LOG_DEBUG, "gap: %lu\n", (unsigned long) gap); LOGPRINTF(LOG_DEBUG, "extim. remaining_gap: %lu\n", (unsigned long) *remaining_gapp); return(1); }