add more commands

This commit is contained in:
Peter McGoron 2023-04-02 21:37:28 +00:00
parent c18db4be57
commit 13c67aba9a
4 changed files with 70 additions and 3 deletions

View File

@ -218,9 +218,17 @@ class Instruction(Enum):
CLOOP_WRITE = 17, "_render_default", ArgType.VAL, ArgType.VAL, ArgType.VAL
WF_LOAD = 18, "_render_default", ArgType.VAL, ArgType.DAT
WF_ARM = 19, "_render_default", ArgType.VAL, ArgType.VAL, ArgType.VAL
WF_DISARM = 22, "_render_default", ArgType.VAL
SENDVAL = 20, "_render_default", ArgType.VAL
SENDDAT = 21, "_render_default", ArgType.DAT
WF_DISARM = 22, "_render_default", ArgType.VAL
TAKE_ADC = 23, "_render_default", ArgType.VAL, ArgType.VAL
RELEASE_ADC = 24, "_render_default", ArgType.VAL
TAKE_DAC = 25, "_render_default", ArgType.VAL, ArgType.VAL
RELEASE_DAC = 26, "_render_default", ArgType.VAL
TAKE_WF = 27, "_render_default", ArgType.VAL, ArgType.VAL
RELEASE_WF = 28, "_render_default", ArgType.VAL
TAKE_CLOOP = 29, "_render_default", ArgType.VAL
RELEASE_CLOOP = 30, "_render_default"
def __int__(self):
""" Returns the opcode associated with the Instruction.

View File

@ -65,7 +65,15 @@ static const struct {
defop(WF_EXEC, 3, TYPE_VAL, TYPE_VAL, TYPE_VAL),
defop(SENDVAL, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE),
defop(SENDDAT, 1, TYPE_IMM, TYPE_NONE, TYPE_NONE),
defop(WF_DISARM, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE)
defop(WF_DISARM, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE),
defop(TAKE_ADC, 2, TYPE_VAL, TYPE_VAL, TYPE_NONE),
defop(RELEASE_ADC, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE),
defop(TAKE_DAC, 2, TYPE_VAL, TYPE_VAL, TYPE_NONE),
defop(RELEASE_DAC, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE),
defop(TAKE_WF, 2, TYPE_VAL, TYPE_VAL, TYPE_NONE),
defop(RELEASE_WF, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE),
defop(TAKE_CLOOP, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE),
defop(RELEASE_CLOOP, 0, TYPE_NONE, TYPE_NONE, TYPE_NONE)
};
/*************************************************************************
@ -687,7 +695,7 @@ enum creole_run_ret creole_step(struct creole_env *env, creole_word *sc)
break;
case CREOLE_WF_DISARM:
check(read_val(env, &ins, 0, &a0));
upsilon_arm_waveform(a0);
upsilon_disarm_waveform(a0);
break;
case CREOLE_SENDVAL:
check(read_val(env, &ins, 0, &a0));
@ -697,6 +705,40 @@ enum creole_run_ret creole_step(struct creole_env *env, creole_word *sc)
check(read_val(env, &ins, 0, &a0));
upsilon_senddat(env, a0);
break;
case CREOLE_TAKE_ADC:
check(read_val(env, &ins, 0, &a0));
check(read_val(env, &ins, 0, &a1));
upsilon_take_adc(a0, a1);
break;
case CREOLE_RELEASE_ADC:
check(read_val(env, &ins, 0, &a0));
upsilon_release_adc(a0);
break;
case CREOLE_TAKE_DAC:
check(read_val(env, &ins, 0, &a0));
check(read_val(env, &ins, 0, &a1));
upsilon_take_dac(a0, a1);
break;
case CREOLE_RELEASE_DAC:
check(read_val(env, &ins, 0, &a0));
upsilon_release_dac(a0);
break;
case CREOLE_TAKE_WF:
check(read_val(env, &ins, 0, &a0));
check(read_val(env, &ins, 0, &a1));
upsilon_take_wf(a0, a1);
break;
case CREOLE_RELEASE_WF:
check(read_val(env, &ins, 0, &a0));
upsilon_release_wf(a0);
break;
case CREOLE_TAKE_CLOOP:
check(read_val(env, &ins, 0, &a0));
upsilon_take_cloop(a0);
break;
case CREOLE_RELEASE_CLOOP:
upsilon_release_cloop();
break;
default:
rcode = CREOLE_STEP_UNKNOWN_OPCODE;
}

View File

@ -57,6 +57,14 @@ enum creole_opcode {
CREOLE_SENDVAL = 20,
CREOLE_SENDDAT = 21,
CREOLE_WF_DISARM = 22,
CREOLE_TAKE_ADC = 23,
CREOLE_RELEASE_ADC = 24,
CREOLE_TAKE_DAC = 25,
CREOLE_RELEASE_DAC = 26,
CREOLE_TAKE_WF = 27,
CREOLE_RELEASE_WF = 28,
CREOLE_TAKE_CLOOP = 29,
CREOLE_RELEASE_CLOOP = 30,
CREOLE_OPCODE_LEN
};

View File

@ -30,3 +30,12 @@ creole_word upsilon_arm_waveform(creole_word slot, creole_word dac,
creole_word upsilon_disarm_waveform(creole_word slot);
creole_word upsilon_sendval(creole_word num);
creole_word upsilon_senddat(struct creole_env *env, creole_word db);
creole_word upsilon_take_adc(creole_word slot, creole_word timeout);
creole_word upsilon_release_adc(creole_word slot);
creole_word upsilon_take_dac(creole_word slot, creole_word timeout);
creole_word upsilon_release_dac(creole_word slot);
creole_word upsilon_take_wf(creole_word slot, creole_word timeout);
creole_word upsilon_release_wf(creole_word slot);
creole_word upsilon_take_cloop(creole_word timeout);
creole_word upsilon_release_cloop(void);