MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / inputdevice_handle_inputcode2

Function inputdevice_handle_inputcode2

src/inputdevice.cpp:4792–5375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4790void target_paste_to_keyboard(void);
4791
4792static bool inputdevice_handle_inputcode2(int monid, int code, int state, const TCHAR *s)
4793{
4794 static int swapperslot;
4795 static int tracer_enable;
4796 int newstate;
4797 int onoffstate = state & ~SET_ONOFF_MASK_PRESS;
4798
4799 if (s != NULL && s[0] == 0)
4800 s = NULL;
4801
4802 if (code == 0)
4803 return false;
4804 if (state && needcputrace(code) && can_cpu_tracer() == true && is_cpu_tracer() == false && !input_play && !input_record && !debugging) {
4805 if (set_cpu_tracer (true)) {
4806 tracer_enable = 1;
4807 return true; // wait for next frame
4808 }
4809 }
4810
4811#if 0
4812 if (vpos != 0)
4813 write_log (_T("inputcode=%d but vpos = %d\n"), code, vpos);
4814#endif
4815 if (onoffstate == SET_ONOFF_ON_VALUE)
4816 newstate = 1;
4817 else if (onoffstate == SET_ONOFF_OFF_VALUE)
4818 newstate = 0;
4819 else if (onoffstate == SET_ONOFF_PRESS_VALUE)
4820 newstate = -1;
4821 else if (onoffstate == SET_ONOFF_PRESSREL_VALUE)
4822 newstate = (state & SET_ONOFF_MASK_PRESS) ? 1 : -1;
4823 else if (state)
4824 newstate = -1;
4825 else
4826 newstate = 0;
4827
4828#ifdef ARCADIA
4829 switch (code)
4830 {
4831 case AKS_ARCADIADIAGNOSTICS:
4832 arcadia_flag &= ~1;
4833 arcadia_flag |= state ? 1 : 0;
4834 break;
4835 case AKS_ARCADIAPLY1:
4836 arcadia_flag &= ~4;
4837 arcadia_flag |= state ? 4 : 0;
4838 break;
4839 case AKS_ARCADIAPLY2:
4840 arcadia_flag &= ~2;
4841 arcadia_flag |= state ? 2 : 0;
4842 break;
4843 case AKS_ARCADIACOIN1:
4844 if (state)
4845 arcadia_coin[0]++;
4846 break;
4847 case AKS_ARCADIACOIN2:
4848 if (state)
4849 arcadia_coin[1]++;

Callers 1

Calls 15

needcputraceFunction · 0.85
can_cpu_tracerFunction · 0.85
is_cpu_tracerFunction · 0.85
set_cpu_tracerFunction · 0.85
cubo_functionFunction · 0.85
setsystimeFunction · 0.85
screenshotFunction · 0.85
set_config_changedFunction · 0.85
action_replay_freezeFunction · 0.85
disk_ejectFunction · 0.85
IRQ_forcedFunction · 0.85
pausemodeFunction · 0.85

Tested by

no test coverage detected